Preparing to release findutils-4.2.19
[findutils.git] / configure.in
blobd25b09df7b4df2bffc3dbb3835a2a6fe2a9cedd4
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([GNU findutils], 4.2.19, [bug-findutils@gnu.org])
3 AM_INIT_AUTOMAKE
5 AC_CONFIG_SRCDIR([find/pred.c])
6 AC_CONFIG_HEADERS([config.h])
7 AC_CANONICAL_HOST
8 AC_CONFIG_MACRO_DIR(gnulib/m4)
10 dnl Set of available languages.
11 ALL_LINGUAS="be ca da de el eo es et fi fr ga gl hr hu id it ja ko lg ms nl pl pt pt_BR ro ru sk sl sr sv tr vi zh_CN"
13 AC_SUBST(INCLUDES)dnl
14 AC_ARG_ENABLE(id-cache,
15 [  --enable-id-cache       cache all UIDs & GIDs; avoid if using NIS or Hesiod],
16   AC_DEFINE(CACHE_IDS, 1, [Define if you want find -nouser and -nogroup to make tables of
17    used UIDs and GIDs at startup instead of using getpwuid or
18    getgrgid when needed.  Speeds up -nouser and -nogroup unless you
19    are running NIS or Hesiod, which make password and group calls
20    very expensive.]))
22 AC_ARG_ENABLE(debug,
23         AS_HELP_STRING(--enable-debug,Enable debugging output which is likely to be interesting to people debugging findutils),
24         [ac_cv_debug=$enableval],[ac_cv_debug=no])
26 AC_ARG_ENABLE(d_type-optimization,
27         AS_HELP_STRING(--enable-d_type-optimization,Make use of the file type data returned in struct dirent.d_type by readdir()),
28         [ac_cv_d_type=$enableval],[ac_cv_d_type=yes])
30 dnl This one has no default, because otherwise we would have to say 
31 dnl both --enable-d_type-optimisation=no and --enable-d_type-optimization=no
32 dnl to turn it off.
33 AC_ARG_ENABLE(d_type-optimisation,
34         AS_HELP_STRING(--enable-d_type-optimisation,Synonym for --enable-d_type-optimization),
35         [ac_cv_d_type=$enableval],[])
38 AC_MSG_CHECKING([whether debug output should be produced])
39 if test x$ac_cv_debug = xno; then
40    AC_MSG_RESULT([no])
41 else
42    AC_MSG_RESULT([yes])
43    AC_DEFINE(DEBUG, 1, [Define if you want to see find's innards])
44    AC_DEFINE(DEBUG_STAT, 1, [Define if you want to see a message every time find calls the stat() system call])
49 dnl Checks for programs.
50 AC_PROG_CC
51 AC_PROG_CPP
53 AC_AIX
56 dnl AC_MINIX
57 dnl for gnulib
58 gl_EARLY
59 dnl gl_EARLY calls AC_GNU_SOURCE anyway.
62 AC_ISC_POSIX
63 AM_C_PROTOTYPES
65 AC_PROG_INSTALL
66 AC_PROG_RANLIB
67 dnl AC_PROG_LIBTOOL
68 AC_PROG_MAKE_SET
69 AC_SYS_LARGEFILE
72 gl_INIT
74 dnl Try to get a POSIX.1 environment.
76 dnl Checks for libraries.  If getpwnam() isn't present in the 
77 dnl C library, try -lsun.
78 AC_CHECK_FUNC(getpwnam, [],
79 [AC_CHECK_LIB(sun, getpwnam)])
81 dnl Checks for header files.
82 AC_HEADER_STDC
83 AC_CHECK_HEADERS(fcntl.h string.h limits.h unistd.h errno.h stdlib.h stddef.h)
84 AC_CHECK_HEADERS(unistd.h sys/types.h inttypes.h fcntl.h locale.h stdint.h)
85 AC_CHECK_HEADERS(sys/param.h mntent.h sys/mnttab.h sys/mntio.h sys/mkdev.h)
86 dnl find.c needs sys/utsname.h because it calls uname(2).
87 AC_CHECK_HEADERS(sys/utsname.h)
88 AC_HEADER_MAJOR
89 AC_HEADER_DIRENT
90 AC_HEADER_STAT
91 AC_HEADER_SYS_WAIT
94 dnl Checks for typedefs, structures, and compiler characteristics.
96 AC_TYPE_UID_T
97 AC_TYPE_SIZE_T
98 AC_CHECK_TYPE(ssize_t, int)
99 AC_TYPE_PID_T
100 AC_CHECK_TYPE(ino_t, unsigned long)
101 AC_CHECK_TYPE(dev_t, unsigned long)
102 AC_TYPE_MODE_T
103 AC_STRUCT_ST_BLOCKS
104 AC_CHECK_MEMBERS([struct stat.st_rdev])
106 AC_MSG_CHECKING([whether we should use struct dirent.d_type, if available])
107 if test x$ac_cv_d_type = xno; then
108    AC_MSG_RESULT([no])
109 else
110    AC_MSG_RESULT([yes])
111    AC_DEFINE(USE_STRUCT_DIRENT_D_TYPE, 1,
112    [Defined if you specify --enable-d_type-optimisation to configure.])
113    AC_CHECK_MEMBERS([struct dirent.d_type],[
114    AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
115    [Define to 1 if your 'struct dirent' has a d_type member])],
116    [],[
117 #include <sys/types.h>
118 #include <dirent.h>])
122 AC_STRUCT_TM
123 AC_STRUCT_TIMEZONE
125 dnl Checks for library functions that are provided by gnulib.
126 AC_FUNC_STRFTIME
127 AC_REPLACE_FUNCS(memcmp memset stpcpy strdup strstr strtol strtoul)
128 AC_CHECK_FUNCS(fchdir getcwd strerror endgrent endpwent setlocale)
129 AC_FUNC_VPRINTF
130 AC_FUNC_ALLOCA
131 AC_FUNC_CLOSEDIR_VOID
133 dnl We don't just use AC_FUNC_GETMNTENT directly because it 
134 dnl will try to use -lsun on platforms which have getmntent() in the 
135 dnl C library, for example UNICOS.
136 AC_CHECK_FUNC(getmntent, [], [AC_FUNC_GETMNTENT])
137 AC_CHECK_FUNCS(getmntent)
138 AC_CHECK_FUNCS(setmntent endmntent)
141 dnl Checks for library functions that are provided by findlib.
142 FINDLIB_REPLACE_FUNCS(waitpid strspn)
143 FINDLIB_REPLACE_FUNCS(forcefindlib)
145 dnl gl_XALLOC
146 gl_FUNC_ALLOCA
148 dnl Use gl_INCLUDED_REGEX so that findutils will build on systems like
149 dnl Solaris, which lacks those functions in libc (see GNU Savannah bug
150 dnl #11710)
151 gl_INCLUDED_REGEX([gnulib/lib/regex.c]) 
153 AC_PREREQ(2.59)
155 # Define intmax_t to 'signed long' or 'signed long long'
156 # if it is not already defined in <stdint.h> or <inttypes.h>.
157 dnl Derived from gnulib's uintmax_t which was from Paul Eggert.
158 AC_DEFUN([jy_AC_TYPE_INTMAX_T],
160   if test $ac_cv_header_inttypes_h = no && test $ac_cv_header_stdint_h = no; then
161     AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
162     test $ac_cv_type_long_long = yes \
163       && ac_type='long long' \
164       || ac_type='long'
165     AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
166       [Define to signed long or signed long long
167        if <stdint.h> and <inttypes.h> don't define.])
168   else
169     AC_DEFINE(HAVE_INTMAX_T, 1,
170       [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
171   fi
174 jy_AC_TYPE_INTMAX_T
175 jy_SORTZ
178 AC_CHECK_MEMBER(struct dirent.d_type,,,[                   
179 #include <sys/types.h>
180 #include <dirent.h>])
183 dnl internationalization macros
184 AM_GNU_GETTEXT([external])
186 # This is necessary so that .o files in LIBOBJS are also built via
187 # the ANSI2KNR-filtering rules.
188 #LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
189 ##AC_CONFIG_SUBDIRS(gnulib)
190 AC_CONFIG_FILES(gnulib/Makefile gnulib/lib/Makefile gnulib/m4/Makefile)
191 AC_CONFIG_FILES(m4/Makefile)
192 AC_CONFIG_FILES([Makefile 
193         find/Makefile find/testsuite/Makefile
194         xargs/Makefile xargs/testsuite/Makefile
195         locate/Makefile locate/testsuite/Makefile
196          po/Makefile.in po/Makefile
197         doc/Makefile lib/Makefile
198         ])
199 AC_OUTPUT
200 dnl intl/Makefile