If we decline to follow a symbolic link due to the safety check, issue a more self...
[findutils.git] / configure.in
blob7900b6b41f374f3b74df351100f394d60f57b74b
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([GNU findutils], 4.3.0-CVS, [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 rw"
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(leaf-optimisation,
27         AS_HELP_STRING(--enable-leaf-optimisation,Enable an optimisation which saves lstat calls to identify subdirectories on filesystems having traditional Unix semantics),
28         [ac_cv_leaf_optimisation=$enableval],[ac_cv_leaf_optimisation=yes])
30 AC_ARG_ENABLE(d_type-optimization,
31         AS_HELP_STRING(--enable-d_type-optimization,Make use of the file type data returned in struct dirent.d_type by readdir()),
32         [ac_cv_d_type=$enableval],[ac_cv_d_type=yes])
34 dnl This one has no default, because otherwise we would have to say 
35 dnl both --enable-d_type-optimisation=no and --enable-d_type-optimization=no
36 dnl to turn it off.
37 AC_ARG_ENABLE(d_type-optimisation,
38         AS_HELP_STRING(--enable-d_type-optimisation,Synonym for --enable-d_type-optimization),
39         [ac_cv_d_type=$enableval],[])
42 AC_MSG_CHECKING([whether debug output should be produced])
43 if test x$ac_cv_debug = xno; then
44    AC_MSG_RESULT([no])
45 else
46    AC_MSG_RESULT([yes])
47    AC_DEFINE(DEBUG, 1, [Define if you want to see find's innards])
48    AC_DEFINE(DEBUG_STAT, 1, [Define if you want to see a message every time find calls the stat() system call])
51 AC_MSG_CHECKING([for leaf optimisation])
52 if test x$ac_cv_leaf_optimisation = xno; then
53    AC_MSG_RESULT([no])
54 else
55    AC_MSG_RESULT([yes])
56    AC_DEFINE(LEAF_OPTIMISATION, 1, [Define if you want to use the leaf optimisation (this can still be turned off with -noleaf)])
61 dnl Checks for programs.
62 AC_PROG_CC
63 AC_PROG_CPP
65 AC_AIX
68 dnl AC_MINIX
69 dnl for gnulib
70 gl_EARLY
71 dnl gl_EARLY calls AC_GNU_SOURCE anyway.
74 AC_ISC_POSIX
75 AM_C_PROTOTYPES
77 AC_PROG_INSTALL
78 AC_PROG_RANLIB
79 dnl AC_PROG_LIBTOOL
80 AC_PROG_MAKE_SET
81 AC_SYS_LARGEFILE
84 gl_INIT
86 dnl Try to get a POSIX.1 environment.
88 dnl Checks for libraries.  If getpwnam() isn't present in the 
89 dnl C library, try -lsun.
90 AC_CHECK_FUNC(getpwnam, [],
91 [AC_CHECK_LIB(sun, getpwnam)])
93 dnl Checks for header files.
94 AC_HEADER_STDC
95 dnl Assume unistd.h is present - coreutils does too.
96 AC_CHECK_HEADERS(fcntl.h string.h limits.h errno.h stdlib.h stddef.h)
97 AC_CHECK_HEADERS(unistd.h sys/types.h inttypes.h fcntl.h locale.h stdint.h)
98 AC_CHECK_HEADERS(sys/param.h mntent.h sys/mnttab.h sys/mntio.h sys/mkdev.h)
99 dnl find.c needs sys/utsname.h because it calls uname(2).
100 AC_CHECK_HEADERS(sys/utsname.h)
101 AC_HEADER_MAJOR
102 AC_HEADER_DIRENT
103 AC_HEADER_STAT
104 AC_HEADER_SYS_WAIT
107 dnl Checks for typedefs, structures, and compiler characteristics.
109 AC_TYPE_UID_T
110 AC_TYPE_SIZE_T
111 AC_CHECK_TYPE(ssize_t, int)
112 AC_TYPE_PID_T
113 AC_CHECK_TYPE(ino_t, unsigned long)
114 AC_CHECK_TYPE(dev_t, unsigned long)
115 AC_TYPE_MODE_T
116 AC_STRUCT_ST_BLOCKS
117 AC_CHECK_MEMBERS([struct stat.st_rdev])
119 AC_MSG_CHECKING([whether we should use struct dirent.d_type, if available])
120 if test x$ac_cv_d_type = xno; then
121    AC_MSG_RESULT([no])
122 else
123    AC_MSG_RESULT([yes])
124    AC_DEFINE(USE_STRUCT_DIRENT_D_TYPE, 1,
125    [Defined if you specify --enable-d_type-optimisation to configure.])
126    AC_CHECK_MEMBERS([struct dirent.d_type],[
127    AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
128    [Define to 1 if your 'struct dirent' has a d_type member])],
129    [],[
130 #include <sys/types.h>
131 #include <dirent.h>])
135 AC_STRUCT_TM
136 AC_STRUCT_TIMEZONE
138 dnl Checks for library functions that are provided by gnulib.
139 AC_FUNC_STRFTIME
140 AC_REPLACE_FUNCS(memcmp memset stpcpy strdup strstr strtol strtoul)
141 AC_CHECK_FUNCS(fchdir getcwd strerror endgrent endpwent setlocale)
142 AC_FUNC_VPRINTF
143 AC_FUNC_ALLOCA
144 AC_FUNC_CLOSEDIR_VOID
146 dnl We don't just use AC_FUNC_GETMNTENT directly because it 
147 dnl will try to use -lsun on platforms which have getmntent() in the 
148 dnl C library, for example UNICOS.
149 AC_CHECK_FUNC(getmntent, [], [AC_FUNC_GETMNTENT])
150 AC_CHECK_FUNCS(getmntent)
151 AC_CHECK_FUNCS(setmntent endmntent)
154 dnl Checks for library functions that are provided by findlib.
155 FINDLIB_REPLACE_FUNCS(waitpid strspn)
156 FINDLIB_REPLACE_FUNCS(forcefindlib)
158 dnl gl_XALLOC
159 gl_FUNC_ALLOCA
161 dnl Use gl_INCLUDED_REGEX so that findutils will build on systems like
162 dnl Solaris, which lacks those functions in libc (see GNU Savannah bug
163 dnl #11710)
164 gl_INCLUDED_REGEX([gnulib/lib/regex.c]) 
166 AC_PREREQ(2.59)
168 # Define intmax_t to 'signed long' or 'signed long long'
169 # if it is not already defined in <stdint.h> or <inttypes.h>.
170 dnl Derived from gnulib's uintmax_t which was from Paul Eggert.
171 AC_DEFUN([jy_AC_TYPE_INTMAX_T],
173   if test $ac_cv_header_inttypes_h = no && test $ac_cv_header_stdint_h = no; then
174     AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
175     test $ac_cv_type_long_long = yes \
176       && ac_type='long long' \
177       || ac_type='long'
178     AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
179       [Define to signed long or signed long long
180        if <stdint.h> and <inttypes.h> don't define.])
181   else
182     AC_DEFINE(HAVE_INTMAX_T, 1,
183       [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
184   fi
187 jy_AC_TYPE_INTMAX_T
188 jy_SORTZ
191 AC_CHECK_MEMBER(struct dirent.d_type,,,[                   
192 #include <sys/types.h>
193 #include <dirent.h>])
196 dnl internationalization macros
197 AM_GNU_GETTEXT([external])
200 dnl regextype.c and regexprops.c are designed to be usable outside findutils,
201 dnl but findutils doesn't want to support all the regex types in gnulib,
202 dnl and wants to support an additional one (RE_SYNTAX_EMACS|RE_DOT_NEWLINE).
203 dnl Hence they need to know if they are being compiled into findutils or not.
204 AC_DEFINE([FINDUTILS], 1, [Define if we are compiling GNU findutils])
207 # This is necessary so that .o files in LIBOBJS are also built via
208 # the ANSI2KNR-filtering rules.
209 #LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
210 ##AC_CONFIG_SUBDIRS(gnulib)
211 AC_CONFIG_FILES(gnulib/Makefile gnulib/lib/Makefile)
212 AC_CONFIG_FILES(m4/Makefile)
213 AC_CONFIG_FILES([Makefile 
214         find/Makefile find/testsuite/Makefile
215         xargs/Makefile xargs/testsuite/Makefile
216         locate/Makefile locate/testsuite/Makefile
217          po/Makefile.in po/Makefile
218         doc/Makefile lib/Makefile
219         ])
220 AC_OUTPUT
221 dnl intl/Makefile