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.15.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
106 tcsh_config_file=bsd4.4
111 tcsh_config_file=bsd4.4
116 tcsh_config_file=bsd4.4
121 tcsh_config_file=bsd4.4
126 tcsh_config_file=bsd4.4
129 ## Silicon Graphics machines
131 tcsh_config_file=irix
133 irix[34]*) # Irix-3.x - Irix 4.x
134 NON_GNU_DFLAGS='-D__STDC__'
135 LIBS='-lsun -lbsd -lc_s'
137 irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
140 irix6.[2-9]*) # Irix 6.2 and later
141 tcsh_config_file=irix62
148 tcsh_config_file=sunos35
151 tcsh_config_file=sunos40
153 *-sun-sunos4.1.[12]* )
154 tcsh_config_file=sunos41
156 *-sun-sunos4.1.[3456]* )
157 tcsh_config_file=sunos413
159 *-*-solaris2.[01] ) # Should handle sparc or x86
160 tcsh_config_file=sol2
162 *-sun-solaris2.2 ) # Sparc only release
163 tcsh_config_file=sol22
165 *-sun-solaris2.3 ) # Sparc only release
166 tcsh_config_file=sol23
168 *-*-solaris2.[45] ) # Should handle sparc, x86 and powerpc
169 tcsh_config_file=sol24
171 *-*-solaris2.* ) # Should handle sparc, x86 and powerpc
172 tcsh_config_file=sol26
177 tcsh_config_file=sysv4
178 DFLAGS="$DFLAGS -DDELL"
181 ## SVR4 (Generic and otherwise)
183 tcsh_config_file=sysv4
187 m68k-tektronix-bsd* )
189 NON_GNU_DFLAGS='-DBSD -DUTek'
191 m88k-tektronix-sysv3* )
192 tcsh_config_file=tekXD88
197 tcsh_config_file=sco32v5
200 tcsh_config_file=sco32v4
203 tcsh_config_file=sco32v2
206 ## Siemens BS2000 Mainframe
208 tcsh_config_file=bs2000
213 tcsh_config_file=convex
218 tcsh_config_file=cray
223 tcsh_config_file=cygwin32
226 ## mips-compaq-nonstopux
228 tcsh_config_file=sysv4
233 tcsh_config_file=apollo
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.])
246 echo "Tcsh will use configuration file \`$tcsh_config_file'."
248 cp ${srcdir}/config/${tcsh_config_file} config_p.h
250 [#include "config_p.h"
251 #include "config_f.h"])
253 dnl Checks for programs
256 AC_PROG_GCC_TRADITIONAL
258 if test "x$GCC" != xyes ; then
259 DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
260 CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
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)
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
277 AC_CHECK_HEADERS([wctype.h])])
283 AC_CHECK_TYPES([long long])
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>.]),
293 #include <sys/types.h>
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.]),
302 #include <sys/types.h>
303 #include <sys/socket.h>
309 dnl Checks for structures
310 AC_CHECK_MEMBERS([struct dirent.d_ino], , ,
311 [#ifdef HAVE_DIRENT_H
317 # include <sys/dir.h>
319 # define dirent direct
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>
327 #elif defined HAVE_UTMP_H
330 AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , ,
331 [#include <sys/types.h>
332 #include <sys/socket.h>])
334 dnl Checks for compiler characteristics
338 dnl checks for library functions
339 AC_CHECK_DECLS([crypt, environ, gethostname, getpgrp], , ,
340 [#include "config_p.h"
341 AC_INCLUDES_DEFAULT([])
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])
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
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
376 dnl if test x$ipv6_libinet6 = x; then
378 dnl SAVELDFLAGS="$LDFLAGS"
379 dnl LDFLAGS="-L$ipv6_cv_dir/lib"
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"
387 dnl if test $ipv6_libinet6 = no; then
388 dnl LDFLAGS="$SAVELDFLAGS"
391 dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
394 dnl ifelse([$2], , :, [$2])
397 dnl ifelse([$3], , :, [$3])
399 dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
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.])
413 [ --with-hesiod=PREFIX Use Hesiod lookup for ~ expansion],
414 [hesiod="$withval"], [hesiod=no])
415 if test "$hesiod" != no; then
417 AC_CHECK_FUNC(res_send, :,
418 AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
420 if test "$hesiod" != yes; then
421 HESDEF="$HESDEF -I$hesiod/include"
422 HESLIB="-L$hesiod/lib $HESLIB"
428 AC_CONFIG_FILES([Makefile])