1 #serial 70 -*- autoconf -*-
3 dnl Misc type-related macros for fileutils, sh-utils, textutils.
9 GNU_PACKAGE="GNU $PACKAGE"
10 AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
11 [The concatenation of the strings `GNU ', and PACKAGE.])
14 AM_MISSING_PROG(HELP2MAN, help2man)
15 AC_SUBST(OPTIONAL_BIN_PROGS)
19 dnl This macro actually runs replacement code. See isc-posix.m4.
20 AC_REQUIRE([AC_ISC_POSIX])dnl
24 AC_REQUIRE([UTILS_HOST_OS])
25 AC_REQUIRE([gl_ASSERT])
26 AC_REQUIRE([gl_CHECK_TYPE_STRUCT_UTIMBUF])
27 AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
28 AC_REQUIRE([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO])
29 AC_REQUIRE([gl_CHECK_DECLS])
31 AC_REQUIRE([gl_PREREQ])
33 AC_REQUIRE([UTILS_FUNC_DIRFD])
34 AC_REQUIRE([AC_FUNC_ACL])
35 AC_REQUIRE([gl_FUNC_LCHOWN])
36 AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
37 AC_REQUIRE([gl_FUNC_CHOWN])
38 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
39 AC_REQUIRE([AC_FUNC_STRERROR_R])
40 AC_REQUIRE([gl_FUNC_GROUP_MEMBER])
42 AC_REQUIRE([gl_AC_FUNC_LINK_FOLLOWS_SYMLINK])
43 AC_REQUIRE([gl_FUNC_FPENDING])
45 # This is for od and stat, and any other program that
46 # uses the PRI.MAX macros from inttypes.h.
47 AC_REQUIRE([gt_INTTYPES_PRI])
49 AC_REQUIRE([gl_FUNC_GETGROUPS])
51 AC_REQUIRE([AC_FUNC_FSEEKO])
52 AC_REQUIRE([AC_FUNC_ALLOCA])
54 AC_CONFIG_LIBOBJ_DIR([lib])
55 AC_FUNC_GETLOADAVG([lib])
57 AC_REQUIRE([gl_SYS_PROC_UPTIME])
58 AC_REQUIRE([gl_FUNC_FTRUNCATE])
60 # raise is used by at least sort and ls.
61 AC_REPLACE_FUNCS(raise)
63 # By default, argmatch should fail calling usage (1).
64 AC_DEFINE(ARGMATCH_DIE, [usage (1)],
65 [Define to the function xargmatch calls on failures.])
66 AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
67 [Define to the declaration of the xargmatch failure function.])
69 dnl Used to define SETVBUF in sys2.h.
70 dnl This evokes the following warning from autoconf:
71 dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
72 AC_FUNC_SETVBUF_REVERSED
74 # used by sleep and shred
75 AC_REQUIRE([gl_CLOCK_TIME])
76 AC_CHECK_FUNCS(gettimeofday)
77 AC_FUNC_GETTIMEOFDAY_CLOBBER
79 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
108 AC_CHECK_FUNCS(setreuid setregid)
111 AC_REQUIRE([GL_FUNC_GETCWD_PATH_MAX])
112 AC_REQUIRE([GL_FUNC_READDIR])
114 # See if linking `seq' requires -lm.
115 # It does on nearly every system. The single exception (so far) is
116 # BeOS which has all the math functions in the normal runtime library
117 # and doesn't have a separate math library.
125 AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
126 [ac_seq_save_LIBS="$LIBS"
128 AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
129 LIBS="$ac_seq_save_LIBS"
135 gl_FUNC_UNLINK_BUSY_TEXT
137 # These tests are for df.
138 AC_REQUIRE([gl_FSUSAGE])
139 AC_REQUIRE([gl_MOUNTLIST])
140 if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
141 DF_PROG='df$(EXEEXT)'
143 AC_REQUIRE([gl_AC_DOS])
144 AC_REQUIRE([AC_FUNC_CANONICALIZE_FILE_NAME])
146 # If any of these functions don't exist (e.g. DJGPP 2.03),
147 # use the corresponding stub.
148 AC_CHECK_FUNC([fchdir], , [AC_LIBOBJ(fchdir-stub)])
149 AC_CHECK_FUNC([fchown], , [AC_LIBOBJ(fchown-stub)])
151 AC_REQUIRE([gl_FUNC_FREE])
154 # These tests must be run before any use of AC_CHECK_TYPE,
155 # because that macro compiles code that tests e.g., HAVE_UNISTD_H.
156 # See the definition of ac_includes_default in `configure'.
157 AC_DEFUN([gl_CHECK_ALL_HEADERS],
200 # This macro must be invoked before any tests that run the compiler.
201 AC_DEFUN([gl_CHECK_ALL_TYPES],
203 dnl This test must come as early as possible after the compiler configuration
204 dnl tests, because the choice of the file model can (in principle) affect
205 dnl whether functions and headers are available, whether they work, etc.
206 AC_REQUIRE([AC_SYS_LARGEFILE])
208 dnl This test must precede tests of compiler characteristics like
209 dnl that for the inline keyword, since it may change the degree to
210 dnl which the compiler supports such features.
211 AC_REQUIRE([AM_C_PROTOTYPES])
213 dnl Checks for typedefs, structures, and compiler characteristics.
214 AC_REQUIRE([AC_C_BIGENDIAN])
215 AC_REQUIRE([AC_C_CONST])
216 AC_REQUIRE([AC_C_VOLATILE])
217 AC_REQUIRE([AC_C_INLINE])
218 AC_REQUIRE([AC_C_LONG_DOUBLE])
220 AC_REQUIRE([gl_CHECK_ALL_HEADERS])
221 AC_REQUIRE([AC_HEADER_DIRENT])
222 AC_REQUIRE([AC_HEADER_STDC])
224 [struct stat.st_author,
225 struct stat.st_blksize],,,
226 [$ac_includes_default
227 #include <sys/stat.h>
229 AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
231 AC_REQUIRE([AC_HEADER_STAT])
232 AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
233 AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
235 AC_REQUIRE([AC_TYPE_GETGROUPS])
236 AC_REQUIRE([AC_TYPE_MODE_T])
237 AC_REQUIRE([AC_TYPE_OFF_T])
238 AC_REQUIRE([AC_TYPE_PID_T])
239 AC_REQUIRE([AC_TYPE_SIGNAL])
240 AC_REQUIRE([AC_TYPE_SIZE_T])
241 AC_REQUIRE([AC_TYPE_UID_T])
242 AC_CHECK_TYPE(ino_t, unsigned long int)
243 AC_CHECK_TYPE(uintptr_t, size_t)
247 dnl This relies on the fact that autoconf 2.14a's implementation of
248 dnl AC_CHECK_TYPE checks includes unistd.h.
249 AC_CHECK_TYPE(major_t, unsigned int)
250 AC_CHECK_TYPE(minor_t, unsigned int)
252 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])
253 AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG])
255 AC_REQUIRE([AC_HEADER_MAJOR])
256 AC_REQUIRE([AC_HEADER_DIRENT])