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.13)dnl Minimum Autoconf version required.
16 dnl We don't use AC_VALIDATE_CACHED_SYSTEM_TUPLE here because we only
17 dnl care about the HOST value, not the HOST/BUILD/TARGET triplet.
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
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
201 bs2000-siemens-posix)
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'."
243 AC_CONFIG_HEADER(config.h:config/${tcsh_config_file}:config.h.in)
246 AC_PROG_GCC_TRADITIONAL
248 if test $ac_cv_prog_gcc = no ; then
249 DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
250 CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
256 CFLAGS="$CFLAGS -mno-win32"
260 AC_SEARCH_LIBS(crypt, crypt)
261 AC_SEARCH_LIBS(tgetent, termlib curses termcap)
262 AC_SEARCH_LIBS(gethostbyname, nsl)
263 AC_SEARCH_LIBS(connect, socket)
265 dnl This is not good enough; we need sockaddr_storage too.
266 dnl See whether we can use IPv6 related functions
267 dnl AC_DEFUN(IPv6_CHECK_FUNC, [
268 dnl changequote(, )dnl
269 dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
270 dnl -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
271 dnl changequote([, ])dnl
272 dnl AC_CHECK_FUNC($1, [dnl
273 dnl AC_DEFINE_UNQUOTED($ac_tr_lib)
274 dnl ac_cv_lib_inet6_$1=no], [dnl
275 dnl AC_MSG_CHECKING([whether your system has IPv6 directory])
276 dnl AC_CACHE_VAL(ipv6_cv_dir, [dnl
277 dnl for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
278 dnl if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
282 dnl AC_MSG_RESULT($ipv6_cv_dir)
283 dnl if test $ipv6_cv_dir = no; then
284 dnl ac_cv_lib_inet6_$1=no
286 dnl if test x$ipv6_libinet6 = x; then
288 dnl SAVELDFLAGS="$LDFLAGS"
289 dnl LDFLAGS="-L$ipv6_cv_dir/lib"
291 dnl AC_CHECK_LIB(inet6, $1, [dnl
292 dnl AC_DEFINE_UNQUOTED($ac_tr_lib)
293 dnl if test $ipv6_libinet6 = no; then
294 dnl ipv6_libinet6=yes
295 dnl LIBS="$LIBS -linet6"
297 dnl if test $ipv6_libinet6 = no; then
298 dnl LDFLAGS="$SAVELDFLAGS"
301 dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
304 dnl ifelse([$2], , :, [$2])
307 dnl ifelse([$3], , :, [$3])
309 dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
311 AC_CACHE_CHECK([ss_family in sockaddr_storage], ac_cv_ss_family,
312 [AC_TRY_COMPILE([#include <sys/types.h>
313 #include <sys/socket.h>], [struct sockaddr_storage ss; ss.ss_family;],
314 ac_cv_ss_family=yes, ac_cv_ss_family=no)]
315 if test "$ac_cv_ss_family" = no; then
316 DFLAGS="$DFLAGS -DNO_SS_FAMILY"
323 [ --with-hesiod=PREFIX Use Hesiod lookup for ~ expansion],
324 [hesiod="$withval"], [hesiod=no])
325 if test "$hesiod" != no; then
327 AC_CHECK_FUNC(res_send, :,
328 AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
330 if test "$hesiod" != yes; then
331 HESDEF="$HESDEF -I$hesiod/include"
332 HESLIB="-L$hesiod/lib $HESLIB"