summaryrefslogtreecommitdiff
path: root/src/configure
diff options
context:
space:
mode:
Diffstat (limited to 'src/configure')
-rwxr-xr-xsrc/configure22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/configure b/src/configure
index cad9c57..a1608ef 100755
--- a/src/configure
+++ b/src/configure
@@ -43,9 +43,12 @@ ANYTUN_02_COMPAT=0
PASSPHRASE=1
V4_MAPPED=1
+PREFIX='/usr/local'
+
print_usage() {
echo "configure --help print this"
- echo " --target=<TARGET> build target i.e. Linux"
+ echo " --target=<TARGET> build target i.e. Linux (default: autodetect)"
+ echo " --prefix=<PREFIX> the installation prefix (default: /usr/local)"
echo " --use-ssl-crypto use ssl crypto library instead of libgcrypt"
echo " --disable-crypto disable crypto at all (only NULL cipher)"
echo " --enable-anytun02-compat enable compatiblity mode for anytun 0.2.x and prior"
@@ -60,6 +63,9 @@ do
--target=*)
TARGET=${arg#--target=}
;;
+ --prefix=*)
+ PREFIX=${arg#--prefix=}
+ ;;
--use-ssl-crypto)
CRYPTO_LIB='ssl'
;;
@@ -144,11 +150,25 @@ if [ $V4_MAPPED -eq 0 ]; then
echo "WARNING: disabling V4 mapped addresses, this prevents uanytun from using IPv6 as outer Protocol"
fi
+if [ "x$PREFIX" = "x/usr" ]; then
+ ETCDIR=/etc
+else
+ ETCDIR=$PREFIX/etc
+fi
+
cat >> include.mk <<EOF
+# this file was created automatically
+# do not edit this file directly
+# use ./configure instead
+
TARGET := $TARGET
CC := gcc
CFLAGS := $CFLAGS
LDFLAGS := $LDFLAGS
+
+SBINDIR := $PREFIX/sbin
+MANDIR := $PREFIX/share/man
+ETCDIR := $ETCDIR
EOF
exit 0