1 dnl Autoconf script for tcsh
2 dnl To rebuild the `configure' script from this, execute the command
4 dnl in the directory containing this script.
6 dnl You'll also need a version of config.guess from a gnu package
8 dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96.
10 dnl $tcsh: configure.in,v 3.99 2012/02/13 16:33:50 christos Exp $
12 AC_PREREQ([2.59])dnl Minimum Autoconf version required.
13 AC_INIT([tcsh], [6.18.01], [http://bugs.gw.com/])
14 AC_CONFIG_MACRO_DIR([m4])
15 AC_CONFIG_SRCDIR([tc.vers.c])
16 AC_CONFIG_HEADERS([config.h])
17 AC_CONFIG_TESTDIR([.], [.])
22 AC_MSG_CHECKING([cached host tuple])
23 if { test x"${ac_cv_host_system_type+set}" = x"set" &&
24 test x"$ac_cv_host_system_type" != x"$host"; }; then
25 AC_MSG_RESULT([different])
26 AC_MSG_ERROR([remove config.cache and re-run configure])
30 ac_cv_host_system_type="$host"
37 ## Alpha (DEC) machines.
39 tcsh_config_file=decosf1
44 tcsh_config_file=ultrix
49 tcsh_config_file=dgux5.4
52 tcsh_config_file=dgux5.4
57 tcsh_config_file=hpux7
60 tcsh_config_file=hpux8
63 tcsh_config_file=hpux11
73 CC='cc -h0,ansi,novector,float0'
75 tcsh_config_file=superux8
81 tcsh_config_file=os390
86 tcsh_config_file=android
90 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
91 tcsh_config_file=linux
96 tcsh_config_file=sysV68
98 m88k-motorola-sysv3* )
99 tcsh_config_file=sysV88
104 tcsh_config_file=bsd4.4
109 tcsh_config_file=bsd4.4
112 ## MidnightBSD systems
114 tcsh_config_file=bsd4.4
117 ## DragonFlyBSD systems
119 tcsh_config_file=bsd4.4
124 tcsh_config_file=bsd4.4
129 tcsh_config_file=bsd4.4
134 tcsh_config_file=bsd4.4
139 tcsh_config_file=bsd4.4
144 tcsh_config_file=bsd4.4
147 ## Silicon Graphics machines
149 tcsh_config_file=irix
151 irix[34]*) # Irix-3.x - Irix 4.x
152 NON_GNU_DFLAGS='-D__STDC__'
153 LIBS='-lsun -lbsd -lc_s'
155 irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
158 irix6.[2-9]*) # Irix 6.2 and later
159 tcsh_config_file=irix62
166 tcsh_config_file=sunos35
169 tcsh_config_file=sunos40
171 *-sun-sunos4.1.[12]* )
172 tcsh_config_file=sunos41
174 *-sun-sunos4.1.[3456]* )
175 tcsh_config_file=sunos413
177 *-*-solaris2.[01] ) # Should handle sparc or x86
178 tcsh_config_file=sol2
180 *-sun-solaris2.2 ) # Sparc only release
181 tcsh_config_file=sol22
183 *-sun-solaris2.3 ) # Sparc only release
184 tcsh_config_file=sol23
186 *-*-solaris2.[45] ) # Should handle sparc, x86 and powerpc
187 tcsh_config_file=sol24
189 *-*-solaris2.[678] ) # Should handle sparc, x86 and powerpc
190 tcsh_config_file=sol26
192 *-*-solaris2.* ) # Should handle sparc, x86 and powerpc
193 tcsh_config_file=sol29
198 tcsh_config_file=sysv4
199 DFLAGS="$DFLAGS -DDELL"
202 ## SVR4 (Generic and otherwise)
204 tcsh_config_file=sysv4
208 m68k-tektronix-bsd* )
210 NON_GNU_DFLAGS='-DBSD -DUTek'
212 m88k-tektronix-sysv3* )
213 tcsh_config_file=tekXD88
218 tcsh_config_file=sco32v5
221 tcsh_config_file=sco32v4
224 tcsh_config_file=sco32v2
227 ## Siemens BS2000 Mainframe
229 tcsh_config_file=bs2000
234 tcsh_config_file=convex
239 tcsh_config_file=cray
244 tcsh_config_file=cygwin
247 ## mips-compaq-nonstopux
249 tcsh_config_file=sysv4
254 tcsh_config_file=apollo
259 tcsh_config_file=qnx6
264 AC_MSG_ERROR([Tcsh can't guess the configuration file name
265 for `${host}' systems.
266 Check tcsh's `Ported' file for manual configuration instructions.])
272 echo "Tcsh will use configuration file \`$tcsh_config_file'."
274 cp ${srcdir}/config/${tcsh_config_file} config_p.h
276 [#include "config_p.h"
277 #include "config_f.h"])
279 dnl Checks for programs
282 AC_PROG_GCC_TRADITIONAL
284 AC_PATH_PROG([GENCAT], [gencat])
286 dnl Require build CC to create gethost helper when cross building
287 if test "x${cross_compiling}" = xyes ; then
290 CC_FOR_GETHOST="\$(CC)"
292 AC_SUBST(CC_FOR_GETHOST)
294 if test "x$GCC" != xyes ; then
295 DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
296 CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
299 dnl Checks for libraries
300 AC_SEARCH_LIBS(crypt, crypt)
301 AC_SEARCH_LIBS(getspnam, sec)
302 AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses)
303 AC_SEARCH_LIBS(gethostbyname, nsl)
304 AC_SEARCH_LIBS(connect, socket)
305 AC_SEARCH_LIBS(catgets, catgets)
308 dnl Checks for header files
309 AC_CHECK_HEADERS([auth.h crypt.h features.h inttypes.h paths.h] dnl
310 [shadow.h stdint.h utmp.h utmpx.h])
311 AC_CHECK_HEADERS([wchar.h],
312 [AC_CHECK_SIZEOF([wchar_t], [], [dnl
315 AC_CHECK_HEADERS([wctype.h])])
321 AC_CHECK_TYPES([long long])
328 AC_DEFUN([AC_TYPE_SSIZE_T], [
329 AC_CHECK_TYPE(ssize_t,,
330 AC_DEFINE(ssize_t, int, [Define to `int' not defined in <sys/types.h>.]),
332 #include <sys/types.h>
337 AC_DEFUN([AC_TYPE_SOCKLEN_T], [
338 AC_CHECK_TYPE(socklen_t,,
339 AC_DEFINE(socklen_t, int, [Define to `int' if neither <sys/types.h> nor <sys/socket.h> define.]),
341 #include <sys/types.h>
342 #include <sys/socket.h>
348 dnl Checks for structures
349 AC_CHECK_MEMBERS([struct dirent.d_ino], , ,
350 [#ifdef HAVE_DIRENT_H
356 # include <sys/dir.h>
358 # define dirent direct
360 AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv,
361 struct utmp.ut_xtime, struct utmpx.ut_host,
362 struct utmpx.ut_user, struct utmpx.ut_tv,
363 struct utmpx.ut_xtime], , ,
364 [#include <sys/types.h>
368 #elif defined HAVE_UTMP_H
371 AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
372 [#include <sys/types.h>
373 #include <sys/socket.h>])
375 dnl Checks for compiler characteristics
379 dnl checks for library functions
380 AC_CHECK_DECLS([crypt, environ, gethostname, getpgrp], , ,
381 [#include "config_p.h"
382 AC_INCLUDES_DEFAULT([])
387 AC_CHECK_FUNC([setlocale], [have_setlocale=yes], [have_setlocale=no])
388 AC_CHECK_FUNC([catgets], [have_catgets=yes], [have_catgets=no])
389 AC_CHECK_FUNCS([dup2 getauthid getcwd gethostname getpwent] dnl
390 [getutent getutxent mallinfo memmove memset mkstemp nice] dnl
391 [nl_langinfo sbrk setpgid setpriority strerror strstr sysconf wcwidth])
394 if test "x${cross_compiling}" != xyes ; then
397 ac_cv_func_setpgrp_void=yes
401 dnl This is not good enough; we need sockaddr_storage too.
402 dnl See whether we can use IPv6 related functions
403 dnl AC_DEFUN([IPv6_CHECK_FUNC], [
404 dnl changequote(, )dnl
405 dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
406 dnl -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
407 dnl changequote([, ])dnl
408 dnl AC_CHECK_FUNC($1, [dnl
409 dnl AC_DEFINE_UNQUOTED($ac_tr_lib)
410 dnl ac_cv_lib_inet6_$1=no], [dnl
411 dnl AC_MSG_CHECKING([whether your system has IPv6 directory])
412 dnl AC_CACHE_VAL(ipv6_cv_dir, [dnl
413 dnl for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
414 dnl if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
418 dnl AC_MSG_RESULT($ipv6_cv_dir)
419 dnl if test $ipv6_cv_dir = no; then
420 dnl ac_cv_lib_inet6_$1=no
422 dnl if test x$ipv6_libinet6 = x; then
424 dnl SAVELDFLAGS="$LDFLAGS"
425 dnl LDFLAGS="-L$ipv6_cv_dir/lib"
427 dnl AC_CHECK_LIB(inet6, $1, [dnl
428 dnl AC_DEFINE_UNQUOTED($ac_tr_lib)
429 dnl if test $ipv6_libinet6 = no; then
430 dnl ipv6_libinet6=yes
431 dnl LIBS="$LIBS -linet6"
433 dnl if test $ipv6_libinet6 = no; then
434 dnl LDFLAGS="$SAVELDFLAGS"
437 dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
440 dnl ifelse([$2], , :, [$2])
443 dnl ifelse([$3], , :, [$3])
445 dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
449 dnl Checks for system services
450 if test "$have_setlocale" != no; then
451 AC_ARG_ENABLE([nls], AS_HELP_STRING([--disable-nls], [Disable NLS support]),
452 [], [enable_nls=yes])
453 if test "x$enable_nls" != xno; then
454 AC_DEFINE([NLS], [1], [Support NLS.])
458 if test "x$enable_nls" != xno -a "$have_catgets" != no -a -n "$GENCAT" ; then
459 AC_ARG_ENABLE([nls-catalogs], AS_HELP_STRING([--disable-nls-catalogs], [Disable NLS catalog support]),
460 [], [enable_nls_catalogs=yes])
461 if test "x$enable_nls_catalogs" != xno; then
463 AC_DEFINE([NLS_CATALOGS], [1], [Support NLS catalogs.])
468 [ --with-hesiod=PREFIX Use Hesiod lookup for ~ expansion],
469 [hesiod="$withval"], [hesiod=no])
470 if test "$hesiod" != no; then
472 AC_CHECK_FUNC(res_send, :,
473 AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
475 if test "$hesiod" != yes; then
476 HESDEF="$HESDEF -I$hesiod/include"
477 HESLIB="-L$hesiod/lib $HESLIB"
482 AC_SUBST(BUILD_CATALOGS)
484 AC_CONFIG_FILES([Makefile nls/Makefile])