summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Dalley <kevin@seti.org>2000-04-12 10:18:08 +0000
committerKevin Dalley <kevin@seti.org>2000-04-12 10:18:08 +0000
commit491aaa41f5ca88418bcf9b85c36bef336ea37401 (patch)
tree82c5bf05180fe6c3d7116b2d231f9743d20fca07
parentd419e9f001cf919abc559de242af408d39dcaf36 (diff)
downloadfindutils-491aaa41f5ca88418bcf9b85c36bef336ea37401.tar.gz
*** empty log message ***
-rw-r--r--.cvsignore1
-rw-r--r--COPYING4
-rw-r--r--ChangeLog291
-rw-r--r--Makefile.in180
-rw-r--r--NEWS88
-rw-r--r--TODO63
-rw-r--r--acconfig.h75
-rw-r--r--aclocal.m42015
-rw-r--r--config.h.in858
-rw-r--r--doc/.cvsignore1
-rw-r--r--doc/Makefile.in21
-rw-r--r--doc/find.info64
-rw-r--r--doc/find.info-14
-rw-r--r--doc/find.info-24
-rw-r--r--find/.cvsignore1
-rw-r--r--find/Makefile.in143
-rw-r--r--find/defs.h96
-rw-r--r--find/find.c25
-rw-r--r--find/fstype.c46
-rw-r--r--find/parser.c195
-rw-r--r--find/pred.c288
-rw-r--r--find/testsuite/.cvsignore2
-rw-r--r--find/testsuite/Makefile.in52
-rw-r--r--find/tree.c6
-rw-r--r--find/util.c6
-rw-r--r--intl/ChangeLog5
-rw-r--r--intl/libgettext.h6
-rw-r--r--lib/.cvsignore1
-rw-r--r--lib/Makefile.in277
-rw-r--r--lib/alloca.c10
-rw-r--r--lib/ansi2knr.127
-rw-r--r--lib/ansi2knr.c188
-rw-r--r--lib/dirname.c9
-rw-r--r--lib/error.c14
-rw-r--r--lib/fnmatch.c367
-rw-r--r--lib/fnmatch.h69
-rw-r--r--lib/getopt.h6
-rw-r--r--lib/listfile.c215
-rw-r--r--lib/modechange.c6
-rw-r--r--lib/regex.c578
-rw-r--r--lib/regex.h534
-rw-r--r--lib/savedir.c9
-rw-r--r--lib/strftime.c537
-rw-r--r--lib/strstr.c12
-rw-r--r--locate/.cvsignore1
-rw-r--r--locate/Makefile.in121
-rw-r--r--locate/code.c2
-rw-r--r--locate/frcode.c2
-rw-r--r--locate/locatedb.h8
-rw-r--r--m4/ChangeLog4
-rw-r--r--m4/Makefile.am20
-rw-r--r--m4/Makefile.in40
-rw-r--r--m4/check-decl.m460
-rw-r--r--m4/check-type.m428
-rw-r--r--m4/const.m466
-rw-r--r--m4/decl.m443
-rw-r--r--m4/jm-glibc-io.m410
-rw-r--r--m4/jm-macros.m4157
-rw-r--r--m4/jm-mktime.m416
-rw-r--r--m4/lfs.m444
-rw-r--r--m4/ls-mntd-fs.m445
-rw-r--r--m4/memcmp.m411
-rw-r--r--m4/mktime.m4166
-rw-r--r--m4/perl.m441
-rw-r--r--m4/prereq.m461
-rw-r--r--m4/putenv.m441
-rw-r--r--m4/readdir.m410
-rw-r--r--m4/regex.m422
-rw-r--r--m4/strftime.m421
-rw-r--r--m4/uintmax_t.m46
-rw-r--r--m4/uptime.m418
-rw-r--r--m4/utimbuf.m440
-rw-r--r--m4/utime.m418
-rw-r--r--m4/utimes.m430
-rw-r--r--xargs/.cvsignore1
-rw-r--r--xargs/Makefile.in136
-rw-r--r--xargs/testsuite/.cvsignore1
-rw-r--r--xargs/testsuite/Makefile.in56
-rw-r--r--xargs/xargs.c8
79 files changed, 5358 insertions, 3395 deletions
diff --git a/.cvsignore b/.cvsignore
index ff12ad4f..2af76e8a 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,5 +1,4 @@
Makefile
-Makefile.in
config.cache
config.h
config.log
diff --git a/COPYING b/COPYING
index eeb586b3..d60c31a9 100644
--- a/COPYING
+++ b/COPYING
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
+ Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -313,7 +313,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
- Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
diff --git a/ChangeLog b/ChangeLog
index bed94baa..c30379f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,281 @@
+2000-04-12 Kevin Dalley <kevind@rahul.net>
+
+ * doc/find.texi, doc/permi.texi: fix spellings, add LocalWords.
+
+ * lib/Makefile.am: put getline.c back into libfind_a_SOURCES,
+ since getstr is needed.
+
+ * Version 4.1.5
+
+ * po/POTFILES.in: updated list of files, updated po files.
+
+
+2000-04-02 Paul Eggert <eggert@twinsun.com>
+
+ Add support for large files, and port to Solaris 8 and earlier
+ versions.
+
+ * lib/human.c (getenv): Depend on NEED_GETENV_DECL, not
+ HAVE_DECL_GETENV.
+
+ * lib/strftime.c (my_strftime): Make sure we call the system
+ strftime, not ourselves, when invoking the underlying strftime.
+
+ * m4/check-decl.m4 (jm_CHECK_DECLS): Remove memchr, nanosleep.
+
+ * m4/jm-macros.m4 (jm_MACROS): Don't check for utime.h. Do not
+ require jm_BISON, jm_CHECK_TYPE_STRUCT_UTIMBUF, jm_FUNC_LCHOWN,
+ jm_FUNC_CHOWN, jm_FUNC_NANOSLEEP, jm_FUNC_GROUP_MEMBER,
+ jm_FUNC_PUTENV, jm_FUNC_GETGROUPS, AM_FUNC_GETLOADAVG,
+ jm_SYS_PROC_UPTIME, jm_FUNC_FTRUNCATE, jm_FUNC_UTIME. Do not
+ replace strcasecmp, dup2, gethostname, getusershell, stime,
+ strcspn, strpbrk, euidaccess, mkdir, rmdir, rpmatch, strndup,
+ strverscmp, memchr, memmove. Do not check for declaration of
+ lchown. Remove invocations of AM_FUNC_OBSTACK, AM_FUNC_STRTOD,
+ POW_LIBM, jm_LANGINFO_CODESET, jm_ICONV. Remove df tests.
+ (jm_CHECK_ALL_TYPES): Include <sys/stat.h> when checking for
+ struct stat.st_blksize.
+
+ * m4/strftime.m4 (jm_FUNC_GNU_STRFTIME): Set environment variable
+ in shell rather than using putenv, which isn't portable.
+
+ * COPYING, lib/alloca.c, lib/dirname.c, lib/error.c,
+ lib/savedir.c, lib/strstr.c, m4/check-decl.m4, m4/d-ino.m4,
+ m4/d-type.m4, m4/getline.m4, m4/jm-glibc-io.m4, m4/jm-macros.m4,
+ m4/jm-mktime.m4, m4/ls-mntd-fs.m4, m4/memcmp.m4, m4/prereq.m4,
+ m4/readdir.m4, m4/regex.m4, m4/strftime.m4, m4/uintmax_t.m4: Sync
+ to latest version from sh-utils-2.0g.
+
+ * config.guess, config.sub, lib/argmatch.c, lib/argmatch.h,
+ lib/human.c, lib/human.h, lib/memcpy.c, lib/quotearg.c,
+ lib/quotearg.h, lib/strtoull.c, lib/strtoumax.c,
+ lib/xstrtoumax.c, m4/c-bs-a.m4, m4/gettext.m4,
+ m4/largefile.m4, m4/lcmessage.m4, m4/link-follow.m4,
+ m4/progtest.m4, m4/strerror_r.m4, m4/timespec.m4,
+ m4/xstrtoumax.m4: New files, taken from sh-utils-2.0g.
+
+ * lib/ansi2knr.1, lib/ansi2knr.c, lib/basename.c, lib/getopt.h,
+ lib/fnmatch.c, lib/fnmatch.h, lib/modechange.c: Sync to latest
+ unreleased version of GNU tar (between 1.13.17 and 1.13.18).
+
+ * lib/basename.h, lib/waitpid.c: New files, taken from same
+ version of GNU tar.
+
+ * lib/regex.c, lib/regex.h: Sync to GNU grep 2.4.2.
+
+ * lib/posix/Makefile.am, lib/posix/regex.h: New files, taken from
+ GNU grep 2.4.2.
+
+ * lib/strftime.c: Sync to textutils 2.0e.
+
+ * acconfig.h, depcomp, lib/strcasecmp.c, m4/check-type.m4,
+ m4/const.m4, m4/decl.m4, m4/lfs.m4, m4/mktime.m4, m4/perl.m4,
+ m4/putenv.m4, m4/uptime.m4, m4/utimbuf.m4, m4/utime.m4,
+ m4/utimes.m4: Remove these files; no longer needed.
+
+ * configure.in (AC_CANONICAL_HOST, AC_SYS_LARGEFILE,
+ jm_AC_TYPE_UINTMAX_T): Add.
+ (CACHE_IDS, FSTYPE_STATVFS, FSTYPE_USG_STATFS, FSTYPE_AIX_STATFS,
+ FSTYPE_MNTENT, FSTYPE_STATFS, FSTYPE_GETMNT): Add comment, so that
+ we don't need acconfig.h.
+ (AC_CHECK_TYPE): Add ssize_t.
+ (AC_REPLACE_FUNCS): Add waitpid.
+ (AC_CHECK_FUNCS): Remove basename.
+ (AC_FUNC_MKTIME): Remove.
+ (LIBOBJS): Add no-ops to work around automake 1.4 bug.
+ (AC_OUTPUT): Add lib/posix/Makefile.
+
+ * find/defs.h: Include <config.h>, <sys/types.h>, <sys/stat.h>,
+ <stdio.h>, <limits.h>, <inttypes.h>. All includers changed to not
+ include these files, and to include "defs.h" first (since config.h
+ must be included first).
+ (CHAR_BIT, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
+ S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, MOD_WXUSR,
+ MODE_R, MODE_RW, MODE_RWX, MODE_ALL): New macros.
+ (enum permissions_type): New enum.
+ (struct long_val.negative): New member.
+ (struct long_val.l_val): Now uintmax_t, not unsigned long.
+ (struct size_val.size): Likewise.
+ (struct perm_val): New type.
+ (struct predicate.perm): Now struct perm_val, not unsigned long.
+ (struct predicate.type): Now mode_t, not unsigned long.
+ (list_file): New parameters current_time, output_block_size.
+ All callers changed.
+ (savedir, basename): Remove decls.
+ (output_block_size, start_time): New extern vars.
+
+ * find/find.c: Include <human.h>, <savedir.h>.
+ (output_block_size, start_time): New vars.
+ (main): Initialize them. No need to check for negative st_size,
+ since savedir now does it for us.
+
+ * find/fstype.c: Include "dirname.h".
+ (xatoi): Remove.
+ (filesystem_type_uncached): Use xstrtoumax instead of xatoi.
+
+ * find/parser.c: Include "xstrtol.h".
+ (get_num_days, get_num, parse_amin, parse_cmin, parse_mmin,
+ parse_size, parse_used, insert_time, insert_num): Compute using
+ uintmax_t, not unsigned long.
+ (parse_amin, parse_cmin, parse_mmin, parse_used, insert_time):
+ Keep track of whether time was negative before converting it to an
+ unsigned type.
+ (parse_daystart): Don't assume that localtime succeeds; e.g. it
+ can fail with 64-bit time_t and 32-bit tm_year.
+ (parse_perm, insert_type): Compute using mode_t, not unsigned
+ long.
+ (insert_type): Use symbolic constants like MODE_ALL instead of
+ traditional ones like 07777. Set new kind member to indicate
+ permissions type, instead of using unportable magic numbers.
+ (make_segment): We will use human_readable to convert most numeric
+ values, so simplify the cases.
+ (get_num_days): Write in terms of get_num, to avoid duplicated
+ code.
+ (insert_time, insert_num): When debugging, convert large values to
+ uintmax_t and output with %ju.
+ (get_num): Use xstrtoumax to do the real work.
+
+ * find/pred.c: Include "basename.h", "human.h".
+ (DEV_BSIZE, ST_BLKSIZE, ST_NBLOCKSIZE): New macros, taken from
+ fileutils.
+ (ST_NBLOCKS): Replace with fileutils defn.
+ (MAX): New macro.
+ (ctime_format): New function.
+ (pred_fprintf, format_date): Use human_readable to output large
+ numbers portably.
+ (pred_fprintf): Use ctime_format to output ctime-style dates. Use
+ base_name to compute the base name of a path. With %m, output the
+ mode portably using traditional numbers, even if the host uses
+ some other numbering scheme.
+ (pred_iname, pred_name): basename -> base_name.
+ (pred_perm): Use new kind member to deduce permissions type,
+ instead of relying on magic numbers.
+ (pred_size): Compute using uintmax_t, not unsigned long. Avoid
+ overflow if file size is near the maximum.
+ (pred_type): Compute using mode_t, not unsigned long.
+ (launch): Use waitpid, not wait. Check for EINTR.
+ (format_date): Don't assume that localtime succeeds.
+
+ * find/util.c (basename): Remove; we now use base_name.
+
+ * lib/Makefile.am (SUBDIRS): New macro.
+ (libfind_a_SOURCES): Add argmatch.h, argmatch.c, basename.h,
+ basename.c, human.c, human.h, quotearg.c, quotearg.h, xstrtoumax.c.
+ Remove error.h, error.c, getline.c.
+ (EXTRA_DIST): Add mktime.c, regex.c.
+
+ * lib/listfile.c: Include "human.h".
+ (alloca): Declare, or include appropriate files to declare.
+ (DEV_BSIZE, ST_NBLKSIZE, ST_NBLOCKS, ST_NBLOCKSIZE): New macros.
+ (convert_blocks): Remove.
+ (list_file): New current_time and output_block_size args.
+ Revamp quite a bit, to handle large numbers correctly
+ and to match GNU ls behavior more closely.
+
+ * m4/Makefile.am (EXTRA_DIST): Add c-bs-a.m4, gettext.m4,
+ largefile.m4, lcmessage.m4, link-follow.m4, progtest.m4,
+ strerror_r.m4, xstrtoumax.m4. Remove check-type.m4, const.m4,
+ decl.m4, lfs.m4, mktime.m4, perl.m4, putenv.m4, timespec.m4,
+ uptime.m4, utimbuf.m4, utime.m4, utimes.m4.
+
+ * xargs/xargs.c (wait_for_proc): Retry wait if it fails with
+ errno == EINTR.
+
+2000-04-05 Kevin Dalley <kevind@rahul.net>
+
+ * xargs/Makefile.am: add ansi2knr
+
+ * xargs/xargs.c: add macros PARAMS rather than P_. Add
+ prototypes.
+
+ * po/POTFILES: new file listing all POFILES.
+
+ * m4/gl.po, m4/et.po: new files
+
+ * m4/Makefile.am.in: updated file
+
+ * m4: update directory
+
+ * locate/Makefile.am: create updatedb from updatedb.sh
+
+ * locate/updatedb.sh, locate/updatedb.in: removed file. Replaced
+ by updatedb.sh
+
+ * locate/frcode.c, locate/code.c, locate/bigram.c: add macros
+ PARAMS rather than P_. Add prototypes.
+
+ * lib/xstat.in: new file
+
+ * lib/Makefile.am: update to latest versions of library files.
+
+ * find/testsuite/Makefile.am: add CLEANFILES
+
+ * find/util.c: remove definition of basename
+
+ * find/util.c, find/tree.c, find/pred.c, find/parser.c,
+ find/fstype.c, find/find.c, find/defs.h: add macros PARAMS rather
+ than P_, for consistency, change to prototypes
+
+ * find/Makefile.am: Add prototypes and ansi2knr
+
+ * configure.in: add Galition and Estonian languages.
+ Miscellaneous other fixes.
+
+
+2000-03-11 Kevin Dalley <kevind@rahul.net>
+
+ * lib/basename.c: Add file from libit.
+ * lib/Makefile.am (libfind_a_SOURCES): add basename.c since it is
+ no longer replaceable.
+
+ * find/util.c: Remove definition of basename, which is now in
+ lib/basename.c (as base_name).
+ * find/pred.c: Use base_name, not basename.
+ * find/defs.h: Likewise.
+
+ * configure.in : Don't replace basename. Now we use only
+ base_name.
+
+2000-02-26 Kevin Dalley <kevind@rahul.net>
+
+ * Version 4.1.4
+
+ * lib/strtoul.c: added to distribution
+
+ * configure.in: added strtoul to AC_REPLACE_FUNCS
+
+ * configure.in: added jm_CHECK_ALL_TYPE
+
+2000-02-23 Kevin Dalley <kevind@rahul.net>
+
+ * po/ChangeLog: removed, merged with top-level ChangeLog.
+
+ * po/de.po: new version of German file.
+
+ * po/gl.po, po/et.po: new languages, Estonian and Galician.
+
+ * locate/updatedb.sh (PRUNEFS): enclose paths in quotes
+
+2000-02-17 Kevin Dalley <kevind@rahul.net>
+
+ * po/it.po: new version of Italian file.
+
+ * locate/updatedb.sh (prunefs_exp): have sed statement use '*'
+ rather than the often unsupported '+'.
+
+2000-02-13 Kevin Dalley <kevind@rahul.net>
+
+ * configure.in: removed AC_ARG_PROGRAM, which is already in
+ AM_INIT_AUTOMAKE.
+
+ * locate/Makefile.am (updatedb), locate/updatedb.sh: add
+ transforms of find, frcode, bigram, and code back into
+ updatedb.sh, which were accidentally removed.
+
+2000-02-12 Kevin Dalley <kevind@rahul.net>
+
+ * lib/wait.h: updated address.
+
2000-01-26 Kevin Dalley <kevind@rahul.net>
* Version 4.1.3
@@ -14,6 +292,17 @@
* xargs/Makefile.am, xargs/xargs.c: internationalized directory.
+2000-01-26 Kevin Dalley <kevind@rahul.net>
+
+ * POTFILES.in: added list of files with translatable strings.
+
+ * de.po, es.po, fr.po, it.po, ko.po, nl.po, pl.po, pt_BR.po,
+ ru.po, sv.po: New, slightly out of date, files imported from the
+ Translation Project: http://www.iro.umontreal.ca/contrib/po/HTML/,
+ German, Spanish, French, Italian, Korean, Dutch, Polish, Brazilian
+ Portuguese.
+
+
2000-01-24 Kevin Dalley <kevind@rahul.net>
* lib/xmalloc.c, lib/regex.c, lib/getopt.c: internationalization
@@ -41,7 +330,7 @@
2000-01-22 Kevin Dalley <kevind@rahul.net>
- * added po and intl directories.
+ * added intl directory.
* Added internationalization, only with slightly out of date po
files for many locales.
diff --git a/Makefile.in b/Makefile.in
index 62e07d29..427d54e8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,7 +10,6 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-
SHELL = @SHELL@
srcdir = @srcdir@
@@ -32,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -46,9 +43,10 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
@@ -57,14 +55,27 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+
+@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
+AMDEP = @AMDEP@
+AMTAR = @AMTAR@
+AWK = @AWK@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
+DEPDIR = @DEPDIR@
+DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
+GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
+GNU_PACKAGE = @GNU_PACKAGE@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INCLUDES = @INCLUDES@
@@ -75,8 +86,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
+MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
+OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@@ -85,51 +99,56 @@ U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
+install_sh = @install_sh@
l = @l@
+
AUTOMAKE_OPTIONS = gnits readme-alpha
-EXTRA_DIST = COPYING ChangeLog TODO install-sh config.h.in stamp-h.in THANKS
+EXTRA_DIST = COPYING ChangeLog TODO install-sh config.h.in stamp-h.in \
+ THANKS
SUBDIRS = lib intl find xargs locate doc m4 po
ACLOCAL_AMFLAGS = -I m4
DISTCLEANFILES = intl/libintl.h
+subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
+DIST_SOURCES =
DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \
INSTALL Makefile.am Makefile.in NEWS README-alpha THANKS TODO \
-acconfig.h aclocal.m4 config.h.in configure configure.in install-sh \
-missing mkinstalldirs
+aclocal.m4 config.guess config.h.in config.sub configure configure.in \
+install-sh missing mkinstalldirs
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-$(ACLOCAL_M4): configure.in m4/assert.m4 m4/check-decl.m4 \
- m4/check-type.m4 m4/const.m4 m4/decl.m4 m4/error.m4 \
+$(ACLOCAL_M4): configure.in m4/afs.m4 m4/assert.m4 m4/c-bs-a.m4 \
+ m4/check-decl.m4 m4/d-ino.m4 m4/d-type.m4 m4/error.m4 \
m4/fnmatch.m4 m4/fstypename.m4 m4/getline.m4 \
- m4/glibc.m4 m4/inttypes_h.m4 m4/isc-posix.m4 \
- m4/jm-glibc-io.m4 m4/jm-macros.m4 m4/jm-mktime.m4 \
- m4/lfs.m4 m4/ls-mntd-fs.m4 m4/lstat.m4 m4/malloc.m4 \
- m4/memcmp.m4 m4/mktime.m4 m4/perl.m4 m4/prereq.m4 \
- m4/putenv.m4 m4/readdir.m4 m4/realloc.m4 m4/regex.m4 \
+ m4/gettext.m4 m4/glibc.m4 m4/inttypes_h.m4 \
+ m4/isc-posix.m4 m4/jm-glibc-io.m4 m4/jm-macros.m4 \
+ m4/jm-mktime.m4 m4/largefile.m4 m4/lcmessage.m4 \
+ m4/link-follow.m4 m4/ls-mntd-fs.m4 m4/lstat-slash.m4 \
+ m4/lstat.m4 m4/malloc.m4 m4/memcmp.m4 m4/prereq.m4 \
+ m4/progtest.m4 m4/readdir.m4 m4/realloc.m4 m4/regex.m4 \
m4/st_dm_mode.m4 m4/st_mtim.m4 m4/stat.m4 \
- m4/strftime.m4 m4/uintmax_t.m4 m4/uptime.m4 \
- m4/utimbuf.m4 m4/utime.m4 m4/utimes.m4
+ m4/strerror_r.m4 m4/strftime.m4 m4/timespec.m4 \
+ m4/uintmax_t.m4 m4/ulonglong.m4 m4/xstrtoumax.m4
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -143,18 +162,22 @@ config.h: stamp-h
$(MAKE) stamp-h; \
else :; fi
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h stamp-hT
+ @echo timestamp > stamp-hT 2> /dev/null
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
$(SHELL) ./config.status
- @echo timestamp > stamp-h 2> /dev/null
-$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
+ @mv stamp-hT stamp-h
+$(srcdir)/config.h.in: $(srcdir)/./stamp-h.in
@if test ! -f $@; then \
- rm -f $(srcdir)/stamp-h.in; \
- $(MAKE) $(srcdir)/stamp-h.in; \
+ rm -f $(srcdir)/./stamp-h.in; \
+ $(MAKE) $(srcdir)/./stamp-h.in; \
else :; fi
-$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ @rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT
+ @echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null
cd $(top_srcdir) && $(AUTOHEADER)
- @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
+ @mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in
mostlyclean-hdr:
@@ -172,8 +195,6 @@ maintainer-clean-hdr:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
-@SET_MAKE@
-
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@@ -201,7 +222,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
- test "$$subdir" = "." && dot_seen=yes; \
+ if test "$$subdir" = "."; then dot_seen=yes; else :; fi; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
@@ -222,15 +243,17 @@ tags-recursive:
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -fID $$unique $(LISP)
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -238,12 +261,14 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LI
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)
mostlyclean-tags:
@@ -257,58 +282,71 @@ maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
+
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
- -rm -rf $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
- dc_install_base=`cd $(distdir)/=inst && pwd`; \
- cd $(distdir)/=build \
- && ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \
+ chmod a-w $(distdir)
+ dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
+ && cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ --with-included-gettext \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) dist
- -rm -rf $(distdir)
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && test `find $$dc_install_base -type f -print | wc -l` -le 1 \
+ && chmod -R u+w .. \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && $(MAKE) $(AM_MAKEFLAGS) distclean \
+ && rm -f $(distdir).tar.gz \
+ && test `find . -type f -print | wc -l` -eq 0
+ -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
@banner="$(distdir).tar.gz is ready for distribution"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"
dist: distdir
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
+ -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
dist-all: distdir
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
+ -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
distdir: $(DISTFILES)
@if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" > /dev/null; then :; else \
echo "NEWS not updated; not releasing" 1>&2; \
exit 1; \
fi
- -rm -rf $(distdir)
+ -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
mkdir $(distdir)
- -chmod 777 $(distdir)
- here=`cd $(top_builddir) && pwd`; \
- top_distdir=`cd $(distdir) && pwd`; \
- distdir=`cd $(distdir) && pwd`; \
- cd $(top_srcdir) \
- && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
else \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
for subdir in $(SUBDIRS); do \
@@ -316,7 +354,6 @@ distdir: $(DISTFILES)
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
- chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
@@ -346,7 +383,7 @@ uninstall: uninstall-recursive
all-am: Makefile config.h
all-redirect: all-recursive-am
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs: installdirs-recursive
installdirs-am:
@@ -361,6 +398,7 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-recursive
@@ -383,7 +421,8 @@ maintainer-clean: maintainer-clean-recursive
-rm -f config.status
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-install-data-recursive uninstall-data-recursive install-exec-recursive \
+install-recursive uninstall-recursive install-data-recursive \
+uninstall-data-recursive install-exec-recursive \
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
@@ -391,9 +430,10 @@ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
install-exec-am install-exec install-data-am install-data install-am \
-install uninstall-am uninstall all-redirect all-am all installdirs-am \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+install uninstall-am uninstall all-redirect all-am all install-strip \
+installdirs-am installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/NEWS b/NEWS
index 4fdfeb25..0474bfaf 100644
--- a/NEWS
+++ b/NEWS
@@ -1,58 +1,74 @@
-Major changes in release 4.1.3:
-* added internationalization and localization.
+GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
+* Major changes in release 4.1.5:
+Add support for large files
-Major changes in release 4.1.1:
-* attempt at successful compilation on many platforms after years of neglect
-* "--existing" option added to locate "--prunefs" option added to updatedb
+* Major changes in release 4.1.4:
+bug fixes, more up-to-date languages.
-Major changes in release 4.1:
+* Major changes in release 4.1.3:
+added internationalization and localization.
-* Distribution renamed to findutils.
-* updatedb is now a user command, installed in $exec_prefix/bin
+* Major changes in release 4.1.1:
+attempt at successful compilation on many platforms after years of neglect
+ "--existing" option added to locate "--prunefs" option added to updatedb
+
+* Major changes in release 4.1:
+
+** Distribution renamed to findutils.
+** updatedb is now a user command, installed in $exec_prefix/bin
instead of $exec_prefix/libexec.
-* A few problems in Makefiles and testsuite corrected.
+** A few problems in Makefiles and testsuite corrected.
-Major changes in release 4.0:
+* Major changes in release 4.0:
-* Documentation:
-** Texinfo manual.
-** Man page for updatedb.
-** Man page for the locate database formats.
+** Documentation:
+*** Texinfo manual.
+*** Man page for updatedb.
+*** Man page for the locate database formats.
-* find:
-** Takes less CPU time on long paths, because it uses chdir to descend
+** find:
+*** Takes less CPU time on long paths, because it uses chdir to descend
trees, so it does fewer inode lookups.
-** Does not get trapped in symbolic link loops when -follow is given.
-** Supports "-fstype afs" if you have /afs and /usr/afsws/include
+*** Does not get trapped in symbolic link loops when -follow is given.
+*** Supports "-fstype afs" if you have /afs and /usr/afsws/include
and you configure using the --with-afs option.
-** New action -fls FILE; like -ls but writes to FILE.
+*** New action -fls FILE; like -ls but writes to FILE.
-* locate:
-** Supports a new database format, which is 8-bit clean and
- allows machines with diffent byte orderings and integer sizes to
+** locate:
+*** Supports a new database format, which is 8-bit clean and
+ allows machines with different byte orderings and integer sizes to
share the databases. The new locate can also detect and read the
old database format automatically. The new databases are typically
30% or more larger than the old ones (due to allowing all 8 bits in
file names). Search times are approximately the same, or faster on
some systems.
-** Warns if a file name database is more than 8 days old.
+*** Warns if a file name database is more than 8 days old.
-* updatedb:
-** Takes command-line options.
+** updatedb:
+*** Takes command-line options.
-* xargs:
-** Performance improved 10-20%.
-** The EOF string is not used when -0 is given.
-** Now has a test suite. Some minor bugs fixed as a result.
+** xargs:
+*** Performance improved 10-20%.
+*** The EOF string is not used when -0 is given.
+*** Now has a test suite. Some minor bugs fixed as a result.
-Major changes in release 3.8:
+* Major changes in release 3.8:
-* case insensitive versions of -lname, -name, -path, -regex:
+** case insensitive versions of -lname, -name, -path, -regex:
-ilname, -iname, -ipath, -iregex
-* %F directive for -printf, -fprintf to print file system type
+** %F directive for -printf, -fprintf to print file system type
-Major changes in release 3.7:
+* Major changes in release 3.7:
+
+** locate can search multiple databases
+** locate has an option to specify the database path
+** updatedb no longer goes into an infinite loop with some versions of tail
+
+ --//--
+This is used by Emacs' spell checker ispell.el:
-* locate can search multiple databases
-* locate has an option to specify the database path
-* updatedb no longer goes into an infinite loop with some versions of tail
+LocalWords: ansi knr strftime xargs updatedb sh fnmatch hin strcpy
+LocalWords: lib getstr getline frcode bigram texi depcomp automake
+LocalWords: strncasecmp strcasecmp LIBOBJS FUNC prunefs allout libexec
+LocalWords: testsuite Texinfo chdir inode fstype afs fls ls EOF lname
+LocalWords: regex ilname iname ipath iregex printf fprintf
diff --git a/TODO b/TODO
index df9f1673..5da7f765 100644
--- a/TODO
+++ b/TODO
@@ -1,28 +1,59 @@
-There are many bugs to be fixed and features to be added to
-findutils. The current distribution is a snapshot which fixes many
+-*-outline-*-
+* There are many bugs to be fixed and features to be added to findutils.
+The current distribution is a snapshot which fixes many
problems, but leaves others unsolved. Many of the known problems are
not listed below. Over the next few releases, I hope to fix more
items, and add the unfixed problems below.
-Is ansi2knr internationalized? Does it need to be?
-Should these files be internationalized?
+* Internationalization
+** Is ansi2knr internationalized? Does it need to be?
+
+** Should these files be internationalized?
strftime.c
-Should translated long options be offered in locate and xargs?
-updatedb.sh should be internationalized as well
-Add case insensitive locate option. Patch is available.
+** Should translated long options be offered in locate and xargs?
+** updatedb.sh should be internationalized as well
+
+* new standards with Austin group
+** "-H" and "-L" options to find were added by Austin group standards.
+They need to be implemented.
+
+**Austin added the following options to xargs:
+-I perhaps replaces -i
+
+-L perhaps replaces -l
+
+-E slightly different from -e
+
-Should fnmatch.h be a link to fnmatch.hin. See tar distribution for
-an example.
+* Add case insensitive locate option. Patch is available.
-Eliminate unnecessary strcpy calls in xargs.
+* Should fnmatch.h be a link to fnmatch.hin?
+See tar distribution for an example.
-lib/getline.c contains a function getstr which is needed in locate,
+* Eliminate unnecessary strcpy calls in xargs.
+
+* lib/getline.c
+getline.c contains a function getstr which is needed in locate,
but is not in the standard library. In fact getstr is in curses.
This problem needs to be fixed. Can getstr be removed? Can getline.c
-be optionally included?
+be optionally included, or is it mandatory?
+
+* man pages for frcode, bigram, and code
+Perhaps a better description in texi pages as well.
+
+* large file problems
+depcomp gets added by automake
+strncasecmp is needed
+which requires strcasecmp
+getline.c temporarily removed from Makefile.am
+remove getline.o from LIBOBJS
+remove extra AM_FUNC_GETLINE
+
+
+ --//--
+This is used by Emacs' spell checker ispell.el:
-Files which were modified in findutils/lib:
-changed in findutils:
-getline.c (skipped for now)
-nextelem.c (twice)
+LocalWords: ansi knr strftime xargs updatedb sh fnmatch hin strcpy
+LocalWords: lib getstr getline frcode bigram texi depcomp automake
+LocalWords: strncasecmp strcasecmp LIBOBJS FUNC
diff --git a/acconfig.h b/acconfig.h
deleted file mode 100644
index c0235efb..00000000
--- a/acconfig.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Entries for config.h.in that aren't automatically generated. */
-
-/* Define if you have the Andrew File System. */
-#undef AFS
-
-/* Define If you want find -nouser and -nogroup to make tables of
- used UIDs and GIDs at startup instead of using getpwuid or
- getgrgid when needed. Speeds up -nouser and -nogroup unless you
- are running NIS or Hesiod, which make password and group calls
- very expensive. */
-#undef CACHE_IDS
-
-/* Define to use SVR4 statvfs to get filesystem type. */
-#undef FSTYPE_STATVFS
-
-/* Define to use SVR3.2 statfs to get filesystem type. */
-#undef FSTYPE_USG_STATFS
-
-/* Define to use AIX3 statfs to get filesystem type. */
-#undef FSTYPE_AIX_STATFS
-
-/* Define to use 4.3BSD getmntent to get filesystem type. */
-#undef FSTYPE_MNTENT
-
-/* Define to use 4.4BSD and OSF1 statfs to get filesystem type. */
-#undef FSTYPE_STATFS
-
-/* Define to use Ultrix getmnt to get filesystem type. */
-#undef FSTYPE_GETMNT
-
-/* Define to `unsigned long' if <sys/types.h> doesn't define. */
-#undef dev_t
-
-/* Define to `unsigned long' if <sys/types.h> doesn't define. */
-#undef ino_t
-
-/* Define to rpl_fnmatch if the replacement function should be used. */
-#undef fnmatch
-
-/* Define to 1 if assertions should be disabled. */
-#undef NDEBUG
-
-/* Define to rpl_malloc if the replacement function should be used. */
-#undef malloc
-
-/* Define to rpl_memcmp if the replacement function should be used. */
-#undef memcmp
-
-/* Define to gnu_mktime if the replacement function should be used. */
-#undef mktime
-
-/* Define to rpl_realloc if the replacement function should be used. */
-#undef realloc
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef ssize_t
-
-/* Define to `unsigned long' or `unsigned long long'
- if <inttypes.h> doesn't define. */
-#undef uintmax_t
-
-/* Define if your locale.h file contains LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
-
-/* Define to 1 if NLS is requested. */
-#undef ENABLE_NLS
-
-/* Define as 1 if you have catgets and don't want to use GNU gettext. */
-#undef HAVE_CATGETS
-
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-#undef HAVE_GETTEXT
-
-/* Define as 1 if you have the stpcpy function. */
-#undef HAVE_STPCPY
diff --git a/aclocal.m4 b/aclocal.m4
index f939f3d3..a4a70094 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4
+dnl aclocal.m4 generated automatically by aclocal 1.4a
-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -44,12 +44,15 @@ dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AC_PROG_INSTALL])
+dnl We require 2.13 because we rely on SHELL being computed by configure.
+AC_PREREQ([2.13])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
dnl test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
@@ -57,14 +60,24 @@ AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
-dnl FIXME This is truly gross.
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
-AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
-AC_REQUIRE([AC_PROG_MAKE_SET])])
+AM_MISSING_PROG(ACLOCAL, aclocal)
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake)
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG(AMTAR, tar)
+AM_MISSING_INSTALL_SH
+dnl We need awk for the "check" target. The system "awk" is bad on
+dnl some platforms.
+AC_REQUIRE([AC_PROG_AWK])
+AC_REQUIRE([AC_PROG_MAKE_SET])
+AC_REQUIRE([AM_DEP_TRACK])
+AC_REQUIRE([AM_SET_DEPDIR])
+ifdef([AC_PROVIDE_AC_PROG_CC], [AM_DEPENDENCIES(CC)], [
+ define([AC_PROG_CC], defn([AC_PROG_CC])[AM_DEPENDENCIES(CC)])])
+ifdef([AC_PROVIDE_AC_PROG_CXX], [AM_DEPENDENCIES(CXX)], [
+ define([AC_PROG_CXX], defn([AC_PROG_CXX])[AM_DEPENDENCIES(CXX)])])
+])
#
# Check to make sure that the build environment is sane.
@@ -109,21 +122,192 @@ fi
rm -f conftest*
AC_MSG_RESULT(yes)])
-dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
-dnl The program must properly implement --version.
-AC_DEFUN(AM_MISSING_PROG,
-[AC_MSG_CHECKING(for working $2)
-# Run test in a subshell; some versions of sh will print an error if
-# an executable is not found, even if stderr is redirected.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if ($2 --version) < /dev/null > /dev/null 2>&1; then
- $1=$2
- AC_MSG_RESULT(found)
+dnl AM_MISSING_PROG(NAME, PROGRAM)
+AC_DEFUN(AM_MISSING_PROG, [
+AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+dnl Like AM_MISSING_PROG, but only looks for install-sh.
+dnl AM_MISSING_INSTALL_SH()
+AC_DEFUN(AM_MISSING_INSTALL_SH, [
+AC_REQUIRE([AM_MISSING_HAS_RUN])
+if test -z "$install_sh"; then
+ install_sh="$ac_aux_dir/install-sh"
+ test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh"
+ test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh"
+ dnl FIXME: an evil hack: we remove the SHELL invocation from
+ dnl install_sh because automake adds it back in. Sigh.
+ install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`"
+fi
+AC_SUBST(install_sh)])
+
+dnl AM_MISSING_HAS_RUN.
+dnl Define MISSING if not defined so far and test if it supports --run.
+dnl If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN], [
+test x"${MISSING+set}" = xset || \
+ MISSING="\${SHELL} `CDPATH=: && cd $ac_aux_dir && pwd`/missing"
+dnl Use eval to expand $SHELL
+if eval "$MISSING --run :"; then
+ am_missing_run="$MISSING --run "
else
- $1="$3/missing $2"
- AC_MSG_RESULT(missing)
+ am_missing_run=
+ am_backtick='`'
+ AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
fi
-AC_SUBST($1)])
+])
+
+dnl See how the compiler implements dependency checking.
+dnl Usage:
+dnl AM_DEPENDENCIES(NAME)
+dnl NAME is "CC", "CXX" or "OBJC".
+
+dnl We try a few techniques and use that to set a single cache variable.
+
+AC_DEFUN(AM_DEPENDENCIES,[
+AC_REQUIRE([AM_SET_DEPDIR])
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])
+ifelse([$1],CC,[
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CPP])
+depcc="$CC"
+depcpp="$CPP"],[$1],CXX,[
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+depcc="$CXX"
+depcpp="$CXXCPP"],[$1],OBJC,[
+am_cv_OBJC_dependencies_compiler_type=gcc],[
+AC_REQUIRE([AC_PROG_][$1])
+depcc="$[$1]"
+depcpp=""])
+AC_MSG_CHECKING([dependency style of $depcc])
+AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[
+if test -z "$AMDEP"; then
+ echo '#include "conftest.h"' > conftest.c
+ echo 'int i;' > conftest.h
+
+ am_cv_[$1]_dependencies_compiler_type=none
+ for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do
+ case "$depmode" in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ if depmode="$depmode" \
+ source=conftest.c object=conftest.o \
+ depfile=conftest.Po tmpdepfile=conftest.TPo \
+ $SHELL $am_depcomp $depcc -c conftest.c 2>/dev/null &&
+ grep conftest.h conftest.Po > /dev/null 2>&1; then
+ am_cv_[$1]_dependencies_compiler_type="$depmode"
+ break
+ fi
+ done
+
+ rm -f conftest.*
+else
+ am_cv_[$1]_dependencies_compiler_type=none
+fi
+])
+AC_MSG_RESULT($am_cv_[$1]_dependencies_compiler_type)
+[$1]DEPMODE="depmode=$am_cv_[$1]_dependencies_compiler_type"
+AC_SUBST([$1]DEPMODE)
+])
+
+dnl Choose a directory name for dependency files.
+dnl This macro is AC_REQUIREd in AM_DEPENDENCIES
+
+AC_DEFUN(AM_SET_DEPDIR,[
+if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+ DEPDIR=.deps
+else
+ DEPDIR=_deps
+fi
+AC_SUBST(DEPDIR)
+])
+
+AC_DEFUN(AM_DEP_TRACK,[
+AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" = xno; then
+ AMDEP="#"
+else
+ am_depcomp="$ac_aux_dir/depcomp"
+ if test ! -f "$am_depcomp"; then
+ AMDEP="#"
+ else
+ AMDEP=
+ fi
+fi
+AC_SUBST(AMDEP)
+if test -z "$AMDEP"; then
+ AMDEPBACKSLASH='\'
+else
+ AMDEPBACKSLASH=
+fi
+pushdef([subst], defn([AC_SUBST]))
+subst(AMDEPBACKSLASH)
+popdef([subst])
+])
+
+dnl Generate code to set up dependency tracking.
+dnl This macro should only be invoked once -- use via AC_REQUIRE.
+dnl Usage:
+dnl AM_OUTPUT_DEPENDENCY_COMMANDS
+
+dnl
+dnl This code is only required when automatic dependency tracking
+dnl is enabled. FIXME. This creates each `.P' file that we will
+dnl need in order to bootstrap the dependency handling code.
+AC_DEFUN(AM_OUTPUT_DEPENDENCY_COMMANDS,[
+AC_OUTPUT_COMMANDS([
+test x"$AMDEP" != x"" ||
+for mf in $CONFIG_FILES; do
+ case "$mf" in
+ Makefile) dirpart=.;;
+ */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+ *) continue;;
+ esac
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
+ $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+], [AMDEP="$AMDEP"
+ac_aux_dir="$ac_aux_dir"])])
#serial 1
dnl This test replaces the one in autoconf.
@@ -200,9 +384,10 @@ ac_save_CC="$CC"
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
@@ -252,171 +437,419 @@ case "x$am_cv_prog_cc_stdc" in
esac
])
-#serial 1
-
-dnl Just like AC_C_CONST from autoconf-2.12, but with an initializer
-dnl for `charset x' and with
-dnl AC_DEFINE(const, )
-dnl changed to
-dnl AC_DEFINE_UNQUOTED(const, [/* empty */])
-dnl to avoid this warning:
-dnl [...]/m4: Warning: Excess arguments to built-in `define' ignored
-
-undefine([AC_C_CONST])
-AC_DEFUN(AC_C_CONST,
-[dnl This message is consistent in form with the other checking messages,
-dnl and with the result message.
-AC_CACHE_CHECK([for working const], ac_cv_c_const,
-[AC_TRY_COMPILE(,
-changequote(<<, >>)dnl
-<<
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x = {0, 0};
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
->>,
-changequote([, ])dnl
-ac_cv_c_const=yes, ac_cv_c_const=no)])
-if test $ac_cv_c_const = no; then
- AC_DEFINE_UNQUOTED(const, [/* empty */])
-fi
-])
-
-#serial 1
-
-dnl Just like AC_CHECK_TYPE from autoconf-2.12, but also checks in unistd.h
-dnl on systems that have it. Fujitsu UXP/V needs this for ssize_t.
-
-undefine([AC_CHECK_TYPE])
-dnl AC_CHECK_TYPE(TYPE, DEFAULT)
-AC_DEFUN(AC_CHECK_TYPE,
-[AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_CHECK_HEADERS(unistd.h)
-AC_MSG_CHECKING(for $1)
-AC_CACHE_VAL(ac_cv_type_$1,
-[AC_EGREP_CPP(dnl
-changequote(<<,>>)dnl
-<<$1[^a-zA-Z_0-9]>>dnl
-changequote([,]), [#include <sys/types.h>
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
-AC_MSG_RESULT($ac_cv_type_$1)
-if test $ac_cv_type_$1 = no; then
- AC_DEFINE($1, $2)
-fi
-])
+#serial 8
+
+dnl By default, many hosts won't let programs access large files;
+dnl one must use special compiler options to get large-file access to work.
+dnl For more details about this brain damage please see:
+dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
+
+dnl Written by Paul Eggert <eggert@twinsun.com>.
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
+AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
+ [AC_CACHE_CHECK([for $1 value to request large file support],
+ ac_cv_sys_largefile_$1,
+ [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2
+ then
+ ac_cv_sys_largefile_$1=`cat conftest.1`
+ else
+ ac_cv_sys_largefile_$1=no
+ ifelse($1, CFLAGS,
+ [case "$host_os" in
+ # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1.
+[ hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)]
+ if test "$GCC" = yes; then
+ ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__
+ fi
+ ;;
+ # IRIX 6.2 and later require cc -n32.
+[ irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)]
+ if test "$GCC" != yes; then
+ ac_cv_sys_largefile_CFLAGS=-n32
+ fi
+ esac
+ if test "$ac_cv_sys_largefile_CFLAGS" != no; then
+ ac_save_CC="$CC"
+ CC="$CC $ac_cv_sys_largefile_CFLAGS"
+ AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
+ CC="$ac_save_CC"
+ fi])
+ fi
+ rm -f conftest*])])
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
+AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
+ [case $2 in
+ no) ;;
+ ?*)
+ case "[$]$1" in
+ '') $1=$2 ;;
+ *) $1=[$]$1' '$2 ;;
+ esac ;;
+ esac])
+
+dnl Internal subroutine of AC_SYS_LARGEFILE.
+dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
+AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
+ [AC_CACHE_CHECK([for $1], $2,
+ [$2=no
+ $4
+ for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+ case "$ac_flag" in
+ -D$1)
+ $2=1 ;;
+ -D$1=*)
+ $2=`expr " $ac_flag" : '[[^=]]*=\(.*\)'` ;;
+ esac
+ done
+ ])
+ if test "[$]$2" != no; then
+ AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
+ fi])
+
+AC_DEFUN(AC_SYS_LARGEFILE,
+ [AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_ARG_ENABLE(largefile,
+ [ --disable-largefile omit support for large files])
+ if test "$enable_largefile" != no; then
+ AC_CHECK_TOOL(GETCONF, getconf)
+ AC_SYS_LARGEFILE_FLAGS(CFLAGS)
+ AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
+ AC_SYS_LARGEFILE_FLAGS(LIBS)
+
+ for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
+ case "$ac_flag" in
+ no) ;;
+ -D_FILE_OFFSET_BITS=*) ;;
+ -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
+ -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
+ -D?* | -I?*)
+ AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
+ *)
+ AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
+ esac
+ done
+ AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
+ AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
+ AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
+ ac_cv_sys_file_offset_bits,
+ [Number of bits in a file offset, on hosts where this is settable.],
+ [case "$host_os" in
+ # HP-UX 10.20 and later
+[ hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)]
+ ac_cv_sys_file_offset_bits=64 ;;
+ esac])
+ AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
+ ac_cv_sys_largefile_source,
+ [Define to make fseeko etc. visible, on some hosts.],
+ [case "$host_os" in
+ # HP-UX 10.20 and later
+[ hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)]
+ ac_cv_sys_largefile_source=1 ;;
+ esac])
+ AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
+ ac_cv_sys_large_files,
+ [Define for large files, on AIX-style hosts.],
+ [case "$host_os" in
+ # AIX 4.2 and later
+[ aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)]
+ ac_cv_sys_large_files=1 ;;
+ esac])
+ fi
+ ])
-#serial 2
+#serial 13, with several lines deleted for fileutils.
dnl Misc type-related macros for fileutils, sh-utils, textutils.
AC_DEFUN(jm_MACROS,
[
+ AC_PREREQ(2.14a)
+
+ GNU_PACKAGE="GNU $PACKAGE"
+ AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
+ [The concatenation of the strings `GNU ', and PACKAGE.])
+ AC_SUBST(GNU_PACKAGE)
+
+ AC_SUBST(OPTIONAL_BIN_PROGS)
+ AC_SUBST(OPTIONAL_BIN_ZCRIPTS)
+ AC_SUBST(MAN)
+ AC_SUBST(DF_PROG)
+
dnl This macro actually runs replacement code. See isc-posix.m4.
AC_REQUIRE([AC_ISC_POSIX])dnl
- AC_REQUIRE([jm_WITH_REGEX])
+ AC_CHECK_HEADERS( \
+ errno.h \
+ fcntl.h \
+ fenv.h \
+ float.h \
+ limits.h \
+ memory.h \
+ mntent.h \
+ mnttab.h \
+ netdb.h \
+ paths.h \
+ stdlib.h \
+ stddef.h \
+ string.h \
+ sys/acl.h \
+ sys/filsys.h \
+ sys/fs/s5param.h \
+ sys/fs_types.h \
+ sys/fstyp.h \
+ sys/ioctl.h \
+ sys/mntent.h \
+ sys/mount.h \
+ sys/param.h \
+ sys/socket.h \
+ sys/statfs.h \
+ sys/statvfs.h \
+ sys/systeminfo.h \
+ sys/time.h \
+ sys/timeb.h \
+ sys/vfs.h \
+ sys/wait.h \
+ syslog.h \
+ termios.h \
+ unistd.h \
+ values.h \
+ )
+
+ jm_INCLUDED_REGEX([lib/regex.c])
+
AC_REQUIRE([jm_ASSERT])
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
- AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
- AC_CHECK_TYPE(ssize_t, int)
- AC_REQUIRE([jm_STRUCT_UTIMBUF])
+ AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
+ AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
AC_REQUIRE([jm_CHECK_DECLS])
AC_REQUIRE([jm_PREREQ])
AC_REQUIRE([jm_FUNC_MKTIME])
AC_REQUIRE([jm_FUNC_LSTAT])
+ AC_REQUIRE([jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
AC_REQUIRE([jm_FUNC_STAT])
AC_REQUIRE([jm_FUNC_REALLOC])
AC_REQUIRE([jm_FUNC_MALLOC])
+ AC_REQUIRE([jm_FUNC_STRERROR_R])
AC_REQUIRE([jm_FUNC_READDIR])
AC_REQUIRE([jm_FUNC_MEMCMP])
AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
AC_REQUIRE([jm_FUNC_FNMATCH])
+ AC_REQUIRE([jm_AFS])
+ AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
+ AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
+ AC_REQUIRE([AM_FUNC_ERROR_AT_LINE])
+ AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
+ AC_REQUIRE([jm_FUNC_MKTIME])
+
+ AC_REQUIRE([AC_FUNC_VPRINTF])
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+
+ AC_REPLACE_FUNCS(strncasecmp)
+ AC_REPLACE_FUNCS(stpcpy strstr strtol strtoul)
+ AC_REPLACE_FUNCS(memcmp)
+
+ dnl used by e.g. intl/*domain.c and lib/canon-host.c
+ AC_REPLACE_FUNCS(strdup)
+
+ AC_REPLACE_FUNCS(memcpy memset)
+ AC_CHECK_FUNCS(getpagesize)
+
+ # By default, argmatch should fail calling usage (1).
+ AC_DEFINE(ARGMATCH_DIE, [usage (1)],
+ [Define to the function xargmatch calls on failures.])
+ AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
+ [Define to the declaration of the xargmatch failure function.])
+
+ dnl Used to define SETVBUF in sys2.h.
+ dnl This evokes the following warning from autoconf:
+ dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
+ 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.
+ AC_SEARCH_LIBS(clock_gettime, [rt posix4])
+ AC_CHECK_FUNCS(clock_gettime)
+ AC_CHECK_FUNCS(gettimeofday)
+
+ AC_CHECK_FUNCS(getdelim)
+
+ AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
+
+ AC_CHECK_FUNCS( \
+ acl \
+ bcopy \
+ endgrent \
+ endpwent \
+ fchdir \
+ fdatasync \
+ fseeko \
+ ftime \
+ ftruncate \
+ getcwd \
+ gethrtime \
+ getmntinfo \
+ hasmntopt \
+ isascii \
+ listmntent \
+ localeconv \
+ memcpy \
+ mempcpy \
+ mkfifo \
+ realpath \
+ resolvepath \
+ sethostname \
+ strchr \
+ strerror \
+ strrchr \
+ sysinfo \
+ tzset \
+ )
+
+ AM_FUNC_GETLINE
+ if test $am_cv_func_working_getline != yes; then
+ AC_CHECK_FUNCS(getdelim)
+ fi
])
-#serial 2
+AC_DEFUN(jm_CHECK_ALL_TYPES,
+[
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_REQUIRE([AC_C_BIGENDIAN])
+ AC_REQUIRE([AC_PROG_CC_STDC])
+ AC_REQUIRE([AC_C_CONST])
+ AC_REQUIRE([AC_C_VOLATILE])
+ AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([AC_C_LONG_DOUBLE])
+
+ AC_REQUIRE([AC_HEADER_DIRENT])
+ AC_REQUIRE([AC_HEADER_STDC])
+ AC_CHECK_MEMBERS((struct stat.st_blksize),,,[$ac_includes_default
+#include <sys/stat.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_OFF_T])
+ AC_REQUIRE([AC_TYPE_PID_T])
+ AC_REQUIRE([AC_TYPE_SIGNAL])
+ AC_REQUIRE([AC_TYPE_SIZE_T])
+ AC_REQUIRE([AC_TYPE_UID_T])
+ AC_CHECK_TYPE(ino_t, unsigned long)
+
+ 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_REQUIRE([jm_AC_TYPE_UINTMAX_T])
+ AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
+
+ AC_REQUIRE([AC_HEADER_MAJOR])
+ AC_REQUIRE([AC_HEADER_DIRENT])
+
+])
-dnl Derived from code in GNU grep.
+#serial 7
-AC_DEFUN(jm_WITH_REGEX,
+dnl Initially derived from code in GNU grep.
+dnl Mostly written by Jim Meyering.
+
+dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
+dnl
+AC_DEFUN(jm_INCLUDED_REGEX,
[
dnl Even packages that don't use regex.c can use this macro.
dnl Of course, for them it doesn't do anything.
- syscmd([test -f lib/regex.c])
+ # Assume we'll default to using the included regex.c.
+ ac_use_included_regex=yes
+
+ # However, if the system regex support is good enough that it passes the
+ # the following run test, then default to *not* using the included regex.c.
+ # If cross compiling, assume the test would fail and use the included
+ # regex.c. The first failing regular expression is from `Spencer ere
+ # test #75' in grep-2.3.
+ AC_CACHE_CHECK([for working re_compile_pattern],
+ jm_cv_func_working_re_compile_pattern,
+ AC_TRY_RUN(
+[#include <stdio.h>
+#include <regex.h>
+ int
+ main ()
+ {
+ static struct re_pattern_buffer regex;
+ const char *s;
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+ /* Add this third left square bracket, [, to balance the
+ three right ones below. Otherwise autoconf-2.14 chokes. */
+ s = re_compile_pattern ("a[[:]:]]b\n", 9, &regex);
+ /* This should fail with _Invalid character class name_ error. */
+ if (!s)
+ exit (1);
+
+ /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
+ s = re_compile_pattern ("{1", 2, &regex);
+
+ exit (s ? 1 : 0);
+ }
+ ],
+ jm_cv_func_working_re_compile_pattern=yes,
+ jm_cv_func_working_re_compile_pattern=no,
+ dnl When crosscompiling, assume it's broken.
+ jm_cv_func_working_re_compile_pattern=no))
+ if test $jm_cv_func_working_re_compile_pattern = yes; then
+ ac_use_included_regex=no
+ fi
+
+ test -n "$1" || AC_MSG_ERROR([missing argument])
+ syscmd([test -f $1])
ifelse(sysval, 0,
[
+
AC_ARG_WITH(included-regex,
- [ --without-included-regex don't compile regex (use with caution)],
+ [ --without-included-regex don't compile regex; this is the default on
+ systems with version 2 of the GNU C library
+ (use with caution on other system)],
jm_with_regex=$withval,
- jm_with_regex=yes)
+ jm_with_regex=$ac_use_included_regex)
if test "$jm_with_regex" = yes; then
- LIBOBJS="$LIBOBJS regex.o"
+ AC_SUBST(LIBOBJS)
+ LIBOBJS="$LIBOBJS regex.$ac_objext"
fi
],
)
]
)
-#serial 1
+#serial 2
dnl based on code from Eleftherios Gkioulekas
AC_DEFUN(jm_ASSERT,
[
AC_MSG_CHECKING(whether to enable assertions)
AC_ARG_ENABLE(assert,
- [ --disable-assert turn off assertions],
- [ AC_MSG_RESULT(no)
- AC_DEFINE(NDEBUG) ],
- [ AC_MSG_RESULT(yes) ]
+ [ --disable-assert turn off assertions],
+ [ AC_MSG_RESULT(no)
+ AC_DEFINE(NDEBUG,1,[Define to 1 if assertions should be disabled.]) ],
+ [ AC_MSG_RESULT(yes) ]
)
])
-#serial 2
+#serial 3
dnl From Paul Eggert.
@@ -425,12 +858,6 @@ dnl From Paul Eggert.
AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
[
- if test x = y; then
- dnl This code is deliberately never run via ./configure.
- dnl FIXME: this is a gross hack to make autoheader put an entry
- dnl for `HAVE_INTTYPES_H' in config.h.in.
- AC_CHECK_FUNCS(INTTYPES_H)
- fi
AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
[AC_TRY_COMPILE(
[#include <sys/types.h>
@@ -439,180 +866,231 @@ AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
jm_ac_cv_header_inttypes_h=yes,
jm_ac_cv_header_inttypes_h=no)])
if test $jm_ac_cv_header_inttypes_h = yes; then
- ac_kludge=HAVE_INTTYPES_H
- AC_DEFINE_UNQUOTED($ac_kludge)
+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
+[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
fi
])
-#serial 1
-
-dnl From Paul Eggert.
-
-# Define uintmax_t to `unsigned long' or `unsigned long long'
-# if <inttypes.h> does not exist.
-
-AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
-[
- AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
- if test $jm_ac_cv_header_inttypes_h = no; then
- AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
- [AC_TRY_COMPILE([],
- [unsigned long long i = (unsigned long long) -1;],
- ac_cv_type_unsigned_long_long=yes,
- ac_cv_type_unsigned_long_long=no)])
- if test $ac_cv_type_unsigned_long_long = yes; then
- AC_DEFINE(uintmax_t, unsigned long long)
- else
- AC_DEFINE(uintmax_t, unsigned long)
- fi
- fi
-])
+#serial 3
-#serial 1
+dnl From Jim Meyering.
+dnl
+dnl Check whether struct dirent has a member named d_type.
+dnl
-dnl From Jim Meyering
+AC_DEFUN(jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE,
+ [AC_REQUIRE([AC_HEADER_DIRENT])dnl
+ AC_CACHE_CHECK([for d_type member in directory struct],
+ jm_cv_struct_dirent_d_type,
+ [AC_TRY_LINK(dnl
+ [
+#include <sys/types.h>
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#else /* not HAVE_DIRENT_H */
+# define dirent direct
+# ifdef HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif /* HAVE_SYS_NDIR_H */
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif /* HAVE_SYS_DIR_H */
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# endif /* HAVE_NDIR_H */
+#endif /* HAVE_DIRENT_H */
+ ],
+ [struct dirent dp; dp.d_type = 0;],
+
+ jm_cv_struct_dirent_d_type=yes,
+ jm_cv_struct_dirent_d_type=no)
+ ]
+ )
+ if test $jm_cv_struct_dirent_d_type = yes; then
+ AC_DEFINE(D_TYPE_IN_DIRENT, 1,
+ [Define if there is a member named d_type in the struct describing
+ directory headers.])
+ fi
+ ]
+)
-dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
-dnl usually in <utime.h>.
-dnl Some systems have utime.h but don't declare the struct anywhere.
+#serial 3
-AC_DEFUN(jm_STRUCT_UTIMBUF,
-[
- AC_CHECK_HEADERS(utime.h)
- AC_REQUIRE([AC_HEADER_TIME])
- AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
- [AC_TRY_COMPILE(
- [
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef HAVE_UTIME_H
-# include <utime.h>
-#endif
- ],
- [static struct utimbuf x; x.actime = x.modtime;],
- fu_cv_sys_struct_utimbuf=yes,
- fu_cv_sys_struct_utimbuf=no)
- ])
+dnl From Jim Meyering.
+dnl
+dnl Check whether struct dirent has a member named d_ino.
+dnl
- if test $fu_cv_sys_struct_utimbuf = yes; then
- if test x = y; then
- # This code is deliberately never run via ./configure.
- # FIXME: this is a hack to make autoheader put the corresponding
- # HAVE_* undef for this symbol in config.h.in. This saves me the
- # trouble of having to maintain the #undef in acconfig.h manually.
- AC_CHECK_FUNCS(STRUCT_UTIMBUF)
- fi
- # Defining it this way (rather than via AC_DEFINE) short-circuits the
- # autoheader check -- autoheader doesn't know it's already been taken
- # care of by the hack above.
- ac_kludge=HAVE_STRUCT_UTIMBUF
- AC_DEFINE_UNQUOTED($ac_kludge)
- fi
-])
+AC_DEFUN(jm_CHECK_TYPE_STRUCT_DIRENT_D_INO,
+ [AC_REQUIRE([AC_HEADER_DIRENT])dnl
+ AC_CACHE_CHECK([for d_ino member in directory struct],
+ jm_cv_struct_dirent_d_ino,
+ [AC_TRY_LINK(dnl
+ [
+#include <sys/types.h>
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#else /* not HAVE_DIRENT_H */
+# define dirent direct
+# ifdef HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif /* HAVE_SYS_NDIR_H */
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif /* HAVE_SYS_DIR_H */
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# endif /* HAVE_NDIR_H */
+#endif /* HAVE_DIRENT_H */
+ ],
+ [struct dirent dp; dp.d_ino = 0;],
+
+ jm_cv_struct_dirent_d_ino=yes,
+ jm_cv_struct_dirent_d_ino=no)
+ ]
+ )
+ if test $jm_cv_struct_dirent_d_ino = yes; then
+ AC_DEFINE(D_INO_IN_DIRENT, 1,
+ [Define if there is a member named d_ino in the struct describing
+ directory headers.])
+ fi
+ ]
+)
-#serial 4
+#serial 9, except remove memchr and nanosleep as findutils doesn't need them
dnl This is just a wrapper function to encapsulate this kludge.
dnl Putting it in a separate file like this helps share it between
dnl different packages.
AC_DEFUN(jm_CHECK_DECLS,
[
+ AC_REQUIRE([_jm_DECL_HEADERS])
+ AC_REQUIRE([AC_HEADER_TIME])
headers='
#include <stdio.h>
-#ifdef HAVE_STRING_H
+#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#else
-# ifdef HAVE_STRINGS_H
+# if HAVE_STRINGS_H
# include <strings.h>
# endif
#endif
-#ifdef HAVE_STDLIB_H
+#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
-#ifdef HAVE_UNISTD_H
+#if HAVE_UNISTD_H
# include <unistd.h>
#endif
-'
- if test x = y; then
- dnl This code is deliberately never run via ./configure.
- dnl FIXME: this is a gross hack to make autoheader put entries
- dnl for each of these symbols in the config.h.in.
- dnl Otherwise, I'd have to update acconfig.h every time I change
- dnl this list of functions.
- AC_CHECK_FUNCS(DECL_FREE DECL_LSEEK DECL_MALLOC DECL_MEMCHR DECL_REALLOC \
- DECL_STPCPY DECL_STRSTR)
- fi
- jm_CHECK_DECLARATIONS($headers, free lseek malloc \
- memchr realloc stpcpy strstr)
-])
-#serial 3
-
-AC_DEFUN(jm_CHECK_DECLARATION,
-[
- AC_REQUIRE([AC_HEADER_STDC])dnl
- test -z "$ac_cv_header_memory_h" && AC_CHECK_HEADERS(memory.h)
- test -z "$ac_cv_header_string_h" && AC_CHECK_HEADERS(string.h)
- test -z "$ac_cv_header_strings_h" && AC_CHECK_HEADERS(strings.h)
- test -z "$ac_cv_header_stdlib_h" && AC_CHECK_HEADERS(stdlib.h)
- test -z "$ac_cv_header_unistd_h" && AC_CHECK_HEADERS(unistd.h)
- AC_MSG_CHECKING([whether $1 is declared])
- AC_CACHE_VAL(jm_cv_func_decl_$1,
- [AC_TRY_COMPILE($2,
- [
-#ifndef $1
-char *(*pfn) = (char *(*)) $1
+#include <sys/types.h>
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
#endif
- ],
- eval "jm_cv_func_decl_$1=yes",
- eval "jm_cv_func_decl_$1=no")])
+'
- if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$3], , :, [$3])
- else
- AC_MSG_RESULT(no)
- ifelse([$4], , , [$4
-])dnl
- fi
-])dnl
+ AC_CHECK_DECLS((
+ free,
+ getenv,
+ geteuid,
+ getlogin,
+ lseek,
+ malloc,
+ realloc,
+ stpcpy,
+ strstr,
+ strtoul,
+ strtoull,
+ ttyname), , , $headers)
+])
-dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
-dnl [, ACTION-IF-NOT-DECLARED]])
-AC_DEFUN(jm_CHECK_DECLARATIONS,
+dnl FIXME: when autoconf has support for it.
+dnl This is a little helper so we can require these header checks.
+AC_DEFUN(_jm_DECL_HEADERS,
[
- for jm_func in $2
- do
- jm_CHECK_DECLARATION($jm_func, $1,
- [
- jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
- AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl
- done
+ AC_REQUIRE([AC_HEADER_STDC])
+ AC_CHECK_HEADERS(memory.h string.h strings.h stdlib.h unistd.h sys/time.h)
])
-#serial 2
+#serial 5
dnl These are the prerequisite macros for files in the lib/
dnl directories of the fileutils, sh-utils, and textutils packages.
AC_DEFUN(jm_PREREQ,
[
+ jm_PREREQ_ADDEXT
+ jm_PREREQ_CANON_HOST
jm_PREREQ_ERROR
+ jm_PREREQ_QUOTEARG
+ jm_PREREQ_READUTMP
jm_PREREQ_REGEX
])
-dnl FIXME: maybe put this in a separate file
+AC_DEFUN(jm_PREREQ_ADDEXT,
+[
+ dnl For addext.c.
+ AC_SYS_LONG_FILE_NAMES
+ AC_CHECK_FUNCS(pathconf)
+ AC_CHECK_HEADERS(limits.h string.h unistd.h)
+])
+
+AC_DEFUN(jm_PREREQ_CANON_HOST,
+[
+ dnl Add any libraries as early as possible.
+ dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
+ dnl so we have to add -lnsl to LIBS before checking for that function.
+ AC_SEARCH_LIBS(gethostbyname, [inet nsl])
+
+ dnl These come from -lnsl on Solaris5.5.1.
+ AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
+
+ AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
+ AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
+ netinet/in.h arpa/inet.h)
+])
+
+AC_DEFUN(jm_PREREQ_QUOTEARG,
+[
+ AC_CHECK_FUNCS(isascii mbrtowc)
+ AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
+ AC_HEADER_STDC
+ AC_C_BACKSLASH_A
+ AM_C_PROTOTYPES
+])
+
+AC_DEFUN(jm_PREREQ_READUTMP,
+[
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS(string.h utmpx.h sys/param.h)
+ AC_CHECK_FUNCS(utmpname)
+ AC_CHECK_FUNCS(utmpxname)
+ AM_C_PROTOTYPES
+
+ utmp_includes="\
+$ac_includes_default
+#ifdef HAVE_UTMPX_H
+# include <utmpx.h>
+#else
+# include <utmp.h>
+#endif
+"
+ AC_CHECK_MEMBERS((struct utmpx.ut_user),,,[$utmp_includes])
+ AC_CHECK_MEMBERS((struct utmp.ut_user),,,[$utmp_includes])
+ AC_CHECK_MEMBERS((struct utmpx.ut_name),,,[$utmp_includes])
+ AC_CHECK_MEMBERS((struct utmp.ut_name),,,[$utmp_includes])
+])
+
AC_DEFUN(jm_PREREQ_REGEX,
[
dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
@@ -638,191 +1116,46 @@ AC_DEFUN(jm_PREREQ_ERROR,
#serial 3
-dnl From Jim Meyering.
-dnl If you use this macro in a package, you should
-dnl add the following two lines to acconfig.h:
-dnl /* Define to rpl_mktime if the replacement function should be used. */
-dnl #undef mktime
-dnl
-AC_DEFUN(jm_FUNC_MKTIME,
-[AC_REQUIRE([jm_AM_FUNC_MKTIME])dnl
-
- dnl mktime.c uses localtime_r if it exists. Check for it.
- AC_CHECK_FUNCS(localtime_r)
-
- if test $jm_am_cv_func_working_mktime = no; then
- AC_DEFINE_UNQUOTED(mktime, rpl_mktime)
- fi
-])
-
-#serial 1001
-
-dnl Just like mktime.m4 from automake-1.3b, but with an additional test.
-dnl Renamed to have jm_ prefix and to use jm_ prefix on cache variable names.
-
-AC_DEFUN(jm_AM_FUNC_MKTIME,
-[AC_REQUIRE([AC_HEADER_TIME])dnl
- AC_CHECK_HEADERS(sys/time.h unistd.h)
- AC_CHECK_FUNCS(alarm)
- AC_CACHE_CHECK([for working mktime], jm_am_cv_func_working_mktime,
- [AC_TRY_RUN(
-changequote(<<, >>)dnl
-<</* Test program from Paul Eggert (eggert@twinsun.com)
- and Tony Leneis (tony@plaza.ds.adp.com). */
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+dnl From Paul Eggert.
-#if !HAVE_ALARM
-# define alarm(X) /* empty */
+AC_DEFUN(AC_C_BACKSLASH_A,
+[
+ AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
+ [AC_TRY_COMPILE([],
+ [
+#if '\a' == 'a'
+ syntax error;
#endif
+ char buf['\a' == 'a' ? -1 : 1];
+ buf[0] = '\a';
+ return buf[0] != "\a"[0];
+ ],
+ ac_cv_c_backslash_a=yes,
+ ac_cv_c_backslash_a=no)])
+ if test $ac_cv_c_backslash_a = yes; then
+ AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
+ [Define if backslash-a works in C strings.])
+ fi
+])
-/* Work around redefinition to rpl_putenv by other config tests. */
-#undef putenv
-
-static time_t time_t_max;
-
-/* Values we'll use to set the TZ environment variable. */
-static const char *const tz_strings[] = {
- (const char *) 0, "TZ=GMT0", "TZ=JST-9",
- "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
-};
-#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
-
-/* Fail if mktime fails to convert a date in the spring-forward gap.
- Based on a problem report from Andreas Jaeger. */
-static void
-spring_forward_gap ()
-{
- /* glibc (up to about 1998-10-07) failed this test) */
- struct tm tm;
-
- /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
- instead of "TZ=America/Vancouver" in order to detect the bug even
- on systems that don't support the Olson extension, or don't have the
- full zoneinfo tables installed. */
- putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
- tm.tm_year = 98;
- tm.tm_mon = 3;
- tm.tm_mday = 5;
- tm.tm_hour = 2;
- tm.tm_min = 0;
- tm.tm_sec = 0;
- tm.tm_isdst = -1;
- if (mktime (&tm) == (time_t)-1)
- exit (1);
-}
-
-static void
-mktime_test (now)
- time_t now;
-{
- struct tm *lt;
- if ((lt = localtime (&now)) && mktime (lt) != now)
- exit (1);
- now = time_t_max - now;
- if ((lt = localtime (&now)) && mktime (lt) != now)
- exit (1);
-}
-
-static void
-irix_6_4_bug ()
-{
- /* Based on code from Ariel Faigon. */
- struct tm tm;
- tm.tm_year = 96;
- tm.tm_mon = 3;
- tm.tm_mday = 0;
- tm.tm_hour = 0;
- tm.tm_min = 0;
- tm.tm_sec = 0;
- tm.tm_isdst = -1;
- mktime (&tm);
- if (tm.tm_mon != 2 || tm.tm_mday != 31)
- exit (1);
-}
+#serial 7
-static void
-bigtime_test (j)
- int j;
-{
- struct tm tm;
- time_t now;
- tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
- /* This test makes some buggy mktime implementations loop.
- Give up after 10 seconds. */
- alarm (10);
- now = mktime (&tm);
- alarm (0);
- if (now != (time_t) -1)
- {
- struct tm *lt = localtime (&now);
- if (! (lt
- && lt->tm_year == tm.tm_year
- && lt->tm_mon == tm.tm_mon
- && lt->tm_mday == tm.tm_mday
- && lt->tm_hour == tm.tm_hour
- && lt->tm_min == tm.tm_min
- && lt->tm_sec == tm.tm_sec
- && lt->tm_yday == tm.tm_yday
- && lt->tm_wday == tm.tm_wday
- && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
- == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
- exit (1);
- }
-}
+dnl From Jim Meyering.
+dnl A wrapper around AC_FUNC_MKTIME.
-int
-main ()
-{
- time_t t, delta;
- int i, j;
-
- spring_forward_gap ();
- for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
- continue;
- time_t_max--;
- delta = time_t_max / 997; /* a suitable prime number */
- for (i = 0; i < N_STRINGS; i++)
- {
- if (tz_strings[i])
- putenv (tz_strings[i]);
+AC_DEFUN(jm_FUNC_MKTIME,
+[AC_REQUIRE([AC_FUNC_MKTIME])dnl
- for (t = 0; t <= time_t_max - delta; t += delta)
- mktime_test (t);
- mktime_test ((time_t) 60 * 60);
- mktime_test ((time_t) 60 * 60 * 24);
+ dnl mktime.c uses localtime_r if it exists. Check for it.
+ AC_CHECK_FUNCS(localtime_r)
- for (j = 1; 0 < j; j *= 2)
- bigtime_test (j);
- bigtime_test (j - 1);
- }
- irix_6_4_bug ();
- exit (0);
-}
- >>,
-changequote([, ])dnl
- jm_am_cv_func_working_mktime=yes, jm_am_cv_func_working_mktime=no,
- dnl When crosscompiling, assume mktime is missing or broken.
- jm_am_cv_func_working_mktime=no)
- ])
- if test $jm_am_cv_func_working_mktime = no; then
- LIBOBJS="$LIBOBJS mktime.o"
- fi
+ if test $ac_cv_func_working_mktime = no; then
+ AC_DEFINE_UNQUOTED(mktime, rpl_mktime,
+ [Define to rpl_mktime if the replacement function should be used.])
+ fi
])
-#serial 2
+#serial 3
dnl From Jim Meyering.
dnl Determine whether lstat has the bug that it succeeds when given the
@@ -854,27 +1187,74 @@ AC_DEFUN(jm_FUNC_LSTAT,
jm_cv_func_lstat_empty_string_bug=yes)
])
if test $jm_cv_func_lstat_empty_string_bug = yes; then
+ AC_SUBST(LIBOBJS)
+ LIBOBJS="$LIBOBJS lstat.$ac_objext"
+ AC_DEFINE_UNQUOTED(HAVE_LSTAT_EMPTY_STRING_BUG, 1,
+[Define if lstat has the bug that it succeeds when given the zero-length
+ file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01)
+ do this. ])
+ fi
+])
- LIBOBJS="$LIBOBJS lstat.o"
+#serial 1
- if test $jm_cv_func_lstat_empty_string_bug = yes; then
- if test x = y; then
- # This code is deliberately never run via ./configure.
- # FIXME: this is a hack to make autoheader put the corresponding
- # HAVE_* undef for this symbol in config.h.in. This saves me the
- # trouble of having to maintain the #undef in acconfig.h manually.
- AC_CHECK_FUNCS(LSTAT_EMPTY_STRING_BUG)
- fi
- # Defining it this way (rather than via AC_DEFINE) short-circuits the
- # autoheader check -- autoheader doesn't know it's already been taken
- # care of by the hack above.
- ac_kludge=HAVE_LSTAT_EMPTY_STRING_BUG
- AC_DEFINE_UNQUOTED($ac_kludge)
- fi
+dnl From Jim Meyering.
+dnl FIXME: describe
+
+AC_DEFUN(jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK,
+[
+ AC_CACHE_CHECK(
+ [whether lstat dereferences a symlink specified with a trailing slash],
+ jm_cv_func_lstat_dereferences_slashed_symlink,
+ [
+ rm -f conftest.sym conftest.file
+ : > conftest.file
+ if ln -s conftest.file conftest.sym; then
+ AC_TRY_RUN([
+# include <sys/types.h>
+# include <sys/stat.h>
+
+ int
+ main ()
+ {
+ struct stat sbuf;
+ /* Linux will dereference the symlink and fail.
+ That is better in the sense that it means we will not
+ have to compile and use the lstat wrapper. */
+ exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1);
+ }
+ ],
+ jm_cv_func_lstat_dereferences_slashed_symlink=yes,
+ jm_cv_func_lstat_dereferences_slashed_symlink=no,
+ dnl When crosscompiling, be pessimistic so we will end up using the
+ dnl replacement version of lstat that checkes for trailing slashes
+ dnl and calls lstat a second time when necessary.
+ jm_cv_func_lstat_dereferences_slashed_symlink=no
+ )
+ else
+ # If the `ln -s' command failed, then we probably don't even
+ # have an lstat function.
+ jm_cv_func_lstat_dereferences_slashed_symlink=no
+ fi
+ ])
+
+ test $jm_cv_func_lstat_dereferences_slashed_symlink = yes \
+ && zero_one=1 \
+ || zero_one=0
+ AC_DEFINE_UNQUOTED(LSTAT_FOLLOWS_SLASHED_SYMLINK, $zero_one,
+ [Define if lstat dereferences a symlink specified with a trailing slash])
+
+ if test $jm_cv_func_lstat_dereferences_slashed_symlink = no; then
+ AC_SUBST(LIBOBJS)
+ # Append lstat.o if it's not already in $LIBOBJS.
+ case "$LIBOBJS" in
+ *lstat.$ac_objext*) ;;
+ *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;;
+ esac
fi
])
-#serial 2
+#serial 3
dnl From Jim Meyering.
dnl Determine whether stat has the bug that it succeeds when given the
@@ -906,50 +1286,28 @@ AC_DEFUN(jm_FUNC_STAT,
jm_cv_func_stat_empty_string_bug=yes)
])
if test $jm_cv_func_stat_empty_string_bug = yes; then
-
- LIBOBJS="$LIBOBJS stat.o"
-
- if test $jm_cv_func_stat_empty_string_bug = yes; then
- if test x = y; then
- # This code is deliberately never run via ./configure.
- # FIXME: this is a hack to make autoheader put the corresponding
- # HAVE_* undef for this symbol in config.h.in. This saves me the
- # trouble of having to maintain the #undef in acconfig.h manually.
- AC_CHECK_FUNCS(STAT_EMPTY_STRING_BUG)
- fi
- # Defining it this way (rather than via AC_DEFINE) short-circuits the
- # autoheader check -- autoheader doesn't know it's already been taken
- # care of by the hack above.
- ac_kludge=HAVE_STAT_EMPTY_STRING_BUG
- AC_DEFINE_UNQUOTED($ac_kludge)
- fi
+ AC_SUBST(LIBOBJS)
+ LIBOBJS="$LIBOBJS stat.$ac_objext"
+ AC_DEFINE_UNQUOTED(HAVE_STAT_EMPTY_STRING_BUG, 1,
+[Define if stat has the bug that it succeeds when given the zero-length
+ file name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01)
+ do this. ])
fi
])
-#serial 1
+#serial 3
dnl From Jim Meyering.
dnl Determine whether realloc works when both arguments are 0.
dnl If it doesn't, arrange to use the replacement function.
dnl
-dnl If you use this macro in a package, you should
-dnl add the following two lines to acconfig.h:
-dnl /* Define to rpl_realloc if the replacement function should be used. */
-dnl #undef realloc
-dnl
AC_DEFUN(jm_FUNC_REALLOC,
[
- if test x = y; then
- dnl This code is deliberately never run via ./configure.
- dnl FIXME: this is a gross hack to make autoheader put an entry
- dnl for this symbol in config.h.in.
- AC_CHECK_FUNCS(DONE_WORKING_REALLOC_CHECK)
- fi
dnl xmalloc.c requires that this symbol be defined so it doesn't
dnl mistakenly use a broken realloc -- as it might if this test were omitted.
- ac_kludge=HAVE_DONE_WORKING_REALLOC_CHECK
- AC_DEFINE_UNQUOTED($ac_kludge)
+ AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
+ [Define if the realloc check has been performed. ])
AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc,
[AC_TRY_RUN([
@@ -966,35 +1324,26 @@ AC_DEFUN(jm_FUNC_REALLOC,
jm_cv_func_working_realloc=no)
])
if test $jm_cv_func_working_realloc = no; then
- LIBOBJS="$LIBOBJS realloc.o"
- AC_DEFINE_UNQUOTED(realloc, rpl_realloc)
+ AC_SUBST(LIBOBJS)
+ LIBOBJS="$LIBOBJS realloc.$ac_objext"
+ AC_DEFINE_UNQUOTED(realloc, rpl_realloc,
+ [Define to rpl_realloc if the replacement function should be used.])
fi
])
-#serial 1
+#serial 3
dnl From Jim Meyering.
dnl Determine whether malloc accepts 0 as its argument.
dnl If it doesn't, arrange to use the replacement function.
dnl
-dnl If you use this macro in a package, you should
-dnl add the following two lines to acconfig.h:
-dnl /* Define to rpl_malloc if the replacement function should be used. */
-dnl #undef malloc
-dnl
AC_DEFUN(jm_FUNC_MALLOC,
[
- if test x = y; then
- dnl This code is deliberately never run via ./configure.
- dnl FIXME: this is a gross hack to make autoheader put an entry
- dnl for this symbol in config.h.in.
- AC_CHECK_FUNCS(DONE_WORKING_MALLOC_CHECK)
- fi
dnl xmalloc.c requires that this symbol be defined so it doesn't
dnl mistakenly use a broken malloc -- as it might if this test were omitted.
- ac_kludge=HAVE_DONE_WORKING_MALLOC_CHECK
- AC_DEFINE_UNQUOTED($ac_kludge)
+ AC_DEFINE_UNQUOTED(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
+ [Define if the malloc check has been performed. ])
AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc,
[AC_TRY_RUN([
@@ -1011,12 +1360,55 @@ AC_DEFUN(jm_FUNC_MALLOC,
jm_cv_func_working_malloc=no)
])
if test $jm_cv_func_working_malloc = no; then
- LIBOBJS="$LIBOBJS malloc.o"
- AC_DEFINE_UNQUOTED(malloc, rpl_malloc)
+ AC_SUBST(LIBOBJS)
+ LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ AC_DEFINE_UNQUOTED(malloc, rpl_malloc,
+ [Define to rpl_malloc if the replacement function should be used.])
fi
])
-#serial 1
+#serial 2
+
+dnl From Jim Meyering.
+dnl Determine whether the strerror_r implementation is one of
+dnl the broken ones that returns `int' rather than `char*'.
+dnl Actually, this tests only whether it returns a scalar
+dnl or an array, but that should be enough.
+dnl On at least DEC UNIX 4.0[A-D] and HP-UX B.10.20, strerror_r
+dnl returns `int'. This is used by lib/error.c.
+
+AC_DEFUN(jm_FUNC_STRERROR_R,
+[
+ # Check strerror_r
+ AC_CHECK_FUNCS([strerror_r])
+ if test $ac_cv_func_strerror_r = yes; then
+ AC_CHECK_HEADERS(string.h)
+ AC_CACHE_CHECK([for working strerror_r],
+ jm_cv_func_working_strerror_r,
+ [
+ AC_TRY_COMPILE(
+ [
+# include <stdio.h>
+# if HAVE_STRING_H
+# include <string.h>
+# endif
+ ],
+ [
+ int buf; /* avoiding square brackets makes this easier */
+ char x = *strerror_r (0, buf, sizeof buf);
+ ],
+ jm_cv_func_working_strerror_r=yes,
+ jm_cv_func_working_strerror_r=no
+ )
+ if test $jm_cv_func_working_strerror_r = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1,
+ [Define to 1 if strerror_r returns a string.])
+ fi
+ ])
+ fi
+])
+
+#serial 3
dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
dnl to test whether a NULL return value really means there are no more files
@@ -1041,9 +1433,7 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir,
ac_clean_files="$ac_clean_files conf-dir"
AC_TRY_RUN(
- changequote(<<, >>)dnl
- <<
-# include <stdio.h>
+[# include <stdio.h>
# include <sys/types.h>
# if HAVE_STRING_H
# include <string.h>
@@ -1137,37 +1527,26 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir,
create_300_file_dir (dir);
remove_dir (dir);
exit (0);
- }
- >>,
- changequote([, ])dnl
+ }],
jm_cv_func_working_readdir=yes,
jm_cv_func_working_readdir=no,
jm_cv_func_working_readdir=no)])
- if test x = y; then
- dnl This code is deliberately never run via ./configure.
- dnl FIXME: this is a gross hack to make autoheader put an entry
- dnl for this HAVE_-prefixed symbol in config.h.in.
- AC_CHECK_FUNCS(WORKING_READDIR)
- fi
-
-
if test $jm_cv_func_working_readdir = yes; then
- ac_kludge=HAVE_WORKING_READDIR
- AC_DEFINE_UNQUOTED($ac_kludge)
+ AC_DEFINE_UNQUOTED(HAVE_WORKING_READDIR, 1,
+[Define if readdir is found to work properly in some unusual cases. ])
fi
])
-#serial 2
+#serial 4
dnl A replacement for autoconf's AC_FUNC_MEMCMP that detects
dnl the losing memcmp on some x86 Next systems.
AC_DEFUN(jm_AC_FUNC_MEMCMP,
[AC_CACHE_CHECK([for working memcmp], jm_cv_func_memcmp_working,
[AC_TRY_RUN(
-changequote(<<, >>)dnl
-<<
-main()
+[int
+main ()
{
/* Some versions of memcmp are not 8-bit clean. */
char c0 = 0x40, c1 = 0x80, c2 = 0x81;
@@ -1192,62 +1571,57 @@ main()
}
exit (0);
}
-}
->>,
-changequote([, ])dnl
+}],
jm_cv_func_memcmp_working=yes,
jm_cv_func_memcmp_working=no,
jm_cv_func_memcmp_working=no)])
-test $jm_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.o"
+test $jm_cv_func_memcmp_working = no \
+ && LIBOBJS="$LIBOBJS memcmp.$ac_objext"
AC_SUBST(LIBOBJS)dnl
])
-dnl If you use this macro in a package, you should
-dnl add the following two lines to acconfig.h:
-dnl /* Define to rpl_memcmp if the replacement function should be used. */
-dnl #undef memcmp
-dnl
AC_DEFUN(jm_FUNC_MEMCMP,
[AC_REQUIRE([jm_AC_FUNC_MEMCMP])dnl
if test $jm_cv_func_memcmp_working = no; then
- AC_DEFINE_UNQUOTED(memcmp, rpl_memcmp)
+ AC_DEFINE_UNQUOTED(memcmp, rpl_memcmp,
+ [Define to rpl_memcmp if the replacement function should be used.])
fi
])
-#serial 1
+#serial 3
dnl From Jim Meyering.
dnl
dnl See if the glibc *_unlocked I/O macros are available.
+dnl Use only those *_unlocked macros that are declared.
dnl
AC_DEFUN(jm_FUNC_GLIBC_UNLOCKED_IO,
- [AC_CHECK_FUNCS( \
- clearerr_unlocked \
- feof_unlocked \
- ferror_unlocked \
- fflush_unlocked \
- fputc_unlocked \
- fread_unlocked \
- fwrite_unlocked \
- getc_unlocked \
- getchar_unlocked \
- putc_unlocked \
- putchar_unlocked \
- )
+ [
+ io_functions='clearerr_unlocked feof_unlocked ferror_unlocked
+ fflush_unlocked fputc_unlocked fread_unlocked fwrite_unlocked
+ getc_unlocked getchar_unlocked putc_unlocked putchar_unlocked'
+ for jm_io_func in $io_functions; do
+ # Check for the existence of each function only if its declared.
+ # Otherwise, we'd get the Solaris5.5.1 functions that are not
+ # declared, and that have been removed from Solaris5.6. The resulting
+ # 5.5.1 binaries would not run on 5.6 due to shared library differences.
+ AC_CHECK_DECLS(($jm_io_func),
+ jm_declared=yes,
+ jm_declared=no,
+ [#include <stdio.h>])
+ if test $jm_declared = yes; then
+ AC_CHECK_FUNCS($jm_io_func)
+ fi
+ done
]
)
-#serial 1
+#serial 2
dnl Determine whether to add fnmatch.o to LIBOBJS and to
dnl define fnmatch to rpl_fnmatch.
dnl
-dnl If you use this macro in a package, you should
-dnl add the following two lines to acconfig.h:
-dnl /* Define to rpl_fnmatch if the replacement function should be used. */
-dnl #undef fnmatch
-dnl
AC_DEFUN(jm_FUNC_FNMATCH,
[
@@ -1255,8 +1629,10 @@ AC_DEFUN(jm_FUNC_FNMATCH,
AC_FUNC_FNMATCH
if test $ac_cv_func_fnmatch_works = no \
&& test $ac_cv_gnu_library = no; then
- LIBOBJS="$LIBOBJS fnmatch.o"
- AC_DEFINE_UNQUOTED(fnmatch, rpl_fnmatch)
+ AC_SUBST(LIBOBJS)
+ LIBOBJS="$LIBOBJS fnmatch.$ac_objext"
+ AC_DEFINE_UNQUOTED(fnmatch, rpl_fnmatch,
+ [Define to rpl_fnmatch if the replacement function should be used.])
fi
])
@@ -1296,6 +1672,458 @@ AC_DEFUN(AM_GLIBC,
]
)
+#serial 1
+
+AC_DEFUN(jm_AFS,
+ AC_CHECKING(for AFS)
+ test -d /afs \
+ && AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
+)
+
+#serial 2
+
+# autoconf tests required for use of xstrtoumax.c
+
+AC_DEFUN(jm_AC_PREREQ_XSTRTOUMAX,
+[
+ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
+ AC_CHECK_HEADERS(stdlib.h)
+
+ AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
+ jm_cv_func_strtoumax_macro,
+ AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
+#ifdef strtoumax
+ inttypes_h_defines_strtoumax
+#endif],
+ jm_cv_func_strtoumax_macro=yes,
+ jm_cv_func_strtoumax_macro=no))
+
+ if test "$jm_cv_func_strtoumax_macro" != yes; then
+ AC_REPLACE_FUNCS(strtoumax)
+ fi
+
+ dnl We don't need (and can't compile) the replacement strtoull
+ dnl unless the type `unsigned long long' exists.
+ dnl Also, only the replacement strtoumax invokes strtoull,
+ dnl so we need the replacement strtoull only if strtoumax does not exist.
+ case "$ac_cv_type_unsigned_long_long,$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
+ yes,no,no)
+ AC_REPLACE_FUNCS(strtoull)
+ ;;
+ esac
+
+])
+
+#serial 2
+
+dnl From Paul Eggert.
+
+AC_DEFUN(jm_AC_TYPE_UNSIGNED_LONG_LONG,
+[
+ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
+ [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
+ [unsigned long long ullmax = (unsigned long long) -1;
+ return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
+ ac_cv_type_unsigned_long_long=yes,
+ ac_cv_type_unsigned_long_long=no)])
+ if test $ac_cv_type_unsigned_long_long = yes; then
+ AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
+ [Define if you have the unsigned long long type.])
+ fi
+])
+
+#serial 1
+dnl Run a program to determine whether whether link(2) follows symlinks.
+dnl Set LINK_FOLLOWS_SYMLINKS accordingly.
+
+AC_DEFUN(jm_AC_FUNC_LINK_FOLLOWS_SYMLINK,
+[dnl
+ AC_CACHE_CHECK([whether link(2) follows symlinks],
+ jm_ac_cv_func_link_follows_symlink,
+ [
+ dnl poor-man's AC_REQUIRE: FIXME: repair this once autoconf-3 provides
+ dnl the appropriate framework.
+ test -z "$ac_cv_header_unistd_h" \
+ && AC_CHECK_HEADERS(unistd.h)
+
+ # Create a regular file.
+ echo > conftest.file
+ AC_TRY_RUN(
+ [
+# include <sys/types.h>
+# include <sys/stat.h>
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+
+# define SAME_INODE(Stat_buf_1, Stat_buf_2) \
+ ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
+ && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
+
+ int
+ main ()
+ {
+ const char *file = "conftest.file";
+ const char *sym = "conftest.sym";
+ const char *hard = "conftest.hard";
+ struct stat sb_file, sb_hard;
+
+ /* Create a symlink to the regular file. */
+ if (symlink (file, sym))
+ abort ();
+
+ /* Create a hard link to that symlink. */
+ if (link (sym, hard))
+ abort ();
+
+ if (lstat (hard, &sb_hard))
+ abort ();
+ if (lstat (file, &sb_file))
+ abort ();
+
+ /* If the dev/inode of hard and file are the same, then
+ the link call followed the symlink. */
+ return SAME_INODE (sb_hard, sb_file) ? 0 : 1;
+ }
+ ],
+ jm_ac_cv_func_link_follows_symlink=yes,
+ jm_ac_cv_func_link_follows_symlink=no,
+ jm_ac_cv_func_link_follows_symlink=yes dnl We're cross compiling.
+ )
+ ])
+ if test $jm_ac_cv_func_link_follows_symlink = yes; then
+ AC_DEFINE(LINK_FOLLOWS_SYMLINKS, 1,
+ [Define if `link(2)' dereferences symbolic links.])
+ fi
+])
+
+dnl From Jim Meyering. Use this if you use the GNU error.[ch].
+dnl FIXME: Migrate into libit
+
+AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
+[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
+ [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
+ am_cv_lib_error_at_line=yes,
+ am_cv_lib_error_at_line=no)])
+ if test $am_cv_lib_error_at_line = no; then
+ LIBOBJS="$LIBOBJS error.$ac_objext"
+ fi
+ AC_SUBST(LIBOBJS)dnl
+])
+
+#serial 9
+
+dnl This macro is intended to be used solely in this file.
+dnl These are the prerequisite macros for GNU's strftime.c replacement.
+AC_DEFUN(_jm_STRFTIME_PREREQS,
+[
+ dnl strftime.c uses localtime_r if it exists. Check for it.
+ AC_CHECK_FUNCS(localtime_r)
+
+ AC_CHECK_HEADERS(limits.h)
+ AC_CHECK_FUNCS(bcopy tzset mempcpy memcpy memset)
+
+ # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
+ AC_STRUCT_TIMEZONE
+
+ AC_CHECK_FUNCS(mblen mbrlen)
+
+ AC_CHECK_MEMBER(struct tm.tm_gmtoff,
+ [AC_DEFINE(HAVE_TM_GMTOFF, 1,
+ [Define if struct tm has the tm_gmtoff member.])],
+ ,
+ [#include <time.h>])
+])
+
+dnl Determine if the strftime function has all the features of the GNU one.
+dnl
+dnl From Jim Meyering.
+dnl
+AC_DEFUN(jm_FUNC_GNU_STRFTIME,
+[AC_REQUIRE([AC_HEADER_TIME])dnl
+
+ _jm_STRFTIME_PREREQS
+
+ AC_REQUIRE([AC_C_CONST])dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_CHECK_HEADERS(sys/time.h)
+ AC_CACHE_CHECK([for working GNU strftime], jm_cv_func_working_gnu_strftime,
+ [# Set TZ to GMT0 to make strftime give consistent results during the test.
+ ac_save_TZ="${TZ-GMT0}"
+ TZ=GMT0
+ export TZ
+ AC_TRY_RUN(
+[ /* Ulrich Drepper provided parts of the test program. */
+#if STDC_HEADERS
+# include <stdlib.h>
+#endif
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+static int
+compare (const char *fmt, const struct tm *tm, const char *expected)
+{
+ char buf[99];
+ strftime (buf, 99, fmt, tm);
+ if (strcmp (buf, expected))
+ {
+#ifdef SHOW_FAILURES
+ printf ("fmt: \"%s\", expected \"%s\", got \"%s\"\n",
+ fmt, expected, buf);
+#endif
+ return 1;
+ }
+ return 0;
+}
+
+int
+main ()
+{
+ int n_fail = 0;
+ struct tm *tm;
+ time_t t = 738367; /* Fri Jan 9 13:06:07 1970 */
+ tm = gmtime (&t);
+
+#undef CMP
+#define CMP(Fmt, Expected) n_fail += compare ((Fmt), tm, (Expected))
+
+ CMP ("%-m", "1"); /* GNU */
+ CMP ("%A", "Friday");
+ CMP ("%^A", "FRIDAY"); /* The ^ is a GNU extension. */
+ CMP ("%B", "January");
+ CMP ("%^B", "JANUARY");
+ CMP ("%C", "19"); /* POSIX.2 */
+ CMP ("%D", "01/09/70"); /* POSIX.2 */
+ CMP ("%F", "1970-01-09");
+ CMP ("%G", "1970"); /* GNU */
+ CMP ("%H", "13");
+ CMP ("%I", "01");
+ CMP ("%M", "06");
+ CMP ("%M", "06");
+ CMP ("%R", "13:06"); /* POSIX.2 */
+ CMP ("%S", "07");
+ CMP ("%T", "13:06:07"); /* POSIX.2 */
+ CMP ("%U", "01");
+ CMP ("%V", "02");
+ CMP ("%W", "01");
+ CMP ("%X", "13:06:07");
+ CMP ("%Y", "1970");
+ CMP ("%Z", "GMT");
+ CMP ("%_m", " 1"); /* GNU */
+ CMP ("%a", "Fri");
+ CMP ("%^a", "FRI");
+ CMP ("%b", "Jan");
+ CMP ("%^b", "JAN");
+ CMP ("%c", "Fri Jan 9 13:06:07 1970");
+ CMP ("%^c", "FRI JAN 9 13:06:07 1970");
+ CMP ("%d", "09");
+ CMP ("%e", " 9"); /* POSIX.2 */
+ CMP ("%g", "70"); /* GNU */
+ CMP ("%h", "Jan"); /* POSIX.2 */
+ CMP ("%^h", "JAN");
+ CMP ("%j", "009");
+ CMP ("%k", "13"); /* GNU */
+ CMP ("%l", " 1"); /* GNU */
+ CMP ("%m", "01");
+ CMP ("%n", "\n"); /* POSIX.2 */
+ CMP ("%p", "PM");
+ CMP ("%r", "01:06:07 PM"); /* POSIX.2 */
+ CMP ("%s", "738367"); /* GNU */
+ CMP ("%t", "\t"); /* POSIX.2 */
+ CMP ("%u", "5"); /* POSIX.2 */
+ CMP ("%w", "5");
+ CMP ("%x", "01/09/70");
+ CMP ("%y", "70");
+ CMP ("%z", "+0000"); /* GNU */
+
+ exit (n_fail ? 1 : 0);
+}],
+ jm_cv_func_working_gnu_strftime=yes,
+ jm_cv_func_working_gnu_strftime=no,
+ dnl When crosscompiling, assume strftime is missing or broken.
+ jm_cv_func_working_gnu_strftime=no)
+ dnl If TZ wasn't set before, this sets it to GMT0. No real harm done.
+ TZ="$ac_save_TZ"
+ ])
+ if test $jm_cv_func_working_gnu_strftime = no; then
+ AC_SUBST(LIBOBJS)
+ LIBOBJS="$LIBOBJS strftime.$ac_objext"
+ AC_DEFINE_UNQUOTED(strftime, gnu_strftime,
+ [Define to gnu_strftime if the replacement function should be used.])
+ fi
+])
+
+AC_DEFUN(jm_FUNC_STRFTIME,
+[
+ _jm_STRFTIME_PREREQS
+ AC_REPLACE_FUNCS(strftime)
+])
+
+#serial 3
+
+dnl See if there's a working, system-supplied version of the getline function.
+dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
+dnl have a function by that name in -linet that doesn't have anything
+dnl to do with the function we need.
+AC_DEFUN(AM_FUNC_GETLINE,
+[dnl
+ am_getline_needs_run_time_check=no
+ AC_CHECK_FUNC(getline,
+ dnl Found it in some library. Verify that it works.
+ am_getline_needs_run_time_check=yes,
+ am_cv_func_working_getline=no)
+ if test $am_getline_needs_run_time_check = yes; then
+ AC_CHECK_HEADERS(string.h)
+ AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
+ [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
+ AC_TRY_RUN([
+# include <stdio.h>
+# include <sys/types.h>
+# if HAVE_STRING_H
+# include <string.h>
+# endif
+ int main ()
+ { /* Based on a test program from Karl Heuer. */
+ char *line = NULL;
+ size_t siz = 0;
+ int len;
+ FILE *in = fopen ("./conftest.data", "r");
+ if (!in)
+ return 1;
+ len = getline (&line, &siz, in);
+ exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
+ }
+ ], am_cv_func_working_getline=yes dnl The library version works.
+ , am_cv_func_working_getline=no dnl The library version does NOT work.
+ , am_cv_func_working_getline=no dnl We're cross compiling.
+ )])
+ fi
+
+ if test $am_cv_func_working_getline = yes; then
+ AC_DEFINE(HAVE_GETLINE, 1,
+ [Define if you have the GETLINE function.])dnl
+ fi
+])
+
+#serial 4
+
+dnl From Paul Eggert.
+
+# Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
+# if it exists.
+
+AC_DEFUN(AC_STRUCT_ST_MTIM_NSEC,
+ [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
+ ac_cv_struct_st_mtim_nsec,
+ [ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_cv_struct_st_mtim_nsec=no
+ # tv_nsec -- the usual case
+ # _tv_nsec -- Solaris 2.6, if
+ # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
+ # && !defined __EXTENSIONS__)
+ # st__tim.tv_nsec -- UnixWare 2.1.2
+ for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
+ CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
+ [ac_cv_struct_st_mtim_nsec=$ac_val; break])
+ done
+ CPPFLAGS="$ac_save_CPPFLAGS"])
+
+ if test $ac_cv_struct_st_mtim_nsec != no; then
+ AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
+ [Define to be the nanoseconds member of struct stat's st_mtim,
+ if it exists.])
+ fi
+ ]
+)
+
+#serial 2
+
+# Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
+
+AC_DEFUN(AC_STRUCT_ST_DM_MODE,
+ [AC_CACHE_CHECK([for st_dm_mode in struct stat], ac_cv_struct_st_dm_mode,
+ [AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/stat.h>], [struct stat s; s.st_dm_mode;],
+ ac_cv_struct_st_dm_mode=yes,
+ ac_cv_struct_st_dm_mode=no)])
+
+ if test $ac_cv_struct_st_dm_mode = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_ST_DM_MODE, 1,
+ [Define if struct stat has an st_dm_mode member. ])
+ fi
+ ]
+)
+
+#serial 4
+
+dnl From Jim Meyering
+
+dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
+dnl in time.h or sys/time.h.
+
+AC_DEFUN(jm_CHECK_TYPE_STRUCT_TIMESPEC,
+[
+ AC_REQUIRE([AC_HEADER_TIME])
+ AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
+ [AC_TRY_COMPILE(
+ [
+# if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+# else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+# endif
+ ],
+ [static struct timespec x; x.tv_sec = x.tv_nsec;],
+ fu_cv_sys_struct_timespec=yes,
+ fu_cv_sys_struct_timespec=no)
+ ])
+
+ if test $fu_cv_sys_struct_timespec = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_STRUCT_TIMESPEC, 1,
+ [Define if struct timespec is declared in <time.h>. ])
+ fi
+])
+
+#serial 5
+
+dnl From Paul Eggert.
+
+AC_PREREQ(2.13)
+
+# Define uintmax_t to `unsigned long' or `unsigned long long'
+# if <inttypes.h> does not exist.
+
+AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
+[
+ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
+ if test $jm_ac_cv_header_inttypes_h = no; then
+ AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
+ test $ac_cv_type_unsigned_long_long = yes \
+ && ac_type='unsigned long long' \
+ || ac_type='unsigned long'
+ AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
+[ Define to unsigned long or unsigned long long
+ if <inttypes.h> doesn't define.])
+ fi
+])
+
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
@@ -1304,7 +2132,9 @@ AC_DEFUN(AM_GLIBC,
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
-# serial 5
+# serial 108
+
+AC_PREREQ(2.13) dnl Minimum Autoconf version required.
AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
@@ -1319,7 +2149,7 @@ AC_DEFUN(AM_WITH_NLS,
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
- AC_DEFINE(ENABLE_NLS)
+ AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested.])
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
@@ -1344,17 +2174,13 @@ AC_DEFUN(AM_WITH_NLS,
if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
- [AC_CACHE_CHECK([for gettext in libintl],
- gt_cv_func_gettext_libintl,
- [AC_CHECK_LIB(intl, gettext,
- gt_cv_func_gettext_libintl=yes,
- gt_cv_func_gettext_libintl=no)],
- gt_cv_func_gettext_libintl=no)])
+ [AC_CHECK_LIB(intl, gettext)])
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
- || test "$gt_cv_func_gettext_libintl" = "yes"; then
- AC_DEFINE(HAVE_GETTEXT)
+ || test "$ac_cv_lib_intl_gettext" = "yes"; then
+ AC_DEFINE(HAVE_GETTEXT, 1,
+ [Define to 1 if you have gettext and don't want to use GNU gettext.])
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
@@ -1384,7 +2210,8 @@ AC_DEFUN(AM_WITH_NLS,
dnl No gettext in C library. Try catgets next.
AC_CHECK_LIB(i, main)
AC_CHECK_FUNC(catgets,
- [AC_DEFINE(HAVE_CATGETS)
+ [AC_DEFINE(HAVE_CATGETS, 1,
+ [Define as 1 if you have catgets and don't want to use GNU gettext.])
INTLOBJS="\$(CATOBJS)"
AC_PATH_PROG(GENCAT, gencat, no)dnl
if test "$GENCAT" != "no"; then
@@ -1455,7 +2282,11 @@ AC_DEFUN(AM_WITH_NLS,
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
- AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+ if test -z "$nls_cv_header_intl"; then
+ # Clean out junk possibly left behind by a previous configuration.
+ rm -f intl/libintl.h
+ fi
+ AC_CONFIG_LINKS($nls_cv_header_intl:$nls_cv_header_libgt)
AC_OUTPUT_COMMANDS(
[case "$CONFIG_FILES" in *po/Makefile.in*)
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
@@ -1513,7 +2344,7 @@ strdup __argz_count __argz_stringify __argz_next])
AC_CHECK_FUNCS(stpcpy)
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
- AC_DEFINE(HAVE_STPCPY)
+ AC_DEFINE(HAVE_STPCPY, 1, [Define to 1 if you have the stpcpy function.])
fi
AM_LC_MESSAGES
@@ -1598,15 +2429,14 @@ strdup __argz_count __argz_stringify __argz_next])
dnl Generate list of files to be processed by xgettext which will
dnl be included in po/Makefile.
test -d po || mkdir po
- if test "x$srcdir" != "x."; then
- if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
- posrcprefix="$srcdir/"
- else
- posrcprefix="../$srcdir/"
- fi
- else
- posrcprefix="../"
- fi
+ case "$srcdir" in
+ .)
+ posrcprefix="../" ;;
+ /* | [[A-Za-z]]:*)
+ posrcprefix="$srcdir/" ;;
+ *)
+ posrcprefix="../$srcdir/" ;;
+ esac
rm -f po/POTFILES
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
@@ -1668,7 +2498,9 @@ AC_SUBST($1)dnl
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
-# serial 1
+# serial 2
+
+AC_PREREQ(2.13) dnl Minimum Autoconf version required.
AC_DEFUN(AM_LC_MESSAGES,
[if test $ac_cv_header_locale_h = yes; then
@@ -1676,7 +2508,8 @@ AC_DEFUN(AM_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
- AC_DEFINE(HAVE_LC_MESSAGES)
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your locale.h file contains LC_MESSAGES.])
fi
fi])
diff --git a/config.h.in b/config.h.in
index 64749e43..fa23eec4 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,462 +1,750 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-#undef _ALL_SOURCE
-#endif
+/* Define if you have the Andrew File System. */
+#undef AFS
-/* Define if using alloca.c. */
-#undef C_ALLOCA
+/* Define to the function xargmatch calls on failures. */
+#undef ARGMATCH_DIE
-/* Define if the closedir function returns void instead of int. */
-#undef CLOSEDIR_VOID
+/* Define to the declaration of the xargmatch failure function. */
+#undef ARGMATCH_DIE_DECL
-/* Define to empty if the keyword does not work. */
-#undef const
+/* Define if you want find -nouser and -nogroup to make tables of used UIDs
+ and GIDs at startup instead of using getpwuid or getgrgid when needed.
+ Speeds up -nouser and -nogroup unless you are running NIS or Hesiod, which
+ make password and group calls very expensive. */
+#undef CACHE_IDS
+
+/* Define if the `closedir' function returns void instead of `int'. */
+#undef CLOSEDIR_VOID
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
+ This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef gid_t
+/* Define if using `alloca.c'. */
+#undef C_ALLOCA
-/* Define if you have alloca, as a function or macro. */
-#undef HAVE_ALLOCA
+/* Define if there is a member named d_ino in the struct describing directory
+ headers. */
+#undef D_INO_IN_DIRENT
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-#undef HAVE_ALLOCA_H
+/* Define if there is a member named d_type in the struct describing directory
+ headers. */
+#undef D_TYPE_IN_DIRENT
-/* Define if you don't have vprintf but do have _doprnt. */
-#undef HAVE_DOPRNT
+/* Define to 1 if NLS is requested. */
+#undef ENABLE_NLS
-/* Define if your system has a working fnmatch function. */
-#undef HAVE_FNMATCH
+/* Define to use AIX3 statfs to get filesystem type. */
+#undef FSTYPE_AIX_STATFS
-/* Define if you have the getmntent function. */
-#undef HAVE_GETMNTENT
+/* Define to use Ultrix getmnt to get filesystem type. */
+#undef FSTYPE_GETMNT
-/* Define if you have a working `mmap' system call. */
-#undef HAVE_MMAP
+/* Define to use 4.3BSD getmntent to get filesystem type. */
+#undef FSTYPE_MNTENT
-/* Define if your struct stat has st_blocks. */
-#undef HAVE_ST_BLOCKS
+/* Define to use 4.4BSD and OSF1 statfs to get filesystem type. */
+#undef FSTYPE_STATFS
-/* Define if your struct stat has st_rdev. */
-#undef HAVE_ST_RDEV
+/* Define to use SVR4 statvfs to get filesystem type. */
+#undef FSTYPE_STATVFS
-/* Define if you have the strftime function. */
-#undef HAVE_STRFTIME
+/* Define to use SVR3.2 statfs to get filesystem type. */
+#undef FSTYPE_USG_STATFS
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
+/* Define to the type of elements in the array set by `getgroups'. Usually
+ this is either `int' or `gid_t'. */
+#undef GETGROUPS_T
-/* Define if your struct tm has tm_zone. */
-#undef HAVE_TM_ZONE
+/* The concatenation of the strings `GNU ', and PACKAGE. */
+#undef GNU_PACKAGE
-/* Define if you don't have tm_zone but do have the external array
- tzname. */
-#undef HAVE_TZNAME
+/* Define if you have the `acl' function. */
+#undef HAVE_ACL
-/* Define if you have the vprintf function. */
-#undef HAVE_VPRINTF
+/* Define if you have the `alarm' function. */
+#undef HAVE_ALARM
-/* Define as __inline if that's what the C compiler calls it. */
-#undef inline
+/* Define if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
-/* Define if major, minor, and makedev are declared in <mkdev.h>. */
-#undef MAJOR_IN_MKDEV
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+#undef HAVE_ALLOCA_H
-/* Define if major, minor, and makedev are declared in <sysmacros.h>. */
-#undef MAJOR_IN_SYSMACROS
+/* Define if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
-/* Define if on MINIX. */
-#undef _MINIX
+/* Define if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef mode_t
+/* Define if you have the `bcopy' function. */
+#undef HAVE_BCOPY
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
+/* Define if you have the `btowc' function. */
+#undef HAVE_BTOWC
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef pid_t
+/* Define if you have the `bzero' function. */
+#undef HAVE_BZERO
-/* Define if the system does not provide POSIX.1 features except
- with this defined. */
-#undef _POSIX_1_SOURCE
+/* Define as 1 if you have catgets and don't want to use GNU gettext. */
+#undef HAVE_CATGETS
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
+/* Define if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
+/* Define if backslash-a works in C strings. */
+#undef HAVE_C_BACKSLASH_A
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
+/* Define if you have the `dcgettext' function. */
+#undef HAVE_DCGETTEXT
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-#undef STAT_MACROS_BROKEN
+/* Define to 1 if you have the declaration of `free', and to 0 if you don't.
+ */
+#undef HAVE_DECL_FREE
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
+/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
+ */
+#undef HAVE_DECL_GETENV
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
+/* Define to 1 if you have the declaration of `geteuid', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETEUID
-/* Define if your <sys/time.h> declares struct tm. */
-#undef TM_IN_SYS_TIME
+/* Define to 1 if you have the declaration of `getlogin', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETLOGIN
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef uid_t
+/* Define to 1 if you have the declaration of `lseek', and to 0 if you don't.
+ */
+#undef HAVE_DECL_LSEEK
-/* Define if you have the Andrew File System. */
-#undef AFS
+/* Define to 1 if you have the declaration of `malloc', and to 0 if you don't.
+ */
+#undef HAVE_DECL_MALLOC
-/* Define If you want find -nouser and -nogroup to make tables of
- used UIDs and GIDs at startup instead of using getpwuid or
- getgrgid when needed. Speeds up -nouser and -nogroup unless you
- are running NIS or Hesiod, which make password and group calls
- very expensive. */
-#undef CACHE_IDS
+/* Define to 1 if you have the declaration of `realloc', and to 0 if you
+ don't. */
+#undef HAVE_DECL_REALLOC
-/* Define to use SVR4 statvfs to get filesystem type. */
-#undef FSTYPE_STATVFS
+/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
+ */
+#undef HAVE_DECL_STPCPY
-/* Define to use SVR3.2 statfs to get filesystem type. */
-#undef FSTYPE_USG_STATFS
+/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
+ */
+#undef HAVE_DECL_STRSTR
-/* Define to use AIX3 statfs to get filesystem type. */
-#undef FSTYPE_AIX_STATFS
+/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRTOUL
-/* Define to use 4.3BSD getmntent to get filesystem type. */
-#undef FSTYPE_MNTENT
+/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRTOULL
-/* Define to use 4.4BSD and OSF1 statfs to get filesystem type. */
-#undef FSTYPE_STATFS
+/* Define to 1 if you have the declaration of `ttyname', and to 0 if you
+ don't. */
+#undef HAVE_DECL_TTYNAME
-/* Define to use Ultrix getmnt to get filesystem type. */
-#undef FSTYPE_GETMNT
+/* Define if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
-/* Define to `unsigned long' if <sys/types.h> doesn't define. */
-#undef dev_t
+/* Define if the malloc check has been performed. */
+#undef HAVE_DONE_WORKING_MALLOC_CHECK
-/* Define to `unsigned long' if <sys/types.h> doesn't define. */
-#undef ino_t
+/* Define if the realloc check has been performed. */
+#undef HAVE_DONE_WORKING_REALLOC_CHECK
-/* Define to rpl_fnmatch if the replacement function should be used. */
-#undef fnmatch
+/* Define if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
-/* Define to 1 if assertions should be disabled. */
-#undef NDEBUG
+/* Define if you have the `endgrent' function. */
+#undef HAVE_ENDGRENT
-/* Define to rpl_malloc if the replacement function should be used. */
-#undef malloc
+/* Define if you have the `endpwent' function. */
+#undef HAVE_ENDPWENT
-/* Define to rpl_memcmp if the replacement function should be used. */
-#undef memcmp
+/* Define if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
-/* Define to gnu_mktime if the replacement function should be used. */
-#undef mktime
+/* Define if you have the `fchdir' function. */
+#undef HAVE_FCHDIR
-/* Define to rpl_realloc if the replacement function should be used. */
-#undef realloc
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef ssize_t
+/* Define if you have the `fdatasync' function. */
+#undef HAVE_FDATASYNC
-/* Define to `unsigned long' or `unsigned long long'
- if <inttypes.h> doesn't define. */
-#undef uintmax_t
+/* Define if you have the <fenv.h> header file. */
+#undef HAVE_FENV_H
-/* Define if your locale.h file contains LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
+/* Define if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
-/* Define to 1 if NLS is requested. */
-#undef ENABLE_NLS
+/* Define if your system has a working `fnmatch' function. */
+#undef HAVE_FNMATCH
-/* Define as 1 if you have catgets and don't want to use GNU gettext. */
-#undef HAVE_CATGETS
+/* Define if you have the <fnmatch.h> header file. */
+#undef HAVE_FNMATCH_H
-/* Define as 1 if you have gettext and don't want to use GNU gettext. */
-#undef HAVE_GETTEXT
+/* Define if you have the `fseeko' function. */
+#undef HAVE_FSEEKO
-/* Define as 1 if you have the stpcpy function. */
-#undef HAVE_STPCPY
+/* Define if you have the `ftime' function. */
+#undef HAVE_FTIME
-/* Define if you have the DECL_FREE function. */
-#undef HAVE_DECL_FREE
+/* Define if you have the `ftruncate' function. */
+#undef HAVE_FTRUNCATE
-/* Define if you have the DECL_LSEEK function. */
-#undef HAVE_DECL_LSEEK
+/* Define if you have the `getcwd' function. */
+#undef HAVE_GETCWD
-/* Define if you have the DECL_MALLOC function. */
-#undef HAVE_DECL_MALLOC
+/* Define if you have the `getdelim' function. */
+#undef HAVE_GETDELIM
-/* Define if you have the DECL_MEMCHR function. */
-#undef HAVE_DECL_MEMCHR
+/* Define if you have the `gethostbyaddr' function. */
+#undef HAVE_GETHOSTBYADDR
-/* Define if you have the DECL_REALLOC function. */
-#undef HAVE_DECL_REALLOC
+/* Define if you have the `gethostbyname' function. */
+#undef HAVE_GETHOSTBYNAME
-/* Define if you have the DECL_STPCPY function. */
-#undef HAVE_DECL_STPCPY
+/* Define if you have the `gethrtime' function. */
+#undef HAVE_GETHRTIME
-/* Define if you have the DECL_STRSTR function. */
-#undef HAVE_DECL_STRSTR
+/* Define if you have the GETLINE function. */
+#undef HAVE_GETLINE
-/* Define if you have the DONE_WORKING_MALLOC_CHECK function. */
-#undef HAVE_DONE_WORKING_MALLOC_CHECK
+/* Define if you have the `getmntent' function. */
+#undef HAVE_GETMNTENT
-/* Define if you have the DONE_WORKING_REALLOC_CHECK function. */
-#undef HAVE_DONE_WORKING_REALLOC_CHECK
+/* Define if you have the `getmntinfo' function. */
+#undef HAVE_GETMNTINFO
-/* Define if you have the INTTYPES_H function. */
-#undef HAVE_INTTYPES_H
+/* Define if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
-/* Define if you have the STRUCT_UTIMBUF function. */
-#undef HAVE_STRUCT_UTIMBUF
+/* Define to 1 if you have gettext and don't want to use GNU gettext. */
+#undef HAVE_GETTEXT
-/* Define if you have the WORKING_READDIR function. */
-#undef HAVE_WORKING_READDIR
+/* Define if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
-/* Define if you have the __argz_count function. */
-#undef HAVE___ARGZ_COUNT
+/* Define if you have the `hasmntopt' function. */
+#undef HAVE_HASMNTOPT
-/* Define if you have the __argz_next function. */
-#undef HAVE___ARGZ_NEXT
+/* Define if you have the `inet_ntoa' function. */
+#undef HAVE_INET_NTOA
-/* Define if you have the __argz_stringify function. */
-#undef HAVE___ARGZ_STRINGIFY
+/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
+ declares uintmax_t. */
+#undef HAVE_INTTYPES_H
-/* Define if you have the alarm function. */
-#undef HAVE_ALARM
+/* Define if you have the `isascii' function. */
+#undef HAVE_ISASCII
-/* Define if you have the basename function. */
-#undef HAVE_BASENAME
+/* Define if your locale.h file contains LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
-/* Define if you have the bcopy function. */
-#undef HAVE_BCOPY
+/* Define if you have the `cposix' library (-lcposix). */
+#undef HAVE_LIBCPOSIX
-/* Define if you have the btowc function. */
-#undef HAVE_BTOWC
+/* Define if you have the `dir' library (-ldir). */
+#undef HAVE_LIBDIR
-/* Define if you have the bzero function. */
-#undef HAVE_BZERO
+/* Define if you have the `gen' library (-lgen). */
+#undef HAVE_LIBGEN
-/* Define if you have the clearerr_unlocked function. */
-#undef HAVE_CLEARERR_UNLOCKED
+/* Define if you have the `i' library (-li). */
+#undef HAVE_LIBI
-/* Define if you have the dcgettext function. */
-#undef HAVE_DCGETTEXT
+/* Define if you have the `intl' library (-lintl). */
+#undef HAVE_LIBINTL
-/* Define if you have the doprnt function. */
-#undef HAVE_DOPRNT
+/* Define if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
-/* Define if you have the endgrent function. */
-#undef HAVE_ENDGRENT
+/* Define if you have the `seq' library (-lseq). */
+#undef HAVE_LIBSEQ
-/* Define if you have the endpwent function. */
-#undef HAVE_ENDPWENT
+/* Define if you have the `sun' library (-lsun). */
+#undef HAVE_LIBSUN
-/* Define if you have the fchdir function. */
-#undef HAVE_FCHDIR
+/* Define if you have the `x' library (-lx). */
+#undef HAVE_LIBX
-/* Define if you have the feof_unlocked function. */
-#undef HAVE_FEOF_UNLOCKED
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
-/* Define if you have the ferror_unlocked function. */
-#undef HAVE_FERROR_UNLOCKED
+/* Define if you have the `listmntent' function. */
+#undef HAVE_LISTMNTENT
-/* Define if you have the fflush_unlocked function. */
-#undef HAVE_FFLUSH_UNLOCKED
+/* Define if you have the `localeconv' function. */
+#undef HAVE_LOCALECONV
-/* Define if you have the fputc_unlocked function. */
-#undef HAVE_FPUTC_UNLOCKED
+/* Define if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
-/* Define if you have the fread_unlocked function. */
-#undef HAVE_FREAD_UNLOCKED
+/* Define if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
-/* Define if you have the fwrite_unlocked function. */
-#undef HAVE_FWRITE_UNLOCKED
+/* Define if the `long double' type works. */
+#undef HAVE_LONG_DOUBLE
-/* Define if you have the getc_unlocked function. */
-#undef HAVE_GETC_UNLOCKED
+/* Define if you support file names longer than 14 characters. */
+#undef HAVE_LONG_FILE_NAMES
-/* Define if you have the getchar_unlocked function. */
-#undef HAVE_GETCHAR_UNLOCKED
+/* Define if lstat has the bug that it succeeds when given the zero-length
+ file name argument. The lstat from SunOS4.1.4 and the Hurd as of
+ 1998-11-01) do this. */
+#undef HAVE_LSTAT_EMPTY_STRING_BUG
-/* Define if you have the getcwd function. */
-#undef HAVE_GETCWD
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
-/* Define if you have the getpagesize function. */
-#undef HAVE_GETPAGESIZE
+/* Define if you have the `mblen' function. */
+#undef HAVE_MBLEN
-/* Define if you have the isascii function. */
-#undef HAVE_ISASCII
+/* Define if you have the `mbrlen' function. */
+#undef HAVE_MBRLEN
-/* Define if you have the localtime_r function. */
-#undef HAVE_LOCALTIME_R
+/* Define if you have the `mbrtowc' function. */
+#undef HAVE_MBRTOWC
-/* Define if you have the memcmp function. */
+/* Define if you have the `memcmp' function. */
#undef HAVE_MEMCMP
-/* Define if you have the memset function. */
+/* Define if you have the `memcpy' function. */
+#undef HAVE_MEMCPY
+
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the `mempcpy' function. */
+#undef HAVE_MEMPCPY
+
+/* Define if you have the `memset' function. */
#undef HAVE_MEMSET
-/* Define if you have the mktime function. */
-#undef HAVE_MKTIME
+/* Define if you have the `mkfifo' function. */
+#undef HAVE_MKFIFO
+
+/* Define if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define if you have the <mntent.h> header file. */
+#undef HAVE_MNTENT_H
+
+/* Define if you have the <mnttab.h> header file. */
+#undef HAVE_MNTTAB_H
-/* Define if you have the munmap function. */
+/* Define if you have the `munmap' function. */
#undef HAVE_MUNMAP
-/* Define if you have the putc_unlocked function. */
-#undef HAVE_PUTC_UNLOCKED
+/* Define if you have the <ndir.h> header file. */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
-/* Define if you have the putchar_unlocked function. */
-#undef HAVE_PUTCHAR_UNLOCKED
+/* Define if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
-/* Define if you have the putenv function. */
+/* Define if you have the `pathconf' function. */
+#undef HAVE_PATHCONF
+
+/* Define if you have the <paths.h> header file. */
+#undef HAVE_PATHS_H
+
+/* Define if you have the `putenv' function. */
#undef HAVE_PUTENV
-/* Define if you have the setenv function. */
+/* Define if you have the `realpath' function. */
+#undef HAVE_REALPATH
+
+/* Define if you have the `resolvepath' function. */
+#undef HAVE_RESOLVEPATH
+
+/* Define if you have the `setenv' function. */
#undef HAVE_SETENV
-/* Define if you have the setlocale function. */
+/* Define if you have the `sethostname' function. */
+#undef HAVE_SETHOSTNAME
+
+/* Define if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
-/* Define if you have the stpcpy function. */
+/* Define if stat has the bug that it succeeds when given the zero-length file
+ name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01) do
+ this. */
+#undef HAVE_STAT_EMPTY_STRING_BUG
+
+/* Define if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
-/* Define if you have the strcasecmp function. */
+/* Define if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
-/* Define if you have the strchr function. */
+/* Define if you have the `strchr' function. */
#undef HAVE_STRCHR
-/* Define if you have the strdup function. */
+/* Define if you have the `strdup' function. */
#undef HAVE_STRDUP
-/* Define if you have the strerror function. */
+/* Define if you have the `strerror' function. */
#undef HAVE_STRERROR
-/* Define if you have the strerror_r function. */
+/* Define if you have the `strerror_r' function. */
#undef HAVE_STRERROR_R
-/* Define if you have the strftime function. */
+/* Define if you have the `strftime' function. */
#undef HAVE_STRFTIME
-/* Define if you have the strspn function. */
+/* Define if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the `strncasecmp' function. */
+#undef HAVE_STRNCASECMP
+
+/* Define if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define if you have the `strspn' function. */
#undef HAVE_STRSPN
-/* Define if you have the strstr function. */
+/* Define if you have the `strstr' function. */
#undef HAVE_STRSTR
-/* Define if you have the strtol function. */
+/* Define if you have the `strtol' function. */
#undef HAVE_STRTOL
-/* Define if you have the vprintf function. */
-#undef HAVE_VPRINTF
+/* Define if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
-/* Define if you have the <alloca.h> header file. */
-#undef HAVE_ALLOCA_H
+/* Define if you have the `strtoull' function. */
+#undef HAVE_STRTOULL
-/* Define if you have the <argz.h> header file. */
-#undef HAVE_ARGZ_H
+/* Define if you have the `strtoumax' function. */
+#undef HAVE_STRTOUMAX
-/* Define if you have the <dirent.h> header file. */
-#undef HAVE_DIRENT_H
+/* Define if `st_blksize' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
-/* Define if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
+/* Define if `st_blocks' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLOCKS
-/* Define if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
+/* Define if `st_rdev' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_RDEV
-/* Define if you have the <libintl.h> header file. */
-#undef HAVE_LIBINTL_H
+/* Define if struct timespec is declared in <time.h>. */
+#undef HAVE_STRUCT_TIMESPEC
-/* Define if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
+/* Define if `tm_zone' is member of `struct tm'. */
+#undef HAVE_STRUCT_TM_TM_ZONE
-/* Define if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
+/* Define if `ut_name' is member of `struct utmpx'. */
+#undef HAVE_STRUCT_UTMPX_UT_NAME
-/* Define if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
+/* Define if `ut_user' is member of `struct utmpx'. */
+#undef HAVE_STRUCT_UTMPX_UT_USER
-/* Define if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
+/* Define if `ut_name' is member of `struct utmp'. */
+#undef HAVE_STRUCT_UTMP_UT_NAME
-/* Define if you have the <ndir.h> header file. */
-#undef HAVE_NDIR_H
+/* Define if `ut_user' is member of `struct utmp'. */
+#undef HAVE_STRUCT_UTMP_UT_USER
-/* Define if you have the <nl_types.h> header file. */
-#undef HAVE_NL_TYPES_H
+/* Define if your `struct stat' has `st_blocks'. Deprecated, use
+ `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */
+#undef HAVE_ST_BLOCKS
-/* Define if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
+/* Define if struct stat has an st_dm_mode member. */
+#undef HAVE_ST_DM_MODE
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+/* Define if you have the `sysinfo' function. */
+#undef HAVE_SYSINFO
-/* Define if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
+/* Define if you have the <syslog.h> header file. */
+#undef HAVE_SYSLOG_H
-/* Define if you have the <sys/dir.h> header file. */
+/* Define if you have the <sys/acl.h> header file. */
+#undef HAVE_SYS_ACL_H
+
+/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
-/* Define if you have the <sys/ndir.h> header file. */
+/* Define if you have the <sys/filsys.h> header file. */
+#undef HAVE_SYS_FILSYS_H
+
+/* Define if you have the <sys/fstyp.h> header file. */
+#undef HAVE_SYS_FSTYP_H
+
+/* Define if you have the <sys/fs/s5param.h> header file. */
+#undef HAVE_SYS_FS_S5PARAM_H
+
+/* Define if you have the <sys/fs_types.h> header file. */
+#undef HAVE_SYS_FS_TYPES_H
+
+/* Define if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define if you have the <sys/mntent.h> header file. */
+#undef HAVE_SYS_MNTENT_H
+
+/* Define if you have the <sys/mount.h> header file. */
+#undef HAVE_SYS_MOUNT_H
+
+/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H
-/* Define if you have the <sys/param.h> header file. */
+/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
-/* Define if you have the <sys/time.h> header file. */
+/* Define if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define if you have the <sys/statfs.h> header file. */
+#undef HAVE_SYS_STATFS_H
+
+/* Define if you have the <sys/statvfs.h> header file. */
+#undef HAVE_SYS_STATVFS_H
+
+/* Define if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define if you have the <sys/systeminfo.h> header file. */
+#undef HAVE_SYS_SYSTEMINFO_H
+
+/* Define if you have the <sys/timeb.h> header file. */
+#undef HAVE_SYS_TIMEB_H
+
+/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
-/* Define if you have the <unistd.h> header file. */
+/* Define if you have the <sys/vfs.h> header file. */
+#undef HAVE_SYS_VFS_H
+
+/* Define if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define if struct tm has the tm_gmtoff member. */
+#undef HAVE_TM_GMTOFF
+
+/* Define if your `struct tm' has `tm_zone'. Deprecated, use
+ `HAVE_STRUCT_TM_TM_ZONE' instead. */
+#undef HAVE_TM_ZONE
+
+/* Define if you don't have `tm_zone' but do have the external array `tzname'.
+ */
+#undef HAVE_TZNAME
+
+/* Define if you have the `tzset' function. */
+#undef HAVE_TZSET
+
+/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if you have the <utime.h> header file. */
-#undef HAVE_UTIME_H
+/* Define if you have the unsigned long long type. */
+#undef HAVE_UNSIGNED_LONG_LONG
+
+/* Define if you have the `utmpname' function. */
+#undef HAVE_UTMPNAME
-/* Define if you have the <wchar.h> header file. */
+/* Define if you have the `utmpxname' function. */
+#undef HAVE_UTMPXNAME
+
+/* Define if you have the <utmpx.h> header file. */
+#undef HAVE_UTMPX_H
+
+/* Define if you have the <values.h> header file. */
+#undef HAVE_VALUES_H
+
+/* Define if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
+/* Define if you have the `waitpid' function. */
+#undef HAVE_WAITPID
+
+/* Define if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
-/* Define if you have the <wctype.h> header file. */
+/* Define if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H
-/* Define if you have the i library (-li). */
-#undef HAVE_LIBI
+/* Define if readdir is found to work properly in some unusual cases. */
+#undef HAVE_WORKING_READDIR
-/* Define if you have the sun library (-lsun). */
-#undef HAVE_LIBSUN
+/* Define to 1 if strerror_r returns a string. */
+#undef HAVE_WORKING_STRERROR_R
+
+/* Define if you have the `__argz_count' function. */
+#undef HAVE___ARGZ_COUNT
+
+/* Define if you have the `__argz_next' function. */
+#undef HAVE___ARGZ_NEXT
+
+/* Define if you have the `__argz_stringify' function. */
+#undef HAVE___ARGZ_STRINGIFY
+
+/* Define if `link(2)' dereferences symbolic links. */
+#undef LINK_FOLLOWS_SYMLINKS
+
+/* Define if lstat dereferences a symlink specified with a trailing slash */
+#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
+
+/* Define if `major', `minor', and `makedev' are declared in <mkdev.h>. */
+#undef MAJOR_IN_MKDEV
+
+/* Define if `major', `minor', and `makedev' are declared in <sysmacros.h>. */
+#undef MAJOR_IN_SYSMACROS
+
+/* Define to 1 if assertions should be disabled. */
+#undef NDEBUG
/* Name of package */
#undef PACKAGE
+/* Define if compiler has function prototypes */
+#undef PROTOTYPES
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* Define if the `setvbuf' function takes the buffering type as its second
+ argument and the buffer pointer as the third, as on System V before release
+ 3. */
+#undef SETVBUF_REVERSED
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+#undef STAT_MACROS_BROKEN
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to be the nanoseconds member of struct stat's st_mtim, if it exists.
+ */
+#undef ST_MTIM_NSEC
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
/* Version number of package */
#undef VERSION
-/* Define if compiler has function prototypes */
-#undef PROTOTYPES
+/* Define if your processor stores words with the most significant byte first
+ (like Motorola and SPARC, unlike Intel and VAX). */
+#undef WORDS_BIGENDIAN
-/* Define if lstat has the bug that it succeeds when given the zero-length
- file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01)
- do this. */
-#undef HAVE_LSTAT_EMPTY_STRING_BUG
+/* Define if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
-/* Define if stat has the bug that it succeeds when given the zero-length
- file name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01)
- do this. */
-#undef HAVE_STAT_EMPTY_STRING_BUG
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define to make fseeko etc. visible, on some hosts. */
+#undef _LARGEFILE_SOURCE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define if on MINIX. */
+#undef _MINIX
+
+/* Define if the system does not provide POSIX.1 features except with this
+ defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `unsigned long' if <sys/types.h> does not define. */
+#undef dev_t
+
+/* Define to rpl_fnmatch if the replacement function should be used. */
+#undef fnmatch
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
+#undef inline
+
+/* Define to `unsigned long' if <sys/types.h> does not define. */
+#undef ino_t
+
+/* Define to rpl_malloc if the replacement function should be used. */
+#undef malloc
+
+/* Define to rpl_memcmp if the replacement function should be used. */
+#undef memcmp
+
+/* Define to rpl_mktime if the replacement function should be used. */
+#undef mktime
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef mode_t
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to rpl_realloc if the replacement function should be used. */
+#undef realloc
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef ssize_t
+
+/* Define to gnu_strftime if the replacement function should be used. */
+#undef strftime
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
+/* Define to unsigned long or unsigned long long if <inttypes.h> doesn't
+ define. */
+#undef uintmax_t
+/* Define to empty if the keyword `volatile' does not work. Warning: valid
+ code using `volatile' can become incorrect without. Disable with care. */
+#undef volatile
diff --git a/doc/.cvsignore b/doc/.cvsignore
index 3fc6e384..888b50e6 100644
--- a/doc/.cvsignore
+++ b/doc/.cvsignore
@@ -1,4 +1,3 @@
Makefile
-Makefile.in
stamp-vti
version.texi
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 459aa0d3..29c7972b 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
+GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@@ -84,8 +86,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
+MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
+OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@@ -122,7 +127,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -246,7 +251,6 @@ dist-info: $(INFO_DEPS)
d=$(srcdir); \
for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done; \
done
@@ -278,11 +282,12 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir); \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
else \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
diff --git a/doc/find.info b/doc/find.info
index c970e950..816f16bf 100644
--- a/doc/find.info
+++ b/doc/find.info
@@ -27,7 +27,7 @@ translation approved by the Foundation.

Indirect:
find.info-1: 1079
-find.info-2: 50723
+find.info-2: 50724

Tag Table:
(Indirect)
@@ -77,36 +77,36 @@ Node: Unsafe File Name Handling42082
Node: Safe File Name Handling43632
Node: Limiting Command Size44317
Node: Interspersing File Names46072
-Node: Querying47131
-Node: Adding Tests48045
-Node: Common Tasks50307
-Node: Viewing And Editing50723
-Node: Archiving51234
-Node: Cleaning Up52866
-Node: Strange File Names54391
-Node: Fixing Permissions56021
-Node: Classifying Files56580
-Node: Databases57298
-Node: Database Locations57912
-Node: Database Formats60217
-Node: New Database Format60868
-Node: Sample Database62430
-Node: Old Database Format63069
-Node: File Permissions64799
-Node: Mode Structure65367
-Node: Symbolic Modes67495
-Node: Setting Permissions68492
-Node: Copying Permissions71028
-Node: Changing Special Permissions71829
-Node: Conditional Executability73664
-Node: Multiple Changes74281
-Node: Umask and Protection75928
-Node: Numeric Modes77017
-Node: Reference78847
-Node: Invoking find79145
-Node: Invoking locate80192
-Node: Invoking updatedb81121
-Node: Invoking xargs82671
-Node: Primary Index85741
+Node: Querying47132
+Node: Adding Tests48046
+Node: Common Tasks50308
+Node: Viewing And Editing50724
+Node: Archiving51235
+Node: Cleaning Up52867
+Node: Strange File Names54392
+Node: Fixing Permissions56022
+Node: Classifying Files56581
+Node: Databases57299
+Node: Database Locations57913
+Node: Database Formats60218
+Node: New Database Format60871
+Node: Sample Database62433
+Node: Old Database Format63072
+Node: File Permissions64802
+Node: Mode Structure65370
+Node: Symbolic Modes67498
+Node: Setting Permissions68495
+Node: Copying Permissions71031
+Node: Changing Special Permissions71832
+Node: Conditional Executability73667
+Node: Multiple Changes74284
+Node: Umask and Protection75931
+Node: Numeric Modes77020
+Node: Reference78850
+Node: Invoking find79148
+Node: Invoking locate80195
+Node: Invoking updatedb81124
+Node: Invoking xargs82674
+Node: Primary Index85745

End Tag Table
diff --git a/doc/find.info-1 b/doc/find.info-1
index 0c1c7864..36235d5b 100644
--- a/doc/find.info-1
+++ b/doc/find.info-1
@@ -29,7 +29,7 @@ File: find.info, Node: Top, Next: Introduction, Up: (dir)
This file documents the GNU utilities for finding files that match
certain criteria and performing various actions on them. This is
-edition 4.1.4, for `find' version 4.1.4.
+edition 4.1.5, for `find' version 4.1.5.
* Menu:
@@ -1469,7 +1469,7 @@ operation is equivalent to `find -exec' (*note Single File::).
`--replace[=REPLACE-STR]'
`-i[REPLACE-STR]'
- Replace occurences of REPLACE-STR in the initial arguments with
+ Replace occurrences of REPLACE-STR in the initial arguments with
names read from standard input. Also, unquoted blanks do not
terminate arguments. If REPLACE-STR is omitted, it defaults to
`{}' (like for `find -exec'). Implies `-x' and `-l 1'. As an
diff --git a/doc/find.info-2 b/doc/find.info-2
index f57fc73f..f72e8d7e 100644
--- a/doc/find.info-2
+++ b/doc/find.info-2
@@ -289,7 +289,7 @@ Database Formats
The file name databases contain lists of files that were in
particular directory trees when the databases were last updated. The
file name database format changed starting with GNU `locate' version
-4.0 to allow machines with diffent byte orderings to share the
+4.0 to allow machines with different byte orderings to share the
databases. The new GNU `locate' can read both the old and new database
formats. However, old versions of `locate' and `find' produce incorrect
results if given a new-format database.
@@ -982,7 +982,7 @@ Invoking `xargs'
`--replace[=REPLACE-STR]'
`-i[REPLACE-STR]'
- Replace occurences of REPLACE-STR in the initial arguments with
+ Replace occurrences of REPLACE-STR in the initial arguments with
names read from standard input. Also, unquoted blanks do not
terminate arguments. If REPLACE-STR is omitted, it defaults to
`{}' (like for `find -exec'). Implies `-x' and `-l 1'.
diff --git a/find/.cvsignore b/find/.cvsignore
index 4ce9bd44..dde18392 100644
--- a/find/.cvsignore
+++ b/find/.cvsignore
@@ -1,4 +1,3 @@
.deps
Makefile
-Makefile.in
find
diff --git a/find/Makefile.in b/find/Makefile.in
index 28813bc0..9e02823d 100644
--- a/find/Makefile.in
+++ b/find/Makefile.in
@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
+GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@@ -83,8 +85,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
+MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
+OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@@ -133,16 +138,16 @@ man1dir = $(mandir)/man1
MANS = $(man_MANS)
NROFF = nroff
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/find$U.Po $(DEPDIR)/fstype$U.Po \
+$(DEPDIR)/parser$U.Po $(DEPDIR)/pred$U.Po $(DEPDIR)/tree$U.Po \
+$(DEPDIR)/util$U.Po $(DEPDIR)/version$U.Po
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-DEP_FILES = @AMDEP@ $(DEPDIR)/find$U.Po $(DEPDIR)/fstype$U.Po \
-$(DEPDIR)/parser$U.Po $(DEPDIR)/pred$U.Po $(DEPDIR)/tree$U.Po \
-$(DEPDIR)/util$U.Po $(DEPDIR)/version$U.Po
SOURCES = $(find_SOURCES)
OBJECTS = $(am_find_OBJECTS)
@@ -152,7 +157,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu find/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -213,22 +218,73 @@ maintainer-clean-kr:
find: $(find_OBJECTS) $(find_DEPENDENCIES)
@rm -f find
$(LINK) $(find_LDFLAGS) $(find_OBJECTS) $(find_LDADD) $(LIBS)
+alloca_.c: alloca.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c
+error_.c: error.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > error_.c
+fileblocks_.c: fileblocks.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fileblocks_.c
find_.c: find.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/find.c; then echo $(srcdir)/find.c; else echo find.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > find_.c
+fnmatch_.c: fnmatch.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fnmatch_.c
fstype_.c: fstype.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fstype.c; then echo $(srcdir)/fstype.c; else echo fstype.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fstype_.c
+lstat_.c: lstat.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > lstat_.c
+malloc_.c: malloc.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c
+memcmp_.c: memcmp.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcmp_.c
+memcpy_.c: memcpy.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcpy_.c
+memset_.c: memset.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memset_.c
+mktime_.c: mktime.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mktime_.c
parser_.c: parser.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/parser.c; then echo $(srcdir)/parser.c; else echo parser.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > parser_.c
pred_.c: pred.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/pred.c; then echo $(srcdir)/pred.c; else echo pred.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > pred_.c
+realloc_.c: realloc.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
+regex_.c: regex.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c
+stat_.c: stat.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
+stpcpy_.c: stpcpy.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c
+strdup_.c: strdup.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strdup_.c
+strftime_.c: strftime.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strftime_.c
+strncasecmp_.c: strncasecmp.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strncasecmp.c; then echo $(srcdir)/strncasecmp.c; else echo strncasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strncasecmp_.c
+strspn_.c: strspn.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strspn.c; then echo $(srcdir)/strspn.c; else echo strspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strspn_.c
+strstr_.c: strstr.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strstr_.c
+strtol_.c: strtol.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtol_.c
+strtoul_.c: strtoul.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoul_.c
+strtoull_.c: strtoull.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoull.c; then echo $(srcdir)/strtoull.c; else echo strtoull.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoull_.c
+strtoumax_.c: strtoumax.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c
tree_.c: tree.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/tree.c; then echo $(srcdir)/tree.c; else echo tree.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > tree_.c
util_.c: util.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/util.c; then echo $(srcdir)/util.c; else echo util.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > util_.c
version_.c: version.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/version.c; then echo $(srcdir)/version.c; else echo version.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > version_.c
-find_.o fstype_.o parser_.o pred_.o tree_.o util_.o version_.o : \
-$(ANSI2KNR)
+waitpid_.c: waitpid.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/waitpid.c; then echo $(srcdir)/waitpid.c; else echo waitpid.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > waitpid_.c
+alloca_.o error_.o fileblocks_.o find_.o fnmatch_.o fstype_.o lstat_.o \
+malloc_.o memcmp_.o memcpy_.o memset_.o mktime_.o parser_.o pred_.o \
+realloc_.o regex_.o stat_.o stpcpy_.o strdup_.o strftime_.o \
+strncasecmp_.o strspn_.o strstr_.o strtol_.o strtoul_.o strtoull_.o \
+strtoumax_.o tree_.o util_.o version_.o waitpid_.o : $(ANSI2KNR)
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@@ -333,7 +389,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- mkid -f$$here/ID $$unique $(LISP)
+ mkid -fID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -362,29 +418,6 @@ distclean-tags:
maintainer-clean-tags:
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir); \
- else \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
- fi; \
- done
- for subdir in $(SUBDIRS); do \
- if test "$$subdir" = .; then :; else \
- test -d $(distdir)/$$subdir \
- || mkdir $(distdir)/$$subdir \
- || exit 1; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
- || exit 1; \
- fi; \
- done
-
@AMDEP@include $(DEPDIR)/find$U.Po
@AMDEP@include $(DEPDIR)/fstype$U.Po
@AMDEP@include $(DEPDIR)/parser$U.Po
@@ -408,8 +441,32 @@ maintainer-clean-depend:
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c -o $@ $<
+ $(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
info-am:
info: info-recursive
dvi-am:
@@ -485,14 +542,14 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir \
-mostlyclean-depend distclean-depend clean-depend \
-maintainer-clean-depend info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all install-strip installdirs-am installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+distclean-tags clean-tags maintainer-clean-tags mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend distdir info-am \
+info dvi-am dvi check check-am installcheck-am installcheck \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all install-strip \
+installdirs-am installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
$(PROGRAMS): ../lib/libfind.a
diff --git a/find/defs.h b/find/defs.h
index 4066bfe8..68401ed4 100644
--- a/find/defs.h
+++ b/find/defs.h
@@ -1,5 +1,5 @@
/* defs.h -- data types and declarations.
- Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,6 +15,11 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <config.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+
#if defined(HAVE_STRING_H) || defined(STDC_HEADERS)
#include <string.h>
#else
@@ -42,6 +47,17 @@ extern int errno;
#include <time.h>
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
+#ifndef CHAR_BIT
+# define CHAR_BIT 8
+#endif
+
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+
#include "regex.h"
#ifndef S_IFLNK
@@ -59,6 +75,49 @@ extern int errno;
int lstat PARAMS((const char *__path, struct stat *__statbuf));
int stat PARAMS((const char *__path, struct stat *__statbuf));
+#ifndef S_ISUID
+# define S_ISUID 0004000
+#endif
+#ifndef S_ISGID
+# define S_ISGID 0002000
+#endif
+#ifndef S_ISVTX
+# define S_ISVTX 0001000
+#endif
+#ifndef S_IRUSR
+# define S_IRUSR 0000400
+#endif
+#ifndef S_IWUSR
+# define S_IWUSR 0000200
+#endif
+#ifndef S_IXUSR
+# define S_IXUSR 0000100
+#endif
+#ifndef S_IRGRP
+# define S_IRGRP 0000040
+#endif
+#ifndef S_IWGRP
+# define S_IWGRP 0000020
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0000010
+#endif
+#ifndef S_IROTH
+# define S_IROTH 0000004
+#endif
+#ifndef S_IWOTH
+# define S_IWOTH 0000002
+#endif
+#ifndef S_IXOTH
+# define S_IXOTH 0000001
+#endif
+
+#define MODE_WXUSR (S_IWUSR | S_IXUSR)
+#define MODE_R (S_IRUSR | S_IRGRP | S_IROTH)
+#define MODE_RW (S_IWUSR | S_IWGRP | S_IWOTH | MODE_R)
+#define MODE_RWX (S_IXUSR | S_IXGRP | S_IXOTH | MODE_RW)
+#define MODE_ALL (S_ISUID | S_ISGID | S_ISVTX | MODE_RWX)
+
/* Not char because of type promotion; NeXT gcc can't handle it. */
typedef int boolean;
#define true 1
@@ -79,6 +138,13 @@ enum comparison_type
COMP_EQ
};
+enum permissions_type
+{
+ PERM_AT_LEAST,
+ PERM_ANY,
+ PERM_EXACT
+};
+
enum predicate_type
{
NO_TYPE,
@@ -102,14 +168,21 @@ enum predicate_precedence
struct long_val
{
enum comparison_type kind;
- unsigned long l_val;
+ boolean negative; /* Defined only when representing time_t. */
+ uintmax_t l_val;
+};
+
+struct perm_val
+{
+ enum permissions_type kind;
+ mode_t val;
};
struct size_val
{
enum comparison_type kind;
int blocksize;
- unsigned long size;
+ uintmax_t size;
};
struct path_arg
@@ -178,13 +251,14 @@ struct predicate
char *str; /* fstype [i]lname [i]name [i]path */
struct re_pattern_buffer *regex; /* regex */
struct exec_val exec_vec; /* exec ok */
- struct long_val info; /* atime ctime mtime inum links */
+ struct long_val info; /* atime ctime gid inum links mtime
+ size uid */
struct size_val size; /* size */
uid_t uid; /* user */
gid_t gid; /* group */
time_t time; /* newer */
- unsigned long perm; /* perm */
- unsigned long type; /* type */
+ struct perm_val perm; /* perm */
+ mode_t type; /* type */
FILE *stream; /* fprint fprint0 */
struct format_val printf_vec; /* printf fprintf */
} args;
@@ -210,12 +284,9 @@ char *dirname PARAMS((char *path));
void error PARAMS((int status, int errnum, char *message, ...));
/* listfile.c */
-void list_file PARAMS((char *name, char *relname, struct stat *statp, FILE *stream));
+void list_file PARAMS((char *name, char *relname, struct stat *statp, time_t current_time, int output_block_size, FILE *stream));
char *get_link_name PARAMS((char *name, char *relname));
-/* savedir.c */
-char *savedir PARAMS((char *dir, unsigned name_size));
-
/* stpcpy.c */
#if !HAVE_STPCPY
char *stpcpy PARAMS((char *dest, const char *src));
@@ -306,12 +377,11 @@ void print_list PARAMS((struct predicate *node));
/* tree.c */
struct predicate *
-get_expr (struct predicate **input, short int prev_prec);
+get_expr PARAMS((struct predicate **input, short int prev_prec));
boolean opt_expr PARAMS((struct predicate **eval_treep));
boolean mark_stat PARAMS((struct predicate *tree));
/* util.c */
-char *base_name PARAMS((const char *fname));
struct predicate *get_new_pred PARAMS((void));
struct predicate *get_new_pred_chk_op PARAMS((void));
struct predicate *insert_primary PARAMS((boolean (*pred_func )()));
@@ -324,6 +394,8 @@ extern boolean do_dir_first;
extern int maxdepth;
extern int mindepth;
extern int curdepth;
+extern int output_block_size;
+extern time_t start_time;
extern time_t cur_day_start;
extern boolean full_days;
extern boolean no_leaf_check;
diff --git a/find/find.c b/find/find.c
index 647526c2..cf9b46d7 100644
--- a/find/find.c
+++ b/find/find.c
@@ -1,5 +1,5 @@
/* find -- search for files in a directory hierarchy
- Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,17 +22,16 @@
The idea for -print0 and xargs -0 came from
Dan Bernstein <brnstnd@kramden.acf.nyu.edu>. */
-#include <config.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
+#include "defs.h"
+
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#else
#include <sys/file.h>
#endif
-#include "defs.h"
+#include <human.h>
#include <modetype.h>
+#include <savedir.h>
#ifdef HAVE_LOCALE_H
#include <locale.h>
@@ -84,6 +83,12 @@ int mindepth;
/* Current depth; 0 means current path is a command line arg. */
int curdepth;
+/* Output block size. */
+int output_block_size;
+
+/* Time at start of execution. */
+time_t start_time;
+
/* Seconds between 00:00 1/1/70 and either one day before now
(the default), or the start of today (if -daystart is given). */
time_t cur_day_start;
@@ -162,7 +167,8 @@ main (int argc, char **argv)
last_pred = NULL;
do_dir_first = true;
maxdepth = mindepth = -1;
- cur_day_start = time ((time_t *) 0) - DAYSECS;
+ start_time = time (NULL);
+ cur_day_start = start_time - DAYSECS;
full_days = false;
no_leaf_check = false;
stay_on_filesystem = false;
@@ -174,6 +180,8 @@ main (int argc, char **argv)
xstat = lstat;
#endif /* !DEBUG_STAT */
+ human_block_size (getenv ("FIND_BLOCK_SIZE"), 0, &output_block_size);
+
#ifdef DEBUG
printf ("cur_day_start = %s", ctime (&cur_day_start));
#endif /* DEBUG */
@@ -441,8 +449,7 @@ process_dir (char *pathname, char *name, int pathlen, struct stat *statp, char *
subdirs_left = statp->st_nlink - 2; /* Account for name and ".". */
errno = 0;
- /* On some systems (VAX 4.3BSD+NFS), NFS mount points have st_size < 0. */
- name_space = savedir (name, statp->st_size > 0 ? statp->st_size : 512);
+ name_space = savedir (name, statp->st_size);
if (name_space == NULL)
{
if (errno)
diff --git a/find/fstype.c b/find/fstype.c
index 5c316d5e..cd32eaf0 100644
--- a/find/fstype.c
+++ b/find/fstype.c
@@ -1,5 +1,5 @@
/* fstype.c -- determine type of filesystems that files are on
- Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,11 +17,9 @@
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
-#include <config.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include "defs.h"
+
+#include "dirname.h"
#include "modetype.h"
#include <errno.h>
#ifdef STDC_HEADERS
@@ -43,7 +41,6 @@ extern int errno;
#endif
static char *filesystem_type_uncached PARAMS((char *path, char *relpath, struct stat *statp));
-static int xatoi PARAMS((char *cp));
#ifdef FSTYPE_MNTENT /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */
#include <mntent.h>
@@ -260,10 +257,12 @@ filesystem_type_uncached (char *path, char *relpath, struct stat *statp)
devopt = strstr (mnt->mnt_opts, "dev=");
if (devopt)
{
- if (devopt[4] == '0' && (devopt[5] == 'x' || devopt[5] == 'X'))
- dev = xatoi (devopt + 6);
- else
- dev = xatoi (devopt + 4);
+ uintmax_t u = 0;
+ devopt += 4;
+ if (devopt[0] == '0' && (devopt[1] == 'x' || devopt[1] == 'X'))
+ devopt += 2;
+ xstrtoumax (devopt, NULL, 16, &u, NULL);
+ dev = u;
}
else
#endif /* not hpux */
@@ -363,30 +362,3 @@ filesystem_type_uncached (char *path, char *relpath, struct stat *statp)
return xstrdup (type ? type : _("unknown"));
}
-
-#ifdef FSTYPE_MNTENT /* 4.3BSD etc. */
-/* Return the value of the hexadecimal number represented by CP.
- No prefix (like '0x') or suffix (like 'h') is expected to be
- part of CP. */
-
-static int
-xatoi (char *cp)
-{
- int val;
-
- val = 0;
- while (*cp)
- {
- if (*cp >= 'a' && *cp <= 'f')
- val = val * 16 + *cp - 'a' + 10;
- else if (*cp >= 'A' && *cp <= 'F')
- val = val * 16 + *cp - 'A' + 10;
- else if (*cp >= '0' && *cp <= '9')
- val = val * 16 + *cp - '0';
- else
- break;
- cp++;
- }
- return val;
-}
-#endif
diff --git a/find/parser.c b/find/parser.c
index f72f0c5c..d85dd33c 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -1,5 +1,5 @@
/* parser.c -- convert the command line args into an expression tree.
- Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,16 +15,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <config.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include "defs.h"
#include <ctype.h>
-#include <stdio.h>
#include <pwd.h>
#include <grp.h>
#include "modechange.h"
-#include "defs.h"
#include "modetype.h"
+#include "xstrtol.h"
#if ENABLE_NLS
# include <libintl.h>
@@ -122,9 +119,9 @@ static boolean insert_type PARAMS((char *argv[], int *arg_ptr, boolean (*which_p
static boolean insert_fprintf PARAMS((FILE *fp, boolean (*func )(), char *argv[], int *arg_ptr));
static struct segment **make_segment PARAMS((struct segment **segment, char *format, int len, int kind));
static boolean insert_exec_ok PARAMS((boolean (*func )(), char *argv[], int *arg_ptr));
-static boolean get_num_days PARAMS((char *str, unsigned long *num_days, enum comparison_type *comp_type));
+static boolean get_num_days PARAMS((char *str, uintmax_t *num_days, enum comparison_type *comp_type));
static boolean insert_time PARAMS((char *argv[], int *arg_ptr, PFB pred));
-static boolean get_num PARAMS((char *str, unsigned long *num, enum comparison_type *comp_type));
+static boolean get_num PARAMS((char *str, uintmax_t *num, enum comparison_type *comp_type));
static boolean insert_num PARAMS((char *argv[], int *arg_ptr, PFB pred));
static FILE *open_output_file PARAMS((char *path));
@@ -252,16 +249,19 @@ static boolean
parse_amin (char **argv, int *arg_ptr)
{
struct predicate *our_pred;
- unsigned long num;
+ uintmax_t num;
enum comparison_type c_type;
+ time_t t;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
return (false);
if (!get_num_days (argv[*arg_ptr], &num, &c_type))
return (false);
+ t = cur_day_start + DAYSECS - num * 60;
our_pred = insert_primary (pred_amin);
our_pred->args.info.kind = c_type;
- our_pred->args.info.l_val = cur_day_start + DAYSECS - num * 60;
+ our_pred->args.info.negative = t < 0;
+ our_pred->args.info.l_val = t;
(*arg_ptr)++;
return (true);
}
@@ -324,16 +324,19 @@ static boolean
parse_cmin (char **argv, int *arg_ptr)
{
struct predicate *our_pred;
- unsigned long num;
+ uintmax_t num;
enum comparison_type c_type;
+ time_t t;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
return (false);
if (!get_num_days (argv[*arg_ptr], &num, &c_type))
return (false);
+ t = cur_day_start + DAYSECS - num * 60;
our_pred = insert_primary (pred_cmin);
our_pred->args.info.kind = c_type;
- our_pred->args.info.l_val = cur_day_start + DAYSECS - num * 60;
+ our_pred->args.info.negative = t < 0;
+ our_pred->args.info.l_val = t;
(*arg_ptr)++;
return (true);
}
@@ -385,8 +388,10 @@ parse_daystart (char **argv, int *arg_ptr)
{
cur_day_start += DAYSECS;
local = localtime (&cur_day_start);
- cur_day_start -= local->tm_sec + local->tm_min * 60
- + local->tm_hour * 3600;
+ cur_day_start -= (local
+ ? (local->tm_sec + local->tm_min * 60
+ + local->tm_hour * 3600)
+ : cur_day_start % DAYSECS);
full_days = true;
}
return (true);
@@ -688,16 +693,19 @@ static boolean
parse_mmin (char **argv, int *arg_ptr)
{
struct predicate *our_pred;
- unsigned long num;
+ uintmax_t num;
enum comparison_type c_type;
+ time_t t;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
return (false);
if (!get_num_days (argv[*arg_ptr], &num, &c_type))
return (false);
+ t = cur_day_start + DAYSECS - num * 60;
our_pred = insert_primary (pred_mmin);
our_pred->args.info.kind = c_type;
- our_pred->args.info.l_val = cur_day_start + DAYSECS - num * 60;
+ our_pred->args.info.negative = t < 0;
+ our_pred->args.info.l_val = t;
(*arg_ptr)++;
return (true);
}
@@ -898,7 +906,7 @@ parse_path (char **argv, int *arg_ptr)
static boolean
parse_perm (char **argv, int *arg_ptr)
{
- unsigned long perm_val;
+ mode_t perm_val;
int mode_start = 0;
struct mode_change *change;
struct predicate *our_pred;
@@ -930,18 +938,16 @@ parse_perm (char **argv, int *arg_ptr)
switch (argv[*arg_ptr][0])
{
case '-':
- /* Set magic flag to indicate true if at least the given bits are set. */
- our_pred->args.perm = (perm_val & 07777) | 010000;
+ our_pred->args.perm.kind = PERM_AT_LEAST;
break;
case '+':
- /* Set magic flag to indicate true if any of the given bits are set. */
- our_pred->args.perm = (perm_val & 07777) | 020000;
+ our_pred->args.perm.kind = PERM_ANY;
break;
default:
- /* True if exactly the given bits are set. */
- our_pred->args.perm = (perm_val & 07777);
+ our_pred->args.perm.kind = PERM_EXACT;
break;
}
+ our_pred->args.perm.val = perm_val & MODE_ALL;
(*arg_ptr)++;
return (true);
}
@@ -1040,7 +1046,7 @@ static boolean
parse_size (char **argv, int *arg_ptr)
{
struct predicate *our_pred;
- unsigned long num;
+ uintmax_t num;
enum comparison_type c_type;
int blksize = 512;
int len;
@@ -1123,16 +1129,19 @@ static boolean
parse_used (char **argv, int *arg_ptr)
{
struct predicate *our_pred;
- unsigned long num_days;
+ uintmax_t num_days;
enum comparison_type c_type;
+ time_t t;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
return (false);
if (!get_num (argv[*arg_ptr], &num_days, &c_type))
return (false);
+ t = num_days * DAYSECS;
our_pred = insert_primary (pred_used);
our_pred->args.info.kind = c_type;
- our_pred->args.info.l_val = num_days * DAYSECS;
+ our_pred->args.info.negative = t < 0;
+ our_pred->args.info.l_val = t;
(*arg_ptr)++;
return (true);
}
@@ -1190,7 +1199,7 @@ parse_xtype (char **argv, int *arg_ptr)
static boolean
insert_type (char **argv, int *arg_ptr, boolean (*which_pred) (/* ??? */))
{
- unsigned long type_cell;
+ mode_t type_cell;
struct predicate *our_pred;
if ((argv == NULL) || (argv[*arg_ptr] == NULL)
@@ -1382,7 +1391,7 @@ make_segment (struct segment **segment, char *format, int len, int kind)
(*segment)->next = NULL;
(*segment)->text_len = len;
- fmt = (*segment)->text = xmalloc (len + 3); /* room for "ld\0" */
+ fmt = (*segment)->text = xmalloc (len + sizeof "d");
strncpy (fmt, format, len);
fmt += len;
@@ -1393,15 +1402,22 @@ make_segment (struct segment **segment, char *format, int len, int kind)
break;
case 'a': /* atime in `ctime' format */
+ case 'A': /* atime in user-specified strftime format */
+ case 'b': /* size in 512-byte blocks */
case 'c': /* ctime in `ctime' format */
+ case 'C': /* ctime in user-specified strftime format */
case 'F': /* filesystem type */
+ case 'G': /* GID number */
case 'g': /* group name */
+ case 'i': /* inode number */
+ case 'k': /* size in 1K blocks */
case 'l': /* object of symlink */
+ case 'n': /* number of links */
+ case 's': /* size in bytes */
case 't': /* mtime in `ctime' format */
- case 'u': /* user name */
- case 'A': /* atime in user-specified strftime format */
- case 'C': /* ctime in user-specified strftime format */
case 'T': /* mtime in user-specified strftime format */
+ case 'U': /* UID number */
+ case 'u': /* user name */
fprintf_stat_needed = true;
/* FALLTHROUGH */
case 'f': /* basename of path */
@@ -1412,27 +1428,10 @@ make_segment (struct segment **segment, char *format, int len, int kind)
*fmt++ = 's';
break;
- case 'b': /* size in 512-byte blocks */
- case 'k': /* size in 1K blocks */
- case 's': /* size in bytes */
- *fmt++ = 'l';
- /*FALLTHROUGH*/
- case 'n': /* number of links */
- fprintf_stat_needed = true;
- /* FALLTHROUGH */
case 'd': /* depth in search tree (0 = ARGV element) */
*fmt++ = 'd';
break;
- case 'i': /* inode number */
- *fmt++ = 'l';
- /*FALLTHROUGH*/
- case 'G': /* GID number */
- case 'U': /* UID number */
- *fmt++ = 'u';
- fprintf_stat_needed = true;
- break;
-
case 'm': /* mode as octal number (perms only) */
*fmt++ = 'o';
fprintf_stat_needed = true;
@@ -1523,45 +1522,17 @@ insert_exec_ok (boolean (*func) (/* ??? */), char **argv, int *arg_ptr)
get the appropriate information for a time predicate processor. */
static boolean
-get_num_days (char *str, long unsigned int *num_days, enum comparison_type *comp_type)
+get_num_days (char *str, uintmax_t *num_days, enum comparison_type *comp_type)
{
- int len_days; /* length of field */
-
- if (str == NULL)
- return (false);
- switch (str[0])
- {
- case '+':
- *comp_type = COMP_LT;
- str++;
- break;
- case '-':
- *comp_type = COMP_GT;
- str++;
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- *comp_type = COMP_EQ;
- break;
- default:
- return (false);
- }
-
- /* We know the first char has been reasonable. Find the
- number of days to play with. */
- len_days = strspn (str, "0123456789");
- if ((len_days == 0) || (str[len_days] != '\0'))
- return (false);
- *num_days = (unsigned long) atol (str);
- return (true);
+ boolean r = get_num (str, num_days, comp_type);
+ if (r)
+ switch (*comp_type)
+ {
+ case COMP_LT: *comp_type = COMP_GT; break;
+ case COMP_GT: *comp_type = COMP_LT; break;
+ default: break;
+ }
+ return r;
}
/* Insert a time predicate PRED.
@@ -1580,17 +1551,20 @@ static boolean
insert_time (char **argv, int *arg_ptr, PFB pred)
{
struct predicate *our_pred;
- unsigned long num_days;
+ uintmax_t num_days;
enum comparison_type c_type;
+ time_t t;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
return (false);
if (!get_num_days (argv[*arg_ptr], &num_days, &c_type))
return (false);
+ t = (cur_day_start - num_days * DAYSECS
+ + ((c_type == COMP_GT) ? DAYSECS - 1 : 0));
our_pred = insert_primary (pred);
our_pred->args.info.kind = c_type;
- our_pred->args.info.l_val = cur_day_start - num_days * DAYSECS
- + ((c_type == COMP_GT) ? DAYSECS - 1 : 0);
+ our_pred->args.info.negative = t < 0;
+ our_pred->args.info.l_val = t;
(*arg_ptr)++;
#ifdef DEBUG
printf (_("inserting %s\n"), our_pred->p_name);
@@ -1599,13 +1573,13 @@ insert_time (char **argv, int *arg_ptr, PFB pred)
((c_type == COMP_LT) ? "lt" : ((c_type == COMP_EQ) ? "eq" : "?")),
(c_type == COMP_GT) ? " >" :
((c_type == COMP_LT) ? " <" : ((c_type == COMP_EQ) ? ">=" : " ?")));
- printf ("%ld %s", our_pred->args.info.l_val,
- ctime (&our_pred->args.info.l_val));
+ t = our_pred->args.info.l_val;
+ printf ("%ju %s", (uintmax_t) our_pred->args.info.l_val, ctime (&t));
if (c_type == COMP_EQ)
{
- our_pred->args.info.l_val += DAYSECS;
- printf (" < %ld %s", our_pred->args.info.l_val,
- ctime (&our_pred->args.info.l_val));
+ t = our_pred->args.info.l_val += DAYSECS;
+ printf (" < %ju %s",
+ (uintmax_t) our_pred->args.info.l_val, ctime (&t));
our_pred->args.info.l_val -= DAYSECS;
}
#endif /* DEBUG */
@@ -1614,18 +1588,16 @@ insert_time (char **argv, int *arg_ptr, PFB pred)
/* Get a number with comparision information.
The sense of the comparision information is 'normal'; that is,
- '+' looks for inums or links > than the number and '-' less than.
+ '+' looks for a count > than the number and '-' less than.
STR is the ASCII representation of the number.
Set *NUM to the number.
Set *COMP_TYPE to the kind of comparison that is requested.
- Return true if all okay, false if input error.
-
- Used by the -inum and -links predicate parsers. */
+ Return true if all okay, false if input error. */
static boolean
-get_num (char *str, long unsigned int *num, enum comparison_type *comp_type)
+get_num (char *str, uintmax_t *num, enum comparison_type *comp_type)
{
int len_num; /* Length of field. */
@@ -1641,29 +1613,12 @@ get_num (char *str, long unsigned int *num, enum comparison_type *comp_type)
*comp_type = COMP_LT;
str++;
break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
+ default:
*comp_type = COMP_EQ;
break;
- default:
- return (false);
}
- /* We know the first char has been reasonable. Find the number of
- days to play with. */
- len_num = strspn (str, "0123456789");
- if ((len_num == 0) || (str[len_num] != '\0'))
- return (false);
- *num = (unsigned long) atol (str);
- return (true);
+ return xstrtoumax (str, NULL, 10, num, "") == LONGINT_OK;
}
/* Insert a number predicate.
@@ -1682,7 +1637,7 @@ static boolean
insert_num (char **argv, int *arg_ptr, PFB pred)
{
struct predicate *our_pred;
- unsigned long num;
+ uintmax_t num;
enum comparison_type c_type;
if ((argv == NULL) || (argv[*arg_ptr] == NULL))
@@ -1700,7 +1655,7 @@ insert_num (char **argv, int *arg_ptr, PFB pred)
((c_type == COMP_LT) ? "lt" : ((c_type == COMP_EQ) ? "eq" : "?")),
(c_type == COMP_GT) ? " >" :
((c_type == COMP_LT) ? " <" : ((c_type == COMP_EQ) ? " =" : " ?")));
- printf ("%ld\n", our_pred->args.info.l_val);
+ printf ("%ju\n", our_pred->args.info.l_val);
#endif /* DEBUG */
return (true);
}
diff --git a/find/pred.c b/find/pred.c
index 3d3bff6f..74481a12 100644
--- a/find/pred.c
+++ b/find/pred.c
@@ -1,5 +1,5 @@
/* pred.c -- execute the expression tree.
- Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,15 +16,14 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define _GNU_SOURCE
-#include <config.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
+#include "defs.h"
+
#include <fnmatch.h>
#include <signal.h>
#include <pwd.h>
#include <grp.h>
-#include "defs.h"
+#include "basename.h"
+#include "human.h"
#include "modetype.h"
#include "wait.h"
@@ -68,28 +67,75 @@
#define CLOSEDIR(d) closedir (d)
#endif
+
+/* Get or fake the disk device blocksize.
+ Usually defined by sys/param.h (if at all). */
+#ifndef DEV_BSIZE
+# ifdef BSIZE
+# define DEV_BSIZE BSIZE
+# else /* !BSIZE */
+# define DEV_BSIZE 4096
+# endif /* !BSIZE */
+#endif /* !DEV_BSIZE */
+
/* Extract or fake data from a `struct stat'.
- ST_NBLOCKS: Number of 512-byte blocks in the file
- (including indirect blocks).
- HP-UX, perhaps uniquely, counts st_blocks in 1024-byte units.
- This workaround loses when mixing HP-UX and 4BSD filesystems, though. */
-#ifdef _POSIX_SOURCE
-# define ST_NBLOCKS(statp) (((statp)->st_size + 512 - 1) / 512)
-#else
-# ifndef HAVE_ST_BLOCKS
-# define ST_NBLOCKS(statp) (st_blocks ((statp)->st_size))
-# else
-# if defined(hpux) || defined(__hpux__)
-# define ST_NBLOCKS(statp) ((statp)->st_blocks * 2)
-# else
-# define ST_NBLOCKS(statp) ((statp)->st_blocks)
-# endif
-# endif
+ ST_BLKSIZE: Preferred I/O blocksize for the file, in bytes.
+ ST_NBLOCKS: Number of blocks in the file, including indirect blocks.
+ ST_NBLOCKSIZE: Size of blocks used when calculating ST_NBLOCKS. */
+#ifndef HAVE_STRUCT_STAT_ST_BLOCKS
+# define ST_BLKSIZE(statbuf) DEV_BSIZE
+# if defined(_POSIX_SOURCE) || !defined(BSIZE) /* fileblocks.c uses BSIZE. */
+# define ST_NBLOCKS(statbuf) \
+ (S_ISREG ((statbuf).st_mode) \
+ || S_ISDIR ((statbuf).st_mode) \
+ ? (statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0) : 0)
+# else /* !_POSIX_SOURCE && BSIZE */
+# define ST_NBLOCKS(statbuf) \
+ (S_ISREG ((statbuf).st_mode) \
+ || S_ISDIR ((statbuf).st_mode) \
+ ? st_blocks ((statbuf).st_size) : 0)
+# endif /* !_POSIX_SOURCE && BSIZE */
+#else /* HAVE_STRUCT_STAT_ST_BLOCKS */
+/* Some systems, like Sequents, return st_blksize of 0 on pipes. */
+# define ST_BLKSIZE(statbuf) ((statbuf).st_blksize > 0 \
+ ? (statbuf).st_blksize : DEV_BSIZE)
+# if defined(hpux) || defined(__hpux__) || defined(__hpux)
+/* HP-UX counts st_blocks in 1024-byte units.
+ This loses when mixing HP-UX and BSD filesystems with NFS. */
+# define ST_NBLOCKSIZE 1024
+# else /* !hpux */
+# if defined(_AIX) && defined(_I386)
+/* AIX PS/2 counts st_blocks in 4K units. */
+# define ST_NBLOCKSIZE (4 * 1024)
+# else /* not AIX PS/2 */
+# if defined(_CRAY)
+# define ST_NBLOCKS(statbuf) \
+ (S_ISREG ((statbuf).st_mode) \
+ || S_ISDIR ((statbuf).st_mode) \
+ ? (statbuf).st_blocks * ST_BLKSIZE(statbuf)/ST_NBLOCKSIZE : 0)
+# endif /* _CRAY */
+# endif /* not AIX PS/2 */
+# endif /* !hpux */
+#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
+
+#ifndef ST_NBLOCKS
+# define ST_NBLOCKS(statbuf) \
+ (S_ISREG ((statbuf).st_mode) \
+ || S_ISDIR ((statbuf).st_mode) \
+ ? (statbuf).st_blocks : 0)
#endif
+#ifndef ST_NBLOCKSIZE
+# define ST_NBLOCKSIZE 512
+#endif
+
+#undef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+
static boolean insert_lname PARAMS((char *pathname, struct stat *stat_buf, struct predicate *pred_ptr, boolean ignore_case));
static boolean launch PARAMS((struct predicate *pred_ptr));
static char *format_date PARAMS((time_t when, int kind));
+static char *ctime_format PARAMS((time_t when));
#ifdef DEBUG
struct pred_assoc
@@ -440,7 +486,8 @@ pred_false (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
boolean
pred_fls (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
- list_file (pathname, rel_pathname, stat_buf, pred_ptr->args.stream);
+ list_file (pathname, rel_pathname, stat_buf, start_time,
+ output_block_size, pred_ptr->args.stream);
return (true);
}
@@ -466,6 +513,7 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
FILE *fp = pred_ptr->args.printf_vec.stream;
struct segment *segment;
char *cp;
+ char hbuf[LONGEST_HUMAN_READABLE + 1];
for (segment = pred_ptr->args.printf_vec.segment; segment;
segment = segment->next)
@@ -503,28 +551,21 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
fflush (fp);
return (true);
case 'a': /* atime in `ctime' format. */
- cp = ctime (&stat_buf->st_atime);
- cp[24] = '\0';
- fprintf (fp, segment->text, cp);
+ fprintf (fp, segment->text, ctime_format (stat_buf->st_atime));
break;
case 'b': /* size in 512-byte blocks */
- fprintf (fp, segment->text, ST_NBLOCKS (stat_buf));
+ fprintf (fp, segment->text,
+ human_readable ((uintmax_t) ST_NBLOCKS (*stat_buf),
+ hbuf, ST_NBLOCKSIZE, 512));
break;
case 'c': /* ctime in `ctime' format */
- cp = ctime (&stat_buf->st_ctime);
- cp[24] = '\0';
- fprintf (fp, segment->text, cp);
+ fprintf (fp, segment->text, ctime_format (stat_buf->st_ctime));
break;
case 'd': /* depth in search tree */
fprintf (fp, segment->text, curdepth);
break;
case 'f': /* basename of path */
- cp = strrchr (pathname, '/');
- if (cp)
- cp++;
- else
- cp = pathname;
- fprintf (fp, segment->text, cp);
+ fprintf (fp, segment->text, base_name (pathname));
break;
case 'F': /* filesystem type */
fprintf (fp, segment->text,
@@ -544,8 +585,8 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
/* else fallthru */
}
case 'G': /* GID number */
- segment->text[segment->text_len] = 'u';
- fprintf (fp, segment->text, stat_buf->st_gid);
+ fprintf (fp, segment->text,
+ human_readable ((uintmax_t) stat_buf->st_gid, hbuf, 1, 1));
break;
case 'h': /* leading directories part of path */
{
@@ -570,10 +611,13 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
break;
}
case 'i': /* inode number */
- fprintf (fp, segment->text, stat_buf->st_ino);
+ fprintf (fp, segment->text,
+ human_readable ((uintmax_t) stat_buf->st_ino, hbuf, 1, 1));
break;
case 'k': /* size in 1K blocks */
- fprintf (fp, segment->text, (ST_NBLOCKS (stat_buf) + 1) / 2);
+ fprintf (fp, segment->text,
+ human_readable ((uintmax_t) ST_NBLOCKS (*stat_buf),
+ hbuf, ST_NBLOCKSIZE, 1024));
break;
case 'l': /* object of symlink */
#ifdef S_ISLNK
@@ -597,10 +641,38 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
#endif /* S_ISLNK */
break;
case 'm': /* mode as octal number (perms only) */
- fprintf (fp, segment->text, stat_buf->st_mode & 07777);
+ {
+ /* Output the mode portably using the traditional numbers,
+ even if the host unwisely uses some other numbering
+ scheme. But help the compiler in the common case where
+ the host uses the traditional numbering scheme. */
+ mode_t m = stat_buf->st_mode;
+ boolean traditional_numbering_scheme =
+ (S_ISUID == 04000 && S_ISGID == 02000 && S_ISVTX == 01000
+ && S_IRUSR == 00400 && S_IWUSR == 00200 && S_IXUSR == 00100
+ && S_IRGRP == 00040 && S_IWGRP == 00020 && S_IXGRP == 00010
+ && S_IROTH == 00004 && S_IWOTH == 00002 && S_IXOTH == 00001);
+ fprintf (fp, segment->text,
+ (traditional_numbering_scheme
+ ? m & MODE_ALL
+ : ((m & S_ISUID ? 04000 : 0)
+ | (m & S_ISGID ? 02000 : 0)
+ | (m & S_ISVTX ? 01000 : 0)
+ | (m & S_IRUSR ? 00400 : 0)
+ | (m & S_IWUSR ? 00200 : 0)
+ | (m & S_IXUSR ? 00100 : 0)
+ | (m & S_IRGRP ? 00040 : 0)
+ | (m & S_IWGRP ? 00020 : 0)
+ | (m & S_IXGRP ? 00010 : 0)
+ | (m & S_IROTH ? 00004 : 0)
+ | (m & S_IWOTH ? 00002 : 0)
+ | (m & S_IXOTH ? 00001 : 0))));
+ }
break;
case 'n': /* number of links */
- fprintf (fp, segment->text, stat_buf->st_nlink);
+ fprintf (fp, segment->text,
+ human_readable ((uintmax_t) stat_buf->st_nlink,
+ hbuf, 1, 1));
break;
case 'p': /* pathname */
fprintf (fp, segment->text, pathname);
@@ -621,12 +693,12 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
fprintf (fp, segment->text, cp);
break;
case 's': /* size in bytes */
- fprintf (fp, segment->text, stat_buf->st_size);
+ fprintf (fp, segment->text,
+ human_readable ((uintmax_t) stat_buf->st_size,
+ hbuf, 1, 1));
break;
case 't': /* mtime in `ctime' format */
- cp = ctime (&stat_buf->st_mtime);
- cp[24] = '\0';
- fprintf (fp, segment->text, cp);
+ fprintf (fp, segment->text, ctime_format (stat_buf->st_mtime));
break;
case 'u': /* user name */
{
@@ -642,8 +714,8 @@ pred_fprintf (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
/* else fallthru */
}
case 'U': /* UID number */
- segment->text[segment->text_len] = 'u';
- fprintf (fp, segment->text, stat_buf->st_uid);
+ fprintf (fp, segment->text,
+ human_readable ((uintmax_t) stat_buf->st_uid, hbuf, 1, 1));
break;
}
}
@@ -785,7 +857,8 @@ insert_lname (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr,
boolean
pred_ls (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
- list_file (pathname, rel_pathname, stat_buf, stdout);
+ list_file (pathname, rel_pathname, stat_buf, start_time,
+ output_block_size, stdout);
return (true);
}
@@ -960,28 +1033,20 @@ pred_path (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
boolean
pred_perm (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
- if (pred_ptr->args.perm & 010000)
+ switch (pred_ptr->args.perm.kind)
{
- /* Magic flag set in parse_perm:
- true if at least the given bits are set. */
- if ((stat_buf->st_mode & 07777 & pred_ptr->args.perm)
- == (pred_ptr->args.perm & 07777))
- return (true);
- }
- else if (pred_ptr->args.perm & 020000)
- {
- /* Magic flag set in parse_perm:
- true if any of the given bits are set. */
- if ((stat_buf->st_mode & 07777) & pred_ptr->args.perm)
- return (true);
- }
- else
- {
- /* True if exactly the given bits are set. */
- if ((stat_buf->st_mode & 07777) == pred_ptr->args.perm)
- return (true);
+ case PERM_AT_LEAST:
+ return (~stat_buf->st_mode & pred_ptr->args.perm.val) != 0;
+
+ case PERM_ANY:
+ return (stat_buf->st_mode & pred_ptr->args.perm.val) != 0;
+
+ case PERM_EXACT:
+ return (stat_buf->st_mode & MODE_ALL) == pred_ptr->args.perm.val;
+
+ default:
+ abort ();
}
- return (false);
}
boolean
@@ -1019,10 +1084,10 @@ pred_regex (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
boolean
pred_size (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
- unsigned long f_val;
+ uintmax_t f_val;
- f_val = (stat_buf->st_size + pred_ptr->args.size.blocksize - 1)
- / pred_ptr->args.size.blocksize;
+ f_val = ((stat_buf->st_size / pred_ptr->args.size.blocksize)
+ + (stat_buf->st_size % pred_ptr->args.size.blocksize != 0));
switch (pred_ptr->args.size.kind)
{
case COMP_GT:
@@ -1050,8 +1115,8 @@ pred_true (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
boolean
pred_type (char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
{
- unsigned long mode = stat_buf->st_mode;
- unsigned long type = pred_ptr->args.type;
+ mode_t mode = stat_buf->st_mode;
+ mode_t type = pred_ptr->args.type;
#ifndef S_IFMT
/* POSIX system; check `mode' the slow way. */
@@ -1174,7 +1239,7 @@ static boolean
launch (struct predicate *pred_ptr)
{
int status;
- pid_t wait_ret, child_pid;
+ pid_t child_pid;
struct exec_val *execp; /* Pointer for efficiency. */
static int first_time = 1;
@@ -1215,26 +1280,14 @@ launch (struct predicate *pred_ptr)
_exit (1);
}
- wait_ret = wait (&status);
- if (wait_ret == -1)
- {
- error (0, errno, _("error waiting for %s"), execp->vec[0]);
- exit_status = 1;
- return (false);
- }
- if (wait_ret != child_pid)
- {
- error (0, 0, _("wait got pid %d, expected pid %d"), wait_ret, child_pid);
- exit_status = 1;
- return (false);
- }
- if (WIFSTOPPED (status))
- {
- error (0, 0, _("%s stopped by signal %d"),
- execp->vec[0], WSTOPSIG (status));
- exit_status = 1;
- return (false);
- }
+
+ while (waitpid (child_pid, &status, 0) == (pid_t) -1)
+ if (errno != EINTR)
+ {
+ error (0, errno, _("error waiting for %s"), execp->vec[0]);
+ exit_status = 1;
+ return false;
+ }
if (WIFSIGNALED (status))
{
error (0, 0, _("%s terminated by signal %d"),
@@ -1251,23 +1304,46 @@ launch (struct predicate *pred_ptr)
static char *
format_date (time_t when, int kind)
{
- static char fmt[3];
- static char buf[64]; /* More than enough space. */
+ static char buf[MAX (LONGEST_HUMAN_READABLE + 2, 64)];
+ struct tm *tm;
+ char fmt[3];
+
+ fmt[0] = '%';
+ fmt[1] = kind;
+ fmt[2] = '\0';
- if (kind == '@')
+ if (kind != '@'
+ && (tm = localtime (&when))
+ && strftime (buf, sizeof buf, fmt, tm))
+ return buf;
+ else
+ {
+ uintmax_t w = when;
+ char *p = human_readable (when < 0 ? -w : w, buf + 1, 1, 1);
+ if (when < 0)
+ *--p = '-';
+ return p;
+ }
+}
+
+static char *
+ctime_format (when)
+ time_t when;
+{
+ char *r = ctime (&when);
+ if (!r)
{
- sprintf (buf, "%ld", when);
- return (buf);
+ /* The time cannot be represented as a struct tm.
+ Output it as an integer. */
+ return format_date (when, '@');
}
else
{
- fmt[0] = '%';
- fmt[1] = kind;
- fmt[2] = '\0';
- if (strftime (buf, sizeof (buf), fmt, localtime (&when)))
- return (buf);
+ /* Remove the trailing newline from the ctime output,
+ being careful not to assume that the output is fixed-width. */
+ *strchr (r, '\n') = '\0';
+ return r;
}
- return "";
}
#ifdef DEBUG
diff --git a/find/testsuite/.cvsignore b/find/testsuite/.cvsignore
index 85782d6b..dde03fc8 100644
--- a/find/testsuite/.cvsignore
+++ b/find/testsuite/.cvsignore
@@ -1,5 +1,5 @@
Makefile
-Makefile.in
dbg.log
find.log
find.sum
+site.exp
diff --git a/find/testsuite/Makefile.in b/find/testsuite/Makefile.in
index 73022ac3..0a87af38 100644
--- a/find/testsuite/Makefile.in
+++ b/find/testsuite/Makefile.in
@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
+GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@@ -84,8 +86,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
+MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
+OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@@ -119,20 +124,20 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
+EXPECT = expect
+RUNTEST = runtest
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
-EXPECT = expect
-RUNTEST = runtest
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu find/testsuite/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -140,21 +145,6 @@ tags: TAGS
TAGS:
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-distdir: $(DISTFILES)
- $(mkinstalldirs) $(distdir)/config $(distdir)/find.gnu
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir); \
- else \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
- fi; \
- done
-
RUNTESTFLAGS =
RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
@@ -176,10 +166,28 @@ site.exp: Makefile
@echo 'set tool $(DEJATOOL)' >> $@-t
@echo 'set srcdir $(srcdir)' >> $@-t
@echo 'set objdir' `pwd` >> $@-t
+ @echo 'set host_alias $(host_alias)' >> $@-t
+ @echo 'set host_triplet $(host_triplet)' >> $@-t
@echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
@test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
@test ! -f site.exp || mv site.exp site.bak
@mv $@-t site.exp
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+distdir: $(DISTFILES)
+ $(mkinstalldirs) $(distdir)/config $(distdir)/find.gnu
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
info-am:
info: info-am
dvi-am:
@@ -236,7 +244,7 @@ maintainer-clean-am: maintainer-clean-generic distclean-am
maintainer-clean: maintainer-clean-am
-.PHONY: tags distdir check-DEJAGNU info-am info dvi-am dvi check \
+.PHONY: tags check-DEJAGNU distdir info-am info dvi-am dvi check \
check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
diff --git a/find/tree.c b/find/tree.c
index 6f4716c0..c07b2825 100644
--- a/find/tree.c
+++ b/find/tree.c
@@ -1,5 +1,5 @@
/* tree.c -- helper functions to build and evaluate the expression tree.
- Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,10 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <config.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
#include "defs.h"
#if ENABLE_NLS
diff --git a/find/util.c b/find/util.c
index cf8d59e3..a830b873 100644
--- a/find/util.c
+++ b/find/util.c
@@ -1,5 +1,5 @@
/* util.c -- functions for initializing new tree elements, and other things.
- Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,10 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <config.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
#include "defs.h"
#if ENABLE_NLS
diff --git a/intl/ChangeLog b/intl/ChangeLog
index 75cd3f43..e9c959df 100644
--- a/intl/ChangeLog
+++ b/intl/ChangeLog
@@ -1,3 +1,8 @@
+2000-03-06 Paul Eggert <eggert@twinsun.com>
+
+ * libgettext.h (gettext_noop): Do not parenthesize Str in the
+ definiens, as that breaks string literal concatenation.
+
1999-08-12 Paul Eggert <eggert@twinsun.com>
* localealias.c (memcpy): Return 2nd argument, so that it's
diff --git a/intl/libgettext.h b/intl/libgettext.h
index 3a92960a..4028ab19 100644
--- a/intl/libgettext.h
+++ b/intl/libgettext.h
@@ -85,8 +85,10 @@ extern int _msg_tbl_length;
/* For automatical extraction of messages sometimes no real
- translation is needed. Instead the string itself is the result. */
-#define gettext_noop(Str) (Str)
+ translation is needed. Instead the string itself is the result.
+ Do not parenthesize Str in the definiens,
+ as that breaks string literal concatenation. */
+#define gettext_noop(Str) Str
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default
diff --git a/lib/.cvsignore b/lib/.cvsignore
index e9955884..63f8570f 100644
--- a/lib/.cvsignore
+++ b/lib/.cvsignore
@@ -1,3 +1,2 @@
.deps
Makefile
-Makefile.in
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 13a85aa1..fe68f8d2 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
+GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@@ -83,8 +85,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
+MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
+OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@@ -98,25 +103,32 @@ l = @l@
AUTOMAKE_OPTIONS = ansi2knr
+SUBDIRS = posix
noinst_LIBRARIES = libfind.a
localedir = $(datadir)/locale
INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\"
libfind_a_SOURCES = regex.h \
+ argmatch.h \
+ argmatch.c \
+ basename.h \
+ basename.c \
dirname.c \
dirname.h \
- error.c \
- error.h \
filemode.c \
filemode.h \
getopt.c \
getopt.h \
getopt1.c \
+ human.c \
+ human.h \
idcache.c \
listfile.c \
modechange.c \
modechange.h \
- pathmax.h \
nextelem.c \
+ pathmax.h \
+ quotearg.c \
+ quotearg.h \
savedir.c \
savedir.h \
xmalloc.c \
@@ -128,6 +140,7 @@ libfind_a_SOURCES = regex.h \
xstrtol.h \
xstrtoul.c \
xstrtoul.h \
+ xstrtoumax.c \
getline.c \
getline.h \
basename.c
@@ -138,7 +151,10 @@ libfind_a_LIBADD = @LIBOBJS@ \
# Are these really needed?
-EXTRA_DIST = modetype.h \
+EXTRA_DIST = \
+ modetype.h \
+ mktime.c \
+ regex.c \
wait.h \
alloca.c \
getline.h \
@@ -161,10 +177,11 @@ LIBS = @LIBS@
ANSI2KNR = @ANSI2KNR@
libfind_a_AR = $(AR) cru
libfind_a_DEPENDENCIES = @LIBOBJS@ @ALLOCA@
-am_libfind_a_OBJECTS = dirname$U.o error$U.o filemode$U.o getopt$U.o \
-getopt1$U.o idcache$U.o listfile$U.o modechange$U.o nextelem$U.o \
-savedir$U.o xmalloc$U.o xstrdup$U.o xgetcwd$U.o xstrtol$U.o \
-xstrtoul$U.o getline$U.o basename$U.o
+am_libfind_a_OBJECTS = argmatch$U.o basename$U.o dirname$U.o \
+filemode$U.o getopt$U.o getopt1$U.o human$U.o idcache$U.o listfile$U.o \
+modechange$U.o nextelem$U.o quotearg$U.o savedir$U.o xmalloc$U.o \
+xstrdup$U.o xgetcwd$U.o xstrtol$U.o xstrtoul$U.o xstrtoumax$U.o \
+getline$U.o basename$U.o
libfind_a_OBJECTS = $(am_libfind_a_OBJECTS)
AR = ar
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -172,29 +189,33 @@ CFLAGS = @CFLAGS@
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(libfind_a_SOURCES)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/alloca.Po $(DEPDIR)/argmatch$U.Po \
+$(DEPDIR)/basename$U.Po $(DEPDIR)/dirname$U.Po $(DEPDIR)/error.Po \
+$(DEPDIR)/fileblocks.Po $(DEPDIR)/filemode$U.Po $(DEPDIR)/fnmatch.Po \
+$(DEPDIR)/getline$U.Po $(DEPDIR)/getopt$U.Po $(DEPDIR)/getopt1$U.Po \
+$(DEPDIR)/human$U.Po $(DEPDIR)/idcache$U.Po $(DEPDIR)/listfile$U.Po \
+$(DEPDIR)/lstat.Po $(DEPDIR)/malloc.Po $(DEPDIR)/memcmp.Po \
+$(DEPDIR)/memcpy.Po $(DEPDIR)/memset.Po $(DEPDIR)/mktime.Po \
+$(DEPDIR)/modechange$U.Po $(DEPDIR)/nextelem$U.Po \
+$(DEPDIR)/quotearg$U.Po $(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po \
+$(DEPDIR)/savedir$U.Po $(DEPDIR)/stat.Po $(DEPDIR)/stpcpy.Po \
+$(DEPDIR)/strdup.Po $(DEPDIR)/strftime.Po $(DEPDIR)/strncasecmp.Po \
+$(DEPDIR)/strspn.Po $(DEPDIR)/strstr.Po $(DEPDIR)/strtol.Po \
+$(DEPDIR)/strtoul.Po $(DEPDIR)/strtoull.Po $(DEPDIR)/strtoumax.Po \
+$(DEPDIR)/waitpid.Po $(DEPDIR)/xgetcwd$U.Po $(DEPDIR)/xmalloc$U.Po \
+$(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoul$U.Po \
+$(DEPDIR)/xstrtoumax$U.Po
DIST_COMMON = Makefile.am Makefile.in alloca.c ansi2knr.1 ansi2knr.c \
-fileblocks.c fnmatch.c getline.c malloc.c memcmp.c memset.c mktime.c \
-realloc.c regex.c stpcpy.c strcasecmp.c strdup.c strftime.c \
-strncasecmp.c strspn.c strstr.c strtol.c strtoul.c
+depcomp error.c error.h fileblocks.c fnmatch.c malloc.c memcmp.c \
+memcpy.c memset.c mktime.c realloc.c regex.c stpcpy.c strdup.c \
+strftime.c strncasecmp.c strspn.c strstr.c strtol.c strtoul.c \
+strtoull.c strtoumax.c waitpid.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-DEP_FILES = @AMDEP@ $(DEPDIR)/alloca.Po $(DEPDIR)/basename$U.Po \
-$(DEPDIR)/dirname$U.Po $(DEPDIR)/error$U.Po $(DEPDIR)/fileblocks.Po \
-$(DEPDIR)/filemode$U.Po $(DEPDIR)/fnmatch.Po $(DEPDIR)/getline$U.Po \
-$(DEPDIR)/getline.Po $(DEPDIR)/getopt$U.Po $(DEPDIR)/getopt1$U.Po \
-$(DEPDIR)/idcache$U.Po $(DEPDIR)/listfile$U.Po $(DEPDIR)/lstat.Po \
-$(DEPDIR)/malloc.Po $(DEPDIR)/memcmp.Po $(DEPDIR)/memset.Po \
-$(DEPDIR)/mktime.Po $(DEPDIR)/modechange$U.Po $(DEPDIR)/nextelem$U.Po \
-$(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po $(DEPDIR)/savedir$U.Po \
-$(DEPDIR)/stat.Po $(DEPDIR)/stpcpy.Po $(DEPDIR)/strcasecmp.Po \
-$(DEPDIR)/strdup.Po $(DEPDIR)/strftime.Po $(DEPDIR)/strncasecmp.Po \
-$(DEPDIR)/strspn.Po $(DEPDIR)/strstr.Po $(DEPDIR)/strtol.Po \
-$(DEPDIR)/strtoul.Po $(DEPDIR)/xgetcwd$U.Po $(DEPDIR)/xmalloc$U.Po \
-$(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoul$U.Po
SOURCES = $(libfind_a_SOURCES)
OBJECTS = $(am_libfind_a_OBJECTS)
@@ -204,7 +225,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -256,6 +277,8 @@ libfind.a: $(libfind_a_OBJECTS) $(libfind_a_DEPENDENCIES)
$(RANLIB) libfind.a
alloca_.c: alloca.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c
+argmatch_.c: argmatch.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > argmatch_.c
basename_.c: basename.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > basename_.c
dirname_.c: dirname.c $(ANSI2KNR)
@@ -274,6 +297,8 @@ getopt_.c: getopt.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt_.c
getopt1_.c: getopt1.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt1_.c
+human_.c: human.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/human.c; then echo $(srcdir)/human.c; else echo human.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > human_.c
idcache_.c: idcache.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/idcache.c; then echo $(srcdir)/idcache.c; else echo idcache.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > idcache_.c
listfile_.c: listfile.c $(ANSI2KNR)
@@ -284,6 +309,8 @@ malloc_.c: malloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c
memcmp_.c: memcmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcmp_.c
+memcpy_.c: memcpy.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcpy_.c
memset_.c: memset.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memset_.c
mktime_.c: mktime.c $(ANSI2KNR)
@@ -292,6 +319,8 @@ modechange_.c: modechange.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/modechange.c; then echo $(srcdir)/modechange.c; else echo modechange.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > modechange_.c
nextelem_.c: nextelem.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/nextelem.c; then echo $(srcdir)/nextelem.c; else echo nextelem.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > nextelem_.c
+quotearg_.c: quotearg.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/quotearg.c; then echo $(srcdir)/quotearg.c; else echo quotearg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > quotearg_.c
realloc_.c: realloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
regex_.c: regex.c $(ANSI2KNR)
@@ -302,8 +331,6 @@ stat_.c: stat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
stpcpy_.c: stpcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c
-strcasecmp_.c: strcasecmp.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strcasecmp_.c
strdup_.c: strdup.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strdup_.c
strftime_.c: strftime.c $(ANSI2KNR)
@@ -318,6 +345,12 @@ strtol_.c: strtol.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtol_.c
strtoul_.c: strtoul.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoul_.c
+strtoull_.c: strtoull.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoull.c; then echo $(srcdir)/strtoull.c; else echo strtoull.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoull_.c
+strtoumax_.c: strtoumax.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c
+waitpid_.c: waitpid.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/waitpid.c; then echo $(srcdir)/waitpid.c; else echo waitpid.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > waitpid_.c
xgetcwd_.c: xgetcwd.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xgetcwd_.c
xmalloc_.c: xmalloc.c $(ANSI2KNR)
@@ -328,13 +361,69 @@ xstrtol_.c: xstrtol.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtol_.c
xstrtoul_.c: xstrtoul.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoul.c; then echo $(srcdir)/xstrtoul.c; else echo xstrtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtoul_.c
-alloca_.o basename_.o dirname_.o error_.o fileblocks_.o filemode_.o \
-fnmatch_.o getline_.o getopt_.o getopt1_.o idcache_.o listfile_.o \
-lstat_.o malloc_.o memcmp_.o memset_.o mktime_.o modechange_.o \
-nextelem_.o realloc_.o regex_.o savedir_.o stat_.o stpcpy_.o \
-strcasecmp_.o strdup_.o strftime_.o strncasecmp_.o strspn_.o strstr_.o \
-strtol_.o strtoul_.o xgetcwd_.o xmalloc_.o xstrdup_.o xstrtol_.o \
-xstrtoul_.o : $(ANSI2KNR)
+xstrtoumax_.c: xstrtoumax.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoumax.c; then echo $(srcdir)/xstrtoumax.c; else echo xstrtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtoumax_.c
+alloca_.o argmatch_.o basename_.o dirname_.o error_.o fileblocks_.o \
+filemode_.o fnmatch_.o getline_.o getopt_.o getopt1_.o human_.o \
+idcache_.o listfile_.o lstat_.o malloc_.o memcmp_.o memcpy_.o memset_.o \
+mktime_.o modechange_.o nextelem_.o quotearg_.o realloc_.o regex_.o \
+savedir_.o stat_.o stpcpy_.o strdup_.o strftime_.o strncasecmp_.o \
+strspn_.o strstr_.o strtol_.o strtoul_.o strtoull_.o strtoumax_.o \
+waitpid_.o xgetcwd_.o xmalloc_.o xstrdup_.o xstrtol_.o xstrtoul_.o \
+xstrtoumax_.o : $(ANSI2KNR)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ if test "$$subdir" = "."; then dot_seen=yes; else :; fi; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
tags: TAGS
@@ -345,12 +434,17 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- mkid -f$$here/ID $$unique $(LISP)
+ mkid -fID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
@@ -369,46 +463,34 @@ distclean-tags:
maintainer-clean-tags:
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir); \
- else \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
- fi; \
- done
-
@AMDEP@include $(DEPDIR)/alloca.Po
+@AMDEP@include $(DEPDIR)/argmatch$U.Po
@AMDEP@include $(DEPDIR)/basename$U.Po
@AMDEP@include $(DEPDIR)/dirname$U.Po
-@AMDEP@include $(DEPDIR)/error$U.Po
+@AMDEP@include $(DEPDIR)/error.Po
@AMDEP@include $(DEPDIR)/fileblocks.Po
@AMDEP@include $(DEPDIR)/filemode$U.Po
@AMDEP@include $(DEPDIR)/fnmatch.Po
@AMDEP@include $(DEPDIR)/getline$U.Po
-@AMDEP@include $(DEPDIR)/getline.Po
@AMDEP@include $(DEPDIR)/getopt$U.Po
@AMDEP@include $(DEPDIR)/getopt1$U.Po
+@AMDEP@include $(DEPDIR)/human$U.Po
@AMDEP@include $(DEPDIR)/idcache$U.Po
@AMDEP@include $(DEPDIR)/listfile$U.Po
@AMDEP@include $(DEPDIR)/lstat.Po
@AMDEP@include $(DEPDIR)/malloc.Po
@AMDEP@include $(DEPDIR)/memcmp.Po
+@AMDEP@include $(DEPDIR)/memcpy.Po
@AMDEP@include $(DEPDIR)/memset.Po
@AMDEP@include $(DEPDIR)/mktime.Po
@AMDEP@include $(DEPDIR)/modechange$U.Po
@AMDEP@include $(DEPDIR)/nextelem$U.Po
+@AMDEP@include $(DEPDIR)/quotearg$U.Po
@AMDEP@include $(DEPDIR)/realloc.Po
@AMDEP@include $(DEPDIR)/regex.Po
@AMDEP@include $(DEPDIR)/savedir$U.Po
@AMDEP@include $(DEPDIR)/stat.Po
@AMDEP@include $(DEPDIR)/stpcpy.Po
-@AMDEP@include $(DEPDIR)/strcasecmp.Po
@AMDEP@include $(DEPDIR)/strdup.Po
@AMDEP@include $(DEPDIR)/strftime.Po
@AMDEP@include $(DEPDIR)/strncasecmp.Po
@@ -416,11 +498,15 @@ distdir: $(DISTFILES)
@AMDEP@include $(DEPDIR)/strstr.Po
@AMDEP@include $(DEPDIR)/strtol.Po
@AMDEP@include $(DEPDIR)/strtoul.Po
+@AMDEP@include $(DEPDIR)/strtoull.Po
+@AMDEP@include $(DEPDIR)/strtoumax.Po
+@AMDEP@include $(DEPDIR)/waitpid.Po
@AMDEP@include $(DEPDIR)/xgetcwd$U.Po
@AMDEP@include $(DEPDIR)/xmalloc$U.Po
@AMDEP@include $(DEPDIR)/xstrdup$U.Po
@AMDEP@include $(DEPDIR)/xstrtol$U.Po
@AMDEP@include $(DEPDIR)/xstrtoul$U.Po
+@AMDEP@include $(DEPDIR)/xstrtoumax$U.Po
mostlyclean-depend:
@@ -437,32 +523,57 @@ maintainer-clean-depend:
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c -o $@ $<
+ $(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
info-am:
-info: info-am
+info: info-recursive
dvi-am:
-dvi: dvi-am
+dvi: dvi-recursive
check-am: all-am
-check: check-am
+check: check-recursive
installcheck-am:
-installcheck: installcheck-am
+installcheck: installcheck-recursive
install-exec-am:
-install-exec: install-exec-am
+install-exec: install-exec-recursive
install-data-am:
-install-data: install-data-am
+install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
+install: install-recursive
uninstall-am:
-uninstall: uninstall-am
+uninstall: uninstall-recursive
all-am: Makefile $(ANSI2KNR) $(LIBRARIES)
-all-redirect: all-am
+all-redirect: all-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
-installdirs:
+installdirs: installdirs-recursive
+installdirs-am:
mostlyclean-generic:
@@ -481,18 +592,18 @@ mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-krextra mostlyclean-kr mostlyclean-tags \
mostlyclean-depend mostlyclean-generic
-mostlyclean: mostlyclean-am
+mostlyclean: mostlyclean-recursive
clean-am: clean-noinstLIBRARIES clean-compile clean-krextra clean-kr \
clean-tags clean-depend clean-generic mostlyclean-am
-clean: clean-am
+clean: clean-recursive
distclean-am: distclean-noinstLIBRARIES distclean-compile \
distclean-krextra distclean-kr distclean-tags \
distclean-depend distclean-generic clean-am
-distclean: distclean-am
+distclean: distclean-recursive
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-krextra \
@@ -502,21 +613,27 @@ maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-maintainer-clean: maintainer-clean-am
+maintainer-clean: maintainer-clean-recursive
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-krextra distclean-krextra \
clean-krextra maintainer-clean-krextra mostlyclean-kr distclean-kr \
-clean-kr maintainer-clean-kr tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir mostlyclean-depend \
-distclean-depend clean-depend maintainer-clean-depend info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
-install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all install-strip \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+clean-kr maintainer-clean-kr install-recursive uninstall-recursive \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend distdir info-am \
+info dvi-am dvi check check-am installcheck-am installcheck \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all install-strip \
+installdirs-am installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
lstat.c: xstat.in
diff --git a/lib/alloca.c b/lib/alloca.c
index b102eb11..55a80677 100644
--- a/lib/alloca.c
+++ b/lib/alloca.c
@@ -25,6 +25,13 @@
# include <config.h>
#endif
+#if HAVE_STRING_H
+# include <string.h>
+#endif
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
#ifdef emacs
# include "blockinput.h"
#endif
@@ -210,6 +217,9 @@ alloca (unsigned size)
register pointer new = malloc (sizeof (header) + size);
/* Address of header. */
+ if (new == 0)
+ abort();
+
((header *) new)->h.next = last_alloca_header;
((header *) new)->h.deep = depth;
diff --git a/lib/ansi2knr.1 b/lib/ansi2knr.1
index f9ee5a63..29fd6bb7 100644
--- a/lib/ansi2knr.1
+++ b/lib/ansi2knr.1
@@ -1,15 +1,21 @@
-.TH ANSI2KNR 1 "19 Jan 1996"
+.\" $Id$
+.TH ANSI2KNR 1 "9 September 1998" \" -*- nroff -*-
.SH NAME
ansi2knr \- convert ANSI C to Kernighan & Ritchie C
.SH SYNOPSIS
-.I ansi2knr
-[--varargs] input_file [output_file]
-.SH DESCRIPTION
-If no output_file is supplied, output goes to stdout.
+\fBansi2knr\fR [\fB--filename\fR \fIfilename\fR] [\fIinput_file\fR [\fIoutput_file\fR]]
.br
+.SH DESCRIPTION
+\fB--filename\fR provides the file name for the #line directive in the output,
+overriding \fIinput_file\fR (if present).
+.sp
+If no \fIinput_file\fR is supplied, input is read from stdin.
+.sp
+If no \fIoutput_file\fR is supplied, output goes to stdout.
+.sp
There are no error messages.
.sp
-.I ansi2knr
+\fBansi2knr\fR
recognizes function definitions by seeing a non-keyword identifier at the left
margin, followed by a left parenthesis, with a right parenthesis as the last
character on the line, and with a left brace as the first token on the
@@ -18,16 +24,23 @@ multi-line header provided that no intervening line ends with a left or right
brace or a semicolon. These algorithms ignore whitespace and comments, except
that the function name must be the first thing on the line.
.sp
+\fBansi2knr\fP
+also recognizes adjacent string literals and concatenates them.
+.sp
The following constructs will confuse it:
.br
- Any other construct that starts at the left margin and follows the
above syntax (such as a macro or function call).
.br
- Some macros that tinker with the syntax of the function header.
+.br
+ - String literals whose concatenation requires rewriting
+their contents; e.g. "ab\0" "07c" is concatenated to "ab\007c",
+which is not correct.
.sp
The --varargs switch is obsolete, and is recognized only for
backwards compatibility. The present version of
-.I ansi2knr
+\fBansi2knr\fR
will always attempt to convert a ... argument to va_alist and va_dcl.
.SH AUTHOR
L. Peter Deutsch <ghost@aladdin.com> wrote the original ansi2knr and
diff --git a/lib/ansi2knr.c b/lib/ansi2knr.c
index 8142b385..a3e126a7 100644
--- a/lib/ansi2knr.c
+++ b/lib/ansi2knr.c
@@ -37,21 +37,21 @@ program under the GPL.
* There are no error messages.
*
* ansi2knr recognizes function definitions by seeing a non-keyword
- * identifier at the left margin, followed by a left parenthesis,
- * with a right parenthesis as the last character on the line,
- * and with a left brace as the first token on the following line
- * (ignoring possible intervening comments), except that a line
+ * identifier at the left margin, followed by a left parenthesis, with a
+ * right parenthesis as the last character on the line, and with a left
+ * brace as the first token on the following line (ignoring possible
+ * intervening comments and/or preprocessor directives), except that a line
* consisting of only
* identifier1(identifier2)
* will not be considered a function definition unless identifier2 is
* the word "void", and a line consisting of
* identifier1(identifier2, <<arbitrary>>)
* will not be considered a function definition.
- * ansi2knr will recognize a multi-line header provided
- * that no intervening line ends with a left or right brace or a semicolon.
- * These algorithms ignore whitespace and comments, except that
- * the function name must be the first thing on the line.
- * The following constructs will confuse it:
+ * ansi2knr will recognize a multi-line header provided that no intervening
+ * line ends with a left or right brace or a semicolon. These algorithms
+ * ignore whitespace, comments, and preprocessor directives, except that
+ * the function name must be the first thing on the line. The following
+ * constructs will confuse it:
* - Any other construct that starts at the left margin and
* follows the above syntax (such as a macro or function call).
* - Some macros that tinker with the syntax of function headers.
@@ -61,6 +61,8 @@ program under the GPL.
* The original and principal author of ansi2knr is L. Peter Deutsch
* <ghost@aladdin.com>. Other authors are noted in the change history
* that follows (in reverse chronological order):
+ lpd 1999-08-17 added code to allow preprocessor directives
+ wherever comments are allowed
lpd 1999-04-12 added minor fixes from Pavel Roskin
<pavel_roskin@geocities.com> for clean compilation with
gcc -W -Wall
@@ -196,11 +198,14 @@ program under the GPL.
#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
/* Forward references */
+char *ppdirforward();
+char *ppdirbackward();
char *skipspace();
char *scanstring();
int writeblanks();
int test1();
int convert1();
+int concatlits();
/* The main program */
int
@@ -298,7 +303,7 @@ f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
goto wl;
if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
goto wl;
- switch ( *skipspace(more, 1) )
+ switch ( *skipspace(ppdirforward(more), 1) )
{
case '{':
/* Definitely a function header. */
@@ -324,6 +329,7 @@ f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
continue;
/* falls through */
default: /* not a function */
+ concatlits(buf, line, buf + bufsize, in);
wl: fputs(buf, out);
break;
}
@@ -349,36 +355,84 @@ wl: fputs(buf, out);
return 0;
}
+/*
+ * Skip forward or backward over one or more preprocessor directives.
+ */
+char *
+ppdirforward(p)
+ char *p;
+{
+ for (; *p == '#'; ++p) {
+ for (; *p != '\r' && *p != '\n'; ++p)
+ if (*p == 0)
+ return p;
+ if (*p == '\r' && p[1] == '\n')
+ ++p;
+ }
+ return p;
+}
+char *
+ppdirbackward(p, limit)
+ char *p;
+ char *limit;
+{
+ char *np = p;
+
+ for (;; p = --np) {
+ if (*np == '\n' && np[-1] == '\r')
+ --np;
+ for (; np > limit && np[-1] != '\r' && np[-1] != '\n'; --np)
+ if (np[-1] == 0)
+ return np;
+ if (*np != '#')
+ return p;
+ }
+}
+
/* Skip over whitespace and comments, in either direction. */
char *
skipspace(p, dir)
- register char *p;
- register int dir; /* 1 for forward, -1 for backward */
-{ for ( ; ; )
- { while ( is_space(*p) )
- p += dir;
- if ( !(*p == '/' && p[dir] == '*') )
- break;
- p += dir; p += dir;
- while ( !(*p == '*' && p[dir] == '/') )
- { if ( *p == 0 )
- return p; /* multi-line comment?? */
- p += dir;
- }
- p += dir; p += dir;
- }
- return p;
+ char *p;
+ int dir; /* 1 for forward, -1 for backward */
+{
+ for ( ; ; ) {
+ while ( is_space(*p) )
+ p += dir;
+ if ( !(*p == '/' && p[dir] == '*') )
+ break;
+ p += dir; p += dir;
+ while ( !(*p == '*' && p[dir] == '/') ) {
+ if ( *p == 0 )
+ return p; /* multi-line comment?? */
+ p += dir;
+ }
+ p += dir; p += dir;
+ }
+ return p;
}
/* Scan over a quoted string, in either direction. */
char *
scanstring(p, dir)
- register char *p;
- register int dir;
+ char *p;
+ int dir;
{
- for (p += dir; ; p += dir)
- if (*p == '"' && p[-dir] != '\\')
- return p + dir;
+ char quote = *p;
+ for (p += dir; *p; p += dir) {
+ if (*p == quote) {
+ char *q = p;
+ int backslashed;
+ for (backslashed = 0; ; backslashed ^= 1) {
+ for (q--; *q == '\n' && q[-1] == '\\'; q -= 2)
+ continue;
+ if (*q != '\\')
+ break;
+ }
+ if (!backslashed)
+ return p + dir;
+ }
+ }
+ return p; /* unterminated string */
}
/*
@@ -412,14 +466,14 @@ writeblanks(start, end)
int
test1(buf)
char *buf;
-{ register char *p = buf;
+{ char *p = buf;
char *bend;
char *endfn;
int contin;
if ( !isidfirstchar(*p) )
return 0; /* no name at left margin */
- bend = skipspace(buf + strlen(buf) - 1, -1);
+ bend = skipspace(ppdirbackward(buf + strlen(buf) - 1, buf), -1);
switch ( *bend )
{
case ';': contin = 0 /*2*/; break;
@@ -498,7 +552,7 @@ convert1(buf, out, header, convert_varargs)
int header; /* Boolean */
int convert_varargs; /* Boolean */
{ char *endfn;
- register char *p;
+ char *p;
/*
* The breaks table contains pointers to the beginning and end
* of each argument.
@@ -558,7 +612,7 @@ top: p = endfn;
if (p[1] == '*')
p = skipspace(p, 1) - 1;
break;
- case '"':
+ case '"': case '\'':
p = scanstring(p, 1) - 1;
break;
default:
@@ -592,7 +646,7 @@ top: p = endfn;
if (p > buf && p[-1] == '*')
p = skipspace(p, -1) + 1;
break;
- case '"':
+ case '"': case '\'':
p = scanstring(p, -1) + 1;
break;
default: ;
@@ -676,3 +730,65 @@ found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )
free((char *)breaks);
return 0;
}
+
+/* Append a line to a buffer. Return the end of the appended line. */
+char *
+appendline(lineend, bufend, in)
+ char *lineend;
+ char *bufend;
+ FILE *in;
+{
+ if (bufend == lineend)
+ return NULL;
+ if (fgets(lineend, (unsigned)(bufend - lineend), in) == NULL)
+ return NULL;
+ return lineend + strlen(lineend);
+}
+
+/*
+ * Concatenate string literals in a non-function line, appending
+ * new lines if a string literal crosses a line boundary or ends a line.
+ */
+int
+concatlits(line, lineend, bufend, in)
+ char *line;
+ char *lineend;
+ FILE *in;
+{
+ char *d = line;
+ char *s = line;
+ char *s1;
+ int pending_newlines = 0;
+ if (lineend[-1] != '\n')
+ return 0;
+ if (*skipspace(s, 1) == '#')
+ return 0;
+ while (*s) {
+ switch ((*d++ = *s++))
+ {
+ case '"': case '\'':
+ for (;;) {
+ while ((s1 = scanstring(s - 1, 1)) == lineend)
+ if (!(lineend = appendline(lineend, bufend, in)))
+ goto finish;
+ do *d++ = *s++;
+ while (s != s1);
+ if (s[-1] != '"')
+ break;
+ while ((s1 = skipspace(s, 1)) == lineend)
+ if (!(lineend = appendline(lineend, bufend, in)))
+ goto finish;
+ if (*s1 != '"')
+ break;
+ d--;
+ do pending_newlines += *s++ == '\n';
+ while (s <= s1);
+ }
+ }
+ }
+ while (pending_newlines--)
+ *d++ = '\n';
+finish:
+ strcpy(d, s);
+ return 0;
+}
diff --git a/lib/dirname.c b/lib/dirname.c
index 483c3386..cf62de7a 100644
--- a/lib/dirname.c
+++ b/lib/dirname.c
@@ -57,8 +57,17 @@ dir_name (const char *path)
else
{
/* Remove any trailing slashes from the result. */
+#ifdef MSDOS
+ char *lim = (path[0] >= 'A' && path[0] <= 'z' && path[1] == ':')
+ ? path + 2 : path;
+
+ /* If canonicalized "d:/path", leave alone the root case "d:/". */
+ while (slash > lim && *slash == '/')
+ --slash;
+#else
while (slash > path && *slash == '/')
--slash;
+#endif
length = slash - path + 1;
}
diff --git a/lib/error.c b/lib/error.c
index 53b650c5..ffa54c39 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -1,5 +1,5 @@
/* Error handler for noninteractive utilities
- Copyright (C) 1990,91,92,93,94,95,96,97,98, 99 Free Software Foundation, Inc.
+ Copyright (C) 1990-2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
@@ -150,12 +150,16 @@ error (status, errnum, message, va_alist)
++error_message_count;
if (errnum)
{
-#if defined HAVE_STRERROR_R || defined _LIBC
+#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
+# if HAVE_WORKING_STRERROR_R || _LIBC
+ fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
+# else
/* Don't use __strerror_r's return value because on some systems
(at least DEC UNIX 4.0[A-D]) strerror_r returns `int'. */
__strerror_r (errnum, errbuf, sizeof errbuf);
fprintf (stderr, ": %s", errbuf);
+# endif
#else
fprintf (stderr, ": %s", strerror (errnum));
#endif
@@ -228,12 +232,16 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
++error_message_count;
if (errnum)
{
-#if defined HAVE_STRERROR_R || defined _LIBC
+#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
+# if HAVE_WORKING_STRERROR_R || _LIBC
+ fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
+# else
/* Don't use __strerror_r's return value because on some systems
(at least DEC UNIX 4.0[A-D]) strerror_r returns `int'. */
__strerror_r (errnum, errbuf, sizeof errbuf);
fprintf (stderr, ": %s", errbuf);
+# endif
#else
fprintf (stderr, ": %s", strerror (errnum));
#endif
diff --git a/lib/fnmatch.c b/lib/fnmatch.c
index d9936331..5b4d5a5d 100644
--- a/lib/fnmatch.c
+++ b/lib/fnmatch.c
@@ -1,4 +1,6 @@
-/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
+ The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@gnu.org.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -10,9 +12,9 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
@@ -27,6 +29,23 @@
#include <fnmatch.h>
#include <ctype.h>
+#if HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+/* For platform which support the ISO C amendement 1 functionality we
+ support user defined character classes. */
+#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
+# include <wchar.h>
+# include <wctype.h>
+#endif
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
@@ -45,23 +64,112 @@
# define ISASCII(c) isascii(c)
# endif
+# ifdef isblank
+# define ISBLANK(c) (ISASCII (c) && isblank (c))
+# else
+# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
+# endif
+# ifdef isgraph
+# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
+# else
+# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
+# endif
+
+# define ISPRINT(c) (ISASCII (c) && isprint (c))
+# define ISDIGIT(c) (ISASCII (c) && isdigit (c))
+# define ISALNUM(c) (ISASCII (c) && isalnum (c))
+# define ISALPHA(c) (ISASCII (c) && isalpha (c))
+# define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
+# define ISLOWER(c) (ISASCII (c) && islower (c))
+# define ISPUNCT(c) (ISASCII (c) && ispunct (c))
+# define ISSPACE(c) (ISASCII (c) && isspace (c))
# define ISUPPER(c) (ISASCII (c) && isupper (c))
+# define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
+
+# define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
+
+# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
+/* The GNU C library provides support for user-defined character classes
+ and the functions from ISO C amendement 1. */
+# ifdef CHARCLASS_NAME_MAX
+# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
+# else
+/* This shouldn't happen but some implementation might still have this
+ problem. Use a reasonable default value. */
+# define CHAR_CLASS_MAX_LENGTH 256
+# endif
+
+# ifdef _LIBC
+# define IS_CHAR_CLASS(string) __wctype (string)
+# else
+# define IS_CHAR_CLASS(string) wctype (string)
+# endif
+# else
+# define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
+
+# define IS_CHAR_CLASS(string) \
+ (STREQ (string, "alpha") || STREQ (string, "upper") \
+ || STREQ (string, "lower") || STREQ (string, "digit") \
+ || STREQ (string, "alnum") || STREQ (string, "xdigit") \
+ || STREQ (string, "space") || STREQ (string, "print") \
+ || STREQ (string, "punct") || STREQ (string, "graph") \
+ || STREQ (string, "cntrl") || STREQ (string, "blank"))
+# endif
+
+/* Avoid depending on library functions or files
+ whose names are inconsistent. */
+# if !defined _LIBC && !defined getenv
+extern char *getenv ();
+# endif
# ifndef errno
extern int errno;
# endif
+/* This function doesn't exist on most systems. */
+
+# if !defined HAVE___STRCHRNUL && !defined _LIBC
+static char *
+__strchrnul (s, c)
+ const char *s;
+ int c;
+{
+ char *result = strchr (s, c);
+ if (result == NULL)
+ result = strchr (s, '\0');
+ return result;
+}
+# endif
+
+# ifndef internal_function
+/* Inside GNU libc we mark some function in a special way. In other
+ environments simply ignore the marking. */
+# define internal_function
+# endif
+
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
-int
-fnmatch (const char *pattern, const char *string, int flags)
+static int internal_fnmatch __P ((const char *pattern, const char *string,
+ int no_leading_period, int flags))
+ internal_function;
+static int
+internal_function
+internal_fnmatch (pattern, string, no_leading_period, flags)
+ const char *pattern;
+ const char *string;
+ int no_leading_period;
+ int flags;
{
register const char *p = pattern, *n = string;
- register char c;
+ register unsigned char c;
/* Note that this evaluates C many times. */
-# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
+# ifdef _LIBC
+# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
+# else
+# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
+# endif
while ((c = *p++) != '\0')
{
@@ -72,10 +180,11 @@ fnmatch (const char *pattern, const char *string, int flags)
case '?':
if (*n == '\0')
return FNM_NOMATCH;
- else if ((flags & FNM_FILE_NAME) && *n == '/')
+ else if (*n == '/' && (flags & FNM_FILE_NAME))
return FNM_NOMATCH;
- else if ((flags & FNM_PERIOD) && *n == '.' &&
- (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+ else if (*n == '.' && no_leading_period
+ && (n == string
+ || (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH;
break;
@@ -88,18 +197,19 @@ fnmatch (const char *pattern, const char *string, int flags)
return FNM_NOMATCH;
c = FOLD (c);
}
- if (FOLD (*n) != c)
+ if (FOLD ((unsigned char) *n) != c)
return FNM_NOMATCH;
break;
case '*':
- if ((flags & FNM_PERIOD) && *n == '.' &&
- (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+ if (*n == '.' && no_leading_period
+ && (n == string
+ || (n[-1] == '/' && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++)
{
- if ((flags & FNM_FILE_NAME) && *n == '/')
+ if (*n == '/' && (flags & FNM_FILE_NAME))
/* A slash does not match a wildcard under FNM_FILE_NAME. */
return FNM_NOMATCH;
else if (c == '?')
@@ -117,82 +227,214 @@ fnmatch (const char *pattern, const char *string, int flags)
}
if (c == '\0')
- return 0;
+ /* The wildcard(s) is/are the last element of the pattern.
+ If the name is a file name and contains another slash
+ this does mean it cannot match. */
+ return ((flags & FNM_FILE_NAME) && strchr (n, '/') != NULL
+ ? FNM_NOMATCH : 0);
+ else
+ {
+ const char *endp;
- {
- char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
- c1 = FOLD (c1);
- for (--p; *n != '\0'; ++n)
- if ((c == '[' || FOLD (*n) == c1) &&
- fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
- return 0;
- return FNM_NOMATCH;
- }
+ endp = __strchrnul (n, (flags & FNM_FILE_NAME) ? '/' : '\0');
+
+ if (c == '[')
+ {
+ int flags2 = ((flags & FNM_FILE_NAME)
+ ? flags : (flags & ~FNM_PERIOD));
+
+ for (--p; n < endp; ++n)
+ if (internal_fnmatch (p, n,
+ (no_leading_period
+ && (n == string
+ || (n[-1] == '/'
+ && (flags
+ & FNM_FILE_NAME)))),
+ flags2)
+ == 0)
+ return 0;
+ }
+ else if (c == '/' && (flags & FNM_FILE_NAME))
+ {
+ while (*n != '\0' && *n != '/')
+ ++n;
+ if (*n == '/'
+ && (internal_fnmatch (p, n + 1, flags & FNM_PERIOD,
+ flags) == 0))
+ return 0;
+ }
+ else
+ {
+ int flags2 = ((flags & FNM_FILE_NAME)
+ ? flags : (flags & ~FNM_PERIOD));
+
+ if (c == '\\' && !(flags & FNM_NOESCAPE))
+ c = *p;
+ c = FOLD (c);
+ for (--p; n < endp; ++n)
+ if (FOLD ((unsigned char) *n) == c
+ && (internal_fnmatch (p, n,
+ (no_leading_period
+ && (n == string
+ || (n[-1] == '/'
+ && (flags
+ & FNM_FILE_NAME)))),
+ flags2) == 0))
+ return 0;
+ }
+ }
+
+ /* If we come here no match is possible with the wildcard. */
+ return FNM_NOMATCH;
case '[':
{
/* Nonzero if the sense of the character class is inverted. */
+ static int posixly_correct;
register int not;
+ char cold;
+
+ if (posixly_correct == 0)
+ posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
if (*n == '\0')
return FNM_NOMATCH;
- if ((flags & FNM_PERIOD) && *n == '.' &&
- (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+ if (*n == '.' && no_leading_period && (n == string
+ || (n[-1] == '/'
+ && (flags
+ & FNM_FILE_NAME))))
return FNM_NOMATCH;
- not = (*p == '!' || *p == '^');
+ if (*n == '/' && (flags & FNM_FILE_NAME))
+ /* `/' cannot be matched. */
+ return FNM_NOMATCH;
+
+ not = (*p == '!' || (posixly_correct < 0 && *p == '^'));
if (not)
++p;
c = *p++;
for (;;)
{
- register char cstart = c, cend = c;
+ unsigned char fn = FOLD ((unsigned char) *n);
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
if (*p == '\0')
return FNM_NOMATCH;
- cstart = cend = *p++;
- }
+ c = FOLD ((unsigned char) *p);
+ ++p;
- cstart = cend = FOLD (cstart);
+ if (c == fn)
+ goto matched;
+ }
+ else if (c == '[' && *p == ':')
+ {
+ /* Leave room for the null. */
+ char str[CHAR_CLASS_MAX_LENGTH + 1];
+ size_t c1 = 0;
+# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
+ wctype_t wt;
+# endif
+ const char *startp = p;
+
+ for (;;)
+ {
+ if (c1 == CHAR_CLASS_MAX_LENGTH)
+ /* The name is too long and therefore the pattern
+ is ill-formed. */
+ return FNM_NOMATCH;
+
+ c = *++p;
+ if (c == ':' && p[1] == ']')
+ {
+ p += 2;
+ break;
+ }
+ if (c < 'a' || c >= 'z')
+ {
+ /* This cannot possibly be a character class name.
+ Match it as a normal range. */
+ p = startp;
+ c = '[';
+ goto normal_bracket;
+ }
+ str[c1++] = c;
+ }
+ str[c1] = '\0';
+
+# if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
+ wt = IS_CHAR_CLASS (str);
+ if (wt == 0)
+ /* Invalid character class name. */
+ return FNM_NOMATCH;
- if (c == '\0')
+ if (__iswctype (__btowc ((unsigned char) *n), wt))
+ goto matched;
+# else
+ if ((STREQ (str, "alnum") && ISALNUM ((unsigned char) *n))
+ || (STREQ (str, "alpha") && ISALPHA ((unsigned char) *n))
+ || (STREQ (str, "blank") && ISBLANK ((unsigned char) *n))
+ || (STREQ (str, "cntrl") && ISCNTRL ((unsigned char) *n))
+ || (STREQ (str, "digit") && ISDIGIT ((unsigned char) *n))
+ || (STREQ (str, "graph") && ISGRAPH ((unsigned char) *n))
+ || (STREQ (str, "lower") && ISLOWER ((unsigned char) *n))
+ || (STREQ (str, "print") && ISPRINT ((unsigned char) *n))
+ || (STREQ (str, "punct") && ISPUNCT ((unsigned char) *n))
+ || (STREQ (str, "space") && ISSPACE ((unsigned char) *n))
+ || (STREQ (str, "upper") && ISUPPER ((unsigned char) *n))
+ || (STREQ (str, "xdigit") && ISXDIGIT ((unsigned char) *n)))
+ goto matched;
+# endif
+ }
+ else if (c == '\0')
/* [ (unterminated) loses. */
return FNM_NOMATCH;
-
- c = *p++;
- c = FOLD (c);
-
- if ((flags & FNM_FILE_NAME) && c == '/')
- /* [/] can never match. */
- return FNM_NOMATCH;
-
- if (c == '-' && *p != ']')
+ else
{
- cend = *p++;
- if (!(flags & FNM_NOESCAPE) && cend == '\\')
- cend = *p++;
- if (cend == '\0')
- return FNM_NOMATCH;
- cend = FOLD (cend);
+ c = FOLD (c);
+ normal_bracket:
+ if (c == fn)
+ goto matched;
+ cold = c;
c = *p++;
- }
- if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
- goto matched;
+ if (c == '-' && *p != ']')
+ {
+ /* It is a range. */
+ char lo[2];
+ char fc[2];
+ char hi[2];
+ unsigned char cend = *p++;
+ if (!(flags & FNM_NOESCAPE) && cend == '\\')
+ cend = *p++;
+ if (cend == '\0')
+ return FNM_NOMATCH;
+
+ lo[0] = cold; lo[1] = '\0';
+ fc[0] = fn; fc[1] = '\0';
+ if (strcoll (lo, fc) <= 0)
+ {
+ hi[0] = FOLD (cend); hi[1] = '\0';
+ if (strcoll (fc, hi) <= 0)
+ goto matched;
+ }
+
+ c = *p++;
+ }
+ }
if (c == ']')
break;
}
+
if (!not)
return FNM_NOMATCH;
break;
- matched:;
+ matched:
/* Skip the rest of the [...] that already matched. */
while (c != ']')
{
@@ -208,6 +450,15 @@ fnmatch (const char *pattern, const char *string, int flags)
/* XXX 1003.2d11 is unclear if this is right. */
++p;
}
+ else if (c == '[' && *p == ':')
+ {
+ do
+ if (*++p == '\0')
+ return FNM_NOMATCH;
+ while (*p != ':' || p[1] == ']');
+ p += 2;
+ c = *p;
+ }
}
if (not)
return FNM_NOMATCH;
@@ -215,7 +466,7 @@ fnmatch (const char *pattern, const char *string, int flags)
break;
default:
- if (c != FOLD (*n))
+ if (c != FOLD ((unsigned char) *n))
return FNM_NOMATCH;
}
@@ -234,4 +485,14 @@ fnmatch (const char *pattern, const char *string, int flags)
# undef FOLD
}
+
+int
+fnmatch (pattern, string, flags)
+ const char *pattern;
+ const char *string;
+ int flags;
+{
+ return internal_fnmatch (pattern, string, flags & FNM_PERIOD, flags);
+}
+
#endif /* _LIBC or not __GNU_LIBRARY__. */
diff --git a/lib/fnmatch.h b/lib/fnmatch.h
index af1dcf52..bcb3c0b8 100644
--- a/lib/fnmatch.h
+++ b/lib/fnmatch.h
@@ -1,41 +1,48 @@
-/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
+ The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@gnu.org.
-NOTE: The canonical source of this file is maintained with the GNU C Library.
-Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _FNMATCH_H
-
#define _FNMATCH_H 1
#ifdef __cplusplus
extern "C" {
#endif
-#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
-#undef __P
-#define __P(protos) protos
+#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
+# if !defined __GLIBC__ || !defined __P
+# undef __P
+# define __P(protos) protos
+# endif
#else /* Not C++ or ANSI C. */
-#undef __P
-#define __P(protos) ()
+# undef __P
+# define __P(protos) ()
/* We can get away without defining `const' here only because in this file
it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */
#endif /* C++ or ANSI C. */
+#ifndef const
+# if (defined __STDC__ && __STDC__) || defined __cplusplus
+# define __const const
+# else
+# define __const
+# endif
+#endif
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
@@ -48,18 +55,26 @@ extern "C" {
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
-#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
-#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
-#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
-#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
+#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
+# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
+# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
+# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
#define FNM_NOMATCH 1
-/* Match STRING against the filename pattern PATTERN,
+/* This value is returned if the implementation does not support
+ `fnmatch'. Since this is not the case here it will never be
+ returned but the conformance test suites still require the symbol
+ to be defined. */
+#ifdef _XOPEN_SOURCE
+# define FNM_NOSYS (-1)
+#endif
+
+/* Match NAME against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
-extern int fnmatch __P ((const char *__pattern, const char *__string,
+extern int fnmatch __P ((__const char *__pattern, __const char *__name,
int __flags));
#ifdef __cplusplus
diff --git a/lib/getopt.h b/lib/getopt.h
index ac6728f8..39f4a168 100644
--- a/lib/getopt.h
+++ b/lib/getopt.h
@@ -126,7 +126,7 @@ struct option
arguments to the option '\0'. This behavior is specific to the GNU
`getopt'. */
-#if defined __STDC__ && __STDC__
+#if (defined __STDC__ && __STDC__) || defined PROTOTYPES
# ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
@@ -149,7 +149,7 @@ extern int _getopt_internal (int __argc, char *const *__argv,
const struct option *__longopts, int *__longind,
int __long_only);
# endif
-#else /* not __STDC__ */
+#else /* not ((defined __STDC__ && __STDC__) || defined PROTOTYPES) */
extern int getopt ();
# ifndef __need_getopt
extern int getopt_long ();
@@ -157,7 +157,7 @@ extern int getopt_long_only ();
extern int _getopt_internal ();
# endif
-#endif /* __STDC__ */
+#endif /* (defined __STDC__ && __STDC__) || defined PROTOTYPES */
#ifdef __cplusplus
}
diff --git a/lib/listfile.c b/lib/listfile.c
index 2a938eb3..5aefd105 100644
--- a/lib/listfile.c
+++ b/lib/listfile.c
@@ -1,5 +1,5 @@
/* listfile.c -- display a long listing of a file
- Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,6 +19,25 @@
# include <config.h>
#endif
+#ifndef __GNUC__
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ # pragma alloca
+# else
+# ifdef _WIN32
+# include <malloc.h>
+# include <io.h>
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
@@ -26,6 +45,7 @@
#include <grp.h>
#include <time.h>
#include <errno.h>
+#include "human.h"
#include "pathmax.h"
#if HAVE_STRING_H || STDC_HEADERS
@@ -71,29 +91,66 @@ extern int errno;
int readlink ();
#endif
+/* Get or fake the disk device blocksize.
+ Usually defined by sys/param.h (if at all). */
+#ifndef DEV_BSIZE
+# ifdef BSIZE
+# define DEV_BSIZE BSIZE
+# else /* !BSIZE */
+# define DEV_BSIZE 4096
+# endif /* !BSIZE */
+#endif /* !DEV_BSIZE */
+
/* Extract or fake data from a `struct stat'.
- ST_NBLOCKS: Number of 512-byte blocks in the file
- (including indirect blocks).
- HP-UX, perhaps uniquely, counts st_blocks in 1024-byte units.
- This workaround loses when mixing HP-UX and 4BSD filesystems, though. */
-#ifdef _POSIX_SOURCE
-# define ST_NBLOCKS(statp) (((statp)->st_size + 512 - 1) / 512)
-#else
-# ifndef HAVE_ST_BLOCKS
-# define ST_NBLOCKS(statp) (st_blocks ((statp)->st_size))
-# else
-# if defined(hpux) || defined(__hpux__)
-# define ST_NBLOCKS(statp) ((statp)->st_blocks * 2)
-# else
-# define ST_NBLOCKS(statp) ((statp)->st_blocks)
-# endif
-# endif
+ ST_BLKSIZE: Preferred I/O blocksize for the file, in bytes.
+ ST_NBLOCKS: Number of blocks in the file, including indirect blocks.
+ ST_NBLOCKSIZE: Size of blocks used when calculating ST_NBLOCKS. */
+#ifndef HAVE_STRUCT_STAT_ST_BLOCKS
+# define ST_BLKSIZE(statbuf) DEV_BSIZE
+# if defined(_POSIX_SOURCE) || !defined(BSIZE) /* fileblocks.c uses BSIZE. */
+# define ST_NBLOCKS(statbuf) \
+ (S_ISREG ((statbuf).st_mode) \
+ || S_ISDIR ((statbuf).st_mode) \
+ ? (statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0) : 0)
+# else /* !_POSIX_SOURCE && BSIZE */
+# define ST_NBLOCKS(statbuf) \
+ (S_ISREG ((statbuf).st_mode) \
+ || S_ISDIR ((statbuf).st_mode) \
+ ? st_blocks ((statbuf).st_size) : 0)
+# endif /* !_POSIX_SOURCE && BSIZE */
+#else /* HAVE_STRUCT_STAT_ST_BLOCKS */
+/* Some systems, like Sequents, return st_blksize of 0 on pipes. */
+# define ST_BLKSIZE(statbuf) ((statbuf).st_blksize > 0 \
+ ? (statbuf).st_blksize : DEV_BSIZE)
+# if defined(hpux) || defined(__hpux__) || defined(__hpux)
+/* HP-UX counts st_blocks in 1024-byte units.
+ This loses when mixing HP-UX and BSD filesystems with NFS. */
+# define ST_NBLOCKSIZE 1024
+# else /* !hpux */
+# if defined(_AIX) && defined(_I386)
+/* AIX PS/2 counts st_blocks in 4K units. */
+# define ST_NBLOCKSIZE (4 * 1024)
+# else /* not AIX PS/2 */
+# if defined(_CRAY)
+# define ST_NBLOCKS(statbuf) \
+ (S_ISREG ((statbuf).st_mode) \
+ || S_ISDIR ((statbuf).st_mode) \
+ ? (statbuf).st_blocks * ST_BLKSIZE(statbuf)/ST_NBLOCKSIZE : 0)
+# endif /* _CRAY */
+# endif /* not AIX PS/2 */
+# endif /* !hpux */
+#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
+
+#ifndef ST_NBLOCKS
+# define ST_NBLOCKS(statbuf) \
+ (S_ISREG ((statbuf).st_mode) \
+ || S_ISDIR ((statbuf).st_mode) \
+ ? (statbuf).st_blocks : 0)
#endif
-/* Convert NUMBER 512-byte blocks to kilobytes if KILOFLAG is nonzero,
- otherwise return it unchanged. */
-#define convert_blocks(Number, Kiloflag) \
- ((Kiloflag) ? ((Number) + 1) / 2 : (Number))
+#ifndef ST_NBLOCKSIZE
+# define ST_NBLOCKSIZE 512
+#endif
#ifndef _POSIX_VERSION
struct passwd *getpwuid ();
@@ -121,63 +178,113 @@ void print_name_with_quoting ();
/* NAME is the name to print.
RELNAME is the path to access it from the current directory.
STATP is the results of stat or lstat on it.
+ Use CURRENT_TIME to decide whether to print yyyy or hh:mm.
+ Use OUTPUT_BLOCK_SIZE to determine how to print file block counts
+ and sizes.
STREAM is the stdio stream to print on. */
void
-list_file (name, relname, statp, stream)
+list_file (name, relname, statp, current_time, output_block_size, stream)
char *name;
char *relname;
struct stat *statp;
+ time_t current_time;
+ int output_block_size;
FILE *stream;
{
- static int kilobytes = -1; /* -1 = uninitialized, 0 = 512, 1 = 1024. */
- char modebuf[20];
- char timebuf[40];
- time_t current_time = time ((time_t *) 0);
-
- if (kilobytes == -1)
- kilobytes = getenv ("POSIXLY_CORRECT") == 0;
-
+ char modebuf[11];
+ struct tm const *when_local;
+ char const *user_name;
+ char const *group_name;
+ char hbuf[LONGEST_HUMAN_READABLE + 1];
+
+#if HAVE_ST_DM_MODE
+ /* Cray DMF: look at the file's migrated, not real, status */
+ mode_string (statp->st_dm_mode, modebuf);
+#else
mode_string (statp->st_mode, modebuf);
+#endif
modebuf[10] = '\0';
- strcpy (timebuf, ctime (&statp->st_mtime));
- if (current_time > statp->st_mtime + 6L * 30L * 24L * 60L * 60L /* Old. */
- || current_time < statp->st_mtime - 60L * 60L) /* In the future. */
- {
- /* The file is fairly old or in the future.
- POSIX says the cutoff is 6 months old;
- approximate this by 6*30 days.
- Allow a 1 hour slop factor for what is considered "the future",
- to allow for NFS server/client clock disagreement.
- Show the year instead of the time of day. */
- strcpy (timebuf + 11, timebuf + 19);
- }
- timebuf[16] = 0;
-
- fprintf (stream, "%6lu ", statp->st_ino);
+ fprintf (stream, "%6s ",
+ human_readable ((uintmax_t) statp->st_ino, hbuf, 1, 1));
- fprintf (stream, "%4lu ",
- (long) convert_blocks (ST_NBLOCKS (statp), kilobytes));
+ fprintf (stream, "%4s ",
+ human_readable ((uintmax_t) ST_NBLOCKS (*statp), hbuf,
+ ST_NBLOCKSIZE, output_block_size));
/* The space between the mode and the number of links is the POSIX
- "optional alternate access method flag". */
- fprintf (stream, "%s %3u ", modebuf, statp->st_nlink);
+ "optional alternate access method flag". */
+ fprintf (stream, "%s %3lu ", modebuf, (unsigned long) statp->st_nlink);
- fprintf (stream, "%-8.8s ", getuser (statp->st_uid));
+ user_name = getuser (statp->st_uid);
+ if (user_name)
+ fprintf (stream, "%-8.8s ", user_name);
+ else
+ fprintf (stream, "%-8lu ", (unsigned long) statp->st_uid);
- fprintf (stream, "%-8.8s ", getgroup (statp->st_gid));
+ group_name = getgroup (statp->st_gid);
+ if (group_name)
+ fprintf (stream, "%-8.8s ", group_name);
+ else
+ fprintf (stream, "%-8lu ", (unsigned long) statp->st_gid);
if (S_ISCHR (statp->st_mode) || S_ISBLK (statp->st_mode))
#ifdef HAVE_ST_RDEV
- fprintf (stream, "%3u, %3u ", major (statp->st_rdev), minor (statp->st_rdev));
+ fprintf (stream, "%3lu, %3lu ",
+ (unsigned long) major (statp->st_rdev),
+ (unsigned long) minor (statp->st_rdev));
#else
fprintf (stream, " ");
#endif
else
- fprintf (stream, "%8lu ", statp->st_size);
+ fprintf (stream, "%8s ",
+ human_readable ((uintmax_t) statp->st_size, hbuf, 1,
+ output_block_size < 0 ? output_block_size : 1));
+
+ if ((when_local = localtime (&statp->st_mtime)))
+ {
+ char init_bigbuf[256];
+ char *buf = init_bigbuf;
+ size_t bufsize = sizeof init_bigbuf;
+
+ /* Use strftime rather than ctime, because the former can produce
+ locale-dependent names for the month (%b).
+
+ Output the year if the file is fairly old or in the future.
+ POSIX says the cutoff is 6 months old;
+ approximate this by 6*30 days.
+ Allow a 1 hour slop factor for what is considered "the future",
+ to allow for NFS server/client clock disagreement. */
+ char const *fmt =
+ ((current_time - 6 * 30 * 24 * 60 * 60 <= statp->st_mtime
+ && statp->st_mtime <= current_time + 60 * 60)
+ ? "%b %e %H:%M"
+ : "%b %e %Y");
+
+ while (!strftime (buf, bufsize, fmt, when_local))
+ buf = (char *) alloca (bufsize *= 2);
+
+ fprintf (stream, "%s ", buf);
+ }
+ else
+ {
+ /* The time cannot be represented as a local time;
+ print it as a huge integer number of seconds. */
+ int width = 12;
- fprintf (stream, "%s ", timebuf + 4);
+ if (statp->st_mtime < 0)
+ {
+ char const *num = human_readable (- (uintmax_t) statp->st_mtime,
+ hbuf, 1, 1);
+ int sign_width = width - strlen (num);
+ fprintf (stream, "%*s%s ",
+ sign_width < 0 ? 0 : sign_width, "-", num);
+ }
+ else
+ fprintf (stream, "%*s ", width,
+ human_readable ((uintmax_t) statp->st_mtime, hbuf, 1, 1));
+ }
print_name_with_quoting (name, stream);
diff --git a/lib/modechange.c b/lib/modechange.c
index 71432fa4..ef484c0f 100644
--- a/lib/modechange.c
+++ b/lib/modechange.c
@@ -157,7 +157,7 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
{
struct mode_change *head; /* First element of the linked list. */
struct mode_change *tail; /* An element of the linked list. */
- unsigned long mode_value; /* The mode value, if octal. */
+ uintmax_t mode_value; /* The mode value, if octal. */
char *string_end; /* Pointer to end of parsed value. */
mode_t umask_value; /* The umask value (surprise). */
@@ -166,10 +166,10 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
tail = NULL;
#endif
- if (xstrtoul (mode_string, &string_end, 8, &mode_value, "") == LONGINT_OK)
+ if (xstrtoumax (mode_string, &string_end, 8, &mode_value, "") == LONGINT_OK)
{
struct mode_change *p;
- if (mode_value > CHMOD_MODE_BITS)
+ if (mode_value != (mode_value & CHMOD_MODE_BITS))
return MODE_INVALID;
p = make_node_op_equals ((mode_t) mode_value);
if (p == NULL)
diff --git a/lib/regex.c b/lib/regex.c
index 74fcf9c4..aff41bbe 100644
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -2,7 +2,7 @@
version 0.12.
(Implements POSIX draft P1003.2/D11.2, except for some of the
internationalization features.)
- Copyright (C) 1993, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
+ Copyright (C) 1993-1999, 2000 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
@@ -78,7 +78,12 @@
__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
-#define btowc __btowc
+# define btowc __btowc
+
+/* We are also using some library internals. */
+# include <locale/localeinfo.h>
+# include <locale/elem-hash.h>
+# include <langinfo.h>
#endif
/* This is for other GNU distributions with internationalized messages. */
@@ -164,47 +169,15 @@ char *realloc ();
# define SWITCH_ENUM_CAST(x) (x)
# endif
-/* How many characters in the character set. */
-# define CHAR_SET_SIZE 256
-
-# ifdef SYNTAX_TABLE
-
-extern char *re_syntax_table;
-
-# else /* not SYNTAX_TABLE */
-
-static char re_syntax_table[CHAR_SET_SIZE];
-
-static void
-init_syntax_once ()
-{
- register int c;
- static int done = 0;
-
- if (done)
- return;
-
- bzero (re_syntax_table, sizeof re_syntax_table);
-
- for (c = 'a'; c <= 'z'; c++)
- re_syntax_table[c] = Sword;
-
- for (c = 'A'; c <= 'Z'; c++)
- re_syntax_table[c] = Sword;
-
- for (c = '0'; c <= '9'; c++)
- re_syntax_table[c] = Sword;
-
- re_syntax_table['_'] = Sword;
-
- done = 1;
-}
-
-# endif /* not SYNTAX_TABLE */
+#endif /* not emacs */
-# define SYNTAX(c) re_syntax_table[c]
+#if defined _LIBC || HAVE_LIMITS_H
+# include <limits.h>
+#endif
-#endif /* not emacs */
+#ifndef MB_LEN_MAX
+# define MB_LEN_MAX 1
+#endif
/* Get the interface, including the syntax bits. */
#include <regex.h>
@@ -276,6 +249,43 @@ init_syntax_once ()
# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
#endif
+#ifndef emacs
+/* How many characters in the character set. */
+# define CHAR_SET_SIZE 256
+
+# ifdef SYNTAX_TABLE
+
+extern char *re_syntax_table;
+
+# else /* not SYNTAX_TABLE */
+
+static char re_syntax_table[CHAR_SET_SIZE];
+
+static void
+init_syntax_once ()
+{
+ register int c;
+ static int done = 0;
+
+ if (done)
+ return;
+ bzero (re_syntax_table, sizeof re_syntax_table);
+
+ for (c = 0; c < CHAR_SET_SIZE; ++c)
+ if (ISALNUM (c))
+ re_syntax_table[c] = Sword;
+
+ re_syntax_table['_'] = Sword;
+
+ done = 1;
+}
+
+# endif /* not SYNTAX_TABLE */
+
+# define SYNTAX(c) re_syntax_table[(unsigned char) (c)]
+
+#endif /* emacs */
+
/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
use `alloca' instead of `malloc'. This is because using malloc in
re_search* or re_match* could cause memory leaks when C-g is used in
@@ -615,7 +625,7 @@ extract_number_and_incr (destination, source)
/* It is useful to test things that ``must'' be true when debugging. */
# include <assert.h>
-static int debug = 0;
+static int debug;
# define DEBUG_STATEMENT(e) e
# define DEBUG_PRINT1(x) if (debug) printf (x)
@@ -1013,25 +1023,79 @@ weak_alias (__re_set_syntax, re_set_syntax)
POSIX doesn't require that we do anything for REG_NOERROR,
but why not be nice? */
-static const char *re_error_msgid[] =
+static const char re_error_msgid[] =
{
- gettext_noop ("Success"), /* REG_NOERROR */
- gettext_noop ("No match"), /* REG_NOMATCH */
- gettext_noop ("Invalid regular expression"), /* REG_BADPAT */
- gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */
- gettext_noop ("Invalid character class name"), /* REG_ECTYPE */
- gettext_noop ("Trailing backslash"), /* REG_EESCAPE */
- gettext_noop ("Invalid back reference"), /* REG_ESUBREG */
- gettext_noop ("Unmatched [ or [^"), /* REG_EBRACK */
- gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */
- gettext_noop ("Unmatched \\{"), /* REG_EBRACE */
- gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */
- gettext_noop ("Invalid range end"), /* REG_ERANGE */
- gettext_noop ("Memory exhausted"), /* REG_ESPACE */
- gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */
- gettext_noop ("Premature end of regular expression"), /* REG_EEND */
- gettext_noop ("Regular expression too big"), /* REG_ESIZE */
- gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */
+#define REG_NOERROR_IDX 0
+ gettext_noop ("Success") /* REG_NOERROR */
+ "\0"
+#define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success")
+ gettext_noop ("No match") /* REG_NOMATCH */
+ "\0"
+#define REG_BADPAT_IDX (REG_NOMATCH_IDX + sizeof "No match")
+ gettext_noop ("Invalid regular expression") /* REG_BADPAT */
+ "\0"
+#define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression")
+ gettext_noop ("Invalid collation character") /* REG_ECOLLATE */
+ "\0"
+#define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character")
+ gettext_noop ("Invalid character class name") /* REG_ECTYPE */
+ "\0"
+#define REG_EESCAPE_IDX (REG_ECTYPE_IDX + sizeof "Invalid character class name")
+ gettext_noop ("Trailing backslash") /* REG_EESCAPE */
+ "\0"
+#define REG_ESUBREG_IDX (REG_EESCAPE_IDX + sizeof "Trailing backslash")
+ gettext_noop ("Invalid back reference") /* REG_ESUBREG */
+ "\0"
+#define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference")
+ gettext_noop ("Unmatched [ or [^") /* REG_EBRACK */
+ "\0"
+#define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [ or [^")
+ gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */
+ "\0"
+#define REG_EBRACE_IDX (REG_EPAREN_IDX + sizeof "Unmatched ( or \\(")
+ gettext_noop ("Unmatched \\{") /* REG_EBRACE */
+ "\0"
+#define REG_BADBR_IDX (REG_EBRACE_IDX + sizeof "Unmatched \\{")
+ gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */
+ "\0"
+#define REG_ERANGE_IDX (REG_BADBR_IDX + sizeof "Invalid content of \\{\\}")
+ gettext_noop ("Invalid range end") /* REG_ERANGE */
+ "\0"
+#define REG_ESPACE_IDX (REG_ERANGE_IDX + sizeof "Invalid range end")
+ gettext_noop ("Memory exhausted") /* REG_ESPACE */
+ "\0"
+#define REG_BADRPT_IDX (REG_ESPACE_IDX + sizeof "Memory exhausted")
+ gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */
+ "\0"
+#define REG_EEND_IDX (REG_BADRPT_IDX + sizeof "Invalid preceding regular expression")
+ gettext_noop ("Premature end of regular expression") /* REG_EEND */
+ "\0"
+#define REG_ESIZE_IDX (REG_EEND_IDX + sizeof "Premature end of regular expression")
+ gettext_noop ("Regular expression too big") /* REG_ESIZE */
+ "\0"
+#define REG_ERPAREN_IDX (REG_ESIZE_IDX + sizeof "Regular expression too big")
+ gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */
+ };
+
+static const size_t re_error_msgid_idx[] =
+ {
+ REG_NOERROR_IDX,
+ REG_NOMATCH_IDX,
+ REG_BADPAT_IDX,
+ REG_ECOLLATE_IDX,
+ REG_ECTYPE_IDX,
+ REG_EESCAPE_IDX,
+ REG_ESUBREG_IDX,
+ REG_EBRACK_IDX,
+ REG_EPAREN_IDX,
+ REG_EBRACE_IDX,
+ REG_BADBR_IDX,
+ REG_ERANGE_IDX,
+ REG_ESPACE_IDX,
+ REG_BADRPT_IDX,
+ REG_EEND_IDX,
+ REG_ESIZE_IDX,
+ REG_ERPAREN_IDX
};
/* Avoiding alloca during matching, to placate r_alloc. */
@@ -1514,7 +1578,8 @@ static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p,
reg_syntax_t syntax));
static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend,
reg_syntax_t syntax));
-static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
+static reg_errcode_t compile_range _RE_ARGS ((unsigned int range_start,
+ const char **p_ptr,
const char *pend,
char *translate,
reg_syntax_t syntax,
@@ -1712,7 +1777,7 @@ typedef struct
{ if (p != pend) \
{ \
PATFETCH (c); \
- while (ISDIGIT (c)) \
+ while ('0' <= c && c <= '9') \
{ \
if (num < 0) \
num = 0; \
@@ -2118,6 +2183,7 @@ regex_compile (pattern, size, syntax, bufp)
case '[':
{
boolean had_char_class = false;
+ unsigned int range_start = 0xffffffff;
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
@@ -2161,6 +2227,7 @@ regex_compile (pattern, size, syntax, bufp)
PATFETCH (c1);
SET_LIST_BIT (c1);
+ range_start = c1;
continue;
}
@@ -2185,8 +2252,10 @@ regex_compile (pattern, size, syntax, bufp)
&& *p != ']')
{
reg_errcode_t ret
- = compile_range (&p, pend, translate, syntax, b);
+ = compile_range (range_start, &p, pend, translate,
+ syntax, b);
if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
+ range_start = 0xffffffff;
}
else if (p[0] == '-' && p[1] != ']')
@@ -2196,8 +2265,9 @@ regex_compile (pattern, size, syntax, bufp)
/* Move past the `-'. */
PATFETCH (c1);
- ret = compile_range (&p, pend, translate, syntax, b);
+ ret = compile_range (c, &p, pend, translate, syntax, b);
if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
+ range_start = 0xffffffff;
}
/* See if we're at the beginning of a possible character
@@ -2320,13 +2390,289 @@ regex_compile (pattern, size, syntax, bufp)
PATUNFETCH;
SET_LIST_BIT ('[');
SET_LIST_BIT (':');
+ range_start = ':';
had_char_class = false;
}
}
+ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '=')
+ {
+ unsigned char str[MB_LEN_MAX + 1];
+#ifdef _LIBC
+ uint32_t nrules =
+ _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+#endif
+
+ PATFETCH (c);
+ c1 = 0;
+
+ /* If pattern is `[[='. */
+ if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
+
+ for (;;)
+ {
+ PATFETCH (c);
+ if ((c == '=' && *p == ']') || p == pend)
+ break;
+ if (c1 < MB_LEN_MAX)
+ str[c1++] = c;
+ else
+ /* This is in any case an invalid class name. */
+ str[0] = '\0';
+ }
+ str[c1] = '\0';
+
+ if (c == '=' && *p == ']' && str[0] != '\0')
+ {
+ /* If we have no collation data we use the default
+ collation in which each character is in a class
+ by itself. It also means that ASCII is the
+ character set and therefore we cannot have character
+ with more than one byte in the multibyte
+ representation. */
+#ifdef _LIBC
+ if (nrules == 0)
+#endif
+ {
+ if (c1 != 1)
+ FREE_STACK_RETURN (REG_ECOLLATE);
+
+ /* Throw away the ] at the end of the equivalence
+ class. */
+ PATFETCH (c);
+
+ /* Set the bit for the character. */
+ SET_LIST_BIT (str[0]);
+ }
+#ifdef _LIBC
+ else
+ {
+ /* Try to match the byte sequence in `str' against
+ those known to the collate implementation.
+ First find out whether the bytes in `str' are
+ actually from exactly one character. */
+ const int32_t *table;
+ const unsigned char *weights;
+ const unsigned char *extra;
+ const int32_t *indirect;
+ int32_t idx;
+ const unsigned char *cp = str;
+ int ch;
+
+ /* This #include defines a local function! */
+# include <locale/weight.h>
+
+ table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
+ weights = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB);
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
+ indirect = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
+
+ idx = findidx (&cp);
+ if (idx == 0 || cp < str + c1)
+ /* This is no valid character. */
+ FREE_STACK_RETURN (REG_ECOLLATE);
+
+ /* Throw away the ] at the end of the equivalence
+ class. */
+ PATFETCH (c);
+
+ /* Now we have to go throught the whole table
+ and find all characters which have the same
+ first level weight.
+
+ XXX Note that this is not entirely correct.
+ we would have to match multibyte sequences
+ but this is not possible with the current
+ implementation. */
+ for (ch = 1; ch < 256; ++ch)
+ /* XXX This test would have to be changed if we
+ would allow matching multibyte sequences. */
+ if (table[ch] > 0)
+ {
+ int32_t idx2 = table[ch];
+ size_t len = weights[idx2];
+
+ /* Test whether the lenghts match. */
+ if (weights[idx] == len)
+ {
+ /* They do. New compare the bytes of
+ the weight. */
+ size_t cnt = 0;
+
+ while (cnt < len
+ && (weights[idx + 1 + cnt]
+ == weights[idx2 + 1 + cnt]))
+ ++len;
+
+ if (cnt == len)
+ /* They match. Mark the character as
+ acceptable. */
+ SET_LIST_BIT (ch);
+ }
+ }
+ }
+#endif
+ had_char_class = true;
+ }
+ else
+ {
+ c1++;
+ while (c1--)
+ PATUNFETCH;
+ SET_LIST_BIT ('[');
+ SET_LIST_BIT ('=');
+ range_start = '=';
+ had_char_class = false;
+ }
+ }
+ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '.')
+ {
+ unsigned char str[128]; /* Should be large enough. */
+#ifdef _LIBC
+ uint32_t nrules =
+ _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+#endif
+
+ PATFETCH (c);
+ c1 = 0;
+
+ /* If pattern is `[[='. */
+ if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
+
+ for (;;)
+ {
+ PATFETCH (c);
+ if ((c == '.' && *p == ']') || p == pend)
+ break;
+ if (c1 < sizeof (str))
+ str[c1++] = c;
+ else
+ /* This is in any case an invalid class name. */
+ str[0] = '\0';
+ }
+ str[c1] = '\0';
+
+ if (c == '.' && *p == ']' && str[0] != '\0')
+ {
+ /* If we have no collation data we use the default
+ collation in which each character is the name
+ for its own class which contains only the one
+ character. It also means that ASCII is the
+ character set and therefore we cannot have character
+ with more than one byte in the multibyte
+ representation. */
+#ifdef _LIBC
+ if (nrules == 0)
+#endif
+ {
+ if (c1 != 1)
+ FREE_STACK_RETURN (REG_ECOLLATE);
+
+ /* Throw away the ] at the end of the equivalence
+ class. */
+ PATFETCH (c);
+
+ /* Set the bit for the character. */
+ SET_LIST_BIT (str[0]);
+ range_start = ((const unsigned char *) str)[0];
+ }
+#ifdef _LIBC
+ else
+ {
+ /* Try to match the byte sequence in `str' against
+ those known to the collate implementation.
+ First find out whether the bytes in `str' are
+ actually from exactly one character. */
+ int32_t table_size;
+ const int32_t *symb_table;
+ const unsigned char *extra;
+ int32_t idx;
+ int32_t elem;
+ int32_t second;
+ int32_t hash;
+
+ table_size =
+ _NL_CURRENT_WORD (LC_COLLATE,
+ _NL_COLLATE_SYMB_HASH_SIZEMB);
+ symb_table = (const int32_t *)
+ _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_SYMB_TABLEMB);
+ extra = (const unsigned char *)
+ _NL_CURRENT (LC_COLLATE,
+ _NL_COLLATE_SYMB_EXTRAMB);
+
+ /* Locate the character in the hashing table. */
+ hash = elem_hash (str, c1);
+
+ idx = 0;
+ elem = hash % table_size;
+ second = hash % (table_size - 2);
+ while (symb_table[2 * elem] != 0)
+ {
+ /* First compare the hashing value. */
+ if (symb_table[2 * elem] == hash
+ && c1 == extra[symb_table[2 * elem + 1]]
+ && memcmp (str,
+ &extra[symb_table[2 * elem + 1]
+ + 1],
+ c1) == 0)
+ {
+ /* Yep, this is the entry. */
+ idx = symb_table[2 * elem + 1];
+ idx += 1 + extra[idx];
+ break;
+ }
+
+ /* Next entry. */
+ elem += second;
+ }
+
+ if (symb_table[2 * elem] == 0)
+ /* This is no valid character. */
+ FREE_STACK_RETURN (REG_ECOLLATE);
+
+ /* Throw away the ] at the end of the equivalence
+ class. */
+ PATFETCH (c);
+
+ /* Now add the multibyte character(s) we found
+ to the acceptabed list.
+
+ XXX Note that this is not entirely correct.
+ we would have to match multibyte sequences
+ but this is not possible with the current
+ implementation. Also, we have to match
+ collating symbols, which expand to more than
+ one file, as a whole and not allow the
+ individual bytes. */
+ c1 = extra[idx++];
+ if (c1 == 1)
+ range_start = extra[idx];
+ while (c1-- > 0)
+ SET_LIST_BIT (extra[idx++]);
+ }
+#endif
+ had_char_class = false;
+ }
+ else
+ {
+ c1++;
+ while (c1--)
+ PATUNFETCH;
+ SET_LIST_BIT ('[');
+ SET_LIST_BIT ('.');
+ range_start = '.';
+ had_char_class = false;
+ }
+ }
else
{
had_char_class = false;
SET_LIST_BIT (c);
+ range_start = c;
}
}
@@ -2553,7 +2899,7 @@ regex_compile (pattern, size, syntax, bufp)
if (!(syntax & RE_INTERVALS)
/* If we're at `\{' and it's not the open-interval
operator. */
- || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+ || (syntax & RE_NO_BK_BRACES)
|| (p - 2 == pattern && p == pend))
goto normal_backslash;
@@ -2579,7 +2925,8 @@ regex_compile (pattern, size, syntax, bufp)
if (c == ',')
{
GET_UNSIGNED_NUMBER (upper_bound);
- if (upper_bound < 0) upper_bound = RE_DUP_MAX;
+ if (upper_bound < 0)
+ upper_bound = RE_DUP_MAX;
}
else
/* Interval such as `{1}' => match exactly once. */
@@ -3076,49 +3423,53 @@ group_in_compile_stack (compile_stack, regnum)
`regex_compile' itself. */
static reg_errcode_t
-compile_range (p_ptr, pend, translate, syntax, b)
- const char **p_ptr, *pend;
- RE_TRANSLATE_TYPE translate;
- reg_syntax_t syntax;
- unsigned char *b;
+compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
+ unsigned int range_start_char;
+ const char **p_ptr, *pend;
+ RE_TRANSLATE_TYPE translate;
+ reg_syntax_t syntax;
+ unsigned char *b;
{
unsigned this_char;
const char *p = *p_ptr;
- unsigned int range_start, range_end;
+ reg_errcode_t ret;
+ char range_start[2];
+ char range_end[2];
+ char ch[2];
if (p == pend)
return REG_ERANGE;
- /* Even though the pattern is a signed `char *', we need to fetch
- with unsigned char *'s; if the high bit of the pattern character
- is set, the range endpoints will be negative if we fetch using a
- signed char *.
-
- We also want to fetch the endpoints without translating them; the
+ /* Fetch the endpoints without translating them; the
appropriate translation is done in the bit-setting loop below. */
- /* The SVR4 compiler on the 3B2 had trouble with unsigned const char *. */
- range_start = ((const unsigned char *) p)[-2];
- range_end = ((const unsigned char *) p)[0];
+ range_start[0] = range_start_char;
+ range_start[1] = '\0';
+ range_end[0] = p[0];
+ range_end[1] = '\0';
/* Have to increment the pointer into the pattern string, so the
caller isn't still at the ending character. */
(*p_ptr)++;
- /* If the start is after the end, the range is empty. */
- if (range_start > range_end)
- return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
+ /* Report an error if the range is empty and the syntax prohibits this. */
+ ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
/* Here we see why `this_char' has to be larger than an `unsigned
- char' -- the range is inclusive, so if `range_end' == 0xff
- (assuming 8-bit characters), we would otherwise go into an infinite
- loop, since all characters <= 0xff. */
- for (this_char = range_start; this_char <= range_end; this_char++)
+ char' -- we would otherwise go into an infinite loop, since all
+ characters <= 0xff. */
+ ch[1] = '\0';
+ for (this_char = 0; this_char <= (unsigned char) -1; ++this_char)
{
- SET_LIST_BIT (TRANSLATE (this_char));
+ ch[0] = this_char;
+ if (strcoll (range_start, ch) <= 0 && strcoll (ch, range_end) <= 0)
+ {
+ SET_LIST_BIT (TRANSLATE (this_char));
+ ret = REG_NOERROR;
+ }
}
- return REG_NOERROR;
+ return ret;
}
/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
@@ -3848,7 +4199,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
fail_stack_type fail_stack;
#endif
#ifdef DEBUG
- static unsigned failure_id = 0;
+ static unsigned failure_id;
unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
#endif
@@ -4779,26 +5130,15 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
}
else if ((re_opcode_t) *p2 == charset)
{
-#ifdef DEBUG
- register unsigned char c
- = *p2 == (unsigned char) endline ? '\n' : p2[2];
-#endif
-
-#if 0
- if ((re_opcode_t) p1[3] == exactn
- && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
- && (p2[2 + p1[5] / BYTEWIDTH]
- & (1 << (p1[5] % BYTEWIDTH)))))
-#else
+ /* We win if the first character of the loop is not part
+ of the charset. */
if ((re_opcode_t) p1[3] == exactn
- && ! ((int) p2[1] * BYTEWIDTH > (int) p1[4]
- && (p2[2 + p1[4] / BYTEWIDTH]
- & (1 << (p1[4] % BYTEWIDTH)))))
-#endif
- {
- p[-3] = (unsigned char) pop_failure_jump;
- DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
- c, p1[5]);
+ && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
+ && (p2[2 + p1[5] / BYTEWIDTH]
+ & (1 << (p1[5] % BYTEWIDTH)))))
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
}
else if ((re_opcode_t) p1[3] == charset_not)
@@ -5489,7 +5829,7 @@ re_compile_pattern (pattern, length, bufp)
if (!ret)
return NULL;
- return gettext (re_error_msgid[(int) ret]);
+ return gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
}
#ifdef _LIBC
weak_alias (__re_compile_pattern, re_compile_pattern)
@@ -5526,12 +5866,14 @@ re_comp (s)
{
re_comp_buf.buffer = (unsigned char *) malloc (200);
if (re_comp_buf.buffer == NULL)
- return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
+ return (char *) gettext (re_error_msgid
+ + re_error_msgid_idx[(int) REG_ESPACE]);
re_comp_buf.allocated = 200;
re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
if (re_comp_buf.fastmap == NULL)
- return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
+ return (char *) gettext (re_error_msgid
+ + re_error_msgid_idx[(int) REG_ESPACE]);
}
/* Since `re_exec' always passes NULL for the `regs' argument, we
@@ -5546,7 +5888,7 @@ re_comp (s)
return NULL;
/* Yes, we're discarding `const' here if !HAVE_LIBINTL. */
- return (char *) gettext (re_error_msgid[(int) ret]);
+ return (char *) gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
}
@@ -5666,7 +6008,7 @@ regcomp (preg, pattern, cflags)
buffer. */
if (re_compile_fastmap (preg) == -2)
{
- /* Some error occured while computing the fastmap, just forget
+ /* Some error occurred while computing the fastmap, just forget
about it. */
free (preg->fastmap);
preg->fastmap = NULL;
@@ -5772,15 +6114,15 @@ regerror (errcode, preg, errbuf, errbuf_size)
size_t msg_size;
if (errcode < 0
- || errcode >= (int) (sizeof (re_error_msgid)
- / sizeof (re_error_msgid[0])))
+ || errcode >= (int) (sizeof (re_error_msgid_idx)
+ / sizeof (re_error_msgid_idx[0])))
/* Only error codes returned by the rest of the code should be passed
to this routine. If we are given anything else, or if other regex
code generates an invalid error code, then the program has a bug.
Dump core so we can fix it. */
abort ();
- msg = gettext (re_error_msgid[errcode]);
+ msg = gettext (re_error_msgid + re_error_msgid_idx[errcode]);
msg_size = strlen (msg) + 1; /* Includes the null. */
diff --git a/lib/regex.h b/lib/regex.h
index d88ab92b..81789be8 100644
--- a/lib/regex.h
+++ b/lib/regex.h
@@ -1,542 +1,46 @@
-/* Definitions for data structures and routines for the regular
- expression library, version 0.12.
- Copyright (C) 1985,89,90,91,92,93,95,96,97,98 Free Software Foundation, Inc.
-
- This file is part of the GNU C Library. Its master source is NOT part of
- the C library, however. The master source lives in /gd/gnu/lib.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
#ifndef _REGEX_H
-#define _REGEX_H 1
-
-/* Allow the use in C++ code. */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* POSIX says that <sys/types.h> must be included (by the caller) before
- <regex.h>. */
-
-#if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
-/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
- should be there. */
-# include <stddef.h>
-#endif
-
-/* The following two types have to be signed and unsigned integer type
- wide enough to hold a value of a pointer. For most ANSI compilers
- ptrdiff_t and size_t should be likely OK. Still size of these two
- types is 2 for Microsoft C. Ugh... */
-typedef long int s_reg_t;
-typedef unsigned long int active_reg_t;
-
-/* The following bits are used to determine the regexp syntax we
- recognize. The set/not-set meanings are chosen so that Emacs syntax
- remains the value 0. The bits are given in alphabetical order, and
- the definitions shifted by one from the previous bit; thus, when we
- add or remove a bit, only one other definition need change. */
-typedef unsigned long int reg_syntax_t;
-
-/* If this bit is not set, then \ inside a bracket expression is literal.
- If set, then such a \ quotes the following character. */
-#define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
-
-/* If this bit is not set, then + and ? are operators, and \+ and \? are
- literals.
- If set, then \+ and \? are operators and + and ? are literals. */
-#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
-
-/* If this bit is set, then character classes are supported. They are:
- [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
- [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
- If not set, then character classes are not supported. */
-#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
-
-/* If this bit is set, then ^ and $ are always anchors (outside bracket
- expressions, of course).
- If this bit is not set, then it depends:
- ^ is an anchor if it is at the beginning of a regular
- expression or after an open-group or an alternation operator;
- $ is an anchor if it is at the end of a regular expression, or
- before a close-group or an alternation operator.
-
- This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
- POSIX draft 11.2 says that * etc. in leading positions is undefined.
- We already implemented a previous draft which made those constructs
- invalid, though, so we haven't changed the code back. */
-#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
-
-/* If this bit is set, then special characters are always special
- regardless of where they are in the pattern.
- If this bit is not set, then special characters are special only in
- some contexts; otherwise they are ordinary. Specifically,
- * + ? and intervals are only special when not after the beginning,
- open-group, or alternation operator. */
-#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
-
-/* If this bit is set, then *, +, ?, and { cannot be first in an re or
- immediately after an alternation or begin-group operator. */
-#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
-
-/* If this bit is set, then . matches newline.
- If not set, then it doesn't. */
-#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
-
-/* If this bit is set, then . doesn't match NUL.
- If not set, then it does. */
-#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
-
-/* If this bit is set, nonmatching lists [^...] do not match newline.
- If not set, they do. */
-#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
-
-/* If this bit is set, either \{...\} or {...} defines an
- interval, depending on RE_NO_BK_BRACES.
- If not set, \{, \}, {, and } are literals. */
-#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
-
-/* If this bit is set, +, ? and | aren't recognized as operators.
- If not set, they are. */
-#define RE_LIMITED_OPS (RE_INTERVALS << 1)
-
-/* If this bit is set, newline is an alternation operator.
- If not set, newline is literal. */
-#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
-
-/* If this bit is set, then `{...}' defines an interval, and \{ and \}
- are literals.
- If not set, then `\{...\}' defines an interval. */
-#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
-
-/* If this bit is set, (...) defines a group, and \( and \) are literals.
- If not set, \(...\) defines a group, and ( and ) are literals. */
-#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
-
-/* If this bit is set, then \<digit> matches <digit>.
- If not set, then \<digit> is a back-reference. */
-#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
-
-/* If this bit is set, then | is an alternation operator, and \| is literal.
- If not set, then \| is an alternation operator, and | is literal. */
-#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
-
-/* If this bit is set, then an ending range point collating higher
- than the starting range point, as in [z-a], is invalid.
- If not set, then when ending range point collates higher than the
- starting range point, the range is ignored. */
-#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
-
-/* If this bit is set, then an unmatched ) is ordinary.
- If not set, then an unmatched ) is invalid. */
-#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
-
-/* If this bit is set, succeed as soon as we match the whole pattern,
- without further backtracking. */
-#define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
-
-/* If this bit is set, do not process the GNU regex operators.
- If not set, then the GNU regex operators are recognized. */
-#define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
-
-/* If this bit is set, turn on internal regex debugging.
- If not set, and debugging was on, turn it off.
- This only works if regex.c is compiled -DDEBUG.
- We define this bit always, so that all that's needed to turn on
- debugging is to recompile regex.c; the calling code can always have
- this bit set, and it won't affect anything in the normal case. */
-#define RE_DEBUG (RE_NO_GNU_OPS << 1)
-
-/* This global variable defines the particular regexp syntax to use (for
- some interfaces). When a regexp is compiled, the syntax used is
- stored in the pattern buffer, so changing this does not affect
- already-compiled regexps. */
-extern reg_syntax_t re_syntax_options;
-
-/* Define combinations of the above bits for the standard possibilities.
- (The [[[ comments delimit what gets put into the Texinfo file, so
- don't delete them!) */
-/* [[[begin syntaxes]]] */
-#define RE_SYNTAX_EMACS 0
-
-#define RE_SYNTAX_AWK \
- (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
- | RE_NO_BK_PARENS | RE_NO_BK_REFS \
- | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
- | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
- | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
-
-#define RE_SYNTAX_GNU_AWK \
- ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
- & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
-
-#define RE_SYNTAX_POSIX_AWK \
- (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
- | RE_INTERVALS | RE_NO_GNU_OPS)
-
-#define RE_SYNTAX_GREP \
- (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
- | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
- | RE_NEWLINE_ALT)
-
-#define RE_SYNTAX_EGREP \
- (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
- | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
- | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
- | RE_NO_BK_VBAR)
-
-#define RE_SYNTAX_POSIX_EGREP \
- (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
-
-/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
-#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
-
-#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
-
-/* Syntax bits common to both basic and extended POSIX regex syntax. */
-#define _RE_SYNTAX_POSIX_COMMON \
- (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
- | RE_INTERVALS | RE_NO_EMPTY_RANGES)
-
-#define RE_SYNTAX_POSIX_BASIC \
- (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
-
-/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
- RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
- isn't minimal, since other operators, such as \`, aren't disabled. */
-#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
- (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
-
-#define RE_SYNTAX_POSIX_EXTENDED \
- (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
- | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
- | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
- | RE_UNMATCHED_RIGHT_PAREN_ORD)
-
-/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
- replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
-#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
- (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
- | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
- | RE_NO_BK_PARENS | RE_NO_BK_REFS \
- | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
-/* [[[end syntaxes]]] */
-
-/* Maximum number of duplicates an interval can allow. Some systems
- (erroneously) define this in other header files, but we want our
- value, so remove any previous define. */
-#ifdef RE_DUP_MAX
-# undef RE_DUP_MAX
-#endif
-/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
-#define RE_DUP_MAX (0x7fff)
-
-
-/* POSIX `cflags' bits (i.e., information for `regcomp'). */
-
-/* If this bit is set, then use extended regular expression syntax.
- If not set, then use basic regular expression syntax. */
-#define REG_EXTENDED 1
-
-/* If this bit is set, then ignore case when matching.
- If not set, then case is significant. */
-#define REG_ICASE (REG_EXTENDED << 1)
-
-/* If this bit is set, then anchors do not match at newline
- characters in the string.
- If not set, then anchors do match at newlines. */
-#define REG_NEWLINE (REG_ICASE << 1)
-
-/* If this bit is set, then report only success or fail in regexec.
- If not set, then returns differ between not matching and errors. */
-#define REG_NOSUB (REG_NEWLINE << 1)
+#include <posix/regex.h>
+/* Document internal interfaces. */
+extern reg_syntax_t __re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
-/* POSIX `eflags' bits (i.e., information for regexec). */
-
-/* If this bit is set, then the beginning-of-line operator doesn't match
- the beginning of the string (presumably because it's not the
- beginning of a line).
- If not set, then the beginning-of-line operator does match the
- beginning of the string. */
-#define REG_NOTBOL 1
-
-/* Like REG_NOTBOL, except for the end-of-line. */
-#define REG_NOTEOL (1 << 1)
-
-
-/* If any error codes are removed, changed, or added, update the
- `re_error_msg' table in regex.c. */
-typedef enum
-{
-#ifdef _XOPEN_SOURCE
- REG_ENOSYS = -1, /* This will never happen for this implementation. */
-#endif
-
- REG_NOERROR = 0, /* Success. */
- REG_NOMATCH, /* Didn't find a match (for regexec). */
-
- /* POSIX regcomp return error codes. (In the order listed in the
- standard.) */
- REG_BADPAT, /* Invalid pattern. */
- REG_ECOLLATE, /* Not implemented. */
- REG_ECTYPE, /* Invalid character class name. */
- REG_EESCAPE, /* Trailing backslash. */
- REG_ESUBREG, /* Invalid back reference. */
- REG_EBRACK, /* Unmatched left bracket. */
- REG_EPAREN, /* Parenthesis imbalance. */
- REG_EBRACE, /* Unmatched \{. */
- REG_BADBR, /* Invalid contents of \{\}. */
- REG_ERANGE, /* Invalid range end. */
- REG_ESPACE, /* Ran out of memory. */
- REG_BADRPT, /* No preceding re for repetition op. */
-
- /* Error codes we've added. */
- REG_EEND, /* Premature end. */
- REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
- REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
-} reg_errcode_t;
-
-/* This data structure represents a compiled pattern. Before calling
- the pattern compiler, the fields `buffer', `allocated', `fastmap',
- `translate', and `no_sub' can be set. After the pattern has been
- compiled, the `re_nsub' field is available. All other fields are
- private to the regex routines. */
-
-#ifndef RE_TRANSLATE_TYPE
-# define RE_TRANSLATE_TYPE char *
-#endif
-
-struct re_pattern_buffer
-{
-/* [[[begin pattern_buffer]]] */
- /* Space that holds the compiled pattern. It is declared as
- `unsigned char *' because its elements are
- sometimes used as array indexes. */
- unsigned char *buffer;
-
- /* Number of bytes to which `buffer' points. */
- unsigned long int allocated;
-
- /* Number of bytes actually used in `buffer'. */
- unsigned long int used;
-
- /* Syntax setting with which the pattern was compiled. */
- reg_syntax_t syntax;
-
- /* Pointer to a fastmap, if any, otherwise zero. re_search uses
- the fastmap, if there is one, to skip over impossible
- starting points for matches. */
- char *fastmap;
-
- /* Either a translate table to apply to all characters before
- comparing them, or zero for no translation. The translation
- is applied to a pattern when it is compiled and to a string
- when it is matched. */
- RE_TRANSLATE_TYPE translate;
-
- /* Number of subexpressions found by the compiler. */
- size_t re_nsub;
-
- /* Zero if this pattern cannot match the empty string, one else.
- Well, in truth it's used only in `re_search_2', to see
- whether or not we should use the fastmap, so we don't set
- this absolutely perfectly; see `re_compile_fastmap' (the
- `duplicate' case). */
- unsigned can_be_null : 1;
-
- /* If REGS_UNALLOCATED, allocate space in the `regs' structure
- for `max (RE_NREGS, re_nsub + 1)' groups.
- If REGS_REALLOCATE, reallocate space if necessary.
- If REGS_FIXED, use what's there. */
-#define REGS_UNALLOCATED 0
-#define REGS_REALLOCATE 1
-#define REGS_FIXED 2
- unsigned regs_allocated : 2;
-
- /* Set to zero when `regex_compile' compiles a pattern; set to one
- by `re_compile_fastmap' if it updates the fastmap. */
- unsigned fastmap_accurate : 1;
-
- /* If set, `re_match_2' does not return information about
- subexpressions. */
- unsigned no_sub : 1;
-
- /* If set, a beginning-of-line anchor doesn't match at the
- beginning of the string. */
- unsigned not_bol : 1;
-
- /* Similarly for an end-of-line anchor. */
- unsigned not_eol : 1;
-
- /* If true, an anchor at a newline matches. */
- unsigned newline_anchor : 1;
-
-/* [[[end pattern_buffer]]] */
-};
-
-typedef struct re_pattern_buffer regex_t;
-
-/* Type for byte offsets within the string. POSIX mandates this. */
-typedef int regoff_t;
-
-
-/* This is the structure we store register match data in. See
- regex.texinfo for a full description of what registers match. */
-struct re_registers
-{
- unsigned num_regs;
- regoff_t *start;
- regoff_t *end;
-};
-
-
-/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
- `re_match_2' returns information about at least this many registers
- the first time a `regs' structure is passed. */
-#ifndef RE_NREGS
-# define RE_NREGS 30
-#endif
-
-
-/* POSIX specification for registers. Aside from the different names than
- `re_registers', POSIX uses an array of structures, instead of a
- structure of arrays. */
-typedef struct
-{
- regoff_t rm_so; /* Byte offset from string's start to substring's start. */
- regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
-} regmatch_t;
-
-/* Declarations for routines. */
-
-/* To avoid duplicating every routine declaration -- once with a
- prototype (if we are ANSI), and once without (if we aren't) -- we
- use the following macro to declare argument types. This
- unfortunately clutters up the declarations a bit, but I think it's
- worth it. */
-
-#if __STDC__
-
-# define _RE_ARGS(args) args
-
-#else /* not __STDC__ */
-
-# define _RE_ARGS(args) ()
-
-#endif /* not __STDC__ */
-
-/* Sets the current default syntax to SYNTAX, and return the old syntax.
- You can also simply assign to the `re_syntax_options' variable. */
-extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
-
-/* Compile the regular expression PATTERN, with length LENGTH
- and syntax given by the global `re_syntax_options', into the buffer
- BUFFER. Return NULL if successful, and an error string if not. */
-extern const char *re_compile_pattern
+extern const char *__re_compile_pattern
_RE_ARGS ((const char *pattern, size_t length,
struct re_pattern_buffer *buffer));
+extern int __re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
-/* Compile a fastmap for the compiled pattern in BUFFER; used to
- accelerate searches. Return 0 if successful and -2 if was an
- internal error. */
-extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
-
-
-/* Search in the string STRING (with length LENGTH) for the pattern
- compiled into BUFFER. Start searching at position START, for RANGE
- characters. Return the starting position of the match, -1 for no
- match, or -2 for an internal error. Also return register
- information in REGS (if REGS and BUFFER->no_sub are nonzero). */
-extern int re_search
+extern int __re_search
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, int range, struct re_registers *regs));
-
-/* Like `re_search', but search in the concatenation of STRING1 and
- STRING2. Also, stop searching at index START + STOP. */
-extern int re_search_2
+extern int __re_search_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, int range, struct re_registers *regs, int stop));
-
-/* Like `re_search', but return how many characters in STRING the regexp
- in BUFFER matched, starting at position START. */
-extern int re_match
+extern int __re_match
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, struct re_registers *regs));
-
-/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
-extern int re_match_2
+extern int __re_match_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers *regs, int stop));
-
-/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
- ENDS. Subsequent matches using BUFFER and REGS will use this memory
- for recording register information. STARTS and ENDS must be
- allocated with malloc, and must each be at least `NUM_REGS * sizeof
- (regoff_t)' bytes long.
-
- If NUM_REGS == 0, then subsequent matches should allocate their own
- register data.
-
- Unless this function is called, the first search or match using
- PATTERN_BUFFER will allocate its own register data, without
- freeing the old data. */
-extern void re_set_registers
+extern void __re_set_registers
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
unsigned num_regs, regoff_t *starts, regoff_t *ends));
-#if defined _REGEX_RE_COMP || defined _LIBC
-# ifndef _CRAY
-/* 4.2 bsd compatibility. */
-extern char *re_comp _RE_ARGS ((const char *));
-extern int re_exec _RE_ARGS ((const char *));
-# endif
-#endif
-
-/* POSIX compatibility. */
-extern int regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
- int __cflags));
-
-extern int regexec _RE_ARGS ((const regex_t *__preg,
- const char *__string, size_t __nmatch,
- regmatch_t __pmatch[], int __eflags));
+extern int __regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
+ int __cflags));
-extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
- char *__errbuf, size_t __errbuf_size));
+extern int __regexec _RE_ARGS ((const regex_t *__preg,
+ const char *__string, size_t __nmatch,
+ regmatch_t __pmatch[], int __eflags));
-extern void regfree _RE_ARGS ((regex_t *__preg));
+extern size_t __regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
+ char *__errbuf, size_t __errbuf_size));
-
-#ifdef __cplusplus
-}
-#endif /* C++ */
-
-#endif /* regex.h */
-
-/*
-Local variables:
-make-backup-files: t
-version-control: t
-trim-versions-without-asking: nil
-End:
-*/
+extern void __regfree _RE_ARGS ((regex_t *__preg));
+#endif
diff --git a/lib/savedir.c b/lib/savedir.c
index a299723d..e969407d 100644
--- a/lib/savedir.c
+++ b/lib/savedir.c
@@ -83,14 +83,15 @@ savedir (const char *dir, off_t name_size)
char *name_space;
char *namep;
- /* Be sure name_size is at least `1' so there's room for
- the final NUL byte. */
- name_size += !name_size;
-
dirp = opendir (dir);
if (dirp == NULL)
return NULL;
+ /* Be sure name_size is at least `1' so there's room for
+ the final NUL byte. */
+ if (name_size <= 0)
+ name_size = 1;
+
name_space = (char *) malloc (name_size);
if (name_space == NULL)
{
diff --git a/lib/strftime.c b/lib/strftime.c
index 18977d17..b01219bf 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -91,11 +91,35 @@ extern char *tzname[];
# endif
#endif
-#ifdef _LIBC
-# define MEMPCPY(d, s, n) __mempcpy (d, s, n)
+#ifdef COMPILE_WIDE
+# include <endian.h>
+# define CHAR_T wchar_t
+# define UCHAR_T unsigned int
+# define L_(Str) L##Str
+# define NLW(Sym) _NL_W##Sym
+
+# define MEMCPY(d, s, n) wmemcpy (d, s, n)
+# define STRLEN(s) wcslen (s)
+
#else
-# ifndef HAVE_MEMPCPY
-# define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n)))
+# define CHAR_T char
+# define UCHAR_T unsigned char
+# define L_(Str) Str
+# define NLW(Sym) Sym
+
+# if !defined STDC_HEADERS && !defined HAVE_MEMCPY
+# define MEMCPY(d, s, n) bcopy ((s), (d), (n))
+# else
+# define MEMCPY(d, s, n) memcpy ((d), (s), (n))
+# endif
+# define STRLEN(s) strlen (s)
+
+# ifdef _LIBC
+# define MEMPCPY(d, s, n) __mempcpy (d, s, n)
+# else
+# ifndef HAVE_MEMPCPY
+# define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n)))
+# endif
# endif
#endif
@@ -157,7 +181,9 @@ extern char *tzname[];
# if ! HAVE_TM_GMTOFF
static struct tm *my_strftime_gmtime_r __P ((const time_t *, struct tm *));
static struct tm *
-my_strftime_gmtime_r (const time_t *t, struct tm *tp)
+my_strftime_gmtime_r (t, tp)
+ const time_t *t;
+ struct tm *tp;
{
struct tm *l = gmtime (t);
if (! l)
@@ -169,7 +195,9 @@ my_strftime_gmtime_r (const time_t *t, struct tm *tp)
static struct tm *my_strftime_localtime_r __P ((const time_t *, struct tm *));
static struct tm *
-my_strftime_localtime_r (const time_t *t, struct tm *tp)
+my_strftime_localtime_r (t, tp)
+ const time_t *t;
+ struct tm *tp;
{
struct tm *l = localtime (t);
if (! l)
@@ -185,10 +213,16 @@ my_strftime_localtime_r (const time_t *t, struct tm *tp)
introduce additional dependencies. */
/* The SGI compiler reportedly barfs on the trailing null
if we use a string constant as the initializer. 28 June 1997, rms. */
-static const char spaces[16] = /* " " */
- { ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' };
-static const char zeroes[16] = /* "0000000000000000" */
- { '0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0' };
+static const CHAR_T spaces[16] = /* " " */
+{
+ L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),
+ L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' '),L_(' ')
+};
+static const CHAR_T zeroes[16] = /* "0000000000000000" */
+{
+ L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),
+ L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0'),L_('0')
+};
# define memset_space(P, Len) \
do { \
@@ -197,7 +231,7 @@ static const char zeroes[16] = /* "0000000000000000" */
do \
{ \
int _this = _len > 16 ? 16 : _len; \
- (P) = MEMPCPY ((P), spaces, _this); \
+ (P) = MEMPCPY ((P), spaces, _this * sizeof (CHAR_T)); \
_len -= _this; \
} \
while (_len > 0); \
@@ -210,14 +244,19 @@ static const char zeroes[16] = /* "0000000000000000" */
do \
{ \
int _this = _len > 16 ? 16 : _len; \
- (P) = MEMPCPY ((P), zeroes, _this); \
+ (P) = MEMPCPY ((P), zeroes, _this * sizeof (CHAR_T)); \
_len -= _this; \
} \
while (_len > 0); \
} while (0)
#else
-# define memset_space(P, Len) (memset ((P), ' ', (Len)), (P) += (Len))
-# define memset_zero(P, Len) (memset ((P), '0', (Len)), (P) += (Len))
+# ifdef COMPILE_WIDE
+# define memset_space(P, Len) (wmemset ((P), L' ', (Len)), (P) += (Len))
+# define memset_zero(P, Len) (wmemset ((P), L'0', (Len)), (P) += (Len))
+# else
+# define memset_space(P, Len) (memset ((P), ' ', (Len)), (P) += (Len))
+# define memset_zero(P, Len) (memset ((P), '0', (Len)), (P) += (Len))
+# endif
#endif
#define add(n, f) \
@@ -232,7 +271,7 @@ static const char zeroes[16] = /* "0000000000000000" */
{ \
if (_delta > 0) \
{ \
- if (pad == '0') \
+ if (pad == L_('0')) \
memset_zero (p, _delta); \
else \
memset_space (p, _delta); \
@@ -250,40 +289,64 @@ static const char zeroes[16] = /* "0000000000000000" */
else if (to_uppcase) \
memcpy_uppcase (p, (s), _n); \
else \
- memcpy ((PTR) p, (PTR) (s), _n))
-
+ MEMCPY ((PTR) p, (PTR) (s), _n))
+
+#ifdef COMPILE_WIDE
+# define widen(os, ws, l) \
+ { \
+ mbstate_t __st; \
+ const char *__s = os; \
+ memset (&__st, '\0', sizeof (__st)); \
+ l = __mbsrtowcs (NULL, &__s, 0, &__st); \
+ ws = alloca ((l + 1) * sizeof (wchar_t)); \
+ (void) __mbsrtowcs (ws, &__s, l, &__st); \
+ }
+#endif
-#ifdef _LIBC
-# define TOUPPER(Ch) toupper (Ch)
-# define TOLOWER(Ch) tolower (Ch)
+#ifdef COMPILE_WIDE
+# define TOUPPER(Ch) towupper (Ch)
+# define TOLOWER(Ch) towlower (Ch)
#else
-# define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch))
-# define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+# ifdef _LIBC
+# define TOUPPER(Ch) toupper (Ch)
+# define TOLOWER(Ch) tolower (Ch)
+# else
+# define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch))
+# define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+# endif
#endif
/* We don't use `isdigit' here since the locale dependent
interpretation is not what we want here. We only need to accept
the arabic digits in the ASCII range. One day there is perhaps a
more reliable way to accept other sets of digits. */
-#define ISDIGIT(Ch) ((unsigned int) (Ch) - '0' <= 9)
+#define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9)
-static char *memcpy_lowcase __P ((char *dest, const char *src, size_t len));
+static CHAR_T *memcpy_lowcase __P ((CHAR_T *dest, const CHAR_T *src,
+ size_t len));
-static char *
-memcpy_lowcase (char *dest, const char *src, size_t len)
+static CHAR_T *
+memcpy_lowcase (dest, src, len)
+ CHAR_T *dest;
+ const CHAR_T *src;
+ size_t len;
{
while (len-- > 0)
- dest[len] = TOLOWER ((unsigned char) src[len]);
+ dest[len] = TOLOWER ((UCHAR_T) src[len]);
return dest;
}
-static char *memcpy_uppcase __P ((char *dest, const char *src, size_t len));
+static CHAR_T *memcpy_uppcase __P ((CHAR_T *dest, const CHAR_T *src,
+ size_t len));
-static char *
-memcpy_uppcase (char *dest, const char *src, size_t len)
+static CHAR_T *
+memcpy_uppcase (dest, src, len)
+ CHAR_T *dest;
+ const CHAR_T *src;
+ size_t len;
{
while (len-- > 0)
- dest[len] = TOUPPER ((unsigned char) src[len]);
+ dest[len] = TOUPPER ((UCHAR_T) src[len]);
return dest;
}
@@ -294,7 +357,9 @@ memcpy_uppcase (char *dest, const char *src, size_t len)
# define tm_diff ftime_tm_diff
static int tm_diff __P ((const struct tm *, const struct tm *));
static int
-tm_diff (const struct tm *a, const struct tm *b)
+tm_diff (a, b)
+ const struct tm *a;
+ const struct tm *b;
{
/* Compute intervening leap days correctly even if year is negative.
Take care to avoid int overflow in leap day calculations,
@@ -329,7 +394,9 @@ static int iso_week_days __P ((int, int));
__inline__
#endif
static int
-iso_week_days (int yday, int wday)
+iso_week_days (yday, wday)
+ int yday;
+ int wday;
{
/* Add enough to the first operand of % to make it nonnegative. */
int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7;
@@ -340,15 +407,16 @@ iso_week_days (int yday, int wday)
#if !(defined _NL_CURRENT || HAVE_STRFTIME)
-static char const weekday_name[][10] =
+static CHAR_T const weekday_name[][10] =
{
- "Sunday", "Monday", "Tuesday", "Wednesday",
- "Thursday", "Friday", "Saturday"
+ L_("Sunday"), L_("Monday"), L_("Tuesday"), L_("Wednesday"),
+ L_("Thursday"), L_("Friday"), L_("Saturday")
};
-static char const month_name[][10] =
+static CHAR_T const month_name[][10] =
{
- "January", "February", "March", "April", "May", "June",
- "July", "August", "September", "October", "November", "December"
+ L_("January"), L_("February"), L_("March"), L_("April"), L_("May"),
+ L_("June"), L_("July"), L_("August"), L_("September"), L_("October"),
+ L_("November"), L_("December")
};
#endif
@@ -359,7 +427,11 @@ static char const month_name[][10] =
# define ut_argument_spec int ut;
# define ut_argument_spec_iso , int ut
#else
-# define my_strftime strftime
+# ifdef COMPILE_WIDE
+# define my_strftime wcsftime
+# else
+# define my_strftime strftime
+# endif
# define ut_argument
# define ut_argument_spec
# define ut_argument_spec_iso
@@ -374,9 +446,9 @@ static char const month_name[][10] =
const struct tm * ut_argument_spec_iso));
size_t
my_strftime (s, maxsize, format, tp ut_argument)
- char *s;
+ CHAR_T *s;
size_t maxsize;
- const char *format;
+ const CHAR_T *format;
const struct tm *tp;
ut_argument_spec
{
@@ -397,8 +469,12 @@ static char const month_name[][10] =
anywhere, so to determine how many characters would be
written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */
size_t
-my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
- ut_argument_spec)
+my_strftime (s, maxsize, format, tp ut_argument)
+ CHAR_T *s;
+ size_t maxsize;
+ const CHAR_T *format;
+ const struct tm *tp;
+ ut_argument_spec
{
int hour12 = tp->tm_hour;
#ifdef _NL_CURRENT
@@ -408,22 +484,28 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
might be generated by a strptime() call that initialized
only a few elements. Dereference the pointers only if the format
requires this. Then it is ok to fail if the pointers are invalid. */
-# define a_wkday _NL_CURRENT (LC_TIME, ABDAY_1 + tp->tm_wday)
-# define f_wkday _NL_CURRENT (LC_TIME, DAY_1 + tp->tm_wday)
-# define a_month _NL_CURRENT (LC_TIME, ABMON_1 + tp->tm_mon)
-# define f_month _NL_CURRENT (LC_TIME, MON_1 + tp->tm_mon)
-# define ampm _NL_CURRENT (LC_TIME, tp->tm_hour > 11 ? PM_STR : AM_STR)
-
-# define aw_len strlen (a_wkday)
-# define am_len strlen (a_month)
-# define ap_len strlen (ampm)
+# define a_wkday \
+ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABDAY_1) + tp->tm_wday))
+# define f_wkday \
+ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(DAY_1) + tp->tm_wday))
+# define a_month \
+ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABMON_1) + tp->tm_mon))
+# define f_month \
+ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon))
+# define ampm \
+ ((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11 \
+ ? NLW(PM_STR) : NLW(AM_STR)))
+
+# define aw_len STRLEN (a_wkday)
+# define am_len STRLEN (a_month)
+# define ap_len STRLEN (ampm)
#else
# if !HAVE_STRFTIME
# define f_wkday (weekday_name[tp->tm_wday])
# define f_month (month_name[tp->tm_mon])
# define a_wkday f_wkday
# define a_month f_month
-# define ampm ("AMPM" + 2 * (tp->tm_hour > 11))
+# define ampm (L_("AMPM") + 2 * (tp->tm_hour > 11))
size_t aw_len = 3;
size_t am_len = 3;
@@ -432,8 +514,8 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
#endif
const char *zone;
size_t i = 0;
- char *p = s;
- const char *f;
+ CHAR_T *p = s;
+ const CHAR_T *f;
zone = NULL;
#if HAVE_TM_ZONE
@@ -475,47 +557,48 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
int digits; /* Max digits for numeric format. */
int number_value; /* Numeric value to be printed. */
int negative_number; /* 1 if the number is negative. */
- const char *subfmt;
- char *bufp;
- char buf[1 + (sizeof (int) < sizeof (time_t)
- ? INT_STRLEN_BOUND (time_t)
- : INT_STRLEN_BOUND (int))];
+ const CHAR_T *subfmt;
+ CHAR_T *bufp;
+ CHAR_T buf[1 + (sizeof (int) < sizeof (time_t)
+ ? INT_STRLEN_BOUND (time_t)
+ : INT_STRLEN_BOUND (int))];
int width = -1;
int to_lowcase = 0;
int to_uppcase = 0;
int change_case = 0;
int format_char;
-#if DO_MULTIBYTE
-
- switch (*f)
+#if DO_MULTIBYTE && !defined COMPILE_WIDE
+ switch (*f)
{
- case '%':
+ case L_('%'):
break;
- case '\b': case '\t': case '\n':
- case '\v': case '\f': case '\r':
- case ' ': case '!': case '"': case '#': case '&': case'\'':
- case '(': case ')': case '*': case '+': case ',': case '-':
- case '.': case '/': case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7': case '8': case '9':
- case ':': case ';': case '<': case '=': case '>': case '?':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
- case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z': case '[': case'\\': case ']': case '^':
- case '_': case 'a': case 'b': case 'c': case 'd': case 'e':
- case 'f': case 'g': case 'h': case 'i': case 'j': case 'k':
- case 'l': case 'm': case 'n': case 'o': case 'p': case 'q':
- case 'r': case 's': case 't': case 'u': case 'v': case 'w':
- case 'x': case 'y': case 'z': case '{': case '|': case '}':
- case '~':
- /* The C Standard requires these 97 characters (plus '%', '\a') to
+ case L_('\b'): case L_('\t'): case L_('\n'):
+ case L_('\v'): case L_('\f'): case L_('\r'):
+ case L_(' '): case L_('!'): case L_('"'): case L_('#'): case L_('&'):
+ case L_('\''): case L_('('): case L_(')'): case L_('*'): case L_('+'):
+ case L_(','): case L_('-'): case L_('.'): case L_('/'): case L_('0'):
+ case L_('1'): case L_('2'): case L_('3'): case L_('4'): case L_('5'):
+ case L_('6'): case L_('7'): case L_('8'): case L_('9'): case L_(':'):
+ case L_(';'): case L_('<'): case L_('='): case L_('>'): case L_('?'):
+ case L_('A'): case L_('B'): case L_('C'): case L_('D'): case L_('E'):
+ case L_('F'): case L_('G'): case L_('H'): case L_('I'): case L_('J'):
+ case L_('K'): case L_('L'): case L_('M'): case L_('N'): case L_('O'):
+ case L_('P'): case L_('Q'): case L_('R'): case L_('S'): case L_('T'):
+ case L_('U'): case L_('V'): case L_('W'): case L_('X'): case L_('Y'):
+ case L_('Z'): case L_('['): case L_('\\'): case L_(']'): case L_('^'):
+ case L_('_'): case L_('a'): case L_('b'): case L_('c'): case L_('d'):
+ case L_('e'): case L_('f'): case L_('g'): case L_('h'): case L_('i'):
+ case L_('j'): case L_('k'): case L_('l'): case L_('m'): case L_('n'):
+ case L_('o'): case L_('p'): case L_('q'): case L_('r'): case L_('s'):
+ case L_('t'): case L_('u'): case L_('v'): case L_('w'): case L_('x'):
+ case L_('y'): case L_('z'): case L_('{'): case L_('|'): case L_('}'):
+ case L_('~'):
+ /* The C Standard requires these 98 characters (plus '%') to
be in the basic execution character set. None of these
characters can start a multibyte sequence, so they need
- not be analyzed further. Some old compilers object to
- '\a', so don't bother optimizing for it. */
+ not be analyzed further. */
add (1, *p = *f);
continue;
@@ -557,9 +640,10 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
#else /* ! DO_MULTIBYTE */
- /* Either multibyte encodings are not supported, or they are
- safe for formats, so any non-'%' byte can be copied through. */
- if (*f != '%')
+ /* Either multibyte encodings are not supported, they are
+ safe for formats, so any non-'%' byte can be copied through,
+ or this is the wide character version. */
+ if (*f != L_('%'))
{
add (1, *p = *f);
continue;
@@ -573,17 +657,17 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
switch (*++f)
{
/* This influences the number formats. */
- case '_':
- case '-':
- case '0':
+ case L_('_'):
+ case L_('-'):
+ case L_('0'):
pad = *f;
continue;
/* This changes textual output. */
- case '^':
+ case L_('^'):
to_uppcase = 1;
continue;
- case '#':
+ case L_('#'):
change_case = 1;
continue;
@@ -600,7 +684,7 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
do
{
width *= 10;
- width += *f - '0';
+ width += *f - L_('0');
++f;
}
while (ISDIGIT (*f));
@@ -609,8 +693,8 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
/* Check for modifiers. */
switch (*f)
{
- case 'E':
- case 'O':
+ case L_('E'):
+ case L_('O'):
modifier = *f++;
break;
@@ -630,13 +714,13 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
digits = width == -1 ? d : width; \
number_value = v; goto do_number_spacepad
- case '%':
+ case L_('%'):
if (modifier != 0)
goto bad_format;
add (1, *p = *f);
break;
- case 'a':
+ case L_('a'):
if (modifier != 0)
goto bad_format;
if (change_case)
@@ -660,14 +744,14 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
to_lowcase = 0;
}
#if defined _NL_CURRENT || !HAVE_STRFTIME
- cpy (strlen (f_wkday), f_wkday);
+ cpy (STRLEN (f_wkday), f_wkday);
break;
#else
goto underlying_strftime;
#endif
- case 'b':
- case 'h': /* POSIX.2 extension. */
+ case L_('b'):
+ case L_('h'): /* POSIX.2 extension. */
if (modifier != 0)
goto bad_format;
#if defined _NL_CURRENT || !HAVE_STRFTIME
@@ -677,7 +761,7 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
goto underlying_strftime;
#endif
- case 'B':
+ case L_('B'):
if (modifier != 0)
goto bad_format;
if (change_case)
@@ -686,37 +770,39 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
to_lowcase = 0;
}
#if defined _NL_CURRENT || !HAVE_STRFTIME
- cpy (strlen (f_month), f_month);
+ cpy (STRLEN (f_month), f_month);
break;
#else
goto underlying_strftime;
#endif
- case 'c':
- if (modifier == 'O')
+ case L_('c'):
+ if (modifier == L_('O'))
goto bad_format;
#ifdef _NL_CURRENT
if (! (modifier == 'E'
- && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT)) != '\0'))
- subfmt = _NL_CURRENT (LC_TIME, D_T_FMT);
+ && (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
+ NLW(ERA_D_T_FMT)))
+ != '\0')))
+ subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT));
#else
# if HAVE_STRFTIME
goto underlying_strftime;
# else
- subfmt = "%a %b %e %H:%M:%S %Y";
+ subfmt = L_("%a %b %e %H:%M:%S %Y");
# endif
#endif
subformat:
{
- char *old_start = p;
+ CHAR_T *old_start = p;
size_t len = my_strftime (NULL, (size_t) -1, subfmt, tp);
add (len, my_strftime (p, maxsize - i, subfmt, tp));
if (to_uppcase)
while (old_start < p)
{
- *old_start = TOUPPER ((unsigned char) *old_start);
+ *old_start = TOUPPER ((UCHAR_T) *old_start);
++old_start;
}
}
@@ -731,6 +817,13 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
char *u = ufmt;
char ubuf[1024]; /* enough for any single format in practice */
size_t len;
+ /* Make sure we're calling the actual underlying strftime.
+ In some cases, config.h contains something like
+ "#define strftime rpl_strftime". */
+# ifdef strftime
+# undef strftime
+# endif
+
*u++ = '%';
if (modifier != 0)
*u++ = modifier;
@@ -744,17 +837,22 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
break;
#endif
- case 'C': /* POSIX.2 extension. */
- if (modifier == 'O')
+ case L_('C'): /* POSIX.2 extension. */
+ if (modifier == L_('O'))
goto bad_format;
- if (modifier == 'E')
+ if (modifier == L_('E'))
{
#if HAVE_STRUCT_ERA_ENTRY
struct era_entry *era = _nl_get_era_entry (tp);
if (era)
{
- size_t len = strlen (era->name_fmt);
- cpy (len, era->name_fmt);
+# ifdef COMPILE_WIDE
+ size_t len = wcslen (era->era_wname);
+ cpy (len, era->era_wname);
+# else
+ size_t len = strlen (era->era_name);
+ cpy (len, era->era_name);
+# endif
break;
}
#else
@@ -769,13 +867,15 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
DO_NUMBER (1, year / 100 - (year % 100 < 0));
}
- case 'x':
- if (modifier == 'O')
+ case L_('x'):
+ if (modifier == L_('O'))
goto bad_format;
#ifdef _NL_CURRENT
- if (! (modifier == 'E'
- && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_FMT)) != '\0'))
- subfmt = _NL_CURRENT (LC_TIME, D_FMT);
+ if (! (modifier == L_('E')
+ && (*(subfmt = (CHAR_T *)_NL_CURRENT (LC_TIME,
+ NLW(ERA_D_FMT)))
+ != L_('\0'))))
+ subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT));
goto subformat;
#else
# if HAVE_STRFTIME
@@ -784,20 +884,20 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
/* Fall through. */
# endif
#endif
- case 'D': /* POSIX.2 extension. */
+ case L_('D'): /* POSIX.2 extension. */
if (modifier != 0)
goto bad_format;
- subfmt = "%m/%d/%y";
+ subfmt = L_("%m/%d/%y");
goto subformat;
- case 'd':
- if (modifier == 'E')
+ case L_('d'):
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER (2, tp->tm_mday);
- case 'e': /* POSIX.2 extension. */
- if (modifier == 'E')
+ case L_('e'): /* POSIX.2 extension. */
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER_SPACEPAD (2, tp->tm_mday);
@@ -807,22 +907,26 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
do_number_spacepad:
/* Force `_' flag unless overwritten by `0' flag. */
- if (pad != '0')
- pad = '_';
+ if (pad != L_('0'))
+ pad = L_('_');
do_number:
/* Format the number according to the MODIFIER flag. */
- if (modifier == 'O' && 0 <= number_value)
+ if (modifier == L_('O') && 0 <= number_value)
{
#ifdef _NL_CURRENT
/* Get the locale specific alternate representation of
the number NUMBER_VALUE. If none exist NULL is returned. */
+# ifdef COMPILE_WIDE
+ const wchar_t *cp = _nl_get_walt_digit (number_value);
+# else
const char *cp = _nl_get_alt_digit (number_value);
+# endif
if (cp != NULL)
{
- size_t digitlen = strlen (cp);
+ size_t digitlen = STRLEN (cp);
if (digitlen != 0)
{
cpy (digitlen, cp);
@@ -838,103 +942,104 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
{
unsigned int u = number_value;
- bufp = buf + sizeof (buf);
+ bufp = buf + sizeof (buf) / sizeof (buf[0]);
negative_number = number_value < 0;
if (negative_number)
u = -u;
do
- *--bufp = u % 10 + '0';
+ *--bufp = u % 10 + L_('0');
while ((u /= 10) != 0);
}
do_number_sign_and_padding:
if (negative_number)
- *--bufp = '-';
+ *--bufp = L_('-');
- if (pad != '-')
+ if (pad != L_('-'))
{
- int padding = digits - (buf + sizeof (buf) - bufp);
+ int padding = digits - (buf + (sizeof (buf) / sizeof (buf[0]))
+ - bufp);
- if (pad == '_')
+ if (pad == L_('_'))
{
while (0 < padding--)
- *--bufp = ' ';
+ *--bufp = L_(' ');
}
else
{
bufp += negative_number;
while (0 < padding--)
- *--bufp = '0';
+ *--bufp = L_('0');
if (negative_number)
- *--bufp = '-';
+ *--bufp = L_('-');
}
}
- cpy (buf + sizeof (buf) - bufp, bufp);
+ cpy (buf + sizeof (buf) / sizeof (buf[0]) - bufp, bufp);
break;
- case 'F':
+ case L_('F'):
if (modifier != 0)
goto bad_format;
- subfmt = "%Y-%m-%d";
+ subfmt = L_("%Y-%m-%d");
goto subformat;
- case 'H':
- if (modifier == 'E')
+ case L_('H'):
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER (2, tp->tm_hour);
- case 'I':
- if (modifier == 'E')
+ case L_('I'):
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER (2, hour12);
- case 'k': /* GNU extension. */
- if (modifier == 'E')
+ case L_('k'): /* GNU extension. */
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER_SPACEPAD (2, tp->tm_hour);
- case 'l': /* GNU extension. */
- if (modifier == 'E')
+ case L_('l'): /* GNU extension. */
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER_SPACEPAD (2, hour12);
- case 'j':
- if (modifier == 'E')
+ case L_('j'):
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER (3, 1 + tp->tm_yday);
- case 'M':
- if (modifier == 'E')
+ case L_('M'):
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER (2, tp->tm_min);
- case 'm':
- if (modifier == 'E')
+ case L_('m'):
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER (2, tp->tm_mon + 1);
- case 'n': /* POSIX.2 extension. */
- add (1, *p = '\n');
+ case L_('n'): /* POSIX.2 extension. */
+ add (1, *p = L_('\n'));
break;
- case 'P':
+ case L_('P'):
to_lowcase = 1;
#if !defined _NL_CURRENT && HAVE_STRFTIME
- format_char = 'p';
+ format_char = L_('p');
#endif
/* FALLTHROUGH */
- case 'p':
+ case L_('p'):
if (change_case)
{
to_uppcase = 0;
@@ -947,24 +1052,25 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
goto underlying_strftime;
#endif
- case 'R': /* GNU extension. */
- subfmt = "%H:%M";
+ case L_('R'): /* GNU extension. */
+ subfmt = L_("%H:%M");
goto subformat;
- case 'r': /* POSIX.2 extension. */
+ case L_('r'): /* POSIX.2 extension. */
#ifdef _NL_CURRENT
- if (*(subfmt = _NL_CURRENT (LC_TIME, T_FMT_AMPM)) == '\0')
+ if (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
+ NLW(T_FMT_AMPM))) == L_('\0'))
#endif
- subfmt = "%I:%M:%S %p";
+ subfmt = L_("%I:%M:%S %p");
goto subformat;
- case 'S':
- if (modifier == 'E')
+ case L_('S'):
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER (2, tp->tm_sec);
- case 's': /* GNU extension. */
+ case L_('s'): /* GNU extension. */
{
struct tm ltm;
time_t t;
@@ -975,7 +1081,7 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
/* Generate string value for T using time_t arithmetic;
this works even if sizeof (long) < sizeof (time_t). */
- bufp = buf + sizeof (buf);
+ bufp = buf + sizeof (buf) / sizeof (buf[0]);
negative_number = t < 0;
do
@@ -995,7 +1101,7 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
}
}
- *--bufp = d + '0';
+ *--bufp = d + L_('0');
}
while (t != 0);
@@ -1003,13 +1109,15 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
goto do_number_sign_and_padding;
}
- case 'X':
- if (modifier == 'O')
+ case L_('X'):
+ if (modifier == L_('O'))
goto bad_format;
#ifdef _NL_CURRENT
- if (! (modifier == 'E'
- && *(subfmt = _NL_CURRENT (LC_TIME, ERA_T_FMT)) != '\0'))
- subfmt = _NL_CURRENT (LC_TIME, T_FMT);
+ if (! (modifier == L_('E')
+ && (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
+ NLW(ERA_T_FMT)))
+ != L_('\0'))))
+ subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT));
goto subformat;
#else
# if HAVE_STRFTIME
@@ -1018,27 +1126,27 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
/* Fall through. */
# endif
#endif
- case 'T': /* POSIX.2 extension. */
- subfmt = "%H:%M:%S";
+ case L_('T'): /* POSIX.2 extension. */
+ subfmt = L_("%H:%M:%S");
goto subformat;
- case 't': /* POSIX.2 extension. */
- add (1, *p = '\t');
+ case L_('t'): /* POSIX.2 extension. */
+ add (1, *p = L_('\t'));
break;
- case 'u': /* POSIX.2 extension. */
+ case L_('u'): /* POSIX.2 extension. */
DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1);
- case 'U':
- if (modifier == 'E')
+ case L_('U'):
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7);
- case 'V':
- case 'g': /* GNU extension. */
- case 'G': /* GNU extension. */
- if (modifier == 'E')
+ case L_('V'):
+ case L_('g'): /* GNU extension. */
+ case L_('G'): /* GNU extension. */
+ if (modifier == L_('E'))
goto bad_format;
{
int year = tp->tm_year + TM_YEAR_BASE;
@@ -1065,10 +1173,10 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
switch (*f)
{
- case 'g':
+ case L_('g'):
DO_NUMBER (2, (year % 100 + 100) % 100);
- case 'G':
+ case L_('G'):
DO_NUMBER (1, year);
default:
@@ -1076,26 +1184,30 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
}
}
- case 'W':
- if (modifier == 'E')
+ case L_('W'):
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7);
- case 'w':
- if (modifier == 'E')
+ case L_('w'):
+ if (modifier == L_('E'))
goto bad_format;
DO_NUMBER (1, tp->tm_wday);
- case 'Y':
+ case L_('Y'):
if (modifier == 'E')
{
#if HAVE_STRUCT_ERA_ENTRY
struct era_entry *era = _nl_get_era_entry (tp);
if (era)
{
- subfmt = strchr (era->name_fmt, '\0') + 1;
+# ifdef COMPILE_WIDE
+ subfmt = era->era_wformat;
+# else
+ subfmt = era->era_format;
+# endif
goto subformat;
}
#else
@@ -1104,13 +1216,13 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
# endif
#endif
}
- if (modifier == 'O')
+ if (modifier == L_('O'))
goto bad_format;
else
DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
- case 'y':
- if (modifier == 'E')
+ case L_('y'):
+ if (modifier == L_('E'))
{
#if HAVE_STRUCT_ERA_ENTRY
struct era_entry *era = _nl_get_era_entry (tp);
@@ -1118,7 +1230,7 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
{
int delta = tp->tm_year - era->start_date[0];
DO_NUMBER (1, (era->offset
- + (era->direction == '-' ? -delta : delta)));
+ + delta * era->absolute_direction));
}
#else
# if HAVE_STRFTIME
@@ -1128,7 +1240,7 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
}
DO_NUMBER (2, (tp->tm_year % 100 + 100) % 100);
- case 'Z':
+ case L_('Z'):
if (change_case)
{
to_uppcase = 0;
@@ -1143,10 +1255,21 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
if (! zone)
zone = ""; /* POSIX.2 requires the empty string here. */
+#ifdef COMPILE_WIDE
+ {
+ /* The zone string is always given in multibyte form. We have
+ to transform it first. */
+ wchar_t *wczone;
+ size_t len;
+ widen (zone, wczone, len);
+ cpy (len, wczone);
+ }
+#else
cpy (strlen (zone), zone);
+#endif
break;
- case 'z': /* GNU extension. */
+ case L_('z'): /* GNU extension. */
if (tp->tm_isdst < 0)
break;
@@ -1192,17 +1315,17 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
if (diff < 0)
{
- add (1, *p = '-');
+ add (1, *p = L_('-'));
diff = -diff;
}
else
- add (1, *p = '+');
+ add (1, *p = L_('+'));
diff /= 60;
DO_NUMBER (4, (diff / 60) * 100 + diff % 60);
}
- case '\0': /* GNU extension: % at end of format. */
+ case L_('\0'): /* GNU extension: % at end of format. */
--f;
/* Fall through. */
default:
@@ -1212,7 +1335,7 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
bad_format:
{
int flen;
- for (flen = 1; f[1 - flen] != '%'; flen++)
+ for (flen = 1; f[1 - flen] != L_('%'); flen++)
continue;
cpy (flen, &f[1 - flen]);
}
@@ -1221,7 +1344,7 @@ my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
}
if (p && maxsize != 0)
- *p = '\0';
+ *p = L_('\0');
return i;
}
diff --git a/lib/strstr.c b/lib/strstr.c
index cdee6211..7709d846 100644
--- a/lib/strstr.c
+++ b/lib/strstr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
@@ -24,15 +24,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
*
* Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <string.h>
#include <sys/types.h>
typedef unsigned chartype;
char *
-strstr (phaystack, pneedle)
- const char *phaystack;
- const char *pneedle;
+strstr (const char *phaystack, const char *pneedle)
{
register const unsigned char *haystack, *needle;
register chartype b, c;
@@ -73,7 +75,7 @@ strstr (phaystack, pneedle)
a = *++haystack;
if (a == '\0')
goto ret0;
-shloop: }
+shloop:; }
while (a != b);
jin: a = *++haystack;
diff --git a/locate/.cvsignore b/locate/.cvsignore
index e6f64926..f2e3cfea 100644
--- a/locate/.cvsignore
+++ b/locate/.cvsignore
@@ -1,6 +1,5 @@
.deps
Makefile
-Makefile.in
bigram
code
config.h.in
diff --git a/locate/Makefile.in b/locate/Makefile.in
index d7d088f0..fb08b423 100644
--- a/locate/Makefile.in
+++ b/locate/Makefile.in
@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
+GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@@ -83,8 +85,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
+MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
+OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@@ -158,15 +163,15 @@ man5dir = $(mandir)/man5
MANS = $(man_MANS)
NROFF = nroff
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/bigram$U.Po $(DEPDIR)/code$U.Po \
+$(DEPDIR)/frcode$U.Po $(DEPDIR)/locate$U.Po
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-DEP_FILES = @AMDEP@ $(DEPDIR)/bigram$U.Po $(DEPDIR)/code$U.Po \
-$(DEPDIR)/frcode$U.Po $(DEPDIR)/locate$U.Po
SOURCES = bigram.c code.c frcode.c locate.c
OBJECTS = bigram$U.o code$U.o frcode$U.o locate$U.o
@@ -176,7 +181,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu locate/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -299,15 +304,67 @@ uninstall-binSCRIPTS:
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
rm -f $(DESTDIR)$(bindir)/$$f; \
done
+alloca_.c: alloca.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c
bigram_.c: bigram.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/bigram.c; then echo $(srcdir)/bigram.c; else echo bigram.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > bigram_.c
code_.c: code.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/code.c; then echo $(srcdir)/code.c; else echo code.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > code_.c
+error_.c: error.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > error_.c
+fileblocks_.c: fileblocks.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fileblocks_.c
+fnmatch_.c: fnmatch.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fnmatch_.c
frcode_.c: frcode.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/frcode.c; then echo $(srcdir)/frcode.c; else echo frcode.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > frcode_.c
locate_.c: locate.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/locate.c; then echo $(srcdir)/locate.c; else echo locate.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > locate_.c
-bigram_.o code_.o frcode_.o locate_.o : $(ANSI2KNR)
+lstat_.c: lstat.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > lstat_.c
+malloc_.c: malloc.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c
+memcmp_.c: memcmp.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcmp_.c
+memcpy_.c: memcpy.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcpy_.c
+memset_.c: memset.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memset_.c
+mktime_.c: mktime.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mktime_.c
+realloc_.c: realloc.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
+regex_.c: regex.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c
+stat_.c: stat.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
+stpcpy_.c: stpcpy.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c
+strdup_.c: strdup.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strdup_.c
+strftime_.c: strftime.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strftime_.c
+strncasecmp_.c: strncasecmp.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strncasecmp.c; then echo $(srcdir)/strncasecmp.c; else echo strncasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strncasecmp_.c
+strspn_.c: strspn.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strspn.c; then echo $(srcdir)/strspn.c; else echo strspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strspn_.c
+strstr_.c: strstr.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strstr_.c
+strtol_.c: strtol.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtol_.c
+strtoul_.c: strtoul.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoul_.c
+strtoull_.c: strtoull.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoull.c; then echo $(srcdir)/strtoull.c; else echo strtoull.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoull_.c
+strtoumax_.c: strtoumax.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c
+waitpid_.c: waitpid.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/waitpid.c; then echo $(srcdir)/waitpid.c; else echo waitpid.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > waitpid_.c
+alloca_.o bigram_.o code_.o error_.o fileblocks_.o fnmatch_.o frcode_.o \
+locate_.o lstat_.o malloc_.o memcmp_.o memcpy_.o memset_.o mktime_.o \
+realloc_.o regex_.o stat_.o stpcpy_.o strdup_.o strftime_.o \
+strncasecmp_.o strspn_.o strstr_.o strtol_.o strtoul_.o strtoull_.o \
+strtoumax_.o waitpid_.o : $(ANSI2KNR)
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@@ -394,7 +451,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- mkid -f$$here/ID $$unique $(LISP)
+ mkid -fID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -418,20 +475,6 @@ distclean-tags:
maintainer-clean-tags:
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir); \
- else \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
- fi; \
- done
-
@AMDEP@include $(DEPDIR)/bigram$U.Po
@AMDEP@include $(DEPDIR)/code$U.Po
@AMDEP@include $(DEPDIR)/frcode$U.Po
@@ -452,8 +495,23 @@ maintainer-clean-depend:
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c -o $@ $<
+ $(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
info-am:
info: info-am
dvi-am:
@@ -533,14 +591,13 @@ distclean-compile clean-compile maintainer-clean-compile mostlyclean-kr \
distclean-kr clean-kr maintainer-clean-kr uninstall-binSCRIPTS \
install-binSCRIPTS install-man1 uninstall-man1 install-man5 \
uninstall-man5 install-man uninstall-man tags mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir \
-mostlyclean-depend distclean-depend clean-depend \
-maintainer-clean-depend info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all install-strip installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+distclean-tags clean-tags maintainer-clean-tags mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend distdir info-am \
+info dvi-am dvi check check-am installcheck-am installcheck \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all install-strip \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
$(PROGRAMS) $(LIBPROGRAMS): ../find/version.o ../lib/libfind.a
diff --git a/locate/code.c b/locate/code.c
index f7155074..9dd25e87 100644
--- a/locate/code.c
+++ b/locate/code.c
@@ -74,7 +74,7 @@
#include "locatedb.h"
#include <getline.h>
-char *xmalloc (size_t);
+char *xmalloc PARAMS((size_t));
/* The name this program was run with. */
char *program_name;
diff --git a/locate/frcode.c b/locate/frcode.c
index eabc969c..e628c8dc 100644
--- a/locate/frcode.c
+++ b/locate/frcode.c
@@ -78,7 +78,7 @@
#include "locatedb.h"
#include <getline.h>
-char *xmalloc (size_t);
+char *xmalloc PARAMS((size_t));
/* The name this program was run with. */
char *program_name;
diff --git a/locate/locatedb.h b/locate/locatedb.h
index e4017651..2476e573 100644
--- a/locate/locatedb.h
+++ b/locate/locatedb.h
@@ -39,4 +39,12 @@
/* Offset added to differential counts to encode them as positive numbers. */
#define LOCATEDB_OLD_OFFSET 14
+# ifndef PARAMS
+# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+# define PARAMS(Args) Args
+# else
+# define PARAMS(Args) ()
+# endif
+# endif
+
#endif /* !_LOCATEDB_H */
diff --git a/m4/ChangeLog b/m4/ChangeLog
index cb269e1d..23f2d559 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,7 @@
+2000-04-05 Kevin Dalley <kevind@rahul.net>
+
+ * m4/Makefile.am: new version of file
+
2000-01-18 Kevin Dalley <kevind@rahul.net>
* Makefile.am: recreated Makefile.am from Makefile.am.in
diff --git a/m4/Makefile.am b/m4/Makefile.am
index ff87d860..b8398701 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -4,45 +4,43 @@
EXTRA_DIST = README Makefile.am.in \
afs.m4 \
assert.m4 \
+c-bs-a.m4 \
check-decl.m4 \
-check-type.m4 \
-const.m4 \
d-ino.m4 \
d-type.m4 \
-decl.m4 \
error.m4 \
fnmatch.m4 \
fstypename.m4 \
getline.m4 \
+gettext.m4 \
glibc.m4 \
inttypes_h.m4 \
isc-posix.m4 \
jm-glibc-io.m4 \
jm-macros.m4 \
jm-mktime.m4 \
-lfs.m4 \
+largefile.m4 \
+lcmessage.m4 \
+link-follow.m4 \
ls-mntd-fs.m4 \
lstat-slash.m4 \
lstat.m4 \
malloc.m4 \
memcmp.m4 \
-mktime.m4 \
-perl.m4 \
prereq.m4 \
-putenv.m4 \
+progtest.m4 \
readdir.m4 \
realloc.m4 \
regex.m4 \
st_dm_mode.m4 \
st_mtim.m4 \
stat.m4 \
+strerror_r.m4 \
strftime.m4 \
+timespec.m4 \
uintmax_t.m4 \
ulonglong.m4 \
-uptime.m4 \
-utimbuf.m4 \
-utime.m4 \
-utimes.m4
+xstrtoumax.m4
##m4-files-end
Makefile.am: Makefile.am.in
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 955e30fe..21158f27 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
+GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@@ -84,8 +86,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
+MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
+OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@@ -101,45 +106,43 @@ l = @l@
EXTRA_DIST = README Makefile.am.in \
afs.m4 \
assert.m4 \
+c-bs-a.m4 \
check-decl.m4 \
-check-type.m4 \
-const.m4 \
d-ino.m4 \
d-type.m4 \
-decl.m4 \
error.m4 \
fnmatch.m4 \
fstypename.m4 \
getline.m4 \
+gettext.m4 \
glibc.m4 \
inttypes_h.m4 \
isc-posix.m4 \
jm-glibc-io.m4 \
jm-macros.m4 \
jm-mktime.m4 \
-lfs.m4 \
+largefile.m4 \
+lcmessage.m4 \
+link-follow.m4 \
ls-mntd-fs.m4 \
lstat-slash.m4 \
lstat.m4 \
malloc.m4 \
memcmp.m4 \
-mktime.m4 \
-perl.m4 \
prereq.m4 \
-putenv.m4 \
+progtest.m4 \
readdir.m4 \
realloc.m4 \
regex.m4 \
st_dm_mode.m4 \
st_mtim.m4 \
stat.m4 \
+strerror_r.m4 \
strftime.m4 \
+timespec.m4 \
uintmax_t.m4 \
ulonglong.m4 \
-uptime.m4 \
-utimbuf.m4 \
-utime.m4 \
-utimes.m4
+xstrtoumax.m4
subdir = m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -157,7 +160,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -171,11 +174,12 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir); \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
else \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
info-am:
diff --git a/m4/check-decl.m4 b/m4/check-decl.m4
index e482169d..14cc0019 100644
--- a/m4/check-decl.m4
+++ b/m4/check-decl.m4
@@ -1,45 +1,63 @@
-#serial 5
+#serial 9, except remove memchr and nanosleep as findutils doesn't need them
dnl This is just a wrapper function to encapsulate this kludge.
dnl Putting it in a separate file like this helps share it between
dnl different packages.
AC_DEFUN(jm_CHECK_DECLS,
[
+ AC_REQUIRE([_jm_DECL_HEADERS])
+ AC_REQUIRE([AC_HEADER_TIME])
headers='
#include <stdio.h>
-#ifdef HAVE_STRING_H
+#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#else
-# ifdef HAVE_STRINGS_H
+# if HAVE_STRINGS_H
# include <strings.h>
# endif
#endif
-#ifdef HAVE_STDLIB_H
+#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
-#ifdef HAVE_UNISTD_H
+#if HAVE_UNISTD_H
# include <unistd.h>
#endif
+
+#include <sys/types.h>
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
'
- if test x = y; then
- dnl This code is deliberately never run via ./configure.
- dnl FIXME: this is a gross hack to make autoheader put entries
- dnl for each of these symbols in the config.h.in.
- dnl Otherwise, I'd have to update acconfig.h every time I change
- dnl this list of functions.
- AC_DEFINE(HAVE_DECL_FREE, 1, [Define if this function is declared.])
- AC_DEFINE(HAVE_DECL_LSEEK, 1, [Define if this function is declared.])
- AC_DEFINE(HAVE_DECL_MALLOC, 1, [Define if this function is declared.])
- AC_DEFINE(HAVE_DECL_MEMCHR, 1, [Define if this function is declared.])
- AC_DEFINE(HAVE_DECL_REALLOC, 1, [Define if this function is declared.])
- AC_DEFINE(HAVE_DECL_STPCPY, 1, [Define if this function is declared.])
- AC_DEFINE(HAVE_DECL_STRSTR, 1, [Define if this function is declared.])
- fi
+ AC_CHECK_DECLS((
+ free,
+ getenv,
+ geteuid,
+ getlogin,
+ lseek,
+ malloc,
+ realloc,
+ stpcpy,
+ strstr,
+ strtoul,
+ strtoull,
+ ttyname), , , $headers)
+])
- jm_CHECK_DECLARATIONS($headers, free lseek malloc \
- memchr realloc stpcpy strstr)
+dnl FIXME: when autoconf has support for it.
+dnl This is a little helper so we can require these header checks.
+AC_DEFUN(_jm_DECL_HEADERS,
+[
+ AC_REQUIRE([AC_HEADER_STDC])
+ AC_CHECK_HEADERS(memory.h string.h strings.h stdlib.h unistd.h sys/time.h)
])
diff --git a/m4/check-type.m4 b/m4/check-type.m4
deleted file mode 100644
index 3eb9dbb2..00000000
--- a/m4/check-type.m4
+++ /dev/null
@@ -1,28 +0,0 @@
-#serial 1
-
-dnl Just like AC_CHECK_TYPE from autoconf-2.12, but also checks in unistd.h
-dnl on systems that have it. Fujitsu UXP/V needs this for ssize_t.
-
-undefine([AC_CHECK_TYPE])
-dnl AC_CHECK_TYPE(TYPE, DEFAULT)
-AC_DEFUN(AC_CHECK_TYPE,
-[AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_CHECK_HEADERS(unistd.h)
-AC_MSG_CHECKING(for $1)
-AC_CACHE_VAL(ac_cv_type_$1,
-[AC_EGREP_CPP(dnl
-changequote(<<,>>)dnl
-<<$1[^a-zA-Z_0-9]>>dnl
-changequote([,]), [#include <sys/types.h>
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
-AC_MSG_RESULT($ac_cv_type_$1)
-if test $ac_cv_type_$1 = no; then
- AC_DEFINE($1, $2)
-fi
-])
diff --git a/m4/const.m4 b/m4/const.m4
deleted file mode 100644
index ebe59596..00000000
--- a/m4/const.m4
+++ /dev/null
@@ -1,66 +0,0 @@
-#serial 1
-
-dnl Just like AC_C_CONST from autoconf-2.12, but with an initializer
-dnl for `charset x' and with
-dnl AC_DEFINE(const, )
-dnl changed to
-dnl AC_DEFINE_UNQUOTED(const, [/* empty */])
-dnl to avoid this warning:
-dnl [...]/m4: Warning: Excess arguments to built-in `define' ignored
-
-undefine([AC_C_CONST])
-AC_DEFUN(AC_C_CONST,
-[dnl This message is consistent in form with the other checking messages,
-dnl and with the result message.
-AC_CACHE_CHECK([for working const], ac_cv_c_const,
-[AC_TRY_COMPILE(,
-changequote(<<, >>)dnl
-<<
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x = {0, 0};
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
->>,
-changequote([, ])dnl
-ac_cv_c_const=yes, ac_cv_c_const=no)])
-if test $ac_cv_c_const = no; then
- AC_DEFINE_UNQUOTED(const, [/* empty */])
-fi
-])
diff --git a/m4/decl.m4 b/m4/decl.m4
deleted file mode 100644
index 69438b70..00000000
--- a/m4/decl.m4
+++ /dev/null
@@ -1,43 +0,0 @@
-#serial 3
-
-AC_DEFUN(jm_CHECK_DECLARATION,
-[
- AC_REQUIRE([AC_HEADER_STDC])dnl
- test -z "$ac_cv_header_memory_h" && AC_CHECK_HEADERS(memory.h)
- test -z "$ac_cv_header_string_h" && AC_CHECK_HEADERS(string.h)
- test -z "$ac_cv_header_strings_h" && AC_CHECK_HEADERS(strings.h)
- test -z "$ac_cv_header_stdlib_h" && AC_CHECK_HEADERS(stdlib.h)
- test -z "$ac_cv_header_unistd_h" && AC_CHECK_HEADERS(unistd.h)
- AC_MSG_CHECKING([whether $1 is declared])
- AC_CACHE_VAL(jm_cv_func_decl_$1,
- [AC_TRY_COMPILE($2,
- [
-#ifndef $1
-char *(*pfn) = (char *(*)) $1
-#endif
- ],
- eval "jm_cv_func_decl_$1=yes",
- eval "jm_cv_func_decl_$1=no")])
-
- if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$3], , :, [$3])
- else
- AC_MSG_RESULT(no)
- ifelse([$4], , , [$4
-])dnl
- fi
-])dnl
-
-dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
-dnl [, ACTION-IF-NOT-DECLARED]])
-AC_DEFUN(jm_CHECK_DECLARATIONS,
-[
- for jm_func in $2
- do
- jm_CHECK_DECLARATION($jm_func, $1,
- [
- jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
- AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl
- done
-])
diff --git a/m4/jm-glibc-io.m4 b/m4/jm-glibc-io.m4
index 868fa439..e2423cd6 100644
--- a/m4/jm-glibc-io.m4
+++ b/m4/jm-glibc-io.m4
@@ -1,4 +1,4 @@
-#serial 2
+#serial 3
dnl From Jim Meyering.
dnl
@@ -16,10 +16,10 @@ AC_DEFUN(jm_FUNC_GLIBC_UNLOCKED_IO,
# Otherwise, we'd get the Solaris5.5.1 functions that are not
# declared, and that have been removed from Solaris5.6. The resulting
# 5.5.1 binaries would not run on 5.6 due to shared library differences.
- jm_CHECK_DECLARATIONS([#include <stdio.h>
- ], $jm_io_func,
- jm_declared=yes,
- jm_declared=no)
+ AC_CHECK_DECLS(($jm_io_func),
+ jm_declared=yes,
+ jm_declared=no,
+ [#include <stdio.h>])
if test $jm_declared = yes; then
AC_CHECK_FUNCS($jm_io_func)
fi
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4
index aa040ee1..55576ab4 100644
--- a/m4/jm-macros.m4
+++ b/m4/jm-macros.m4
@@ -1,4 +1,4 @@
-#serial 11
+#serial 13, with several lines deleted for fileutils.
dnl Misc type-related macros for fileutils, sh-utils, textutils.
@@ -11,36 +11,90 @@ AC_DEFUN(jm_MACROS,
[The concatenation of the strings `GNU ', and PACKAGE.])
AC_SUBST(GNU_PACKAGE)
+ AC_SUBST(OPTIONAL_BIN_PROGS)
+ AC_SUBST(OPTIONAL_BIN_ZCRIPTS)
+ AC_SUBST(MAN)
+ AC_SUBST(DF_PROG)
+
dnl This macro actually runs replacement code. See isc-posix.m4.
AC_REQUIRE([AC_ISC_POSIX])dnl
+ AC_CHECK_HEADERS( \
+ errno.h \
+ fcntl.h \
+ fenv.h \
+ float.h \
+ limits.h \
+ memory.h \
+ mntent.h \
+ mnttab.h \
+ netdb.h \
+ paths.h \
+ stdlib.h \
+ stddef.h \
+ string.h \
+ sys/acl.h \
+ sys/filsys.h \
+ sys/fs/s5param.h \
+ sys/fs_types.h \
+ sys/fstyp.h \
+ sys/ioctl.h \
+ sys/mntent.h \
+ sys/mount.h \
+ sys/param.h \
+ sys/socket.h \
+ sys/statfs.h \
+ sys/statvfs.h \
+ sys/systeminfo.h \
+ sys/time.h \
+ sys/timeb.h \
+ sys/vfs.h \
+ sys/wait.h \
+ syslog.h \
+ termios.h \
+ unistd.h \
+ values.h \
+ )
+
jm_INCLUDED_REGEX([lib/regex.c])
AC_REQUIRE([jm_ASSERT])
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
- AC_REQUIRE([jm_STRUCT_UTIMBUF])
- AC_REQUIRE([jm_STRUCT_DIRENT_D_TYPE])
- AC_REQUIRE([jm_STRUCT_DIRENT_D_INO])
+ AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
+ AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
AC_REQUIRE([jm_CHECK_DECLS])
AC_REQUIRE([jm_PREREQ])
+ AC_REQUIRE([jm_FUNC_MKTIME])
AC_REQUIRE([jm_FUNC_LSTAT])
AC_REQUIRE([jm_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
AC_REQUIRE([jm_FUNC_STAT])
AC_REQUIRE([jm_FUNC_REALLOC])
AC_REQUIRE([jm_FUNC_MALLOC])
+ AC_REQUIRE([jm_FUNC_STRERROR_R])
AC_REQUIRE([jm_FUNC_READDIR])
AC_REQUIRE([jm_FUNC_MEMCMP])
AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
AC_REQUIRE([jm_FUNC_FNMATCH])
AC_REQUIRE([jm_AFS])
+ AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
+ AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
+ AC_REQUIRE([AM_FUNC_ERROR_AT_LINE])
+ AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
+ AC_REQUIRE([jm_FUNC_MKTIME])
- AC_REPLACE_FUNCS(strcasecmp strncasecmp)
+ AC_REQUIRE([AC_FUNC_VPRINTF])
+ AC_REQUIRE([AC_FUNC_ALLOCA])
+
+ AC_REPLACE_FUNCS(strncasecmp)
+ AC_REPLACE_FUNCS(stpcpy strstr strtol strtoul)
+ AC_REPLACE_FUNCS(memcmp)
dnl used by e.g. intl/*domain.c and lib/canon-host.c
AC_REPLACE_FUNCS(strdup)
+ AC_REPLACE_FUNCS(memcpy memset)
AC_CHECK_FUNCS(getpagesize)
# By default, argmatch should fail calling usage (1).
@@ -61,38 +115,77 @@ AC_DEFUN(jm_MACROS,
AC_CHECK_FUNCS(clock_gettime)
AC_CHECK_FUNCS(gettimeofday)
- AM_FUNC_GETLINE
AC_CHECK_FUNCS(getdelim)
+ AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
+
+ AC_CHECK_FUNCS( \
+ acl \
+ bcopy \
+ endgrent \
+ endpwent \
+ fchdir \
+ fdatasync \
+ fseeko \
+ ftime \
+ ftruncate \
+ getcwd \
+ gethrtime \
+ getmntinfo \
+ hasmntopt \
+ isascii \
+ listmntent \
+ localeconv \
+ memcpy \
+ mempcpy \
+ mkfifo \
+ realpath \
+ resolvepath \
+ sethostname \
+ strchr \
+ strerror \
+ strrchr \
+ sysinfo \
+ tzset \
+ )
+
+ AM_FUNC_GETLINE
+ if test $am_cv_func_working_getline != yes; then
+ AC_CHECK_FUNCS(getdelim)
+ fi
])
AC_DEFUN(jm_CHECK_ALL_TYPES,
[
dnl Checks for typedefs, structures, and compiler characteristics.
- AC_C_BIGENDIAN
- AC_C_CONST
- AC_C_INLINE
- AC_C_LONG_DOUBLE
-
- AC_HEADER_DIRENT
- AC_HEADER_STDC
- AC_CHECK_MEMBERS((struct stat.st_blksize))
- AC_STRUCT_ST_BLOCKS
-
- AC_STRUCT_TM
- AC_HEADER_TIME
- AC_STRUCT_TIMEZONE
- AC_HEADER_STAT
- AC_STRUCT_ST_MTIM_NSEC
- AC_STRUCT_ST_DM_MODE
-
- AC_TYPE_GETGROUPS
- AC_TYPE_MODE_T
- AC_TYPE_OFF_T
- AC_TYPE_PID_T
- AC_TYPE_SIGNAL
- AC_TYPE_SIZE_T
- AC_TYPE_UID_T
+ AC_REQUIRE([AC_C_BIGENDIAN])
+ AC_REQUIRE([AC_PROG_CC_STDC])
+ AC_REQUIRE([AC_C_CONST])
+ AC_REQUIRE([AC_C_VOLATILE])
+ AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([AC_C_LONG_DOUBLE])
+
+ AC_REQUIRE([AC_HEADER_DIRENT])
+ AC_REQUIRE([AC_HEADER_STDC])
+ AC_CHECK_MEMBERS((struct stat.st_blksize),,,[$ac_includes_default
+#include <sys/stat.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_OFF_T])
+ AC_REQUIRE([AC_TYPE_PID_T])
+ AC_REQUIRE([AC_TYPE_SIGNAL])
+ AC_REQUIRE([AC_TYPE_SIZE_T])
+ AC_REQUIRE([AC_TYPE_UID_T])
AC_CHECK_TYPE(ino_t, unsigned long)
dnl This relies on the fact that autoconf 2.14a's implementation of
@@ -101,4 +194,8 @@ AC_DEFUN(jm_CHECK_ALL_TYPES,
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
+
+ AC_REQUIRE([AC_HEADER_MAJOR])
+ AC_REQUIRE([AC_HEADER_DIRENT])
+
])
diff --git a/m4/jm-mktime.m4 b/m4/jm-mktime.m4
index af361179..5bb73576 100644
--- a/m4/jm-mktime.m4
+++ b/m4/jm-mktime.m4
@@ -1,18 +1,16 @@
-#serial 3
+#serial 7
dnl From Jim Meyering.
-dnl If you use this macro in a package, you should
-dnl add the following two lines to acconfig.h:
-dnl /* Define to rpl_mktime if the replacement function should be used. */
-dnl #undef mktime
-dnl
+dnl A wrapper around AC_FUNC_MKTIME.
+
AC_DEFUN(jm_FUNC_MKTIME,
-[AC_REQUIRE([jm_AM_FUNC_MKTIME])dnl
+[AC_REQUIRE([AC_FUNC_MKTIME])dnl
dnl mktime.c uses localtime_r if it exists. Check for it.
AC_CHECK_FUNCS(localtime_r)
- if test $jm_am_cv_func_working_mktime = no; then
- AC_DEFINE_UNQUOTED(mktime, rpl_mktime)
+ if test $ac_cv_func_working_mktime = no; then
+ AC_DEFINE_UNQUOTED(mktime, rpl_mktime,
+ [Define to rpl_mktime if the replacement function should be used.])
fi
])
diff --git a/m4/lfs.m4 b/m4/lfs.m4
deleted file mode 100644
index 8de343b2..00000000
--- a/m4/lfs.m4
+++ /dev/null
@@ -1,44 +0,0 @@
-#serial 1
-
-dnl The problem is that the default compilation flags in Solaris 2.6 won't
-dnl let programs access large files; you need to tell the compiler that
-dnl you actually want your programs to work on large files. For more
-dnl details about this brain damage please see:
-dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
-
-dnl Written by Paul Eggert <eggert@twinsun.com>.
-
-AC_DEFUN(AC_LFS,
-[dnl
- # If available, prefer support for large files unless the user specified
- # one of the CPPFLAGS, LDFLAGS, or LIBS variables.
- AC_MSG_CHECKING(whether large file support needs explicit enabling)
- ac_getconfs=''
- ac_result=yes
- ac_set=''
- ac_shellvars='CPPFLAGS LDFLAGS LIBS'
- for ac_shellvar in $ac_shellvars; do
- case $ac_shellvar in
- CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
- *) ac_lfsvar=LFS_$ac_shellvar ;;
- esac
- eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
- (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
- ac_getconf=`getconf $ac_lfsvar`
- ac_getconfs=$ac_getconfs$ac_getconf
- eval ac_test_$ac_shellvar=\$ac_getconf
- done
- case "$ac_result$ac_getconfs" in
- yes) ac_result=no ;;
- esac
- case "$ac_result$ac_set" in
- yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
- esac
- AC_MSG_RESULT($ac_result)
- case $ac_result in
- yes)
- for ac_shellvar in $ac_shellvars; do
- eval $ac_shellvar=\$ac_test_$ac_shellvar
- done ;;
- esac
-])
diff --git a/m4/ls-mntd-fs.m4 b/m4/ls-mntd-fs.m4
index 7a90be5d..40a2fb17 100644
--- a/m4/ls-mntd-fs.m4
+++ b/m4/ls-mntd-fs.m4
@@ -13,10 +13,11 @@ dnl
AC_PREREQ(2.14a)
+# jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN(jm_LIST_MOUNTED_FILESYSTEMS,
[
# Determine how to get the list of mounted filesystems.
-list_mounted_fs=
+ac_list_mounted_fs=
# If the getmntent function is available but not in the standard library,
# make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
@@ -31,7 +32,7 @@ AC_FUNC_GETMNTENT
# I think there is too great a chance that some non-Cray system has a
# function named listmntent to risk the false positive.
-if test -z "$list_mounted_fs"; then
+if test -z "$ac_list_mounted_fs"; then
# Cray UNICOS 9
AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
@@ -47,7 +48,7 @@ yes
)
AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
if test $fu_cv_sys_mounted_cray_listmntent = yes; then
- list_mounted_fs=found
+ ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_LISTMNTENT, 1,
[Define if there is a function named listmntent that can be used to
list all mounted filesystems. (UNICOS)])
@@ -59,7 +60,7 @@ if test $ac_cv_func_getmntent = yes; then
# This system has the getmntent function.
# Determine whether it's the one-argument variant or the two-argument one.
- if test -z "$list_mounted_fs"; then
+ if test -z "$ac_list_mounted_fs"; then
# 4.3BSD, SunOS, HP-UX, Dynix, Irix
AC_MSG_CHECKING([for one-argument getmntent function])
AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
@@ -68,7 +69,7 @@ if test $ac_cv_func_getmntent = yes; then
|| fu_cv_sys_mounted_getmntent1=no])
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
if test $fu_cv_sys_mounted_getmntent1 = yes; then
- list_mounted_fs=found
+ ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNTENT1, 1,
[Define if there is a function named getmntent for reading the list
of mounted filesystems, and that function takes a single argument.
@@ -76,7 +77,7 @@ if test $ac_cv_func_getmntent = yes; then
fi
fi
- if test -z "$list_mounted_fs"; then
+ if test -z "$ac_list_mounted_fs"; then
# SVR4
AC_MSG_CHECKING([for two-argument getmntent function])
AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
@@ -85,20 +86,20 @@ if test $ac_cv_func_getmntent = yes; then
fu_cv_sys_mounted_getmntent2=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
if test $fu_cv_sys_mounted_getmntent2 = yes; then
- list_mounted_fs=found
+ ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNTENT2, 1,
[Define if there is a function named getmntent for reading the list of
mounted filesystems, and that function takes two arguments. (SVR4)])
fi
fi
- if test -z "$list_mounted_fs"; then
+ if test -z "$ac_list_mounted_fs"; then
AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
fi
fi
-if test -z "$list_mounted_fs"; then
+if test -z "$ac_list_mounted_fs"; then
# DEC Alpha running OSF/1.
AC_MSG_CHECKING([for getfsstat function])
AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
@@ -112,14 +113,14 @@ if test -z "$list_mounted_fs"; then
fu_cv_sys_mounted_getsstat=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_getsstat)
if test $fu_cv_sys_mounted_getsstat = yes; then
- list_mounted_fs=found
+ ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_GETFSSTAT, 1,
[Define if there is a function named getfsstat for reading the
list of mounted filesystems. (DEC Alpha running OSF/1)])
fi
fi
-if test -z "$list_mounted_fs"; then
+if test -z "$ac_list_mounted_fs"; then
# AIX.
AC_MSG_CHECKING([for mntctl function and struct vmount])
AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
@@ -128,7 +129,7 @@ if test -z "$list_mounted_fs"; then
fu_cv_sys_mounted_vmount=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
if test $fu_cv_sys_mounted_vmount = yes; then
- list_mounted_fs=found
+ ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_VMOUNT, 1,
[Define if there is a function named mntctl that can be used to read
the list of mounted filesystems, and there is a system header file
@@ -136,7 +137,7 @@ if test -z "$list_mounted_fs"; then
fi
fi
-if test -z "$list_mounted_fs"; then
+if test -z "$ac_list_mounted_fs"; then
# SVR3
AC_MSG_CHECKING([for FIXME existence of three headers])
AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
@@ -148,7 +149,7 @@ if test -z "$list_mounted_fs"; then
fu_cv_sys_mounted_fread_fstyp=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
if test $fu_cv_sys_mounted_fread_fstyp = yes; then
- list_mounted_fs=found
+ ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
[Define if (like SVR2) there is no specific function for reading the
list of mounted filesystems, and your system has these header files:
@@ -156,7 +157,7 @@ if test -z "$list_mounted_fs"; then
fi
fi
-if test -z "$list_mounted_fs"; then
+if test -z "$ac_list_mounted_fs"; then
# 4.4BSD and DEC OSF/1.
AC_MSG_CHECKING([for getmntinfo function])
AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
@@ -172,7 +173,7 @@ if test -z "$list_mounted_fs"; then
])
AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
if test $fu_cv_sys_mounted_getmntinfo = yes; then
- list_mounted_fs=found
+ ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNTINFO, 1,
[Define if there is a function named getmntinfo for reading the
list of mounted filesystems. (4.4BSD)])
@@ -181,7 +182,7 @@ fi
# FIXME: add a test for netbsd-1.1 here
-if test -z "$list_mounted_fs"; then
+if test -z "$ac_list_mounted_fs"; then
# Ultrix
AC_MSG_CHECKING([for getmnt function])
AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
@@ -192,14 +193,14 @@ if test -z "$list_mounted_fs"; then
fu_cv_sys_mounted_getmnt=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
if test $fu_cv_sys_mounted_getmnt = yes; then
- list_mounted_fs=found
+ ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_GETMNT, 1,
[Define if there is a function named getmnt for reading the list of
mounted filesystems. (Ultrix)])
fi
fi
-if test -z "$list_mounted_fs"; then
+if test -z "$ac_list_mounted_fs"; then
# SVR2
AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
AC_CACHE_VAL(fu_cv_sys_mounted_fread,
@@ -208,17 +209,19 @@ if test -z "$list_mounted_fs"; then
fu_cv_sys_mounted_fread=no)])
AC_MSG_RESULT($fu_cv_sys_mounted_fread)
if test $fu_cv_sys_mounted_fread = yes; then
- list_mounted_fs=found
+ ac_list_mounted_fs=found
AC_DEFINE(MOUNTED_FREAD, 1,
[Define if there is no specific function for reading the list of
mounted filesystems. fread will be used to read /etc/mnttab. (SVR2) ])
fi
fi
-if test -z "$list_mounted_fs"; then
+if test -z "$ac_list_mounted_fs"; then
AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
# FIXME -- no need to abort building the whole package
# Can't build mountlist.c or anything that needs its functions
fi
+AC_SHELL_IFELSE([test $ac_list_mounted_fs = found], [$1], [$2])dnl
+
])
diff --git a/m4/memcmp.m4 b/m4/memcmp.m4
index 1c08adc2..7fdfe9ad 100644
--- a/m4/memcmp.m4
+++ b/m4/memcmp.m4
@@ -1,13 +1,12 @@
-#serial 3
+#serial 4
dnl A replacement for autoconf's AC_FUNC_MEMCMP that detects
dnl the losing memcmp on some x86 Next systems.
AC_DEFUN(jm_AC_FUNC_MEMCMP,
[AC_CACHE_CHECK([for working memcmp], jm_cv_func_memcmp_working,
[AC_TRY_RUN(
-changequote(<<, >>)dnl
-<<
-main()
+[int
+main ()
{
/* Some versions of memcmp are not 8-bit clean. */
char c0 = 0x40, c1 = 0x80, c2 = 0x81;
@@ -32,9 +31,7 @@ main()
}
exit (0);
}
-}
->>,
-changequote([, ])dnl
+}],
jm_cv_func_memcmp_working=yes,
jm_cv_func_memcmp_working=no,
jm_cv_func_memcmp_working=no)])
diff --git a/m4/mktime.m4 b/m4/mktime.m4
deleted file mode 100644
index 10e02db5..00000000
--- a/m4/mktime.m4
+++ /dev/null
@@ -1,166 +0,0 @@
-#serial 1001
-
-dnl Just like mktime.m4 from automake-1.3b, but with an additional test.
-dnl Renamed to have jm_ prefix and to use jm_ prefix on cache variable names.
-
-AC_DEFUN(jm_AM_FUNC_MKTIME,
-[AC_REQUIRE([AC_HEADER_TIME])dnl
- AC_CHECK_HEADERS(sys/time.h unistd.h)
- AC_CHECK_FUNCS(alarm)
- AC_CACHE_CHECK([for working mktime], jm_am_cv_func_working_mktime,
- [AC_TRY_RUN(
-changequote(<<, >>)dnl
-<</* Test program from Paul Eggert (eggert@twinsun.com)
- and Tony Leneis (tony@plaza.ds.adp.com). */
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#if !HAVE_ALARM
-# define alarm(X) /* empty */
-#endif
-
-/* Work around redefinition to rpl_putenv by other config tests. */
-#undef putenv
-
-static time_t time_t_max;
-
-/* Values we'll use to set the TZ environment variable. */
-static const char *const tz_strings[] = {
- (const char *) 0, "TZ=GMT0", "TZ=JST-9",
- "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
-};
-#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
-
-/* Fail if mktime fails to convert a date in the spring-forward gap.
- Based on a problem report from Andreas Jaeger. */
-static void
-spring_forward_gap ()
-{
- /* glibc (up to about 1998-10-07) failed this test) */
- struct tm tm;
-
- /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
- instead of "TZ=America/Vancouver" in order to detect the bug even
- on systems that don't support the Olson extension, or don't have the
- full zoneinfo tables installed. */
- putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
- tm.tm_year = 98;
- tm.tm_mon = 3;
- tm.tm_mday = 5;
- tm.tm_hour = 2;
- tm.tm_min = 0;
- tm.tm_sec = 0;
- tm.tm_isdst = -1;
- if (mktime (&tm) == (time_t)-1)
- exit (1);
-}
-
-static void
-mktime_test (now)
- time_t now;
-{
- struct tm *lt;
- if ((lt = localtime (&now)) && mktime (lt) != now)
- exit (1);
- now = time_t_max - now;
- if ((lt = localtime (&now)) && mktime (lt) != now)
- exit (1);
-}
-
-static void
-irix_6_4_bug ()
-{
- /* Based on code from Ariel Faigon. */
- struct tm tm;
- tm.tm_year = 96;
- tm.tm_mon = 3;
- tm.tm_mday = 0;
- tm.tm_hour = 0;
- tm.tm_min = 0;
- tm.tm_sec = 0;
- tm.tm_isdst = -1;
- mktime (&tm);
- if (tm.tm_mon != 2 || tm.tm_mday != 31)
- exit (1);
-}
-
-static void
-bigtime_test (j)
- int j;
-{
- struct tm tm;
- time_t now;
- tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
- /* This test makes some buggy mktime implementations loop.
- Give up after 10 seconds. */
- alarm (10);
- now = mktime (&tm);
- alarm (0);
- if (now != (time_t) -1)
- {
- struct tm *lt = localtime (&now);
- if (! (lt
- && lt->tm_year == tm.tm_year
- && lt->tm_mon == tm.tm_mon
- && lt->tm_mday == tm.tm_mday
- && lt->tm_hour == tm.tm_hour
- && lt->tm_min == tm.tm_min
- && lt->tm_sec == tm.tm_sec
- && lt->tm_yday == tm.tm_yday
- && lt->tm_wday == tm.tm_wday
- && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
- == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
- exit (1);
- }
-}
-
-int
-main ()
-{
- time_t t, delta;
- int i, j;
-
- spring_forward_gap ();
- for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
- continue;
- time_t_max--;
- delta = time_t_max / 997; /* a suitable prime number */
- for (i = 0; i < N_STRINGS; i++)
- {
- if (tz_strings[i])
- putenv (tz_strings[i]);
-
- for (t = 0; t <= time_t_max - delta; t += delta)
- mktime_test (t);
- mktime_test ((time_t) 60 * 60);
- mktime_test ((time_t) 60 * 60 * 24);
-
- for (j = 1; 0 < j; j *= 2)
- bigtime_test (j);
- bigtime_test (j - 1);
- }
- irix_6_4_bug ();
- exit (0);
-}
- >>,
-changequote([, ])dnl
- jm_am_cv_func_working_mktime=yes, jm_am_cv_func_working_mktime=no,
- dnl When crosscompiling, assume mktime is missing or broken.
- jm_am_cv_func_working_mktime=no)
- ])
- if test $jm_am_cv_func_working_mktime = no; then
- LIBOBJS="$LIBOBJS mktime.o"
- fi
-])
diff --git a/m4/perl.m4 b/m4/perl.m4
deleted file mode 100644
index 7d6abc34..00000000
--- a/m4/perl.m4
+++ /dev/null
@@ -1,41 +0,0 @@
-#serial 2
-
-dnl From Jim Meyering.
-dnl Find a new-enough version of Perl.
-dnl
-
-AC_DEFUN(jm_PERL,
-[
- dnl FIXME: don't hard-code 5.003
- dnl FIXME: should we cache the result?
- AC_MSG_CHECKING([for perl5.003 or newer])
- if test "${PERL+set}" = set; then
- # `PERL' is set in the user's environment.
- candidate_perl_names="$PERL"
- perl_specified=yes
- else
- candidate_perl_names='perl perl5'
- perl_specified=no
- fi
-
- found=no
- AC_SUBST(PERL)
- PERL="$missing_dir/missing perl"
- for perl in $candidate_perl_names; do
- # Run test in a subshell; some versions of sh will print an error if
- # an executable is not found, even if stderr is redirected.
- if ( $perl -e 'require 5.003; use File::Compare' ) > /dev/null 2>&1; then
- PERL=$perl
- found=yes
- break
- fi
- done
-
- AC_MSG_RESULT($found)
- test $found = no && AC_MSG_WARN([
-*** You don't seem to have perl5.003 or newer installed, or you lack
-*** a usable version of the Perl File::Compare module. As a result,
-*** you may be unable to run a few tests or to regenerate certain
-*** files if you modify the sources from which they are derived.
-] )
-])
diff --git a/m4/prereq.m4 b/m4/prereq.m4
index 790adafe..f822efc7 100644
--- a/m4/prereq.m4
+++ b/m4/prereq.m4
@@ -1,15 +1,72 @@
-#serial 2
+#serial 5
dnl These are the prerequisite macros for files in the lib/
dnl directories of the fileutils, sh-utils, and textutils packages.
AC_DEFUN(jm_PREREQ,
[
+ jm_PREREQ_ADDEXT
+ jm_PREREQ_CANON_HOST
jm_PREREQ_ERROR
+ jm_PREREQ_QUOTEARG
+ jm_PREREQ_READUTMP
jm_PREREQ_REGEX
])
-dnl FIXME: maybe put this in a separate file
+AC_DEFUN(jm_PREREQ_ADDEXT,
+[
+ dnl For addext.c.
+ AC_SYS_LONG_FILE_NAMES
+ AC_CHECK_FUNCS(pathconf)
+ AC_CHECK_HEADERS(limits.h string.h unistd.h)
+])
+
+AC_DEFUN(jm_PREREQ_CANON_HOST,
+[
+ dnl Add any libraries as early as possible.
+ dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
+ dnl so we have to add -lnsl to LIBS before checking for that function.
+ AC_SEARCH_LIBS(gethostbyname, [inet nsl])
+
+ dnl These come from -lnsl on Solaris5.5.1.
+ AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
+
+ AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
+ AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
+ netinet/in.h arpa/inet.h)
+])
+
+AC_DEFUN(jm_PREREQ_QUOTEARG,
+[
+ AC_CHECK_FUNCS(isascii mbrtowc)
+ AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
+ AC_HEADER_STDC
+ AC_C_BACKSLASH_A
+ AM_C_PROTOTYPES
+])
+
+AC_DEFUN(jm_PREREQ_READUTMP,
+[
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS(string.h utmpx.h sys/param.h)
+ AC_CHECK_FUNCS(utmpname)
+ AC_CHECK_FUNCS(utmpxname)
+ AM_C_PROTOTYPES
+
+ utmp_includes="\
+$ac_includes_default
+#ifdef HAVE_UTMPX_H
+# include <utmpx.h>
+#else
+# include <utmp.h>
+#endif
+"
+ AC_CHECK_MEMBERS((struct utmpx.ut_user),,,[$utmp_includes])
+ AC_CHECK_MEMBERS((struct utmp.ut_user),,,[$utmp_includes])
+ AC_CHECK_MEMBERS((struct utmpx.ut_name),,,[$utmp_includes])
+ AC_CHECK_MEMBERS((struct utmp.ut_name),,,[$utmp_includes])
+])
+
AC_DEFUN(jm_PREREQ_REGEX,
[
dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
diff --git a/m4/putenv.m4 b/m4/putenv.m4
deleted file mode 100644
index f9fcc8cd..00000000
--- a/m4/putenv.m4
+++ /dev/null
@@ -1,41 +0,0 @@
-#serial 3
-
-dnl From Jim Meyering.
-dnl
-dnl Check whether putenv ("FOO") removes FOO from the environment.
-dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
-dnl
-
-AC_DEFUN(jm_FUNC_PUTENV,
-[AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
- [AC_TRY_RUN([
- int
- main ()
- {
- /* Put it in env. */
- if (putenv ("CONFTEST_putenv=val"))
- exit (1);
-
- /* Try to remove it. */
- if (putenv ("CONFTEST_putenv"))
- exit (1);
-
- /* Make sure it was deleted. */
- if (getenv ("CONFTEST_putenv") != 0)
- exit (1);
-
- exit (0);
- }
- ],
- jm_cv_func_svid_putenv=yes,
- jm_cv_func_svid_putenv=no,
- dnl When crosscompiling, assume putenv is broken.
- jm_cv_func_svid_putenv=no)
- ])
- if test $jm_cv_func_svid_putenv = no; then
- AC_SUBST(LIBOBJS)
- LIBOBJS="$LIBOBJS putenv.$ac_objext"
- AC_DEFINE_UNQUOTED(putenv, rpl_putenv,
- [Define to rpl_putenv if the replacement function should be used.])
- fi
-])
diff --git a/m4/readdir.m4 b/m4/readdir.m4
index 74616d46..d851b0fe 100644
--- a/m4/readdir.m4
+++ b/m4/readdir.m4
@@ -1,4 +1,4 @@
-#serial 2
+#serial 3
dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
dnl to test whether a NULL return value really means there are no more files
@@ -23,9 +23,7 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir,
ac_clean_files="$ac_clean_files conf-dir"
AC_TRY_RUN(
- changequote(<<, >>)dnl
- <<
-# include <stdio.h>
+[# include <stdio.h>
# include <sys/types.h>
# if HAVE_STRING_H
# include <string.h>
@@ -119,9 +117,7 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir,
create_300_file_dir (dir);
remove_dir (dir);
exit (0);
- }
- >>,
- changequote([, ])dnl
+ }],
jm_cv_func_working_readdir=yes,
jm_cv_func_working_readdir=no,
jm_cv_func_working_readdir=no)])
diff --git a/m4/regex.m4 b/m4/regex.m4
index 3047d4d4..c8194b21 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,4 +1,4 @@
-#serial 5
+#serial 7
dnl Initially derived from code in GNU grep.
dnl Mostly written by Jim Meyering.
@@ -16,14 +16,12 @@ AC_DEFUN(jm_INCLUDED_REGEX,
# However, if the system regex support is good enough that it passes the
# the following run test, then default to *not* using the included regex.c.
# If cross compiling, assume the test would fail and use the included
- # regex.c. The failing regular expression is from `Spencer ere test #75'
- # in grep-2.3.
+ # regex.c. The first failing regular expression is from `Spencer ere
+ # test #75' in grep-2.3.
AC_CACHE_CHECK([for working re_compile_pattern],
jm_cv_func_working_re_compile_pattern,
AC_TRY_RUN(
- changequote(<<, >>)dnl
- <<
-#include <stdio.h>
+[#include <stdio.h>
#include <regex.h>
int
main ()
@@ -35,11 +33,15 @@ AC_DEFUN(jm_INCLUDED_REGEX,
three right ones below. Otherwise autoconf-2.14 chokes. */
s = re_compile_pattern ("a[[:]:]]b\n", 9, &regex);
/* This should fail with _Invalid character class name_ error. */
- exit (s ? 0 : 1);
- }
- >>,
- changequote([, ])dnl
+ if (!s)
+ exit (1);
+
+ /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
+ s = re_compile_pattern ("{1", 2, &regex);
+ exit (s ? 1 : 0);
+ }
+ ],
jm_cv_func_working_re_compile_pattern=yes,
jm_cv_func_working_re_compile_pattern=no,
dnl When crosscompiling, assume it's broken.
diff --git a/m4/strftime.m4 b/m4/strftime.m4
index 12972166..c389a322 100644
--- a/m4/strftime.m4
+++ b/m4/strftime.m4
@@ -1,4 +1,4 @@
-#serial 8
+#serial 9
dnl This macro is intended to be used solely in this file.
dnl These are the prerequisite macros for GNU's strftime.c replacement.
@@ -35,9 +35,12 @@ AC_DEFUN(jm_FUNC_GNU_STRFTIME,
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_CHECK_HEADERS(sys/time.h)
AC_CACHE_CHECK([for working GNU strftime], jm_cv_func_working_gnu_strftime,
- [AC_TRY_RUN(
-changequote(<<, >>)dnl
-<< /* Ulrich Drepper provided parts of the test program. */
+ [# Set TZ to GMT0 to make strftime give consistent results during the test.
+ ac_save_TZ="${TZ-GMT0}"
+ TZ=GMT0
+ export TZ
+ AC_TRY_RUN(
+[ /* Ulrich Drepper provided parts of the test program. */
#if STDC_HEADERS
# include <stdlib.h>
#endif
@@ -77,10 +80,6 @@ main ()
time_t t = 738367; /* Fri Jan 9 13:06:07 1970 */
tm = gmtime (&t);
- /* This is necessary to make strftime give consistent zone strings and
- e.g., seconds since the epoch (%s). */
- putenv ("TZ=GMT0");
-
#undef CMP
#define CMP(Fmt, Expected) n_fail += compare ((Fmt), tm, (Expected))
@@ -134,13 +133,13 @@ main ()
CMP ("%z", "+0000"); /* GNU */
exit (n_fail ? 1 : 0);
-}
- >>,
-changequote([, ])dnl
+}],
jm_cv_func_working_gnu_strftime=yes,
jm_cv_func_working_gnu_strftime=no,
dnl When crosscompiling, assume strftime is missing or broken.
jm_cv_func_working_gnu_strftime=no)
+ dnl If TZ wasn't set before, this sets it to GMT0. No real harm done.
+ TZ="$ac_save_TZ"
])
if test $jm_cv_func_working_gnu_strftime = no; then
AC_SUBST(LIBOBJS)
diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4
index 9251d1ee..222beffa 100644
--- a/m4/uintmax_t.m4
+++ b/m4/uintmax_t.m4
@@ -1,8 +1,8 @@
-#serial 4
+#serial 5
dnl From Paul Eggert.
-AC_PREREQ(2.14a)
+AC_PREREQ(2.13)
# Define uintmax_t to `unsigned long' or `unsigned long long'
# if <inttypes.h> does not exist.
@@ -16,7 +16,7 @@ AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
&& ac_type='unsigned long long' \
|| ac_type='unsigned long'
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
-[ Define to `unsigned long' or `unsigned long long'
+[ Define to unsigned long or unsigned long long
if <inttypes.h> doesn't define.])
fi
])
diff --git a/m4/uptime.m4 b/m4/uptime.m4
deleted file mode 100644
index 86570fa3..00000000
--- a/m4/uptime.m4
+++ /dev/null
@@ -1,18 +0,0 @@
-#serial 2
-
-AC_PREREQ(2.13)
-
-AC_DEFUN(jm_SYS_PROC_UPTIME,
-[ dnl Require AC_PROG_CC to see if we're cross compiling.
- AC_REQUIRE([AC_PROG_CC])
- AC_CACHE_CHECK([for /proc/uptime], jm_cv_have_proc_uptime,
- [jm_cv_have_proc_uptime=no
- test -f /proc/uptime \
- && test $ac_cv_prog_cc_cross = no \
- && cat < /proc/uptime >/dev/null 2>/dev/null \
- && jm_cv_have_proc_uptime=yes])
- if test $jm_cv_have_proc_uptime = yes; then
- AC_DEFINE(HAVE_PROC_UPTIME, 1,
- [ Define if your system has the /proc/uptime special file.])
- fi
-])
diff --git a/m4/utimbuf.m4 b/m4/utimbuf.m4
deleted file mode 100644
index 14d77725..00000000
--- a/m4/utimbuf.m4
+++ /dev/null
@@ -1,40 +0,0 @@
-#serial 2
-
-dnl From Jim Meyering
-
-dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
-dnl usually in <utime.h>.
-dnl Some systems have utime.h but don't declare the struct anywhere.
-
-AC_DEFUN(jm_STRUCT_UTIMBUF,
-[
- AC_CHECK_HEADERS(utime.h)
- AC_REQUIRE([AC_HEADER_TIME])
- AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
- [AC_TRY_COMPILE(
- [
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef HAVE_UTIME_H
-# include <utime.h>
-#endif
- ],
- [static struct utimbuf x; x.actime = x.modtime;],
- fu_cv_sys_struct_utimbuf=yes,
- fu_cv_sys_struct_utimbuf=no)
- ])
-
- if test $fu_cv_sys_struct_utimbuf = yes; then
- AC_DEFINE_UNQUOTED(HAVE_STRUCT_UTIMBUF, 1,
-[Define if struct utimbuf is declared -- usually in <utime.h>.
- Some systems have utime.h but don't declare the struct anywhere. ])
- fi
-])
diff --git a/m4/utime.m4 b/m4/utime.m4
deleted file mode 100644
index 9fb587c8..00000000
--- a/m4/utime.m4
+++ /dev/null
@@ -1,18 +0,0 @@
-#serial 1
-
-dnl From Jim Meyering
-dnl Replace the utime function on systems that need it.
-
-dnl FIXME
-
-AC_DEFUN(jm_FUNC_UTIME,
-[
- AC_CHECK_HEADERS(utime.h)
- AC_REQUIRE([jm_STRUCT_UTIMBUF])
- AC_REQUIRE([AC_FUNC_UTIME_NULL])
-
- if test $ac_cv_func_utime_null = no; then
- jm_FUNC_UTIMES_NULL
- AC_REPLACE_FUNCS(utime)
- fi
-])
diff --git a/m4/utimes.m4 b/m4/utimes.m4
deleted file mode 100644
index f91e6885..00000000
--- a/m4/utimes.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-#serial 3
-
-dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
-dnl then do case-insensitive s/utime/utimes/.
-
-AC_DEFUN(jm_FUNC_UTIMES_NULL,
-[AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
-[rm -f conftestdata; > conftestdata
-AC_TRY_RUN([
-/* In case stat has been defined to rpl_stat, undef it here. */
-#undef stat
-#include <sys/types.h>
-#include <sys/stat.h>
-main() {
-struct stat s, t;
-exit(!(stat ("conftestdata", &s) == 0 && utimes("conftestdata", (long *)0) == 0
-&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
-&& t.st_mtime - s.st_mtime < 120));
-}],
- ac_cv_func_utimes_null=yes,
- ac_cv_func_utimes_null=no,
- ac_cv_func_utimes_null=no)
-rm -f core core.* *.core])
-
- if test $ac_cv_func_utimes_null = yes; then
- AC_DEFINE_UNQUOTED(HAVE_UTIMES_NULL, 1,
- [Define if utimes accepts a null argument])
- fi
- ]
-)
diff --git a/xargs/.cvsignore b/xargs/.cvsignore
index 7b0f96e3..9c3b7f01 100644
--- a/xargs/.cvsignore
+++ b/xargs/.cvsignore
@@ -1,4 +1,3 @@
.deps
Makefile
-Makefile.in
xargs
diff --git a/xargs/Makefile.in b/xargs/Makefile.in
index 82f7cc36..57d8017f 100644
--- a/xargs/Makefile.in
+++ b/xargs/Makefile.in
@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
+GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@@ -83,8 +85,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
+MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
+OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@@ -131,14 +136,14 @@ man1dir = $(mandir)/man1
MANS = $(man_MANS)
NROFF = nroff
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/xargs$U.Po
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-DEP_FILES = @AMDEP@ $(DEPDIR)/xargs$U.Po
SOURCES = xargs.c
OBJECTS = xargs$U.o
@@ -148,7 +153,7 @@ all: all-redirect
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu xargs/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -209,9 +214,61 @@ maintainer-clean-kr:
xargs: $(xargs_OBJECTS) $(xargs_DEPENDENCIES)
@rm -f xargs
$(LINK) $(xargs_LDFLAGS) $(xargs_OBJECTS) $(xargs_LDADD) $(LIBS)
+alloca_.c: alloca.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c
+error_.c: error.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > error_.c
+fileblocks_.c: fileblocks.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fileblocks_.c
+fnmatch_.c: fnmatch.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > fnmatch_.c
+lstat_.c: lstat.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > lstat_.c
+malloc_.c: malloc.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c
+memcmp_.c: memcmp.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcmp_.c
+memcpy_.c: memcpy.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcpy_.c
+memset_.c: memset.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memset_.c
+mktime_.c: mktime.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mktime_.c
+realloc_.c: realloc.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
+regex_.c: regex.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c
+stat_.c: stat.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
+stpcpy_.c: stpcpy.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c
+strdup_.c: strdup.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strdup_.c
+strftime_.c: strftime.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strftime_.c
+strncasecmp_.c: strncasecmp.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strncasecmp.c; then echo $(srcdir)/strncasecmp.c; else echo strncasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strncasecmp_.c
+strspn_.c: strspn.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strspn.c; then echo $(srcdir)/strspn.c; else echo strspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strspn_.c
+strstr_.c: strstr.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strstr_.c
+strtol_.c: strtol.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtol_.c
+strtoul_.c: strtoul.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoul_.c
+strtoull_.c: strtoull.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoull.c; then echo $(srcdir)/strtoull.c; else echo strtoull.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoull_.c
+strtoumax_.c: strtoumax.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c
+waitpid_.c: waitpid.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/waitpid.c; then echo $(srcdir)/waitpid.c; else echo waitpid.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > waitpid_.c
xargs_.c: xargs.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xargs.c; then echo $(srcdir)/xargs.c; else echo xargs.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xargs_.c
-xargs_.o : $(ANSI2KNR)
+alloca_.o error_.o fileblocks_.o fnmatch_.o lstat_.o malloc_.o \
+memcmp_.o memcpy_.o memset_.o mktime_.o realloc_.o regex_.o stat_.o \
+stpcpy_.o strdup_.o strftime_.o strncasecmp_.o strspn_.o strstr_.o \
+strtol_.o strtoul_.o strtoull_.o strtoumax_.o waitpid_.o xargs_.o : \
+$(ANSI2KNR)
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@@ -316,7 +373,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- mkid -f$$here/ID $$unique $(LISP)
+ mkid -fID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -345,17 +402,38 @@ distclean-tags:
maintainer-clean-tags:
+@AMDEP@include $(DEPDIR)/xargs$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
+
+
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir); \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
else \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
for subdir in $(SUBDIRS); do \
@@ -367,26 +445,6 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
-
-@AMDEP@include $(DEPDIR)/xargs$U.Po
-
-mostlyclean-depend:
-
-clean-depend:
-
-distclean-depend:
- -rm -rf $(DEPDIR)
-
-maintainer-clean-depend:
-
-@AMDEP@CCDEPMODE = @CCDEPMODE@
-
-.c.o:
-@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c -o $@ $<
-
info-am:
info: info-recursive
dvi-am:
@@ -462,14 +520,14 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir \
-mostlyclean-depend distclean-depend clean-depend \
-maintainer-clean-depend info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all install-strip installdirs-am installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+distclean-tags clean-tags maintainer-clean-tags mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend distdir info-am \
+info dvi-am dvi check check-am installcheck-am installcheck \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all install-strip \
+installdirs-am installdirs mostlyclean-generic distclean-generic \
+clean-generic maintainer-clean-generic clean mostlyclean distclean \
+maintainer-clean
$(PROGRAMS): ../find/version.o ../lib/libfind.a
diff --git a/xargs/testsuite/.cvsignore b/xargs/testsuite/.cvsignore
index 282522db..f3c7a7c5 100644
--- a/xargs/testsuite/.cvsignore
+++ b/xargs/testsuite/.cvsignore
@@ -1,2 +1 @@
Makefile
-Makefile.in
diff --git a/xargs/testsuite/Makefile.in b/xargs/testsuite/Makefile.in
index aa66341a..6fb6578a 100644
--- a/xargs/testsuite/Makefile.in
+++ b/xargs/testsuite/Makefile.in
@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -31,8 +31,6 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-DESTDIR =
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -59,6 +57,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
@SET_MAKE@
+host_alias = @host_alias@
+host_triplet = @host@
AMDEP = @AMDEP@
AMTAR = @AMTAR@
AWK = @AWK@
@@ -70,7 +70,9 @@ CXX = @CXX@
CXXCPP = @CXXCPP@
DATADIRNAME = @DATADIRNAME@
DEPDIR = @DEPDIR@
+DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
+GETCONF = @GETCONF@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GNU_PACKAGE = @GNU_PACKAGE@
@@ -84,8 +86,11 @@ INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAKEINFO = @MAKEINFO@
+MAN = @MAN@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
+OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
@@ -149,20 +154,20 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
+EXPECT = expect
+RUNTEST = runtest
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
-EXPECT = expect
-RUNTEST = runtest
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu xargs/testsuite/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -170,23 +175,6 @@ tags: TAGS
TAGS:
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-distdir: $(DISTFILES)
- $(mkinstalldirs) $(distdir)/config $(distdir)/inputs \
- $(distdir)/xargs.gnu $(distdir)/xargs.posix \
- $(distdir)/xargs.sysv
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir); \
- else \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
- fi; \
- done
-
RUNTESTFLAGS =
RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir
@@ -208,10 +196,30 @@ site.exp: Makefile
@echo 'set tool $(DEJATOOL)' >> $@-t
@echo 'set srcdir $(srcdir)' >> $@-t
@echo 'set objdir' `pwd` >> $@-t
+ @echo 'set host_alias $(host_alias)' >> $@-t
+ @echo 'set host_triplet $(host_triplet)' >> $@-t
@echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
@test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
@test ! -f site.exp || mv site.exp site.bak
@mv $@-t site.exp
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+distdir: $(DISTFILES)
+ $(mkinstalldirs) $(distdir)/config $(distdir)/inputs \
+ $(distdir)/xargs.gnu $(distdir)/xargs.posix \
+ $(distdir)/xargs.sysv
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pR $$d/$$file $(distdir) \
+ || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
info-am:
info: info-am
dvi-am:
@@ -268,7 +276,7 @@ maintainer-clean-am: maintainer-clean-generic distclean-am
maintainer-clean: maintainer-clean-am
-.PHONY: tags distdir check-DEJAGNU info-am info dvi-am dvi check \
+.PHONY: tags check-DEJAGNU distdir info-am info dvi-am dvi check \
check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
diff --git a/xargs/xargs.c b/xargs/xargs.c
index 505103e2..cd2d1a2f 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -1,5 +1,5 @@
/* xargs -- build and execute command lines from standard input
- Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -834,9 +834,9 @@ wait_for_proc (boolean all)
{
pid_t pid;
- pid = wait (&status);
- if (pid < 0)
- error (1, errno, _("error waiting for child process"));
+ while ((pid = wait (&status)) == (pid_t) -1)
+ if (errno != EINTR)
+ error (1, errno, _("error waiting for child process"));
/* Find the entry in `pids' for the child process
that exited. */