proxychains-ng/configure
2012-01-30 18:35:03 +01:00

76 lines
1.4 KiB
Bash
Executable File

#!/bin/sh
prefix=/usr/local
spliteq() {
arg=$1
echo "${arg#*=}"
#alternatives echo "$arg" | cut -d= -f2-
# or echo "$arg" | sed 's/[^=]*=//'
}
parsearg() {
case "$1" in
--prefix=*) prefix=`spliteq $1`;;
--exec_prefix=*) exec_prefix=`spliteq $1`;;
--bindir=*) bindir=`spliteq $1`;;
--libdir=*) libdir=`spliteq $1`;;
--includedir=*) includedir=`spliteq $1`;;
--sysconfdir=*) sysconfdir=`spliteq $1`;;
esac
}
ismac() {
uname -s | grep Darwin
}
while true ; do
case $1 in
-*) parsearg "$1"; shift;;
*) break ;;
esac
done
if [ -z "$exec_prefix" ] ; then
exec_prefix=$prefix
fi
if [ -z "$libdir" ] ; then
libdir=$prefix/lib
fi
if [ -z "$includedir" ] ; then
includedir=$prefix/include
fi
if [ -z "$sysconfdir" ] ; then
sysconfdir=$prefix/etc
fi
if [ -z "$bindir" ] ; then
bindir=$exec_prefix/bin
fi
if [ -z "$CC" ] ; then
CC=cc
fi
echo CC?=$CC>config.mak
[ -z "$CPPFLAGS" ] || echo CPPFLAGS?=$CPPFLAGS>>config.mak
[ -z "$CFLAGS" ] || echo USER_CFLAGS?=$CFLAGS>>config.mak
echo prefix=$prefix>>config.mak
echo exec_prefix=$exec_prefix>>config.mak
echo bindir=$bindir>>config.mak
echo libdir=$libdir>>config.mak
echo includedir=$includedir>>config.mak
echo sysconfdir=$sysconfdir>>config.mak
if ismac ; then
echo LDSO_SUFFIX=dylib>>config.mak
echo MAC_CFLAGS+=-DIS_MAC=1>>config.mak
echo LD_SET_SONAME=-Wl,-install_name,>>config.mak
echo INSTALL_FLAGS=-m>>config.mak
fi
echo done, now run make \&\& make install