2 # $Id: configure,v 1.38 2008/06/15 07:08:49 paulus Exp $
4 # Where to install stuff by default
23 CFLAGS="-O2 -g -pipe";;
25 karch=`/usr/bin/isainfo -k`
27 5.[7-9]*|5.[1-9][0-9]*) state="known"; ksrc="solaris"; makext="sol2";
29 amd64) archvariant='-64x';;
30 sparcv9) archvariant='-64';;
33 5.[1-6]*) state="known"; ksrc="solaris"; makext="sol2";;
35 if [ "$1" = gcc ]; then
39 if [ "$1" = 32 ]; then
43 if [ -x /opt/SUNWspro/bin/cc -a "$usegcc" != gcc ] &&
44 /opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
45 if [ "$archvariant" = "-64x" ]; then
46 ( cd /tmp; echo "int x;" > ppp$$.c
47 /opt/SUNWspro/bin/cc -c -errwarn -xchip=opteron -m64 ppp$$.c >/dev/null 2>&1 || (
48 echo "WorkShop C is unable to make 64 bit modules, and your $karch system needs"
49 echo "them. Consider upgrading cc on this machine."
56 elif gcc --version >/dev/null 2>&1; then
57 archvariant=gcc$archvariant
59 if [ "$archvariant" = "gcc-64" -o"$archvariant" = "gcc-64x" ]; then
60 ( cd /tmp; touch ppp$$.c
61 gcc -c -m64 ppp$$.c >/dev/null 2>&1 || (
62 echo "gcc is unable to make 64 bit modules, and your $karch system needs them."
63 echo "Consider upgrading gcc on this machine, or switching to Sun WorkShop."
71 echo "C compiler not found; hoping for the best."
73 NetBSD|FreeBSD|ULTRIX|OSF1|NeXTStep|SINIX-?|UNIX_SV|UNIX_System_V)
77 if [ -d "$ksrc" ]; then :; else
84 echo "This software has not been ported to $system. Sorry.";;
86 echo "Support for $system has not been included"
87 echo "in this distribution. Sorry.";;
89 echo "Configuring for $system";;
93 while [ $# -gt 0 ]; do
99 val=`expr "x$arg" : 'x[^=]*=\(.*\)'`
100 arg=`expr "x$arg" : 'x\([^=]*\)=.*'`
103 if [ $# -eq 0 ]; then
104 echo "error: the $arg argument requires a value" 1>&2
112 --prefix) DESTDIR=$val ;;
113 --sysconfdir) SYSCONF=$val ;;
114 --cross_compile) CROSS_COMPILE=$val ;;
116 --cflags) CFLAGS=$val ;;
124 sed -e "s,@DESTDIR@,$DESTDIR,g" -e "s,@SYSCONF@,$SYSCONF,g" \
125 -e "s,@CROSS_COMPILE@,$CROSS_COMPILE,g" -e "s,@CC@,$CC,g" \
126 -e "s,@CFLAGS@,$CFLAGS,g" $1 >$2
130 if [ -d "$ksrc" ]; then
131 echo "Creating Makefiles."
132 mkmkf $ksrc/Makefile.top Makefile
133 mkmkf $ksrc/Makedefs$compiletype Makedefs.com
134 for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/pppoe \
135 pppd/plugins/radius pppd/plugins/pppoatm \
136 pppd/plugins/pppol2tp; do
137 mkmkf $dir/Makefile.$makext $dir/Makefile
139 if [ -f $ksrc/Makefile.$makext$archvariant ]; then
140 mkmkf $ksrc/Makefile.$makext$archvariant $ksrc/Makefile
143 echo "Unable to locate kernel source $ksrc"