Prepare for release of findutils-4.2.12
[findutils.git] / configure.in
blob18d758dfa9debe4f2ceb0bbffeb226b99207a509
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 sk"
10 AM_INIT_AUTOMAKE(findutils, 4.2.12)
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 AC_ARG_ENABLE(debug,
22         AC_HELP_STRING([--enable-debug],[Enable debugging output which is likely to be interesting to people debugging findutils]),
23         [ac_cv_debug=$enableval],[ac_cv_debug=no])
25 AC_MSG_CHECKING([whether debug output should be produced])
26 if test x$ac_cv_debug = xno; then
27    AC_MSG_RESULT([no])
28 else
29    AC_MSG_RESULT([yes])
30    AC_DEFINE(DEBUG, 1, [Define if you want to see find's innards])
31    AC_DEFINE(DEBUG_STAT, 1, [Define if you want to see a message every time find calls the stat() system call])
36 dnl Checks for programs.
37 AC_PROG_CC
38 AC_PROG_CPP
40 AC_AIX
41 AC_PROG_CC_STDC
43 dnl AC_MINIX
44 dnl for gnulib
45 gl_EARLY
46 dnl gl_EARLY calls AC_GNU_SOURCE anyway.
49 AC_ISC_POSIX
50 AM_C_PROTOTYPES
52 AC_PROG_INSTALL
53 AC_PROG_RANLIB
54 dnl AC_PROG_LIBTOOL
55 AC_PROG_MAKE_SET
56 AC_SYS_LARGEFILE
59 gl_INIT
61 dnl Try to get a POSIX.1 environment.
63 dnl Checks for libraries.  If getpwnam() isn't present in the 
64 dnl C library, try -lsun.
65 AC_CHECK_FUNC(getpwnam, [],
66 [AC_CHECK_LIB(sun, getpwnam)])
68 dnl Checks for header files.
69 AC_HEADER_STDC
70 AC_CHECK_HEADERS(fcntl.h string.h limits.h unistd.h errno.h stdlib.h stddef.h)
71 AC_CHECK_HEADERS(unistd.h sys/types.h inttypes.h fcntl.h locale.h stdint.h)
72 AC_CHECK_HEADERS(sys/param.h mntent.h sys/mnttab.h sys/mntio.h sys/mkdev.h)
73 AC_HEADER_MAJOR
74 AC_HEADER_DIRENT
75 AC_HEADER_STAT
76 AC_HEADER_SYS_WAIT
79 dnl Checks for typedefs, structures, and compiler characteristics.
81 AC_TYPE_UID_T
82 AC_TYPE_SIZE_T
83 AC_CHECK_TYPE(ssize_t, int)
84 AC_TYPE_PID_T
85 AC_CHECK_TYPE(ino_t, unsigned long)
86 AC_CHECK_TYPE(dev_t, unsigned long)
87 AC_TYPE_MODE_T
88 AC_STRUCT_ST_BLOCKS
89 AC_CHECK_MEMBERS([struct stat.st_rdev])
90 AC_STRUCT_TM
91 AC_STRUCT_TIMEZONE
93 dnl Checks for library functions that are provided by gnulib.
94 AC_FUNC_STRFTIME
95 AC_REPLACE_FUNCS(memcmp memset stpcpy strdup strstr strtol strtoul)
96 AC_CHECK_FUNCS(fchdir getcwd strerror endgrent endpwent setlocale)
97 AC_FUNC_VPRINTF
98 AC_FUNC_ALLOCA
99 AC_FUNC_CLOSEDIR_VOID
101 dnl We don't just use AC_FUNC_GETMNTENT directly because it 
102 dnl will try to use -lsun on platforms which have getmntent() in the 
103 dnl C library, for example UNICOS.
104 AC_CHECK_FUNC(getmntent, [], [AC_FUNC_GETMNTENT])
105 AC_CHECK_FUNCS(getmntent)
106 AC_CHECK_FUNCS(setmntent endmntent)
109 dnl Checks for library functions that are provided by findlib.
110 FINDLIB_REPLACE_FUNCS(waitpid strspn)
111 FINDLIB_REPLACE_FUNCS(forcefindlib)
113 dnl gl_XALLOC
114 gl_FUNC_ALLOCA
117 AC_PREREQ(2.13)
119 # Define intmax_t to 'signed long' or 'signed long long'
120 # if it is not already defined in <stdint.h> or <inttypes.h>.
121 dnl Derived from gnulib's uintmax_t which was from Paul Eggert.
122 AC_DEFUN([jy_AC_TYPE_INTMAX_T],
124   if test $ac_cv_header_inttypes_h = no && test $ac_cv_header_stdint_h = no; then
125     AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
126     test $ac_cv_type_long_long = yes \
127       && ac_type='long long' \
128       || ac_type='long'
129     AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
130       [Define to signed long or signed long long
131        if <stdint.h> and <inttypes.h> don't define.])
132   else
133     AC_DEFINE(HAVE_INTMAX_T, 1,
134       [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
135   fi
138 jy_AC_TYPE_INTMAX_T
139 jy_SORTZ
142 AC_CHECK_MEMBER(struct dirent.d_type,,,[                   
143 #include <sys/types.h>
144 #include <dirent.h>])
147 dnl internationalization macros
148 AM_GNU_GETTEXT([external])
150 # This is necessary so that .o files in LIBOBJS are also built via
151 # the ANSI2KNR-filtering rules.
152 #LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
153 ##AC_CONFIG_SUBDIRS(gnulib)
154 AC_CONFIG_FILES(gnulib/Makefile gnulib/lib/Makefile gnulib/m4/Makefile)
155 AC_CONFIG_FILES(m4/Makefile)
156 AC_OUTPUT(
157         Makefile 
158         find/Makefile find/testsuite/Makefile
159         xargs/Makefile xargs/testsuite/Makefile
160         locate/Makefile locate/testsuite/Makefile
161          po/Makefile.in po/Makefile
162         doc/Makefile lib/Makefile
163         )
164 dnl intl/Makefile