2 # Copyright 1993, 1997 Free Software Foundation, Inc.
3 dnl Process this file with autoconf to produce a configure script.
7 AC_CONFIG_HEADER(config.h:config.hin)
19 # Use ed_PROGRAM, not ED_PROGRAM,
20 # because <errno.h> reserves symbols starting with `E'.
21 AC_PATH_PROG(ed_PROGRAM, ed, ed)
23 # If available, prefer support for large files unless the user specified
24 # one of the CPPFLAGS, LDFLAGS, or LIBS variables.
25 AC_MSG_CHECKING(whether large file support needs explicit enabling)
29 ac_shellvars='CPPFLAGS LDFLAGS LIBS'
30 for ac_shellvar in $ac_shellvars; do
32 CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
33 *) ac_lfsvar=LFS_$ac_shellvar ;;
35 eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
36 (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
37 ac_getconf=`getconf $ac_lfsvar`
38 ac_getconfs=$ac_getconfs$ac_getconf
39 eval ac_test_$ac_shellvar=\$ac_getconf
41 case "$ac_result$ac_getconfs" in
44 case "$ac_result$ac_set" in
45 yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
47 AC_MSG_RESULT($ac_result)
50 for ac_shellvar in $ac_shellvars; do
51 eval $ac_shellvar=\$ac_test_$ac_shellvar
63 AC_CHECK_HEADERS(fcntl.h limits.h string.h unistd.h utime.h varargs.h)
70 dnl Some systems have utime.h but don't declare the struct anywhere.
71 AC_MSG_CHECKING(for struct utimbuf)
72 AC_CACHE_VAL(patch_cv_sys_struct_utimbuf,
73 [AC_TRY_COMPILE([#include <sys/types.h>
76 #endif], [static struct utimbuf x; x.actime = x.modtime;],
77 patch_cv_sys_struct_utimbuf=yes,
78 patch_cv_sys_struct_utimbuf=no)])
79 AC_MSG_RESULT($patch_cv_sys_struct_utimbuf)
80 if test $patch_cv_sys_struct_utimbuf = yes; then
81 AC_DEFINE(HAVE_STRUCT_UTIMBUF)
84 # Check for NetBSD 1.0 bug, where memchr(..., 0) returns nonzero.
85 AC_MSG_CHECKING(for working memchr)
86 AC_CACHE_VAL(ac_cv_func_memchr,
87 [AC_TRY_RUN([#include <string.h>
88 main () { exit (memchr ("", 0, 0) != 0 || memchr ("", 1, 0) != 0); }],
89 ac_cv_func_memchr=yes,
91 AC_MSG_WARN([We are cross-compiling so we assume memchr does not work.])
92 ac_cv_func_memchr=no)])dnl
93 AC_MSG_RESULT($ac_cv_func_memchr)
94 if test $ac_cv_func_memchr = yes; then
95 AC_DEFINE(HAVE_MEMCHR)
98 AC_CHECK_FUNC(getopt_long, , [LIBOBJS="$LIBOBJS getopt1.o getopt.o"])
100 AC_CHECK_FUNCS(_doprintf isascii memcmp mkdir mktemp pathconf raise sigaction sigprocmask sigsetmask)
101 AC_REPLACE_FUNCS(memchr rename)
102 AC_FUNC_CLOSEDIR_VOID
105 AC_SYS_LONG_FILE_NAMES
107 AC_MSG_CHECKING([for d_ino member in directory struct])
108 AC_CACHE_VAL(patch_cv_sys_d_ino_in_dirent,
110 #include <sys/types.h>
114 # define dirent direct
116 # include <sys/ndir.h>
118 # ifdef HAVE_SYS_DIR_H
119 # include <sys/dir.h>
126 [struct dirent dp; dp.d_ino = 0;],
127 patch_cv_sys_d_ino_in_dirent=yes,
128 patch_cv_sys_d_ino_in_dirent=no)])
129 AC_MSG_RESULT($patch_cv_sys_d_ino_in_dirent)
130 if test $patch_cv_sys_d_ino_in_dirent = yes; then
131 AC_DEFINE(D_INO_IN_DIRENT)