1 #serial 60 -*- autoconf -*-
3 m4_undefine([AC_LANG_SOURCE(C)])
4 dnl The following is identical to the definition in c.m4
5 dnl from the autoconf cvs repository on 2003-03-07.
6 dnl FIXME: remove this code once we upgrade to autoconf-2.58.
8 # We can't use '#line $LINENO "configure"' here, since
9 # Sun c89 (Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09)
10 # rejects $LINENO greater than 32767, and some configure scripts
11 # are longer than 32767 lines.
12 m4_define([AC_LANG_SOURCE(C)],
15 cat confdefs.h >>conftest.$ac_ext
16 cat >>conftest.$ac_ext <<_ACEOF
21 dnl Misc type-related macros for fileutils, sh-utils, textutils.
27 GNU_PACKAGE="GNU $PACKAGE"
28 AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
29 [The concatenation of the strings `GNU ', and PACKAGE.])
32 AM_MISSING_PROG(HELP2MAN, help2man)
33 AC_SUBST(OPTIONAL_BIN_PROGS)
34 AC_SUBST(OPTIONAL_BIN_ZCRIPTS)
38 dnl This macro actually runs replacement code. See isc-posix.m4.
39 AC_REQUIRE([AC_ISC_POSIX])dnl
42 jm_INCLUDED_REGEX([lib/regex.c])
44 AC_REQUIRE([UTILS_HOST_OS])
45 AC_REQUIRE([UTILS_FUNC_MKDIR_TRAILING_SLASH])
46 AC_REQUIRE([jm_BISON])
47 AC_REQUIRE([jm_ASSERT])
48 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
49 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
50 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
51 AC_REQUIRE([jm_CHECK_DECLS])
53 AC_REQUIRE([jm_PREREQ])
55 AC_REQUIRE([UTILS_FUNC_DIRFD])
56 AC_REQUIRE([AC_FUNC_ACL])
57 AC_REQUIRE([AC_FUNC_FTW])
58 AC_REQUIRE([jm_FUNC_LCHOWN])
59 AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
60 AC_REQUIRE([jm_FUNC_CHOWN])
61 AC_REQUIRE([jm_FUNC_MKTIME])
62 AC_REQUIRE([jm_FUNC_LSTAT])
63 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
64 AC_REQUIRE([jm_FUNC_STAT])
65 AC_REQUIRE([AC_FUNC_REALLOC])
66 AC_REQUIRE([AC_FUNC_MALLOC])
67 AC_REQUIRE([AC_FUNC_STRERROR_R])
68 AC_REQUIRE([jm_FUNC_NANOSLEEP])
69 AC_REQUIRE([jm_FUNC_MEMCMP])
70 AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
71 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
72 AC_REQUIRE([jm_FUNC_GROUP_MEMBER])
73 AC_REQUIRE([jm_FUNC_PUTENV])
75 AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
76 AC_REQUIRE([jm_AC_PREREQ_XSTRTOIMAX])
77 AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
78 AC_REQUIRE([AC_FUNC_ERROR_AT_LINE])
79 AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
80 AC_REQUIRE([jm_FUNC_MKTIME])
81 AC_REQUIRE([jm_FUNC_FPENDING])
83 # This is for od and stat, and any other program that
84 # uses the PRI.MAX macros from inttypes.h.
85 AC_REQUIRE([gt_INTTYPES_PRI])
87 AC_REQUIRE([jm_FUNC_GETGROUPS])
89 AC_REQUIRE([AC_FUNC_FSEEKO])
90 AC_REQUIRE([AC_FUNC_VPRINTF])
91 AC_REQUIRE([AC_FUNC_ALLOCA])
93 AC_CONFIG_LIBOBJ_DIR([lib])
96 AC_REQUIRE([jm_SYS_PROC_UPTIME])
97 AC_REQUIRE([jm_FUNC_FTRUNCATE])
98 AC_REQUIRE([vb_FUNC_RENAME])
100 AC_REPLACE_FUNCS(strcasecmp strncasecmp)
101 AC_REPLACE_FUNCS(dup2)
102 AC_REPLACE_FUNCS(gethostname getusershell)
103 AC_REPLACE_FUNCS(sig2str)
104 AC_REPLACE_FUNCS(strcspn stpcpy strstr strtol strtoul)
105 AC_REPLACE_FUNCS(strpbrk)
106 AC_REPLACE_FUNCS(euidaccess memcmp rmdir rpmatch strndup strverscmp)
107 AC_REPLACE_FUNCS(atexit)
108 AC_REPLACE_FUNCS(getpass)
110 # raise is used by at least sort and ls.
111 AC_REPLACE_FUNCS(raise)
113 dnl used by e.g. intl/*domain.c and lib/canon-host.c
114 AC_REPLACE_FUNCS(strdup)
116 AC_REPLACE_FUNCS(memchr memcpy memmove memrchr memset)
117 AC_CHECK_FUNCS(getpagesize)
119 AC_REQUIRE([UTILS_FUNC_MKSTEMP])
121 # By default, argmatch should fail calling usage (1).
122 AC_DEFINE(ARGMATCH_DIE, [usage (1)],
123 [Define to the function xargmatch calls on failures.])
124 AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
125 [Define to the declaration of the xargmatch failure function.])
127 dnl Used to define SETVBUF in sys2.h.
128 dnl This evokes the following warning from autoconf:
129 dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
130 AC_FUNC_SETVBUF_REVERSED
132 # used by sleep and shred
133 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
134 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
136 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
137 # programs in the package would end up linked with that potentially-shared
138 # library, inducing unnecessary run-time overhead.
139 fetish_saved_libs=$LIBS
140 AC_SEARCH_LIBS(clock_gettime, [rt posix4],
141 [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
142 AC_SUBST(LIB_CLOCK_GETTIME)
143 AC_CHECK_FUNCS(clock_gettime clock_settime)
144 LIBS=$fetish_saved_libs
145 AC_CHECK_FUNCS(gettimeofday)
146 AC_FUNC_GETTIMEOFDAY_CLOBBER
148 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
149 AC_REQUIRE([jm_FUNC_UTIME])
183 AC_CHECK_FUNCS(setreuid setregid)
186 if test $am_cv_func_working_getline != yes; then
187 AC_CHECK_FUNCS(getdelim)
192 AC_REQUIRE([UTILS_SYS_OPEN_MAX])
193 AC_REQUIRE([GL_FUNC_GETCWD_PATH_MAX])
195 # See if linking `seq' requires -lm.
196 # It does on nearly every system. The single exception (so far) is
197 # BeOS which has all the math functions in the normal runtime library
198 # and doesn't have a separate math library.
206 AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
207 [ac_seq_save_LIBS="$LIBS"
209 AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
210 LIBS="$ac_seq_save_LIBS"
216 jm_FUNC_UNLINK_BUSY_TEXT
218 # These tests are for df.
219 jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
221 jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
222 if test $list_mounted_fs = yes && test $space = yes; then
227 AC_REQUIRE([jm_AC_DOS])
228 AC_REQUIRE([AC_FUNC_CANONICALIZE_FILE_NAME])
232 # These tests must be run before any use of AC_CHECK_TYPE,
233 # because that macro compiles code that tests e.g., HAVE_UNISTD_H.
234 # See the definition of ac_includes_default in `configure'.
235 AC_DEFUN([jm_CHECK_ALL_HEADERS],
278 # This macro must be invoked before any tests that run the compiler.
279 AC_DEFUN([jm_CHECK_ALL_TYPES],
281 dnl This test must come as early as possible after the compiler configuration
282 dnl tests, because the choice of the file model can (in principle) affect
283 dnl whether functions and headers are available, whether they work, etc.
284 AC_REQUIRE([AC_SYS_LARGEFILE])
286 dnl This test must precede tests of compiler characteristics like
287 dnl that for the inline keyword, since it may change the degree to
288 dnl which the compiler supports such features.
289 AC_REQUIRE([AM_C_PROTOTYPES])
291 dnl Checks for typedefs, structures, and compiler characteristics.
292 AC_REQUIRE([AC_C_BIGENDIAN])
293 AC_REQUIRE([AC_C_CONST])
294 AC_REQUIRE([AC_C_VOLATILE])
295 AC_REQUIRE([AC_C_INLINE])
296 AC_REQUIRE([AC_C_LONG_DOUBLE])
298 AC_REQUIRE([jm_CHECK_ALL_HEADERS])
299 AC_REQUIRE([AC_HEADER_DIRENT])
300 AC_REQUIRE([AC_HEADER_STDC])
302 [struct stat.st_author,
303 struct stat.st_blksize],,,
304 [$ac_includes_default
305 #include <sys/stat.h>
307 AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
309 AC_REQUIRE([AC_STRUCT_TM])
310 AC_REQUIRE([AC_STRUCT_TIMEZONE])
311 AC_REQUIRE([AC_HEADER_STAT])
312 AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
313 AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
314 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC])
316 AC_REQUIRE([AC_TYPE_GETGROUPS])
317 AC_REQUIRE([AC_TYPE_MODE_T])
318 AC_REQUIRE([AC_TYPE_OFF_T])
319 AC_REQUIRE([AC_TYPE_PID_T])
320 AC_REQUIRE([AC_TYPE_SIGNAL])
321 AC_REQUIRE([AC_TYPE_SIZE_T])
322 AC_REQUIRE([AC_TYPE_UID_T])
323 AC_CHECK_TYPE(ino_t, unsigned long)
325 dnl This relies on the fact that autoconf 2.14a's implementation of
326 dnl AC_CHECK_TYPE checks includes unistd.h.
327 AC_CHECK_TYPE(ssize_t, int)
328 AC_CHECK_TYPE(major_t, unsigned int)
329 AC_CHECK_TYPE(minor_t, unsigned int)
331 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
332 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
334 AC_REQUIRE([AC_HEADER_MAJOR])
335 AC_REQUIRE([AC_HEADER_DIRENT])