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.
13 AC_CONFIG_SRCDIR([tc.vers.c])
14 AC_CONFIG_HEADERS([config.h])
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])
26 ac_cv_host_system_type="$host"
33 ## Alpha (DEC) machines.
35 tcsh_config_file=decosf1
40 tcsh_config_file=ultrix
45 tcsh_config_file=dgux5.4
48 tcsh_config_file=dgux5.4
53 tcsh_config_file=hpux7
56 tcsh_config_file=hpux8
59 tcsh_config_file=hpux11
69 CC='cc -h0,ansi,novector,float0'
71 tcsh_config_file=superux8
77 tcsh_config_file=os390
81 *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
82 tcsh_config_file=linux
87 tcsh_config_file=sysV68
89 m88k-motorola-sysv3* )
90 tcsh_config_file=sysV88
95 tcsh_config_file=bsd4.4
100 tcsh_config_file=bsd4.4
105 tcsh_config_file=bsd4.4
110 tcsh_config_file=bsd4.4
115 tcsh_config_file=bsd4.4
120 tcsh_config_file=bsd4.4
123 ## Silicon Graphics machines
125 tcsh_config_file=irix
127 irix[34]*) # Irix-3.x - Irix 4.x
128 NON_GNU_DFLAGS='-D__STDC__'
129 LIBS='-lsun -lbsd -lc_s'
131 irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
134 irix6.[2-9]*) # Irix 6.2 and later
135 tcsh_config_file=irix62
142 tcsh_config_file=sunos35
145 tcsh_config_file=sunos40
147 *-sun-sunos4.1.[12]* )
148 tcsh_config_file=sunos41
150 *-sun-sunos4.1.[3456]* )
151 tcsh_config_file=sunos413
153 *-*-solaris2.[01]* ) # Should handle sparc or x86
154 tcsh_config_file=sol2
156 *-sun-solaris2.2* ) # Sparc only release
157 tcsh_config_file=sol22
159 *-sun-solaris2.3* ) # Sparc only release
160 tcsh_config_file=sol23
162 *-*-solaris2.[45]* ) # Should handle sparc, x86 and powerpc
163 tcsh_config_file=sol24
165 *-*-solaris2.* ) # Should handle sparc, x86 and powerpc
166 tcsh_config_file=sol26
171 tcsh_config_file=sysv4
172 DFLAGS="$DFLAGS -DDELL"
175 ## SVR4 (Generic and otherwise)
177 tcsh_config_file=sysv4
181 m68k-tektronix-bsd* )
183 NON_GNU_DFLAGS='-DBSD -DUTek'
185 m88k-tektronix-sysv3* )
186 tcsh_config_file=tekXD88
191 tcsh_config_file=sco32v5
194 tcsh_config_file=sco32v4
197 tcsh_config_file=sco32v2
200 ## Siemens BS2000 Mainframe
202 tcsh_config_file=bs2000
207 tcsh_config_file=convex
212 tcsh_config_file=cray
217 tcsh_config_file=cygwin32
220 ## mips-compaq-nonstopux
222 tcsh_config_file=sysv4
227 tcsh_config_file=apollo
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.])
240 echo "Tcsh will use configuration file \`$tcsh_config_file'."
242 cp ${srcdir}/config/${tcsh_config_file} config_p.h
244 [#include "config_p.h"
245 #include "config_f.h"])
247 dnl Checks for programs
250 AC_PROG_GCC_TRADITIONAL
252 if test "x$GCC" != xyes ; then
253 DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
254 CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
257 dnl Checks for libraries
258 AC_SEARCH_LIBS(crypt, crypt)
259 AC_SEARCH_LIBS(getspnam, sec)
260 AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses)
261 AC_SEARCH_LIBS(gethostbyname, nsl)
262 AC_SEARCH_LIBS(connect, socket)
263 AC_SEARCH_LIBS([iconv], [iconv], [AC_DEFINE([HAVE_ICONV], [1],
264 [Define to 1 if you have the iconv () interface])])
266 dnl Checks for header files
267 AC_CHECK_HEADERS([auth.h inttypes.h shadow.h stdint.h])
268 AC_CHECK_HEADERS([utmpx.h utmp.h])
269 AC_CHECK_HEADERS([wchar.h],
270 [AC_CHECK_SIZEOF([wchar_t], [], [dnl
273 AC_CHECK_HEADERS([wctype.h])])
279 AC_CHECK_TYPES([long long])
286 AC_DEFUN([AC_TYPE_SOCKLEN_T], [
287 AC_CHECK_TYPE(socklen_t,,
288 AC_DEFINE(socklen_t, int, [Define to `int' if neither <sys/types.h> nor <sys/socket.h> define.]),
290 #include <sys/types.h>
291 #include <sys/socket.h>
297 dnl Checks for structures
298 AC_CHECK_MEMBERS([struct dirent.d_ino], , ,
299 [#ifdef HAVE_DIRENT_H
305 # include <sys/dir.h>
307 # define dirent direct
309 AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv,
310 struct utmp.ut_xtime], , ,
314 #elif defined HAVE_UTMP_H
317 AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
318 [#include <sys/types.h>
319 #include <sys/socket.h>])
321 dnl Checks for compiler characteristics
326 dnl checks for library functions
327 AC_CHECK_DECLS([gethostname])
328 AC_CHECK_FUNCS([dup2 getcwd gethostname getpwent getutent memmove memset] dnl
329 [nice nl_langinfo sbrk setpgid setpriority strerror strstr sysconf] dnl
334 dnl This is not good enough; we need sockaddr_storage too.
335 dnl See whether we can use IPv6 related functions
336 dnl AC_DEFUN([IPv6_CHECK_FUNC], [
337 dnl changequote(, )dnl
338 dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
339 dnl -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
340 dnl changequote([, ])dnl
341 dnl AC_CHECK_FUNC($1, [dnl
342 dnl AC_DEFINE_UNQUOTED($ac_tr_lib)
343 dnl ac_cv_lib_inet6_$1=no], [dnl
344 dnl AC_MSG_CHECKING([whether your system has IPv6 directory])
345 dnl AC_CACHE_VAL(ipv6_cv_dir, [dnl
346 dnl for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
347 dnl if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
351 dnl AC_MSG_RESULT($ipv6_cv_dir)
352 dnl if test $ipv6_cv_dir = no; then
353 dnl ac_cv_lib_inet6_$1=no
355 dnl if test x$ipv6_libinet6 = x; then
357 dnl SAVELDFLAGS="$LDFLAGS"
358 dnl LDFLAGS="-L$ipv6_cv_dir/lib"
360 dnl AC_CHECK_LIB(inet6, $1, [dnl
361 dnl AC_DEFINE_UNQUOTED($ac_tr_lib)
362 dnl if test $ipv6_libinet6 = no; then
363 dnl ipv6_libinet6=yes
364 dnl LIBS="$LIBS -linet6"
366 dnl if test $ipv6_libinet6 = no; then
367 dnl LDFLAGS="$SAVELDFLAGS"
370 dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
373 dnl ifelse([$2], , :, [$2])
376 dnl ifelse([$3], , :, [$3])
378 dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
383 [ --with-hesiod=PREFIX Use Hesiod lookup for ~ expansion],
384 [hesiod="$withval"], [hesiod=no])
385 if test "$hesiod" != no; then
387 AC_CHECK_FUNC(res_send, :,
388 AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
390 if test "$hesiod" != yes; then
391 HESDEF="$HESDEF -I$hesiod/include"
392 HESLIB="-L$hesiod/lib $HESLIB"
398 AC_CONFIG_FILES([Makefile])