s/pxeldr/pxeboot/
[dragonfly.git] / contrib / tcsh / configure.in
1 dnl Autoconf script for tcsh
2 dnl To rebuild the `configure' script from this, execute the command
3 dnl     autoconf
4 dnl in the directory containing this script.
5 dnl
6 dnl You'll also need a version of config.guess from a gnu package
7 dnl
8 dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96.
9 dnl
10
11 AC_PREREQ(2.13)dnl Minimum Autoconf version required.
12 AC_INIT(tc.vers.c)
13
14 AC_CANONICAL_HOST
15
16 dnl We don't use AC_VALIDATE_CACHED_SYSTEM_TUPLE here because we only
17 dnl care about the HOST value, not the HOST/BUILD/TARGET triplet.
18 AC_MSG_CHECKING([cached host tuple])
19 if { test x"${ac_cv_host_system_type+set}" = x"set" &&
20      test x"$ac_cv_host_system_type" != x"$host"; }; then
21   AC_MSG_RESULT([different])
22   AC_MSG_ERROR([remove config.cache and re-run configure])
23 else
24   AC_MSG_RESULT(ok)
25 fi
26 ac_cv_host_system_type="$host"
27
28
29 changequote(, )dnl
30
31 case "${host}" in
32
33   ## Alpha (DEC) machines.
34   alpha*-dec-osf* )
35     tcsh_config_file=decosf1
36   ;;
37
38   ## Ultrix
39   *-dec-ultrix* )
40     tcsh_config_file=ultrix
41   ;;
42
43   ## DGUX
44   *-dg-dguxR4* )
45     tcsh_config_file=dgux5.4
46   ;;
47   m88k-dg-dgux5.4R* )
48     tcsh_config_file=dgux5.4
49   ;;
50
51   ## HP/UX
52   *-hp-hpux7* )
53     tcsh_config_file=hpux7
54   ;;
55   *-hp-hpux[89]* )
56     tcsh_config_file=hpux8
57   ;;
58   *-hp-hpux1[0-9]* )
59     tcsh_config_file=hpux11
60   ;;
61
62   ## IBM AIX systems
63   *-ibm-aix*)
64     tcsh_config_file=aix
65   ;;
66
67   ## SX-4
68   sx4-nec-*)
69     CC='cc -h0,ansi,novector,float0'
70     LDFLAGS='-Gsmall'
71     tcsh_config_file=superux8
72   ;;
73
74   ## IBM OS/390 systems
75   *-ibm-os390*)
76     CC='c89'
77     tcsh_config_file=os390
78   ;;
79
80   ## Linux
81   *-*-linux* )
82     tcsh_config_file=linux
83   ;;
84
85   ## Motorola systems
86   m68k-motorola-sysv* )
87     tcsh_config_file=sysV68
88   ;;
89   m88k-motorola-sysv3* )
90     tcsh_config_file=sysV88
91   ;;
92
93   ## NetBSD systems
94   *-*-netbsd*)
95     tcsh_config_file=bsd4.4
96   ;;
97
98   ## FreeBSD systems
99   *-*-freebsd*)
100     tcsh_config_file=bsd4.4
101   ;;
102
103   ## OpenBSD systems
104   *-*-openbsd*)
105     tcsh_config_file=bsd4.4
106   ;;
107
108   ## BSDI systems
109   *-*-bsdi*)
110     tcsh_config_file=bsd4.4
111   ;;
112
113   ## Mac OS X Server
114   *-*-rhapsody* )
115     tcsh_config_file=bsd4.4
116   ;;
117
118   ## Mac OS X Server
119   *-*-darwin* )
120     tcsh_config_file=bsd4.4
121   ;;
122
123   ## Silicon Graphics machines
124   *-sgi-iri* )
125     tcsh_config_file=irix
126     case "${host_os}" in
127       irix[34]*) # Irix-3.x - Irix 4.x
128         NON_GNU_DFLAGS='-D__STDC__'
129         LIBS='-lsun -lbsd -lc_s'
130       ;;
131       irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
132         LIBS='-lbsd'
133       ;;
134       irix6.[2-9]*) # Irix 6.2 and later
135         tcsh_config_file=irix62
136       ;;
137     esac
138   ;;
139
140   ## Suns
141   *-sun-sunos3* )
142     tcsh_config_file=sunos35
143   ;;
144   *-sun-sunos4.0* )
145     tcsh_config_file=sunos40
146   ;;
147   *-sun-sunos4.1.[12]* )
148     tcsh_config_file=sunos41
149   ;;
150   *-sun-sunos4.1.[3456]* )
151     tcsh_config_file=sunos413
152   ;;
153   *-*-solaris2.[01]* ) # Should handle sparc or x86
154     tcsh_config_file=sol2
155   ;;
156   *-sun-solaris2.2* ) # Sparc only release
157     tcsh_config_file=sol22
158   ;;
159   *-sun-solaris2.3* ) # Sparc only release
160     tcsh_config_file=sol23
161   ;;
162   *-*-solaris2.[45]* ) # Should handle sparc, x86 and powerpc
163     tcsh_config_file=sol24
164   ;;
165   *-*-solaris2.* ) # Should handle sparc, x86 and powerpc
166     tcsh_config_file=sol26
167   ;;
168
169   ## Dell SVR4
170   *-dell-sysv4* )
171     tcsh_config_file=sysv4
172     DFLAGS="$DFLAGS -DDELL"
173   ;;
174
175   ## SVR4 (Generic and otherwise)
176   *-*-sysv4* )
177     tcsh_config_file=sysv4
178   ;;
179
180   ## Tektronix systems
181   m68k-tektronix-bsd* )
182     tcsh_config_file=bsd
183     NON_GNU_DFLAGS='-DBSD -DUTek'
184   ;;
185   m88k-tektronix-sysv3* )
186     tcsh_config_file=tekXD88
187   ;;
188
189   ## SCO
190   *-sco3.2v5*) 
191     tcsh_config_file=sco32v5
192   ;;
193   *-sco3.2v4*)
194     tcsh_config_file=sco32v4
195   ;;
196   *-sco3.2v2*)
197     tcsh_config_file=sco32v2
198   ;;
199
200   ## Siemens BS2000 Mainframe
201   bs2000-siemens-posix)
202     tcsh_config_file=bs2000
203   ;;
204
205   ## Convex
206   *-convex*)
207     tcsh_config_file=convex
208   ;;
209
210   ## Cray
211   *-cray-unicos*)
212     tcsh_config_file=cray
213   ;;
214
215   ## Cygnus GNU Win32
216   *-cygwin)
217     tcsh_config_file=cygwin32
218   ;;
219
220   ## mips-compaq-nonstopux
221   *-*-nonstopux)
222     tcsh_config_file=sysv4
223   ;;
224
225   ## Apollo Domain/OS
226   *-apollo-*)
227     tcsh_config_file=apollo
228   ;;
229
230   * )
231   changequote([, ])dnl
232   AC_MSG_ERROR([Tcsh can't guess the configuration file name
233 for \`${host}' systems.
234 Check tcsh's \`Ported' file for manual configuration instructions.])
235   changequote(, )dnl
236   ;;
237
238 esac
239
240 echo "Tcsh will use configuration file \`$tcsh_config_file'."
241 changequote([, ])dnl
242
243 AC_CONFIG_HEADER(config.h:config/${tcsh_config_file}:config.h.in)
244 AC_PROG_CC
245 AC_PROG_CPP
246 AC_PROG_GCC_TRADITIONAL
247
248 if test $ac_cv_prog_gcc = no ; then
249   DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
250   CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
251 fi
252
253 case "${host}" in
254   ## Cygnus GNU Win32
255   *-cygwin)
256     CFLAGS="$CFLAGS -mno-win32"
257   ;;
258 esac
259
260 AC_SEARCH_LIBS(crypt, crypt)
261 AC_SEARCH_LIBS(tgetent, termlib curses termcap)
262 AC_SEARCH_LIBS(gethostbyname, nsl)
263 AC_SEARCH_LIBS(connect, socket)
264
265 dnl This is not good enough; we need sockaddr_storage too.
266 dnl See whether we can use IPv6 related functions
267 dnl AC_DEFUN(IPv6_CHECK_FUNC, [
268 dnl changequote(, )dnl
269 dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
270 dnl   -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
271 dnl changequote([, ])dnl
272 dnl AC_CHECK_FUNC($1, [dnl
273 dnl   AC_DEFINE_UNQUOTED($ac_tr_lib)
274 dnl   ac_cv_lib_inet6_$1=no], [dnl
275 dnl   AC_MSG_CHECKING([whether your system has IPv6 directory])
276 dnl   AC_CACHE_VAL(ipv6_cv_dir, [dnl
277 dnl     for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
278 dnl       if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
279 dnl     break
280 dnl       fi
281 dnl     done])dnl
282 dnl   AC_MSG_RESULT($ipv6_cv_dir)
283 dnl   if test $ipv6_cv_dir = no; then
284 dnl     ac_cv_lib_inet6_$1=no
285 dnl   else
286 dnl     if test x$ipv6_libinet6 = x; then
287 dnl       ipv6_libinet6=no
288 dnl       SAVELDFLAGS="$LDFLAGS"
289 dnl       LDFLAGS="-L$ipv6_cv_dir/lib"
290 dnl     fi
291 dnl     AC_CHECK_LIB(inet6, $1, [dnl
292 dnl       AC_DEFINE_UNQUOTED($ac_tr_lib)
293 dnl       if test $ipv6_libinet6 = no; then
294 dnl     ipv6_libinet6=yes
295 dnl     LIBS="$LIBS -linet6"
296 dnl       fi],)dnl
297 dnl     if test $ipv6_libinet6 = no; then
298 dnl       LDFLAGS="$SAVELDFLAGS"
299 dnl     fi
300 dnl   fi])dnl
301 dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
302 dnl then
303 dnl   ipv6_cv_$1=yes
304 dnl   ifelse([$2], , :, [$2])
305 dnl else
306 dnl   ipv6_cv_$1=no
307 dnl   ifelse([$3], , :, [$3])
308 dnl fi])
309 dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
310
311 AC_CACHE_CHECK([ss_family in sockaddr_storage], ac_cv_ss_family,
312 [AC_TRY_COMPILE([#include <sys/types.h>
313 #include <sys/socket.h>], [struct sockaddr_storage ss; ss.ss_family;],
314   ac_cv_ss_family=yes, ac_cv_ss_family=no)]
315 if test "$ac_cv_ss_family" = no; then
316   DFLAGS="$DFLAGS -DNO_SS_FAMILY"
317 fi
318 )
319
320 AC_SUBST(DFLAGS)
321
322 AC_ARG_WITH(hesiod,
323   [  --with-hesiod=PREFIX    Use Hesiod lookup for ~ expansion],
324   [hesiod="$withval"], [hesiod=no])
325 if test "$hesiod" != no; then
326   HESLIB="-lhesiod"
327   AC_CHECK_FUNC(res_send, :,
328     AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
329   HESDEF=-DHESIOD
330   if test "$hesiod" != yes; then
331     HESDEF="$HESDEF -I$hesiod/include"
332     HESLIB="-L$hesiod/lib $HESLIB"
333   fi
334 fi
335 AC_SUBST(HESDEF)
336 AC_SUBST(HESLIB)
337
338 AC_OUTPUT(Makefile)