~ach/hermes

hermes/configure -rwxr-xr-x 916 bytes
b2599991Andrew Chambers Add pkg_tree builtin. 3 years ago
                                                                                
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
#!/bin/sh

set -eu

fail() {
	echo "$0: $*" >&2
	exit 1
}

PREFIX="/usr/local"
CC="${CC:-cc}"
CFLAGS="${CFLAGS:--O3}"
LDFLAGS="${LDFLAGS:--static}"
HERMES_GO_EXTRA_BUILD_FLAGS=""

for arg ; do
	case "$arg" in
	--prefix=*) PREFIX=$(echo ${arg#*=}) ;;
	CC=*) CC=${arg#*=} ;;
	CFLAGS=*) CFLAGS=${arg#*=} ;;
	LDFLAGS=*) LDFLAGS=${arg#*=} ;;
	HERMES_GO_EXTRA_BUILD_FLAGS=*) HERMES_GO_EXTRA_BUILD_FLAGS=${arg#*=} ;;
	*) fail "unknown option '$arg'"
	esac
done

printf "export PREFIX=%q\n" "$PREFIX" > config.inc
printf "export CC=%q\n" "$CC" >> config.inc 
printf "export CFLAGS=%q\n" "$CFLAGS" >> config.inc 
printf "export LDFLAGS=%q\n" "$LDFLAGS" >> config.inc 
printf "export HERMES_GO_EXTRA_BUILD_FLAGS=%q\n" "$HERMES_GO_EXTRA_BUILD_FLAGS" >> config.inc 

echo "--- config.inc ---"
cat config.inc
echo "------------------"

echo "run 'make install' to install hermes."
echo "run 'make uninstall' to uninstall hermes."