'cvs status' should ignore Makefile.in
[findutils.git] / configure.in
blobcd3f374029379f946d97ed15e3552328fd27e367
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)
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 dnl AC_GNU_SOURCE
23 dnl AC_PROG_CC
24 dnl AC_PROG_CPP
25 dnl AC_AIX
26 dnl AC_MINIX
27 dnl AC_PROG_CC_STDC
29 # for gnulib
30 gl_EARLY
32 AC_ISC_POSIX
33 AM_C_PROTOTYPES
40 AC_PROG_INSTALL
41 AC_PROG_RANLIB
42 dnl AC_PROG_LIBTOOL
43 AC_PROG_MAKE_SET
44 AC_SYS_LARGEFILE
47 gl_INIT
49 dnl Try to get a POSIX.1 environment.
51 dnl Checks for libraries.
52 AC_CHECK_LIB(sun, getpwnam)
54 dnl Checks for header files.
55 AC_HEADER_STDC
56 AC_CHECK_HEADERS(fcntl.h string.h limits.h unistd.h errno.h stdlib.h stddef.h)
57 AC_CHECK_HEADERS(unistd.h inttypes.h fcntl.h locale.h stdint.h)
58 AC_CHECK_HEADERS(sys/param.h)
59 AC_HEADER_MAJOR
60 AC_HEADER_DIRENT
61 AC_HEADER_STAT
62 AC_HEADER_SYS_WAIT
64 AC_MSG_CHECKING(how to get filesystem type)
65 fstype=no
66 # The order of these tests is important.
67 AC_TRY_CPP([#include <sys/statvfs.h>
68 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS, 1, [Define to use SVR4 statvfs to get filesystem type.]) fstype=SVR4)
69 if test $fstype = no; then
70 AC_TRY_CPP([#include <sys/statfs.h>
71 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS, 1, [Define to use SVR3.2 statfs to get filesystem type.]) fstype=SVR3)
73 if test $fstype = no; then
74 AC_TRY_CPP([#include <sys/statfs.h>
75 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS, 1, [Define to use AIX3 statfs to get filesystem type.]) fstype=AIX)
77 if test $fstype = no; then  
78 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)
80 if test $fstype = no; then  
81 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT, 1, [Define to use 4.3BSD getmntent to get filesystem type.]) fstype=4.3BSD)
83 if test $fstype = no; then  
84 AC_TRY_CPP([#include <sys/mount.h>
85 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT, 1, [Define to use Ultrix getmnt to get filesystem type.]) fstype=Ultrix)
87 AC_MSG_RESULT($fstype)
89 dnl Checks for typedefs, structures, and compiler characteristics.
91 AC_TYPE_UID_T
92 AC_TYPE_SIZE_T
93 AC_CHECK_TYPE(ssize_t, int)
94 AC_TYPE_PID_T
95 AC_CHECK_TYPE(ino_t, unsigned long)
96 AC_CHECK_TYPE(dev_t, unsigned long)
97 AC_TYPE_MODE_T
98 AC_STRUCT_ST_BLOCKS
99 AC_CHECK_MEMBERS([struct stat.st_rdev])
100 AC_STRUCT_TM
101 AC_STRUCT_TIMEZONE
103 dnl Checks for library functions that are provided by gnulib.
104 AC_FUNC_STRFTIME
105 AC_REPLACE_FUNCS(memcmp memset stpcpy strdup strstr strtol strtoul)
106 AC_CHECK_FUNCS(fchdir getcwd strerror endgrent endpwent)
107 AC_FUNC_VPRINTF
108 AC_FUNC_ALLOCA
109 AC_FUNC_GETMNTENT
110 AC_FUNC_CLOSEDIR_VOID
112 dnl Checks for library functions that are provided by findlib.
113 FINDLIB_REPLACE_FUNCS(waitpid strspn)
114 FINDLIB_REPLACE_FUNCS(forcefindlib)
116 dnl gl_XALLOC
117 gl_FUNC_ALLOCA
120 AC_PREREQ(2.13)
122 # Define intmax_t to 'signed long' or 'signed long long'
123 # if it is not already defined in <stdint.h> or <inttypes.h>.
124 dnl Derived from gnulib's uintmax_t which was from Paul Eggert.
125 AC_DEFUN([jy_AC_TYPE_INTMAX_T],
127   if test $ac_cv_header_inttypes_h = no && test $ac_cv_header_stdint_h = no; then
128     AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
129     test $ac_cv_type_long_long = yes \
130       && ac_type='long long' \
131       || ac_type='long'
132     AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
133       [Define to signed long or signed long long
134        if <stdint.h> and <inttypes.h> don't define.])
135   else
136     AC_DEFINE(HAVE_INTMAX_T, 1,
137       [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
138   fi
141 jy_AC_TYPE_INTMAX_T
143 dnl internationalization macros
144 AM_GNU_GETTEXT
146 # This is necessary so that .o files in LIBOBJS are also built via
147 # the ANSI2KNR-filtering rules.
148 #LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
149 ##AC_CONFIG_SUBDIRS(gnulib)
150 AC_CONFIG_FILES(gnulib/Makefile gnulib/lib/Makefile gnulib/m4/Makefile)
151 AC_CONFIG_FILES(m4/Makefile)
152 AC_OUTPUT(
153         Makefile 
154         find/Makefile find/testsuite/Makefile
155         xargs/Makefile xargs/testsuite/Makefile
156         locate/Makefile locate/testsuite/Makefile
157         intl/Makefile po/Makefile.in po/Makefile
158         doc/Makefile lib/Makefile
159         )