summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in2
-rw-r--r--aclocal.m479
-rw-r--r--config.hin3
-rw-r--r--src/Makefile.in5
4 files changed, 82 insertions, 7 deletions
diff --git a/Makefile.in b/Makefile.in
index aee2b2a2d..7b1bd2c17 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -211,7 +211,7 @@ $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): configure.ac m4/acl.m4 m4/afs.m4 m4/assert.m4 m4/bison.m4 m4/boottime.m4 m4/c-stack.m4 m4/canonicalize.m4 m4/check-decl.m4 m4/chown.m4 m4/codeset.m4 m4/d-ino.m4 m4/d-type.m4 m4/dirfd.m4 m4/dos.m4 m4/error.m4 m4/fpending.m4 m4/fstypename.m4 m4/fsusage.m4 m4/ftruncate.m4 m4/ftw.m4 m4/getcwd.m4 m4/getgroups.m4 m4/getline.m4 m4/gettext.m4 m4/gettimeofday.m4 m4/glibc.m4 m4/glibc21.m4 m4/group-member.m4 m4/host-os.m4 m4/iconv.m4 m4/intdiv0.m4 m4/inttypes-pri.m4 m4/inttypes.m4 m4/isc-posix.m4 m4/jm-glibc-io.m4 m4/jm-macros.m4 m4/jm-mktime.m4 m4/jm-winsz1.m4 m4/jm-winsz2.m4 m4/lchown.m4 m4/lcmessage.m4 m4/lib-check.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/link-follow.m4 m4/longlong.m4 m4/ls-mntd-fs.m4 m4/lstat.m4 m4/mbrtowc.m4 m4/mbswidth.m4 m4/memcmp.m4 m4/mkdir-slash.m4 m4/mkstemp.m4 m4/nanosleep.m4 m4/perl.m4 m4/prereq.m4 m4/progtest.m4 m4/putenv.m4 m4/regex.m4 m4/rename.m4 m4/rmdir-errno.m4 m4/search-libs.m4 m4/st_dm_mode.m4 m4/st_mtim.m4 m4/stat.m4 m4/stdbool.m4 m4/strftime.m4 m4/timespec.m4 m4/unlink-busy.m4 m4/uptime.m4 m4/utimbuf.m4 m4/utime.m4 m4/utimes.m4 m4/xstrtoimax.m4 m4/xstrtoumax.m4
+$(ACLOCAL_M4): configure.ac m4/acl.m4 m4/afs.m4 m4/assert.m4 m4/bison.m4 m4/boottime.m4 m4/c-stack.m4 m4/canonicalize.m4 m4/check-decl.m4 m4/chown.m4 m4/codeset.m4 m4/d-ino.m4 m4/d-type.m4 m4/dirfd.m4 m4/dos.m4 m4/error.m4 m4/fpending.m4 m4/fstypename.m4 m4/fsusage.m4 m4/ftruncate.m4 m4/ftw.m4 m4/getcwd.m4 m4/getgroups.m4 m4/getline.m4 m4/gettext.m4 m4/gettimeofday.m4 m4/glibc.m4 m4/glibc21.m4 m4/group-member.m4 m4/host-os.m4 m4/iconv.m4 m4/intdiv0.m4 m4/inttypes-pri.m4 m4/inttypes.m4 m4/isc-posix.m4 m4/jm-glibc-io.m4 m4/jm-macros.m4 m4/jm-mktime.m4 m4/jm-winsz1.m4 m4/jm-winsz2.m4 m4/lchown.m4 m4/lcmessage.m4 m4/lib-check.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/link-follow.m4 m4/longlong.m4 m4/ls-mntd-fs.m4 m4/lstat.m4 m4/mbrtowc.m4 m4/mbswidth.m4 m4/memcmp.m4 m4/mkdir-slash.m4 m4/mkstemp.m4 m4/nanosleep.m4 m4/open-max.m4 m4/perl.m4 m4/prereq.m4 m4/progtest.m4 m4/putenv.m4 m4/regex.m4 m4/rename.m4 m4/rmdir-errno.m4 m4/search-libs.m4 m4/st_dm_mode.m4 m4/st_mtim.m4 m4/stat.m4 m4/stdbool.m4 m4/strftime.m4 m4/timespec.m4 m4/unlink-busy.m4 m4/uptime.m4 m4/utimbuf.m4 m4/utime.m4 m4/utimes.m4 m4/xstrtoimax.m4 m4/xstrtoumax.m4
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
diff --git a/aclocal.m4 b/aclocal.m4
index 5093bca74..42b8eb14d 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -825,7 +825,7 @@ WARNING: You don't seem to have perl5.003 or newer installed, or you lack
] )
])
-#serial 57 -*- autoconf -*-
+#serial 58 -*- autoconf -*-
dnl Misc type-related macros for fileutils, sh-utils, textutils.
@@ -995,6 +995,7 @@ AC_DEFUN([jm_MACROS],
AC_FUNC_OBSTACK
AC_FUNC_STRTOD
+ AC_REQUIRE([UTILS_SYS_OPEN_MAX])
# See if linking `seq' requires -lm.
# It does on nearly every system. The single exception (so far) is
@@ -1167,7 +1168,7 @@ AC_DEFUN([AC_ISC_POSIX],
]
)
-#serial 13
+#serial 14
dnl Initially derived from code in GNU grep.
dnl Mostly written by Jim Meyering.
@@ -1224,6 +1225,16 @@ AC_DEFUN([jm_INCLUDED_REGEX],
if (re_match (&regex, "an", 2, 0, &regs) != 2)
exit (1);
+ memset (&regex, 0, sizeof (regex));
+ s = re_compile_pattern ("x", 1, &regex);
+ if (s)
+ exit (1);
+
+ /* The version of regex.c in e.g. GNU libc-2.2.93 didn't
+ work with a negative RANGE argument. */
+ if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+ exit (1);
+
exit (0);
}
],
@@ -2453,13 +2464,17 @@ AC_DEFUN([AC_FUNC_GETCWD_NULL],
[Define if getcwd (NULL, 0) allocates memory for result.])
fi])
-#serial 2
+#serial 4
dnl Find out how to get the file descriptor associated with an open DIR*.
dnl From Jim Meyering
AC_DEFUN([UTILS_FUNC_DIRFD],
[
+ dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
+ AC_REQUIRE([AC_PROG_CPP])
+ AC_REQUIRE([AC_PROG_EGREP])
+
AC_HEADER_DIRENT
dirfd_headers='
#if HAVE_DIRENT_H
@@ -2516,7 +2531,7 @@ AC_DEFUN([UTILS_FUNC_DIRFD],
ac_cv_sys_dir_fd_member_name=$ac_expr
]
)
- if test $ac_cv_have_decl_dirfd = -1; then
+ if test $ac_cv_have_decl_dirfd = no; then
AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
$ac_cv_sys_dir_fd_member_name,
[the name of the file descriptor member of DIR])
@@ -2558,6 +2573,10 @@ AC_DEFUN([AC_FUNC_ACL],
#serial 1
# Use the replacement ftw.c if the one in the C library is inadequate or buggy.
+# For now, we always use the code in lib/ because libc doesn't have the FTW_DCH
+# or FTW_DCHP that we need. Arrange to use lib/ftw.h. And since that
+# implementation uses tsearch.c/tdestroy, add tsearch.o to the list of
+# objects and arrange to use lib/search.h if necessary.
# From Jim Meyering
AC_DEFUN([AC_FUNC_FTW],
@@ -2571,10 +2590,12 @@ AC_DEFUN([AC_FUNC_FTW],
# see if we'll also need the replacement tsearch.c.
AC_CHECK_FUNC([tdestroy], , [need_tdestroy=1])
- AC_CACHE_CHECK([for working GNU ftw], ac_cv_func_ftw_working,
+ AC_CACHE_CHECK([for ftw/FTW_CHDIR that informs callback of failed chdir],
+ ac_cv_func_ftw_working,
[
# The following test would fail prior to glibc-2.3.2, because `depth'
- # would be 2 rather than 4.
+ # would be 2 rather than 4. Of course, now that we require FTW_DCH
+ # and FTW_DCHP, this test fails even with GNU libc's fixed ftw.
mkdir -p conftest.dir/a/b/c
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
@@ -2598,6 +2619,10 @@ cb (const char *file, const struct stat *sb, int file_type, struct FTW *info)
int
main ()
{
+ /* Require these symbols, too. */
+ int d1 = FTW_DCH;
+ int d2 = FTW_DCHP;
+
int err = nftw ("conftest.dir", cb, 30, FTW_PHYS | FTW_MOUNT | FTW_CHDIR);
exit ((err == 0 && depth == 4) ? 0 : 1);
}
@@ -3562,6 +3587,48 @@ AC_DEFUN([AM_FUNC_GETLINE],
fi
])
+#serial 1
+# Determine approximately how many files may be open simultaneously
+# in one process. This is approximate, since while running this test,
+# the configure script already has a few files open.
+# From Jim Meyering
+
+AC_DEFUN([UTILS_SYS_OPEN_MAX],
+[
+ AC_CACHE_CHECK([determine how many files may be open simultaneously],
+ utils_cv_sys_open_max,
+ [
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+ int
+ main ()
+ {
+ FILE *result = fopen ("conftest.omax", "w");
+ int i = 1;
+ /* Impose an arbitrary limit, in case some system has no
+ effective limit on the number of simultaneously open files. */
+ while (i < 30000)
+ {
+ FILE *s = fopen ("conftest.op", "w");
+ if (!s)
+ break;
+ ++i;
+ }
+ fprintf (result, "%d\n", i);
+ exit (fclose (result) == EOF);
+ }
+ ]])],
+ [utils_cv_sys_open_max=`cat conftest.omax`],
+ [utils_cv_sys_open_max='internal error in open-max.m4'],
+ [utils_cv_sys_open_max='cross compiling run-test in open-max.m4'])])
+
+ AC_DEFINE_UNQUOTED([UTILS_OPEN_MAX],
+ $utils_cv_sys_open_max,
+ [the maximum number of simultaneously open files per process])
+])
+
# codeset.m4 serial AM1 (gettext-0.10.40)
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
diff --git a/config.hin b/config.hin
index 869280d6c..eee1e9694 100644
--- a/config.hin
+++ b/config.hin
@@ -1270,6 +1270,9 @@
<sys/cpustats.h>. */
#undef UMAX4_3
+/* the maximum number of simultaneously open files per process */
+#undef UTILS_OPEN_MAX
+
/* Version number of package */
#undef VERSION
diff --git a/src/Makefile.in b/src/Makefile.in
index 7b08cf8ee..9fd9f030f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1540,9 +1540,14 @@ check-README:
# Make sure we don't define any S_IS* macros in src/*.c files.
# Not a big deal, but they're already defined via system.h.
+#
+# Also make sure we don't use st_blocks. Use ST_NBLOCKS instead.
+# This is a bit of a kludge, since it prevents use of the string
+# even in comments, but for now it does the job with no false positives.
.PHONY: check-misc
check-misc:
grep '^# *define *S_IS' $(SOURCES) && exit 1 || :
+ grep st_blocks $(SOURCES) && exit 1 || :
# FIXME: handle *.sh; and use $(all_programs), not $(SOURCES)
../AUTHORS: $(SOURCES)
rm -f $@-t