1 dnl Process this file with autoconf to produce a configure script.
3 AM_CONFIG_HEADER(config.h)
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 sk"
10 AM_INIT_AUTOMAKE(findutils, 4.2.8-CVS)
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
21 dnl Checks for programs.
31 dnl gl_EARLY calls AC_GNU_SOURCE anyway.
46 dnl Try to get a POSIX.1 environment.
48 dnl Checks for libraries. If getpwnam() isn't present in the
49 dnl C library, try -lsun.
50 AC_CHECK_FUNC(getpwnam, [],
51 [AC_CHECK_LIB(sun, getpwnam)])
53 dnl Checks for header files.
55 AC_CHECK_HEADERS(fcntl.h string.h limits.h unistd.h errno.h stdlib.h stddef.h)
56 AC_CHECK_HEADERS(unistd.h sys/types.h inttypes.h fcntl.h locale.h stdint.h)
57 AC_CHECK_HEADERS(sys/param.h mntent.h sys/mnttab.h sys/mntio.h sys/mkdev.h)
63 AC_MSG_CHECKING(how to get filesystem type)
65 # The order of these tests is important.
66 AC_TRY_CPP([#include <sys/statvfs.h>
67 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS, 1, [Define to use SVR4 statvfs to get filesystem type.]) fstype=SVR4)
68 if test $fstype = no; then
69 AC_TRY_CPP([#include <sys/statfs.h>
70 #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS, 1, [Define to use SVR3.2 statfs to get filesystem type.]) fstype=SVR3)
72 if test $fstype = no; then
73 AC_TRY_CPP([#include <sys/statfs.h>
74 #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS, 1, [Define to use AIX3 statfs to get filesystem type.]) fstype=AIX)
76 if test $fstype = no; then
77 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)
79 if test $fstype = no; then
80 AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT, 1, [Define to use 4.3BSD getmntent to get filesystem type.]) fstype=4.3BSD)
82 if test $fstype = no; then
83 AC_TRY_CPP([#include <sys/mount.h>
84 #include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT, 1, [Define to use Ultrix getmnt to get filesystem type.]) fstype=Ultrix)
86 AC_MSG_RESULT($fstype)
88 dnl Checks for typedefs, structures, and compiler characteristics.
92 AC_CHECK_TYPE(ssize_t, int)
94 AC_CHECK_TYPE(ino_t, unsigned long)
95 AC_CHECK_TYPE(dev_t, unsigned long)
98 AC_CHECK_MEMBERS([struct stat.st_rdev])
102 dnl Checks for library functions that are provided by gnulib.
104 AC_REPLACE_FUNCS(memcmp memset stpcpy strdup strstr strtol strtoul)
105 AC_CHECK_FUNCS(fchdir getcwd strerror endgrent endpwent setlocale)
108 AC_FUNC_CLOSEDIR_VOID
110 dnl We don't just use AC_FUNC_GETMNTENT directly because it
111 dnl will try to use -lsun on platforms which have getmntent() in the
112 dnl C library, for example UNICOS.
113 AC_CHECK_FUNC(getmntent, [], [AC_FUNC_GETMNTENT])
114 AC_CHECK_FUNCS(getmntent)
115 AC_CHECK_FUNCS(setmntent endmntent)
117 dnl Linux, 4.3BSD, etc.
118 AC_CHECK_TYPE([struct mntent],
119 [AC_DEFINE([HAVE_STRUCT_MNTENT],1,[Set if you have struct mntent])
120 AC_CHECK_MEMBERS([struct mntent.mnt_type, struct mntent.mnt_dir],,,[#include <mntent.h>])],,
121 [#include <mntent.h>])
124 AC_CHECK_TYPE([struct mnttab],
125 [AC_DEFINE([HAVE_STRUCT_MNTTAB],1,[Set if you have struct mnttab])
126 AC_CHECK_MEMBERS([struct mnttab.mnt_fstype,struct mnttab.mnt_mountp],,,
129 #include <sys/mnttab.h>])],,
132 #include <sys/mnttab.h>])
134 AC_DEFUN([jy_FUNC_GETMNTENT_ARGTYPES],
135 AC_MSG_CHECKING([how to call getmntent()])
143 #if HAVE_SYS_MNTTAB_H
145 # include <sys/mnttab.h>
147 #if HAVE_STRUCT_MNTTAB
148 typedef struct mnttab MMM;
149 #elif HAVE_STRUCT_MNTENT
150 typedef struct mntent MMM;
153 [extern int getmntent(FILE*,MMM *);])],
154 AC_DEFINE([GETMNTENT_RETURNS_INT],1,[Set if getmntent() returns int])
155 AC_DEFINE([GETMNTENT_REQUIRES_STRUCT_PTR],1,[Set if the second argument to getmntent() is a pointer to struct])
156 AC_MSG_RESULT([takes two arguments and returns int])
158 dnl First try failed.
166 #if HAVE_SYS_MNTTAB_H
168 # include <sys/mnttab.h>
170 #if HAVE_STRUCT_MNTTAB
171 typedef struct mnttab MMM;
172 #elif HAVE_STRUCT_MNTENT
173 typedef struct mntent MMM;
176 [extern MMM* getmntent(FILE *);])],
177 AC_DEFINE([GETMNTENT_RETURNS_STRUCT],1,[Set if getmntent() returns a struct pointer])
178 AC_MSG_RESULT([takes just one argument and returns a struct pointer]),
179 AC_MSG_ERROR([I can't figure out how to use your getmntent() function.]))))
182 jy_FUNC_GETMNTENT_ARGTYPES
184 dnl Checks for library functions that are provided by findlib.
185 FINDLIB_REPLACE_FUNCS(waitpid strspn)
186 FINDLIB_REPLACE_FUNCS(forcefindlib)
194 # Define intmax_t to 'signed long' or 'signed long long'
195 # if it is not already defined in <stdint.h> or <inttypes.h>.
196 dnl Derived from gnulib's uintmax_t which was from Paul Eggert.
197 AC_DEFUN([jy_AC_TYPE_INTMAX_T],
199 if test $ac_cv_header_inttypes_h = no && test $ac_cv_header_stdint_h = no; then
200 AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
201 test $ac_cv_type_long_long = yes \
202 && ac_type='long long' \
204 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
205 [Define to signed long or signed long long
206 if <stdint.h> and <inttypes.h> don't define.])
208 AC_DEFINE(HAVE_INTMAX_T, 1,
209 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
217 AC_CHECK_MEMBER(struct dirent.d_type,,,[
218 #include <sys/types.h>
219 #include <dirent.h>])
222 dnl internationalization macros
223 AM_GNU_GETTEXT([external])
225 # This is necessary so that .o files in LIBOBJS are also built via
226 # the ANSI2KNR-filtering rules.
227 #LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
228 ##AC_CONFIG_SUBDIRS(gnulib)
229 AC_CONFIG_FILES(gnulib/Makefile gnulib/lib/Makefile gnulib/m4/Makefile)
230 AC_CONFIG_FILES(m4/Makefile)
233 find/Makefile find/testsuite/Makefile
234 xargs/Makefile xargs/testsuite/Makefile
235 locate/Makefile locate/testsuite/Makefile
236 po/Makefile.in po/Makefile
237 doc/Makefile lib/Makefile