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.
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([.], [.])
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])
27 ac_cv_host_system_type="$host"
34 ## Alpha (DEC) machines.
36 tcsh_config_file=decosf1
41 tcsh_config_file=ultrix
46 tcsh_config_file=dgux5.4
49 tcsh_config_file=dgux5.4
54 tcsh_config_file=hpux7
57 tcsh_config_file=hpux8
60 tcsh_config_file=hpux11
70 CC='cc -h0,ansi,novector,float0'
72 tcsh_config_file=superux8
78 tcsh_config_file=os390
82 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
83 tcsh_config_file=linux
88 tcsh_config_file=sysV68
90 m88k-motorola-sysv3* )
91 tcsh_config_file=sysV88
96 tcsh_config_file=bsd4.4
101 tcsh_config_file=bsd4.4
104 ## MidnightBSD systems
106 tcsh_config_file=bsd4.4
109 ## DragonFlyBSD systems
111 tcsh_config_file=bsd4.4
116 tcsh_config_file=bsd4.4
121 tcsh_config_file=bsd4.4
126 tcsh_config_file=bsd4.4
131 tcsh_config_file=bsd4.4
136 tcsh_config_file=bsd4.4
139 ## Silicon Graphics machines
141 tcsh_config_file=irix
143 irix[34]*) # Irix-3.x - Irix 4.x
144 NON_GNU_DFLAGS='-D__STDC__'
145 LIBS='-lsun -lbsd -lc_s'
147 irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
150 irix6.[2-9]*) # Irix 6.2 and later
151 tcsh_config_file=irix62
158 tcsh_config_file=sunos35
161 tcsh_config_file=sunos40
163 *-sun-sunos4.1.[12]* )
164 tcsh_config_file=sunos41
166 *-sun-sunos4.1.[3456]* )
167 tcsh_config_file=sunos413
169 *-*-solaris2.[01] ) # Should handle sparc or x86
170 tcsh_config_file=sol2
172 *-sun-solaris2.2 ) # Sparc only release
173 tcsh_config_file=sol22
175 *-sun-solaris2.3 ) # Sparc only release
176 tcsh_config_file=sol23
178 *-*-solaris2.[45] ) # Should handle sparc, x86 and powerpc
179 tcsh_config_file=sol24
181 *-*-solaris2.* ) # Should handle sparc, x86 and powerpc
182 tcsh_config_file=sol26
187 tcsh_config_file=sysv4
188 DFLAGS="$DFLAGS -DDELL"
191 ## SVR4 (Generic and otherwise)
193 tcsh_config_file=sysv4
197 m68k-tektronix-bsd* )
199 NON_GNU_DFLAGS='-DBSD -DUTek'
201 m88k-tektronix-sysv3* )
202 tcsh_config_file=tekXD88
207 tcsh_config_file=sco32v5
210 tcsh_config_file=sco32v4
213 tcsh_config_file=sco32v2
216 ## Siemens BS2000 Mainframe
218 tcsh_config_file=bs2000
223 tcsh_config_file=convex
228 tcsh_config_file=cray
233 tcsh_config_file=cygwin32
236 ## mips-compaq-nonstopux
238 tcsh_config_file=sysv4
243 tcsh_config_file=apollo
248 tcsh_config_file=qnx6
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.])
261 echo "Tcsh will use configuration file \`$tcsh_config_file'."
263 cp ${srcdir}/config/${tcsh_config_file} config_p.h
265 [#include "config_p.h"
266 #include "config_f.h"])
268 dnl Checks for programs
271 AC_PROG_GCC_TRADITIONAL
273 if test "x$GCC" != xyes ; then
274 DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
275 CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
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)
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
292 AC_CHECK_HEADERS([wctype.h])])
298 AC_CHECK_TYPES([long long])
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>.]),
308 #include <sys/types.h>
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.]),
317 #include <sys/types.h>
318 #include <sys/socket.h>
324 dnl Checks for structures
325 AC_CHECK_MEMBERS([struct dirent.d_ino], , ,
326 [#ifdef HAVE_DIRENT_H
332 # include <sys/dir.h>
334 # define dirent direct
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>
342 #elif defined HAVE_UTMP_H
345 AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
346 [#include <sys/types.h>
347 #include <sys/socket.h>])
349 dnl Checks for compiler characteristics
353 dnl checks for library functions
354 AC_CHECK_DECLS([crypt, environ, gethostname, getpgrp], , ,
355 [#include "config_p.h"
356 AC_INCLUDES_DEFAULT([])
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])
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
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
391 dnl if test x$ipv6_libinet6 = x; then
393 dnl SAVELDFLAGS="$LDFLAGS"
394 dnl LDFLAGS="-L$ipv6_cv_dir/lib"
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"
402 dnl if test $ipv6_libinet6 = no; then
403 dnl LDFLAGS="$SAVELDFLAGS"
406 dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
409 dnl ifelse([$2], , :, [$2])
412 dnl ifelse([$3], , :, [$3])
414 dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
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.])
428 [ --with-hesiod=PREFIX Use Hesiod lookup for ~ expansion],
429 [hesiod="$withval"], [hesiod=no])
430 if test "$hesiod" != no; then
432 AC_CHECK_FUNC(res_send, :,
433 AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
435 if test "$hesiod" != yes; then
436 HESDEF="$HESDEF -I$hesiod/include"
437 HESLIB="-L$hesiod/lib $HESLIB"
443 AC_CONFIG_FILES([Makefile])