Correct my email address.
[mpls-ppp.git] / configure
blob8d2fc58de249c37c222f1737dda52325f6216a2b
1 #!/bin/sh
2 # $Id: configure,v 1.35 2004/11/06 11:36:54 paulus Exp $
4 # Where to install stuff by default
5 DESTDIR=/usr/local
6 SYSCONF=/etc
8 # if [ -d /NextApps ]; then
9 # system="NeXTStep"
10 # else
11 system=`uname -s`
12 release=`uname -r`
13 arch=`uname -m`
14 # fi
15 state="unknown"
17 case $system in
18 Linux)
19 makext="linux";
20 ksrc="linux";
21 state="known";;
22 SunOS)
23 case $release in
24 # [0-3]*) state="ancient";;
25 # 4*) state="known"; ksrc="sunos4"; makext="sunos4";;
26 5.[7-9]*|5.[1-9][0-9]) state="known"; ksrc="solaris"; makext="sol2";
27 case "`/usr/bin/isainfo -k`" in
28 sparcv9) archvariant='-64';;
29 *) ;;
30 esac;;
31 5.[1-6]*) state="known"; ksrc="solaris"; makext="sol2";;
32 esac
33 if [ -x /opt/SUNWspro/bin/cc -a "$1" != "gcc" ] &&
34 /opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
35 : # use Sun WorkShop compiler
36 elif gcc --version >/dev/null 2>&1; then
37 archvariant=gcc$archvariant
38 compiletype=.gcc
39 if [ "$archvariant" = "gcc-64" ]; then
40 ( cd /tmp; touch ppp$$.c
41 gcc -c -m64 ppp$$.c >/dev/null 2>&1 || (
42 echo "gcc is unable to make 64 bit modules, and your $arch system needs them."
43 echo "consider upgrading gcc on this machine, or switching to Sun WorkShop."
44 rm -f ppp$$.c
45 exit 1
46 ) || exit 1
47 rm -f ppp$$.c ppp$$.o
48 ) || exit 1
50 else
51 echo "C compiler not found; hoping for the best."
52 fi;;
53 NetBSD|FreeBSD|ULTRIX|OSF1|NeXTStep|SINIX-?|UNIX_SV|UNIX_System_V)
54 state="notincluded";;
55 # NetBSD)
56 # makext="bsd";
57 # case $release in
58 # 0.*) state="ancient";;
59 # 1.0*) state="ancient";;
60 # 1.1*) state="known"; ksrc="netbsd-1.1";;
61 # 1.2*) state="known"; ksrc="netbsd-1.2"; makext="netbsd-1.2";;
62 # 1.[3-9]*|[2-9]*)
63 # state="late"; ksrc="netbsd-1.2";;
64 # esac;;
65 # ULTRIX)
66 # makext="ultrix";
67 # case $release in
68 # [0-3]*) state="ancient";;
69 # 4.[01]*) state="early"; ksrc="ultrix";;
70 # 4.[234]) state="known"; ksrc="ultrix";;
71 # esac;;
72 # OSF1)
73 # makext="osf";
74 # case $release in
75 # V1.*) state="neolithic"; ksrc="osf1";;
76 # V[23].*) state="neolithic"; ksrc="osf1";;
77 # V4.*) state="known"; ksrc="osf1";;
78 # V[5-9]*) state="late"; ksrc="osf1";;
79 # esac;;
80 # FreeBSD)
81 # makext="bsd";
82 # case $release in
83 # 1.*) state="known"; ksrc="freebsd-old";;
84 # 2.[01]*) state="known"; ksrc="freebsd-2.0";;
85 # 2.2.[2-7]*) state="late"; ksrc="freebsd-2.0";;
86 # 2.2.8*) state="known"; ksrc="freebsd-2.2.8";;
87 # 3.[0-1]*) state="known"; ksrc="freebsd-3.0";;
88 # esac;;
89 # NeXTStep)
90 # makext="NeXT";
91 # ksrc="NeXT";
92 # state="known";;
93 # SINIX-?)
94 # case $release in
95 # 5.4[01]) state=known; ksrc=svr4; makext=svr4;;
96 # 5.4[2-9]) state=late; ksrc=svr4; makext=svr4;;
97 # esac;;
98 # # Intel SVR4 systems come with a bug in the uname program. Unless
99 # # your provider fixed the bug, or you get a fix for it, uname -S will
100 # # overwrite the system name with the node name!
101 # UNIX_SV|UNIX_System_V|`uname -n`)
102 # case $release in
103 # 4.0) state=known; ksrc=svr4; makext=svr4;;
104 # 4.2) state=late; ksrc=svr4; makext=svr4;;
105 # esac;;
106 esac
108 if [ -d "$ksrc" ]; then :; else
109 state="notincluded"
110 unset ksrc
113 case $state in
114 neolithic)
115 echo "This is a newer release on an outdated OS ($system)."
116 echo " This software may or may not work on this OS."
117 echo " You may want to download an older version of PPP for this OS.";;
118 ancient)
119 echo "This is an old release of a supported OS ($system)."
120 echo "This software cannot be used as-is on this system,"
121 echo "but you may be able to port it. Good luck!"
122 exit;;
123 early)
124 echo "This is an old release of a supported OS ($system)."
125 echo "This software should install and run on this system,"
126 echo "but it hasn't been tested.";;
127 late)
128 echo "This is a newer release of $system than is supported by"
129 echo "this software. It may or may not work.";;
130 unknown)
131 echo "This software has not been ported to $system. Sorry.";;
132 notincluded)
133 echo "Support for $system has not been included"
134 echo "in this distribution. Sorry.";;
135 known)
136 echo "Configuring for $system";;
137 esac
139 # Parse arguments
140 while [ $# -gt 0 ]; do
141 arg=$1
142 val=
143 shift
144 case $arg in
145 *=*)
146 val=`expr "x$arg" : 'x[^=]*=\(.*\)'`
147 arg=`expr "x$arg" : 'x\([^=]*\)=.*'`
149 --prefix|--sysconf)
150 if [ $# -eq 0 ]; then
151 echo "error: the $arg argument requires a value" 1>&2
152 exit 1
154 val=$1
155 shift
157 esac
158 case $arg in
159 --prefix) DESTDIR=$val ;;
160 --sysconfdir) SYSCONF=$val ;;
161 esac
162 done
164 mkmkf() {
165 rm -f $2
166 if [ -f $1 ]; then
167 echo " $2 <= $1"
168 sed -e "s,@DESTDIR@,$DESTDIR,g" -e "s,@SYSCONF@,$SYSCONF,g" $1 >$2
172 if [ -d "$ksrc" ]; then
173 echo "Creating Makefiles."
174 mkmkf $ksrc/Makefile.top Makefile
175 mkmkf $ksrc/Makedefs$compiletype Makedefs.com
176 for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/rp-pppoe \
177 pppd/plugins/radius pppd/plugins/pppoatm; do
178 mkmkf $dir/Makefile.$makext $dir/Makefile
179 done
180 if [ "$archvariant" ]; then
181 mkmkf $ksrc/Makefile.$makext$archvariant $ksrc/Makefile
183 else
184 echo "Unable to locate kernel source $ksrc"
185 exit 1