]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - contrib/tcsh/configure.in
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.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.59])dnl Minimum Autoconf version required.
12 AC_INIT([tcsh], [6.17.00], [http://bugs.gw.com/])
13 AC_CONFIG_SRCDIR([tc.vers.c])
14 AC_CONFIG_HEADERS([config.h])
15 AC_CONFIG_TESTDIR([.], [.])
16
17 AC_CANONICAL_HOST
18
19 AC_MSG_CHECKING([cached host tuple])
20 if { test x"${ac_cv_host_system_type+set}" = x"set" &&
21      test x"$ac_cv_host_system_type" != x"$host"; }; then
22   AC_MSG_RESULT([different])
23   AC_MSG_ERROR([remove config.cache and re-run configure])
24 else
25   AC_MSG_RESULT(ok)
26 fi
27 ac_cv_host_system_type="$host"
28
29
30 changequote(, )dnl
31
32 case "${host}" in
33
34   ## Alpha (DEC) machines.
35   alpha*-dec-osf* )
36     tcsh_config_file=decosf1
37   ;;
38
39   ## Ultrix
40   *-dec-ultrix* )
41     tcsh_config_file=ultrix
42   ;;
43
44   ## DGUX
45   *-dg-dguxR4* )
46     tcsh_config_file=dgux5.4
47   ;;
48   m88k-dg-dgux5.4R* )
49     tcsh_config_file=dgux5.4
50   ;;
51
52   ## HP/UX
53   *-hp-hpux7* )
54     tcsh_config_file=hpux7
55   ;;
56   *-hp-hpux[89]* )
57     tcsh_config_file=hpux8
58   ;;
59   *-hp-hpux1[0-9]* )
60     tcsh_config_file=hpux11
61   ;;
62
63   ## IBM AIX systems
64   *-ibm-aix*)
65     tcsh_config_file=aix
66   ;;
67
68   ## SX-4
69   sx4-nec-*)
70     CC='cc -h0,ansi,novector,float0'
71     LDFLAGS='-Gsmall'
72     tcsh_config_file=superux8
73   ;;
74
75   ## IBM OS/390 systems
76   *-ibm-os390*)
77     CC='c89'
78     tcsh_config_file=os390
79   ;;
80
81   ## Linux
82   *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
83     tcsh_config_file=linux
84   ;;
85
86   ## Motorola systems
87   m68k-motorola-sysv* )
88     tcsh_config_file=sysV68
89   ;;
90   m88k-motorola-sysv3* )
91     tcsh_config_file=sysV88
92   ;;
93
94   ## NetBSD systems
95   *-*-netbsd*)
96     tcsh_config_file=bsd4.4
97   ;;
98
99   ## FreeBSD systems
100   *-*-freebsd*)
101     tcsh_config_file=bsd4.4
102   ;;
103
104   ## MidnightBSD systems
105   *-*-midnightbsd*)
106     tcsh_config_file=bsd4.4
107   ;;
108   
109   ## DragonFlyBSD systems
110   *-*-dragonfly*)
111     tcsh_config_file=bsd4.4
112   ;;
113
114   ## OpenBSD systems
115   *-*-openbsd*)
116     tcsh_config_file=bsd4.4
117   ;;
118
119   ## BSDI systems
120   *-*-bsdi*)
121     tcsh_config_file=bsd4.4
122   ;;
123
124   ## Mac OS X Server
125   *-*-rhapsody* )
126     tcsh_config_file=bsd4.4
127   ;;
128
129   ## Mac OS X Server
130   *-*-darwin* )
131     tcsh_config_file=bsd4.4
132   ;;
133
134   ## DragonFly systems
135   *-*-dragonfly*)
136     tcsh_config_file=bsd4.4
137   ;;
138
139   ## Silicon Graphics machines
140   *-sgi-iri* )
141     tcsh_config_file=irix
142     case "${host_os}" in
143       irix[34]*) # Irix-3.x - Irix 4.x
144         NON_GNU_DFLAGS='-D__STDC__'
145         LIBS='-lsun -lbsd -lc_s'
146       ;;
147       irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
148         LIBS='-lbsd'
149       ;;
150       irix6.[2-9]*) # Irix 6.2 and later
151         tcsh_config_file=irix62
152       ;;
153     esac
154   ;;
155
156   ## Suns
157   *-sun-sunos3* )
158     tcsh_config_file=sunos35
159   ;;
160   *-sun-sunos4.0* )
161     tcsh_config_file=sunos40
162   ;;
163   *-sun-sunos4.1.[12]* )
164     tcsh_config_file=sunos41
165   ;;
166   *-sun-sunos4.1.[3456]* )
167     tcsh_config_file=sunos413
168   ;;
169   *-*-solaris2.[01] ) # Should handle sparc or x86
170     tcsh_config_file=sol2
171   ;;
172   *-sun-solaris2.2 ) # Sparc only release
173     tcsh_config_file=sol22
174   ;;
175   *-sun-solaris2.3 ) # Sparc only release
176     tcsh_config_file=sol23
177   ;;
178   *-*-solaris2.[45] ) # Should handle sparc, x86 and powerpc
179     tcsh_config_file=sol24
180   ;;
181   *-*-solaris2.* ) # Should handle sparc, x86 and powerpc
182     tcsh_config_file=sol26
183   ;;
184
185   ## Dell SVR4
186   *-dell-sysv4* )
187     tcsh_config_file=sysv4
188     DFLAGS="$DFLAGS -DDELL"
189   ;;
190
191   ## SVR4 (Generic and otherwise)
192   *-*-sysv4* )
193     tcsh_config_file=sysv4
194   ;;
195
196   ## Tektronix systems
197   m68k-tektronix-bsd* )
198     tcsh_config_file=bsd
199     NON_GNU_DFLAGS='-DBSD -DUTek'
200   ;;
201   m88k-tektronix-sysv3* )
202     tcsh_config_file=tekXD88
203   ;;
204
205   ## SCO
206   *-sco3.2v5*) 
207     tcsh_config_file=sco32v5
208   ;;
209   *-sco3.2v4*)
210     tcsh_config_file=sco32v4
211   ;;
212   *-sco3.2v2*)
213     tcsh_config_file=sco32v2
214   ;;
215
216   ## Siemens BS2000 Mainframe
217   bs2000-siemens-*)
218     tcsh_config_file=bs2000
219   ;;
220
221   ## Convex
222   *-convex*)
223     tcsh_config_file=convex
224   ;;
225
226   ## Cray
227   *-cray-unicos*)
228     tcsh_config_file=cray
229   ;;
230
231   ## Red Hat Cygwin
232   *-cygwin)
233     tcsh_config_file=cygwin32
234   ;;
235
236   ## mips-compaq-nonstopux
237   *-*-nonstopux)
238     tcsh_config_file=sysv4
239   ;;
240
241   ## Apollo Domain/OS
242   *-apollo-*)
243     tcsh_config_file=apollo
244   ;;
245
246   ## QNX6
247   *-qnx6*)
248     tcsh_config_file=qnx6
249   ;;
250
251   * )
252   changequote([, ])dnl
253   AC_MSG_ERROR([Tcsh can't guess the configuration file name
254 for `${host}' systems.
255 Check tcsh's `Ported' file for manual configuration instructions.])
256   changequote(, )dnl
257   ;;
258
259 esac
260
261 echo "Tcsh will use configuration file \`$tcsh_config_file'."
262 changequote([, ])dnl
263 cp ${srcdir}/config/${tcsh_config_file} config_p.h
264 AH_BOTTOM(
265 [#include "config_p.h"
266 #include "config_f.h"])
267
268 dnl Checks for programs
269 AC_PROG_CC
270 AC_PROG_CPP
271 AC_PROG_GCC_TRADITIONAL
272
273 if test "x$GCC" != xyes ; then
274   DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
275   CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
276 fi
277
278 dnl Checks for libraries
279 AC_SEARCH_LIBS(crypt, crypt)
280 AC_SEARCH_LIBS(getspnam, sec)
281 AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses)
282 AC_SEARCH_LIBS(gethostbyname, nsl)
283 AC_SEARCH_LIBS(connect, socket)
284 AM_ICONV
285
286 dnl Checks for header files
287 AC_CHECK_HEADERS([auth.h crypt.h inttypes.h shadow.h stdint.h utmp.h utmpx.h])
288 AC_CHECK_HEADERS([wchar.h],
289         [AC_CHECK_SIZEOF([wchar_t], [], [dnl
290 #include <stdio.h>
291 #include <wchar.h>])
292         AC_CHECK_HEADERS([wctype.h])])
293 AC_HEADER_DIRENT
294 AC_HEADER_STAT
295 AC_HEADER_STDC
296
297 dnl Checks for types
298 AC_CHECK_TYPES([long long])
299 AC_TYPE_GETGROUPS
300 AC_TYPE_MODE_T
301 AC_TYPE_SIZE_T
302 AC_TYPE_UID_T
303
304 AC_DEFUN([AC_TYPE_SSIZE_T], [
305 AC_CHECK_TYPE(ssize_t,,
306 AC_DEFINE(ssize_t, int, [Define to `int' not defined in <sys/types.h>.]),
307 [
308 #include <sys/types.h>
309 ])
310 ])
311 AC_TYPE_SSIZE_T
312
313 AC_DEFUN([AC_TYPE_SOCKLEN_T], [
314 AC_CHECK_TYPE(socklen_t,,
315 AC_DEFINE(socklen_t, int, [Define to `int' if neither <sys/types.h> nor <sys/socket.h> define.]),
316 [
317 #include <sys/types.h>
318 #include <sys/socket.h>
319 ])
320 ])
321 AC_TYPE_SOCKLEN_T
322
323
324 dnl Checks for structures
325 AC_CHECK_MEMBERS([struct dirent.d_ino], , ,
326 [#ifdef HAVE_DIRENT_H
327 # include <dirent.h>
328 #else
329 # ifdef HAVE_NDIR_H
330 #  include <ndir.h>
331 # else
332 #  include <sys/dir.h>
333 # endif
334 # define dirent direct
335 #endif])
336 AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv,
337                   struct utmp.ut_xtime], , ,
338 [#include <sys/types.h>
339 #ifdef HAVE_UTMPX_H
340 #include <utmpx.h>
341 #define utmp utmpx
342 #elif defined HAVE_UTMP_H
343 #include <utmp.h>
344 #endif])
345 AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
346 [#include <sys/types.h>
347 #include <sys/socket.h>])
348
349 dnl Checks for compiler characteristics
350 AC_C_CONST
351 AC_C_VOLATILE
352
353 dnl checks for library functions
354 AC_CHECK_DECLS([crypt, environ, gethostname, getpgrp], , ,
355 [#include "config_p.h"
356 AC_INCLUDES_DEFAULT([])
357 #ifdef HAVE_CRYPT_H
358 #include <crypt.h>
359 #endif
360 ])
361 AC_CHECK_FUNC([setlocale], [have_setlocale=yes], [have_setlocale=no])
362 AC_CHECK_FUNCS([catgets dup2 getauthid getcwd gethostname getpwent] dnl
363         [getutent memmove memset nice nl_langinfo sbrk setpgid setpriority] dnl
364         [strerror strstr sysconf wcwidth])
365 AC_FUNC_GETPGRP
366 AC_FUNC_MBRTOWC
367 AC_FUNC_SETPGRP
368 AC_FUNC_STRCOLL
369
370 dnl This is not good enough; we need sockaddr_storage too.
371 dnl See whether we can use IPv6 related functions
372 dnl AC_DEFUN([IPv6_CHECK_FUNC], [
373 dnl changequote(, )dnl
374 dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
375 dnl   -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
376 dnl changequote([, ])dnl
377 dnl AC_CHECK_FUNC($1, [dnl
378 dnl   AC_DEFINE_UNQUOTED($ac_tr_lib)
379 dnl   ac_cv_lib_inet6_$1=no], [dnl
380 dnl   AC_MSG_CHECKING([whether your system has IPv6 directory])
381 dnl   AC_CACHE_VAL(ipv6_cv_dir, [dnl
382 dnl     for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
383 dnl       if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
384 dnl     break
385 dnl       fi
386 dnl     done])dnl
387 dnl   AC_MSG_RESULT($ipv6_cv_dir)
388 dnl   if test $ipv6_cv_dir = no; then
389 dnl     ac_cv_lib_inet6_$1=no
390 dnl   else
391 dnl     if test x$ipv6_libinet6 = x; then
392 dnl       ipv6_libinet6=no
393 dnl       SAVELDFLAGS="$LDFLAGS"
394 dnl       LDFLAGS="-L$ipv6_cv_dir/lib"
395 dnl     fi
396 dnl     AC_CHECK_LIB(inet6, $1, [dnl
397 dnl       AC_DEFINE_UNQUOTED($ac_tr_lib)
398 dnl       if test $ipv6_libinet6 = no; then
399 dnl     ipv6_libinet6=yes
400 dnl     LIBS="$LIBS -linet6"
401 dnl       fi],)dnl
402 dnl     if test $ipv6_libinet6 = no; then
403 dnl       LDFLAGS="$SAVELDFLAGS"
404 dnl     fi
405 dnl   fi])dnl
406 dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
407 dnl then
408 dnl   ipv6_cv_$1=yes
409 dnl   ifelse([$2], , :, [$2])
410 dnl else
411 dnl   ipv6_cv_$1=no
412 dnl   ifelse([$3], , :, [$3])
413 dnl fi])
414 dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
415
416 AC_SUBST(DFLAGS)
417
418 dnl Checks for system services
419 if test "$have_setlocale" != no; then
420   AC_ARG_ENABLE([nls], AS_HELP_STRING([--disable-nls], [Disable NLS support]),
421                 [], [enable_nls=yes])
422   if test "x$enable_nls" != xno; then
423     AC_DEFINE([NLS], [1], [Support NLS.])
424   fi
425 fi
426
427 AC_ARG_WITH(hesiod,
428   [  --with-hesiod=PREFIX    Use Hesiod lookup for ~ expansion],
429   [hesiod="$withval"], [hesiod=no])
430 if test "$hesiod" != no; then
431   HESLIB="-lhesiod"
432   AC_CHECK_FUNC(res_send, :,
433     AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
434   HESDEF=-DHESIOD
435   if test "$hesiod" != yes; then
436     HESDEF="$HESDEF -I$hesiod/include"
437     HESLIB="-L$hesiod/lib $HESLIB"
438   fi
439 fi
440 AC_SUBST(HESDEF)
441 AC_SUBST(HESLIB)
442
443 AC_CONFIG_FILES([Makefile])
444 AC_OUTPUT