]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/tcsh/configure.in
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.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.15.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   ## OpenBSD systems
105   *-*-openbsd*)
106     tcsh_config_file=bsd4.4
107   ;;
108
109   ## BSDI systems
110   *-*-bsdi*)
111     tcsh_config_file=bsd4.4
112   ;;
113
114   ## Mac OS X Server
115   *-*-rhapsody* )
116     tcsh_config_file=bsd4.4
117   ;;
118
119   ## Mac OS X Server
120   *-*-darwin* )
121     tcsh_config_file=bsd4.4
122   ;;
123
124   ## DragonFly systems
125   *-*-dragonfly*)
126     tcsh_config_file=bsd4.4
127   ;;
128
129   ## Silicon Graphics machines
130   *-sgi-iri* )
131     tcsh_config_file=irix
132     case "${host_os}" in
133       irix[34]*) # Irix-3.x - Irix 4.x
134         NON_GNU_DFLAGS='-D__STDC__'
135         LIBS='-lsun -lbsd -lc_s'
136       ;;
137       irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
138         LIBS='-lbsd'
139       ;;
140       irix6.[2-9]*) # Irix 6.2 and later
141         tcsh_config_file=irix62
142       ;;
143     esac
144   ;;
145
146   ## Suns
147   *-sun-sunos3* )
148     tcsh_config_file=sunos35
149   ;;
150   *-sun-sunos4.0* )
151     tcsh_config_file=sunos40
152   ;;
153   *-sun-sunos4.1.[12]* )
154     tcsh_config_file=sunos41
155   ;;
156   *-sun-sunos4.1.[3456]* )
157     tcsh_config_file=sunos413
158   ;;
159   *-*-solaris2.[01] ) # Should handle sparc or x86
160     tcsh_config_file=sol2
161   ;;
162   *-sun-solaris2.2 ) # Sparc only release
163     tcsh_config_file=sol22
164   ;;
165   *-sun-solaris2.3 ) # Sparc only release
166     tcsh_config_file=sol23
167   ;;
168   *-*-solaris2.[45] ) # Should handle sparc, x86 and powerpc
169     tcsh_config_file=sol24
170   ;;
171   *-*-solaris2.* ) # Should handle sparc, x86 and powerpc
172     tcsh_config_file=sol26
173   ;;
174
175   ## Dell SVR4
176   *-dell-sysv4* )
177     tcsh_config_file=sysv4
178     DFLAGS="$DFLAGS -DDELL"
179   ;;
180
181   ## SVR4 (Generic and otherwise)
182   *-*-sysv4* )
183     tcsh_config_file=sysv4
184   ;;
185
186   ## Tektronix systems
187   m68k-tektronix-bsd* )
188     tcsh_config_file=bsd
189     NON_GNU_DFLAGS='-DBSD -DUTek'
190   ;;
191   m88k-tektronix-sysv3* )
192     tcsh_config_file=tekXD88
193   ;;
194
195   ## SCO
196   *-sco3.2v5*) 
197     tcsh_config_file=sco32v5
198   ;;
199   *-sco3.2v4*)
200     tcsh_config_file=sco32v4
201   ;;
202   *-sco3.2v2*)
203     tcsh_config_file=sco32v2
204   ;;
205
206   ## Siemens BS2000 Mainframe
207   bs2000-siemens-*)
208     tcsh_config_file=bs2000
209   ;;
210
211   ## Convex
212   *-convex*)
213     tcsh_config_file=convex
214   ;;
215
216   ## Cray
217   *-cray-unicos*)
218     tcsh_config_file=cray
219   ;;
220
221   ## Red Hat Cygwin
222   *-cygwin)
223     tcsh_config_file=cygwin32
224   ;;
225
226   ## mips-compaq-nonstopux
227   *-*-nonstopux)
228     tcsh_config_file=sysv4
229   ;;
230
231   ## Apollo Domain/OS
232   *-apollo-*)
233     tcsh_config_file=apollo
234   ;;
235
236   * )
237   changequote([, ])dnl
238   AC_MSG_ERROR([Tcsh can't guess the configuration file name
239 for `${host}' systems.
240 Check tcsh's `Ported' file for manual configuration instructions.])
241   changequote(, )dnl
242   ;;
243
244 esac
245
246 echo "Tcsh will use configuration file \`$tcsh_config_file'."
247 changequote([, ])dnl
248 cp ${srcdir}/config/${tcsh_config_file} config_p.h
249 AH_BOTTOM(
250 [#include "config_p.h"
251 #include "config_f.h"])
252
253 dnl Checks for programs
254 AC_PROG_CC
255 AC_PROG_CPP
256 AC_PROG_GCC_TRADITIONAL
257
258 if test "x$GCC" != xyes ; then
259   DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
260   CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
261 fi
262
263 dnl Checks for libraries
264 AC_SEARCH_LIBS(crypt, crypt)
265 AC_SEARCH_LIBS(getspnam, sec)
266 AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses)
267 AC_SEARCH_LIBS(gethostbyname, nsl)
268 AC_SEARCH_LIBS(connect, socket)
269 AM_ICONV
270
271 dnl Checks for header files
272 AC_CHECK_HEADERS([auth.h crypt.h inttypes.h shadow.h stdint.h utmp.h utmpx.h])
273 AC_CHECK_HEADERS([wchar.h],
274         [AC_CHECK_SIZEOF([wchar_t], [], [dnl
275 #include <stdio.h>
276 #include <wchar.h>])
277         AC_CHECK_HEADERS([wctype.h])])
278 AC_HEADER_DIRENT
279 AC_HEADER_STAT
280 AC_HEADER_STDC
281
282 dnl Checks for types
283 AC_CHECK_TYPES([long long])
284 AC_TYPE_GETGROUPS
285 AC_TYPE_MODE_T
286 AC_TYPE_SIZE_T
287 AC_TYPE_UID_T
288
289 AC_DEFUN([AC_TYPE_SSIZE_T], [
290 AC_CHECK_TYPE(ssize_t,,
291 AC_DEFINE(ssize_t, int, [Define to `int' not defined in <sys/types.h>.]),
292 [
293 #include <sys/types.h>
294 ])
295 ])
296 AC_TYPE_SSIZE_T
297
298 AC_DEFUN([AC_TYPE_SOCKLEN_T], [
299 AC_CHECK_TYPE(socklen_t,,
300 AC_DEFINE(socklen_t, int, [Define to `int' if neither <sys/types.h> nor <sys/socket.h> define.]),
301 [
302 #include <sys/types.h>
303 #include <sys/socket.h>
304 ])
305 ])
306 AC_TYPE_SOCKLEN_T
307
308
309 dnl Checks for structures
310 AC_CHECK_MEMBERS([struct dirent.d_ino], , ,
311 [#ifdef HAVE_DIRENT_H
312 # include <dirent.h>
313 #else
314 # ifdef HAVE_NDIR_H
315 #  include <ndir.h>
316 # else
317 #  include <sys/dir.h>
318 # endif
319 # define dirent direct
320 #endif])
321 AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv,
322                   struct utmp.ut_xtime], , ,
323 [#include <sys/types.h>
324 #ifdef HAVE_UTMPX_H
325 #include <utmpx.h>
326 #define utmp utmpx
327 #elif defined HAVE_UTMP_H
328 #include <utmp.h>
329 #endif])
330 AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
331 [#include <sys/types.h>
332 #include <sys/socket.h>])
333
334 dnl Checks for compiler characteristics
335 AC_C_CONST
336 AC_C_VOLATILE
337
338 dnl checks for library functions
339 AC_CHECK_DECLS([crypt, environ, gethostname, getpgrp], , ,
340 [#include "config_p.h"
341 AC_INCLUDES_DEFAULT([])
342 #ifdef HAVE_CRYPT_H
343 #include <crypt.h>
344 #endif
345 ])
346 AC_CHECK_FUNC([setlocale], [have_setlocale=yes], [have_setlocale=no])
347 AC_CHECK_FUNCS([catgets dup2 getauthid getcwd gethostname getpwent] dnl
348         [getutent memmove memset nice nl_langinfo sbrk setpgid setpriority] dnl
349         [strerror strstr sysconf wcwidth])
350 AC_FUNC_GETPGRP
351 AC_FUNC_MBRTOWC
352 AC_FUNC_SETPGRP
353 AC_FUNC_STRCOLL
354
355 dnl This is not good enough; we need sockaddr_storage too.
356 dnl See whether we can use IPv6 related functions
357 dnl AC_DEFUN([IPv6_CHECK_FUNC], [
358 dnl changequote(, )dnl
359 dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
360 dnl   -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
361 dnl changequote([, ])dnl
362 dnl AC_CHECK_FUNC($1, [dnl
363 dnl   AC_DEFINE_UNQUOTED($ac_tr_lib)
364 dnl   ac_cv_lib_inet6_$1=no], [dnl
365 dnl   AC_MSG_CHECKING([whether your system has IPv6 directory])
366 dnl   AC_CACHE_VAL(ipv6_cv_dir, [dnl
367 dnl     for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
368 dnl       if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
369 dnl     break
370 dnl       fi
371 dnl     done])dnl
372 dnl   AC_MSG_RESULT($ipv6_cv_dir)
373 dnl   if test $ipv6_cv_dir = no; then
374 dnl     ac_cv_lib_inet6_$1=no
375 dnl   else
376 dnl     if test x$ipv6_libinet6 = x; then
377 dnl       ipv6_libinet6=no
378 dnl       SAVELDFLAGS="$LDFLAGS"
379 dnl       LDFLAGS="-L$ipv6_cv_dir/lib"
380 dnl     fi
381 dnl     AC_CHECK_LIB(inet6, $1, [dnl
382 dnl       AC_DEFINE_UNQUOTED($ac_tr_lib)
383 dnl       if test $ipv6_libinet6 = no; then
384 dnl     ipv6_libinet6=yes
385 dnl     LIBS="$LIBS -linet6"
386 dnl       fi],)dnl
387 dnl     if test $ipv6_libinet6 = no; then
388 dnl       LDFLAGS="$SAVELDFLAGS"
389 dnl     fi
390 dnl   fi])dnl
391 dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
392 dnl then
393 dnl   ipv6_cv_$1=yes
394 dnl   ifelse([$2], , :, [$2])
395 dnl else
396 dnl   ipv6_cv_$1=no
397 dnl   ifelse([$3], , :, [$3])
398 dnl fi])
399 dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
400
401 AC_SUBST(DFLAGS)
402
403 dnl Checks for system services
404 if test "$have_setlocale" != no; then
405   AC_ARG_ENABLE([nls], AS_HELP_STRING([--disable-nls], [Disable NLS support]),
406                 [], [enable_nls=yes])
407   if test "x$enable_nls" != xno; then
408     AC_DEFINE([NLS], [1], [Support NLS.])
409   fi
410 fi
411
412 AC_ARG_WITH(hesiod,
413   [  --with-hesiod=PREFIX    Use Hesiod lookup for ~ expansion],
414   [hesiod="$withval"], [hesiod=no])
415 if test "$hesiod" != no; then
416   HESLIB="-lhesiod"
417   AC_CHECK_FUNC(res_send, :,
418     AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
419   HESDEF=-DHESIOD
420   if test "$hesiod" != yes; then
421     HESDEF="$HESDEF -I$hesiod/include"
422     HESLIB="-L$hesiod/lib $HESLIB"
423   fi
424 fi
425 AC_SUBST(HESDEF)
426 AC_SUBST(HESLIB)
427
428 AC_CONFIG_FILES([Makefile])
429 AC_OUTPUT