Work around what appears to be a C compiler bug in HP-UX 11.23 for
[findutils.git] / configure.in
blob5b7650a0b26236cca843d0a5adc73770442719e0
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(find/pred.c)
3 AM_CONFIG_HEADER(config.h)
4 AC_CANONICAL_HOST
5 AC_CONFIG_MACRO_DIR(gnulib/m4)
7 dnl Set of available languages.
8 ALL_LINGUAS="da de es et fr gl id it ko nl pl pt_BR ru sv tr"
10 AM_INIT_AUTOMAKE(findutils, 4.2.2-CVS)
12 AC_SUBST(INCLUDES)dnl
13 AC_ARG_ENABLE(id-cache,
14 [  --enable-id-cache       cache all UIDs & GIDs; avoid if using NIS or Hesiod],
15   AC_DEFINE(CACHE_IDS, 1, [Define if you want find -nouser and -nogroup to make tables of
16    used UIDs and GIDs at startup instead of using getpwuid or
17    getgrgid when needed.  Speeds up -nouser and -nogroup unless you
18    are running NIS or Hesiod, which make password and group calls
19    very expensive.]))
21 dnl Checks for programs.
22 AC_PROG_CC
23 AC_PROG_CPP
24 AC_AIX
25 AC_MINIX
26 AC_ISC_POSIX
27 AC_PROG_CC_STDC
28 AM_C_PROTOTYPES
29 AC_PROG_INSTALL
30 AC_PROG_RANLIB
31 AC_PROG_MAKE_SET
32 AC_SYS_LARGEFILE
34 dnl Try to get a POSIX.1 environment.
36 dnl Checks for libraries.
37 AC_CHECK_LIB(sun, getpwnam)
39 dnl Checks for header files.
40 AC_HEADER_STDC
41 AC_CHECK_HEADERS(fcntl.h string.h limits.h unistd.h errno.h stdlib.h stddef.h)
42 AC_CHECK_HEADERS(unistd.h inttypes.h fcntl.h locale.h stdint.h)
43 AC_CHECK_HEADERS(sys/param.h)
44 AC_HEADER_MAJOR
45 AC_HEADER_DIRENT
46 AC_HEADER_STAT
47 AC_HEADER_SYS_WAIT
49 AC_MSG_CHECKING(how to get filesystem type)
50 fstype=no
51 # The order of these tests is important.
52 AC_TRY_CPP([#include <sys/statvfs.h>
53 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS, 1, [Define to use SVR4 statvfs to get filesystem type.]) fstype=SVR4)
54 if test $fstype = no; then
55 AC_TRY_CPP([#include <sys/statfs.h>
56 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS, 1, [Define to use SVR3.2 statfs to get filesystem type.]) fstype=SVR3)
58 if test $fstype = no; then
59 AC_TRY_CPP([#include <sys/statfs.h>
60 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS, 1, [Define to use AIX3 statfs to get filesystem type.]) fstype=AIX)
62 if test $fstype = no; then  
63 AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS, 1, [Define to use 4.4BSD and OSF1 statfs to get filesystem type.]) fstype=4.4BSD/OSF1)
65 if test $fstype = no; then  
66 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT, 1, [Define to use 4.3BSD getmntent to get filesystem type.]) fstype=4.3BSD)
68 if test $fstype = no; then  
69 AC_TRY_CPP([#include <sys/mount.h>
70 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT, 1, [Define to use Ultrix getmnt to get filesystem type.]) fstype=Ultrix)
72 AC_MSG_RESULT($fstype)
74 dnl Checks for typedefs, structures, and compiler characteristics.
76 AC_TYPE_UID_T
77 AC_TYPE_SIZE_T
78 AC_CHECK_TYPE(ssize_t, int)
79 AC_TYPE_PID_T
80 AC_CHECK_TYPE(ino_t, unsigned long)
81 AC_CHECK_TYPE(dev_t, unsigned long)
82 AC_TYPE_MODE_T
83 AC_STRUCT_ST_BLOCKS
84 AC_CHECK_MEMBERS([struct stat.st_rdev])
85 AC_STRUCT_TM
86 AC_STRUCT_TIMEZONE
88 dnl Checks for library functions.
90 AC_FUNC_STRFTIME
91 AC_REPLACE_FUNCS(memcmp memset stpcpy strdup strftime strspn strstr \
92      strtol strtoul waitpid)
94 AC_CHECK_FUNCS(fchdir getcwd strerror endgrent endpwent)
95 AC_FUNC_VPRINTF
96 AC_FUNC_ALLOCA
97 AC_FUNC_GETMNTENT
98 AC_FUNC_CLOSEDIR_VOID
100 dnl gl_XALLOC
101 gl_FUNC_ALLOCA
104 AC_PREREQ(2.13)
106 # Define intmax_t to 'signed long' or 'signed long long'
107 # if it is not already defined in <stdint.h> or <inttypes.h>.
108 dnl Derived from gnulib's uintmax_t which was from Paul Eggert.
109 AC_DEFUN([jy_AC_TYPE_INTMAX_T],
111   if test $ac_cv_header_inttypes_h = no && test $ac_cv_header_stdint_h = no; then
112     AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
113     test $ac_cv_type_long_long = yes \
114       && ac_type='long long' \
115       || ac_type='long'
116     AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
117       [Define to signed long or signed long long
118        if <stdint.h> and <inttypes.h> don't define.])
119   else
120     AC_DEFINE(HAVE_INTMAX_T, 1,
121       [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
122   fi
125 jy_AC_TYPE_INTMAX_T
127 dnl internationalization macros
128 AM_GNU_GETTEXT
130 # This is necessary so that .o files in LIBOBJS are also built via
131 # the ANSI2KNR-filtering rules.
132 #LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
133 AC_CONFIG_SUBDIRS(gnulib)
134 AC_OUTPUT(
135         Makefile 
136         find/Makefile find/testsuite/Makefile
137         xargs/Makefile xargs/testsuite/Makefile
138         locate/Makefile locate/testsuite/Makefile
139         intl/Makefile po/Makefile.in po/Makefile
140         doc/Makefile lib/Makefile
141         )