1 #serial 68 -*- 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)
37 dnl This macro actually runs replacement code. See isc-posix.m4.
38 AC_REQUIRE([AC_ISC_POSIX])dnl
42 AC_REQUIRE([UTILS_HOST_OS])
43 AC_REQUIRE([jm_ASSERT])
44 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
45 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
46 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
47 AC_REQUIRE([jm_CHECK_DECLS])
49 AC_REQUIRE([jm_PREREQ])
51 AC_REQUIRE([UTILS_FUNC_DIRFD])
52 AC_REQUIRE([AC_FUNC_ACL])
53 AC_REQUIRE([AC_FUNC_FTW])
54 AC_REQUIRE([jm_FUNC_LCHOWN])
55 AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
56 AC_REQUIRE([jm_FUNC_CHOWN])
57 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
58 AC_REQUIRE([AC_FUNC_STRERROR_R])
59 AC_REQUIRE([jm_FUNC_GROUP_MEMBER])
61 AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
62 AC_REQUIRE([jm_FUNC_FPENDING])
64 # This is for od and stat, and any other program that
65 # uses the PRI.MAX macros from inttypes.h.
66 AC_REQUIRE([gt_INTTYPES_PRI])
68 AC_REQUIRE([jm_FUNC_GETGROUPS])
70 AC_REQUIRE([AC_FUNC_FSEEKO])
71 AC_REQUIRE([AC_FUNC_ALLOCA])
73 AC_CONFIG_LIBOBJ_DIR([lib])
74 AC_FUNC_GETLOADAVG([lib])
76 AC_REQUIRE([jm_SYS_PROC_UPTIME])
77 AC_REQUIRE([jm_FUNC_FTRUNCATE])
79 # raise is used by at least sort and ls.
80 AC_REPLACE_FUNCS(raise)
82 # By default, argmatch should fail calling usage (1).
83 AC_DEFINE(ARGMATCH_DIE, [usage (1)],
84 [Define to the function xargmatch calls on failures.])
85 AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
86 [Define to the declaration of the xargmatch failure function.])
88 dnl Used to define SETVBUF in sys2.h.
89 dnl This evokes the following warning from autoconf:
90 dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
91 AC_FUNC_SETVBUF_REVERSED
93 # used by sleep and shred
94 AC_REQUIRE([gl_CLOCK_TIME])
95 AC_CHECK_FUNCS(gettimeofday)
96 AC_FUNC_GETTIMEOFDAY_CLOBBER
98 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
127 AC_CHECK_FUNCS(setreuid setregid)
130 AC_REQUIRE([UTILS_SYS_OPEN_MAX])
131 AC_REQUIRE([GL_FUNC_GETCWD_PATH_MAX])
132 AC_REQUIRE([GL_FUNC_READDIR])
134 # See if linking `seq' requires -lm.
135 # It does on nearly every system. The single exception (so far) is
136 # BeOS which has all the math functions in the normal runtime library
137 # and doesn't have a separate math library.
145 AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
146 [ac_seq_save_LIBS="$LIBS"
148 AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
149 LIBS="$ac_seq_save_LIBS"
155 jm_FUNC_UNLINK_BUSY_TEXT
157 # These tests are for df.
158 AC_REQUIRE([gl_FSUSAGE])
159 AC_REQUIRE([gl_MOUNTLIST])
160 if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
161 DF_PROG='df$(EXEEXT)'
163 AC_REQUIRE([jm_AC_DOS])
164 AC_REQUIRE([AC_FUNC_CANONICALIZE_FILE_NAME])
166 # If any of these functions don't exist (e.g. DJGPP 2.03),
167 # use the corresponding stub.
168 AC_CHECK_FUNC([fchdir], , [AC_LIBOBJ(fchdir-stub)])
169 AC_CHECK_FUNC([fchown], , [AC_LIBOBJ(fchown-stub)])
172 # These tests must be run before any use of AC_CHECK_TYPE,
173 # because that macro compiles code that tests e.g., HAVE_UNISTD_H.
174 # See the definition of ac_includes_default in `configure'.
175 AC_DEFUN([jm_CHECK_ALL_HEADERS],
218 # This macro must be invoked before any tests that run the compiler.
219 AC_DEFUN([jm_CHECK_ALL_TYPES],
221 dnl This test must come as early as possible after the compiler configuration
222 dnl tests, because the choice of the file model can (in principle) affect
223 dnl whether functions and headers are available, whether they work, etc.
224 AC_REQUIRE([AC_SYS_LARGEFILE])
226 dnl This test must precede tests of compiler characteristics like
227 dnl that for the inline keyword, since it may change the degree to
228 dnl which the compiler supports such features.
229 AC_REQUIRE([AM_C_PROTOTYPES])
231 dnl Checks for typedefs, structures, and compiler characteristics.
232 AC_REQUIRE([AC_C_BIGENDIAN])
233 AC_REQUIRE([AC_C_CONST])
234 AC_REQUIRE([AC_C_VOLATILE])
235 AC_REQUIRE([AC_C_INLINE])
236 AC_REQUIRE([AC_C_LONG_DOUBLE])
238 AC_REQUIRE([jm_CHECK_ALL_HEADERS])
239 AC_REQUIRE([AC_HEADER_DIRENT])
240 AC_REQUIRE([AC_HEADER_STDC])
242 [struct stat.st_author,
243 struct stat.st_blksize],,,
244 [$ac_includes_default
245 #include <sys/stat.h>
247 AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
249 AC_REQUIRE([AC_HEADER_STAT])
250 AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
251 AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
253 AC_REQUIRE([AC_TYPE_GETGROUPS])
254 AC_REQUIRE([AC_TYPE_MODE_T])
255 AC_REQUIRE([AC_TYPE_OFF_T])
256 AC_REQUIRE([AC_TYPE_PID_T])
257 AC_REQUIRE([AC_TYPE_SIGNAL])
258 AC_REQUIRE([AC_TYPE_SIZE_T])
259 AC_REQUIRE([AC_TYPE_UID_T])
260 AC_CHECK_TYPE(ino_t, unsigned long)
264 dnl This relies on the fact that autoconf 2.14a's implementation of
265 dnl AC_CHECK_TYPE checks includes unistd.h.
266 AC_CHECK_TYPE(major_t, unsigned int)
267 AC_CHECK_TYPE(minor_t, unsigned int)
269 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
270 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
272 AC_REQUIRE([AC_HEADER_MAJOR])
273 AC_REQUIRE([AC_HEADER_DIRENT])