-
Notifications
You must be signed in to change notification settings - Fork 325
/
configure
executable file
·49 lines (40 loc) · 1.03 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
set -e -u
prefix="/opt/api-umbrella"
source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
build_dir="$(pwd)"
usage() {
cat <<EOS
Usage: ./configure [OPTION]...
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$prefix]
EOS
exit 0
}
while [ $# -gt 0 ]; do
key="$1"
case $key in
--prefix=*)
prefix="${key#*=}"
shift
;;
--help|-h)
usage
;;
*)
echo "configure: error: unrecognized option: '$key'"
echo "Try './configure --help' for more information"
exit 1
;;
esac
done
if [ -z "$prefix" ]; then
echo "configure: error: missing argument to --prefix"
exit 1
fi
echo "configure: creating Makefile"
< "$source_dir/Makefile.in" sed -e "s|@prefix@|$prefix|g" | sed -e "s|@source_dir@|$source_dir|g" | sed -e "s|@build_dir@|$build_dir|g" > Makefile