-#serial 49 -*- autoconf -*-
+#serial 67 -*- autoconf -*-
+
+m4_undefine([AC_LANG_SOURCE(C)])
+dnl The following is identical to the definition in c.m4
+dnl from the autoconf cvs repository on 2003-03-07.
+dnl FIXME: remove this code once we upgrade to autoconf-2.58.
+
+# We can't use '#line $LINENO "configure"' here, since
+# Sun c89 (Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09)
+# rejects $LINENO greater than 32767, and some configure scripts
+# are longer than 32767 lines.
+m4_define([AC_LANG_SOURCE(C)],
+[/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$1])
+
dnl Misc type-related macros for fileutils, sh-utils, textutils.
AC_DEFUN([jm_MACROS],
[
- AC_PREREQ(2.52g)
+ AC_PREREQ(2.57)
GNU_PACKAGE="GNU $PACKAGE"
AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
AM_MISSING_PROG(HELP2MAN, help2man)
AC_SUBST(OPTIONAL_BIN_PROGS)
- AC_SUBST(OPTIONAL_BIN_ZCRIPTS)
AC_SUBST(MAN)
AC_SUBST(DF_PROG)
AC_REQUIRE([AC_ISC_POSIX])dnl
jm_CHECK_ALL_TYPES
- gl_REGEX
AC_REQUIRE([UTILS_HOST_OS])
- AC_REQUIRE([UTILS_FUNC_MKDIR_TRAILING_SLASH])
- AC_REQUIRE([jm_BISON])
AC_REQUIRE([jm_ASSERT])
AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
AC_REQUIRE([UTILS_FUNC_DIRFD])
AC_REQUIRE([AC_FUNC_ACL])
+ AC_REQUIRE([AC_FUNC_FTW])
AC_REQUIRE([jm_FUNC_LCHOWN])
AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
AC_REQUIRE([jm_FUNC_CHOWN])
- AC_REQUIRE([gl_FUNC_MKTIME])
- AC_REQUIRE([jm_FUNC_LSTAT])
AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
- AC_REQUIRE([jm_FUNC_STAT])
- AC_REQUIRE([jm_FUNC_REALLOC])
- AC_REQUIRE([jm_FUNC_MALLOC])
AC_REQUIRE([AC_FUNC_STRERROR_R])
- AC_REQUIRE([jm_FUNC_NANOSLEEP])
- AC_REQUIRE([jm_FUNC_READDIR])
- AC_REQUIRE([jm_FUNC_MEMCMP])
- AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
- AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
AC_REQUIRE([jm_FUNC_GROUP_MEMBER])
- AC_REQUIRE([jm_FUNC_PUTENV])
AC_REQUIRE([jm_AFS])
- AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
- AC_REQUIRE([jm_AC_PREREQ_XSTRTOIMAX])
AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
- AC_REQUIRE([AC_FUNC_ERROR_AT_LINE])
- AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
AC_REQUIRE([jm_FUNC_FPENDING])
+ # This is for od and stat, and any other program that
+ # uses the PRI.MAX macros from inttypes.h.
+ AC_REQUIRE([gt_INTTYPES_PRI])
+
AC_REQUIRE([jm_FUNC_GETGROUPS])
- test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
AC_REQUIRE([AC_FUNC_FSEEKO])
- AC_REQUIRE([AC_FUNC_VPRINTF])
AC_REQUIRE([AC_FUNC_ALLOCA])
+
+ AC_CONFIG_LIBOBJ_DIR([lib])
AC_FUNC_GETLOADAVG([lib])
+
AC_REQUIRE([jm_SYS_PROC_UPTIME])
AC_REQUIRE([jm_FUNC_FTRUNCATE])
- AC_REQUIRE([vb_FUNC_RENAME])
-
- AC_REPLACE_FUNCS(strcasecmp strncasecmp)
- AC_REPLACE_FUNCS(dup2)
- AC_REPLACE_FUNCS(gethostname getusershell)
- AC_REPLACE_FUNCS(sig2str)
- AC_REPLACE_FUNCS(strcspn stpcpy strstr strtol strtoul)
- AC_REPLACE_FUNCS(strpbrk)
- AC_REPLACE_FUNCS(euidaccess memcmp rmdir rpmatch strndup strverscmp)
- AC_REPLACE_FUNCS(atexit)
- AC_REPLACE_FUNCS(getpass)
- dnl used by e.g. intl/*domain.c and lib/canon-host.c
- AC_REPLACE_FUNCS(strdup)
-
- AC_REPLACE_FUNCS(memchr memcpy memmove memrchr memset)
- AC_CHECK_FUNCS(getpagesize)
-
- AC_REQUIRE([UTILS_FUNC_MKSTEMP])
+ # raise is used by at least sort and ls.
+ AC_REPLACE_FUNCS(raise)
# By default, argmatch should fail calling usage (1).
AC_DEFINE(ARGMATCH_DIE, [usage (1)],
AC_FUNC_SETVBUF_REVERSED
# used by sleep and shred
- # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
- # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
-
- # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
- # programs in the package would end up linked with that potentially-shared
- # library, inducing unnecessary run-time overhead.
- fetish_saved_libs=$LIBS
- AC_SEARCH_LIBS(clock_gettime, [rt posix4],
- [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
- AC_SUBST(LIB_CLOCK_GETTIME)
- AC_CHECK_FUNCS(clock_gettime clock_settime)
- LIBS=$fetish_saved_libs
+ AC_REQUIRE([gl_CLOCK_TIME])
AC_CHECK_FUNCS(gettimeofday)
AC_FUNC_GETTIMEOFDAY_CLOBBER
AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
- AC_REQUIRE([jm_FUNC_UTIME])
AC_CHECK_FUNCS( \
- bcopy \
- canonicalize_file_name \
endgrent \
endpwent \
- fchdir \
fdatasync \
- ftime \
ftruncate \
- getcwd \
gethrtime \
- getmntinfo \
hasmntopt \
isascii \
iswspace \
mempcpy \
mkfifo \
realpath \
- resolvepath \
sethostname \
strchr \
strerror \
strrchr \
+ sysctl \
sysinfo \
wcrtomb \
tzset \
)
- AM_FUNC_GETLINE
- if test $am_cv_func_working_getline != yes; then
- AC_CHECK_FUNCS(getdelim)
- fi
- AC_FUNC_OBSTACK
+ # for test.c
+ AC_CHECK_FUNCS(setreuid setregid)
AC_FUNC_STRTOD
+ AC_REQUIRE([UTILS_SYS_OPEN_MAX])
+ AC_REQUIRE([GL_FUNC_GETCWD_PATH_MAX])
+ AC_REQUIRE([GL_FUNC_READDIR])
# See if linking `seq' requires -lm.
# It does on nearly every system. The single exception (so far) is
jm_FUNC_UNLINK_BUSY_TEXT
# These tests are for df.
- jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
- jm_FSTYPENAME
- jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
- if test $list_mounted_fs = yes && test $space = yes; then
- DF_PROG=df
- AC_LIBOBJ(fsusage)
- AC_LIBOBJ(mountlist)
+ AC_REQUIRE([gl_FSUSAGE])
+ AC_REQUIRE([gl_MOUNTLIST])
+ if test $gl_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
+ DF_PROG='df$(EXEEXT)'
fi
AC_REQUIRE([jm_AC_DOS])
+ AC_REQUIRE([AC_FUNC_CANONICALIZE_FILE_NAME])
+ # If any of these functions don't exist (e.g. DJGPP 2.03),
+ # use the corresponding stub.
+ AC_CHECK_FUNC([fchdir], , [AC_LIBOBJ(fchdir-stub)])
+ AC_CHECK_FUNC([fchown], , [AC_LIBOBJ(fchown-stub)])
])
# These tests must be run before any use of AC_CHECK_TYPE,
AC_CHECK_HEADERS( \
errno.h \
fcntl.h \
- fenv.h \
float.h \
hurd.h \
limits.h \
sys/socket.h \
sys/statfs.h \
sys/statvfs.h \
+ sys/sysctl.h \
sys/systeminfo.h \
sys/time.h \
sys/timeb.h \
])
AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
- AC_REQUIRE([AC_STRUCT_TM])
- AC_REQUIRE([AC_STRUCT_TIMEZONE])
AC_REQUIRE([AC_HEADER_STAT])
AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
- AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC])
AC_REQUIRE([AC_TYPE_GETGROUPS])
AC_REQUIRE([AC_TYPE_MODE_T])
AC_REQUIRE([AC_TYPE_UID_T])
AC_CHECK_TYPE(ino_t, unsigned long)
+ gt_TYPE_SSIZE_T
+
dnl This relies on the fact that autoconf 2.14a's implementation of
dnl AC_CHECK_TYPE checks includes unistd.h.
- AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_TYPE(major_t, unsigned int)
AC_CHECK_TYPE(minor_t, unsigned int)
-#serial 27
+#serial 35
-dnl These are the prerequisite macros for files in the lib/
-dnl directories of the fileutils, sh-utils, and textutils packages.
+dnl We use jm_ for non Autoconf macros.
+m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
+m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
+
+# These are the prerequisite macros for files in the lib/
+# directory of the coreutils package.
AC_DEFUN([jm_PREREQ],
[
- gl_BACKUPFILE
- jm_PREREQ_C_STACK
- gl_CANON_HOST
- gl_DIRNAME
- jm_PREREQ_ERROR
- gl_EXCLUDE
- gl_GETPAGESIZE
- gl_HARD_LOCALE
- gl_HASH
- gl_HUMAN
- gl_MBSWIDTH
- gl_FUNC_MEMCHR
- gl_PHYSMEM
- gl_POSIXVER
- gl_QUOTEARG
- gl_READUTMP
- gl_REGEX
- jm_PREREQ_STAT
- gl_FUNC_STRNLEN
- gl_XGETCWD
- gl_XREADLINK
+ # We don't yet use c-stack.c.
+ # AC_REQUIRE([gl_C_STACK])
+
+ AC_REQUIRE([AM_FUNC_GETLINE])
+ AC_REQUIRE([AM_STDBOOL_H])
+ AC_REQUIRE([UTILS_FUNC_MKDIR_TRAILING_SLASH])
+ AC_REQUIRE([UTILS_FUNC_MKSTEMP])
+ AC_REQUIRE([gl_BACKUPFILE])
+ AC_REQUIRE([gl_CANON_HOST])
+ AC_REQUIRE([gl_CLOSEOUT])
+ AC_REQUIRE([gl_DIRNAME])
+ AC_REQUIRE([gl_ERROR])
+ AC_REQUIRE([gl_EXCLUDE])
+ AC_REQUIRE([gl_EXITFAIL])
+ AC_REQUIRE([gl_FILEBLOCKS])
+ AC_REQUIRE([gl_FILEMODE])
+ AC_REQUIRE([gl_FILE_TYPE])
+ AC_REQUIRE([gl_FSUSAGE])
+ AC_REQUIRE([gl_FUNC_ALLOCA])
+ AC_REQUIRE([gl_FUNC_ATEXIT])
+ AC_REQUIRE([gl_FUNC_DUP2])
+ AC_REQUIRE([gl_FUNC_EUIDACCESS])
+ AC_REQUIRE([gl_FUNC_FNMATCH_GNU])
+ AC_REQUIRE([gl_FUNC_GETHOSTNAME])
+ AC_REQUIRE([gl_FUNC_GETLOADAVG])
+ AC_REQUIRE([gl_FUNC_GETPASS])
+ AC_REQUIRE([gl_FUNC_GETUSERSHELL])
+ AC_REQUIRE([gl_FUNC_MEMCHR])
+ AC_REQUIRE([gl_FUNC_MEMCPY])
+ AC_REQUIRE([gl_FUNC_MEMMOVE])
+ AC_REQUIRE([gl_FUNC_MEMRCHR])
+ AC_REQUIRE([gl_FUNC_MEMSET])
+ AC_REQUIRE([gl_FUNC_MKTIME])
+ AC_REQUIRE([gl_FUNC_READLINK])
+ AC_REQUIRE([gl_FUNC_RMDIR])
+ AC_REQUIRE([gl_FUNC_RPMATCH])
+ AC_REQUIRE([gl_FUNC_SIG2STR])
+ AC_REQUIRE([gl_FUNC_STPCPY])
+ AC_REQUIRE([gl_FUNC_STRCSPN])
+ AC_REQUIRE([gl_FUNC_STRDUP])
+ AC_REQUIRE([gl_FUNC_STRNDUP])
+ AC_REQUIRE([gl_FUNC_STRNLEN])
+ AC_REQUIRE([gl_FUNC_STRPBRK])
+ AC_REQUIRE([gl_FUNC_STRSTR])
+ AC_REQUIRE([gl_FUNC_STRTOD])
+ AC_REQUIRE([gl_FUNC_STRTOIMAX])
+ AC_REQUIRE([gl_FUNC_STRTOLL])
+ AC_REQUIRE([gl_FUNC_STRTOL])
+ AC_REQUIRE([gl_FUNC_STRTOULL])
+ AC_REQUIRE([gl_FUNC_STRTOUL])
+ AC_REQUIRE([gl_FUNC_STRTOUMAX])
+ AC_REQUIRE([gl_FUNC_STRVERSCMP])
+ AC_REQUIRE([gl_FUNC_VASNPRINTF])
+ AC_REQUIRE([gl_FUNC_VASPRINTF])
+ AC_REQUIRE([gl_GETDATE])
+ AC_REQUIRE([gl_GETNDELIM2])
+ AC_REQUIRE([gl_GETOPT])
+ AC_REQUIRE([gl_GETPAGESIZE])
+ AC_REQUIRE([gl_HARD_LOCALE])
+ AC_REQUIRE([gl_HASH])
+ AC_REQUIRE([gl_HUMAN])
+ AC_REQUIRE([gl_MBSWIDTH])
+ AC_REQUIRE([gl_MEMCOLL])
+ AC_REQUIRE([gl_MODECHANGE])
+ AC_REQUIRE([gl_MOUNTLIST])
+ AC_REQUIRE([gl_OBSTACK])
+ AC_REQUIRE([gl_PATHMAX])
+ AC_REQUIRE([gl_PATH_CONCAT])
+ AC_REQUIRE([gl_PHYSMEM])
+ AC_REQUIRE([gl_POSIXTM])
+ AC_REQUIRE([gl_POSIXVER])
+ AC_REQUIRE([gl_QUOTEARG])
+ AC_REQUIRE([gl_QUOTE])
+ AC_REQUIRE([gl_READUTMP])
+ AC_REQUIRE([gl_REGEX])
+ AC_REQUIRE([gl_SAFE_READ])
+ AC_REQUIRE([gl_SAFE_WRITE])
+ AC_REQUIRE([gl_SAME])
+ AC_REQUIRE([gl_SAVEDIR])
+ AC_REQUIRE([gl_SAVE_CWD])
+ AC_REQUIRE([gl_SETTIME])
+ AC_REQUIRE([gl_SHA])
+ AC_REQUIRE([gl_STDIO_SAFER])
+ AC_REQUIRE([gl_STRCASE])
+ AC_REQUIRE([gl_TIMESPEC])
+ AC_REQUIRE([gl_UNICODEIO])
+ AC_REQUIRE([gl_UNISTD_SAFER])
+ AC_REQUIRE([gl_USERSPEC])
+ AC_REQUIRE([gl_UTIMENS])
+ AC_REQUIRE([gl_XALLOC])
+ AC_REQUIRE([gl_XGETCWD])
+ AC_REQUIRE([gl_XREADLINK])
+ AC_REQUIRE([gl_XSTRTOD])
+ AC_REQUIRE([gl_XSTRTOL])
+ AC_REQUIRE([gl_YESNO])
+ AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
+ AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
+ AC_REQUIRE([jm_FUNC_LSTAT])
+ AC_REQUIRE([jm_FUNC_MALLOC])
+ AC_REQUIRE([jm_FUNC_MEMCMP])
+ AC_REQUIRE([jm_FUNC_NANOSLEEP])
+ AC_REQUIRE([jm_FUNC_PUTENV])
+ AC_REQUIRE([jm_FUNC_REALLOC])
+ AC_REQUIRE([jm_FUNC_STAT])
+ AC_REQUIRE([jm_FUNC_UTIME])
+ AC_REQUIRE([jm_PREREQ_ADDEXT])
+ AC_REQUIRE([jm_PREREQ_STAT])
+ AC_REQUIRE([jm_XSTRTOIMAX])
+ AC_REQUIRE([jm_XSTRTOUMAX])
+ AC_REQUIRE([vb_FUNC_RENAME])
+])
+
+AC_DEFUN([jm_PREREQ_ADDEXT],
+[
+ dnl For addext.c.
+ AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
+ AC_CHECK_FUNCS(pathconf)
+ AC_CHECK_HEADERS(limits.h string.h unistd.h)
])
AC_DEFUN([jm_PREREQ_STAT],
AC_CHECK_HEADERS(sys/sysmacros.h sys/statvfs.h sys/vfs.h inttypes.h)
AC_CHECK_HEADERS(sys/param.h sys/mount.h)
AC_CHECK_FUNCS(statvfs)
- jm_AC_TYPE_LONG_LONG
+
+ # For `struct statfs' on Ultrix 4.4.
+ AC_CHECK_HEADERS([netinet/in.h nfs/nfs_clnt.h nfs/vfs.h],,,
+ [AC_INCLUDES_DEFAULT])
+
+ AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
statxfs_includes="\
$ac_includes_default
#if HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif
-#if ( ! HAVE_SYS_STATVFS_H && ! HAVE_SYS_VFS_H && HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H )
+#if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H
+# if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
/* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
-# include <sys/param.h>
-# include <sys/mount.h>
+# include <sys/param.h>
+# include <sys/mount.h>
+# elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
+/* Ultrix 4.4 needs these for the declaration of struct statfs. */
+# include <netinet/in.h>
+# include <nfs/nfs_clnt.h>
+# include <nfs/vfs.h>
+# endif
#endif
"
AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])