From 33587eb6c9856661c8de0e54315e94e81910274a Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 8 Nov 2009 02:22:58 +0000 Subject: small configure improvement --- src/configure | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/configure b/src/configure index e5954fd..5ba351a 100755 --- a/src/configure +++ b/src/configure @@ -44,6 +44,9 @@ PASSPHRASE=1 V4_MAPPED=1 PREFIX='/usr/local' +SBINDIR='' +ETCDIR='' +MANDIR='' USERNAME='uanytun' USERHOME='/var/run/uanytun' @@ -51,6 +54,9 @@ print_usage() { echo "configure --help print this" echo " --target= build target i.e. Linux (default: autodetect)" echo " --prefix= the installation prefix (default: /usr/local)" + echo " --sbindir= the path to the sbin directory (default: $PREFIX/sbin)" + echo " --sysconfdir= the path to the system configuration directory (default: $PREFIX/etc" + echo " --mandir= the path to the system man pages (default: $PREFIX/share/man)" echo " --username= create this user when installing (default: uanytun)" echo " --userhome= the home directory of the user to be created (default: /var/run/uanytun)" echo " --use-ssl-crypto use ssl crypto library instead of libgcrypt" @@ -71,6 +77,15 @@ do --prefix=*) PREFIX=${arg#--prefix=} ;; + --sbindir=*) + SBINDIR=${arg#--sbindir=} + ;; + --sysconfdir=*) + ETCDIR=${arg#--sysconfdir=} + ;; + --mandir=*) + MANDIR=${arg#--mandir=} + ;; --username=*) USERNAME=${arg#--username=} ;; @@ -158,12 +173,18 @@ if [ $V4_MAPPED -eq 0 ]; then echo "WARNING: disabling V4 mapped addresses, this prevents uanytun from using IPv6 and IPv4 Sockets at the same time" fi -if [ "x$PREFIX" = "x/usr" ]; then - ETCDIR=/etc -else +if [ -z "$SBINDIR" ]; then + SBINDIR=$PREFIX/sbin +fi + +if [ -z "$ETCDIR" ]; then ETCDIR=$PREFIX/etc fi +if [ -z "$MANDIR" ]; then + MANDIR=$PREFIX/share/man +fi + cat >> include.mk <