tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / network / stacks / AROSTCP / dhcp / configure
blob2d548c8dfe565ea7a97accdf130a358200891a83
1 #!/bin/sh
3 #sysname=$1
5 while [ $# != 0 ]; do
6 if [ x$1 = x--with-nsupdate ]; then
7 echo "nsupdate is always built now."
8 elif [ x$1 = x--print-sysname ]; then
9 print_sysname=yes
10 elif [ x$1 = x--work-dir ]; then
11 workname=$2
12 shift
13 elif [ x$1 = x--dirs ]; then
14 dirs=$2
15 shift
16 elif [ x$1 = x--no-links ]; then
17 nolinks=YES
18 elif [ x$1 = x--copts ]; then
19 copts=$2
20 shift
21 elif [ x$sysname = x ]; then
22 sysname=$1
23 else
24 echo "Unexpected argument: $1"
26 shift
27 done
29 uname=`uname -s`
30 machine=`uname -m`
32 if [ "$sysname" = "" ]; then
33 case $uname in
34 SCO_SV)
35 IFS=":"
36 for foo in $PATH; do
37 if [ x$gcc_path = x ] && [ -x $foo/gcc ]; then
38 gcc_path=$foo/gcc
39 fi
40 done
41 IFS=" "
42 if [ x$gcc_path = x ]; then
43 sysname=sco-cc
44 sysname_print=sco
45 else
46 sysname=sco-gcc
47 sysname_print=sco
50 AIX)
51 sysname=aix;;
52 Darwin)
53 sysname=darwin;;
54 Rhapsody)
55 sysname=rhapsody;;
56 ULTRIX)
57 sysname=ultrix;;
58 BSD/OS)
59 release=`uname -r`
60 minor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'`
61 major=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
63 case $major in
64 [123]) sysname=bsdos ;;
65 *) case $minor in
66 0) sysname=bsdos ;;
67 *) sysname=bsdos-4.1 ;;
68 esac;;
69 esac;;
70 OSF1)
71 if [ $machine = 'alpha' ]; then
72 sysname=alphaosf
73 # OSF1 has libc snprintf/vsnprintf support as of 4.0F. There is
74 # no v4 & v5 portable compile-time way of knowing the system's
75 # version (we can #include a version-identing file, but it is only
76 # present in v5).
78 # So we rely on a system command, 'sizer', and default to
79 # no-snprintf if we can't find it.
80 if [ -x /usr/sbin/sizer ] ; then
81 release=`/usr/sbin/sizer -v | cut -d ' ' -f 4 | cut -c 2-`
82 major=`echo $release | cut -d . -f 1`
83 minor=`echo $release | cut -d . -f 2`
84 incr=`echo $minor | sed 's/[0-9]//g' | tr '[A-Z]' '[0-9]'`
85 minor=`echo $minor | sed 's/[A-Z]//g'`
87 if [ $major -gt 4 -o \
88 $major -eq 4 -a $minor -gt 0 -o \
89 $major -eq 4 -a $minor -eq 0 -a $incr -gt 5 ]; then
90 copts="$copts -DHAVE_SNPRINTF"
93 fi;;
94 Linux)
95 release=`uname -r`
96 minor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'`
97 major=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
99 case $major in
100 1) sysname=linux-1 ;;
101 2) case $minor in
102 0) sysname=linux-2.0 ;;
103 1) sysname=linux-2.1 ;;
104 2) sysname=linux-2.2 ;;
105 *) sysname=linux-2.2 ;;
106 esac;;
107 esac;;
108 SunOS)
109 release=`uname -r`
110 minor=`echo $release |sed -e 's/.*[0-9]*\.\([0-9][0-9]*\).*$/\1/'`
111 major=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
112 IFS=":"
113 for foo in $PATH; do
114 if [ x$gcc_path = x ] && [ -x $foo/gcc ]; then
115 gcc_path=$foo/gcc
117 done
118 IFS=" "
120 case $major in
122 if [ x$gcc_path = x ]; then
123 echo SunOS 4 build will not work without the GNU C Compiler.
124 exit 1
126 sysname=sunos4;;
128 if [ x$gcc_path = x ]; then
129 sysname=sunos5-cc
130 sysname_print=sunos5
131 else
132 sysname=sunos5-gcc
133 sysname_print=sunos5
134 fi;;
135 esac;;
136 NetBSD)
137 sysname=netbsd;;
138 OpenBSD)
139 sysname=openbsd;;
140 FreeBSD)
141 sysname=freebsd;;
142 hpux)
143 IFS=":"
144 for foo in $PATH; do
145 if [ x$gcc_path = x ] && [ -x $foo/gcc ]; then
146 gcc_path=$foo/gcc
148 done
149 IFS=" "
151 if [ x$gcc_path = x ]; then
152 sysname=hpux-cc
153 sysname_print=hpux
154 else
155 sysname=hpux-gcc
156 sysname_print=hpux
157 fi;;
158 HP-UX)
159 IFS=":"
160 for foo in $PATH; do
161 if [ x$gcc_path = x ] && [ -x $foo/gcc ]; then
162 gcc_path=$foo/gcc
164 done
165 IFS=" "
167 if [ x$gcc_path = x ]; then
168 sysname=hpux-cc
169 sysname_print=hpux
170 else
171 sysname=hpux-gcc
172 sysname_print=hpux
173 fi;;
174 QNX)
175 release=`uname -r`
176 major=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
177 case $major in
179 sysname=qnxnto;;
181 sysname=qnx;;
182 esac;;
183 NEXTSTEP)
184 sysname=nextstep;;
185 MorphOS)
186 sysname=morphos;;
187 UnixWare)
188 sysname=uw7;;
189 esac
192 if [ "$sysname" = "" ]; then
193 if [ x$print_sysname = xyes ]; then
194 echo "unknown"
195 else
196 echo "UNIX name: $uname machine: $machine"
197 echo
198 echo "Unknown system. If this is an SCO system running ODT 3.0 or"
199 echo "higher, type \`\`./configure sco''. Otherwise, this is a"
200 echo "configuration that isn't supported or hasn't been tested."
201 echo
202 echo "Supported configurations are:"
203 echo " aix AIX 4.1.5.0"
204 echo " ultrix ULTRIX 4.2A or higher"
205 echo " bsdos BSDI BSD/OS 2.1"
206 echo " alphaosf DEC Alpha OSF/1"
207 echo " linux Linux"
208 echo " sunos4 Sunos 4.1.4 (earlier releases may work)"
209 echo " sunos5-cc Solaris 2.4 or higher with Sun cc"
210 echo " sunos5-gcc Solaris 2.4 or higher with gcc"
211 echo " netbsd NetBSD 1.1 or higher"
212 echo " freebsd FreeBSD"
213 echo " openbsd OpenBSD (i386/alpha)"
214 echo " hpux HP-UX"
215 echo " qnx QNX 4.2 or higher"
216 echo " NEXTSTEP NeXTSTEP"
217 echo " morphos MorphOS"
218 echo " sco SCO Open Server"
219 exit 1;
223 if [ x$print_sysname = xyes ]; then
224 if [ x$sysname_print != x ]; then
225 echo $sysname_print
226 else
227 echo $sysname
229 exit 0
232 if [ x$workname = x ]; then
233 if [ x$sysname_print != x ]; then
234 workname=work.${sysname_print}
235 else
236 workname=work.${sysname}
240 echo "System Type: $sysname"
242 if [ x$major != x ] && [ x$minor != x ]; then
243 majversubst="-e /^##--majver--/,/^##--majver--/s/MajorVersion/$major/"
244 minversubst="-e /^##--minver--/,/^##--minver--/s/MinorVersion/$minor/"
247 if [ ! -d $workname ]; then
248 mkdir $workname
251 if [ x"$dirs" = x ]; then
252 dirs=". client server relay common omapip dhcpctl minires dst"
255 for foo in $dirs; do
256 bar=`basename $foo`
257 if [ ! -d ${workname}/$bar ]; then
258 mkdir ${workname}/$bar
260 (sed $majversubst $minversubst \
261 -e "/^##--${sysname}--/,/^##--${sysname}--/s/^#//" \
262 <Makefile.conf; \
263 cat site.conf; \
264 echo "TOP = `pwd`"; \
265 echo CC_OPTIONS = $copts; \
266 cat $foo/Makefile.dist) \
267 >${workname}/$bar/Makefile
268 done
270 # Make the link tree in which to actually build.
271 if [ x$nolinks = x ]; then
272 make links
275 exit 0