Imported Upstream version 1.5 upstream/1.5
authorBdale Garbee <bdale@gag.com>
Tue, 19 Jun 2012 19:57:35 +0000 (13:57 -0600)
committerBdale Garbee <bdale@gag.com>
Tue, 19 Jun 2012 19:57:35 +0000 (13:57 -0600)
505 files changed:
.tarball-version
ChangeLog
ChangeLog-2007
GNUmakefile
INSTALL
Makefile.am
Makefile.in
NEWS
README
README-release [new file with mode: 0644]
THANKS
TODO
aclocal.m4
algorithm.doc
amiga/Makefile.gcc [deleted file]
amiga/Makefile.sasc [deleted file]
amiga/match.a [deleted file]
amiga/tailor.c [deleted file]
amiga/utime.h [deleted file]
atari/Makefile.st [deleted file]
bits.c
build-aux/announce-gen
build-aux/arg-nonnull.h [deleted file]
build-aux/compile
build-aux/config.guess
build-aux/config.rpath [new file with mode: 0755]
build-aux/config.sub
build-aux/depcomp
build-aux/do-release-commit-and-tag [new file with mode: 0755]
build-aux/gendocs.sh
build-aux/git-version-gen
build-aux/gitlog-to-changelog
build-aux/gnu-web-doc-update
build-aux/gnupload
build-aux/install-sh
build-aux/link-warning.h [deleted file]
build-aux/mdate-sh
build-aux/missing
build-aux/snippet/_Noreturn.h [new file with mode: 0644]
build-aux/snippet/arg-nonnull.h [new file with mode: 0644]
build-aux/snippet/c++defs.h [new file with mode: 0644]
build-aux/snippet/unused-parameter.h [new file with mode: 0644]
build-aux/snippet/warn-on-use.h [new file with mode: 0644]
build-aux/test-driver [new file with mode: 0755]
build-aux/texinfo.tex
build-aux/update-copyright
build-aux/useless-if-before-free
build-aux/vc-list-files
build-aux/warn-on-use.h [deleted file]
cfg.mk [new file with mode: 0644]
configure
configure.ac
crypt.c [deleted file]
crypt.h [deleted file]
deflate.c
dist-check.mk [new file with mode: 0644]
doc/Makefile.am
doc/Makefile.in
doc/fdl.texi
doc/gzip.info
doc/gzip.texi
doc/stamp-vti
doc/version.texi
gunzip.in
gzexe.in
gzip.1
gzip.c
gzip.doc
gzip.h
inflate.c
lib/Makefile.am
lib/Makefile.in
lib/alloca.in.h
lib/asnprintf.c
lib/at-func.c [deleted file]
lib/basename-lgpl.c
lib/c-ctype.c [new file with mode: 0644]
lib/c-ctype.h [new file with mode: 0644]
lib/c-strcase.h [new file with mode: 0644]
lib/c-strcasecmp.c [new file with mode: 0644]
lib/c-strcaseeq.h [new file with mode: 0644]
lib/c-strncasecmp.c [new file with mode: 0644]
lib/calloc.c
lib/chdir-long.c
lib/chdir-long.h
lib/chown.c [deleted file]
lib/cloexec.c [new file with mode: 0644]
lib/cloexec.h [new file with mode: 0644]
lib/close-hook.c [deleted file]
lib/close-hook.h [deleted file]
lib/close-stream.c
lib/close.c
lib/closedir.c [new file with mode: 0644]
lib/closein.c
lib/closein.h
lib/closeout.c
lib/closeout.h
lib/config.charset
lib/config.hin
lib/creat-safer.c
lib/dirent--.h [new file with mode: 0644]
lib/dirent-private.h [new file with mode: 0644]
lib/dirent-safer.h [new file with mode: 0644]
lib/dirent.in.h
lib/dirfd.c
lib/dirname-lgpl.c
lib/dirname.h
lib/dosname.h [new file with mode: 0644]
lib/dup-safer.c
lib/dup.c [new file with mode: 0644]
lib/dup2.c
lib/errno.in.h
lib/error.c
lib/error.h
lib/exitfail.c
lib/exitfail.h
lib/fchdir.c
lib/fchmodat.c [deleted file]
lib/fchown-stub.c [deleted file]
lib/fchownat.c [deleted file]
lib/fclose.c
lib/fcntl--.h
lib/fcntl-safer.h
lib/fcntl.c
lib/fcntl.in.h
lib/fd-hook.c [new file with mode: 0644]
lib/fd-hook.h [new file with mode: 0644]
lib/fd-safer.c
lib/fdopendir.c
lib/fflush.c
lib/filename.h [new file with mode: 0644]
lib/filenamecat-lgpl.c [new file with mode: 0644]
lib/filenamecat.h [new file with mode: 0644]
lib/float+.h
lib/float.c [new file with mode: 0644]
lib/float.in.h
lib/fpending.c
lib/fpending.h
lib/fprintf.c
lib/fpucw.h
lib/fpurge.c
lib/freadahead.c
lib/freadahead.h
lib/freading.c
lib/freading.h
lib/frexp.c
lib/frexpl.c
lib/fseek.c [new file with mode: 0644]
lib/fseeko.c
lib/fseterr.c
lib/fseterr.h
lib/fstat.c [new file with mode: 0644]
lib/fstatat.c [deleted file]
lib/ftell.c [new file with mode: 0644]
lib/ftello.c
lib/getcwd-lgpl.c [new file with mode: 0644]
lib/getcwd.c [deleted file]
lib/getdtablesize.c [new file with mode: 0644]
lib/getopt.c
lib/getopt.in.h
lib/getopt1.c
lib/getopt_int.h
lib/gettext.h
lib/gettime.c
lib/gettimeofday.c
lib/glthread/lock.c [new file with mode: 0644]
lib/glthread/lock.h [new file with mode: 0644]
lib/glthread/threadlib.c [new file with mode: 0644]
lib/gnulib.mk
lib/ignore-value.h
lib/intprops.h
lib/isnan.c
lib/isnand-nolibm.h
lib/isnand.c
lib/isnanf-nolibm.h
lib/isnanf.c
lib/isnanl-nolibm.h
lib/isnanl.c
lib/itold.c [new file with mode: 0644]
lib/lchown.c [deleted file]
lib/localcharset.c
lib/localcharset.h
lib/lseek.c
lib/lstat.c
lib/malloc.c
lib/match.c
lib/math.in.h
lib/mbrtowc.c
lib/mbsinit.c
lib/memchr.c
lib/mempcpy.c
lib/memrchr.c
lib/mkdir.c [deleted file]
lib/mkdirat.c [deleted file]
lib/msvc-inval.c [new file with mode: 0644]
lib/msvc-inval.h [new file with mode: 0644]
lib/msvc-nothrow.c [new file with mode: 0644]
lib/msvc-nothrow.h [new file with mode: 0644]
lib/open-safer.c
lib/open.c
lib/openat-die.c
lib/openat-priv.h
lib/openat-proc.c
lib/openat.c
lib/openat.h
lib/opendir-safer.c [new file with mode: 0644]
lib/opendir.c [new file with mode: 0644]
lib/pathmax.h [new file with mode: 0644]
lib/perror.c
lib/pipe-safer.c
lib/printf-args.c
lib/printf-args.h
lib/printf-frexp.c
lib/printf-frexp.h
lib/printf-frexpl.c
lib/printf-frexpl.h
lib/printf-parse.c
lib/printf-parse.h
lib/printf.c
lib/quote.h [new file with mode: 0644]
lib/quotearg.c
lib/quotearg.h
lib/readdir.c [new file with mode: 0644]
lib/realloc.c
lib/ref-add.sin
lib/ref-del.sin
lib/rmdir.c [deleted file]
lib/same-inode.h [deleted file]
lib/save-cwd.c
lib/save-cwd.h
lib/savedir.c [new file with mode: 0644]
lib/savedir.h [new file with mode: 0644]
lib/signbitd.c
lib/signbitf.c
lib/signbitl.c
lib/size_max.h
lib/stat-time.h
lib/stat.c
lib/stdbool.in.h
lib/stddef.in.h
lib/stdint.in.h
lib/stdio-impl.h
lib/stdio-write.c [deleted file]
lib/stdio.in.h
lib/stdlib.in.h
lib/strdup.c
lib/streq.h
lib/strerror-override.c [new file with mode: 0644]
lib/strerror-override.h [new file with mode: 0644]
lib/strerror.c
lib/strerror_r.c [new file with mode: 0644]
lib/string.in.h
lib/stripslash.c
lib/sys_stat.in.h
lib/sys_time.in.h
lib/sys_types.in.h [new file with mode: 0644]
lib/time.in.h
lib/timespec.h
lib/unistd--.h
lib/unistd-safer.h
lib/unistd.in.h
lib/unlink.c [deleted file]
lib/unlinkat.c [deleted file]
lib/utimens.c
lib/utimens.h
lib/vasnprintf.c
lib/vasnprintf.h
lib/verify.h
lib/vfprintf.c
lib/wchar.in.h
lib/wctype.in.h
lib/xalloc-die.c
lib/xalloc-oversized.h [new file with mode: 0644]
lib/xalloc.h
lib/xgetcwd.c [deleted file]
lib/xgetcwd.h [deleted file]
lib/xmalloc.c
lib/xsize.h
lib/yesno.c
lib/yesno.h
lzw.h
m4/00gnulib.m4
m4/alloca.m4
m4/asm-underscore.m4 [new file with mode: 0644]
m4/calloc.m4
m4/chdir-long.m4
m4/chown.m4 [deleted file]
m4/clock_time.m4
m4/close-stream.m4
m4/close.m4
m4/closedir.m4 [new file with mode: 0644]
m4/closein.m4
m4/closeout.m4
m4/codeset.m4
m4/configmake.m4 [new file with mode: 0644]
m4/d-ino.m4 [deleted file]
m4/dirent-safer.m4 [new file with mode: 0644]
m4/dirent_h.m4
m4/dirfd.m4
m4/dirname.m4
m4/dos.m4 [deleted file]
m4/double-slash-root.m4
m4/dup.m4 [new file with mode: 0644]
m4/dup2.m4
m4/errno_h.m4
m4/error.m4
m4/exitfail.m4 [deleted file]
m4/exponentd.m4
m4/exponentf.m4
m4/exponentl.m4
m4/extensions.m4
m4/fchdir.m4
m4/fclose.m4
m4/fcntl-o.m4
m4/fcntl-safer.m4
m4/fcntl.m4
m4/fcntl_h.m4
m4/fdopendir.m4
m4/fflush.m4
m4/filenamecat.m4 [new file with mode: 0644]
m4/float_h.m4
m4/fpending.m4
m4/fpieee.m4
m4/fprintf-posix.m4
m4/fpurge.m4
m4/freading.m4
m4/frexp.m4
m4/frexpl.m4
m4/fseek.m4 [new file with mode: 0644]
m4/fseeko.m4
m4/fstat.m4 [new file with mode: 0644]
m4/ftell.m4 [new file with mode: 0644]
m4/ftello.m4
m4/getcwd-abort-bug.m4 [deleted file]
m4/getcwd-path-max.m4 [deleted file]
m4/getcwd.m4
m4/getdtablesize.m4 [new file with mode: 0644]
m4/getopt.m4
m4/gettime.m4
m4/gettimeofday.m4
m4/glibc21.m4
m4/gnu-make.m4
m4/gnulib-common.m4
m4/gnulib-comp.m4
m4/include_next.m4
m4/inline.m4
m4/intmax_t.m4
m4/inttypes_h.m4
m4/isnand.m4
m4/isnanf.m4
m4/isnanl.m4
m4/largefile.m4 [new file with mode: 0644]
m4/lchown.m4 [deleted file]
m4/ldexpl.m4
m4/lib-ignore.m4 [new file with mode: 0644]
m4/lib-ld.m4 [new file with mode: 0644]
m4/lib-link.m4 [new file with mode: 0644]
m4/lib-prefix.m4 [new file with mode: 0644]
m4/localcharset.m4
m4/locale-fr.m4
m4/locale-ja.m4
m4/locale-zh.m4
m4/lock.m4 [new file with mode: 0644]
m4/longlong.m4
m4/lseek.m4
m4/lstat.m4
m4/malloc.m4
m4/manywarnings.m4
m4/math_h.m4
m4/mbrtowc.m4
m4/mbsinit.m4
m4/mbstate_t.m4
m4/memchr.m4
m4/mempcpy.m4
m4/memrchr.m4
m4/mkdir.m4 [deleted file]
m4/mmap-anon.m4
m4/mode_t.m4
m4/msvc-inval.m4 [new file with mode: 0644]
m4/msvc-nothrow.m4 [new file with mode: 0644]
m4/multiarch.m4
m4/nocrash.m4
m4/off_t.m4 [new file with mode: 0644]
m4/open.m4
m4/openat.m4
m4/opendir.m4 [new file with mode: 0644]
m4/pathmax.m4 [new file with mode: 0644]
m4/perror.m4
m4/printf-frexp.m4
m4/printf-frexpl.m4
m4/printf-posix-rpl.m4
m4/printf.m4
m4/quotearg.m4
m4/readdir.m4 [new file with mode: 0644]
m4/realloc.m4
m4/rmdir.m4 [deleted file]
m4/save-cwd.m4
m4/savedir.m4 [new file with mode: 0644]
m4/shell.m4
m4/signbit.m4
m4/size_max.m4
m4/ssize_t.m4 [new file with mode: 0644]
m4/stat-time.m4
m4/stat.m4
m4/stdbool.m4
m4/stddef_h.m4
m4/stdint.m4
m4/stdint_h.m4
m4/stdio_h.m4
m4/stdlib_h.m4
m4/strdup.m4
m4/strerror.m4
m4/strerror_r.m4 [new file with mode: 0644]
m4/string_h.m4
m4/sys_socket_h.m4 [new file with mode: 0644]
m4/sys_stat_h.m4
m4/sys_time_h.m4
m4/sys_types_h.m4 [new file with mode: 0644]
m4/threadlib.m4 [new file with mode: 0644]
m4/time_h.m4
m4/timespec.m4
m4/unistd-safer.m4
m4/unistd_h.m4
m4/unlink.m4 [deleted file]
m4/utimbuf.m4
m4/utimens.m4
m4/utimes.m4
m4/vasnprintf.m4
m4/vfprintf-posix.m4
m4/warn-on-use.m4
m4/warnings.m4
m4/wchar.m4 [deleted file]
m4/wchar_h.m4 [new file with mode: 0644]
m4/wchar_t.m4
m4/wctype.m4 [deleted file]
m4/wctype_h.m4 [new file with mode: 0644]
m4/wint_t.m4
m4/xalloc.m4
m4/xgetcwd.m4 [deleted file]
m4/xsize.m4
m4/yesno.m4
maint.mk
msdos/Makefile.bor [deleted file]
msdos/Makefile.djg [deleted file]
msdos/Makefile.msc [deleted file]
msdos/doturboc.bat [deleted file]
msdos/gzip.prj [deleted file]
msdos/match.asm [deleted file]
msdos/tailor.c [deleted file]
nt/Makefile.nt [deleted file]
os2/Makefile.os2 [deleted file]
os2/gzip.def [deleted file]
os2/gzip16.def [deleted file]
primos/build.cpl [deleted file]
primos/ci.opts [deleted file]
primos/include/errno.h [deleted file]
primos/include/fcntl.h [deleted file]
primos/include/stdlib.h [deleted file]
primos/include/sysStat.h [deleted file]
primos/include/sysTypes.h [deleted file]
primos/primos.c [deleted file]
primos/readme [deleted file]
revision.h
sample/zread.c
sample/ztouch
tailor.h
tests/Makefile.am [new file with mode: 0644]
tests/Makefile.in [new file with mode: 0644]
tests/helin-segv
tests/help-version [new file with mode: 0755]
tests/hufts [new file with mode: 0755]
tests/init.cfg [new file with mode: 0644]
tests/init.sh
tests/memcpy-abuse
tests/mixed [new file with mode: 0755]
tests/null-suffix-clobber [new file with mode: 0755]
tests/stdin [new file with mode: 0755]
tests/trailing-nul
tests/zdiff
tests/zgrep-f [changed mode: 0644->0755]
tests/zgrep-signal [new file with mode: 0755]
tests/znew-k [new file with mode: 0755]
trees.c
unlzh.c
unlzw.c
unpack.c
unzip.c
util.c
vms/Makefile.gcc [deleted file]
vms/Makefile.mms [deleted file]
vms/Makefile.vms [deleted file]
vms/Readme.vms [deleted file]
vms/gzip.hlp [deleted file]
vms/makegzip.com [deleted file]
vms/vms.c [deleted file]
zcat.in
zcmp.in
zdiff.in
zforce.in
zgrep.in
zip.c
zless.in
zmore.in
znew.1
znew.in

index c068b2447cc22327bcac3f4884de3b32025c5bb2..c239c60cba28a79a295acb60a122b8c46eb57271 100644 (file)
@@ -1 +1 @@
-1.4
+1.5
index f1f25ab210301c783ce32d17c1457a7550d909f3..ae6ed81f5b4adf203bb60f64c5f624b53a9bbb4d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,775 @@
+2012-06-17  Jim Meyering  <meyering@redhat.com>
+
+       version 1.5
+       * NEWS: Record release date.
+
+       build: update gnulib for fixed maint.mk
+
+       build: update gnulib submodule; bootstrap and init.sh, too
+       * cfg.mk: Exempt crufty tailor.h from its use of "#define off_t...".
+       * .gitignore, m4/.gitignore: Update semi-automatically (via bootstrap).
+
+2012-04-24  Paul Eggert  <eggert@cs.ucla.edu>
+
+       doc: document -rf change
+       * NEWS: Document the ZFS fix.
+
+       gzip: remove CLOSEDIR
+       * gzip.c (CLOSEDIR): Remove; no longer used.
+
+       gzip: port gzip -rf to ZFS
+       Problem reported privately by Rich Burridge.
+       * bootstrap.conf: Add savedir.
+       * gzip.c: Include <savedir.h>.
+       (_D_EXACT_NAMELEN): Remove.
+       (treat_dir): Use savedir rather than reading directory entries one
+       at a time, to avoid revisiting an already-compressed file when using
+       ZFS and the -rf flags are specified.
+       * lib/.gitignore, m4/.gitignore: Ignore savedir-related files.
+
+2012-03-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       gzip: fix nondeterministic compression results
+       Reported by Jakub Wilk in <http://bugs.debian.org/647522>.
+       * deflate.c (fill_window): Don't let garbage pollute the dictionary.
+
+2012-01-11  Jim Meyering  <meyering@redhat.com>
+
+       tests: make all test scripts executable; work with automake-1.12
+       * tests/Makefile.am (TESTS_ENVIRONMENT): Adapt to work with upcoming
+       automake-1.12.
+       * tests/mixed: Make executable.
+       * tests/zgrep-f: Likewise.
+       * tests/zgrep-signal: Likewise.
+       * tests/znew-k: Likewise.
+
+       build: accommodate newer bootstrap from gnulib
+       * bootstrap.conf (gnulib_tool_option_extras): Add both --symlink
+       and --makefile-name=gnulib.mk.
+       * bootstrap: Update from gnulib.
+       * tests/init.sh: Update from gnulib.
+       * lib/Makefile.am: Initialize all of the following so that
+       generated code in gnulib.mk may use += to append to those variables:
+       AM_CFLAGS, BUILT_SOURCES, CLEANFILES, EXTRA_DIST, MOSTLYCLEANDIRS,
+       MOSTLYCLEANFILES, SUFFIXES, noinst_LTLIBRARIES.
+
+2012-01-01  Jim Meyering  <meyering@redhat.com>
+
+       maint: update all copyright year number ranges
+       Run "make update-copyright".
+
+2011-12-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+       zless: decompress stdin too, if less 429 or later
+       * zless.in: Use LESSOPEN |- feature of less 429 or later.
+       Problem reported by Jeroen Roovers via Mike Frysinger in
+       <http://lists.gnu.org/archive/html/bug-gzip/2011-12/msg00006.html>.
+
+2011-11-29  Jim Meyering  <meyering@redhat.com>
+
+       build: update gnulib submodule to latest
+
+       build: accommodate gnulib's new warnings with --enable-gcc-warnings
+       * configure.ac (WERROR_CFLAGS): Disable two new warnings:
+       -Wno-format-nonliteral, -Wno-unsuffixed-float-constants.
+       * gzip.h (bi_reverse): Declare with _GL_ATTRIBUTE_CONST.
+       (gzip_base_name): Declare with _GL_ATTRIBUTE_PURE.
+
+2011-11-29  Jim Meyering  <meyering@redhat.com>
+
+       tests: use "compare exp out", not "compare out exp"
+       Likewise, when an empty file is expected, use "compare /dev/null out",
+       not "compare out /dev/null". I.e., specify the expected/desired contents
+       via the first file name.  Prompted by a suggestion from Bruno Haible
+       in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154
+
+       Run these commands:
+
+           git grep -l -E 'compare [^ ]+ exp' \
+             |xargs perl -pi -e 's/\b(compare) (\S+) (exp\S*)/$1 $3 $2/'
+           git grep -l -E 'compare [^ ]+ /dev/null' \
+             |xargs perl -pi -e 's,\b(compare) (\S+) (/dev/null),$1 $3 $2,'
+
+2011-11-05  Jim Meyering  <meyering@redhat.com>
+
+       build: update gnulib submodule to latest
+
+2011-11-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * tests/zgrep-signal: Don't assume exit status 141 on PIPE signal.
+       Problem reported by Eric Blake in
+       <http://lists.gnu.org/archive/html/bug-gzip/2011-11/msg00007.html>.
+
+2011-11-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * tests/zgrep-signal: Use perl instead of a nonportable shell trap.
+       Problem reported by Eric Blake in
+       <http://lists.gnu.org/archive/html/bug-gzip/2011-11/msg00005.html>.
+
+       * tests/zgrep-signal: Test for Fedora 15 signal bug.
+       Also, don't assume that SIGPIPE is SIG_DFL on entry.
+
+2011-11-02  Jim Meyering  <meyering@redhat.com>
+
+       build: update gnulib submodule to latest
+
+       tests: mixed: correct size-enumeration logic
+       * tests/mixed (sizes): Fix misplaced "&& break" that made us test
+       only with a size of 0, rather than all sizes in 0..64.
+
+       maint: avoid "make syntax-check" failure
+       * gzip.c (treat_stdin): Indent with spaces, not TABs.
+
+2011-11-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * gzip.c (treat_stdin): If quiet, be quiet with plain gzip -q.
+       Problem reported by Michaël Guitton in
+       <http://lists.gnu.org/archive/html/bug-gzip/2011-11/msg00000.html>.
+
+2011-08-10  Jim Meyering  <meyering@redhat.com>
+
+       maint: remove amiga, atari, msdos, nt, os2, vms sub-directories,
+       and all files therein.  This was proposed months prior, and no
+       one objected.
+       * amiga/Makefile.gcc: Remove file.
+       * amiga/Makefile.sasc: Likewise.
+       * amiga/match.a: Likewise.
+       * amiga/tailor.c: Likewise.
+       * amiga/utime.h: Likewise.
+       * atari/Makefile.st: Likewise.
+       * msdos/Makefile.bor: Likewise.
+       * msdos/Makefile.djg: Likewise.
+       * msdos/Makefile.msc: Likewise.
+       * msdos/doturboc.bat: Likewise.
+       * msdos/gzip.prj: Likewise.
+       * msdos/match.asm: Likewise.
+       * msdos/tailor.c: Likewise.
+       * nt/Makefile.nt: Likewise.
+       * os2/Makefile.os2: Likewise.
+       * os2/gzip.def: Likewise.
+       * os2/gzip16.def: Likewise.
+       * vms/Makefile.gcc: Likewise.
+       * vms/Makefile.mms: Likewise.
+       * vms/Makefile.vms: Likewise.
+       * vms/Readme.vms: Likewise.
+       * vms/gzip.hlp: Likewise.
+       * vms/makegzip.com: Likewise.
+       * vms/vms.c: Likewise.
+       * Makefile.am (EXTRA_DIST): Remove those file names.
+
+       build: use largefile module and update to latest gnulib
+       * configure.ac: Remove AC_SYS_LARGEFILE, subsumed by ...
+       * bootstrap.conf (gnulib_modules): ...this.  Use largefile module.
+       * gnulib: Update to latest.
+
+2011-07-12  Jim Meyering  <meyering@redhat.com>
+
+       maint: update init.sh and bootstrap from gnulib
+       * bootstrap: Update from gnulib.
+       * tests/init.sh: Update from gnulib.
+
+       maint: use gnulib's realloc-gnu and malloc-gnu modules
+       * bootstrap.conf (gnulib_modules): Use realloc-gnu and malloc-gnu,
+       rather than the now-deprecated realloc and malloc modules.
+
+       build: update gnulib submodule to latest
+
+2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * deflate.c: Export nice_match to assembler.
+       (static_unless_ASMV): New macro.
+       (nice_match): Use it.
+
+2011-06-08  Jim Meyering  <meyering@redhat.com>
+
+       build: fix "make syntax-check"
+       * cfg.mk (_gl_TS_unmarked_extern_vars): Add good_match.
+
+       build: avoid link failure: this time on i686 linux
+       * deflate.c (good_match): Must not be static, since it may
+       be used from lib/match.c.
+
+2011-05-14  Jim Meyering  <meyering@redhat.com>
+
+       build: avoid link failure on at least i386-FreeBSD7.2
+       * deflate.c (match_start, prev_length, max_chain_length): Do not
+       declare these as static.  On some types of system/arch, they are
+       used via match_.s.
+       * cfg.mk (_gl_TS_unmarked_extern_vars): Mark those three variables
+       as known-extern: match_start, prev_length, max_chain_length.
+
+2011-05-13  Jim Meyering  <meyering@redhat.com>
+
+       avoid new build failure on a system without <crypt.h>
+       * bits.c: Don't include "crypt.h", now that it's deleted.
+
+       maint: use gnulib's new readme-release module
+       * bootstrap.conf (gnulib_modules): Add readme-release.
+       (bootstrap_epilogue): Add the recommended perl one-liner.
+       * README-release: Remove file; it is now generated from gnulib.
+       * .gitignore: Add it.
+
+2011-05-09  Jim Meyering  <meyering@redhat.com>
+
+       build: update gnulib submodule to latest
+
+       maint: prepare for gnulib's new tight-scope syntax-check rule
+       * cfg.mk (_gl_TS_dir): Define.
+       (_gl_TS_unmarked_extern_vars): Define.
+
+       maint: declare many variables to be static
+       * deflate.c: Likewise.
+       * gzip.c: Likewise.
+       * gzip.h: Likewise.
+       * inflate.c: Likewise.
+       * trees.c: Likewise.
+       * unzip.c: Likewise.
+       * util.c: Likewise.
+
+       maint: remove crypt.[ch] stubs
+       * Makefile.am (gzip_SOURCES): Remove crypt.c
+       (EXTRA_DIST): Remove crypt.h
+       * crypt.c, crypt.h: Remove files.
+       * unpack.c: Don't #include "crypt.h"
+       * zip.c: Likewise
+       * util.c: Likewise.
+       * unzip.c: Likewise.
+
+       maint: limit scope of several functions
+       * deflate.c (longest_match): Move extern declaration into #if-ASMV block.
+       [!ASMV]: Define as static.
+       * inflate.c: Remove unnecessary prototypes.
+       ANSI-declify functions and declare them to be static.
+
+       maint: remove all uses of OF((...)) prototype-hiding macro
+       * bits.c: Remove all uses of OF.
+       * deflate.c: Likewise.
+       * gzip.c: Likewise.
+       * inflate.c: Likewise.
+       * lzw.h: Likewise.
+       * trees.c: Likewise.
+       * unlzh.c: Likewise.
+       * unpack.c: Likewise.
+       * util.c: Likewise.
+       * gzip.h: Likewise.
+       (OF): Remove its definition, too.
+
+       maint: prepare for tight-scope rule: use noinst_HEADERS
+       * Makefile.am (EXTRA_DIST): Move lzw.h and gzip.h from here to ...
+       (noinst_HEADERS): ...here.
+       For convenience, since the tight-scope rule uses $(noinst_HEADERS).
+
+2011-04-14  Jim Meyering  <meyering@redhat.com>
+
+       maint: update bootstrap and init.sh from gnulib
+       * bootstrap: Likewise.
+       * tests/init.sh: Update from gnulib.
+
+       maint: note that we'll remove amiga, atari, msdos, nt, os2, vms soon
+       If someone can show that any of these are being used, let us know.
+       * TODO: Note the plan to remove those directories this year.
+
+       build: update gnulib submodule to latest
+
+       maint: fix typos in vms manual: s/it\nit/\nit/
+       * vms/gzip.hlp: Remove doubled "it".
+
+2011-04-10  Jim Meyering  <meyering@redhat.com>
+
+       maint: fix typos in comment: s/to to/to/
+       * deflate.c: Remove doubled 'to's.
+
+2011-03-20  Jim Meyering  <meyering@redhat.com>
+
+       maint: stop using .x-sc_* files to list syntax-check exemptions
+       Instead, use the new mechanism with which you merely use a
+       variable (derived from the rule name) defined in cfg.mk to an ERE
+       matching the exempted file names.
+       * gnulib: Update to latest, to get maint.mk that implements this.
+       * .x-sc_file_system: Remove file.
+       * .x-sc_prohibit_tab_based_indentation: Likewise.
+       * .x-sc_require_config_h: Likewise.
+       * .x-sc_require_config_h_first: Likewise.
+       * cfg.mk: Define variables to exempt the same files.
+
+2011-03-18  Jim Meyering  <meyering@redhat.com>
+
+       doc: correct README-release
+       * README-release: Remove mention of -announce mailing list.
+       Unlike coreutils, gzip does not have its own.
+
+       doc: update release procedure
+       * README-release: Resync from coreutils' file by the same name.
+
+2011-01-03  Jim Meyering  <meyering@redhat.com>
+
+       maint: update copyright year ranges to include 2011
+       Run "make update-copyright", so "make syntax-check" works in 2011.
+
+       build: update gnulib submodule to latest
+
+       maint: avoid failure of new test for bindtextdomain
+       * cfg.mk (local-checks-to-skip): Add sc_bindtextdomain.
+
+2010-12-02  Jim Meyering  <meyering@redhat.com>
+
+       maint: avoid "make syntax-check" failure due to old-NEWS modification
+       * cfg.mk (old_NEWS_hash): Update, to reflect recent NEWS correction.
+
+2010-12-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * NEWS: The "gzip -f foo.gz" change occurred in 1.3.13, not 1.3.12
+
+2010-11-10  Paul Eggert  <eggert@cs.ucla.edu>
+
+       zgrep: don't assume traditional behavior with signal numbers
+       * zgrep.in: Don't assume the exit status is the signal number plus
+       128, as POSIX doesn't require this.  No need to kill self; exiting
+       with large status is enough.  Propagate all exit statuses greater
+       than 1, not merely those in the range 129..143, as there's no need
+       to treat that range specially (and it's not portable anyway).
+
+2010-11-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       zgrep: fix shell portability bug with -f; fix mishandling of "-e -"
+       * tests/zgrep-f: Check for "zgrep -e -" bug, too.
+       * zgrep.in: Don't assume that if the shell redirects fd 6, then
+       this redirection is visible to the subsidiary grep.  POSIX doesn't
+       guarantee this visibility except for file descriptors 0, 1, and 2,
+       and ksh does not support it.  Problem reported by Thomas Schulz in
+       <http://lists.gnu.org/archive/html/bug-gzip/2010-11/msg00000.html>.
+       Also, fix a related bug: "-e -" was mishandled.  These two bugs
+       were introduced by commit 5b54db4546b84ec97ff57a62f8ddb98faacf77f2
+       dated 2009-10-09.
+       (escape): Change the convention: do not assume that a stray X
+       is present at the end of the last line.  All uses changed.
+       There was no longer any need for this convention, and fixing this
+       made it a bit easier to use 'sed' in a later part of the fix.
+
+2010-11-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       maint: fix copyright dates that were munged by a maintenance script
+       * gunzip.in, gzexe.in, zcat.in, zcmp.in, zdiff.in, zforce.in:
+       * zgrep.in, zless.in, zmore.in, znew.in:
+       A script went awry when updating copyright dates in gzip's shell
+       scripts.  It should update comments to look like "# Copyright (C)
+       2007, 2010 Free Software Foundation, Inc." (with a set of years)
+       and version messages to look like "Copyright (C) 2010 Free
+       Software Foundation, Inc." (with just the most-recent year).
+       Instead, it sometimes ignored one, sometimes the other, and
+       typically put ranges into version messages.  Fix all this stuff by
+       hand, using dates that I divined from the change logs (so they're
+       a bit more accurate than script-generated dates).  We need to fix
+       the script before it runs in 2011.
+
+2010-10-23  Jim Meyering  <meyering@redhat.com>
+
+       maint: anchor patterns in .gitignore files
+       * doc/.gitignore: Anchor patterns.
+       * lib/.gitignore: Likewise.
+       * m4/.gitignore: Likewise.
+
+       maint: update bootstrap and init.sh from gnulib
+       * bootstrap: Update.
+       * tests/init.sh: Update.
+
+2010-10-23  Rob Vermaas  <rob.vermaas@gmail.com>
+
+       maint: update to latest gnulib; use fdutimens, not gl_futimens
+       * gzip.c (copy_stat): Use fdutimens, not gl_futimens.
+       * gnulib: Update to latest.
+
+2010-10-23  Jim Meyering  <meyering@redhat.com>
+
+       maint: accommodate stricter syntax-check
+       Avoid #if, #define and #undef of always-defined symbols.
+       * gzip.c (ELOOP, SIGPIPE): Remove unneeded cpp directives.
+       * tailor.h (HAVE_DIRENT_H, HAVE_FCNTL_H, HAVE_UNISTD_H, MSDOS):
+       (O_BINARY): Likewise.
+
+       maint: make our use of gnulib's init.sh conform
+       * tests/help-version: Make use of init.sh conform.
+       * tests/helin-segv: Likewise.
+       * tests/help-version: Likewise.
+       * tests/hufts: Likewise.
+       * tests/memcpy-abuse: Likewise.
+       * tests/mixed: Likewise.
+       * tests/null-suffix-clobber: Likewise.
+       * tests/stdin: Likewise.
+       * tests/trailing-nul: Likewise.
+       * tests/zdiff: Likewise.
+       * tests/zgrep-f: Likewise.
+       * tests/zgrep-signal: Likewise.
+       * tests/znew-k: Likewise.
+
+2010-10-10  Jim Meyering  <meyering@redhat.com>
+
+       maint: describe policy on copyright year number ranges
+       * README: Mention coreutils' long-standing policy on use of M-N
+       ranges in copyright year lists.  Requested by Richard Stallman.
+
+2010-09-15  Paul Eggert  <eggert@cs.ucla.edu>
+
+       zgrep: fix parsing of -Eh options
+       * zgrep.in: Update list of single-letter options to match what's
+       in GNU grep.  Add -h as an alias for --no-filename.  Bug reported
+       by Vladimir Sidorenko in
+       <http://lists.gnu.org/archive/html/bug-gzip/2010-09/msg00007.html>.
+
+2010-08-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       gzip: fix NO_SIZE_CHECK for VMS
+       * gzip.c (do_list): Use if, not #if.
+       * tailor.h (NO_SIZE_CHECK) [defined(VAXC) || defined(VMS)]: Define.
+       * zip.c (zip): Simplify conditional, which was incorrect at any rate
+       for VMS.
+
+2010-08-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       algorithm.doc: mention Internet RFC 1952 and modernize a bit
+       * algorithm.doc: Update to mention header-CRC and Internet RFC 1952.
+       Also, remove the crypto stuff, which never worked.
+       Inspired by that same suggestion of Greg Roelofs.
+
+       gzip: Use 0x%04x instead of %x when printing 16-bit checksums
+       * gzip.c (get_method): Use 0x%04x, not %x, to print 16-bit checksums.
+       Inspired by a suggestion of Greg Roelofs in
+       http://lists.gnu.org/archive/html/bug-gzip/2010-08/msg00004.html
+
+2010-08-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       maint: update bootstrap
+       * bootstrap, bootstrap.conf, tests/init.sh: Merge from gnulib.
+
+2010-07-19  Paul R. Eggert  <eggert@cs.ucla.edu>
+
+       gzip: don't assume C99, and don't assume overlapping memcpy should work
+       * tailor.h (NOMEMCPY): Remove.  memcpy is entitled to not work
+       on overlapping blocks.
+       * inflate.c (inflate_codes): Don't put decl after statement.
+       Omit NOMEMCPY.
+
+       * gzip.c (get_method): don't assume size_t can be printed with %u
+
+2010-07-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Mention that gzip -d now handles FHCRC.
+
+2010-07-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Decode FHCRC flag properly, as per Internet RFC 1952.
+       Problem reported by Greg Roelofs in:
+       http://lists.gnu.org/archive/html/bug-gzip/2010-06/msg00003.html
+
+       * gzip.c (discard_input_bytes): New function.
+       (get_method): Check header checksum, if given.  We never generate it,
+       but other programs may.
+       * gzip.h (HEADER_CRC): Renamed from CONTINUATION.  All uses changed.
+       * tailor.h [defined __50SERIES]: Remove PRIMOS stuff that was obsolete
+       anyway and would have made this patch harder to maintain.
+       (get_char, put_char): Remove.
+       * zip.c (zip): Use put_byte instead of the now-removed put_char.
+
+2010-07-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Don't assume that sizeof (long) == 4 when computing statistics.
+       * gzip.c (get_method): Don't assume sizeof (long) == 4.
+       * zip.c (zip): Likewise.
+
+       Update Info-ZIP name and coordinates (thanks to Greg Roelofs).
+
+2010-05-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * doc/gzip.texi (Sample): Fix backslash quoting problem.
+       Problem reported by Ole Tange in
+       <http://lists.gnu.org/archive/html/bug-gzip/2010-05/msg00000.html>.
+
+2010-04-26  Jim Meyering  <meyering@redhat.com>
+
+       build: update gnulib submodule to latest
+
+       maint: remove primos support
+       * Makefile.am (EXTRA_DIST): Remove all primos/ files.
+       * primos/build.cpl: Remove file.
+       * primos/ci.opts: Likewise.
+       * primos/include/errno.h: Likewise.
+       * primos/include/fcntl.h: Likewise.
+       * primos/include/stdlib.h: Likewise.
+       * primos/include/sysStat.h: Likewise.
+       * primos/include/sysTypes.h: Likewise.
+       * primos/primos.c: Likewise.
+       * primos/readme: Likewise.
+
+2010-04-08  Jim Meyering  <meyering@redhat.com>
+
+       build: include cfg.mk in the distribution tarball
+       * Makefile.am (EXTRA_DIST): Add cfg.mk.
+
+2010-04-07  Eric Blake  <eblake@redhat.com>
+
+       maint: ignore more built files
+       * .gitignore: Add version files.
+
+2010-04-07  Jim Meyering  <meyering@redhat.com>
+
+       tests: help-version: cross-check PATH in tests
+       * tests/help-version: Cross-check $VERSION and --version output.
+       * tests/Makefile.am (TESTS_ENVIRONMENT): Export VERSION=$(VERSION).
+
+       tests: improve help-version
+       * tests/help-version: Use fail_, rather than echo+Exit.
+
+       tests: pull help-version from grep
+
+       build: keep --version strictly up to date
+       Before this change, in development, gzip's --version output could lag
+       behind reality by a couple deltas or by a "-dirty" suffix.  That would
+       lead to spurious failure of the new --version-$VERSION PATH cross-check.
+       * Makefile.am (version.c, version.h): New rules.
+       (BUILT_SOURCES): Set/append.
+       (noinst_LIBRARIES, noinst_libver_a_SOURCES): Define.
+       (gzip_LDADD): Add libver.a.
+       (DISTCLEANFILES): Define.
+       * gzip.c (license): Use Version, not VERSION.
+
+2010-04-06  Jim Meyering  <meyering@redhat.com>
+
+       tests: (portability) use st, not "status" as variable name
+       * tests/zgrep-signal: Do not use status as a variable name,
+       per autoconf's documentation that it is not portable to
+       some shells.
+
+       tests: s/framework_failure/framework_failure_/
+
+       tests: update init.sh from gnulib
+       * tests/init.sh: Update from gnulib.
+
+       tests: run most tests via tests/Makefile.am
+       * Makefile.am (SUBDIRS): List tests after ".".
+       Move most test-related things from here to ...
+       * tests/Makefile.am: ... here.
+       * configure.ac (AC_CONFIG_FILES): Add tests/Makefile.
+       * tests/helin-segv: Adjust.
+       * tests/help-version: Likewise.
+       * tests/hufts: Likewise.
+       * tests/memcpy-abuse: Likewise.
+       * tests/mixed: Likewise.
+       * tests/null-suffix-clobber: Likewise.
+       * tests/stdin: Likewise.
+       * tests/trailing-nul: Likewise.
+       * tests/zdiff: Likewise.
+       * tests/zgrep-f: Likewise.
+       * tests/zgrep-signal: Likewise.
+       * tests/znew-k: Likewise.
+
+       tests: skip tests that use grep's -f and -E options, if they don't work
+       * tests/init.cfg (require_grep_minus_f): New function.
+       * tests/zgrep-f: Use require_grep_minus_f.  Use path_prepend_.
+
+       tests: arrange for skip and failure notices to go to stderr, not .log
+       * tests/init.cfg: New file.  Make init.sh's stderr_fileno_ match
+       what the "exec 9>&2" we use in TESTS_ENVIRONMENT.
+       * Makefile.am (EXTRA_DIST): Add it.
+
+2010-04-06  Eric Blake  <eblake@redhat.com>
+
+       maint: ignore generated files
+       * .gitignore: Ignore recent gnulib additions.
+
+       maint: update bootstrap
+       * bootstrap: Use latest copy from gnulib/build-aux.
+
+2010-04-06  Jim Meyering  <meyering@redhat.com>
+
+       build: use gnulib's lib-ignore module
+       * bootstrap.conf (gnulib_modules): Add lib-ignore, in case it helps.
+       * Makefile.am (AM_LDFLAGS): Define it.
+
+       maint: let configure-invoked cpp emit diagnostics to config.log
+       * configure.ac: Do not discard CPP's stderr.
+
+       build: update gnulib submodule to latest, and adapt
+       * cfg.mk: Update to use new _sc_search_regexp interface.  Run this:
+       perl -pi -e 's/\b_prohibit_regexp\b/_sc_search_regexp/;'
+       -e 's/\bmsg=/halt=/; s/\bre=/prohibit=/;' cfg.mk
+       and then adjust backslashes so they still line up.
+       * cfg.mk (local-checks-to-skip): Add new sc_texinfo_acronym, to skip it.
+       * msdos/tailor.c (fcalloc): Mark a diagnostic for translation, to
+       placate stricter syntax-check, even though no one uses this file.
+
+       use assembly code matcher when possible
+       * configure.ac (ASCPPPOST): Backslash-escape "#" in AC_SUBST'd
+       variable, to keep make from seeing it as a comment-introducer.
+       Based on a patch by Petr Pisar.
+       * lib/Makefile.am (match.$(OBJEXT)): Use AM_V_GEN and AM_V_at.
+       * lib/match.c: Don't include <config.h>.
+       It would impede configure-time assembler test.
+       * .x-sc_require_config_h: Exempt lib/match.c from syntax-check.
+       * .x-sc_require_config_h_first: Likewise.
+
+2010-03-20  Jim Meyering  <meyering@redhat.com>
+
+       do not use stat.st_mtime of a non-regular file
+       * gzip.c: Include "timespec.h".
+       (treat_stdin): Use st_mtime only from a regular file.
+       This matters at least on Cygwin 1.7.1-1, for which a stdin-pipe has
+       the mtime of /dev/null, rather than the gzip-documented-for-pipes
+       "current time".  Reported by Denis Excoffier.
+
+2010-02-22  Jim Meyering  <meyering@redhat.com>
+
+       tests: exercise the fix for the decompression data-loss bug
+       * tests/null-suffix-clobber: New file.
+       * Makefile.am (TESTS): Add it.
+
+       gzip: fix a data-loss bug when decompressing with --suffix=''
+       * gzip.c (main): Disallow an empty --suffix=S also with -d.
+       Otherwise, "gzip -d -S '' F.gz" would ask if it's ok to remove the
+       existing file, "F.gz";  if you reply "yes", you'd lose all of that data.
+       Use of an empty suffix was already rejected in compression mode.
+       * gzip.1 (--suffix (-S)): Do not recommend to use "gunzip -S '' *".
+       Describe how the suffix is used when decompressing, too.
+       * NEWS (Bug fixes): mention the fix.
+       Reported by Ripduman Sohan.
+
+       tests: add ---presume-input-tty option, solely for testing
+       * gzip.c: Include <stdbool.h>.
+       (presume_input_tty): New global.
+       (main): Set it.
+       (treat_stdin, check_ofname): Use it.
+
+2010-02-07  Jim Meyering  <meyering@redhat.com>
+
+       doc: minor adjustment to README-release
+       * README-release: Tweak description, to sync from coreutils.
+
+       tests: add the help-version sanity tests from coreutils
+       * tests/help-version: New file, from coreutils.
+       * Makefile.am (TESTS): Add it.
+
+       tests: make distcheck invoke "make syntax-check" and other tests
+       * dist-check.mk: New file, from coreutils.
+       * cfg.mk: Include it.
+       * Makefile.am (distcheck-hook): New rule, to make us use it.
+
+       zcmp: consistently indicate failure with exit status of 2
+       * zcmp.in: Exit with status of 2 (not 1), when writing
+       --help or --version output fails, to be more like cmp.
+
+2010-02-04  Jim Meyering  <meyering@redhat.com>
+
+       tests: add more tests of gzip -cdf
+       * tests/mixed: Test "gzip -cdf" for a range of small uncompressed files.
+
+       tests: flip and adjust mixed test, now that the bug is fixed
+       * NEWS (Bug fixes): Mention the fix.
+       * Makefile.am (XFAIL_TESTS): Move tests/mixed from here...
+       (TESTS): ...to here.
+       * tests/mixed: Comment out the currently (always?) failing part.
+
+2010-02-04  Mark Adler  <madler@alumni.caltech.edu>
+
+       gzip -cdf now handles concatenation of gzip'd and uncompressed data
+       * util.c (copy): Change semantics so as to honor a decremented inptr.
+       * gzip.c (get_method): When needed (-cdf), decrement inptr rather
+       than clearing it -- and output the first magic byte.
+
+2010-02-04  Dmitry V. Levin  <ldv@altlinux.org>
+
+       zgrep: terminate gracefully when a pipeline is interrupted by a signal
+       zgrep is not terminated gracefully when its grep/sed pipeline
+       is terminated by a signal.  For example, a command like
+       zgrep -F .TH /usr/share/man/man1/*.gz | head
+       continues working long after the "head" process completes.
+       Another example, a command like
+       zgrep unmatched-pattern /usr/share/man/man1/*.gz
+       cannot be interrupted by sending a SIGQUIT with Ctrl-\ key, it outputs
+       zgrep: line 221: test: : integer expression expected
+       and goes on.
+       * zgrep.in: Terminate gracefully when the grep/sed pipeline is
+       terminated by a signal.
+       * tests/zgrep-signal: New test.
+       * Makefile.am (TESTS): Add it.
+
+2010-02-03  Jim Meyering  <meyering@redhat.com>
+
+       maint: teach "make syntax-check" the space-only indentation rule
+       * cfg.mk (sc_prohibit_tab_based_indentation): New rule, from coreutils.
+       (sc_prohibit_emacs__indent_tabs_mode__setting): Likewise.
+       * bootstrap: Remove "indent-tabs-mode: nil" directive.
+       * .x-sc_prohibit_tab_based_indentation: New file.
+
+       global: convert indentation-TABs to spaces
+       Transformed via this shell code:
+       t=$'\t'
+       git ls-files \
+         | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \
+         | grep -vE 'tests/pr/|help2man' \
+         | xargs grep -lE "^ *$t" \
+         | xargs perl -MText::Tabs -ni -le \
+           '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
+
+2010-02-03  Dmitry V. Levin  <ldv@altlinux.org>
+
+       wrapper scripts: write diagnostics to stderr, not to stdout
+       * zforce.in: In case of usage error, output short error diagnostics to
+       stderr instead of printing help text to stdout.
+       * zmore.in: Likewise.
+       * znew.in: Likewise.
+
+2010-02-03  Jim Meyering  <meyering@redhat.com>
+
+       gzip -cdf mishandles some concatenated input streams: test it
+       * tests/mixed: Exercise "gzip -cdf" bug.
+       * Makefile.am (XFAIL_TESTS): Add it.
+       Mark Adler reported the bug.
+
+       tests: move the hufts-segv test to its own file
+       * tests/hufts: New test.
+       * Makefile.am (TESTS): Add tests/
+       (check-local): Remove the hufts-segv test from this rule.
+
+       tests: begin moving tests into their own files
+       * Makefile.am (TESTS): Add tests/stdin.
+       (check-local): Move the stdin check to its own file:
+       * tests/stdin: New script.
+
+       tests: remove unnecessary use of "path_prepend_ ."
+       It is unnecessary, since Makefile.am's TESTS_ENVIRONMENT setting
+       already adds the top build directory, and besides, is only
+       marginally useful when running stand-alone, since it presumes
+       that the script is being run from the top build directory.
+       * tests/helin-segv: Remove unnecessary use of path_prepend_.
+       * tests/memcpy-abuse: Likewise.
+       * tests/trailing-nul: Likewise.
+       * tests/zdiff: Likewise.
+       * tests/zgrep-f: Likewise.
+
+       tests: note that znew-k test depends on length of temp file name
+       * tests/znew-k: Tweak diagnostic, factor and add a surprising comment.
+
+2010-02-01  Jim Meyering  <meyering@redhat.com>
+
+       build: update gnulib submodule to latest
+
+2010-02-01  Dmitry V. Levin  <ldv@altlinux.org>
+
+       fix "znew -K" to work without use of compress utility
+       * znew.in: Change -K option to imply -t, do not use compress(1).
+       * znew.1: Document it.
+       * tests/znew-k: New test.
+       * Makefile.am (TESTS): Add it.
+
 2010-01-20  Jim Meyering  <meyering@redhat.com>
 
+       maint: update README-release procedure
+       * README-release: sync from coreutils.
+
+       post-release administrivia
+       * NEWS: Add header line for next release.
+       * .prev-version: Record previous version.
+       * cfg.mk (old_NEWS_hash): Auto-update.
+
        version 1.4
        * NEWS: Record release date.
 
        but fortunately is not a bug, because the definition
        it would have overridden was always empty.
 
+2010-01-11  Jim Meyering  <meyering@redhat.com>
+
        gzip -d would fail with a CRC error...
        ...for some inputs, and some memcpy implementations.  It is possible
        that an offending input has to be compressed "from FAT filesystem
index 7cf851b4d60adf53cbc748984cd415c65bcf3535..c0a2b3b553ee9ae30a535a4f41a30d7240634933 100644 (file)
@@ -1776,7 +1776,7 @@ Sat Oct 31 12:46:00 1992  Jean-loup Gailly  (jloup@chorus.fr)
 
        -----
 
-       Copyright (C) 1997-2002, 2006-2010 Free Software Foundation, Inc.
+       Copyright (C) 1997-2002, 2006-2012 Free Software Foundation, Inc.
        Copyright (C) 1992, 1993 Jean-loup Gailly
 
        Copying and distribution of this file, with or without
index 40ccc061d0c93ce2055c4b46772f05d15cd69adb..58f2ead461a040942ad1bc374a28928a9ee99ef3 100644 (file)
@@ -1,11 +1,11 @@
-# Having a separate GNUmakefile lets me `include' the dynamically
+# Having a separate GNUmakefile lets me 'include' the dynamically
 # generated rules created via cfg.mk (package-local configuration)
 # as well as maint.mk (generic maintainer rules).
 # This makefile is used only if you run GNU Make.
 # It is necessary if you want to build targets usually of interest
 # only to the maintainer.
 
-# Copyright (C) 2001, 2003, 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2006-2012 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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Systems where /bin/sh is not the default shell need this.  The $(shell)
-# command below won't work with e.g. stock DOS/Windows shells.
-ifeq ($(wildcard /bin/s[h]),/bin/sh)
-SHELL = /bin/sh
-else
-# will be used only with the next shell-test line, then overwritten
-# by a configured-in value
-SHELL = sh
-endif
-
 # If the user runs GNU make but has not yet run ./configure,
 # give them a diagnostic.
-_have-Makefile := $(shell test -f Makefile && echo yes)
-ifeq ($(_have-Makefile),yes)
+_gl-Makefile := $(wildcard [M]akefile)
+ifneq ($(_gl-Makefile),)
 
 # Make tar archive easier to reproduce.
 export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
@@ -45,11 +35,12 @@ include Makefile
 
 # Some projects override e.g., _autoreconf here.
 -include $(srcdir)/cfg.mk
-include $(srcdir)/maint.mk
 
 # Allow cfg.mk to override these.
 _build-aux ?= build-aux
-_autoreconf ?= autoreconf
+_autoreconf ?= autoreconf -v
+
+include $(srcdir)/maint.mk
 
 # Ensure that $(VERSION) is up to date for dist-related targets, but not
 # for others: rerunning autoreconf and recompiling everything isn't cheap.
@@ -57,11 +48,13 @@ _have-git-version-gen := \
   $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
 ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
   _is-dist-target ?= $(filter-out %clean, \
-    $(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS)))
+    $(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS)))
   _is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS)))
   ifneq (,$(_is-dist-target)$(_is-install-target))
-    _curr-ver := $(shell cd $(srcdir) \
-                   && $(_build-aux)/git-version-gen .tarball-version)
+    _curr-ver := $(shell cd $(srcdir)                          \
+                   && $(_build-aux)/git-version-gen            \
+                         .tarball-version                      \
+                         $(git-version-gen-tag-sed-script))
     ifneq ($(_curr-ver),$(VERSION))
       ifeq ($(_curr-ver),UNKNOWN)
         $(info WARNING: unable to verify if $(VERSION) is the correct version)
@@ -78,7 +71,8 @@ ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
           $(info run '$(MAKE) _version' to fix it)
         else
           $(info INFO: running autoreconf for new version string: $(_curr-ver))
-          _dummy := $(shell $(MAKE) $(AM_MAKEFLAGS) _version)
+GNUmakefile: _version
+       touch GNUmakefile
         endif
       endif
     endif
@@ -88,6 +82,7 @@ endif
 .PHONY: _version
 _version:
        cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf)
+       $(MAKE) $(AM_MAKEFLAGS) Makefile
 
 else
 
@@ -96,6 +91,11 @@ srcdir = .
 
 # The package can override .DEFAULT_GOAL to run actions like autoreconf.
 -include ./cfg.mk
+
+# Allow cfg.mk to override these.
+_build-aux ?= build-aux
+_autoreconf ?= autoreconf -v
+
 include ./maint.mk
 
 ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
@@ -104,7 +104,7 @@ endif
 
 abort-due-to-no-makefile:
        @echo There seems to be no Makefile in this directory.   1>&2
-       @echo "You must run ./configure before running \`make'." 1>&2
+       @echo "You must run ./configure before running 'make'." 1>&2
        @exit 1
 
 endif
diff --git a/INSTALL b/INSTALL
index 81fd332cef8812df383d283d3f16cad10ff10f42..6e90e07d271f34826b3868acf577d68a5761c0c1 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation,
+Inc.
 
    Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
@@ -226,6 +226,11 @@ order to use an ANSI C compiler:
 
 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
 
+   HP-UX `make' updates targets which have the same time stamps as
+their prerequisites, which makes it generally unusable when shipped
+generated files such as `configure' are involved.  Use GNU `make'
+instead.
+
    On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
 parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
 a workaround.  If GNU CC is not installed, it is therefore recommended
@@ -304,9 +309,10 @@ causes the specified `gcc' to be used as the C compiler (unless it is
 overridden in the site shell script).
 
 Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug.  Until the bug is fixed you can use this workaround:
+an Autoconf limitation.  Until the limitation is lifted, you can use
+this workaround:
 
-     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+     CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
 
 `configure' Invocation
 ======================
@@ -362,4 +368,3 @@ operates.
 
 `configure' also accepts some other, not widely useful, options.  Run
 `configure --help' for more details.
-
index ac9561540504171b67cec3afae8ace8bf3d8eedd..86a02975027df24d2d4ae3ba5699e9a95a46f010 100644 (file)
@@ -1,6 +1,6 @@
 # Make gzip (GNU zip).
 
-# Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2010 Free Software Foundation,
+# Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2012 Free Software Foundation,
 # Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-SUBDIRS = lib doc
+ALL_RECURSIVE_TARGETS =
+BUILT_SOURCES =
+
+SUBDIRS = lib doc . tests
 ACLOCAL_AMFLAGS = -I m4
 AM_CPPFLAGS = -I$(top_srcdir)/lib
 AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
 
+# Tell the linker to omit references to unused shared libraries.
+AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)
+
+noinst_LIBRARIES = libver.a
+nodist_libver_a_SOURCES = version.c version.h
+DISTCLEANFILES = version.c version.h
+
 man_MANS = gunzip.1 gzexe.1 gzip.1 \
   zcat.1 zcmp.1 zdiff.1 zforce.1 zgrep.1 zless.1 zmore.1 znew.1
 
 EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_MANS) \
   ChangeLog-2007 \
-  tests/hufts-segv.gz \
-  algorithm.doc amiga/match.a amiga/Makefile.gcc amiga/Makefile.sasc \
-  amiga/tailor.c amiga/utime.h atari/Makefile.st crypt.h \
-  gunzip.in gzexe.in gzip.doc gzip.h lzw.h msdos/match.asm msdos/tailor.c \
-  msdos/gzip.prj msdos/doturboc.bat msdos/Makefile.msc msdos/Makefile.bor \
-  msdos/Makefile.djg nt/Makefile.nt os2/gzip.def os2/Makefile.os2 \
-  os2/gzip16.def primos/include/errno.h primos/include/fcntl.h \
-  primos/include/stdlib.h primos/include/sysStat.h \
-  primos/include/sysTypes.h primos/build.cpl primos/readme \
-  primos/primos.c primos/ci.opts revision.h sample/makecrc.c \
+  cfg.mk       \
+  dist-check.mk        \
+  algorithm.doc \
+  gunzip.in gzexe.in gzip.doc \
+  revision.h sample/makecrc.c \
   sample/ztouch sample/add.c sample/sub.c sample/zread.c sample/zfile \
-  tailor.h vms/Makefile.mms vms/gzip.hlp vms/vms.c vms/Readme.vms \
-  vms/Makefile.vms vms/Makefile.gcc vms/makegzip.com zcat.in zcmp.in zdiff.in \
-  zegrep.in zfgrep.in zforce.in zgrep.in zless.in zmore.in znew.in \
-  tests/init.sh
+  tailor.h \
+  zcat.in zcmp.in zdiff.in \
+  zegrep.in zfgrep.in zforce.in zgrep.in zless.in zmore.in znew.in
+noinst_HEADERS = gzip.h lzw.h
 
 bin_PROGRAMS = gzip
 bin_SCRIPTS = gunzip gzexe zcat zcmp zdiff \
   zegrep zfgrep zforce zgrep zless zmore znew
 gzip_SOURCES = \
-  bits.c crypt.c deflate.c gzip.c inflate.c lzw.c \
+  bits.c deflate.c gzip.c inflate.c lzw.c \
   trees.c unlzh.c unlzw.c unpack.c unzip.c util.c zip.c
-gzip_LDADD = lib/libgzip.a
+gzip_LDADD = libver.a lib/libgzip.a
 gzip_LDADD += $(LIB_CLOCK_GETTIME)
 
+BUILT_SOURCES += version.c
+version.c: Makefile
+       $(AM_V_GEN)rm -f $@
+       $(AM_V_at)printf '#include <config.h>\n' > $@t
+       $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
+       $(AM_V_at)chmod a-w $@t
+       $(AM_V_at)mv $@t $@
+
+BUILT_SOURCES += version.h
+version.h: Makefile
+       $(AM_V_GEN)rm -f $@
+       $(AM_V_at)printf 'extern char const *Version;\n' > $@t
+       $(AM_V_at)chmod a-w $@t
+       $(AM_V_at)mv $@t $@
+
 gzip.doc: gzip.1
        $(AM_V_GEN)groff -man -Tascii $(srcdir)/gzip.1 | col -b | uniq > $@-t \
          && mv $@-t $@
@@ -97,21 +117,8 @@ check-local: $(FILES_TO_CHECK) $(bin_PROGRAMS) gzip.doc.gz
        for file in $(FILES_TO_CHECK); do \
          ./gzip -cv -- "$$file" | ./gzip -d | cmp - "$$file" || exit 1; \
        done
-       ./gzip -dc $(srcdir)/tests/hufts-segv.gz > /dev/null 2>&1; \
-         test $$? = 1
-       k=in-$$$$; printf a | ./gzip > $$k && \
-         test "`cat $$k | ./gzip -dc $$k - $$k`" = aaa && rm $$k
        @echo 'Test succeeded.'
 
-TESTS =                                                \
-  tests/helin-segv                             \
-  tests/memcpy-abuse                           \
-  tests/trailing-nul                           \
-  tests/zdiff                                  \
-  tests/zgrep-f
-
-EXTRA_DIST += $(TESTS)
-
 install-exec-hook: remove-installed-links
 install-exec-hook remove-installed-links:
        @for prog_ext in $(bin_PROGRAMS) $(bin_SCRIPTS); do \
@@ -140,48 +147,11 @@ install-exec-hook remove-installed-links:
 
 uninstall-local: remove-installed-links
 
+ALL_RECURSIVE_TARGETS += distcheck-hook
+distcheck-hook:
+       $(MAKE) my-distcheck
+
 MAINTAINERCLEANFILES = gzip.doc
 
 MOSTLYCLEANFILES = _match.i match_.s _match.S gzip.doc.gz \
   gunzip gzexe zcat zcmp zdiff zegrep zfgrep zforce zgrep zless zmore znew
-
-# Note that the first lines are statements.  They ensure that environment
-# variables that can perturb tests are unset or set to expected values.
-# The rest are envvar settings that propagate build-related Makefile
-# variables to test scripts.
-TESTS_ENVIRONMENT =                            \
-  tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.;        \
-  TMPDIR=$$tmp__; export TMPDIR;               \
-  exec 9>&2;                                   \
-  shell_or_perl_() {                           \
-    if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then                        \
-      if $(PERL) -e 'use warnings' > /dev/null 2>&1; then              \
-       grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=;   \
-        $(PERL) -w$$T_ -I$(srcdir) -MCoreutils                         \
-             -M"CuTmpdir qw($$f)" -- "$$1";    \
-      else                                     \
-       echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
-         "so skipping this test";              \
-       (exit 77);                              \
-      fi;                                      \
-    else                                       \
-      $(SHELL) "$$1";                          \
-    fi;                                                \
-  };                                           \
-  export                                       \
-  abs_top_builddir='$(abs_top_builddir)'       \
-  abs_top_srcdir='$(abs_top_srcdir)'           \
-  abs_srcdir='$(abs_srcdir)'                   \
-  srcdir='$(srcdir)'                           \
-  top_srcdir='$(top_srcdir)'                   \
-  CC='$(CC)'                                   \
-  MAKE=$(MAKE)                                 \
-  PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)'     \
-  PACKAGE_VERSION=$(PACKAGE_VERSION)           \
-  PERL='$(PERL)'                               \
-  PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \
-  REPLACE_GETCWD=$(REPLACE_GETCWD)             \
-  PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH" \
-  ; shell_or_perl_
-
-VERBOSE = yes
index 9176c71d72e5a1f89831450c1a01ff1bd50af571..f2ed4d66ba38ce7eda0103e38b09f7b6e0e86a43 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11a from Makefile.am.
+# Makefile.in generated by automake 1.12a from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2012 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.
@@ -17,7 +16,7 @@
 
 # Make gzip (GNU zip).
 
-# Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2010 Free Software Foundation,
+# Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2012 Free Software Foundation,
 # Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 
+
+
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -56,83 +73,99 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = gzip$(EXEEXT)
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \
-       ChangeLog INSTALL NEWS THANKS TODO build-aux/compile \
-       build-aux/config.guess build-aux/config.sub build-aux/depcomp \
+DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
+       $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+       $(top_srcdir)/configure $(am__configure_deps) \
+       $(top_srcdir)/build-aux/depcomp $(noinst_HEADERS) COPYING \
+       THANKS TODO build-aux/compile build-aux/config.guess \
+       build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
        build-aux/install-sh build-aux/mdate-sh build-aux/missing \
-       build-aux/texinfo.tex
+       build-aux/texinfo.tex $(top_srcdir)/build-aux/compile \
+       $(top_srcdir)/build-aux/config.guess \
+       $(top_srcdir)/build-aux/config.rpath \
+       $(top_srcdir)/build-aux/config.sub \
+       $(top_srcdir)/build-aux/install-sh \
+       $(top_srcdir)/build-aux/missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
-       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/calloc.m4 \
-       $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/chown.m4 \
+       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \
+       $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/chdir-long.m4 \
        $(top_srcdir)/m4/clock_time.m4 \
        $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \
-       $(top_srcdir)/m4/closein.m4 $(top_srcdir)/m4/closeout.m4 \
-       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/d-ino.m4 \
-       $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
-       $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \
-       $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
-       $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
-       $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/exponentd.m4 \
+       $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closein.m4 \
+       $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
+       $(top_srcdir)/m4/configmake.m4 \
+       $(top_srcdir)/m4/dirent-safer.m4 $(top_srcdir)/m4/dirent_h.m4 \
+       $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
+       $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
+       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/errno_h.m4 \
+       $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exponentd.m4 \
        $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \
        $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \
        $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-o.m4 \
        $(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fcntl.m4 \
        $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopendir.m4 \
-       $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/float_h.m4 \
-       $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \
-       $(top_srcdir)/m4/fprintf-posix.m4 $(top_srcdir)/m4/fpurge.m4 \
-       $(top_srcdir)/m4/freading.m4 $(top_srcdir)/m4/frexp.m4 \
-       $(top_srcdir)/m4/frexpl.m4 $(top_srcdir)/m4/fseeko.m4 \
-       $(top_srcdir)/m4/ftello.m4 \
-       $(top_srcdir)/m4/getcwd-abort-bug.m4 \
-       $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
-       $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettime.m4 \
-       $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \
-       $(top_srcdir)/m4/gnu-make.m4 $(top_srcdir)/m4/gnulib-common.m4 \
+       $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/filenamecat.m4 \
+       $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fpending.m4 \
+       $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \
+       $(top_srcdir)/m4/fpurge.m4 $(top_srcdir)/m4/freading.m4 \
+       $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
+       $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
+       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/ftell.m4 \
+       $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/getcwd.m4 \
+       $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
+       $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+       $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \
+       $(top_srcdir)/m4/gnulib-common.m4 \
        $(top_srcdir)/m4/gnulib-comp.m4 \
        $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \
        $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \
        $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \
-       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/lchown.m4 \
-       $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/localcharset.m4 \
-       $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \
-       $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/longlong.m4 \
+       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/largefile.m4 \
+       $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/lib-ignore.m4 \
+       $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+       $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
+       $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \
+       $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \
        $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
        $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/manywarnings.m4 \
        $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbrtowc.m4 \
        $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \
        $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mempcpy.m4 \
-       $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mkdir.m4 \
-       $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
-       $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nocrash.m4 \
+       $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+       $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
+       $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+       $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
        $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \
+       $(top_srcdir)/m4/opendir.m4 $(top_srcdir)/m4/pathmax.m4 \
        $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/printf-frexp.m4 \
        $(top_srcdir)/m4/printf-frexpl.m4 \
        $(top_srcdir)/m4/printf-posix-rpl.m4 \
        $(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/quotearg.m4 \
-       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/rmdir.m4 \
-       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/shell.m4 \
-       $(top_srcdir)/m4/signbit.m4 $(top_srcdir)/m4/size_max.m4 \
+       $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/realloc.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \
+       $(top_srcdir)/m4/shell.m4 $(top_srcdir)/m4/signbit.m4 \
+       $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/ssize_t.m4 \
        $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
        $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
        $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
        $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
        $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
-       $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/sys_stat_h.m4 \
-       $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/time_h.m4 \
-       $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/unistd-safer.m4 \
-       $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlink.m4 \
+       $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \
+       $(top_srcdir)/m4/sys_socket_h.m4 \
+       $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
+       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/threadlib.m4 \
+       $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/timespec.m4 \
+       $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
        $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/m4/utimens.m4 \
        $(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \
        $(top_srcdir)/m4/vfprintf-posix.m4 \
        $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \
-       $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \
-       $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \
-       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \
-       $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/yesno.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
+       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
+       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+       $(top_srcdir)/m4/yesno.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -141,16 +174,25 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/lib/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo "  AR      " $@;
+am__v_AR_1 = 
+libver_a_AR = $(AR) $(ARFLAGS)
+libver_a_LIBADD =
+nodist_libver_a_OBJECTS = version.$(OBJEXT)
+libver_a_OBJECTS = $(nodist_libver_a_OBJECTS)
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \
        "$(DESTDIR)$(man1dir)"
 PROGRAMS = $(bin_PROGRAMS)
-am_gzip_OBJECTS = bits.$(OBJEXT) crypt.$(OBJEXT) deflate.$(OBJEXT) \
-       gzip.$(OBJEXT) inflate.$(OBJEXT) lzw.$(OBJEXT) trees.$(OBJEXT) \
+am_gzip_OBJECTS = bits.$(OBJEXT) deflate.$(OBJEXT) gzip.$(OBJEXT) \
+       inflate.$(OBJEXT) lzw.$(OBJEXT) trees.$(OBJEXT) \
        unlzh.$(OBJEXT) unlzw.$(OBJEXT) unpack.$(OBJEXT) \
        unzip.$(OBJEXT) util.$(OBJEXT) zip.$(OBJEXT)
 gzip_OBJECTS = $(am_gzip_OBJECTS)
 am__DEPENDENCIES_1 =
-gzip_DEPENDENCIES = lib/libgzip.a $(am__DEPENDENCIES_1)
+gzip_DEPENDENCIES = libver.a lib/libgzip.a $(am__DEPENDENCIES_1)
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -172,28 +214,42 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 SCRIPTS = $(bin_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib
 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_$(V))
-am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
 am__v_CC_0 = @echo "  CC      " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
+am__v_CC_1 = 
 CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_$(V))
-am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN     " $@;
-SOURCES = $(gzip_SOURCES)
+am__v_CCLD_1 = 
+SOURCES = $(nodist_libver_a_SOURCES) $(gzip_SOURCES)
 DIST_SOURCES = $(gzip_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
        html-recursive info-recursive install-data-recursive \
@@ -202,89 +258,34 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
        install-pdf-recursive install-ps-recursive install-recursive \
        installcheck-recursive installdirs-recursive pdf-recursive \
        ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(man_MANS)
+HEADERS = $(noinst_HEADERS)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
        $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-       cscope check check-html recheck recheck-html distdir dist \
-       dist-all distcheck
+       cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
-# If stdout is a non-dumb tty, use colors.  If test -t is not supported,
-# then this fails; a conservative approach.  Of course do not redirect
-# stdout here, just stderr.
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=; \
-test "X$(AM_COLOR_TESTS)" != Xno \
-&& test "X$$TERM" != Xdumb \
-&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
-&& { \
-  red='\e[0;31m'; \
-  grn='\e[0;32m'; \
-  lgn='\e[1;32m'; \
-  blu='\e[1;34m'; \
-  std='\e[m'; \
-}
-# Restructured Text title and section.
-am__rst_title = sed 's/.*/   &   /;h;s/./=/g;p;x;p;g;p;s/.*//'
-am__rst_section = sed 'p;s/./=/g;p;g'
-# Put stdin (possibly several lines separated by ".  ") in a box.
-am__text_box = $(AWK) '{                               \
-  n = split($$0, lines, "\\.  "); max = 0;             \
-  for (i = 1; i <= n; ++i)                             \
-    if (max < length(lines[i]))                                \
-      max = length(lines[i]);                          \
-  for (i = 0; i < max; ++i) line = line "=";           \
-  print line;                                          \
-  for (i = 1; i <= n; ++i) if (lines[i]) print lines[i];\
-  print line;                                          \
-}'
-# Solaris 10 'make', and several other traditional 'make' implementations,
-# pass "-e" to $(SHELL).  This contradicts POSIX.  Work around the problem
-# by disabling -e (using the XSI extension "set +e") if it's set.
-am__sh_e_setup = case $$- in *e*) set +e;; esac
-# To be inserted before the command running the test.  Creates the
-# directory for the log if needed.  Stores in $dir the directory
-# containing $f, in $tst the test, in $log the log, and passes
-# TESTS_ENVIRONMENT.  Save and restore TERM around use of
-# TESTS_ENVIRONMENT, in case that unsets it.
-am__check_pre = \
-$(am__sh_e_setup);                                     \
-$(am__vpath_adj_setup) $(am__vpath_adj)                        \
-srcdir=$(srcdir); export srcdir;                       \
-rm -f $@-t;                                            \
-trap 'st=$$?; rm -f '\''$(abs_builddir)/$@-t'\''; (exit $$st); exit $$st' \
-  1 2 13 15;                                           \
-am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;           \
-test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?;        \
-if test -f "./$$f"; then dir=./;                       \
-elif test -f "$$f"; then dir=;                         \
-else dir="$(srcdir)/"; fi;                             \
-tst=$$dir$$f; log='$@'; __SAVED_TERM=$$TERM;           \
-$(TESTS_ENVIRONMENT)
-RECHECK_LOGS = $(TEST_LOGS)
-TEST_SUITE_LOG = test-suite.log
-TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
-TEST_EXTENSIONS = @EXEEXT@ .test
-LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
-am__test_logs1 = $(TESTS:=.log)
-am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
-TEST_LOGS = $(am__test_logs2:.test.log=.log)
-TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
-       $(TEST_LOG_FLAGS)
-TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t)
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d "$(distdir)" \
-    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr "$(distdir)"; }; }
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
 am__post_remove_distdir = $(am__remove_distdir)
 am__relativize = \
   dir0=`pwd`; \
@@ -315,16 +316,22 @@ DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz
 GZIP_ENV = --best
 DIST_TARGETS = dist-xz dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
+pkglibexecdir = @pkglibexecdir@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
 ASCPPFLAGS = @ASCPPFLAGS@
 ASCPPPOST = @ASCPPPOST@
 ASFLAGS_config = @ASFLAGS_config@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -337,6 +344,7 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CONFIG_INCLUDE = @CONFIG_INCLUDE@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CYGPATH_W = @CYGPATH_W@
@@ -357,47 +365,89 @@ EXEEXT = @EXEEXT@
 FLOAT_H = @FLOAT_H@
 GETOPT_H = @GETOPT_H@
 GLIBC21 = @GLIBC21@
+GNULIB_ACOSF = @GNULIB_ACOSF@
 GNULIB_ACOSL = @GNULIB_ACOSL@
 GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
+GNULIB_ASINF = @GNULIB_ASINF@
 GNULIB_ASINL = @GNULIB_ASINL@
+GNULIB_ATAN2F = @GNULIB_ATAN2F@
+GNULIB_ATANF = @GNULIB_ATANF@
 GNULIB_ATANL = @GNULIB_ATANL@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CBRT = @GNULIB_CBRT@
+GNULIB_CBRTF = @GNULIB_CBRTF@
+GNULIB_CBRTL = @GNULIB_CBRTL@
+GNULIB_CEIL = @GNULIB_CEIL@
 GNULIB_CEILF = @GNULIB_CEILF@
 GNULIB_CEILL = @GNULIB_CEILL@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
+GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
+GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
+GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
+GNULIB_COSF = @GNULIB_COSF@
+GNULIB_COSHF = @GNULIB_COSHF@
 GNULIB_COSL = @GNULIB_COSL@
 GNULIB_DIRFD = @GNULIB_DIRFD@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_EXP2 = @GNULIB_EXP2@
+GNULIB_EXP2F = @GNULIB_EXP2F@
+GNULIB_EXP2L = @GNULIB_EXP2L@
+GNULIB_EXPF = @GNULIB_EXPF@
 GNULIB_EXPL = @GNULIB_EXPL@
+GNULIB_EXPM1 = @GNULIB_EXPM1@
+GNULIB_EXPM1F = @GNULIB_EXPM1F@
+GNULIB_EXPM1L = @GNULIB_EXPM1L@
+GNULIB_FABSF = @GNULIB_FABSF@
+GNULIB_FABSL = @GNULIB_FABSL@
 GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
 GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
 GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
 GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
+GNULIB_FLOOR = @GNULIB_FLOOR@
 GNULIB_FLOORF = @GNULIB_FLOORF@
 GNULIB_FLOORL = @GNULIB_FLOORL@
+GNULIB_FMA = @GNULIB_FMA@
+GNULIB_FMAF = @GNULIB_FMAF@
+GNULIB_FMAL = @GNULIB_FMAL@
+GNULIB_FMOD = @GNULIB_FMOD@
+GNULIB_FMODF = @GNULIB_FMODF@
+GNULIB_FMODL = @GNULIB_FMODL@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
 GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FREXP = @GNULIB_FREXP@
+GNULIB_FREXPF = @GNULIB_FREXPF@
 GNULIB_FREXPL = @GNULIB_FREXPL@
+GNULIB_FSCANF = @GNULIB_FSCANF@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
 GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
@@ -405,6 +455,8 @@ GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
 GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
@@ -417,18 +469,46 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_HYPOT = @GNULIB_HYPOT@
+GNULIB_HYPOTF = @GNULIB_HYPOTF@
+GNULIB_HYPOTL = @GNULIB_HYPOTL@
+GNULIB_ILOGB = @GNULIB_ILOGB@
+GNULIB_ILOGBF = @GNULIB_ILOGBF@
+GNULIB_ILOGBL = @GNULIB_ILOGBL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISFINITE = @GNULIB_ISFINITE@
 GNULIB_ISINF = @GNULIB_ISINF@
 GNULIB_ISNAN = @GNULIB_ISNAN@
 GNULIB_ISNAND = @GNULIB_ISNAND@
 GNULIB_ISNANF = @GNULIB_ISNANF@
 GNULIB_ISNANL = @GNULIB_ISNANL@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LDEXPF = @GNULIB_LDEXPF@
 GNULIB_LDEXPL = @GNULIB_LDEXPL@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOG = @GNULIB_LOG@
+GNULIB_LOG10 = @GNULIB_LOG10@
+GNULIB_LOG10F = @GNULIB_LOG10F@
+GNULIB_LOG10L = @GNULIB_LOG10L@
+GNULIB_LOG1P = @GNULIB_LOG1P@
+GNULIB_LOG1PF = @GNULIB_LOG1PF@
+GNULIB_LOG1PL = @GNULIB_LOG1PL@
+GNULIB_LOG2 = @GNULIB_LOG2@
+GNULIB_LOG2F = @GNULIB_LOG2F@
+GNULIB_LOG2L = @GNULIB_LOG2L@
+GNULIB_LOGB = @GNULIB_LOGB@
+GNULIB_LOGBF = @GNULIB_LOGBF@
+GNULIB_LOGBL = @GNULIB_LOGBL@
+GNULIB_LOGF = @GNULIB_LOGF@
 GNULIB_LOGL = @GNULIB_LOGL@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
@@ -452,6 +532,7 @@ GNULIB_MBSSEP = @GNULIB_MBSSEP@
 GNULIB_MBSSPN = @GNULIB_MBSSPN@
 GNULIB_MBSSTR = @GNULIB_MBSSTR@
 GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
 GNULIB_MEMCHR = @GNULIB_MEMCHR@
 GNULIB_MEMMEM = @GNULIB_MEMMEM@
 GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
@@ -466,43 +547,73 @@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
 GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
 GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_MODF = @GNULIB_MODF@
+GNULIB_MODFF = @GNULIB_MODFF@
+GNULIB_MODFL = @GNULIB_MODFL@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_OPEN = @GNULIB_OPEN@
 GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_OPENDIR = @GNULIB_OPENDIR@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
 GNULIB_PIPE2 = @GNULIB_PIPE2@
 GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_POWF = @GNULIB_POWF@
 GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
+GNULIB_READDIR = @GNULIB_READDIR@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
 GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_REMAINDER = @GNULIB_REMAINDER@
+GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
+GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
 GNULIB_REMOVE = @GNULIB_REMOVE@
 GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
+GNULIB_RINT = @GNULIB_RINT@
+GNULIB_RINTF = @GNULIB_RINTF@
+GNULIB_RINTL = @GNULIB_RINTL@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_ROUND = @GNULIB_ROUND@
 GNULIB_ROUNDF = @GNULIB_ROUNDF@
 GNULIB_ROUNDL = @GNULIB_ROUNDL@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SCANDIR = @GNULIB_SCANDIR@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
+GNULIB_SINF = @GNULIB_SINF@
+GNULIB_SINHF = @GNULIB_SINHF@
 GNULIB_SINL = @GNULIB_SINL@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_SQRTF = @GNULIB_SQRTF@
 GNULIB_SQRTL = @GNULIB_SQRTL@
 GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
 GNULIB_STPCPY = @GNULIB_STPCPY@
 GNULIB_STPNCPY = @GNULIB_STPNCPY@
@@ -510,9 +621,12 @@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
 GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
 GNULIB_STRDUP = @GNULIB_STRDUP@
 GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
 GNULIB_STRNDUP = @GNULIB_STRNDUP@
 GNULIB_STRNLEN = @GNULIB_STRNLEN@
 GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
 GNULIB_STRSEP = @GNULIB_STRSEP@
 GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
 GNULIB_STRSTR = @GNULIB_STRSTR@
@@ -523,14 +637,23 @@ GNULIB_STRTOULL = @GNULIB_STRTOULL@
 GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
 GNULIB_SYMLINK = @GNULIB_SYMLINK@
 GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TANF = @GNULIB_TANF@
+GNULIB_TANHF = @GNULIB_TANHF@
 GNULIB_TANL = @GNULIB_TANL@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TRUNC = @GNULIB_TRUNC@
 GNULIB_TRUNCF = @GNULIB_TRUNCF@
 GNULIB_TRUNCL = @GNULIB_TRUNCL@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
 GNULIB_USLEEP = @GNULIB_USLEEP@
 GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
@@ -538,51 +661,129 @@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
 GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
 GNULIB_VPRINTF = @GNULIB_VPRINTF@
 GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
 GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
 GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
 GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
 GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
 GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
 GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
 GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GREP = @GREP@
+HAVE_ACOSF = @HAVE_ACOSF@
 HAVE_ACOSL = @HAVE_ACOSL@
 HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ASINF = @HAVE_ASINF@
 HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
 HAVE_ATANL = @HAVE_ATANL@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
 HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
 HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
 HAVE_COSL = @HAVE_COSL@
 HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
 HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
 HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
 HAVE_DECL_COSL = @HAVE_DECL_COSL@
 HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
 HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
 HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
 HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
 HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SINL = @HAVE_DECL_SINL@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
-HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
@@ -590,24 +791,45 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_TANL = @HAVE_DECL_TANL@
 HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DIRENT_H = @HAVE_DIRENT_H@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
 HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXPF = @HAVE_EXPF@
 HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
 HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FDOPENDIR = @HAVE_FDOPENDIR@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
 HAVE_FUTIMENS = @HAVE_FUTIMENS@
-HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
 HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
@@ -615,26 +837,43 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISNAND = @HAVE_ISNAND@
 HAVE_ISNANF = @HAVE_ISNANF@
 HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
 HAVE_LCHMOD = @HAVE_LCHMOD@
 HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
 HAVE_LINK = @HAVE_LINK@
 HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
 HAVE_LOGL = @HAVE_LOGL@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
 HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
 HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
@@ -644,27 +883,52 @@ HAVE_MKNOD = @HAVE_MKNOD@
 HAVE_MKNODAT = @HAVE_MKNODAT@
 HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OPENDIR = @HAVE_OPENDIR@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READDIR = @HAVE_READDIR@
 HAVE_READLINK = @HAVE_READLINK@
 HAVE_READLINKAT = @HAVE_READLINKAT@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
 HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_REWINDDIR = @HAVE_REWINDDIR@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
 HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
 HAVE_SINL = @HAVE_SINL@
 HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
 HAVE_SQRTL = @HAVE_SQRTL@
 HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
@@ -672,6 +936,7 @@ HAVE_STPNCPY = @HAVE_STPNCPY@
 HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
 HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
@@ -687,10 +952,13 @@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
-HAVE_UNSETENV = @HAVE_UNSETENV@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
 HAVE_USLEEP = @HAVE_USLEEP@
 HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
@@ -698,12 +966,45 @@ HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
 HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMSET = @HAVE_WMEMSET@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+IGNORE_UNUSED_LIBRARIES_CFLAGS = @IGNORE_UNUSED_LIBRARIES_CFLAGS@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
 INSTALL = @INSTALL@
@@ -715,8 +1016,12 @@ LDFLAGS = @LDFLAGS@
 LIBGZIP_LIBDEPS = @LIBGZIP_LIBDEPS@
 LIBGZIP_LTLIBDEPS = @LIBGZIP_LTLIBDEPS@
 LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
 LN_S = @LN_S@
 LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
@@ -724,7 +1029,10 @@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
 LOCALE_JA = @LOCALE_JA@
 LOCALE_ZH_CN = @LOCALE_ZH_CN@
 LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
@@ -740,6 +1048,7 @@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
 NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
@@ -757,6 +1066,7 @@ NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
@@ -771,32 +1081,52 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
 PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
 REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
 REPLACE_CEILF = @REPLACE_CEILF@
 REPLACE_CEILL = @REPLACE_CEILL@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
+REPLACE_DIRFD = @REPLACE_DIRFD@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
 REPLACE_DUP = @REPLACE_DUP@
 REPLACE_DUP2 = @REPLACE_DUP2@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_FABSL = @REPLACE_FABSL@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FLOOR = @REPLACE_FLOOR@
 REPLACE_FLOORF = @REPLACE_FLOORF@
 REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
 REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
 REPLACE_FREXPL = @REPLACE_FREXPL@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
@@ -804,30 +1134,59 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
 REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISFINITE = @REPLACE_ISFINITE@
 REPLACE_ISINF = @REPLACE_ISINF@
 REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LDEXPL = @REPLACE_LDEXPL@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
 REPLACE_MEMCHR = @REPLACE_MEMCHR@
 REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
@@ -835,6 +1194,9 @@ REPLACE_MKFIFO = @REPLACE_MKFIFO@
 REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
 REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
 REPLACE_NAN = @REPLACE_NAN@
 REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
 REPLACE_NULL = @REPLACE_NULL@
@@ -846,9 +1208,17 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
 REPLACE_REMOVE = @REPLACE_REMOVE@
 REPLACE_RENAME = @REPLACE_RENAME@
 REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
@@ -862,20 +1232,32 @@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
 REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
 REPLACE_STRNDUP = @REPLACE_STRNDUP@
-REPLACE_STRPTIME = @REPLACE_STRPTIME@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
 REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
 REPLACE_UNSETENV = @REPLACE_UNSETENV@
@@ -890,7 +1272,9 @@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
 REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
 REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 REPLACE_WRITE = @REPLACE_WRITE@
 SET_MAKE = @SET_MAKE@
@@ -901,7 +1285,6 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
-SYS_TIME_H = @SYS_TIME_H@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -910,8 +1293,9 @@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOC
 VERSION = @VERSION@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WERROR_CFLAGS = @WERROR_CFLAGS@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -939,6 +1323,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -950,10 +1335,10 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+lispdir = @lispdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
-mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -967,39 +1352,42 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = lib doc
+ALL_RECURSIVE_TARGETS = distcheck-hook
+BUILT_SOURCES = version.c version.h
+SUBDIRS = lib doc . tests
 ACLOCAL_AMFLAGS = -I m4
 AM_CPPFLAGS = -I$(top_srcdir)/lib
 AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+
+# Tell the linker to omit references to unused shared libraries.
+AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)
+noinst_LIBRARIES = libver.a
+nodist_libver_a_SOURCES = version.c version.h
+DISTCLEANFILES = version.c version.h
 man_MANS = gunzip.1 gzexe.1 gzip.1 \
   zcat.1 zcmp.1 zdiff.1 zforce.1 zgrep.1 zless.1 zmore.1 znew.1
 
-EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_MANS) ChangeLog-2007 \
-       tests/hufts-segv.gz algorithm.doc amiga/match.a \
-       amiga/Makefile.gcc amiga/Makefile.sasc amiga/tailor.c \
-       amiga/utime.h atari/Makefile.st crypt.h gunzip.in gzexe.in \
-       gzip.doc gzip.h lzw.h msdos/match.asm msdos/tailor.c \
-       msdos/gzip.prj msdos/doturboc.bat msdos/Makefile.msc \
-       msdos/Makefile.bor msdos/Makefile.djg nt/Makefile.nt \
-       os2/gzip.def os2/Makefile.os2 os2/gzip16.def \
-       primos/include/errno.h primos/include/fcntl.h \
-       primos/include/stdlib.h primos/include/sysStat.h \
-       primos/include/sysTypes.h primos/build.cpl primos/readme \
-       primos/primos.c primos/ci.opts revision.h sample/makecrc.c \
-       sample/ztouch sample/add.c sample/sub.c sample/zread.c \
-       sample/zfile tailor.h vms/Makefile.mms vms/gzip.hlp vms/vms.c \
-       vms/Readme.vms vms/Makefile.vms vms/Makefile.gcc \
-       vms/makegzip.com zcat.in zcmp.in zdiff.in zegrep.in zfgrep.in \
-       zforce.in zgrep.in zless.in zmore.in znew.in tests/init.sh \
-       $(TESTS)
+EXTRA_DIST = $(ACINCLUDE_INPUTS) $(man_MANS) \
+  ChangeLog-2007 \
+  cfg.mk       \
+  dist-check.mk        \
+  algorithm.doc \
+  gunzip.in gzexe.in gzip.doc \
+  revision.h sample/makecrc.c \
+  sample/ztouch sample/add.c sample/sub.c sample/zread.c sample/zfile \
+  tailor.h \
+  zcat.in zcmp.in zdiff.in \
+  zegrep.in zfgrep.in zforce.in zgrep.in zless.in zmore.in znew.in
+
+noinst_HEADERS = gzip.h lzw.h
 bin_SCRIPTS = gunzip gzexe zcat zcmp zdiff \
   zegrep zfgrep zforce zgrep zless zmore znew
 
 gzip_SOURCES = \
-  bits.c crypt.c deflate.c gzip.c inflate.c lzw.c \
+  bits.c deflate.c gzip.c inflate.c lzw.c \
   trees.c unlzh.c unlzw.c unpack.c unzip.c util.c zip.c
 
-gzip_LDADD = lib/libgzip.a $(LIB_CLOCK_GETTIME)
+gzip_LDADD = libver.a lib/libgzip.a $(LIB_CLOCK_GETTIME)
 SUFFIXES = .in
 gen_start_date = 2008-01-01
 
@@ -1007,63 +1395,16 @@ gen_start_date = 2008-01-01
 FILES_TO_CHECK = $(bin_SCRIPTS) \
   $(top_srcdir)/ChangeLog $(top_srcdir)/configure $(top_srcdir)/gzip.c
 
-TESTS = \
-  tests/helin-segv                             \
-  tests/memcpy-abuse                           \
-  tests/trailing-nul                           \
-  tests/zdiff                                  \
-  tests/zgrep-f
-
 MAINTAINERCLEANFILES = gzip.doc
 MOSTLYCLEANFILES = _match.i match_.s _match.S gzip.doc.gz \
   gunzip gzexe zcat zcmp zdiff zegrep zfgrep zforce zgrep zless zmore znew
 
-
-# Note that the first lines are statements.  They ensure that environment
-# variables that can perturb tests are unset or set to expected values.
-# The rest are envvar settings that propagate build-related Makefile
-# variables to test scripts.
-TESTS_ENVIRONMENT = \
-  tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.;        \
-  TMPDIR=$$tmp__; export TMPDIR;               \
-  exec 9>&2;                                   \
-  shell_or_perl_() {                           \
-    if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then                        \
-      if $(PERL) -e 'use warnings' > /dev/null 2>&1; then              \
-       grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=;   \
-        $(PERL) -w$$T_ -I$(srcdir) -MCoreutils                         \
-             -M"CuTmpdir qw($$f)" -- "$$1";    \
-      else                                     \
-       echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
-         "so skipping this test";              \
-       (exit 77);                              \
-      fi;                                      \
-    else                                       \
-      $(SHELL) "$$1";                          \
-    fi;                                                \
-  };                                           \
-  export                                       \
-  abs_top_builddir='$(abs_top_builddir)'       \
-  abs_top_srcdir='$(abs_top_srcdir)'           \
-  abs_srcdir='$(abs_srcdir)'                   \
-  srcdir='$(srcdir)'                           \
-  top_srcdir='$(top_srcdir)'                   \
-  CC='$(CC)'                                   \
-  MAKE=$(MAKE)                                 \
-  PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)'     \
-  PACKAGE_VERSION=$(PACKAGE_VERSION)           \
-  PERL='$(PERL)'                               \
-  PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \
-  REPLACE_GETCWD=$(REPLACE_GETCWD)             \
-  PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH" \
-  ; shell_or_perl_
-
-VERBOSE = yes
-all: all-recursive
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
-.SUFFIXES: .in .c .html .log .o .obj .test .test$(EXEEXT)
-am--refresh:
+.SUFFIXES: .in .c .o .obj
+am--refresh: Makefile
        @:
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
@@ -1097,16 +1438,27 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 $(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+       -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libver.a: $(libver_a_OBJECTS) $(libver_a_DEPENDENCIES) $(EXTRA_libver_a_DEPENDENCIES) 
+       $(AM_V_at)-rm -f libver.a
+       $(AM_V_AR)$(libver_a_AR) libver.a $(libver_a_OBJECTS) $(libver_a_LIBADD)
+       $(AM_V_at)$(RANLIB) libver.a
 install-binPROGRAMS: $(bin_PROGRAMS)
        @$(NORMAL_INSTALL)
-       test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
        for p in $$list; do echo "$$p $$p"; done | \
        sed 's/$(EXEEXT)$$//' | \
-       while read p p1; do if test -f $$p; \
-         then echo "$$p"; echo "$$p"; else :; fi; \
+       while read p p1; do if test -f $$p \
+         then echo "$$p"; echo "$$p"; else :; fi; \
        done | \
-       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
            -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
        sed 'N;N;N;s,\n, ,g' | \
        $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -1127,20 +1479,24 @@ uninstall-binPROGRAMS:
        @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
        files=`for p in $$list; do echo "$$p"; done | \
          sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-             -e 's/$$/$(EXEEXT)/' `; \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
        -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-gzip$(EXEEXT): $(gzip_OBJECTS) $(gzip_DEPENDENCIES) 
+gzip$(EXEEXT): $(gzip_OBJECTS) $(gzip_DEPENDENCIES) $(EXTRA_gzip_DEPENDENCIES) 
        @rm -f gzip$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(gzip_OBJECTS) $(gzip_LDADD) $(LIBS)
 install-binSCRIPTS: $(bin_SCRIPTS)
        @$(NORMAL_INSTALL)
-       test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
        @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
@@ -1168,9 +1524,7 @@ uninstall-binSCRIPTS:
        @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
        files=`for p in $$list; do echo "$$p"; done | \
               sed -e 's,.*/,,;$(transform)'`; \
-       test -n "$$list" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(bindir)" && rm -f $$files
+       dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -1179,7 +1533,6 @@ distclean-compile:
        -rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bits.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypt.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deflate.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inflate.Po@am__quote@
@@ -1190,30 +1543,36 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unpack.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unzip.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zip.Po@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
 install-man1: $(man_MANS)
        @$(NORMAL_INSTALL)
-       test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-       @list=''; test -n "$(man1dir)" || exit 0; \
-       { for i in $$list; do echo "$$i"; done; \
-       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-         sed -n '/\.1[a-z]*$$/p'; \
+       @list1=''; \
+       list2='$(man_MANS)'; \
+       test -n "$(man1dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.1[a-z]*$$/p'; \
+       fi; \
        } | while read p; do \
          if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; echo "$$p"; \
@@ -1242,17 +1601,15 @@ uninstall-man1:
          sed -n '/\.1[a-z]*$$/p'; \
        } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
              -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-       test -z "$$files" || { \
-         echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
-         cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+       dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
 # 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.
-$(RECURSIVE_TARGETS):
+# 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.
+$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
        @fail= failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
@@ -1262,7 +1619,11 @@ $(RECURSIVE_TARGETS):
        done; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       for subdir in $$list; do \
          echo "Making $$target in $$subdir"; \
          if test "$$subdir" = "."; then \
            dot_seen=yes; \
@@ -1276,37 +1637,6 @@ $(RECURSIVE_TARGETS):
        if test "$$dot_seen" = "no"; then \
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
        fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
-       dot_seen=no; \
-       case "$@" in \
-         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-         *) list='$(SUBDIRS)' ;; \
-       esac; \
-       rev=''; for subdir in $$list; do \
-         if test "$$subdir" = "."; then :; else \
-           rev="$$subdir $$rev"; \
-         fi; \
-       done; \
-       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; \
-         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-         || eval $$failcom; \
-       done && test -z "$$fail"
 tags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
          test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
@@ -1320,8 +1650,8 @@ cscopelist-recursive:
          test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
        done
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ID: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        unique=`for i in $$list; do \
            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          done | \
@@ -1330,8 +1660,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        mkid -fID $$unique
 tags: TAGS
 
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+TAGS: tags-recursive $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
        if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -1347,7 +1676,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
              set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
          fi; \
        done; \
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       list='$(am__tagged_files)'; \
        unique=`for i in $$list; do \
            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          done | \
@@ -1365,9 +1694,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
          fi; \
        fi
 ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+CTAGS: ctags-recursive $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        unique=`for i in $$list; do \
            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          done | \
@@ -1391,8 +1719,8 @@ clean-cscope:
 
 cscope.files: clean-cscope cscopelist-recursive cscopelist
 
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist: cscopelist-recursive $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -1409,173 +1737,6 @@ distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
        -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
-# To be appended to the command running the test.  Handle the stdout
-# and stderr redirection, and catch the exit status.
-am__check_post =                                       \
->$@-t 2>&1;                                            \
-estatus=$$?;                                           \
-if test -n '$(DISABLE_HARD_ERRORS)'                    \
-   && test $$estatus -eq 99; then                      \
-  estatus=1;                                           \
-fi;                                                    \
-TERM=$$__SAVED_TERM; export TERM;                      \
-$(am__tty_colors);                                     \
-xfailed=PASS;                                          \
-case " $(XFAIL_TESTS) " in                             \
-  *[\ \        ]$$f[\ \        ]* | *[\ \      ]$$dir$$f[\ \   ]*) \
-    xfailed=XFAIL;;                                    \
-esac;                                                  \
-case $$estatus:$$xfailed in                            \
-    0:XFAIL) col=$$red; res=XPASS;;                    \
-    0:*)     col=$$grn; res=PASS ;;                    \
-    77:*)    col=$$blu; res=SKIP ;;                    \
-    99:*)    col=$$red; res=FAIL ;;                    \
-    *:XFAIL) col=$$lgn; res=XFAIL;;                    \
-    *:*)     col=$$red; res=FAIL ;;                    \
-esac;                                                  \
-echo "$${col}$$res$${std}: $$f";                       \
-echo "$$res: $$f (exit: $$estatus)" |                  \
-  $(am__rst_section) >$@;                              \
-cat $@-t >>$@;                                         \
-rm -f $@-t
-
-$(TEST_SUITE_LOG): $(TEST_LOGS)
-       @$(am__sh_e_setup);                                             \
-       list='$(TEST_LOGS)';                                            \
-       results=`for f in $$list; do                                    \
-                  read line < $$f && echo "$$line" || echo FAIL;       \
-                done`;                                                 \
-       all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[      ]*//'`; \
-       fail=`echo "$$results" | grep -c '^FAIL'`;                      \
-       pass=`echo "$$results" | grep -c '^PASS'`;                      \
-       skip=`echo "$$results" | grep -c '^SKIP'`;                      \
-       xfail=`echo "$$results" | grep -c '^XFAIL'`;                    \
-       xpass=`echo "$$results" | grep -c '^XPASS'`;                    \
-       failures=`expr $$fail + $$xpass`;                               \
-       all=`expr $$all - $$skip`;                                      \
-       if test "$$all" -eq 1; then tests=test; All=;                   \
-       else tests=tests; All="All "; fi;                               \
-       case fail=$$fail:xpass=$$xpass:xfail=$$xfail in                 \
-         fail=0:xpass=0:xfail=0)                                       \
-           msg="$$All$$all $$tests passed.  ";                         \
-           exit=true;;                                                 \
-         fail=0:xpass=0:xfail=*)                                       \
-           msg="$$All$$all $$tests behaved as expected";               \
-           if test "$$xfail" -eq 1; then xfailures=failure;            \
-           else xfailures=failures; fi;                                \
-           msg="$$msg ($$xfail expected $$xfailures).  ";              \
-           exit=true;;                                                 \
-         fail=*:xpass=0:xfail=*)                                       \
-           msg="$$fail of $$all $$tests failed.  ";                    \
-           exit=false;;                                                \
-         fail=*:xpass=*:xfail=*)                                       \
-           msg="$$failures of $$all $$tests did not behave as expected"; \
-           if test "$$xpass" -eq 1; then xpasses=pass;                 \
-           else xpasses=passes; fi;                                    \
-           msg="$$msg ($$xpass unexpected $$xpasses).  ";              \
-           exit=false;;                                                \
-         *)                                                            \
-           echo >&2 "incorrect case"; exit 4;;                         \
-       esac;                                                           \
-       if test "$$skip" -ne 0; then                                    \
-         if test "$$skip" -eq 1; then                                  \
-           msg="$$msg($$skip test was not run).  ";                    \
-         else                                                          \
-           msg="$$msg($$skip tests were not run).  ";                  \
-         fi;                                                           \
-       fi;                                                             \
-       {                                                               \
-         echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |       \
-           $(am__rst_title);                                           \
-         echo "$$msg";                                                 \
-         echo;                                                         \
-         echo ".. contents:: :depth: 2";                               \
-         echo;                                                         \
-         for f in $$list; do                                           \
-           read line < $$f;                                            \
-           case $$line in                                              \
-             PASS:*|XFAIL:*);;                                         \
-             *) echo; cat $$f;;                                        \
-           esac;                                                       \
-         done;                                                         \
-       } >$(TEST_SUITE_LOG).tmp;                                       \
-       mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);                     \
-       if test "$$failures" -ne 0; then                                \
-         msg="$${msg}See $(subdir)/$(TEST_SUITE_LOG).  ";              \
-         if test -n "$(PACKAGE_BUGREPORT)"; then                       \
-           msg="$${msg}Please report to $(PACKAGE_BUGREPORT).  ";      \
-         fi;                                                           \
-       fi;                                                             \
-       test x"$$VERBOSE" = x || $$exit || cat $(TEST_SUITE_LOG);       \
-       $(am__tty_colors);                                              \
-       if $$exit; then                                                 \
-         echo $(ECHO_N) "$$grn$(ECHO_C)";                              \
-        else                                                           \
-         echo $(ECHO_N) "$$red$(ECHO_C)";                              \
-       fi;                                                             \
-       echo "$$msg" | $(am__text_box);                                 \
-       echo $(ECHO_N) "$$std$(ECHO_C)";                                \
-       $$exit
-
-# Run all the tests.
-check-TESTS:
-       @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
-       @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
-       @list='$(TEST_LOGS)';                                           \
-       list=`for f in $$list; do                                       \
-         test .log = $$f || echo $$f;                                  \
-       done | tr '\012\015' '  '`;                                     \
-       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$list"
-
-.log.html:
-       @list='$(RST2HTML) $$RST2HTML rst2html rst2html.py';            \
-       for r2h in $$list; do                                           \
-         if ($$r2h --version) >/dev/null 2>&1; then                    \
-           R2H=$$r2h;                                                  \
-         fi;                                                           \
-       done;                                                           \
-       if test -z "$$R2H"; then                                        \
-         echo >&2 "cannot find rst2html, cannot create $@";            \
-         exit 2;                                                       \
-       fi;                                                             \
-       $$R2H $< >$@.tmp
-       @mv $@.tmp $@
-
-# Be sure to run check first, and then to convert the result.
-# Beware of concurrent executions.  Run "check" not "check-TESTS", as
-# check-SCRIPTS and other dependencies are rebuilt by the former only.
-# And expect check to fail.
-check-html:
-       @if $(MAKE) $(AM_MAKEFLAGS) check; then                 \
-         rv=0; else rv=$$?;                                    \
-       fi;                                                     \
-       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_HTML) || exit 4;   \
-       exit $$rv
-recheck recheck-html:
-       @target=`echo $@ | sed 's,^re,,'`;                              \
-       list='$(TEST_LOGS)';                                            \
-       list=`for f in $$list; do                                       \
-               test -f $$f || continue;                                \
-               if read line < $$f; then                                \
-                 case $$line in FAIL*|XPASS*) echo $$f;; esac;         \
-               else echo $$f; fi;                                      \
-             done | tr '\012\015' '  '`;                               \
-       $(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS="'"$$list"'"'
-tests/helin-segv.log: tests/helin-segv
-       @p='tests/helin-segv'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
-tests/memcpy-abuse.log: tests/memcpy-abuse
-       @p='tests/memcpy-abuse'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
-tests/trailing-nul.log: tests/trailing-nul
-       @p='tests/trailing-nul'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
-tests/zdiff.log: tests/zdiff
-       @p='tests/zdiff'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
-tests/zgrep-f.log: tests/zgrep-f
-       @p='tests/zgrep-f'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
-.test.log:
-       @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
-@am__EXEEXT_TRUE@.test$(EXEEXT).log:
-@am__EXEEXT_TRUE@      @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
-
 distdir: $(DISTFILES)
        @list='$(MANS)'; if test -n "$$list"; then \
          list=`for p in $$list; do \
@@ -1583,10 +1744,10 @@ distdir: $(DISTFILES)
            if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
          if test -n "$$list" && \
            grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-           echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+           echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
            grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
            echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-           echo "       typically \`make maintainer-clean' will remove them" >&2; \
+           echo "       typically 'make maintainer-clean' will remove them" >&2; \
            exit 1; \
          else :; fi; \
        else :; fi
@@ -1623,13 +1784,10 @@ distdir: $(DISTFILES)
        done
        @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
          if test "$$subdir" = .; then :; else \
-           test -d "$(distdir)/$$subdir" \
-           || $(MKDIR_P) "$(distdir)/$$subdir" \
-           || exit 1; \
-         fi; \
-       done
-       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
+           $(am__make_dryrun) \
+             || test -d "$(distdir)/$$subdir" \
+             || $(MKDIR_P) "$(distdir)/$$subdir" \
+             || exit 1; \
            dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
            $(am__relativize); \
            new_distdir=$$reldir; \
@@ -1664,14 +1822,14 @@ dist-gzip: distdir
        $(am__post_remove_distdir)
 
 dist-bzip2: distdir
-       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
        $(am__post_remove_distdir)
 
-dist-lzma: distdir
-       tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+dist-lzip: distdir
+       tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
        $(am__post_remove_distdir)
 dist-xz: distdir
-       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
        $(am__post_remove_distdir)
 
 dist-tarZ: distdir
@@ -1700,8 +1858,8 @@ distcheck: dist
          GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
        *.tar.bz2*) \
          bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
-       *.tar.lzma*) \
-         lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.lz*) \
+         lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
        *.tar.xz*) \
          xz -dc $(distdir).tar.xz | $(am__untar) ;;\
        *.tar.Z*) \
@@ -1718,9 +1876,11 @@ distcheck: dist
        test -d $(distdir)/_build || exit 0; \
        dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
          && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \
          && am__cwd=`pwd` \
          && $(am__cd) $(distdir)/_build \
          && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+           $(AM_DISTCHECK_CONFIGURE_FLAGS) \
            $(DISTCHECK_CONFIGURE_FLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -1749,8 +1909,16 @@ distcheck: dist
          list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
          sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-       @$(am__cd) '$(distuninstallcheck_dir)' \
-       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+       @test -n '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: trying to run $@ with an empty' \
+              '$$(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       $(am__cd) '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
           || { echo "ERROR: files left after uninstall:" ; \
                if test -n "$(DESTDIR)"; then \
                  echo "  (check DESTDIR support)"; \
@@ -1767,15 +1935,18 @@ distcleancheck: distclean
               $(distcleancheck_listfiles) ; \
               exit 1; } >&2
 check-am: all-am
-       $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
-check: check-recursive
-all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS)
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-recursive
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) \
+               $(HEADERS)
 installdirs: installdirs-recursive
 installdirs-am:
        for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
-install: install-recursive
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-recursive
 install-exec: install-exec-recursive
 install-data: install-data-recursive
 uninstall: uninstall-recursive
@@ -1785,30 +1956,34 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
        -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-       -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
-       -test -z "$(TEST_LOGS_TMP)" || rm -f $(TEST_LOGS_TMP)
-       -test -z "$(TEST_SUITE_HTML)" || rm -f $(TEST_SUITE_HTML)
-       -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
 
 clean-generic:
 
 distclean-generic:
        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
        -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
        -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 clean: clean-recursive
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \
+       mostlyclean-am
 
 distclean: distclean-recursive
        -rm -f $(am__CONFIG_DISTCLEAN_FILES)
@@ -1882,32 +2057,42 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
 
 uninstall-man: uninstall-man1
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
-       check-html cscopelist-recursive ctags-recursive install-am \
-       install-exec-am install-strip recheck recheck-html \
-       tags-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
+       check-am cscopelist-recursive ctags-recursive install \
+       install-am install-exec-am install-strip tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am am--refresh check check-TESTS check-am check-html \
-       check-local clean clean-binPROGRAMS clean-cscope clean-generic \
-       cscope cscopelist cscopelist-recursive ctags ctags-recursive \
-       dist dist-all dist-bzip2 dist-gzip dist-hook dist-lzma \
-       dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
-       distclean-compile distclean-generic distclean-tags \
-       distcleancheck distdir distuninstallcheck dvi dvi-am html \
-       html-am info info-am install install-am install-binPROGRAMS \
-       install-binSCRIPTS install-data install-data-am install-dvi \
-       install-dvi-am install-exec install-exec-am install-exec-hook \
-       install-html install-html-am install-info install-info-am \
-       install-man install-man1 install-pdf install-pdf-am install-ps \
-       install-ps-am install-strip installcheck installcheck-am \
-       installdirs installdirs-am maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-       mostlyclean-generic pdf pdf-am ps ps-am recheck recheck-html \
-       tags tags-recursive uninstall uninstall-am \
+       all all-am am--refresh check check-am check-local clean \
+       clean-binPROGRAMS clean-cscope clean-generic \
+       clean-noinstLIBRARIES cscope cscopelist cscopelist-recursive \
+       ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+       dist-hook dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
+       distcheck distclean distclean-compile distclean-generic \
+       distclean-tags distcleancheck distdir distuninstallcheck dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-binPROGRAMS install-binSCRIPTS install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-exec-hook install-html install-html-am \
+       install-info install-info-am install-man install-man1 \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+       ps ps-am tags tags-recursive uninstall uninstall-am \
        uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-local \
        uninstall-man uninstall-man1
 
+version.c: Makefile
+       $(AM_V_GEN)rm -f $@
+       $(AM_V_at)printf '#include <config.h>\n' > $@t
+       $(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
+       $(AM_V_at)chmod a-w $@t
+       $(AM_V_at)mv $@t $@
+version.h: Makefile
+       $(AM_V_GEN)rm -f $@
+       $(AM_V_at)printf 'extern char const *Version;\n' > $@t
+       $(AM_V_at)chmod a-w $@t
+       $(AM_V_at)mv $@t $@
 
 gzip.doc: gzip.1
        $(AM_V_GEN)groff -man -Tascii $(srcdir)/gzip.1 | col -b | uniq > $@-t \
@@ -1946,10 +2131,6 @@ check-local: $(FILES_TO_CHECK) $(bin_PROGRAMS) gzip.doc.gz
        for file in $(FILES_TO_CHECK); do \
          ./gzip -cv -- "$$file" | ./gzip -d | cmp - "$$file" || exit 1; \
        done
-       ./gzip -dc $(srcdir)/tests/hufts-segv.gz > /dev/null 2>&1; \
-         test $$? = 1
-       k=in-$$$$; printf a | ./gzip > $$k && \
-         test "`cat $$k | ./gzip -dc $$k - $$k`" = aaa && rm $$k
        @echo 'Test succeeded.'
 
 install-exec-hook: remove-installed-links
@@ -1979,6 +2160,8 @@ install-exec-hook remove-installed-links:
        done
 
 uninstall-local: remove-installed-links
+distcheck-hook:
+       $(MAKE) my-distcheck
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/NEWS b/NEWS
index 8370882e59e5fd3dbb29962fced190b55620ab5d..f9e48e87bf35b13715b9e914e4b7db454ab69725 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,28 @@
 GNU gzip NEWS                                    -*- outline -*-
 
+* Noteworthy changes in release 1.5 (2012-06-17) [stable]
+
+** Bug fixes
+
+  gzip -d now decodes and checks header CRC16 checksums as specified by
+  the FHCRC section of Internet RFC 1952.
+
+  "gzip -d -S '' precious.gz" is now rejected immediately.  Before,
+  that command would emulate "rm -i precious.gz", but with an easily-
+  misunderstood prompt.  I.e., gzip would ask if it's ok to remove the
+  existing file, "precious.gz".  If you made the mistake of saying "yes",
+  it would remove that input file before attempting to uncompress it.
+
+  gzip -cdf now properly handles input consisting of gzip'd data followed
+  by uncompressed data.  Before it would output raw compressed input, too.
+  For example, now "(printf x|gzip; echo y)|gzip -dcf" prints "xy\n",
+  while before it would print "x<compressed data>y\n".
+
+  gzip -rf no longer compresses files more than once (e.g., replacing
+  FOO with FOO.gz.gz) on file systems such as ZFS where a readdir
+  loop that unlinks and creates files can revisit output files.
+
+
 * Noteworthy changes in release 1.4 (2010-01-20) [stable]
 
 ** Bug fixes
@@ -33,6 +56,8 @@ GNU gzip NEWS                                    -*- outline -*-
 
 * Noteworthy changes in release 1.3.13 (2009-09-30) [stable]
 
+** 'gzip -f foo.gz' now creates a file foo.gz.gz instead of complaining.
+
 ** Bug fixes
 
   gzip -d no longer fails with "-" as 2nd or subsequent argument
@@ -46,8 +71,6 @@ Major changes in Gzip 1.3.12 (2007-04-13)
 
 * znew now uses $TMPDIR (default /tmp) instead of always using /tmp.
 
-* 'gzip -f foo.gz' now creates a file foo.gz.gz instead of complaining.
-
 * It is now documented that gzip ignores case when examining file name
   extensions; for example, 'gzip test.Gz' (without -f) fails because
   the file name ends in '.Gz'.
@@ -383,7 +406,7 @@ Major changes form 0.5 to 0.6:
 
 ========================================================================
 
-Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2010 Free Software Foundation,
+Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2012 Free Software Foundation,
 Inc.
 Copyright (C) 1992, 1993 Jean-loup Gailly
 
diff --git a/README b/README
index 4637ba6790698fdf6bb55d2661fbe60a764ff4d1..772145c3d29419fea5cb13dfaf97bb948066145e 100644 (file)
--- a/README
+++ b/README
@@ -85,7 +85,7 @@ Many thanks to those who provided me with bug reports and feedback.
 See the files THANKS and ChangeLog for more details.
 
 
-               Note about zip vs. gzip:
+                Note about zip vs. gzip:
 
 The name 'gzip' was a very unfortunate choice, because zip and gzip
 are two really different programs, although the actual compression and
@@ -119,14 +119,17 @@ error recovery features.)
 
 gzip and gunzip are distributed as a single program. zip and unzip
 are, for historical reasons, two separate programs, although the
-authors of these two programs work closely together in the info-zip
+authors of these two programs work closely together in the Info-ZIP
 team. zip and unzip are not associated with the GNU project.
-See http://www.cdrom.com/pub/infozip/ for more about zip and unzip.
+See http://info-zip.org/ for more about zip and unzip.
 
 
+For any copyright year range specified as YYYY-ZZZZ in this package
+note that the range specifies every single year in that closed interval.
+
 ========================================================================
 
-Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2010 Free Software Foundation,
+Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2012 Free Software Foundation,
 Inc.
 Copyright (C) 1992, 1993 Jean-loup Gailly
 
diff --git a/README-release b/README-release
new file mode 100644 (file)
index 0000000..ebaa150
--- /dev/null
@@ -0,0 +1,100 @@
+Here are most of the steps we (maintainers) follow when making a release.
+
+* Start from a clean, up-to-date git directory on "master":
+
+    make -k maintainer-clean || { ./configure && make maintainer-clean; }
+    git checkout master
+    git pull origin master
+
+* Ensure that the latest stable versions of autoconf, automake, etc.
+  are in your PATH.  See the buildreq list in bootstrap.conf for
+  the complete list of tools.
+
+* Ensure that you have no uncommitted diffs.  This should produce no
+  output:
+
+    git diff
+
+* Ensure that you've pushed all changes that belong in the release:
+
+    git push origin master
+
+* Check that the NixOS/Hydra autobuilder is reporting all is well:
+
+    http://hydra.nixos.org/jobset/gnu/gzip-master
+
+* Run the following command to download any new translations:
+
+    ./bootstrap && ./configure
+
+* Pre-release testing: ensure that the following command succeeds:
+
+    make check syntax-check distcheck
+
+* From top_srcdir, run:
+
+    build-aux/do-release-commit-and-tag X.Y stable
+
+  in order to (i) set the date, version number, and release type
+  [stable/alpha/beta] on line 3 of NEWS, (ii) commit that, and (iii) tag the
+  release.  See --help if you need options such as:
+
+    build-aux/do-release-commit-and-tag --branch=maint -C _build X.Y.Z stable
+
+* Run the following to create release tarballs.  Your choice selects the
+  corresponding upload-to destination in the emitted gnupload command.
+  The different destinations are specified in cfg.mk.  See the definitions
+  of gnu_ftp_host-{alpha,beta,stable}.
+
+    # "TYPE" must be stable, beta or alpha
+    make TYPE
+
+* Test the tarball.  Copy it to a few odd-ball systems and ensure that
+  it builds and passes all tests.
+
+* While that's happening, write the release announcement that you will
+  soon post.  Start with the template, $HOME/announce-gzip-X.Y
+  that was just created by that "make" command.
+
+Once all the builds and tests have passed,
+
+* Run the gnupload command that was suggested by your "make TYPE" run above.
+
+* Wait a few minutes (maybe up to 30?) and then use the release URLs to
+  download all tarball/signature pairs and use gpg --verify to ensure
+  that they're all valid.
+
+* Push the NEWS-updating changes and the new tag:
+
+    v=$(cat .prev-version)
+    git push origin master tag v$v
+
+* Announce it on Savannah first, so you can include the savannah.org
+  announcement link in the email message.
+
+  From here:
+    https://savannah.gnu.org/projects/gzip/
+  click on "submit news", then write something like the following:
+  (If there is no such button, then enable "News" for the project via
+   the Main -> "Select Features" menu item, or via this link:
+   https://savannah.gnu.org/project/admin/editgroupfeatures.php?group=gzip)
+
+    Subject: gzip-X.Y released [stable]
+    +verbatim+
+    ...paste the announcement here...
+    -verbatim-
+
+  Then go here to approve it:
+    https://savannah.gnu.org/news/approve.php?group=gzip
+
+* Send the announcement email message.
+
+* After each non-alpha release, update the on-line manual accessible via
+
+    http://www.gnu.org/software/gzip/manual/
+
+  by running this from top_srcdir:
+
+    build-aux/gnu-web-doc-update
+
+  possibly with "-C <BUILDDIR>"
diff --git a/THANKS b/THANKS
index 183d39ce9f71e96594d9c1ed0496b28c8a9f3342..713558b36af9603fc893297ebc87e828d93d4bd2 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -74,6 +74,7 @@ Paul Eggert             eggert@cs.ucla.edu
 Enami                   enami@sys.ptg.sony.co.jp
 Kristoffer Eriksson     ske@pkmab.se
 Daniel Eriksson         m91der@bellatrix.tdb.uu.se
+Denis Excoffier         3.1416@free.fr
 Rik Faith               faith@cs.unc.edu
 Larry Fahnoe            fahnoe@c1mpls.mn.org
 Cristian Ferretti       cfs@poincare.mat.puc.cl
@@ -203,6 +204,7 @@ Pascal Petit            petit@cadillac.ibp.fr
 Bruno Pillard          bp@chorus.fr
 Franc,ois Pinard        pinard@iro.umontreal.ca
 Jay Pinkos              pinkos@butyng.bu.edu
+Petr PísaÅ™              petr.pisar@atlas.cz
 Thomas Plass            thomas@cogsci.ed.ac.uk
 Mike Polo               mikep@cfsmo.honeywell.com
 Francesco Potorti       pot@fly.cnuce.cnr.it
@@ -237,6 +239,7 @@ Amos Shapira            amoss@cs.huji.ac.il
 Rick Sladkey            jrs@world.std.com
 Daniel L Smith          dls@autodesk.com
 Fred Smith              fredex%fcshome@merk.merk.com
+Ripduman Sohan          Ripduman.Sohan@cl.cam.ac.uk
 Stephen Soliday         soliday@ncat.edu
 Paul Southworth         pauls@css.itd.umich.edu
 Rob Spencer             robbie@winkle.bhpese.oz.au
diff --git a/TODO b/TODO
index b14710623d92c09a163bc48b3b6e24aa831c5502..78ebe99dd96e90d95d8d73bedee010aeb1fa4328 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,8 +2,9 @@ TODO file for gzip.
 
 Some of the planned features include:
 
-- Remove some of the old porting cruft, since we no longer support
-  PRIMOS etc. any more.
+- Remove some of the old porting cruft. since we no longer support
+  FIXME-2011: in mid to late 2011, remove the following directories:
+  amiga, atari, msdos, nt, os2, vms
 
 - Separate out the shell scripts like gzexe into a new little package;
   these scripts are less used and less reliable and should be optional.
@@ -72,7 +73,7 @@ Send comments to <bug-gzip@gnu.org>.
 
 ========================================================================
 
-Copyright (C) 1999, 2001, 2006, 2009-2010 Free Software Foundation, Inc.
+Copyright (C) 1999, 2001, 2006, 2009-2012 Free Software Foundation, Inc.
 Copyright (C) 1992, 1993 Jean-loup Gailly
 
 Permission is granted to copy, distribute and/or modify this document
index 764d3344d0c2f9014184b4888446a9c2533e8afd..bf7d4f8970ab747c2936d353eb2b46041819e3ea 100644 (file)
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.11a -*- Autoconf -*-
+# generated automatically by aclocal 1.12a -*- Autoconf -*-
+
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 # This file 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.
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65.23-13e35],,
-[m4_warning([this file was generated for autoconf 2.65.23-13e35.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69.4-560f],,
+[m4_warning([this file was generated for autoconf 2.69.4-560f.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# po.m4 serial 15 (gettext-0.17)
-dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
+# po.m4 serial 17 (gettext-0.18)
+dnl Copyright (C) 1995-2010 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.
@@ -38,7 +38,7 @@ dnl Authors:
 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
-AC_PREREQ(2.50)
+AC_PREREQ([2.50])
 
 dnl Checks for all prerequisites of the po subdirectory.
 AC_DEFUN([AM_PO_SUBDIRS],
@@ -50,7 +50,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
 
   dnl Release version of the gettext macros. This is used to ensure that
   dnl the gettext macros and po/Makefile.in.in are in sync.
-  AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
+  AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
 
   dnl Perform the following tests also if --disable-nls has been given,
   dnl because they are needed for "make dist" to work.
@@ -62,7 +62,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
     [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
      (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
     :)
-  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+  AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
 
   dnl Test whether it is GNU msgfmt >= 0.15.
 changequote(,)dnl
@@ -469,22 +469,24 @@ AC_DEFUN([AM_XGETTEXT_OPTION],
   XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
 ])
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
+# serial 8
+
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11a'
+[am__api_version='1.12a'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11a], [],
+m4_if([$1], [1.12a], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -500,22 +502,24 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11a])dnl
+[AM_AUTOMAKE_VERSION([1.12a])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
+# serial 2
+
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
 #
 # Of course, Automake must honor this variable whenever it calls a
 # tool from the auxiliary directory.  The problem is that $srcdir (and
@@ -534,7 +538,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 #
 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
 # are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
+# harmless because $srcdir is '.', but things will broke when you
 # start a VPATH build or use an absolute $srcdir.
 #
 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
@@ -560,22 +564,21 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 9
+# serial 10
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
 AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
 AC_SUBST([$1_TRUE])dnl
 AC_SUBST([$1_FALSE])dnl
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
@@ -594,16 +597,15 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 10
+# serial 17
 
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
 # will think it sees a *use*, and therefore will trigger all it's
 # C support machinery.  Also note that it means that autoscan, seeing
@@ -613,7 +615,7 @@ fi])])
 # _AM_DEPENDENCIES(NAME)
 # ----------------------
 # See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
 # We try a few techniques and use that to set a single cache variable.
 #
 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -626,12 +628,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
 AC_REQUIRE([AM_DEP_TRACK])dnl
 
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
 
 AC_CACHE_CHECK([dependency style of $depcc],
                [am_cv_$1_dependencies_compiler_type],
@@ -639,8 +642,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -679,16 +683,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -697,16 +701,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # 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
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -754,7 +758,7 @@ AM_CONDITIONAL([am__fastdep$1], [
 # AM_SET_DEPDIR
 # -------------
 # Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
 AC_DEFUN([AM_SET_DEPDIR],
 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -764,34 +768,40 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 # AM_DEP_TRACK
 # ------------
 AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
-#serial 5
+# serial 7
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 [{
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -804,7 +814,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
     # Strip MF so we end up with the name of the file.
     mf=`echo "$mf" | sed -e 's/:.*$//'`
     # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
+    # We used to match only the files named 'Makefile.in', but
     # some people rename them; so instead we look at the file content.
     # Grep'ing the first line is not enough: some people post-process
     # each Makefile.in and add a new line on top of each file to say so.
@@ -816,21 +826,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # from the Makefile without running 'make'.
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
     test -z "am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  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 "
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`AS_DIRNAME(["$file"])`
@@ -848,7 +856,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
 # This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
+# is enabled.  FIXME.  This creates each '.P' file that we will
 # need in order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
@@ -858,31 +866,21 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 16
+# serial 22
 
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 # AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out.  PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition.  After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
+# ---------------------------
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -909,33 +907,34 @@ fi
 AC_SUBST([CYGPATH_W])
 
 # Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
+dnl Error out on old-style AM_INIT_AUTOMAKE calls.
+m4_ifval([$2], [m4_fatal(
+[$0: old-style two- and three-arguments forms are now unsupported.  For more info:
+http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])])
+_AM_SET_OPTIONS([$1])dnl
 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])dnl
 
 _AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
 
 # Some tools Automake needs.
 AC_REQUIRE([AM_SANITY_CHECK])dnl
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
@@ -946,28 +945,32 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
                             [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-                 [_AM_DEPENDENCIES(CC)],
-                 [define([AC_PROG_CC],
-                         defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+                 [_AM_DEPENDENCIES([CC])],
+                 [m4_define([AC_PROG_CC],
+                            m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                 [_AM_DEPENDENCIES(CXX)],
-                 [define([AC_PROG_CXX],
-                         defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+                 [_AM_DEPENDENCIES([CXX])],
+                 [m4_define([AC_PROG_CXX],
+                            m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-                 [_AM_DEPENDENCIES(OBJC)],
-                 [define([AC_PROG_OBJC],
-                         defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+                 [_AM_DEPENDENCIES([OBJC])],
+                 [m4_define([AC_PROG_OBJC],
+                            m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+                 [_AM_DEPENDENCIES([OBJCXX])],
+                 [m4_define([AC_PROG_OBJCXX],
+                            m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
 ])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 ])
 
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
 dnl mangled by Autoconf and run in a shell conditional statement.
 m4_define([_AC_COMPILER_EXEEXT],
@@ -995,12 +998,14 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
+# serial 8
+
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
@@ -1014,9 +1019,9 @@ if test x"${install_sh}" != xset; then
     install_sh="\${SHELL} $am_aux_dir/install-sh"
   esac
 fi
-AC_SUBST(install_sh)])
+AC_SUBST([install_sh])])
 
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1039,13 +1044,13 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 4
+# serial 5
 
 # AM_MAKE_INCLUDE()
 # -----------------
@@ -1064,7 +1069,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
 case `$am_make -s -f confmf 2> /dev/null` in #(
 *the\ am__doit\ target*)
   am__include=include
@@ -1089,8 +1094,7 @@ AC_MSG_RESULT([$_am_result])
 rm -f confinc confmf
 ])
 
-# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1126,14 +1130,13 @@ m4_define([AC_PROG_CC],
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 6
+# serial 7
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -1163,45 +1166,19 @@ if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
+  AC_MSG_WARN(['missing' script is too old or missing])
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
-#
-# This file 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.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
-  [[\\/$]]* | ?:[[\\/]]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 4
+# serial 6
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -1209,13 +1186,13 @@ AC_DEFUN([_AM_MANGLE_OPTION],
 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
 # _AM_SET_OPTION(NAME)
-# ------------------------------
+# --------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
 
 # _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
+# ------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -1228,14 +1205,13 @@ AC_DEFUN([_AM_IF_OPTION],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 6
+# serial 9
 
 # AM_SANITY_CHECK
 # ---------------
@@ -1251,23 +1227,23 @@ case `pwd` in
 esac
 case $srcdir in
   *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
-    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
+   am_has_slept=no
    for am_try in 1 2; do
-     echo timestamp > conftest.file
+     echo "timestamp, slept: $am_has_slept" > conftest.file
      set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
      if test "$[*]" = "X"; then
        # -L didn't work.
        set X `ls -t "$srcdir/configure" conftest.file`
      fi
-     rm -f conftest.file
      if test "$[*]" != "X $srcdir/configure conftest.file" \
        && test "$[*]" != "X conftest.file $srcdir/configure"; then
 
@@ -1283,6 +1259,7 @@ if (
      fi
      # Just in case.
      sleep 1
+     am_has_slept=yes
    done
    test "$[2]" = conftest.file
    )
@@ -1293,70 +1270,123 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
 
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 1
+# serial 3
 
 # AM_SILENT_RULES([DEFAULT])
 # --------------------------
 # Enable less verbose build rules; with the default set to DEFAULT
-# (`yes' being less verbose, `no' or empty being verbose).
+# ("yes" being less verbose, "no" or empty being verbose).
 AC_DEFUN([AM_SILENT_RULES],
-[AC_ARG_ENABLE([silent-rules],
-[  --enable-silent-rules          less verbose build output (undo: `make V=1')
-  --disable-silent-rules         verbose build output (undo: `make V=0')])
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no)  AM_DEFAULT_VERBOSITY=1;;
-*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
 esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
 AM_BACKSLASH='\'
 AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
+# serial 2
+
 # AM_PROG_INSTALL_STRIP
 # ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# One issue with vendor 'install' (even GNU) is that you can't
 # specify the program used to strip binaries.  This is especially
 # annoying in cross-compiling environments, where the build's strip
 # is unlikely to handle the host's binaries.
 # Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
+# always use install-sh in "make install-strip", and initialize
 # STRIPPROG with the value of the STRIP variable (set by the user).
 AC_DEFUN([AM_PROG_INSTALL_STRIP],
 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
 if test "$cross_compiling" != no; then
   AC_CHECK_TOOL([STRIP], [strip], :)
 fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 2
+# serial 3
 
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
@@ -1365,24 +1395,24 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
 # AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
+# --------------------------
 # Public sister of _AM_SUBST_NOTMAKE.
 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2004-2012 Free Software Foundation, Inc.
 #
 # This file 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.
 
-# serial 2
+# serial 3
 
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
 #
 # Substitute a variable $(am__tar) that is a command
 # writing to stdout a FORMAT-tarball containing the directory
@@ -1393,10 +1423,11 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
 m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
      [m4_case([$1], [ustar],, [pax],,
               [m4_fatal([Unknown tar format])])
 AC_MSG_CHECKING([how to create a $1 tar archive])
@@ -1404,7 +1435,7 @@ AC_MSG_CHECKING([how to create a $1 tar archive])
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
 # Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
+# Solaris sh will not grok spaces in the rhs of '-'.
 for _am_tool in $_am_tools
 do
   case $_am_tool in
@@ -1467,25 +1498,26 @@ AC_SUBST([am__untar])
 
 m4_include([m4/00gnulib.m4])
 m4_include([m4/alloca.m4])
+m4_include([m4/asm-underscore.m4])
 m4_include([m4/calloc.m4])
 m4_include([m4/chdir-long.m4])
-m4_include([m4/chown.m4])
 m4_include([m4/clock_time.m4])
 m4_include([m4/close-stream.m4])
 m4_include([m4/close.m4])
+m4_include([m4/closedir.m4])
 m4_include([m4/closein.m4])
 m4_include([m4/closeout.m4])
 m4_include([m4/codeset.m4])
-m4_include([m4/d-ino.m4])
+m4_include([m4/configmake.m4])
+m4_include([m4/dirent-safer.m4])
 m4_include([m4/dirent_h.m4])
 m4_include([m4/dirfd.m4])
 m4_include([m4/dirname.m4])
-m4_include([m4/dos.m4])
 m4_include([m4/double-slash-root.m4])
+m4_include([m4/dup.m4])
 m4_include([m4/dup2.m4])
 m4_include([m4/errno_h.m4])
 m4_include([m4/error.m4])
-m4_include([m4/exitfail.m4])
 m4_include([m4/exponentd.m4])
 m4_include([m4/exponentf.m4])
 m4_include([m4/exponentl.m4])
@@ -1498,6 +1530,7 @@ m4_include([m4/fcntl.m4])
 m4_include([m4/fcntl_h.m4])
 m4_include([m4/fdopendir.m4])
 m4_include([m4/fflush.m4])
+m4_include([m4/filenamecat.m4])
 m4_include([m4/float_h.m4])
 m4_include([m4/fpending.m4])
 m4_include([m4/fpieee.m4])
@@ -1506,11 +1539,13 @@ m4_include([m4/fpurge.m4])
 m4_include([m4/freading.m4])
 m4_include([m4/frexp.m4])
 m4_include([m4/frexpl.m4])
+m4_include([m4/fseek.m4])
 m4_include([m4/fseeko.m4])
+m4_include([m4/fstat.m4])
+m4_include([m4/ftell.m4])
 m4_include([m4/ftello.m4])
-m4_include([m4/getcwd-abort-bug.m4])
-m4_include([m4/getcwd-path-max.m4])
 m4_include([m4/getcwd.m4])
+m4_include([m4/getdtablesize.m4])
 m4_include([m4/getopt.m4])
 m4_include([m4/gettime.m4])
 m4_include([m4/gettimeofday.m4])
@@ -1525,12 +1560,17 @@ m4_include([m4/inttypes_h.m4])
 m4_include([m4/isnand.m4])
 m4_include([m4/isnanf.m4])
 m4_include([m4/isnanl.m4])
-m4_include([m4/lchown.m4])
+m4_include([m4/largefile.m4])
 m4_include([m4/ldexpl.m4])
+m4_include([m4/lib-ignore.m4])
+m4_include([m4/lib-ld.m4])
+m4_include([m4/lib-link.m4])
+m4_include([m4/lib-prefix.m4])
 m4_include([m4/localcharset.m4])
 m4_include([m4/locale-fr.m4])
 m4_include([m4/locale-ja.m4])
 m4_include([m4/locale-zh.m4])
+m4_include([m4/lock.m4])
 m4_include([m4/longlong.m4])
 m4_include([m4/lseek.m4])
 m4_include([m4/lstat.m4])
@@ -1543,25 +1583,31 @@ m4_include([m4/mbstate_t.m4])
 m4_include([m4/memchr.m4])
 m4_include([m4/mempcpy.m4])
 m4_include([m4/memrchr.m4])
-m4_include([m4/mkdir.m4])
 m4_include([m4/mmap-anon.m4])
 m4_include([m4/mode_t.m4])
+m4_include([m4/msvc-inval.m4])
+m4_include([m4/msvc-nothrow.m4])
 m4_include([m4/multiarch.m4])
 m4_include([m4/nocrash.m4])
+m4_include([m4/off_t.m4])
 m4_include([m4/open.m4])
 m4_include([m4/openat.m4])
+m4_include([m4/opendir.m4])
+m4_include([m4/pathmax.m4])
 m4_include([m4/perror.m4])
 m4_include([m4/printf-frexp.m4])
 m4_include([m4/printf-frexpl.m4])
 m4_include([m4/printf-posix-rpl.m4])
 m4_include([m4/printf.m4])
 m4_include([m4/quotearg.m4])
+m4_include([m4/readdir.m4])
 m4_include([m4/realloc.m4])
-m4_include([m4/rmdir.m4])
 m4_include([m4/save-cwd.m4])
+m4_include([m4/savedir.m4])
 m4_include([m4/shell.m4])
 m4_include([m4/signbit.m4])
 m4_include([m4/size_max.m4])
+m4_include([m4/ssize_t.m4])
 m4_include([m4/stat-time.m4])
 m4_include([m4/stat.m4])
 m4_include([m4/stdbool.m4])
@@ -1572,14 +1618,17 @@ m4_include([m4/stdio_h.m4])
 m4_include([m4/stdlib_h.m4])
 m4_include([m4/strdup.m4])
 m4_include([m4/strerror.m4])
+m4_include([m4/strerror_r.m4])
 m4_include([m4/string_h.m4])
+m4_include([m4/sys_socket_h.m4])
 m4_include([m4/sys_stat_h.m4])
 m4_include([m4/sys_time_h.m4])
+m4_include([m4/sys_types_h.m4])
+m4_include([m4/threadlib.m4])
 m4_include([m4/time_h.m4])
 m4_include([m4/timespec.m4])
 m4_include([m4/unistd-safer.m4])
 m4_include([m4/unistd_h.m4])
-m4_include([m4/unlink.m4])
 m4_include([m4/utimbuf.m4])
 m4_include([m4/utimens.m4])
 m4_include([m4/utimes.m4])
@@ -1587,11 +1636,10 @@ m4_include([m4/vasnprintf.m4])
 m4_include([m4/vfprintf-posix.m4])
 m4_include([m4/warn-on-use.m4])
 m4_include([m4/warnings.m4])
-m4_include([m4/wchar.m4])
+m4_include([m4/wchar_h.m4])
 m4_include([m4/wchar_t.m4])
-m4_include([m4/wctype.m4])
+m4_include([m4/wctype_h.m4])
 m4_include([m4/wint_t.m4])
 m4_include([m4/xalloc.m4])
-m4_include([m4/xgetcwd.m4])
 m4_include([m4/xsize.m4])
 m4_include([m4/yesno.m4])
index a62800c16d2bb75f622bd4313d3dc8f44c0c7ab2..c8c3a92190ff0e0af0d5bb354d2c4ffe153b5be7 100644 (file)
@@ -1,7 +1,7 @@
 1. Algorithm
 
-The deflation algorithm used by zip and gzip is a variation of LZ77
-(Lempel-Ziv 1977, see reference below). It finds duplicated strings in
+The deflation algorithm used by zip and gzip is a variation of
+Lempel-Ziv 1977 [LZ77].  It finds duplicated strings in
 the input data.  The second occurrence of a string is replaced by a
 pointer to the previous string, in the form of a pair (distance,
 length).  Distances are limited to 32K bytes, and lengths are limited
@@ -57,6 +57,10 @@ but saves time since there are both fewer insertions and fewer searches.
 
 2. gzip file format
 
+The gzip file format was standardized in Internet RFC 1952 [RFC1952].
+This section briefly describes the format and comments on some
+implementation details.
+
 The pkzip format imposes a lot of overhead in various headers, which
 are useful for an archiver but not necessary when only one file is
 compressed. gzip uses a much simpler structure. Numbers are in little
@@ -68,12 +72,11 @@ following structure:
 1 byte   compression method (0..7 reserved, 8 = deflate)
 1 byte   flags
             bit 0 set: file probably ascii text
-            bit 1 set: continuation of multi-part gzip file
+            bit 1 set: header CRC-16 present
             bit 2 set: extra field present
             bit 3 set: original file name present
             bit 4 set: file comment present
-            bit 5 set: file is encrypted
-            bit 6,7:   reserved
+            bit 5,6,7: reserved
 4 bytes  file modification time in Unix format
 1 byte   extra flags (depend on compression method)
 1 byte   operating system on which compression took place
@@ -83,7 +86,7 @@ following structure:
 ? bytes  optional extra field
 ? bytes  optional original file name, zero terminated
 ? bytes  optional file comment, zero terminated
-12 bytes optional encryption header
+2 bytes  optional 16-bit header CRC
 ? bytes  compressed data
 4 bytes  crc32
 4 bytes  uncompressed input size modulo 2^32
@@ -128,7 +131,7 @@ compression format, regardless of the actual size of the compressed
 data. If the compressed data cannot fit in one file (in particular for
 diskettes), each part starts with a header as described above, but
 only the last part has the crc32 and uncompressed size. A decompressor
-may prompt for additional data for multipart compressed files. It is
+may prompt for additional data for multi-part compressed files. It is
 desirable but not mandatory that multiple parts be extractable
 independently so that partial data can be recovered if one of the
 parts is damaged. This is possible only if no compression state is
@@ -145,20 +148,18 @@ a few bytes for the gzip file header, plus 5 bytes every 32K block,
 or an expansion ratio of 0.015% for large files. Note that the actual
 number of used disk blocks almost never increases.
 
-The encryption is that of zip 1.9. For the encryption check, the
-last byte of the decoded encryption header must be zero. The time
-stamp of an encrypted file might be set to zero to avoid giving a clue
-about the construction of the random header.
-
 Jean-loup Gailly
 gzip@gnu.org
 
 References:
 
 [LZ77] Ziv J., Lempel A., "A Universal Algorithm for Sequential Data
-Compression", IEEE Transactions on Information Theory", Vol. 23, No. 3,
-pp. 337-343.
+Compression", IEEE Transactions on Information Theory, Vol. 23, No. 3,
+May 1977, pp. 337-343.
+
+[RFC1952] Deutsch P., "GZIP file format specification version 4.3",
+Internet RFC 1952, May 1996, <http://www.ietf.org/rfc/rfc1952.txt>.
 
-APPNOTE.TXT documentation file in PKZIP 1.93a. It is available by
-ftp in ftp.cso.uiuc.edu:/pc/exec-pc/pkz193a.exe [128.174.5.59]
-Use "unzip pkz193a.exe APPNOTE.TXT" to extract (note: unzip, not gunzip).
+APPNOTE.TXT documentation file in PKZIP 1.93a (October 1991).  This
+version no longer seems to be available online; the latest version is
+in <http://www.pkware.com/documents/casestudies/APPNOTE.TXT>.
diff --git a/amiga/Makefile.gcc b/amiga/Makefile.gcc
deleted file mode 100644 (file)
index 82d46e4..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# Makefile for gzip (GNU zip)    -*- Indented-Text -*-
-# Copyright (C) 1992-1993 Jean-loup Gailly and the Free Software Foundation
-
-# Amiga GCC version, written by Preston Hunt <gt5708a@prism.gatech.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 3, 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.
-
-# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-CC = gcc
-CPP = cpp
-
-CFLAGS = -m68020 -m68881 -O2
-#CFLAGS = -m68000 -O2
-#for the 68000, set below: OBJA=
-CPPFLAGS = -Dmc68020
-LDFLAGS =
-O = .o
-
-SRCS = gzip.c zip.c deflate.c trees.c bits.c unzip.c inflate.c util.c crypt.c\
-       lzw.c unlzw.c unpack.c unlzh.c makecrc.c getopt.c match.S
-
-OBJA = match$O
-
-OBJS = gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O util$O \
-       crypt$O lzw$O unlzw$O unpack$O unlzh$O getopt$O match$O
-
-HDRS = gzip.h lzw.h tailor.h revision.h crypt.h getopt.h
-
-.c.o:
-       $(CC) -c $(DEFS) $(CFLAGS) $<
-
-.PHONY: default all
-all:   gzip
-
-gzip: $(OBJS)
-       $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
-
-gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O: gzip.h tailor.h
-util$O lzw$O unlzw$O unpack$O unlzh$O crypt$O: gzip.h tailor.h
-
-gzip$O unlzw$O: revision.h lzw.h
-
-bits$O unzip$O util$O zip$O: crypt.h
-
-gzip$O getopt$O: getopt.h
-
-match$O: match.S
-       $(CPP) $(CPPFLAGS) match.S > _match.s
-       $(CC) -c _match.s
-       mv _match$O match$O
-       rm -f _match.s
diff --git a/amiga/Makefile.sasc b/amiga/Makefile.sasc
deleted file mode 100644 (file)
index faf15fd..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-# Makefile for gzip (GNU zip)    -*- Indented-Text -*-
-# This Makefile is for SAS/C 6.3 on the Amiga
-# Don't use it with SAS/C 6.2 or earlier versions. These versions will
-# produce incorrect code for trees.c because of a bug in the optimizer.
-# Made by Carsten Steger (carsten.steger@informatik.tu-muenchen.de)
-
-# Some notes on gzip for the Amiga:
-# Due to a strange implementation of the RAM-Disk on Commodore's part
-# you should not use gzip -r on a directory in the RAM-Disk. To zip all
-# files in a directory 'dir' in the RAM-Disk use something like
-# gzip ram:dir/#? ram:dir/#?/#? ...
-# where the number of '#?'s reflects the depth of the directory 'dir'.
-#
-# Alas, the program has it's full functionality only if you have
-# Kickstart 2.0 or higher installed. This affects the expansion of
-# wildcards and the preservation of file access times. You should use
-# a shell that does wildcard expansion under Kickstart 1.3.
-
-
-CC = sc
-
-# If you have a 68020 or more you can define UNALIGNED_OK below
-DEFS = DEF=AMIGA
-LIBS = LIB LIB:scnb.lib
-
-CFLAGS = DATA=FAR NOSTKCHK PARM=R IDIR=
-OPTFLAGS = OPT OPTGO OPTPEEP OPTCOMP=3 OPTDEP=3 OPTRDEP=3
-LDFLAGS = FROM LIB:c.o
-
-OBJS = gzip.o zip.o deflate.o trees.o bits.o unzip.o inflate.o util.o \
-      crypt.o lzw.o unlzw.o unpack.o unlzh.o getopt.o tailor.o match.o
-
-.c.o:
-       $(CC) $(DEFS) $(CFLAGS) $(OPTFLAGS) $<
-.a.o:
-       $(CC) $(DEFS) $(CFLAGS) $<
-
-all: gzip
-
-gzip: $(OBJS)
-       slink $(LDFLAGS) $(OBJS) TO $@ $(LIBS)
-
-gzip.o: gzip.c gzip.h tailor.h revision.h lzw.h getopt.h
-zip.o: zip.c gzip.h tailor.h crypt.h
-deflate.o: deflate.c gzip.h tailor.h lzw.h
-trees.o: trees.c gzip.h tailor.h
-bits.o: bits.c gzip.h tailor.h crypt.h
-unzip.o: unzip.c gzip.h tailor.h crypt.h
-inflate.o: inflate.c gzip.h tailor.h
-util.o: util.c gzip.h tailor.h crypt.h
-lzw.o: lzw.c lzw.h gzip.h tailor.h
-unlzw.o: unlzw.c gzip.h tailor.h lzw.h
-unpack.o: unpack.c gzip.h tailor.h crypt.h
-unlzh.o: unlzh.c gzip.h tailor.h lzw.h
-crypt.o: crypt.c
-getopt.o: getopt.c getopt.h
-tailor.o: tailor.c
-
-match.o: match.a
diff --git a/amiga/match.a b/amiga/match.a
deleted file mode 100644 (file)
index c14a20b..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-; match.a -- optional optimized asm version of longest match in deflate.c
-; Copyright (C) 1992-1993 Jean-loup Gailly
-; This is free software; you can redistribute it and/or modify it under the
-; terms of the GNU General Public License, see the file COPYING.
-
-; Adapted for the Amiga by Carsten Steger <stegerc@informatik.tu-muenchen.de>
-; using the code in match.S.
-; The major change in this code consists of removing all unaligned
-; word accesses, because they cause 68000-based Amigas to crash.
-; For maximum speed, UNALIGNED_OK can be defined in Makefile.sasc.
-; The program will then only run on 68020-based Amigas, though.
-;
-; This code will run with registerized parameters too, unless SAS
-; changes parameter passing conventions between new releases of SAS/C.
-
-
-Cur_Match      reg     d0      ; Must be in d0!
-Best_Len       reg     d1
-Loop_Counter   reg     d2
-Scan_Start     reg     d3
-Scan_End       reg     d4
-Limit          reg     d5
-Chain_Length   reg     d6
-Scan_Test      reg     d7
-Scan           reg     a0
-Match          reg     a1
-Prev_Address   reg     a2
-Scan_Ini       reg     a3
-Match_Ini      reg     a4
-
-MAX_MATCH      equ     258
-MIN_MATCH      equ     3
-WSIZE          equ     32768
-MAX_DIST       equ     WSIZE-MAX_MATCH-MIN_MATCH-1
-
-
-       xref    _max_chain_length
-       xref    _prev_length
-       xref    _prev
-       xref    _window
-       xref    _strstart
-       xref    _good_match
-       xref    _match_start
-       xref    _nice_match
-
-
-       section match,code
-
-       xdef    _match_init
-       xdef    @match_init
-       xdef    _longest_match
-       xdef    @longest_match
-
-
-_match_init:
-@match_init:
-       rts
-
-
-_longest_match:
-       move.l  4(sp),Cur_Match
-@longest_match:
-       ifd     UNALIGNED_OK
-       movem.l d2-d6/a2-a4,-(sp)
-       else
-       movem.l d2-d7/a2-a4,-(sp)
-       endc
-       move.l  _max_chain_length,Chain_Length
-       move.l  _prev_length,Best_Len
-       lea     _prev,Prev_Address
-       lea     _window+MIN_MATCH,Match_Ini
-       move.l  _strstart,Limit
-       move.l  Match_Ini,Scan_Ini
-       add.l   Limit,Scan_Ini
-       subi.w  #MAX_DIST,Limit
-       bhi.b   limit_ok
-       moveq   #0,Limit
-limit_ok:
-       cmp.l   _good_match,Best_Len
-       bcs.b   length_ok
-       lsr.l   #2,Chain_Length
-length_ok:
-       subq.l  #1,Chain_Length
-
-       ifd     UNALIGNED_OK
-
-       move.w  -MIN_MATCH(Scan_Ini),Scan_Start
-       move.w  -MIN_MATCH-1(Scan_Ini,Best_Len),Scan_End
-
-       else
-
-       move.b  -MIN_MATCH(Scan_Ini),Scan_Start
-       lsl.w   #8,Scan_Start
-       move.b  -MIN_MATCH+1(Scan_Ini),Scan_Start
-       move.b  -MIN_MATCH-1(Scan_Ini,Best_Len),Scan_End
-       lsl.w   #8,Scan_End
-       move.b  -MIN_MATCH(Scan_Ini,Best_Len),Scan_End
-
-       endc
-
-       bra.b   do_scan
-
-long_loop:
-
-       ifd     UNALIGNED_OK
-
-       move.w  -MIN_MATCH-1(Scan_Ini,Best_Len),Scan_End
-
-       else
-
-       move.b  -MIN_MATCH-1(Scan_Ini,Best_Len),Scan_End
-       lsl.w   #8,Scan_End
-       move.b  -MIN_MATCH(Scan_Ini,Best_Len),Scan_End
-
-       endc
-
-short_loop:
-       lsl.w   #1,Cur_Match
-       move.w  0(Prev_Address,Cur_Match),Cur_Match
-       cmp.w   Limit,Cur_Match
-       dbls    Chain_Length,do_scan
-       bra.b   return
-
-do_scan:
-       move.l  Match_Ini,Match
-       add.l   Cur_Match,Match
-
-       ifd     UNALIGNED_OK
-
-       cmp.w   -MIN_MATCH-1(Match,Best_Len),Scan_End
-       bne.b   short_loop
-       cmp.w   -MIN_MATCH(Match),Scan_Start
-       bne.b   short_loop
-
-       else
-
-       move.b  -MIN_MATCH-1(Match,Best_Len),Scan_Test
-       lsl.w   #8,Scan_Test
-       move.b  -MIN_MATCH(Match,Best_Len),Scan_Test
-       cmp.w   Scan_Test,Scan_End
-       bne.b   short_loop
-       move.b  -MIN_MATCH(Match),Scan_Test
-       lsl.w   #8,Scan_Test
-       move.b  -MIN_MATCH+1(Match),Scan_Test
-       cmp.w   Scan_Test,Scan_Start
-       bne.b   short_loop
-
-       endc
-
-       move.w  #(MAX_MATCH-MIN_MATCH),Loop_Counter
-       move.l  Scan_Ini,Scan
-scan_loop:
-       cmpm.b  (Match)+,(Scan)+
-       dbne    Loop_Counter,scan_loop
-
-       sub.l   Scan_Ini,Scan
-       addq.l  #(MIN_MATCH-1),Scan
-       cmp.l   Best_Len,Scan
-       bls.b   short_loop
-       move.l  Scan,Best_Len
-       move.l  Cur_Match,_match_start
-       cmp.l   _nice_match,Best_Len
-       bcs.b   long_loop
-return:
-       move.l  Best_Len,d0
-       ifd     UNALIGNED_OK
-       movem.l (sp)+,d2-d6/a2-a4
-       else
-       movem.l (sp)+,d2-d7/a2-a4
-       endc
-       rts
-
-       end
diff --git a/amiga/tailor.c b/amiga/tailor.c
deleted file mode 100644 (file)
index 9207999..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/* tailor.c -- target dependent functions
- * Copyright (C) 1993 Carsten Steger (carsten.steger@informatik.tu-muenchen.de)
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License, see the file COPYING.
- */
-
-/*
- * This file contains Amiga specific functions for gzip.
- */
-
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <error.h>
-#include <time.h>
-#include <utime.h>
-#include <exec/types.h>
-#include <dos/dos.h>
-#include <dos/dosextens.h>
-#include <dos/dosasl.h>
-#include <proto/dos.h>
-
-#define MAXPATH 1024
-#define MAXARGS 512
-
-extern struct DosLibrary *DOSBase;
-
-extern void *xmalloc(unsigned int size);
-
-static char *expand_next_file (char *pattern);
-static int in_prev_args (char *arg, char **argv, int argc);
-extern void _expand_args (int *oargc, char ***oargv);
-
-
-static char *expand_next_file (pattern)
-     char *pattern;
-{
-  long err;
-  char *pathname;
-  static struct AnchorPath *an = NULL;
-
-  pathname = NULL;
-  if (pattern == NULL)
-    err = -1;
-  else
-    do
-      {
-        if (an == NULL)
-          {
-            an = xmalloc (sizeof (struct AnchorPath) + MAXPATH);
-            memset (an, 0, sizeof (struct AnchorPath) + MAXPATH);
-            an->ap_BreakBits = SIGBREAKF_CTRL_C;
-            an->ap_Strlen = MAXPATH;
-            an->ap_Flags = APF_DOWILD;
-            err = MatchFirst (pattern, an);
-          }
-        else
-          err = MatchNext (an);
-
-        pathname = an->ap_Buf;
-      } while (err == 0 && pathname == NULL);
-
-  if (err)
-    {
-      MatchEnd (an);
-      free (an);
-      an = NULL;
-      return NULL;
-    }
-  else
-    return pathname;
-}
-
-
-static int in_prev_args (arg, argv, argc)
-     char *arg, **argv;
-     int argc;
-{
-  int i, is_in_args;
-
-  is_in_args = 0;
-  for (i = 1; i < argc - 1; i++)
-    if (stricmp (arg, argv[i]) == 0)
-      is_in_args = 1;
-  return is_in_args;
-}
-
-
-void _expand_args (oargc, oargv)
-     int *oargc;
-     char ***oargv;
-{
-  int i;
-  char *str, **argv;
-  static char buf[MAXPATH];
-  int argc, no_match_at_all, num_matches, contains_wildcards;
-
-  /* With Kickstart 1.3 wildcards can't be expanded. */
-  if (DOSBase->dl_lib.lib_Version < 37) return;
-
-  no_match_at_all = 1;
-  contains_wildcards = 0;
-  argc = 0;
-  argv = xmalloc (MAXARGS * sizeof (char *));
-
-  argv[argc++] = (*oargv)[0];
-  for (i = 1; i < *oargc; i++)
-    {
-      if (ParsePattern ((*oargv)[i], buf, MAXPATH))
-        {
-          contains_wildcards = 1;
-          num_matches = 0;
-          while (str = expand_next_file ((*oargv)[i]))
-            if (argc >= MAXARGS)
-              {
-                expand_next_file (NULL);
-                fprintf (stderr,"Too many files.\n");
-                exit (EXIT_FAILURE);
-              }
-            else
-              {
-                /* Avoid duplicate entries */
-                if (!in_prev_args (str, argv, argc))
-                  {
-                    argv[argc++] = strdup (str);
-                    num_matches++;
-                  }
-              }
-          if (num_matches != 0)
-            no_match_at_all = 0;
-        }
-      else
-        if (argc >= MAXARGS)
-          {
-            fprintf (stderr,"Too many files.\n");
-            exit (EXIT_FAILURE);
-          }
-        else
-          {
-            if (!in_prev_args ((*oargv)[i], argv, argc))
-              argv[argc++] = (*oargv)[i];
-          }
-    }
-  *oargc = argc;
-  *oargv = argv;
-  if (no_match_at_all && contains_wildcards) {
-    fprintf (stderr,"No match.\n");
-    exit (EXIT_FAILURE);
-  }
-}
-
-
-int utime (path, times)
-     char *path;
-     struct utimbuf *times;
-{
-  struct DateStamp date;
-  LONG error;
-  time_t modtime;
-
-  /* With Kickstart 1.3 setting the filedate could be done, I guess.
-   * Maybe someone else will implement and test the code for this
-   * case (I don't have Kickstart 1.3). */
-  if (DOSBase->dl_lib.lib_Version < 37) return 0;
-
-  /* Amiga dates are counted from 1. Jan 1978 as opposed to 1. Jan 1970
-   * on Unix. Therefore we have to subtract 2922 days (8*365+2). We also
-   * have to subtract the value of __timezone since SAS/C uses "CST+06"
-   * as the default value. */
-  modtime = times->modtime - __timezone;
-  date.ds_Days = (modtime / 86400) - 2922;
-  modtime %= 86400;
-  date.ds_Minute = modtime / 60;
-  modtime %= 60;
-  date.ds_Tick = modtime * TICKS_PER_SECOND;
-  error = SetFileDate (path, &date);
-  if (error == DOSFALSE)
-    {
-      errno = EOSERR;
-      return -1;
-    }
-  return 0;
-}
diff --git a/amiga/utime.h b/amiga/utime.h
deleted file mode 100644 (file)
index 8c35a1a..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _UTIME_H
-#define _UTIME_H 1
-
-#ifndef _TIME_H
-#include <time.h>
-#endif
-
-struct utimbuf {
-  time_t actime;
-  time_t modtime;
-};
-
-extern int utime (char *path, struct utimbuf *times);
-
-#endif
diff --git a/atari/Makefile.st b/atari/Makefile.st
deleted file mode 100644 (file)
index 0b13348..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# Makefile for gzip (GNU zip)    -*- Indented-Text -*-
-# This is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License, see the file COPYING.
-
-# Simple Atari-specific makefile for gcc.
-# Written by Daniel Eriksson <den@hgs.se>
-# Modified by Andreas Schwab <schwab@ls5.informatik.uni-dortmund.de>
-# and Robert Fischer <fischer-robert@cs.yale.edu>.
-
-# This Makefile is configured by default for the Atari ST using the
-# Minix filesytem. It can be modified (for efficiency) for an Atari TT
-# according to the instructions given below. It must be modified
-# for building a TOS-file system version.
-
-CC=gcc
-BASIC_FLAGS = -O2 -DATARI
-
-# Use this for a TT-only version
-#TT_FLAGS = -m68020
-
-# CFLAGS for building a Minix-file system version
-CFLAGS = $(BASIC_FLAGS) $(TT_FLAGS)
-
-# CFLAGS for building a TOS-file system version
-#CFLAGS = $(BASIC_FLAGS) $(TT_FLAGS) -DTOSFS
-
-AS=$(CC) -c
-ASFLAGS = $(CFLAGS)
-LDFLAGS =
-
-OBJA = match.o
-OBJS = bits.o crypt.o deflate.o getopt.o gzip.o inflate.o lzw.o \
-  trees.o unlzw.o unpack.o unlzh.o unzip.o util.o zip.o $(OBJA)
-
-gzip.ttp:      $(OBJS)
-       $(CC) $(LDFLAGS) -o gzip.ttp $(OBJS)
-
-gzip.o zip.o deflate.o trees.o bits.o unzip.o inflate.o: gzip.h tailor.h
-util.o lzw.o unlzw.o unpack.o unlzh.o crypt.o: gzip.h tailor.h
-
-gzip.o unlzw.o: revision.h lzw.h
-
-bits.o unzip.o util.o zip.o: crypt.h
-
-gzip.o getopt.o: getopt.h
-
-match.o: match.S
-       $(AS) $(ASLAGS) match.S
diff --git a/bits.c b/bits.c
index ddb150971069e415aef72df101691db33eb13b48..3501b5296fdc40d0d67ca66a03e02d222de5a5df 100644 (file)
--- a/bits.c
+++ b/bits.c
@@ -1,6 +1,6 @@
 /* bits.c -- output variable-length bit strings
 
-   Copyright (C) 1999, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2009-2012 Free Software Foundation, Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly
 
    This program is free software; you can redistribute it and/or modify
@@ -67,7 +67,6 @@
 #include <config.h>
 #include "tailor.h"
 #include "gzip.h"
-#include "crypt.h"
 
 #ifdef DEBUG
 #  include <stdio.h>
@@ -94,7 +93,7 @@ local int bi_valid;
  * are always zero.
  */
 
-int (*read_buf) OF((char *buf, unsigned size));
+int (*read_buf) (char *buf, unsigned size);
 /* Current input function. Set to mem_read for in-memory compression */
 
 #ifdef DEBUG
@@ -118,7 +117,7 @@ void bi_init (zipfile)
      * for in-memory compression.
      */
     if (zfile != NO_FILE) {
-       read_buf  = file_read;
+        read_buf  = file_read;
     }
 }
 
@@ -208,8 +207,8 @@ void copy_block(buf, len, header)
     while (len--) {
 #ifdef CRYPT
         int t;
-       if (key) zencode(*buf, t);
+        if (key) zencode(*buf, t);
 #endif
-       put_byte(*buf++);
+        put_byte(*buf++);
     }
 }
index 7d70fd4b59bac87362cc92a27f2b15187721340a..ec7c22a281ffa323f657d3f60047a38ef69804cd 100755 (executable)
@@ -3,13 +3,13 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
     if 0;
 # Generate a release announcement message.
 
-my $VERSION = '2009-11-20 13:36'; # UTC
+my $VERSION = '2012-06-08 06:53'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 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
@@ -30,13 +30,15 @@ use strict;
 
 use Getopt::Long;
 use Digest::MD5;
-use Digest::SHA1;
+eval { require Digest::SHA; }
+  or eval 'use Digest::SHA1';
 use POSIX qw(strftime);
 
 (my $ME = $0) =~ s|.*/||;
 
 my %valid_release_types = map {$_ => 1} qw (alpha beta stable);
 my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz');
+my $srcdir = '.';
 
 sub usage ($)
 {
@@ -44,14 +46,14 @@ sub usage ($)
   my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
   if ($exit_code != 0)
     {
-      print $STREAM "Try `$ME --help' for more information.\n";
+      print $STREAM "Try '$ME --help' for more information.\n";
     }
   else
     {
       my @types = sort keys %valid_release_types;
       print $STREAM <<EOF;
 Usage: $ME [OPTIONS]
-Generate an announcement message.
+Generate an announcement message.  Run this from builddir.
 
 OPTIONS:
 
@@ -66,7 +68,9 @@ These options must be specified:
 
 The following are optional:
 
-   --news=NEWS_FILE
+   --news=NEWS_FILE             include the NEWS section about this release
+                                from this NEWS_FILE; accumulates.
+   --srcdir=DIR                 where to find the NEWS_FILEs (default: $srcdir)
    --bootstrap-tools=TOOL_LIST  a comma-separated list of tools, e.g.,
                                 autoconf,automake,bison,gnulib
    --gnulib-version=VERSION     report VERSION as the gnulib version, where
@@ -75,6 +79,8 @@ The following are optional:
                                 required if gnulib is in TOOL_LIST.
    --no-print-checksums         do not emit MD5 or SHA1 checksums
    --archive-suffix=SUF         add SUF to the list of archive suffixes
+   --mail-headers=HEADERS       a space-separated list of mail headers, e.g.,
+                                To: x\@example.com Cc: y-announce\@example.com,...
 
    --help             display this help and exit
    --version          output version information and exit
@@ -100,13 +106,13 @@ sub sizes (@)
   my %res;
   foreach my $f (@file)
     {
-      my $cmd = "du --human $f";
+      my $cmd = "du -h $f";
       my $t = `$cmd`;
       # FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS
       $@
-       and (warn "$ME: command failed: `$cmd'\n"), $fail = 1;
+        and (warn "command failed: '$cmd'\n"), $fail = 1;
       chomp $t;
-      $t =~ s/^([\d.]+[MkK]).*/${1}B/;
+      $t =~ s/^\s*([\d.]+[MkK]).*/${1}B/;
       $res{$f} = $t;
     }
   return $fail ? undef : %res;
@@ -126,12 +132,12 @@ sub print_locations ($\@\%@)
   foreach my $url (@{$url})
     {
       for my $file (@file)
-       {
-         print "  $url/$file";
-         print "   (", $$size{$file}, ")"
-           if exists $$size{$file};
-         print "\n";
-       }
+        {
+          print "  $url/$file";
+          print "   (", $$size{$file}, ")"
+            if exists $$size{$file};
+          print "\n";
+        }
     }
   print "\n";
 }
@@ -152,17 +158,17 @@ sub print_checksums (@)
   foreach my $meth (qw (md5 sha1))
     {
       foreach my $f (@file)
-       {
-         open IN, '<', $f
-           or die "$ME: $f: cannot open for reading: $!\n";
-         binmode IN;
-         my $dig =
-           ($meth eq 'md5'
-            ? Digest::MD5->new->addfile(*IN)->hexdigest
-            : Digest::SHA1->new->addfile(*IN)->hexdigest);
-         close IN;
-         print "$dig  $f\n";
-       }
+        {
+          open IN, '<', $f
+            or die "$ME: $f: cannot open for reading: $!\n";
+          binmode IN;
+          my $dig =
+            ($meth eq 'md5'
+             ? Digest::MD5->new->addfile(*IN)->hexdigest
+             : Digest::SHA1->new->addfile(*IN)->hexdigest);
+          close IN;
+          print "$dig  $f\n";
+        }
     }
   print "\n";
 }
@@ -178,7 +184,10 @@ sub print_news_deltas ($$$)
 {
   my ($news_file, $prev_version, $curr_version) = @_;
 
-  print "\n$news_file\n\n";
+  my $news_name = $news_file;
+  $news_name =~ s|^\Q$srcdir\E/||;
+
+  print "\n$news_name\n\n";
 
   # Print all lines from $news_file, starting with the first one
   # that mentions $curr_version up to but not including
@@ -187,34 +196,39 @@ sub print_news_deltas ($$$)
 
   my $re_prefix = qr/(?:\* )?(?:Noteworthy c|Major c|C)(?i:hanges)/;
 
+  my $found_news;
   open NEWS, '<', $news_file
     or die "$ME: $news_file: cannot open for reading: $!\n";
   while (defined (my $line = <NEWS>))
     {
       if ( ! $in_items)
-       {
-         # Match lines like these:
-         # * Major changes in release 5.0.1:
-         # * Noteworthy changes in release 6.6 (2006-11-22) [stable]
-         $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$curr_version\E(?:[^\d.]|$)/o
-           or next;
-         $in_items = 1;
-         print $line;
-       }
+        {
+          # Match lines like these:
+          # * Major changes in release 5.0.1:
+          # * Noteworthy changes in release 6.6 (2006-11-22) [stable]
+          $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$curr_version\E(?:[^\d.]|$)/o
+            or next;
+          $in_items = 1;
+          print $line;
+        }
       else
-       {
-         # This regexp must not match version numbers in NEWS items.
-         # For example, they might well say `introduced in 4.5.5',
-         # and we don't want that to match.
-         $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$prev_version\E(?:[^\d.]|$)/o
-           and last;
-         print $line;
-       }
+        {
+          # This regexp must not match version numbers in NEWS items.
+          # For example, they might well say "introduced in 4.5.5",
+          # and we don't want that to match.
+          $line =~ /^$re_prefix.*(?:[^\d.]|$)\Q$prev_version\E(?:[^\d.]|$)/o
+            and last;
+          print $line;
+          $line =~ /\S/
+            and $found_news = 1;
+        }
     }
   close NEWS;
 
   $in_items
-    or die "$ME: $news_file: no matching lines for `$curr_version'\n";
+    or die "$ME: $news_file: no matching lines for '$curr_version'\n";
+  $found_news
+    or die "$ME: $news_file: no news item found for '$curr_version'\n";
 }
 
 sub print_changelog_deltas ($$)
@@ -227,8 +241,8 @@ sub print_changelog_deltas ($$)
   use File::Find;
   my @changelog;
   find ({wanted => sub {$_ eq 'ChangeLog' && -d 'CVS'
-                         and push @changelog, $File::Find::name}},
-       '.');
+                          and push @changelog, $File::Find::name}},
+        '.');
 
   # If there are no ChangeLog files, we're done.
   @changelog
@@ -253,13 +267,13 @@ sub print_changelog_deltas ($$)
       my $dot_slash = $d eq '.' ? $d : "./$d";
       my $target = "$dot_slash/ChangeLog";
       delete $changelog{$target}
-       and push @reordered, $target;
+        and push @reordered, $target;
     }
 
   # Append any remaining ChangeLog files.
   push @reordered, sort keys %changelog;
 
-  # Remove leading `./'.
+  # Remove leading './'.
   @reordered = map { s!^\./!!; $_ } @reordered;
 
   print "\nChangeLog entries:\n\n";
@@ -270,37 +284,37 @@ sub print_changelog_deltas ($$)
 
   my $cmd = "cvs -n diff -u -r$prev_cvs_tag -rHEAD @reordered";
   open DIFF, '-|', $cmd
-    or die "$ME: cannot run `$cmd': $!\n";
+    or die "$ME: cannot run '$cmd': $!\n";
   # Print two types of lines, making minor changes:
-  # Lines starting with `+++ ', e.g.,
+  # Lines starting with '+++ ', e.g.,
   # +++ ChangeLog   22 Feb 2003 16:52:51 -0000      1.247
-  # and those starting with `+'.
+  # and those starting with '+'.
   # Don't print the others.
   my $prev_printed_line_empty = 1;
   while (defined (my $line = <DIFF>))
     {
       if ($line =~ /^\+\+\+ /)
-       {
-         my $separator = "*"x70 ."\n";
-         $line =~ s///;
-         $line =~ s/\s.*//;
-         $prev_printed_line_empty
-           or print "\n";
-         print $separator, $line, $separator;
-       }
+        {
+          my $separator = "*"x70 ."\n";
+          $line =~ s///;
+          $line =~ s/\s.*//;
+          $prev_printed_line_empty
+            or print "\n";
+          print $separator, $line, $separator;
+        }
       elsif ($line =~ /^\+/)
-       {
-         $line =~ s///;
-         print $line;
-         $prev_printed_line_empty = ($line =~ /^$/);
-       }
+        {
+          $line =~ s///;
+          print $line;
+          $prev_printed_line_empty = ($line =~ /^$/);
+        }
     }
   close DIFF;
 
   # The exit code should be 1.
   # Allow in case there are no modified ChangeLog entries.
   $? == 256 || $? == 128
-    or warn "$ME: warning: `cmd' had unexpected exit code or signal ($?)\n";
+    or warn "warning: '$cmd' had unexpected exit code or signal ($?)\n";
 }
 
 sub get_tool_versions ($$)
@@ -314,25 +328,25 @@ sub get_tool_versions ($$)
   foreach my $t (@$tool_list)
     {
       if ($t eq 'gnulib')
-       {
-         push @tool_version_pair, ucfirst $t . ' ' . $gnulib_version;
-         next;
-       }
+        {
+          push @tool_version_pair, ucfirst $t . ' ' . $gnulib_version;
+          next;
+        }
       # Assume that the last "word" on the first line of
-      # `tool --version` output is the version string.
+      # 'tool --version' output is the version string.
       my ($first_line, undef) = split ("\n", `$t --version`);
       if ($first_line =~ /.* (\d[\w.-]+)$/)
-       {
-         $t = ucfirst $t;
-         push @tool_version_pair, "$t $1";
-       }
+        {
+          $t = ucfirst $t;
+          push @tool_version_pair, "$t $1";
+        }
       else
-       {
-         defined $first_line
-           and $first_line = '';
-         warn "$ME: $t: unexpected --version output\n:$first_line";
-         $fail = 1;
-       }
+        {
+          defined $first_line
+            and $first_line = '';
+          warn "$t: unexpected --version output\n:$first_line";
+          $fail = 1;
+        }
     }
 
   $fail
@@ -346,6 +360,7 @@ sub get_tool_versions ($$)
   # issue "1,2" instead of "1.2", what confuses our regexps.
   $ENV{LC_ALL} = "C";
 
+  my $mail_headers;
   my $release_type;
   my $package_name;
   my $prev_version;
@@ -357,8 +372,18 @@ sub get_tool_versions ($$)
   my $gnulib_version;
   my $print_checksums_p = 1;
 
+  # Reformat the warnings before displaying them.
+  local $SIG{__WARN__} = sub
+    {
+      my ($msg) = @_;
+      # Warnings from GetOptions.
+      $msg =~ s/Option (\w)/option --$1/;
+      warn "$ME: $msg";
+    };
+
   GetOptions
     (
+     'mail-headers=s'     => \$mail_headers,
      'release-type=s'     => \$release_type,
      'package-name=s'     => \$package_name,
      'previous-version=s' => \$prev_version,
@@ -366,6 +391,7 @@ sub get_tool_versions ($$)
      'gpg-key-id=s'       => \$gpg_key_id,
      'url-directory=s'    => \@url_dir_list,
      'news=s'             => \@news_file,
+     'srcdir=s'           => \$srcdir,
      'bootstrap-tools=s'  => \$bootstrap_tools,
      'gnulib-version=s'   => \$gnulib_version,
      'print-checksums!'   => \$print_checksums_p,
@@ -376,32 +402,32 @@ sub get_tool_versions ($$)
     ) or usage 1;
 
   my $fail = 0;
-  # Ensure that sure each required option is specified.
+  # Ensure that each required option is specified.
   $release_type
-    or (warn "$ME: release type not specified\n"), $fail = 1;
+    or (warn "release type not specified\n"), $fail = 1;
   $package_name
-    or (warn "$ME: package name not specified\n"), $fail = 1;
+    or (warn "package name not specified\n"), $fail = 1;
   $prev_version
-    or (warn "$ME: previous version string not specified\n"), $fail = 1;
+    or (warn "previous version string not specified\n"), $fail = 1;
   $curr_version
-    or (warn "$ME: current version string not specified\n"), $fail = 1;
+    or (warn "current version string not specified\n"), $fail = 1;
   $gpg_key_id
-    or (warn "$ME: GnuPG key ID not specified\n"), $fail = 1;
+    or (warn "GnuPG key ID not specified\n"), $fail = 1;
   @url_dir_list
-    or (warn "$ME: URL directory name(s) not specified\n"), $fail = 1;
+    or (warn "URL directory name(s) not specified\n"), $fail = 1;
 
   my @tool_list = split ',', $bootstrap_tools;
 
   grep (/^gnulib$/, @tool_list) ^ defined $gnulib_version
-    and (warn "$ME: when specifying gnulib as a tool, you must also specify\n"
-       . "--gnulib-version=V, where V is the result of running git describe\n"
-       . "in the gnulib source directory.\n"), $fail = 1;
+    and (warn "when specifying gnulib as a tool, you must also specify\n"
+        . "--gnulib-version=V, where V is the result of running git describe\n"
+        . "in the gnulib source directory.\n"), $fail = 1;
 
   exists $valid_release_types{$release_type}
-    or (warn "$ME: `$release_type': invalid release type\n"), $fail = 1;
+    or (warn "'$release_type': invalid release type\n"), $fail = 1;
 
   @ARGV
-    and (warn "$ME: too many arguments:\n", join ("\n", @ARGV), "\n"),
+    and (warn "too many arguments:\n", join ("\n", @ARGV), "\n"),
       $fail = 1;
   $fail
     and usage 1;
@@ -422,11 +448,18 @@ sub get_tool_versions ($$)
   %size
     or exit 1;
 
+  my $headers = '';
+  if (defined $mail_headers)
+    {
+      ($headers = $mail_headers) =~ s/\s+(\S+:)/\n$1/g;
+      $headers .= "\n";
+    }
+
   # The markup is escaped as <\# so that when this script is sent by
   # mail (or part of a diff), Gnus is not triggered.
   print <<EOF;
 
-Subject: $my_distdir released [$release_type]
+${headers}Subject: $my_distdir released [$release_type]
 
 <\#secure method=pgpmime mode=sign>
 
@@ -434,28 +467,50 @@ FIXME: put comments here
 
 EOF
 
-  print_locations ("compressed sources", @url_dir_list, %size, @tarballs);
-  -f $xd
-    and print_locations ("xdelta diffs (useful? if so, "
-                        . "please tell bug-gnulib\@gnu.org)",
-                        @url_dir_list, %size, $xd);
-  my @sig_files = map { "$_.sig" } @tarballs;
-  print_locations ("GPG detached signatures[*]", @url_dir_list, %size,
-                  @sig_files);
+  if (@url_dir_list == 1 && @tarballs == 1)
+    {
+      # When there's only one tarball and one URL, use a more concise form.
+      my $m = "$url_dir_list[0]/$tarballs[0]";
+      print "Here are the compressed sources and a GPG detached signature[*]:\n"
+        . "  $m\n"
+        . "  $m.sig\n\n";
+    }
+  else
+    {
+      print_locations ("compressed sources", @url_dir_list, %size, @tarballs);
+      -f $xd
+        and print_locations ("xdelta diffs (useful? if so, "
+                             . "please tell bug-gnulib\@gnu.org)",
+                             @url_dir_list, %size, $xd);
+      my @sig_files = map { "$_.sig" } @tarballs;
+      print_locations ("GPG detached signatures[*]", @url_dir_list, %size,
+                       @sig_files);
+    }
+
   if ($url_dir_list[0] =~ "gnu\.org")
     {
-      print "To reduce load on the main server, use a mirror listed at:\n";
-      print "  http://www.gnu.org/order/ftp.html\n\n";
+      print "Use a mirror for higher download bandwidth:\n";
+      if (@tarballs == 1 && $url_dir_list[0] =~ m!http://ftp\.gnu\.org/gnu/!)
+        {
+          (my $m = "$url_dir_list[0]/$tarballs[0]")
+            =~ s!http://ftp\.gnu\.org/gnu/!http://ftpmirror\.gnu\.org/!;
+          print "  $m\n"
+              . "  $m.sig\n\n";
+
+        }
+      else
+        {
+          print "  http://www.gnu.org/order/ftp.html\n\n";
+        }
     }
 
   $print_checksums_p
     and print_checksums (@sizable);
 
   print <<EOF;
-[*] You can use either of the above signature files to verify that
-the corresponding file (without the .sig suffix) is intact.  First,
-be sure to download both the .sig file and the corresponding tarball.
-Then, run a command like this:
+[*] Use a .sig file to verify that the corresponding file (without the
+.sig suffix) is intact.  First, be sure to download both the .sig file
+and the corresponding tarball.  Then, run a command like this:
 
   gpg --verify $tarballs[0].sig
 
@@ -464,7 +519,7 @@ then run this command to import it:
 
   gpg --keyserver keys.gnupg.net --recv-keys $gpg_key_id
 
-and rerun the \`gpg --verify' command.
+and rerun the 'gpg --verify' command.
 EOF
 
   my @tool_versions = get_tool_versions (\@tool_list, $gnulib_version);
diff --git a/build-aux/arg-nonnull.h b/build-aux/arg-nonnull.h
deleted file mode 100644 (file)
index ffbb397..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-/* A C macro for declaring that specific arguments must not be NULL.
-   Copyright (C) 2009, 2010 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 the Free Software Foundation; either version 3 of the License, 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
-   that the values passed as arguments n, ..., m must be non-NULL pointers.
-   n = 1 stands for the first argument, n = 2 for the second argument etc.  */
-#ifndef _GL_ARG_NONNULL
-# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
-#  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
-# else
-#  define _GL_ARG_NONNULL(params)
-# endif
-#endif
index c0096a7b563231c0c7ade728962574ec3b8df270..bac481cdc7d1b9846caffc71230b8f4ae728a89f 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand `-c -o'.
 
-scriptversion=2009-10-06.20; # UTC
+scriptversion=2010-11-15.09; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010 Free Software
 # Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
@@ -29,6 +29,171 @@ scriptversion=2009-10-06.20; # UTC
 # bugs to <bug-automake@gnu.org> or send patches to
 # <automake-patches@gnu.org>.
 
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""       $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Win32 hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+       # lazily determine how to convert abs files
+       case `uname -s` in
+         MINGW*)
+           file_conv=mingw
+           ;;
+         CYGWIN*)
+           file_conv=cygwin
+           ;;
+         *)
+           file_conv=wine
+           ;;
+       esac
+      fi
+      case $file_conv/,$2, in
+       *,$file_conv,*)
+         ;;
+       mingw/*)
+         file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+         ;;
+       cygwin/*)
+         file=`cygpath -m "$file" || echo "$file"`
+         ;;
+       wine/*)
+         file=`winepath -w "$file" || echo "$file"`
+         ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+       -o)
+         # configure might choose to run compile as `compile cc -o foo foo.c'.
+         eat=1
+         case $2 in
+           *.o | *.[oO][bB][jJ])
+             func_file_conv "$2"
+             set x "$@" -Fo"$file"
+             shift
+             ;;
+           *)
+             func_file_conv "$2"
+             set x "$@" -Fe"$file"
+             shift
+             ;;
+         esac
+         ;;
+       -I*)
+         func_file_conv "${1#-I}" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -l*)
+         lib=${1#-l}
+         found=no
+         save_IFS=$IFS
+         IFS=';'
+         for dir in $lib_path $LIB
+         do
+           IFS=$save_IFS
+           if $shared && test -f "$dir/$lib.dll.lib"; then
+             found=yes
+             set x "$@" "$dir/$lib.dll.lib"
+             break
+           fi
+           if test -f "$dir/$lib.lib"; then
+             found=yes
+             set x "$@" "$dir/$lib.lib"
+             break
+           fi
+         done
+         IFS=$save_IFS
+
+         test "$found" != yes && set x "$@" "$lib.lib"
+         shift
+         ;;
+       -L*)
+         func_file_conv "${1#-L}"
+         if test -z "$lib_path"; then
+           lib_path=$file
+         else
+           lib_path="$lib_path;$file"
+         fi
+         linker_opts="$linker_opts -LIBPATH:$file"
+         ;;
+       -static)
+         shared=false
+         ;;
+       -Wl,*)
+         arg=${1#-Wl,}
+         save_ifs="$IFS"; IFS=','
+         for flag in $arg; do
+           IFS="$save_ifs"
+           linker_opts="$linker_opts $flag"
+         done
+         IFS="$save_ifs"
+         ;;
+       -Xlinker)
+         eat=1
+         linker_opts="$linker_opts $2"
+         ;;
+       -*)
+         set x "$@" "$1"
+         shift
+         ;;
+       *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+         func_file_conv "$1"
+         set x "$@" -Tp"$file"
+         shift
+         ;;
+       *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+         func_file_conv "$1" mingw
+         set x "$@" "$file"
+         shift
+         ;;
+       *)
+         set x "$@" "$1"
+         shift
+         ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
 case $1 in
   '')
      echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
@@ -53,11 +218,13 @@ EOF
     echo "compile $scriptversion"
     exit $?
     ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
 esac
 
 ofile=
 cfile=
-eat=
 
 for arg
 do
index c2246a4f7f4c78281ccfc4238a54cf7d83c4f421..aa04f04bda9641e1dcbf138f6ba7a72b2bc3d1bd 100755 (executable)
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2009-12-30'
+timestamp='2012-06-17'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -17,9 +17,7 @@ timestamp='2009-12-30'
 # 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., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -57,8 +55,8 @@ GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -145,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
-       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+       # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
        # switched to ELF, *-*-netbsd* would select the old
        # object file format.  This provides both forward
@@ -181,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                fi
                ;;
            *)
-               os=netbsd
+               os=netbsd
                ;;
        esac
        # The OS release
@@ -202,6 +200,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
        echo "${machine}-${os}${release}"
        exit ;;
+    *:Bitrig:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+       exit ;;
     *:OpenBSD:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
        echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@@ -224,7 +226,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
                ;;
        *5.*)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
                ;;
        esac
        # According to Compaq, /usr/sbin/psrinfo has been available on
@@ -270,7 +272,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit ;;
+       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+       exitcode=$?
+       trap '' 0
+       exit $exitcode ;;
     Alpha\ *:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # Should we change UNAME_MACHINE based on the output of uname instead
@@ -296,7 +301,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo s390-ibm-zvmoe
        exit ;;
     *:OS400:*:*)
-        echo powerpc-ibm-os400
+       echo powerpc-ibm-os400
        exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
@@ -395,23 +400,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint${UNAME_RELEASE}
        exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+       exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint${UNAME_RELEASE}
        exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-milan-mint${UNAME_RELEASE}
+       exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-hades-mint${UNAME_RELEASE}
+       exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+       echo m68k-unknown-mint${UNAME_RELEASE}
+       exit ;;
     m68k:machten:*:*)
        echo m68k-apple-machten${UNAME_RELEASE}
        exit ;;
@@ -481,8 +486,8 @@ EOF
        echo m88k-motorola-sysv3
        exit ;;
     AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
+       # DG/UX returns AViiON for all architectures
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
        then
            if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -495,7 +500,7 @@ EOF
        else
            echo i586-dg-dgux${UNAME_RELEASE}
        fi
-       exit ;;
+       exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
        exit ;;
@@ -552,7 +557,7 @@ EOF
                echo rs6000-ibm-aix3.2
        fi
        exit ;;
-    *:AIX:*:[456])
+    *:AIX:*:[4567])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
@@ -595,52 +600,52 @@ EOF
            9000/[678][0-9][0-9])
                if [ -x /usr/bin/getconf ]; then
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
+                   sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                   case "${sc_cpu_version}" in
+                     523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                     528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                     532)                      # CPU_PA_RISC2_0
+                       case "${sc_kernel_bits}" in
+                         32) HP_ARCH="hppa2.0n" ;;
+                         64) HP_ARCH="hppa2.0w" ;;
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
+                       esac ;;
+                   esac
                fi
                if [ "${HP_ARCH}" = "" ]; then
                    eval $set_cc_for_build
-                   sed 's/^              //' << EOF >$dummy.c
+                   sed 's/^            //' << EOF >$dummy.c
 
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
+               #define _HPUX_SOURCE
+               #include <stdlib.h>
+               #include <unistd.h>
 
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
+               int main ()
+               {
+               #if defined(_SC_KERNEL_BITS)
+                   long bits = sysconf(_SC_KERNEL_BITS);
+               #endif
+                   long cpu  = sysconf (_SC_CPU_VERSION);
 
-                  switch (cpu)
-               {
-               case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-               case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-               case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-                   switch (bits)
-                       {
-                       case 64: puts ("hppa2.0w"); break;
-                       case 32: puts ("hppa2.0n"); break;
-                       default: puts ("hppa2.0"); break;
-                       } break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-                   puts ("hppa2.0"); break;
-              #endif
-               default: puts ("hppa1.0"); break;
-               }
-                  exit (0);
-              }
+                   switch (cpu)
+                       {
+                       case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+                       case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+                       case CPU_PA_RISC2_0:
+               #if defined(_SC_KERNEL_BITS)
+                           switch (bits)
+                               {
+                               case 64: puts ("hppa2.0w"); break;
+                               case 32: puts ("hppa2.0n"); break;
+                               default: puts ("hppa2.0"); break;
+                               } break;
+               #else  /* !defined(_SC_KERNEL_BITS) */
+                           puts ("hppa2.0"); break;
+               #endif
+                       default: puts ("hppa1.0"); break;
+                       }
+                   exit (0);
+               }
 EOF
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
                    test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -731,22 +736,22 @@ EOF
        exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
-        exit ;;
+       exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-        exit ;;
+       exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
        echo c34-convex-bsd
-        exit ;;
+       exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
        echo c38-convex-bsd
-        exit ;;
+       exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
-        exit ;;
+       exit ;;
     CRAY*Y-MP:*:*:*)
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit ;;
@@ -770,14 +775,14 @@ EOF
        exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+       FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+       FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+       echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       exit ;;
     5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+       FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+       FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+       echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -789,13 +794,12 @@ EOF
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
        exit ;;
     *:FreeBSD:*:*)
-       case ${UNAME_MACHINE} in
-           pc98)
-               echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
+       case ${UNAME_PROCESSOR} in
            amd64)
                echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
            *)
-               echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+               echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
        esac
        exit ;;
     i*:CYGWIN*:*)
@@ -804,15 +808,18 @@ EOF
     *:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
        exit ;;
+    i*:MSYS*:*)
+       echo ${UNAME_MACHINE}-pc-msys
+       exit ;;
     i*:windows32*:*)
-       # uname -m includes "-pc" on this system.
-       echo ${UNAME_MACHINE}-mingw32
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
        exit ;;
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
        exit ;;
     *:Interix*:*)
-       case ${UNAME_MACHINE} in
+       case ${UNAME_MACHINE} in
            x86)
                echo i586-pc-interix${UNAME_RELEASE}
                exit ;;
@@ -858,6 +865,13 @@ EOF
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
        exit ;;
+    aarch64:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    aarch64_be:Linux:*:*)
+       UNAME_MACHINE=aarch64_be
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
          EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -867,7 +881,7 @@ EOF
          EV6)   UNAME_MACHINE=alphaev6 ;;
          EV67)  UNAME_MACHINE=alphaev67 ;;
          EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
+       esac
        objdump --private-headers /bin/sh | grep -q ld.so.1
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
@@ -879,20 +893,29 @@ EOF
        then
            echo ${UNAME_MACHINE}-unknown-linux-gnu
        else
-           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+           if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+               | grep -q __ARM_PCS_VFP
+           then
+               echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+           else
+               echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+           fi
        fi
        exit ;;
     avr32*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     cris:Linux:*:*)
-       echo cris-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-gnu
        exit ;;
     crisv32:Linux:*:*)
-       echo crisv32-axis-linux-gnu
+       echo ${UNAME_MACHINE}-axis-linux-gnu
        exit ;;
     frv:Linux:*:*)
-       echo frv-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
+    hexagon:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     i*86:Linux:*:*)
        LIBC=gnu
@@ -934,7 +957,7 @@ EOF
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
        ;;
     or32:Linux:*:*)
-       echo or32-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     padre:Linux:*:*)
        echo sparc-unknown-linux-gnu
@@ -960,7 +983,7 @@ EOF
        echo ${UNAME_MACHINE}-ibm-linux
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     sh*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -968,14 +991,17 @@ EOF
     sparc:Linux:*:* | sparc64:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
+    tile*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       exit ;;
     vax:Linux:*:*)
        echo ${UNAME_MACHINE}-dec-linux-gnu
        exit ;;
     x86_64:Linux:*:*)
-       echo x86_64-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     xtensa*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -984,11 +1010,11 @@ EOF
        echo i386-sequent-sysv4
        exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
+       # Unixware is an offshoot of SVR4, but it has its own version
+       # number series starting with 2...
+       # I am not positive that other SVR4 systems won't match this,
        # I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
+       # Use sysv4.2uw... so that sysv4* matches it.
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
        exit ;;
     i*86:OS/2:*:*)
@@ -1020,7 +1046,7 @@ EOF
        fi
        exit ;;
     i*86:*:5:[678]*)
-       # UnixWare 7.x, OpenUNIX and OpenServer 6.
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
        case `/bin/uname -X | grep "^Machine"` in
            *486*)           UNAME_MACHINE=i486 ;;
            *Pentium)        UNAME_MACHINE=i586 ;;
@@ -1048,13 +1074,13 @@ EOF
        exit ;;
     pc:*:*:*)
        # Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i586.
+       # uname -m prints for DJGPP always 'pc', but it prints nothing about
+       # the processor, so we play safe by assuming i586.
        # Note: whatever this is, it MUST be the same as what config.sub
        # prints for the "djgpp" host, or else GDB configury will decide that
        # this is a cross-build.
        echo i586-pc-msdosdjgpp
-        exit ;;
+       exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
        exit ;;
@@ -1089,8 +1115,8 @@ EOF
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
          && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && { echo i486-ncr-sysv4; exit; } ;;
     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
        OS_REL='.3'
        test -r /etc/.relid \
@@ -1133,10 +1159,10 @@ EOF
                echo ns32k-sni-sysv
        fi
        exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel@ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
+    PENTIUM:*:4.0*:*)  # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                       # says <Richard.M.Bartel@ccMail.Census.GOV>
+       echo i586-unisys-sysv4
+       exit ;;
     *:UNIX_System_V:4*:FTX*)
        # From Gerald Hewes <hewes@openmarket.com>.
        # How about differentiating between stratus architectures? -djm
@@ -1162,11 +1188,11 @@ EOF
        exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
-               echo mips-nec-sysv${UNAME_RELEASE}
+               echo mips-nec-sysv${UNAME_RELEASE}
        else
-               echo mips-unknown-sysv${UNAME_RELEASE}
+               echo mips-unknown-sysv${UNAME_RELEASE}
        fi
-        exit ;;
+       exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
        echo powerpc-be-beos
        exit ;;
@@ -1231,7 +1257,10 @@ EOF
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
+    NEO-?:NONSTOP_KERNEL:*:*)
+       echo neo-tandem-nsk${UNAME_RELEASE}
+       exit ;;
+    NSE-*:NONSTOP_KERNEL:*:*)
        echo nse-tandem-nsk${UNAME_RELEASE}
        exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
@@ -1276,13 +1305,13 @@ EOF
        echo pdp10-unknown-its
        exit ;;
     SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
+       echo mips-sei-seiux${UNAME_RELEASE}
        exit ;;
     *:DragonFly:*:*)
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
        exit ;;
     *:*VMS:*:*)
-       UNAME_MACHINE=`(uname -p) 2>/dev/null`
+       UNAME_MACHINE=`(uname -p) 2>/dev/null`
        case "${UNAME_MACHINE}" in
            A*) echo alpha-dec-vms ; exit ;;
            I*) echo ia64-dec-vms ; exit ;;
@@ -1300,6 +1329,9 @@ EOF
     i*86:AROS:*:*)
        echo ${UNAME_MACHINE}-pc-aros
        exit ;;
+    x86_64:VMkernel:*:*)
+       echo ${UNAME_MACHINE}-unknown-esx
+       exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1322,11 +1354,11 @@ main ()
 #include <sys/param.h>
   printf ("m68k-sony-newsos%s\n",
 #ifdef NEWSOS4
-          "4"
+       "4"
 #else
-         ""
+       ""
 #endif
-         ); exit (0);
+       ); exit (0);
 #endif
 #endif
 
diff --git a/build-aux/config.rpath b/build-aux/config.rpath
new file mode 100755 (executable)
index 0000000..1a07018
--- /dev/null
@@ -0,0 +1,690 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+#   Copyright 1996-2012 Free Software Foundation, Inc.
+#   Taken from GNU libtool, 2001
+#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+#   This file 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.
+#
+# The first argument passed to this file is the canonical host specification,
+#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+#   than 256 bytes, otherwise the compiler driver will dump core. The only
+#   known workaround is to choose shorter directory names for the build
+#   directory and/or the installation directory.
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+  wl='-Wl,'
+else
+  case "$host_os" in
+    aix*)
+      wl='-Wl,'
+      ;;
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      ;;
+    hpux9* | hpux10* | hpux11*)
+      wl='-Wl,'
+      ;;
+    irix5* | irix6* | nonstopux*)
+      wl='-Wl,'
+      ;;
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+        ecc*)
+          wl='-Wl,'
+          ;;
+        icc* | ifort*)
+          wl='-Wl,'
+          ;;
+        lf95*)
+          wl='-Wl,'
+          ;;
+        nagfor*)
+          wl='-Wl,-Wl,,'
+          ;;
+        pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+          wl='-Wl,'
+          ;;
+        ccc*)
+          wl='-Wl,'
+          ;;
+        xl* | bgxl* | bgf* | mpixl*)
+          wl='-Wl,'
+          ;;
+        como)
+          wl='-lopt='
+          ;;
+        *)
+          case `$CC -V 2>&1 | sed 5q` in
+            *Sun\ F* | *Sun*Fortran*)
+              wl=
+              ;;
+            *Sun\ C*)
+              wl='-Wl,'
+              ;;
+          esac
+          ;;
+      esac
+      ;;
+    newsos6)
+      ;;
+    *nto* | *qnx*)
+      ;;
+    osf3* | osf4* | osf5*)
+      wl='-Wl,'
+      ;;
+    rdos*)
+      ;;
+    solaris*)
+      case $cc_basename in
+        f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+          wl='-Qoption ld '
+          ;;
+        *)
+          wl='-Wl,'
+          ;;
+      esac
+      ;;
+    sunos4*)
+      wl='-Qoption ld '
+      ;;
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      wl='-Wl,'
+      ;;
+    sysv4*MP*)
+      ;;
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      wl='-Wl,'
+      ;;
+    unicos*)
+      wl='-Wl,'
+      ;;
+    uts4*)
+      ;;
+  esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+  # Set some defaults for GNU ld with shared library support. These
+  # are reset later if shared libraries are not supported. Putting them
+  # here allows them to be overridden if necessary.
+  # Unlike libtool, we use -rpath here, not --rpath, since the documented
+  # option of GNU ld is called -rpath, not --rpath.
+  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+  case "$host_os" in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+        ld_shlibs=no
+      fi
+      ;;
+    amigaos*)
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
+      ;;
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    cygwin* | mingw* | pw32* | cegcc*)
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    haiku*)
+      ;;
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      ;;
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    netbsd*)
+      ;;
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+        ld_shlibs=no
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+          ld_shlibs=no
+          ;;
+        *)
+          if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+            hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+          else
+            ld_shlibs=no
+          fi
+          ;;
+      esac
+      ;;
+    sunos4*)
+      hardcode_direct=yes
+      ;;
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+  esac
+  if test "$ld_shlibs" = no; then
+    hardcode_libdir_flag_spec=
+  fi
+else
+  case "$host_os" in
+    aix3*)
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes; then
+        # Neither direct hardcoding nor static linking is supported with a
+        # broken collect2.
+        hardcode_direct=unsupported
+      fi
+      ;;
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+        # On IA64, the linker does run time linking by default, so we don't
+        # have to do anything special.
+        aix_use_runtimelinking=no
+      else
+        aix_use_runtimelinking=no
+        # Test if we are trying to use run time linking or normal
+        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+        # need to do runtime linking.
+        case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+          for ld_flag in $LDFLAGS; do
+            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+              aix_use_runtimelinking=yes
+              break
+            fi
+          done
+          ;;
+        esac
+      fi
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      if test "$GCC" = yes; then
+        case $host_os in aix4.[012]|aix4.[012].*)
+          collect2name=`${CC} -print-prog-name=collect2`
+          if test -f "$collect2name" && \
+            strings "$collect2name" | grep resolve_lib_name >/dev/null
+          then
+            # We have reworked collect2
+            :
+          else
+            # We have old collect2
+            hardcode_direct=unsupported
+            hardcode_minus_L=yes
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_libdir_separator=
+          fi
+          ;;
+        esac
+      fi
+      # Begin _LT_AC_SYS_LIBPATH_AIX.
+      echo 'int main () { return 0; }' > conftest.c
+      ${CC} ${LDFLAGS} conftest.c -o conftest
+      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      if test -z "$aix_libpath"; then
+        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      fi
+      if test -z "$aix_libpath"; then
+        aix_libpath="/usr/lib:/lib"
+      fi
+      rm -f conftest.c conftest
+      # End _LT_AC_SYS_LIBPATH_AIX.
+      if test "$aix_use_runtimelinking" = yes; then
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+      else
+        if test "$host_cpu" = ia64; then
+          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+        else
+          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        fi
+      fi
+      ;;
+    amigaos*)
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
+      ;;
+    bsdi[45]*)
+      ;;
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      libext=lib
+      ;;
+    darwin* | rhapsody*)
+      hardcode_direct=no
+      if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    dgux*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    freebsd2.2*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    freebsd2*)
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    freebsd* | dragonfly*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    hpux9*)
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      ;;
+    hpux10*)
+      if test "$with_gnu_ld" = no; then
+        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator=:
+        hardcode_direct=yes
+        # hardcode_minus_L: Not really in the search PATH,
+        # but as the default location of the library.
+        hardcode_minus_L=yes
+      fi
+      ;;
+    hpux11*)
+      if test "$with_gnu_ld" = no; then
+        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator=:
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct=no
+            ;;
+          *)
+            hardcode_direct=yes
+            # hardcode_minus_L: Not really in the search PATH,
+            # but as the default location of the library.
+            hardcode_minus_L=yes
+            ;;
+        esac
+      fi
+      ;;
+    irix5* | irix6* | nonstopux*)
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    netbsd*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    newsos6)
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    *nto* | *qnx*)
+      ;;
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+        hardcode_direct=yes
+        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+        else
+          case "$host_os" in
+            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+              hardcode_libdir_flag_spec='-R$libdir'
+              ;;
+            *)
+              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+              ;;
+          esac
+        fi
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      ;;
+    osf3*)
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    osf4* | osf5*)
+      if test "$GCC" = yes; then
+        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+        # Both cc and cxx compiler support -rpath directly
+        hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+    solaris*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      ;;
+    sunos4*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    sysv4)
+      case $host_vendor in
+        sni)
+          hardcode_direct=yes # is this really true???
+          ;;
+        siemens)
+          hardcode_direct=no
+          ;;
+        motorola)
+          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+          ;;
+      esac
+      ;;
+    sysv4.3*)
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+        ld_shlibs=yes
+      fi
+      ;;
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      ;;
+    sysv5* | sco3.2v5* | sco5v6*)
+      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator=':'
+      ;;
+    uts4*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    *)
+      ld_shlibs=no
+      ;;
+  esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec=      # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+  aix3*)
+    library_names_spec='$libname.a'
+    ;;
+  aix[4-9]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  amigaos*)
+    case "$host_cpu" in
+      powerpc*)
+        library_names_spec='$libname$shrext' ;;
+      m68k)
+        library_names_spec='$libname.a' ;;
+    esac
+    ;;
+  beos*)
+    library_names_spec='$libname$shrext'
+    ;;
+  bsdi[45]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  cygwin* | mingw* | pw32* | cegcc*)
+    shrext=.dll
+    library_names_spec='$libname.dll.a $libname.lib'
+    ;;
+  darwin* | rhapsody*)
+    shrext=.dylib
+    library_names_spec='$libname$shrext'
+    ;;
+  dgux*)
+    library_names_spec='$libname$shrext'
+    ;;
+  freebsd* | dragonfly*)
+    case "$host_os" in
+      freebsd[123]*)
+        library_names_spec='$libname$shrext$versuffix' ;;
+      *)
+        library_names_spec='$libname$shrext' ;;
+    esac
+    ;;
+  gnu*)
+    library_names_spec='$libname$shrext'
+    ;;
+  haiku*)
+    library_names_spec='$libname$shrext'
+    ;;
+  hpux9* | hpux10* | hpux11*)
+    case $host_cpu in
+      ia64*)
+        shrext=.so
+        ;;
+      hppa*64*)
+        shrext=.sl
+        ;;
+      *)
+        shrext=.sl
+        ;;
+    esac
+    library_names_spec='$libname$shrext'
+    ;;
+  interix[3-9]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  irix5* | irix6* | nonstopux*)
+    library_names_spec='$libname$shrext'
+    case "$host_os" in
+      irix5* | nonstopux*)
+        libsuff= shlibsuff=
+        ;;
+      *)
+        case $LD in
+          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+          *) libsuff= shlibsuff= ;;
+        esac
+        ;;
+    esac
+    ;;
+  linux*oldld* | linux*aout* | linux*coff*)
+    ;;
+  linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    library_names_spec='$libname$shrext'
+    ;;
+  knetbsd*-gnu)
+    library_names_spec='$libname$shrext'
+    ;;
+  netbsd*)
+    library_names_spec='$libname$shrext'
+    ;;
+  newsos6)
+    library_names_spec='$libname$shrext'
+    ;;
+  *nto* | *qnx*)
+    library_names_spec='$libname$shrext'
+    ;;
+  openbsd*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  os2*)
+    libname_spec='$name'
+    shrext=.dll
+    library_names_spec='$libname.a'
+    ;;
+  osf3* | osf4* | osf5*)
+    library_names_spec='$libname$shrext'
+    ;;
+  rdos*)
+    ;;
+  solaris*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sunos4*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  sysv4 | sysv4.3*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sysv4*MP*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+    library_names_spec='$libname$shrext'
+    ;;
+  tpf*)
+    library_names_spec='$libname$shrext'
+    ;;
+  uts4*)
+    library_names_spec='$libname$shrext'
+    ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
index 85186096a9e1c6953474b9294f9d5c6041d648cf..8beeb41a7f7b40fb9e168cc1b335e8188372321c 100755 (executable)
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-#   Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
 
-timestamp='2009-12-31'
+timestamp='2012-04-18'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,9 +21,7 @@ timestamp='2009-12-31'
 # 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., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -76,8 +74,8 @@ version="\
 GNU config.sub ($timestamp)
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -124,13 +122,18 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -157,8 +160,8 @@ case $os in
                os=
                basic_machine=$1
                ;;
-        -bluegene*)
-               os=-cnk
+       -bluegene*)
+               os=-cnk
                ;;
        -sim | -cisco | -oki | -wec | -winbond)
                os=
@@ -174,10 +177,10 @@ case $os in
                os=-chorusos
                basic_machine=$1
                ;;
-       -chorusrdb)
-               os=-chorusrdb
+       -chorusrdb)
+               os=-chorusrdb
                basic_machine=$1
-               ;;
+               ;;
        -hiux*)
                os=-hiuxwe2
                ;;
@@ -222,6 +225,12 @@ case $os in
        -isc*)
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
+       -lynx*178)
+               os=-lynxos178
+               ;;
+       -lynx*5)
+               os=-lynxos5
+               ;;
        -lynx*)
                os=-lynxos
                ;;
@@ -246,17 +255,22 @@ case $basic_machine in
        # Some are omitted here because they have special meanings below.
        1750a | 580 \
        | a29k \
+       | aarch64 | aarch64_be \
        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
        | am33_2.0 \
        | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+        | be32 | be64 \
        | bfin \
        | c4x | clipper \
        | d10v | d30v | dlx | dsp16xx \
+       | epiphany \
        | fido | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | hexagon \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
+       | le32 | le64 \
        | lm32 \
        | m32c | m32r | m32rle | m68000 | m68k | m88k \
        | maxq | mb | microblaze | mcore | mep | metag \
@@ -282,29 +296,39 @@ case $basic_machine in
        | moxie \
        | mt \
        | msp430 \
+       | nds32 | nds32le | nds32be \
        | nios | nios2 \
        | ns16k | ns32k \
+       | open8 \
        | or32 \
        | pdp10 | pdp11 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | powerpc | powerpc64 | powerpc64le | powerpcle \
        | pyramid \
-       | rx \
+       | rl78 | rx \
        | score \
        | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
        | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
        | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-       | spu | strongarm \
-       | tahoe | thumb | tic4x | tic80 | tron \
+       | spu \
+       | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
        | ubicom32 \
-       | v850 | v850e \
+       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
        | we32k \
-       | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+       | x86 | xc16x | xstormy16 | xtensa \
        | z8k | z80)
                basic_machine=$basic_machine-unknown
                ;;
-       m6811 | m68hc11 | m6812 | m68hc12 | picochip)
-               # Motorola 68HC11/12.
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
                basic_machine=$basic_machine-unknown
                os=-none
                ;;
@@ -314,6 +338,21 @@ case $basic_machine in
                basic_machine=mt-unknown
                ;;
 
+       strongarm | thumb | xscale)
+               basic_machine=arm-unknown
+               ;;
+       xgate)
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       xscaleeb)
+               basic_machine=armeb-unknown
+               ;;
+
+       xscaleel)
+               basic_machine=armel-unknown
+               ;;
+
        # We use `pc' rather than `unknown'
        # because (1) that's what they normally are, and
        # (2) the word "unknown" tends to confuse beginning users.
@@ -328,21 +367,25 @@ case $basic_machine in
        # Recognize the basic CPU types with company name.
        580-* \
        | a29k-* \
+       | aarch64-* | aarch64_be-* \
        | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
        | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
        | avr-* | avr32-* \
+       | be32-* | be64-* \
        | bfin-* | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
        | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
        | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
        | h8300-* | h8500-* \
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | hexagon-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
+       | le32-* | le64-* \
        | lm32-* \
        | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
@@ -368,25 +411,29 @@ case $basic_machine in
        | mmix-* \
        | mt-* \
        | msp430-* \
+       | nds32-* | nds32le-* | nds32be-* \
        | nios-* | nios2-* \
        | none-* | np1-* | ns16k-* | ns32k-* \
+       | open8-* \
        | orion-* \
        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
        | pyramid-* \
-       | romp-* | rs6000-* | rx-* \
+       | rl78-* | romp-* | rs6000-* | rx-* \
        | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
        | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
-       | tahoe-* | thumb-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+       | tahoe-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile*-* \
        | tron-* \
        | ubicom32-* \
-       | v850-* | v850e-* | vax-* \
+       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+       | vax-* \
        | we32k-* \
-       | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* \
        | xstormy16-* | xtensa*-* \
        | ymp-* \
        | z8k-* | z80-*)
@@ -411,7 +458,7 @@ case $basic_machine in
                basic_machine=a29k-amd
                os=-udi
                ;;
-       abacus)
+       abacus)
                basic_machine=abacus-unknown
                ;;
        adobe68k)
@@ -481,11 +528,20 @@ case $basic_machine in
                basic_machine=powerpc-ibm
                os=-cnk
                ;;
+       c54x-*)
+               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c55x-*)
+               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c6x-*)
+               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        c90)
                basic_machine=c90-cray
                os=-unicos
                ;;
-        cegcc)
+       cegcc)
                basic_machine=arm-unknown
                os=-cegcc
                ;;
@@ -517,7 +573,7 @@ case $basic_machine in
                basic_machine=craynv-cray
                os=-unicosmp
                ;;
-       cr16)
+       cr16 | cr16-*)
                basic_machine=cr16-unknown
                os=-elf
                ;;
@@ -675,7 +731,6 @@ case $basic_machine in
        i370-ibm* | ibm*)
                basic_machine=i370-ibm
                ;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
        i*86v32)
                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
                os=-sysv32
@@ -733,7 +788,7 @@ case $basic_machine in
                basic_machine=ns32k-utek
                os=-sysv
                ;;
-        microblaze)
+       microblaze)
                basic_machine=microblaze-xilinx
                ;;
        mingw32)
@@ -772,10 +827,18 @@ case $basic_machine in
        ms1-*)
                basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
                ;;
+       msys)
+               basic_machine=i386-pc
+               os=-msys
+               ;;
        mvs)
                basic_machine=i370-ibm
                os=-mvs
                ;;
+       nacl)
+               basic_machine=le32-unknown
+               os=-nacl
+               ;;
        ncr3000)
                basic_machine=i486-ncr
                os=-sysv4
@@ -840,6 +903,12 @@ case $basic_machine in
        np1)
                basic_machine=np1-gould
                ;;
+       neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+       nse-tandem)
+               basic_machine=nse-tandem
+               ;;
        nsr-tandem)
                basic_machine=nsr-tandem
                ;;
@@ -922,9 +991,10 @@ case $basic_machine in
                ;;
        power)  basic_machine=power-ibm
                ;;
-       ppc)    basic_machine=powerpc-unknown
+       ppc | ppcbe)    basic_machine=powerpc-unknown
                ;;
-       ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+       ppc-* | ppcbe-*)
+               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        ppcle | powerpclittle | ppc-le | powerpc-little)
                basic_machine=powerpcle-unknown
@@ -1018,6 +1088,9 @@ case $basic_machine in
                basic_machine=i860-stratus
                os=-sysv4
                ;;
+       strongarm-* | thumb-*)
+               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        sun2)
                basic_machine=m68000-sun
                ;;
@@ -1074,20 +1147,8 @@ case $basic_machine in
                basic_machine=t90-cray
                os=-unicos
                ;;
-       tic54x | c54x*)
-               basic_machine=tic54x-unknown
-               os=-coff
-               ;;
-       tic55x | c55x*)
-               basic_machine=tic55x-unknown
-               os=-coff
-               ;;
-       tic6x | c6x*)
-               basic_machine=tic6x-unknown
-               os=-coff
-               ;;
        tile*)
-               basic_machine=tile-unknown
+               basic_machine=$basic_machine-unknown
                os=-linux-gnu
                ;;
        tx39)
@@ -1157,6 +1218,9 @@ case $basic_machine in
        xps | xps100)
                basic_machine=xps100-honeywell
                ;;
+       xscale-* | xscalee[bl]-*)
+               basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+               ;;
        ymp)
                basic_machine=ymp-cray
                os=-unicos
@@ -1254,11 +1318,11 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+       # First match some system type aliases
+       # that might get confused with valid system types.
        # -solaris* is a basic system type, with this one exception.
-        -auroraux)
-               os=-auroraux
+       -auroraux)
+               os=-auroraux
                ;;
        -solaris1 | -solaris1.*)
                os=`echo $os | sed -e 's|solaris1|sunos4|'`
@@ -1288,14 +1352,15 @@ case $os in
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-             | -openbsd* | -solidbsd* \
+             | -bitrig* | -openbsd* | -solidbsd* \
              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
              | -chorusos* | -chorusrdb* | -cegcc* \
-             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+             | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -linux-android* \
+             | -linux-newlib* | -linux-uclibc* \
              | -uxpv* | -beos* | -mpeix* | -udk* \
              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1342,7 +1407,7 @@ case $os in
        -opened*)
                os=-openedition
                ;;
-        -os400*)
+       -os400*)
                os=-os400
                ;;
        -wince*)
@@ -1391,7 +1456,7 @@ case $os in
        -sinix*)
                os=-sysv4
                ;;
-        -tpf*)
+       -tpf*)
                os=-tpf
                ;;
        -triton*)
@@ -1436,8 +1501,8 @@ case $os in
        -dicos*)
                os=-dicos
                ;;
-        -nacl*)
-               ;;
+       -nacl*)
+               ;;
        -none)
                ;;
        *)
@@ -1460,10 +1525,10 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-        score-*)
+       score-*)
                os=-elf
                ;;
-        spu-*)
+       spu-*)
                os=-elf
                ;;
        *-acorn)
@@ -1475,8 +1540,20 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
-        c4x-* | tic4x-*)
-               os=-coff
+       c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       hexagon-*)
+               os=-elf
+               ;;
+       tic54x-*)
+               os=-coff
+               ;;
+       tic55x-*)
+               os=-coff
+               ;;
+       tic6x-*)
+               os=-coff
                ;;
        # This must come before the *-dec entry.
        pdp10-*)
@@ -1496,14 +1573,11 @@ case $basic_machine in
                ;;
        m68000-sun)
                os=-sunos3
-               # This also exists in the configure program, but was not the
-               # default.
-               # os=-sunos4
                ;;
        m68*-cisco)
                os=-aout
                ;;
-        mep-*)
+       mep-*)
                os=-elf
                ;;
        mips*-cisco)
@@ -1530,7 +1604,7 @@ case $basic_machine in
        *-ibm)
                os=-aix
                ;;
-       *-knuth)
+       *-knuth)
                os=-mmixware
                ;;
        *-wec)
index df8eea7e4ce8862105fcd7929b20bdb45488048b..debb6ffa3eae410200617afdc04f86860a0a5ab7 100755 (executable)
@@ -1,10 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-03-27.16; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999-2012 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
@@ -28,7 +27,7 @@ scriptversion=2009-04-28.21; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
@@ -40,11 +39,11 @@ as side-effects.
 
 Environment variables:
   depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputing dependencies.
+  tmpdepfile  Temporary file to use when outputting dependencies.
   libtool     Whether libtool is used (yes/no).
 
 Report bugs to <bug-automake@gnu.org>.
@@ -57,6 +56,12 @@ EOF
     ;;
 esac
 
+# A tabulation character.
+tab='  '
+# A newline character.
+nl='
+'
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -90,10 +95,24 @@ if test "$depmode" = msvcmsys; then
    # This is just like msvisualcpp but w/o cygpath translation.
    # Just convert the backslash-escaped backslashes to single forward
    # slashes to satisfy depend.m4
-   cygpath_u="sed s,\\\\\\\\,/,g"
+   cygpath_u='sed s,\\\\,/,g'
    depmode=msvisualcpp
 fi
 
+if test "$depmode" = msvc7msys; then
+   # This is just like msvc7 but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u='sed s,\\\\,/,g'
+   depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
+   gccflag=-qmakedep=gcc,-MF
+   depmode=gcc
+fi
+
 case "$depmode" in
 gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
@@ -148,20 +167,21 @@ gcc)
 ## The second -e expression handles DOS-style file names with drive letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
 ## The problem is that when a header file which appears in a .P file
 ## is deleted, the dependency causes make to die (because there is
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
+  tr ' ' "$nl" < "$tmpdepfile" |
+## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
-## well.
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+      | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -193,18 +213,15 @@ sgi)
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like `#:fec' to the end of the
+    # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> "$depfile"
+    tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
 
     # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
+    tr ' ' "$nl" < "$tmpdepfile" \
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
    >> "$depfile"
   else
@@ -216,10 +233,17 @@ sgi)
   rm -f "$tmpdepfile"
   ;;
 
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
   # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
@@ -249,12 +273,11 @@ aix)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    # Each line is of the form `foo.o: dependent.h'.
+    # Each line is of the form 'foo.o: dependent.h'.
     # Do two passes, one to just change these to
-    # `$object: dependent.h' and one to simply `dependent.h:'.
+    # '$object: dependent.h' and one to simply 'dependent.h:'.
     sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    # That's a tab and a space in the [].
-    sed -e 's,^.*\.[a-z]*:[     ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -265,23 +288,26 @@ aix)
   ;;
 
 icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
+  # However on
+  #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
   # ICC 7.0 will fill foo.d with something like
   #    foo.o: sub/foo.c
   #    foo.o: sub/foo.h
-  # which is wrong.  We want:
+  # which is wrong.  We want
   #    sub/foo.o: sub/foo.c
   #    sub/foo.o: sub/foo.h
   #    sub/foo.c:
   #    sub/foo.h:
   # ICC 7.1 will output
   #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using :
+  # and will wrap long lines using '\':
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
-
+  # tcc 0.9.26 (FIXME still under development at the moment of writing)
+  # will emit a similar output, but also prepend the continuation lines
+  # with horizontal tabulation characters.
   "$@" -MD -MF "$tmpdepfile"
   stat=$?
   if test $stat -eq 0; then :
@@ -290,15 +316,21 @@ icc)
     exit $stat
   fi
   rm -f "$depfile"
-  # Each line is of the form `foo.o: dependent.h',
-  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Each line is of the form 'foo.o: dependent.h',
+  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
   # Do two passes, one to just change these to
-  # `$object: dependent.h' and one to simply `dependent.h:'.
-  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
-  # Some versions of the HPUX 10.20 sed can't process this invocation
-  # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  # '$object: dependent.h' and one to simply 'dependent.h:'.
+  sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
+    < "$tmpdepfile" > "$depfile"
+  sed '
+    s/[ '"$tab"'][ '"$tab"']*/ /g
+    s/^ *//
+    s/ *\\*$//
+    s/^[^:]*: *//
+    /^$/d
+    /:$/d
+    s/$/ :/
+  ' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -334,7 +366,7 @@ hp2)
   done
   if test -f "$tmpdepfile"; then
     sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
+    # Add 'dependent.h:' lines.
     sed -ne '2,${
               s/^ *//
               s/ \\*$//
@@ -349,9 +381,9 @@ hp2)
 
 tru64)
    # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
    # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in `foo.d' instead, so we check for that too.
+   # dependencies in 'foo.d' instead, so we check for that too.
    # Subdirectories are respected.
    dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
    test "x$dir" = "x$object" && dir=
@@ -397,14 +429,59 @@ tru64)
    done
    if test -f "$tmpdepfile"; then
       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[   ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    else
       echo "#dummy" > "$depfile"
    fi
    rm -f "$tmpdepfile"
    ;;
 
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test "$stat" = 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
   # dependency tracking mechanisms from slower ones.
@@ -422,7 +499,7 @@ dashmstdout)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -442,15 +519,14 @@ dashmstdout)
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
+  # Require at least two characters before searching for ':'
   # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
+  tr ' ' "$nl" < "$tmpdepfile" | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -503,9 +579,10 @@ makedepend)
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
     sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
@@ -525,7 +602,7 @@ cpp)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -594,8 +671,8 @@ msvisualcpp)
   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::     \1 \\:p' >> "$depfile"
-  echo "       " >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
diff --git a/build-aux/do-release-commit-and-tag b/build-aux/do-release-commit-and-tag
new file mode 100755 (executable)
index 0000000..a0d1c9c
--- /dev/null
@@ -0,0 +1,164 @@
+#!/bin/sh
+# In a git/autoconf/automake-enabled project with a NEWS file and a version-
+# controlled .prev-version file, automate the procedure by which we record
+# the date, release-type and version string in the NEWS file.  That commit
+# will serve to identify the release, so apply a signed tag to it as well.
+VERSION=2012-06-07.15 # UTC
+
+# Note: this is a bash script (could be zsh or dash)
+
+# Copyright (C) 2009-2012 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
+# the Free Software Foundation, either version 3 of the License, 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Written by Jim Meyering
+
+ME=$(basename "$0")
+warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
+die() { warn "$*"; exit 1; }
+
+noteworthy='* Noteworthy changes in release'
+noteworthy_stub="$noteworthy ?.? (????-??-??) [?]"
+
+help()
+{
+  cat <<EOF
+Usage: $ME [OPTION...] VERSION RELEASE_TYPE
+
+Run this script from top_srcdir to perform the final pre-release NEWS
+update in which the date, release-type and version string are
+recorded.  Commit that result with a log entry marking the release,
+and apply a signed tag.  Run it from your project's top-level
+directory.
+
+Requirements:
+- you use git for version-control
+- a version-controlled .prev-version file
+- a NEWS file, with line 3 identical to this:
+$noteworthy_stub
+
+Options:
+  --branch=BRANCH      set release branch (default: master)
+  -C, --builddir=DIR   location of (configured) Makefile (default: .)
+  --help               print this help, then exit
+  --version            print version number, then exit
+
+EXAMPLE:
+To update NEWS and tag the beta 8.1 release of coreutils, I would run this:
+
+  $ME 8.1 beta
+
+Report bugs and patches to <bug-gnulib@gnu.org>.
+EOF
+  exit
+}
+
+version()
+{
+  year=$(echo "$VERSION" | sed 's/[^0-9].*//')
+  cat <<EOF
+$ME $VERSION
+Copyright (C) $year Free Software Foundation, Inc,
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+EOF
+  exit
+}
+
+branch=master
+builddir=.
+
+while test $# != 0
+do
+  # Handle --option=value by splitting apart and putting back on argv.
+  case $1 in
+    --*=*)
+      opt=$(echo "$1" | sed -e 's/=.*//')
+      val=$(echo "$1" | sed -e 's/[^=]*=//')
+      shift
+      set dummy "$opt" "$val" ${1+"$@"}; shift
+      ;;
+  esac
+
+  case $1 in
+    --help|--version) ${1#--};;
+    --branch) shift; branch=$1; shift ;;
+    -C|--builddir) shift; builddir=$1; shift ;;
+    --*) die "unrecognized option: $1";;
+    *) break;;
+  esac
+done
+
+test $# = 2 \
+  || die "Usage: $ME [OPTION...] VERSION TYPE"
+
+ver=$1
+type=$2
+
+# Verify that $ver looks like a version number, and...
+echo "$ver"|grep -E '^[0-9][0-9.]*[0-9]$' > /dev/null \
+  || die "invalid version: $ver"
+prev_ver=$(cat .prev-version) \
+  || die 'failed to determine previous version number from .prev-version'
+
+# Verify that $ver is sensible (> .prev-version).
+case $(printf "$prev_ver\n$ver\n"|sort -V -u|tr '\n' ':') in
+  "$prev_ver:$ver:") ;;
+  *) die "invalid version: $ver (<= $prev_ver)";;
+esac
+
+case $type in
+  alpha|beta|stable) ;;
+  *) die "invalid release type: $type";;
+esac
+
+# Extract package name from Makefile.
+Makefile=$builddir/Makefile
+pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' "$Makefile") \
+  || die "failed to determine package name from $Makefile"
+
+# simple check: no question marks on line 3 of NEWS
+test "$(sed -n 3p NEWS)" = "$noteworthy_stub" \
+  || die 'line 3 of NEWS looks fishy!'
+
+# No dirt allowed.
+case $(git diff-index --name-only HEAD) in
+  '') ;;
+  *) die 'this tree is dirty; commit your changes first';;
+esac
+
+# update NEWS to have today's date, plus desired version number and $type
+perl -MPOSIX -ni -e 'my $today = strftime "%F", localtime time;' \
+ -e 'my ($type, $ver) = qw('"$type $ver"');' \
+ -e 'my $pfx = "'"$noteworthy"'";' \
+ -e 'print $.==3 ? "$pfx $ver ($today) [$type]\n" : $_' \
+     NEWS || die 'failed to update NEWS'
+
+# Ensure the current branch name is correct:
+curr_br=$(git rev-parse --symbolic-full-name HEAD)
+test "$curr_br" = refs/heads/$branch || die not on branch $branch
+
+printf "version $ver\n\n* NEWS: Record release date.\n" \
+    | git commit -F -  -a || die 'git commit failed'
+git tag -s -m "$pkg $ver" v$ver HEAD || die 'git tag failed'
+
+# Local variables:
+# indent-tabs-mode: nil
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "VERSION="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: " # UTC"
+# End:
index b50a6c7ffd80296ca2b74a3e0c9391624b70b758..c8abd55fb387f553b07e439fd4a7a17ec7704279 100755 (executable)
@@ -2,10 +2,10 @@
 # gendocs.sh -- generate a GNU manual in many formats.  This script is
 #   mentioned in maintain.texi.  See the help message below for usage details.
 
-scriptversion=2010-01-02.16
+scriptversion=2011-04-08.14
 
-# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-# Free Software Foundation, Inc.
+# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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,6 +22,13 @@ scriptversion=2010-01-02.16
 #
 # Original author: Mohit Agarwal.
 # Send bug reports and any other correspondence to bug-texinfo@gnu.org.
+#
+# The latest version of this script, and the companion template, is
+# available from Texinfo CVS:
+# http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs.sh
+# http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs_template
+#
+# An up-to-date copy is also maintained in Gnulib (gnu.org/software/gnulib).
 
 prog=`basename "$0"`
 srcdir=`pwd`
@@ -44,7 +51,7 @@ unset use_texi2html
 
 version="gendocs.sh $scriptversion
 
-Copyright 2009 Free Software Foundation, Inc.
+Copyright 2010 Free Software Foundation, Inc.
 There is NO warranty.  You may redistribute this software
 under the terms of the GNU General Public License.
 For more information about these matters, see the files named COPYING."
@@ -56,6 +63,7 @@ See the GNU Maintainers document for a more extensive discussion:
   http://www.gnu.org/prep/maintain_toc.html
 
 Options:
+  -s SRCFILE  read Texinfo from SRCFILE, instead of PACKAGE.{texinfo|texi|txi}
   -o OUTDIR   write files into OUTDIR, instead of manual/.
   --email ADR use ADR as contact in generated web pages.
   --docbook   convert to DocBook too (xml, txt, html, pdf and ps).
@@ -94,16 +102,16 @@ If a manual's Texinfo sources are spread across several directories,
 first copy or symlink all Texinfo sources into a single directory.
 (Part of the script's work is to make a tar.gz of the sources.)
 
-You can set the environment variables MAKEINFO, TEXI2DVI, and DVIPS to
-control the programs that get executed, and GENDOCS_TEMPLATE_DIR to
-control where the gendocs_template file is looked for.  (With --docbook,
-the environment variables DOCBOOK2HTML, DOCBOOK2PDF, DOCBOOK2PS, and
-DOCBOOK2TXT are also respected.)
+You can set the environment variables MAKEINFO, TEXI2DVI, TEXI2HTML, and
+DVIPS to control the programs that get executed, and
+GENDOCS_TEMPLATE_DIR to control where the gendocs_template file is
+looked for.  With --docbook, the environment variables DOCBOOK2HTML,
+DOCBOOK2PDF, DOCBOOK2PS, and DOCBOOK2TXT are also respected.
 
-By default, makeinfo is run in the default (English) locale, since
-that's the language of most Texinfo manuals.  If you happen to have a
-non-English manual and non-English web site, see the SETLANG setting
-in the source.
+By default, makeinfo and texi2dvi are run in the default (English)
+locale, since that's the language of most Texinfo manuals.  If you
+happen to have a non-English manual and non-English web site, see the
+SETLANG setting in the source.
 
 Email bug reports or enhancement requests to bug-texinfo@gnu.org.
 "
@@ -119,12 +127,14 @@ PACKAGE=
 EMAIL=webmasters@gnu.org  # please override with --email
 htmlarg=
 outdir=manual
+srcfile=
 
 while test $# -gt 0; do
   case $1 in
     --email) shift; EMAIL=$1;;
     --help) echo "$usage"; exit 0;;
     --version) echo "$version"; exit 0;;
+    -s) shift; srcfile=$1;;
     -o) shift; outdir=$1;;
     --docbook) docbook=yes;;
     --html) shift; htmlarg=$1;;
@@ -146,7 +156,17 @@ while test $# -gt 0; do
   shift
 done
 
-if test -s "$srcdir/$PACKAGE.texinfo"; then
+# For most of the following, the base name is just $PACKAGE
+base=$PACKAGE
+
+if test -n "$srcfile"; then
+  # but here, we use the basename of $srcfile
+  base=`basename "$srcfile"`
+  case $base in
+    *.txi|*.texi|*.texinfo) base=`echo "$base"|sed 's/\.[texinfo]*$//'`;;
+  esac
+  PACKAGE=$base
+elif test -s "$srcdir/$PACKAGE.texinfo"; then
   srcfile=$srcdir/$PACKAGE.texinfo
 elif test -s "$srcdir/$PACKAGE.texi"; then
   srcfile=$srcdir/$PACKAGE.texi
@@ -164,8 +184,8 @@ if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then
 fi
 
 case $outdir in
-  /*) dotdot_outdir="$outdir";;
-  *) dotdot_outdir="../$outdir";;
+  /*) abs_outdir=$outdir;;
+  *)  abs_outdir=$srcdir/$outdir;;
 esac
 
 echo Generating output formats for $srcfile
@@ -173,13 +193,13 @@ echo Generating output formats for $srcfile
 cmd="$SETLANG $MAKEINFO -o $PACKAGE.info \"$srcfile\""
 echo "Generating info files... ($cmd)"
 eval "$cmd"
-mkdir -p $outdir/
-tar czf $outdir/$PACKAGE.info.tar.gz $PACKAGE.info*
-info_tgz_size=`calcsize $outdir/$PACKAGE.info.tar.gz`
+mkdir -p "$outdir/"
+tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info*
+info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"`
 # do not mv the info files, there's no point in having them available
 # separately on the web.
 
-cmd="${TEXI2DVI} \"$srcfile\""
+cmd="$SETLANG ${TEXI2DVI} \"$srcfile\""
 echo "Generating dvi ... ($cmd)"
 eval "$cmd"
 
@@ -188,26 +208,26 @@ echo Generating postscript...
 ${DVIPS} $PACKAGE -o
 gzip -f -9 $PACKAGE.ps
 ps_gz_size=`calcsize $PACKAGE.ps.gz`
-mv $PACKAGE.ps.gz $outdir/
+mv $PACKAGE.ps.gz "$outdir/"
 
 # compress/finish dvi:
 gzip -f -9 $PACKAGE.dvi
 dvi_gz_size=`calcsize $PACKAGE.dvi.gz`
-mv $PACKAGE.dvi.gz $outdir/
+mv $PACKAGE.dvi.gz "$outdir/"
 
-cmd="${TEXI2DVI} --pdf \"$srcfile\""
+cmd="$SETLANG ${TEXI2DVI} --pdf \"$srcfile\""
 echo "Generating pdf ... ($cmd)"
 eval "$cmd"
 pdf_size=`calcsize $PACKAGE.pdf`
-mv $PACKAGE.pdf $outdir/
+mv $PACKAGE.pdf "$outdir/"
 
 cmd="$SETLANG $MAKEINFO -o $PACKAGE.txt --no-split --no-headers \"$srcfile\""
 echo "Generating ASCII... ($cmd)"
 eval "$cmd"
 ascii_size=`calcsize $PACKAGE.txt`
-gzip -f -9 -c $PACKAGE.txt >$outdir/$PACKAGE.txt.gz
-ascii_gz_size=`calcsize $outdir/$PACKAGE.txt.gz`
-mv $PACKAGE.txt $outdir/
+gzip -f -9 -c $PACKAGE.txt >"$outdir/$PACKAGE.txt.gz"
+ascii_gz_size=`calcsize "$outdir/$PACKAGE.txt.gz"`
+mv $PACKAGE.txt "$outdir/"
 
 html_split()
 {
@@ -219,12 +239,12 @@ html_split()
   (
     cd ${split_html_dir} || exit 1
     ln -sf ${PACKAGE}.html index.html
-    tar -czf $dotdot_outdir/${PACKAGE}.html_$1.tar.gz -- *.html
+    tar -czf "$abs_outdir/${PACKAGE}.html_$1.tar.gz" -- *.html
   )
-  eval html_$1_tgz_size=`calcsize $outdir/${PACKAGE}.html_$1.tar.gz`
-  rm -f $outdir/html_$1/*.html
-  mkdir -p $outdir/html_$1/
-  mv ${split_html_dir}/*.html $outdir/html_$1/
+  eval html_$1_tgz_size=`calcsize "$outdir/${PACKAGE}.html_$1.tar.gz"`
+  rm -f "$outdir"/html_$1/*.html
+  mkdir -p "$outdir/html_$1/"
+  mv ${split_html_dir}/*.html "$outdir/html_$1/"
   rmdir ${split_html_dir}
 }
 
@@ -235,9 +255,9 @@ if test -z "$use_texi2html"; then
   rm -rf $PACKAGE.html  # in case a directory is left over
   eval "$cmd"
   html_mono_size=`calcsize $PACKAGE.html`
-  gzip -f -9 -c $PACKAGE.html >$outdir/$PACKAGE.html.gz
-  html_mono_gz_size=`calcsize $outdir/$PACKAGE.html.gz`
-  mv $PACKAGE.html $outdir/
+  gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz"
+  html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"`
+  mv $PACKAGE.html "$outdir/"
 
   cmd="$SETLANG $MAKEINFO --html -o $PACKAGE.html $htmlarg \"$srcfile\""
   echo "Generating html by node... ($cmd)"
@@ -245,12 +265,12 @@ if test -z "$use_texi2html"; then
   split_html_dir=$PACKAGE.html
   (
    cd ${split_html_dir} || exit 1
-   tar -czf $dotdot_outdir/${PACKAGE}.html_node.tar.gz -- *.html
+   tar -czf "$abs_outdir/${PACKAGE}.html_node.tar.gz" -- *.html
   )
-  html_node_tgz_size=`calcsize $outdir/${PACKAGE}.html_node.tar.gz`
-  rm -f $outdir/html_node/*.html
-  mkdir -p $outdir/html_node/
-  mv ${split_html_dir}/*.html $outdir/html_node/
+  html_node_tgz_size=`calcsize "$outdir/${PACKAGE}.html_node.tar.gz"`
+  rm -f "$outdir"/html_node/*.html
+  mkdir -p "$outdir/html_node/"
+  mv ${split_html_dir}/*.html "$outdir/html_node/"
   rmdir ${split_html_dir}
 else
   cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $htmlarg \"$srcfile\""
@@ -258,9 +278,9 @@ else
   rm -rf $PACKAGE.html  # in case a directory is left over
   eval "$cmd"
   html_mono_size=`calcsize $PACKAGE.html`
-  gzip -f -9 -c $PACKAGE.html >$outdir/$PACKAGE.html.gz
-  html_mono_gz_size=`calcsize $outdir/$PACKAGE.html.gz`
-  mv $PACKAGE.html $outdir/
+  gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz"
+  html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"`
+  mv $PACKAGE.html "$outdir/"
 
   html_split node
   html_split chapter
@@ -268,51 +288,55 @@ else
 fi
 
 echo Making .tar.gz for sources...
-srcfiles=`ls *.texinfo *.texi *.txi *.eps 2>/dev/null` || true
-tar cvzfh $outdir/$PACKAGE.texi.tar.gz $srcfiles
-texi_tgz_size=`calcsize $outdir/$PACKAGE.texi.tar.gz`
+d=`dirname $srcfile`
+(
+  cd "$d"
+  srcfiles=`ls *.texinfo *.texi *.txi *.eps 2>/dev/null` || true
+  tar cvzfh "$abs_outdir/$PACKAGE.texi.tar.gz" $srcfiles
+)
+texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`
 
 if test -n "$docbook"; then
   cmd="$SETLANG $MAKEINFO -o - --docbook \"$srcfile\" > ${srcdir}/$PACKAGE-db.xml"
-  echo "Generating docbook XML... $(cmd)"
+  echo "Generating docbook XML... ($cmd)"
   eval "$cmd"
   docbook_xml_size=`calcsize $PACKAGE-db.xml`
-  gzip -f -9 -c $PACKAGE-db.xml >$outdir/$PACKAGE-db.xml.gz
-  docbook_xml_gz_size=`calcsize $outdir/$PACKAGE-db.xml.gz`
-  mv $PACKAGE-db.xml $outdir/
+  gzip -f -9 -c $PACKAGE-db.xml >"$outdir/$PACKAGE-db.xml.gz"
+  docbook_xml_gz_size=`calcsize "$outdir/$PACKAGE-db.xml.gz"`
+  mv $PACKAGE-db.xml "$outdir/"
 
-  cmd="${DOCBOOK2HTML} -o $split_html_db_dir ${outdir}/$PACKAGE-db.xml"
+  split_html_db_dir=html_node_db
+  cmd="${DOCBOOK2HTML} -o $split_html_db_dir \"${outdir}/$PACKAGE-db.xml\""
   echo "Generating docbook HTML... ($cmd)"
   eval "$cmd"
-  split_html_db_dir=html_node_db
   (
     cd ${split_html_db_dir} || exit 1
-    tar -czf $dotdot_outdir/${PACKAGE}.html_node_db.tar.gz -- *.html
+    tar -czf "$abs_outdir/${PACKAGE}.html_node_db.tar.gz" -- *.html
   )
-  html_node_db_tgz_size=`calcsize $outdir/${PACKAGE}.html_node_db.tar.gz`
-  rm -f $outdir/html_node_db/*.html
-  mkdir -p $outdir/html_node_db
-  mv ${split_html_db_dir}/*.html $outdir/html_node_db/
+  html_node_db_tgz_size=`calcsize "$outdir/${PACKAGE}.html_node_db.tar.gz"`
+  rm -f "$outdir"/html_node_db/*.html
+  mkdir -p "$outdir/html_node_db"
+  mv ${split_html_db_dir}/*.html "$outdir/html_node_db/"
   rmdir ${split_html_db_dir}
 
-  cmd="${DOCBOOK2TXT} ${outdir}/$PACKAGE-db.xml"
+  cmd="${DOCBOOK2TXT} \"${outdir}/$PACKAGE-db.xml\""
   echo "Generating docbook ASCII... ($cmd)"
   eval "$cmd"
   docbook_ascii_size=`calcsize $PACKAGE-db.txt`
-  mv $PACKAGE-db.txt $outdir/
+  mv $PACKAGE-db.txt "$outdir/"
 
-  cmd="${DOCBOOK2PS} ${outdir}/$PACKAGE-db.xml"
-  echo "Generating docbook PS... $(cmd)"
+  cmd="${DOCBOOK2PS} \"${outdir}/$PACKAGE-db.xml\""
+  echo "Generating docbook PS... ($cmd)"
   eval "$cmd"
-  gzip -f -9 -c $PACKAGE-db.ps >$outdir/$PACKAGE-db.ps.gz
-  docbook_ps_gz_size=`calcsize $outdir/$PACKAGE-db.ps.gz`
-  mv $PACKAGE-db.ps $outdir/
+  gzip -f -9 -c $PACKAGE-db.ps >"$outdir/$PACKAGE-db.ps.gz"
+  docbook_ps_gz_size=`calcsize "$outdir/$PACKAGE-db.ps.gz"`
+  mv $PACKAGE-db.ps "$outdir/"
 
-  cmd="${DOCBOOK2PDF} ${outdir}/$PACKAGE-db.xml"
+  cmd="${DOCBOOK2PDF} \"${outdir}/$PACKAGE-db.xml\""
   echo "Generating docbook PDF... ($cmd)"
   eval "$cmd"
   docbook_pdf_size=`calcsize $PACKAGE-db.pdf`
-  mv $PACKAGE-db.pdf $outdir/
+  mv $PACKAGE-db.pdf "$outdir/"
 fi
 
 echo "Writing index file..."
@@ -349,7 +373,7 @@ sed \
    -e "s,%%SCRIPTURL%%,$scripturl,g" \
    -e "s!%%SCRIPTNAME%%!$prog!g" \
    -e "$CONDS" \
-$GENDOCS_TEMPLATE_DIR/gendocs_template >$outdir/index.html
+$GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html"
 
 echo "Done, see $outdir/ subdirectory for new files."
 
index 8317604f8fd5eb07d46a8a3c4e2a2ca24b5b442b..0fa90636bd1e12517aea2a9760f5736588a361a9 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2009-09-09.22
+scriptversion=2012-03-18.17; # UTC
 
-# Copyright (C) 2007-2009 Free Software Foundation
+# Copyright (C) 2007-2012 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
@@ -44,8 +44,10 @@ scriptversion=2009-09-09.22
 #   files to pick up a version string change; and leave it stale to
 #   minimize rebuild time after unrelated changes to configure sources.
 #
-# It is probably wise to add these two files to .gitignore, so that you
-# don't accidentally commit either generated file.
+# As with any generated file in a VC'd directory, you should add
+# /.version to .gitignore, so that you don't accidentally commit it.
+# .tarball-version is never generated in a VC'd directory, so needn't
+# be listed there.
 #
 # Use the following line in your configure.ac, so that $(VERSION) will
 # automatically be up-to-date each time configure is run (and note that
@@ -57,47 +59,104 @@ scriptversion=2009-09-09.22
 #         [bug-project@example])
 #
 # Then use the following lines in your Makefile.am, so that .version
-# will be present for dependencies, and so that .tarball-version will
-# exist in distribution tarballs.
+# will be present for dependencies, and so that .version and
+# .tarball-version will exist in distribution tarballs.
 #
+# EXTRA_DIST = $(top_srcdir)/.version
 # BUILT_SOURCES = $(top_srcdir)/.version
 # $(top_srcdir)/.version:
 #      echo $(VERSION) > $@-t && mv $@-t $@
 # dist-hook:
 #      echo $(VERSION) > $(distdir)/.tarball-version
 
-case $# in
-    1) ;;
-    *) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;;
-esac
 
-tarball_version_file=$1
+me=$0
+
+version="git-version-gen $scriptversion
+
+Copyright 2011 Free Software Foundation, Inc.
+There is NO warranty.  You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
+
+usage="\
+Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT]
+Print a version string.
+
+Options:
+
+   --prefix           prefix of git tags (default 'v')
+
+   --help             display this help and exit
+   --version          output version information and exit
+
+Running without arguments will suffice in most cases."
+
+prefix=v
+
+while test $# -gt 0; do
+  case $1 in
+    --help) echo "$usage"; exit 0;;
+    --version) echo "$version"; exit 0;;
+    --prefix) shift; prefix="$1";;
+    -*)
+      echo "$0: Unknown option '$1'." >&2
+      echo "$0: Try '--help' for more information." >&2
+      exit 1;;
+    *)
+      if test -z "$tarball_version_file"; then
+        tarball_version_file="$1"
+      elif test -z "$tag_sed_script"; then
+        tag_sed_script="$1"
+      else
+        echo "$0: extra non-option argument '$1'." >&2
+        exit 1
+      fi;;
+  esac
+  shift
+done
+
+if test -z "$tarball_version_file"; then
+    echo "$usage"
+    exit 1
+fi
+
+tag_sed_script="${tag_sed_script:-s/x/x/}"
+
 nl='
 '
 
+# Avoid meddling by environment variable of the same name.
+v=
+v_from_git=
+
 # First see if there is a tarball-only version file.
 # then try "git describe", then default.
 if test -f $tarball_version_file
 then
-    v=`cat $tarball_version_file` || exit 1
+    v=`cat $tarball_version_file` || v=
     case $v in
-       *$nl*) v= ;; # reject multi-line output
-       [0-9]*) ;;
-       *) v= ;;
+        *$nl*) v= ;; # reject multi-line output
+        [0-9]*) ;;
+        *) v= ;;
     esac
     test -z "$v" \
-       && echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2
+        && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
 fi
 
 if test -n "$v"
 then
     : # use $v
-elif test -d .git \
-    && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
-         || git describe --abbrev=4 HEAD 2>/dev/null` \
+# Otherwise, if there is at least one git commit involving the working
+# directory, and "git describe" output looks sensible, use that to
+# derive a version string.
+elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
+    && v=`git describe --abbrev=4 --match="$prefix*" HEAD 2>/dev/null \
+          || git describe --abbrev=4 HEAD 2>/dev/null` \
+    && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
     && case $v in
-        v[0-9]*) ;;
-        *) (exit 1) ;;
+         $prefix[0-9]*) ;;
+         *) (exit 1) ;;
        esac
 then
     # Is this a new git that lists number of commits since the last
@@ -105,46 +164,57 @@ then
     #   Newer: v6.10-77-g0f8faeb
     #   Older: v6.10-g0f8faeb
     case $v in
-       *-*-*) : git describe is okay three part flavor ;;
-       *-*)
-           : git describe is older two part flavor
-           # Recreate the number of commits and rewrite such that the
-           # result is the same as if we were using the newer version
-           # of git describe.
-           vtag=`echo "$v" | sed 's/-.*//'`
-           numcommits=`git rev-list "$vtag"..HEAD | wc -l`
-           v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
-           ;;
+        *-*-*) : git describe is okay three part flavor ;;
+        *-*)
+            : git describe is older two part flavor
+            # Recreate the number of commits and rewrite such that the
+            # result is the same as if we were using the newer version
+            # of git describe.
+            vtag=`echo "$v" | sed 's/-.*//'`
+            commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \
+                || { commit_list=failed;
+                     echo "$0: WARNING: git rev-list failed" 1>&2; }
+            numcommits=`echo "$commit_list" | wc -l`
+            v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
+            test "$commit_list" = failed && v=UNKNOWN
+            ;;
     esac
 
     # Change the first '-' to a '.', so version-comparing tools work properly.
     # Remove the "g" in git describe's output string, to save a byte.
     v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
+    v_from_git=1
 else
     v=UNKNOWN
 fi
 
-v=`echo "$v" |sed 's/^v//'`
+v=`echo "$v" |sed "s/^$prefix//"`
 
-# Don't declare a version "dirty" merely because a time stamp has changed.
-git status > /dev/null 2>&1
+# Test whether to append the "-dirty" suffix only if the version
+# string we're using came from git.  I.e., skip the test if it's "UNKNOWN"
+# or if it came from .tarball-version.
+if test -n "$v_from_git"; then
+  # Don't declare a version "dirty" merely because a time stamp has changed.
+  git update-index --refresh > /dev/null 2>&1
 
-dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
-case "$dirty" in
-    '') ;;
-    *) # Append the suffix only if there isn't one already.
-       case $v in
-         *-dirty) ;;
-         *) v="$v-dirty" ;;
-       esac ;;
-esac
+  dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
+  case "$dirty" in
+      '') ;;
+      *) # Append the suffix only if there isn't one already.
+          case $v in
+            *-dirty) ;;
+            *) v="$v-dirty" ;;
+          esac ;;
+  esac
+fi
 
 # Omit the trailing newline, so that m4_esyscmd can use the result directly.
-echo "$v" | tr -d '\012'
+echo "$v" | tr -d "$nl"
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
index 7660af511c4a2cb493ac8e827375b1c3c4b8a85f..17c456271d9a058e4d65d96e4af911a0fb053773 100755 (executable)
@@ -3,13 +3,13 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
     if 0;
 # Convert git log output to ChangeLog format.
 
-my $VERSION = '2009-10-30 13:46'; # UTC
+my $VERSION = '2012-05-22 09:40'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
-# Copyright (C) 2008-2010 Free Software Foundation, Inc.
+# Copyright (C) 2008-2012 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
@@ -47,7 +47,7 @@ sub usage ($)
   my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
   if ($exit_code != 0)
     {
-      print $STREAM "Try `$ME --help' for more information.\n";
+      print $STREAM "Try '$ME --help' for more information.\n";
     }
   else
     {
@@ -60,12 +60,23 @@ $ME, they may be preceded by '--'.
 
 OPTIONS:
 
+   --amend=FILE FILE maps from an SHA1 to perl code (i.e., s/old/new/) that
+                  makes a change to SHA1's commit log text or metadata.
+   --append-dot append a dot to the first line of each commit message if
+                  there is no other punctuation or blank at the end.
+   --no-cluster never cluster commit messages under the same date/author
+                  header; the default is to cluster adjacent commit messages
+                  if their headers are the same and neither commit message
+                  contains multiple paragraphs.
    --since=DATE convert only the logs since DATE;
                   the default is to convert all log entries.
    --format=FMT set format string for commit subject and body;
                   see 'man git-log' for the list of format metacharacters;
                   the default is '%s%n%b%n'
-
+   --strip-tab  remove one additional leading TAB from commit message lines.
+   --strip-cherry-pick  remove data inserted by "git cherry-pick";
+                  this includes the "cherry picked from commit ..." line,
+                  and the possible final "Conflicts:" paragraph.
    --help       display this help and exit
    --version    output version information and exit
 
@@ -74,6 +85,38 @@ EXAMPLE:
   $ME --since=2008-01-01 > ChangeLog
   $ME -- -n 5 foo > last-5-commits-to-branch-foo
 
+SPECIAL SYNTAX:
+
+The following types of strings are interpreted specially when they appear
+at the beginning of a log message line.  They are not copied to the output.
+
+  Copyright-paperwork-exempt: Yes
+    Append the "(tiny change)" notation to the usual "date name email"
+    ChangeLog header to mark a change that does not require a copyright
+    assignment.
+  Co-authored-by: Joe User <user\@example.com>
+    List the specified name and email address on a second
+    ChangeLog header, denoting a co-author.
+  Signed-off-by: Joe User <user\@example.com>
+    These lines are simply elided.
+
+In a FILE specified via --amend, comment lines (starting with "#") are ignored.
+FILE must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1 (alone on
+a line) referring to a commit in the current project, and CODE refers to one
+or more consecutive lines of Perl code.  Pairs must be separated by one or
+more blank line.
+
+Here is sample input for use with --amend=FILE, from coreutils:
+
+3a169f4c5d9159283548178668d2fae6fced3030
+# fix typo in title:
+s/all tile types/all file types/
+
+1379ed974f1fa39b12e2ffab18b3f7a607082202
+# Due to a bug in vc-dwim, I mis-attributed a patch by Paul to myself.
+# Change the author to be Paul.  Note the escaped "@":
+s,Jim .*>,Paul Eggert <eggert\\\@cs.ucla.edu>,
+
 EOF
     }
   exit $exit_code;
@@ -99,24 +142,94 @@ sub quoted_cmd(@)
   return join (' ', map {shell_quote $_} @_);
 }
 
+# Parse file F.
+# Comment lines (starting with "#") are ignored.
+# F must consist of <SHA,CODE+> pairs where SHA is a 40-byte SHA1
+# (alone on a line) referring to a commit in the current project, and
+# CODE refers to one or more consecutive lines of Perl code.
+# Pairs must be separated by one or more blank line.
+sub parse_amend_file($)
+{
+  my ($f) = @_;
+
+  open F, '<', $f
+    or die "$ME: $f: failed to open for reading: $!\n";
+
+  my $fail;
+  my $h = {};
+  my $in_code = 0;
+  my $sha;
+  while (defined (my $line = <F>))
+    {
+      $line =~ /^\#/
+        and next;
+      chomp $line;
+      $line eq ''
+        and $in_code = 0, next;
+
+      if (!$in_code)
+        {
+          $line =~ /^([0-9a-fA-F]{40})$/
+            or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
+              $fail = 1, next;
+          $sha = lc $1;
+          $in_code = 1;
+          exists $h->{$sha}
+            and (warn "$ME: $f:$.: duplicate SHA1\n"),
+              $fail = 1, next;
+        }
+      else
+        {
+          $h->{$sha} ||= '';
+          $h->{$sha} .= "$line\n";
+        }
+    }
+  close F;
+
+  $fail
+    and exit 1;
+
+  return $h;
+}
+
 {
-  my $since_date = '1970-01-01 UTC';
+  my $since_date;
   my $format_string = '%s%n%b%n';
+  my $amend_file;
+  my $append_dot = 0;
+  my $cluster = 1;
+  my $strip_tab = 0;
+  my $strip_cherry_pick = 0;
   GetOptions
     (
      help => sub { usage 0 },
      version => sub { print "$ME version $VERSION\n"; exit },
      'since=s' => \$since_date,
      'format=s' => \$format_string,
+     'amend=s' => \$amend_file,
+     'append-dot' => \$append_dot,
+     'cluster!' => \$cluster,
+     'strip-tab' => \$strip_tab,
+     'strip-cherry-pick' => \$strip_cherry_pick,
     ) or usage 1;
 
-  my @cmd = (qw (git log --log-size), "--since=$since_date",
-             '--pretty=format:%ct  %an  <%ae>%n%n'.$format_string, @ARGV);
+
+  defined $since_date
+    and unshift @ARGV, "--since=$since_date";
+
+  # This is a hash that maps an SHA1 to perl code (i.e., s/old/new/)
+  # that makes a correction in the log or attribution of that commit.
+  my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {};
+
+  my @cmd = (qw (git log --log-size),
+             '--pretty=format:%H:%ct  %an  <%ae>%n%n'.$format_string, @ARGV);
   open PIPE, '-|', @cmd
-    or die ("$ME: failed to run `". quoted_cmd (@cmd) ."': $!\n"
+    or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n"
             . "(Is your Git too old?  Version 1.5.1 or later is required.)\n");
 
+  my $prev_multi_paragraph;
   my $prev_date_line = '';
+  my @prev_coauthors = ();
   while (1)
     {
       defined (my $in = <PIPE>)
@@ -130,7 +243,41 @@ sub quoted_cmd(@)
       $n_read == $log_nbytes
         or die "$ME:$.: unexpected EOF\n";
 
-      my @line = split "\n", $log;
+      # Extract leading hash.
+      my ($sha, $rest) = split ':', $log, 2;
+      defined $sha
+        or die "$ME:$.: malformed log entry\n";
+      $sha =~ /^[0-9a-fA-F]{40}$/
+        or die "$ME:$.: invalid SHA1: $sha\n";
+
+      # If this commit's log requires any transformation, do it now.
+      my $code = $amend_code->{$sha};
+      if (defined $code)
+        {
+          eval 'use Safe';
+          my $s = new Safe;
+          # Put the unpreprocessed entry into "$_".
+          $_ = $rest;
+
+          # Let $code operate on it, safely.
+          my $r = $s->reval("$code")
+            or die "$ME:$.:$sha: failed to eval \"$code\":\n$@\n";
+
+          # Note that we've used this entry.
+          delete $amend_code->{$sha};
+
+          # Update $rest upon success.
+          $rest = $_;
+        }
+
+      # Remove lines inserted by "git cherry-pick".
+      if ($strip_cherry_pick)
+        {
+          $rest =~ s/^\s*Conflicts:\n.*//sm;
+          $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m;
+        }
+
+      my @line = split "\n", $rest;
       my $author_line = shift @line;
       defined $author_line
         or die "$ME:$.: unexpected EOF\n";
@@ -138,19 +285,62 @@ sub quoted_cmd(@)
         or die "$ME:$.: Invalid line "
           . "(expected date/author/email):\n$author_line\n";
 
-      my $date_line = sprintf "%s  $2\n", strftime ("%F", localtime ($1));
-      # If this line would be the same as the previous date/name/email
-      # line, then arrange not to print it.
-      if ($date_line ne $prev_date_line)
+      # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
+      # `(tiny change)' annotation.
+      my $tiny = (grep (/^Copyright-paperwork-exempt:\s+[Yy]es$/, @line)
+                  ? '  (tiny change)' : '');
+
+      my $date_line = sprintf "%s  %s$tiny\n",
+        strftime ("%F", localtime ($1)), $2;
+
+      my @coauthors = grep /^Co-authored-by:.*$/, @line;
+      # Omit meta-data lines we've already interpreted.
+      @line = grep !/^(?:Signed-off-by:[ ].*>$
+                       |Co-authored-by:[ ]
+                       |Copyright-paperwork-exempt:[ ]
+                       )/x, @line;
+
+      # Remove leading and trailing blank lines.
+      if (@line)
+        {
+          while ($line[0] =~ /^\s*$/) { shift @line; }
+          while ($line[$#line] =~ /^\s*$/) { pop @line; }
+        }
+
+      # Record whether there are two or more paragraphs.
+      my $multi_paragraph = grep /^\s*$/, @line;
+
+      # Format 'Co-authored-by: A U Thor <email@example.com>' lines in
+      # standard multi-author ChangeLog format.
+      for (@coauthors)
+        {
+          s/^Co-authored-by:\s*/\t    /;
+          s/\s*</  </;
+
+          /<.*?@.*\..*>/
+            or warn "$ME: warning: missing email address for "
+              . substr ($_, 5) . "\n";
+        }
+
+      # If clustering of commit messages has been disabled, if this header
+      # would be different from the previous date/name/email/coauthors header,
+      # or if this or the previous entry consists of two or more paragraphs,
+      # then print the header.
+      if ( ! $cluster
+          || $date_line ne $prev_date_line
+          || "@coauthors" ne "@prev_coauthors"
+          || $multi_paragraph
+          || $prev_multi_paragraph)
         {
           $prev_date_line eq ''
             or print "\n";
           print $date_line;
+          @coauthors
+            and print join ("\n", @coauthors), "\n";
         }
       $prev_date_line = $date_line;
-
-      # Omit "Signed-off-by..." lines.
-      @line = grep !/^Signed-off-by: .*>$/, @line;
+      @prev_coauthors = @coauthors;
+      $prev_multi_paragraph = $multi_paragraph;
 
       # If there were any lines
       if (@line == 0)
@@ -159,9 +349,21 @@ sub quoted_cmd(@)
         }
       else
         {
-          # Remove leading and trailing blank lines.
-          while ($line[0] =~ /^\s*$/) { shift @line; }
-          while ($line[$#line] =~ /^\s*$/) { pop @line; }
+          if ($append_dot)
+            {
+              # If the first line of the message has enough room, then
+              if (length $line[0] < 72)
+                {
+                  # append a dot if there is no other punctuation or blank
+                  # at the end.
+                  $line[0] =~ /[[:punct:]\s]$/
+                    or $line[0] .= '.';
+                }
+            }
+
+          # Remove one additional leading TAB from each line.
+          $strip_tab
+            and map { s/^\t// } @line;
 
           # Prefix each non-empty line with a TAB.
           @line = map { length $_ ? "\t$_" : '' } @line;
@@ -178,6 +380,16 @@ sub quoted_cmd(@)
   close PIPE
     or die "$ME: error closing pipe from " . quoted_cmd (@cmd) . "\n";
   # FIXME-someday: include $PROCESS_STATUS in the diagnostic
+
+  # Complain about any unused entry in the --amend=F specified file.
+  my $fail = 0;
+  foreach my $sha (keys %$amend_code)
+    {
+      warn "$ME:$amend_file: unused entry: $sha\n";
+      $fail = 1;
+    }
+
+  exit $fail;
 }
 
 # Local Variables:
index 2c1a0cc6eb28ec6932730700f229662549f784f9..851f8b899bb21f2664488debf5ee162c5e106091 100755 (executable)
@@ -9,7 +9,7 @@
 
 VERSION=2009-07-21.16; # UTC
 
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 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
@@ -27,59 +27,80 @@ VERSION=2009-07-21.16; # UTC
 # Requirements: everything required to bootstrap your package,
 # plus these: git, cvs, cvsu, rsync, mktemp
 
-ME=`basename "$0"`
+ME=$(basename "$0")
 warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
 die() { warn "$*"; exit 1; }
 
-help_version()
+help()
 {
-  case $1 in
-    --help) cat <<EOF
+  cat <<EOF
 Usage: $ME
 
-Run this script (no options or arguments) after each non-alpha release,
-to update the web documentation at http://www.gnu.org/software/\$pkg/manual/
-Run it from your project's the top-level directory.
+Run this script from top_srcdir (no options or arguments) after each
+non-alpha release, to update the web documentation at
+http://www.gnu.org/software/\$pkg/manual/ Run it from your project's
+the top-level directory.
 
 Options:
-  --help     print this help, then exit
-  --version  print version number, then exit
+  -C, --builddir=DIR  location of (configured) Makefile (default: .)
+  --help              print this help, then exit
+  --version           print version number, then exit
 
 Report bugs and patches to <bug-gnulib@gnu.org>.
 EOF
-      exit ;;
+  exit
+}
 
-    --version)
-      year=`echo "$VERSION" | sed 's/[^0-9].*//'`
-      cat <<EOF
+version()
+{
+  year=$(echo "$VERSION" | sed 's/[^0-9].*//')
+  cat <<EOF
 $ME $VERSION
 Copyright (C) $year Free Software Foundation, Inc,
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 EOF
-      exit ;;
+  exit
+}
+
+builddir=.
+while test $# != 0
+do
+  # Handle --option=value by splitting apart and putting back on argv.
+  case $1 in
+    --*=*)
+      opt=$(echo "$1" | sed -e 's/=.*//')
+      val=$(echo "$1" | sed -e 's/[^=]*=//')
+      shift
+      set dummy "$opt" "$val" ${1+"$@"}; shift
+      ;;
+  esac
 
-  *) die "unrecognized option: $1";;
+  case $1 in
+    --help|--version) ${1#--};;
+    -C|--builddir) shift; builddir=$1; shift ;;
+    --*) die "unrecognized option: $1";;
+    *) break;;
   esac
-}
+done
 
-case $# in
-  0) ;;
-  1) help_version $1 ;;
-  *) die "$ME: too many options" ;;
-esac
+test $# = 0 \
+  || die "$ME: too many arguments"
 
 prev=.prev-version
 version=$(cat $prev) || die "$ME: no $prev file?"
-pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' Makefile) || die "$ME: no Makefile?"
+pkg=$(sed -n 's/^PACKAGE = \(.*\)/\1/p' $builddir/Makefile) \
+  || die "$ME: no Makefile?"
 tmp_branch=web-doc-$version-$$
+current_branch=$(git branch | sed -ne '/^\* /{s///;p;q;}')
 
 cleanup()
 {
-  __st=$?;
+  __st=$?
   rm -rf "$tmp"
-  git checkout master
+  git checkout "$current_branch"
+  git submodule update --recursive
   git branch -d $tmp_branch
   exit $__st
 }
@@ -89,13 +110,23 @@ trap 'exit $?' 1 2 13 15
 # We must build using sources for which --version reports the
 # just-released version number, not some string like 7.6.18-20761.
 # That version string propagates into all documentation.
+set -e
 git checkout -b $tmp_branch v$version
-./bootstrap && ./configure && make && make web-manual
-
-tmp=$(mktemp -d --tmpdir=. web-doc-update.XXXXXX) || exit 1
+git submodule update --recursive
+./bootstrap
+srcdir=$(pwd)
+cd "$builddir"
+  ./config.status --recheck
+  ./config.status
+  make
+  make web-manual
+cd "$srcdir"
+set +e
+
+tmp=$(mktemp -d web-doc-update.XXXXXX) || exit 1
 ( cd $tmp \
     && cvs -d $USER@cvs.sv.gnu.org:/webcvs/$pkg co $pkg )
-rsync -avP doc/manual/ $tmp/$pkg/manual
+rsync -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
 
 (
   cd $tmp/$pkg/manual
index bfdad59b6a73e9a4ad5d6f2e8d83c32a27c10f60..a0e5c7b60ff36872458a1d4dff1882a60dee4a6d 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/sh
 # Sign files and upload them.
 
-scriptversion=2009-12-21.21; # UTC
+scriptversion=2012-06-11.00; # UTC
 
-# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation
+# Copyright (C) 2004-2012 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,8 @@ scriptversion=2009-12-21.21; # UTC
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Originally written by Alexandre Duret-Lutz <adl@gnu.org>.
+# The master copy of this file is maintained in the gnulib Git repository.
+# Please send bug reports and feature requests to bug-gnulib@gnu.org.
 
 set -e
 
@@ -26,16 +28,20 @@ GPG='gpg --batch --no-tty'
 conffile=.gnuploadrc
 to=
 dry_run=false
+replace=
 symlink_files=
 delete_files=
 delete_symlinks=
 collect_var=
 dbg=
+nl='
+'
 
-usage="Usage: $0 [OPTIONS]... [COMMAND] FILES... [[COMMAND] FILES...]
+usage="Usage: $0 [OPTION]... [CMD] FILE... [[CMD] FILE...]
 
-Sign all FILES, and upload them to selected destinations, according to
-<http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>.
+Sign all FILES, and process them at selected destinations according to CMD.
+<http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
+explains further.
 
 Commands:
   --delete                 delete FILES from destination
@@ -48,12 +54,14 @@ Options:
   --to DEST                specify one destination for FILES
                            (multiple --to options are allowed)
   --user NAME              sign with key NAME
+  --replace                allow replacements of existing files
   --symlink-regex[=EXPR]   use sed script EXPR to compute symbolic link names
   --dry-run                do nothing, show what would have been done
+                           (including the constructed directive file)
   --version                output version information and exit
 
 If --symlink-regex is given without EXPR, then the link target name
-is created by replacing the version information with \`-latest', e.g.:
+is created by replacing the version information with '-latest', e.g.:
 
   foo-1.3.4.tar.gz -> foo-latest.tar.gz
 
@@ -101,13 +109,13 @@ happen to have an ncftp package installed, the ncftpput-ftp script in
 the build-aux/ directory of the gnulib package
 (http://savannah.gnu.org/projects/gnulib) may serve as a replacement.
 
-Report bugs to <bug-automake@gnu.org>.
-Send patches to <automake-patches@gnu.org>."
+Send patches and bug reports to <bug-gnulib@gnu.org>."
 
 # Read local configuration file
 if test -r "$conffile"; then
   echo "$0: Reading configuration file $conffile"
-  eval set x "`sed 's/#.*$//;/^$/d' \"$conffile\" | tr '\012\015' '  '` \"\$@\""
+  conf=`sed 's/#.*$//;/^$/d' "$conffile" | tr "\015$nl" '  '`
+  eval set x "$conf \"\$@\""
   shift
 fi
 
@@ -141,6 +149,9 @@ while test -n "$1"; do
     --delete)
       collect_var=delete_files
       ;;
+    --replace)
+      replace="replace: true"
+      ;;
     --rmsymlink)
       collect_var=delete_symlinks
       ;;
@@ -165,7 +176,7 @@ while test -n "$1"; do
       break
       ;;
     -*)
-      echo "$0: Unknown option \`$1', try \`$0 --help'" 1>&2
+      echo "$0: Unknown option '$1', try '$0 --help'" 1>&2
       exit 1
       ;;
     esac
@@ -183,7 +194,7 @@ done
 
 dprint()
 {
-  echo "Running $*..."
+  echo "Running $* ..."
 }
 
 if $dry_run; then
@@ -214,7 +225,7 @@ else
   for file
   do
     if test ! -f $file; then
-      echo "$0: Cannot find \`$file'" 1>&2
+      echo "$0: Cannot find '$file'" 1>&2
       exit 1
     elif test -n "$symlink_expr"; then
       linkname=`echo $file | sed "$symlink_expr"`
@@ -233,21 +244,23 @@ fi
 unset passphrase
 
 # Reset PATH to be sure that echo is a built-in.  We will later use
-# `echo $passphrase' to output the passphrase, so it is important that
-# it is a built-in (third-party programs tend to appear in `ps'
+# 'echo $passphrase' to output the passphrase, so it is important that
+# it is a built-in (third-party programs tend to appear in 'ps'
 # listings with their arguments...).
-# Remember this script runs with `set -e', so if echo is not built-in
+# Remember this script runs with 'set -e', so if echo is not built-in
 # it will exit now.
-PATH=/empty echo -n "Enter GPG passphrase: "
-stty -echo
-read -r passphrase
-stty echo
-echo
+if $dry_run; then :; else
+  PATH=/empty echo -n "Enter GPG passphrase: "
+  stty -echo
+  read -r passphrase
+  stty echo
+  echo
+fi
 
 if test $# -ne 0; then
   for file
   do
-    echo "Signing $file..."
+    echo "Signing $file ..."
     rm -f $file.sig
     echo "$passphrase" | $dbg $GPG --passphrase-fd 0 -ba -o $file.sig $file
   done
@@ -265,7 +278,7 @@ filename: $3$stmt"
   fi
 
   cat >${2}.directive<<EOF
-version: 1.1
+version: 1.2
 directory: $1
 comment: gnupload v. $scriptversion$stmt
 EOF
@@ -386,8 +399,14 @@ for dest in $to
 do
   for file
   do
-    echo "Uploading $file to $dest..."
+    echo "Uploading $file to $dest ..."
     stmt=
+    #
+    # allowing file replacement is all or nothing.
+    if test -n "$replace"; then stmt="$stmt
+$replace"
+    fi
+    #
     files="$file $file.sig"
     destdir=`echo $dest | sed 's/[^:]*://'`
     if test -n "$symlink_expr"; then
index 6781b987bdbcbc23efe6bbe1654a1e3637b9af07..377bb8687ffe16bfc79ea25c8667cabf72aaf2c2 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,7 +35,7 @@ scriptversion=2009-04-28.21; # UTC
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
@@ -156,6 +156,10 @@ while test $# -ne 0; do
     -s) stripcmd=$stripprog;;
 
     -t) dst_arg=$2
+       # Protect names problematic for 'test' and other utilities.
+       case $dst_arg in
+         -* | [=\(\)!]) dst_arg=./$dst_arg;;
+       esac
        shift;;
 
     -T) no_target_directory=true;;
@@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     fi
     shift # arg
     dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
   done
 fi
 
@@ -194,13 +202,17 @@ if test $# -eq 0; then
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
 
 if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
 
   # Set umask so as not to create temps with too-generous modes.
   # However, 'strip' requires both read and write access to temps.
@@ -228,9 +240,9 @@ fi
 
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
-    -*) src=./$src;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
@@ -252,12 +264,7 @@ do
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
     dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
@@ -347,7 +354,7 @@ do
              if test -z "$dir_arg" || {
                   # Check for POSIX incompatibilities with -m.
                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-                  # other-writeable bit of parent directory when it shouldn't.
+                  # other-writable bit of parent directory when it shouldn't.
                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
                   case $ls_ld_tmpdir in
@@ -385,7 +392,7 @@ do
 
       case $dstdir in
        /*) prefix='/';;
-       -*) prefix='./';;
+       [-=\(\)!]*) prefix='./';;
        *)  prefix='';;
       esac
 
@@ -403,7 +410,7 @@ do
 
       for d
       do
-       test -z "$d" && continue
+       test X"$d" = X && continue
 
        prefix=$prefix$d
        if test -d "$prefix"; then
diff --git a/build-aux/link-warning.h b/build-aux/link-warning.h
deleted file mode 100644 (file)
index 642c0e5..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-/* A C macro for emitting link time warnings.
-   Copyright (C) 1995, 1997, 2000, 2002-2003, 2007, 2009-2010 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 the Free Software Foundation; either version 3 of the License, 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* GL_LINK_WARNING("literal string") arranges to emit the literal string as
-   a linker warning on most glibc systems.
-   We use a linker warning rather than a preprocessor warning, because
-   #warning cannot be used inside macros.  */
-#ifndef GL_LINK_WARNING
-  /* This works on platforms with GNU ld and ELF object format.
-     Testing __GLIBC__ is sufficient for asserting that GNU ld is in use.
-     Testing __ELF__ guarantees the ELF object format.
-     Testing __GNUC__ is necessary for the compound expression syntax.  */
-# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__
-#  define GL_LINK_WARNING(message) \
-     GL_LINK_WARNING1 (__FILE__, __LINE__, message)
-#  define GL_LINK_WARNING1(file, line, message) \
-     GL_LINK_WARNING2 (file, line, message)  /* macroexpand file and line */
-#  define GL_LINK_WARNING2(file, line, message) \
-     GL_LINK_WARNING3 (file ":" #line ": warning: " message)
-#  define GL_LINK_WARNING3(message) \
-     ({ static const char warning[sizeof (message)]             \
-          __attribute__ ((__unused__,                           \
-                          __section__ (".gnu.warning"),         \
-                          __aligned__ (1)))                     \
-          = message "\n";                                       \
-        (void)0;                                                \
-     })
-# else
-#  define GL_LINK_WARNING(message) ((void) 0)
-# endif
-#endif
index e631b2219a3cc2ccb992cb1a5f2f42e6b6d84765..4614441d55ef2acea59614fb3371e3779184ece3 100755 (executable)
@@ -1,10 +1,9 @@
 #!/bin/sh
 # Get modification time of a file or directory and pretty-print it.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2010-08-21.06; # UTC
 
-# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1995-2012 Free Software Foundation, Inc.
 # written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
 #
 # This program is free software; you can redistribute it and/or modify
@@ -29,16 +28,26 @@ scriptversion=2009-04-28.21; # UTC
 # bugs to <bug-automake@gnu.org> or send patches to
 # <automake-patches@gnu.org>.
 
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+fi
+
 case $1 in
   '')
-     echo "$0: No file.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No file.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
     cat <<\EOF
 Usage: mdate-sh [--help] [--version] FILE
 
-Pretty-print the modification time of FILE.
+Pretty-print the modification day of FILE, in the format:
+1 January 1970
 
 Report bugs to <bug-automake@gnu.org>.
 EOF
@@ -50,6 +59,13 @@ EOF
     ;;
 esac
 
+error ()
+{
+  echo "$0: $1" >&2
+  exit 1
+}
+
+
 # Prevent date giving response in another language.
 LANG=C
 export LANG
@@ -59,7 +75,7 @@ LC_TIME=C
 export LC_TIME
 
 # GNU ls changes its time format in response to the TIME_STYLE
-# variable.  Since we cannot assume `unset' works, revert this
+# variable.  Since we cannot assume 'unset' works, revert this
 # variable to its documented default.
 if test "${TIME_STYLE+set}" = set; then
   TIME_STYLE=posix-long-iso
@@ -79,14 +95,14 @@ if ls -n /dev/null 1>/dev/null 2>&1; then
   ls_command="$ls_command -n"
 fi
 
-# A `ls -l' line looks as follows on OS/2.
+# A 'ls -l' line looks as follows on OS/2.
 #  drwxrwx---        0 Aug 11  2001 foo
 # This differs from Unix, which adds ownership information.
 #  drwxrwx---   2 root  root      4096 Aug 11  2001 foo
 #
 # To find the date, we split the line on spaces and iterate on words
 # until we find a month.  This cannot work with files whose owner is a
-# user named `Jan', or `Feb', etc.  However, it's unlikely that `/'
+# user named "Jan", or "Feb", etc.  However, it's unlikely that '/'
 # will be owned by a user whose name is a month.  So we first look at
 # the extended ls output of the root directory to decide how many
 # words should be skipped to get the date.
@@ -99,6 +115,7 @@ month=
 command=
 until test $month
 do
+  test $# -gt 0 || error "failed parsing '$ls_command /' output"
   shift
   # Add another shift to the command.
   command="$command shift;"
@@ -118,8 +135,10 @@ do
   esac
 done
 
+test -n "$month" || error "failed parsing '$ls_command /' output"
+
 # Get the extended ls output of the file or directory.
-set dummy x`eval "$ls_command \"\$save_arg1\""`
+set dummy x`eval "$ls_command \"\\\$save_arg1\""`
 
 # Remove all preceding arguments
 eval $command
index 28055d2ae6f2a2c584afcd769d7881e11f62ecd9..074c62c4488650d623d30336ac7c528216da303c 100755 (executable)
@@ -1,10 +1,9 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-05-23.18; # UTC
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -26,7 +25,7 @@ scriptversion=2009-04-28.21; # UTC
 # the same distribution terms that you use for the rest of that program.
 
 if test $# -eq 0; then
-  echo 1>&2 "Try \`$0 --help' for more information"
+  echo 1>&2 "Try '$0 --help' for more information"
   exit 1
 fi
 
@@ -34,7 +33,7 @@ run=:
 sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
 sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
 
-# In the cases where this matters, `missing' is being run in the
+# In the cases where this matters, 'missing' is being run in the
 # srcdir already.
 if test -f configure.ac; then
   configure_ac=configure.ac
@@ -65,7 +64,7 @@ case $1 in
     echo "\
 $0 [OPTION]... PROGRAM [ARGUMENT]...
 
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
 error status if there is no known handling for PROGRAM.
 
 Options:
@@ -74,21 +73,20 @@ Options:
   --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
-  aclocal      touch file \`aclocal.m4'
-  autoconf     touch file \`configure'
-  autoheader   touch file \`config.h.in'
+  aclocal      touch file 'aclocal.m4'
+  autoconf     touch file 'configure'
+  autoheader   touch file 'config.h.in'
   autom4te     touch the output file, or create a stub one
-  automake     touch all \`Makefile.in' files
-  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
-  flex         create \`lex.yy.c', if possible, from existing .c
+  automake     touch all 'Makefile.in' files
+  bison        create 'y.tab.[ch]', if possible, from existing .[ch]
+  flex         create 'lex.yy.c', if possible, from existing .c
   help2man     touch the output file
-  lex          create \`lex.yy.c', if possible, from existing .c
+  lex          create 'lex.yy.c', if possible, from existing .c
   makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+  yacc         create 'y.tab.[ch]', if possible, from existing .[ch]
 
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
 
 Send bug reports to <bug-automake@gnu.org>."
     exit $?
@@ -100,8 +98,8 @@ Send bug reports to <bug-automake@gnu.org>."
     ;;
 
   -*)
-    echo 1>&2 "$0: Unknown \`$1' option"
-    echo 1>&2 "Try \`$0 --help' for more information"
+    echo 1>&2 "$0: Unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
     exit 1
     ;;
 
@@ -122,22 +120,13 @@ case $1 in
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
   *)
     if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
        # We have it, but it failed.
        exit 1
     elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
        # Could not run --version or --help.  This is probably someone
-       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # running '$TOOL --version' or '$TOOL --help' to check whether
        # $TOOL exists and not knowing $TOOL uses missing.
        exit 1
     fi
@@ -149,29 +138,31 @@ esac
 case $program in
   aclocal*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
-         to install the \`Automake' and \`Perl' packages.  Grab them from
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'acinclude.m4' or '${configure_ac}'.  You might want
+         to install the Automake and Perl packages.  Grab them from
          any GNU archive site."
     touch aclocal.m4
     ;;
 
   autoconf*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`${configure_ac}'.  You might want to install the
-         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+WARNING: '$1' is $msg.  You should only need it if
+         you modified '${configure_ac}'.  You might want to install the
+         Autoconf and GNU m4 packages.  Grab them from any GNU
          archive site."
     touch configure
     ;;
 
   autoheader*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
-         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'acconfig.h' or '${configure_ac}'.  You might want
+         to install the Autoconf and GNU m4 packages.  Grab them
          from any GNU archive site."
-    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    files=`sed -n -e 's/^[ ]*AC_CONFIG_HEADER(\([^)]*\)).*/\1/p' \
+                  -e 's/^[ ]*AC_CONFIG_HEADERS(\([^)]*\)).*/\1/p' \
+             ${configure_ac}`
     test -z "$files" && files="config.h"
     touch_files=
     for f in $files; do
@@ -186,9 +177,9 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   automake*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
-         You might want to install the \`Automake' and \`Perl' packages.
+WARNING: '$1' is $msg.  You should only need it if
+         you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
+         You might want to install the Automake and Perl packages.
          Grab them from any GNU archive site."
     find . -type f -name Makefile.am -print |
           sed 's/\.am$/.in/' |
@@ -197,10 +188,10 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   autom4te*)
     echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
+WARNING: '$1' is needed, but is $msg.
          You might have modified some files without having the
          proper tools for further handling them.
-         You can get \`$1' as part of \`Autoconf' from any GNU
+         You can get '$1' as part of Autoconf from any GNU
          archive site."
 
     file=`echo "$*" | sed -n "$sed_output"`
@@ -220,13 +211,13 @@ WARNING: \`$1' is needed, but is $msg.
 
   bison*|yacc*)
     echo 1>&2 "\
-WARNING: \`$1' $msg.  You should only need it if
-         you modified a \`.y' file.  You may need the \`Bison' package
+WARNING: '$1' $msg.  You should only need it if
+         you modified a '.y' file.  You may need the Bison package
          in order for those modifications to take effect.  You can get
-         \`Bison' from any GNU archive site."
+         Bison from any GNU archive site."
     rm -f y.tab.c y.tab.h
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
        case $LASTARG in
        *.y)
            SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
@@ -250,13 +241,13 @@ WARNING: \`$1' $msg.  You should only need it if
 
   lex*|flex*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.l' file.  You may need the \`Flex' package
+WARNING: '$1' is $msg.  You should only need it if
+         you modified a '.l' file.  You may need the Flex package
          in order for those modifications to take effect.  You can get
-         \`Flex' from any GNU archive site."
+         Flex from any GNU archive site."
     rm -f lex.yy.c
     if test $# -ne 1; then
-        eval LASTARG="\${$#}"
+        eval LASTARG=\${$#}
        case $LASTARG in
        *.l)
            SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
@@ -273,10 +264,10 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   help2man*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
+WARNING: '$1' is $msg.  You should only need it if
         you modified a dependency of a manual page.  You may need the
-        \`Help2man' package in order for those modifications to take
-        effect.  You can get \`Help2man' from any GNU archive site."
+        Help2man package in order for those modifications to take
+        effect.  You can get Help2man from any GNU archive site."
 
     file=`echo "$*" | sed -n "$sed_output"`
     test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
@@ -291,12 +282,12 @@ WARNING: \`$1' is $msg.  You should only need it if
 
   makeinfo*)
     echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.texi' or \`.texinfo' file, or any other file
+WARNING: '$1' is $msg.  You should only need it if
+         you modified a '.texi' or '.texinfo' file, or any other file
          indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy \`make' (AIX,
-         DU, IRIX).  You might want to install the \`Texinfo' package or
-         the \`GNU make' package.  Grab either from any GNU archive site."
+         call might also be the consequence of using a buggy 'make' (AIX,
+         DU, IRIX).  You might want to install the Texinfo package or
+         the GNU make package.  Grab either from any GNU archive site."
     # The file to touch is that specified with -o ...
     file=`echo "$*" | sed -n "$sed_output"`
     test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
@@ -318,49 +309,14 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch $file
     ;;
 
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-       case $firstarg in
-       *o*)
-           firstarg=`echo "$firstarg" | sed s/o//`
-           tar "$firstarg" "$@" && exit 0
-           ;;
-       esac
-       case $firstarg in
-       *h*)
-           firstarg=`echo "$firstarg" | sed s/h//`
-           tar "$firstarg" "$@" && exit 0
-           ;;
-       esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
   *)
     echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
+WARNING: '$1' is needed, and is $msg.
          You might have modified some files without having the
-         proper tools for further handling them.  Check the \`README' file,
+         proper tools for further handling them.  Check the 'README' file,
          it often tells you about the needed prerequisites for installing
          this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing \`$1' program."
+         some other package would contain this missing '$1' program."
     exit 1
     ;;
 esac
diff --git a/build-aux/snippet/_Noreturn.h b/build-aux/snippet/_Noreturn.h
new file mode 100644 (file)
index 0000000..c44ad89
--- /dev/null
@@ -0,0 +1,10 @@
+#if !defined _Noreturn && __STDC_VERSION__ < 201112
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+      || 0x5110 <= __SUNPRO_C)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn
+# endif
+#endif
diff --git a/build-aux/snippet/arg-nonnull.h b/build-aux/snippet/arg-nonnull.h
new file mode 100644 (file)
index 0000000..3a9dd26
--- /dev/null
@@ -0,0 +1,26 @@
+/* A C macro for declaring that specific arguments must not be NULL.
+   Copyright (C) 2009-2012 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 the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
+   that the values passed as arguments n, ..., m must be non-NULL pointers.
+   n = 1 stands for the first argument, n = 2 for the second argument etc.  */
+#ifndef _GL_ARG_NONNULL
+# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
+#  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
+# else
+#  define _GL_ARG_NONNULL(params)
+# endif
+#endif
diff --git a/build-aux/snippet/c++defs.h b/build-aux/snippet/c++defs.h
new file mode 100644 (file)
index 0000000..96da94b
--- /dev/null
@@ -0,0 +1,271 @@
+/* C++ compatible function declaration macros.
+   Copyright (C) 2010-2012 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 the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _GL_CXXDEFS_H
+#define _GL_CXXDEFS_H
+
+/* The three most frequent use cases of these macros are:
+
+   * For providing a substitute for a function that is missing on some
+     platforms, but is declared and works fine on the platforms on which
+     it exists:
+
+       #if @GNULIB_FOO@
+       # if !@HAVE_FOO@
+       _GL_FUNCDECL_SYS (foo, ...);
+       # endif
+       _GL_CXXALIAS_SYS (foo, ...);
+       _GL_CXXALIASWARN (foo);
+       #elif defined GNULIB_POSIXCHECK
+       ...
+       #endif
+
+   * For providing a replacement for a function that exists on all platforms,
+     but is broken/insufficient and needs to be replaced on some platforms:
+
+       #if @GNULIB_FOO@
+       # if @REPLACE_FOO@
+       #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+       #   undef foo
+       #   define foo rpl_foo
+       #  endif
+       _GL_FUNCDECL_RPL (foo, ...);
+       _GL_CXXALIAS_RPL (foo, ...);
+       # else
+       _GL_CXXALIAS_SYS (foo, ...);
+       # endif
+       _GL_CXXALIASWARN (foo);
+       #elif defined GNULIB_POSIXCHECK
+       ...
+       #endif
+
+   * For providing a replacement for a function that exists on some platforms
+     but is broken/insufficient and needs to be replaced on some of them and
+     is additionally either missing or undeclared on some other platforms:
+
+       #if @GNULIB_FOO@
+       # if @REPLACE_FOO@
+       #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+       #   undef foo
+       #   define foo rpl_foo
+       #  endif
+       _GL_FUNCDECL_RPL (foo, ...);
+       _GL_CXXALIAS_RPL (foo, ...);
+       # else
+       #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
+       _GL_FUNCDECL_SYS (foo, ...);
+       #  endif
+       _GL_CXXALIAS_SYS (foo, ...);
+       # endif
+       _GL_CXXALIASWARN (foo);
+       #elif defined GNULIB_POSIXCHECK
+       ...
+       #endif
+*/
+
+/* _GL_EXTERN_C declaration;
+   performs the declaration with C linkage.  */
+#if defined __cplusplus
+# define _GL_EXTERN_C extern "C"
+#else
+# define _GL_EXTERN_C extern
+#endif
+
+/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
+   declares a replacement function, named rpl_func, with the given prototype,
+   consisting of return type, parameters, and attributes.
+   Example:
+     _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+                                  _GL_ARG_NONNULL ((1)));
+ */
+#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
+  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
+#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
+  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
+
+/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
+   declares the system function, named func, with the given prototype,
+   consisting of return type, parameters, and attributes.
+   Example:
+     _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
+                                  _GL_ARG_NONNULL ((1)));
+ */
+#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
+  _GL_EXTERN_C rettype func parameters_and_attributes
+
+/* _GL_CXXALIAS_RPL (func, rettype, parameters);
+   declares a C++ alias called GNULIB_NAMESPACE::func
+   that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
+   Example:
+     _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+ */
+#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
+  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+    namespace GNULIB_NAMESPACE                                \
+    {                                                         \
+      rettype (*const func) parameters = ::rpl_func;          \
+    }                                                         \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
+   is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
+   except that the C function rpl_func may have a slightly different
+   declaration.  A cast is used to silence the "invalid conversion" error
+   that would otherwise occur.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+    namespace GNULIB_NAMESPACE                                     \
+    {                                                              \
+      rettype (*const func) parameters =                           \
+        reinterpret_cast<rettype(*)parameters>(::rpl_func);        \
+    }                                                              \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS (func, rettype, parameters);
+   declares a C++ alias called GNULIB_NAMESPACE::func
+   that redirects to the system provided function func, if GNULIB_NAMESPACE
+   is defined.
+   Example:
+     _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+ */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+  /* If we were to write
+       rettype (*const func) parameters = ::func;
+     like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
+     better (remove an indirection through a 'static' pointer variable),
+     but then the _GL_CXXALIASWARN macro below would cause a warning not only
+     for uses of ::func but also for uses of GNULIB_NAMESPACE::func.  */
+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+    namespace GNULIB_NAMESPACE                     \
+    {                                              \
+      static rettype (*func) parameters = ::func;  \
+    }                                              \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
+   is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
+   except that the C function func may have a slightly different declaration.
+   A cast is used to silence the "invalid conversion" error that would
+   otherwise occur.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+    namespace GNULIB_NAMESPACE                          \
+    {                                                   \
+      static rettype (*func) parameters =               \
+        reinterpret_cast<rettype(*)parameters>(::func); \
+    }                                                   \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
+   is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
+   except that the C function is picked among a set of overloaded functions,
+   namely the one with rettype2 and parameters2.  Two consecutive casts
+   are used to silence the "cannot find a match" and "invalid conversion"
+   errors that would otherwise occur.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+  /* The outer cast must be a reinterpret_cast.
+     The inner cast: When the function is defined as a set of overloaded
+     functions, it works as a static_cast<>, choosing the designated variant.
+     When the function is defined as a single variant, it works as a
+     reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+    namespace GNULIB_NAMESPACE                                                \
+    {                                                                         \
+      static rettype (*func) parameters =                                     \
+        reinterpret_cast<rettype(*)parameters>(                               \
+          (rettype2(*)parameters2)(::func));                                  \
+    }                                                                         \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIASWARN (func);
+   causes a warning to be emitted when ::func is used but not when
+   GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
+   variants.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIASWARN(func) \
+   _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
+# define _GL_CXXALIASWARN_1(func,namespace) \
+   _GL_CXXALIASWARN_2 (func, namespace)
+/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+   we enable the warning only when not optimizing.  */
+# if !__OPTIMIZE__
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+    _GL_WARN_ON_USE (func, \
+                     "The symbol ::" #func " refers to the system function. " \
+                     "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+     extern __typeof__ (func) func
+# else
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+     _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
+#else
+# define _GL_CXXALIASWARN(func) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
+   causes a warning to be emitted when the given overloaded variant of ::func
+   is used but not when GNULIB_NAMESPACE::func is used.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+   _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
+                        GNULIB_NAMESPACE)
+# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
+   _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
+/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+   we enable the warning only when not optimizing.  */
+# if !__OPTIMIZE__
+#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+    _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
+                         "The symbol ::" #func " refers to the system function. " \
+                         "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+     extern __typeof__ (func) func
+# else
+#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+     _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
+#else
+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+#endif /* _GL_CXXDEFS_H */
diff --git a/build-aux/snippet/unused-parameter.h b/build-aux/snippet/unused-parameter.h
new file mode 100644 (file)
index 0000000..1c8d61f
--- /dev/null
@@ -0,0 +1,36 @@
+/* A C macro for declaring that specific function parameters are not used.
+   Copyright (C) 2008-2012 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 the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* _GL_UNUSED_PARAMETER is a marker that can be appended to function parameter
+   declarations for parameters that are not used.  This helps to reduce
+   warnings, such as from GCC -Wunused-parameter.  The syntax is as follows:
+       type param _GL_UNUSED_PARAMETER
+   or more generally
+       param_decl _GL_UNUSED_PARAMETER
+   For example:
+       int param _GL_UNUSED_PARAMETER
+       int *(*param)(void) _GL_UNUSED_PARAMETER
+   Other possible, but obscure and discouraged syntaxes:
+       int _GL_UNUSED_PARAMETER *(*param)(void)
+       _GL_UNUSED_PARAMETER int *(*param)(void)
+ */
+#ifndef _GL_UNUSED_PARAMETER
+# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+#  define _GL_UNUSED_PARAMETER __attribute__ ((__unused__))
+# else
+#  define _GL_UNUSED_PARAMETER
+# endif
+#endif
diff --git a/build-aux/snippet/warn-on-use.h b/build-aux/snippet/warn-on-use.h
new file mode 100644 (file)
index 0000000..d4cb94f
--- /dev/null
@@ -0,0 +1,109 @@
+/* A C macro for emitting warnings if a function is used.
+   Copyright (C) 2010-2012 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 the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
+   for FUNCTION which will then trigger a compiler warning containing
+   the text of "literal string" anywhere that function is called, if
+   supported by the compiler.  If the compiler does not support this
+   feature, the macro expands to an unused extern declaration.
+
+   This macro is useful for marking a function as a potential
+   portability trap, with the intent that "literal string" include
+   instructions on the replacement function that should be used
+   instead.  However, one of the reasons that a function is a
+   portability trap is if it has the wrong signature.  Declaring
+   FUNCTION with a different signature in C is a compilation error, so
+   this macro must use the same type as any existing declaration so
+   that programs that avoid the problematic FUNCTION do not fail to
+   compile merely because they included a header that poisoned the
+   function.  But this implies that _GL_WARN_ON_USE is only safe to
+   use if FUNCTION is known to already have a declaration.  Use of
+   this macro implies that there must not be any other macro hiding
+   the declaration of FUNCTION; but undefining FUNCTION first is part
+   of the poisoning process anyway (although for symbols that are
+   provided only via a macro, the result is a compilation error rather
+   than a warning containing "literal string").  Also note that in
+   C++, it is only safe to use if FUNCTION has no overloads.
+
+   For an example, it is possible to poison 'getline' by:
+   - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
+     [getline]) in configure.ac, which potentially defines
+     HAVE_RAW_DECL_GETLINE
+   - adding this code to a header that wraps the system <stdio.h>:
+     #undef getline
+     #if HAVE_RAW_DECL_GETLINE
+     _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
+       "not universally present; use the gnulib module getline");
+     #endif
+
+   It is not possible to directly poison global variables.  But it is
+   possible to write a wrapper accessor function, and poison that
+   (less common usage, like &environ, will cause a compilation error
+   rather than issue the nice warning, but the end result of informing
+   the developer about their portability problem is still achieved):
+   #if HAVE_RAW_DECL_ENVIRON
+   static inline char ***rpl_environ (void) { return &environ; }
+   _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
+   # undef environ
+   # define environ (*rpl_environ ())
+   #endif
+   */
+#ifndef _GL_WARN_ON_USE
+
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+/* A compiler attribute is available in gcc versions 4.3.0 and later.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function
+# else /* Unsupported.  */
+#  define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+# endif
+#endif
+
+/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
+   is like _GL_WARN_ON_USE (function, "string"), except that the function is
+   declared with the given prototype, consisting of return type, parameters,
+   and attributes.
+   This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
+   not work in this case.  */
+#ifndef _GL_WARN_ON_USE_CXX
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+extern rettype function parameters_and_attributes \
+     __attribute__ ((__warning__ (msg)))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function.  */
+#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+extern rettype function parameters_and_attributes
+# else /* Unsupported.  */
+#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+# endif
+#endif
+
+/* _GL_WARN_EXTERN_C declaration;
+   performs the declaration with C linkage.  */
+#ifndef _GL_WARN_EXTERN_C
+# if defined __cplusplus
+#  define _GL_WARN_EXTERN_C extern "C"
+# else
+#  define _GL_WARN_EXTERN_C extern
+# endif
+#endif
diff --git a/build-aux/test-driver b/build-aux/test-driver
new file mode 100755 (executable)
index 0000000..b89107c
--- /dev/null
@@ -0,0 +1,127 @@
+#! /bin/sh
+# test-driver - basic driver script for the `parallel-tests' mode.
+
+scriptversion=2011-08-17.14; # UTC
+
+# Copyright (C) 2011 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
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+# Make unconditional expansion of undefined variables an error.  This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+  echo "$0: $*" >&2
+  print_usage >&2
+  exit 2
+}
+
+print_usage ()
+{
+  cat <<END
+Usage:
+  test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+              [--expect-failure={yes|no}] [--color-tests={yes|no}]
+              [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
+The \`--test-name', \`--log-file' and \`--trs-file' options are mandatory.
+END
+}
+
+# TODO: better error handling in option parsing (in particular, ensure
+# TODO: $log_file, $trs_file and $test_name are defined).
+test_name= # Used for reporting.
+log_file=  # Where to save the output of the test script.
+trs_file=  # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+  case $1 in
+  --help) print_usage; exit $?;;
+  --version) echo "test-driver $scriptversion"; exit $?;;
+  --test-name) test_name=$2; shift;;
+  --log-file) log_file=$2; shift;;
+  --trs-file) trs_file=$2; shift;;
+  --color-tests) color_tests=$2; shift;;
+  --expect-failure) expect_failure=$2; shift;;
+  --enable-hard-errors) enable_hard_errors=$2; shift;;
+  --) shift; break;;
+  -*) usage_error "invalid option: '$1'";;
+  esac
+  shift
+done
+
+if test $color_tests = yes; then
+  # Keep this in sync with `lib/am/check.am:$(am__tty_colors)'.
+  red='\e[0;31m' # Red.
+  grn='\e[0;32m' # Green.
+  lgn='\e[1;32m' # Light green.
+  blu='\e[1;34m' # Blue.
+  mgn='\e[0;35m' # Magenta.
+  std='\e[m'     # No color.
+else
+  red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+  estatus=1
+fi
+
+case $estatus:$expect_failure in
+  0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+  0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
+  77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
+  99:*)  col=$mgn res=ERROR recheck=yes gcopy=yes;;
+  *:yes) col=$lgn res=XFAIL recheck=no  gcopy=yes;;
+  *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
+esac
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
index 91408263bc9c8ab0ad735c0974872d2f1cf58dc0..a5a7b2beac7347429d4b954da8d18a2bedcc2c9b 100644 (file)
@@ -3,11 +3,11 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2009-08-14.15}
+\def\texinfoversion{2012-06-05.14}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009 Free Software Foundation, Inc.
+% 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 %
 % This texinfo.tex file is free software: you can redistribute it and/or
 % modify it under the terms of the GNU General Public License as
@@ -28,9 +28,9 @@
 %
 % Please try the latest version of texinfo.tex before submitting bug
 % reports; you can get the latest version from:
-%   http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
-%   ftp://tug.org/tex/texinfo.tex
-%     (and all CTAN mirrors, see http://www.ctan.org).
+%   http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
+%   http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
+%   http://www.gnu.org/software/texinfo/ (the Texinfo home page)
 % The texinfo.tex in any given distribution could well be out
 % of date, so if that's what you're using, please check.
 %
@@ -65,7 +65,6 @@
 \everyjob{\message{[Texinfo version \texinfoversion]}%
   \catcode`+=\active \catcode`\_=\active}
 
-
 \chardef\other=12
 
 % We never want plain's \outer definition of \+ in Texinfo.
 \let\ptexnewwrite\newwrite
 \let\ptexnoindent=\noindent
 \let\ptexplus=+
+\let\ptexraggedright=\raggedright
 \let\ptexrbrace=\}
 \let\ptexslash=\/
 \let\ptexstar=\*
 \let\ptext=\t
 \let\ptextop=\top
-{\catcode`\'=\active
-\global\let\ptexquoteright'}% Math-mode def from plain.tex.
-\let\ptexraggedright=\raggedright
+{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
 
 % If this character appears in an error message or help string, it
 % starts a new line in the output.
 % Set up fixed words for English if not already set.
 \ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
 \ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
+\ifx\putworderror\undefined     \gdef\putworderror{error}\fi
 \ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
 \ifx\putwordin\undefined        \gdef\putwordin{in}\fi
-\ifx\putwordIndexIsEmpty\undefined     \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
-\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordIndexIsEmpty\undefined       \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined   \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
 \ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
 \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
 \ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
 \def\spaceisspace{\catcode`\ =\spacecat}
 
 % sometimes characters are active, so we need control sequences.
+\chardef\ampChar   = `\&
 \chardef\colonChar = `\:
 \chardef\commaChar = `\,
 \chardef\dashChar  = `\-
 \chardef\dotChar   = `\.
 \chardef\exclamChar= `\!
+\chardef\hashChar  = `\#
 \chardef\lquoteChar= `\`
 \chardef\questChar = `\?
 \chardef\rquoteChar= `\'
 \chardef\semiChar  = `\;
+\chardef\slashChar = `\/
 \chardef\underChar = `\_
 
 % Ignore a token.
 % that mark overfull boxes (in case you have decided
 % that the text looks ok even though it passes the margin).
 %
-\def\finalout{\overfullrule=0pt}
-
-% @| inserts a changebar to the left of the current line.  It should
-% surround any changed text.  This approach does *not* work if the
-% change spans more than two lines of output.  To handle that, we would
-% have adopt a much more difficult approach (putting marks into the main
-% vertical list for the beginning and end of each change).
-%
-\def\|{%
-  % \vadjust can only be used in horizontal mode.
-  \leavevmode
-  %
-  % Append this vertical mode material after the current line in the output.
-  \vadjust{%
-    % We want to insert a rule with the height and depth of the current
-    % leading; that is exactly what \strutbox is supposed to record.
-    \vskip-\baselineskip
-    %
-    % \vadjust-items are inserted at the left edge of the type.  So
-    % the \llap here moves out into the left-hand margin.
-    \llap{%
-      %
-      % For a thicker or thinner bar, change the `1pt'.
-      \vrule height\baselineskip width1pt
-      %
-      % This is the space between the bar and the text.
-      \hskip 12pt
-    }%
-  }%
-}
+\def\finalout{\overfullrule=0pt }
 
 % Sometimes it is convenient to have everything in the transcript file
 % and nothing on the terminal.  We don't just call \tracingall here,
   \tracingmacros2
   \tracingrestores1
   \showboxbreadth\maxdimen \showboxdepth\maxdimen
-  \ifx\eTeXversion\undefined\else % etex gives us more logging
+  \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
     \tracingscantokens1
     \tracingifs1
     \tracinggroups1
   \errorcontextlines16
 }%
 
+% @errormsg{MSG}.  Do the index-like expansions on MSG, but if things
+% aren't perfect, it's not the end of the world, being an error message,
+% after all.
+% 
+\def\errormsg{\begingroup \indexnofonts \doerrormsg}
+\def\doerrormsg#1{\errmessage{#1}}
+
 % add check for \lastpenalty to plain's definitions.  If the last thing
 % we did was a \nobreak, we don't want to insert more space.
 %
 \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
   \removelastskip\penalty-200\bigskip\fi\fi}
 
-% For @cropmarks command.
 % Do @cropmarks to get crop marks.
 %
 \newif\ifcropmarks
 }
 \def\inenvironment#1{%
   \ifx#1\empty
-    out of any environment%
+    outside of any environment%
   \else
     in environment \expandafter\string#1%
   \fi
 \parseargdef\end{%
   \if 1\csname iscond.#1\endcsname
   \else
-    % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
+    % The general wording of \badenverr may not be ideal.
     \expandafter\checkenv\csname#1\endcsname
     \csname E#1\endcsname
     \endgroup
 \newhelp\EMsimple{Press RETURN to continue.}
 
 
-%% Simple single-character @ commands
-
-% @@ prints an @
-% Kludge this until the fonts are right (grr).
-\def\@{{\tt\char64}}
-
-% This is turned off because it was never documented
-% and you can use @w{...} around a quote to suppress ligatures.
-%% Define @` and @' to be the same as ` and '
-%% but suppressing ligatures.
-%\def\`{{`}}
-%\def\'{{'}}
-
-% Used to generate quoted braces.
-\def\mylbrace {{\tt\char123}}
-\def\myrbrace {{\tt\char125}}
-\let\{=\mylbrace
-\let\}=\myrbrace
-\begingroup
-  % Definitions to produce \{ and \} commands for indices,
-  % and @{ and @} for the aux/toc files.
-  \catcode`\{ = \other \catcode`\} = \other
-  \catcode`\[ = 1 \catcode`\] = 2
-  \catcode`\! = 0 \catcode`\\ = \other
-  !gdef!lbracecmd[\{]%
-  !gdef!rbracecmd[\}]%
-  !gdef!lbraceatcmd[@{]%
-  !gdef!rbraceatcmd[@}]%
-!endgroup
-
-% @comma{} to avoid , parsing problems.
-\let\comma = ,
-
-% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
-% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
-\let\, = \c
-\let\dotaccent = \.
-\def\ringaccent#1{{\accent23 #1}}
-\let\tieaccent = \t
-\let\ubaraccent = \b
-\let\udotaccent = \d
-
-% Other special characters: @questiondown @exclamdown @ordf @ordm
-% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
-\def\questiondown{?`}
-\def\exclamdown{!`}
-\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
-\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
-
-% Dotless i and dotless j, used for accents.
-\def\imacro{i}
-\def\jmacro{j}
-\def\dotless#1{%
-  \def\temp{#1}%
-  \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
-  \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
-  \else \errmessage{@dotless can be used only with i or j}%
-  \fi\fi
-}
-
-% The \TeX{} logo, as in plain, but resetting the spacing so that a
-% period following counts as ending a sentence.  (Idea found in latex.)
-%
-\edef\TeX{\TeX \spacefactor=1000 }
-
-% @LaTeX{} logo.  Not quite the same results as the definition in
-% latex.ltx, since we use a different font for the raised A; it's most
-% convenient for us to use an explicitly smaller font, rather than using
-% the \scriptstyle font (since we don't reset \scriptstyle and
-% \scriptscriptstyle).
-%
-\def\LaTeX{%
-  L\kern-.36em
-  {\setbox0=\hbox{T}%
-   \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
-  \kern-.15em
-  \TeX
-}
-
 % Be sure we're in horizontal mode when doing a tie, since we make space
 % equivalent to this in @example-like environments. Otherwise, a space
 % at the beginning of a line will start with \penalty -- and
   \else\ifx\temp\offword \plainnonfrenchspacing
   \else
     \errhelp = \EMsimple
-    \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
+    \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
   \fi\fi
 }
 
@@ -801,15 +701,6 @@ where each line of input produces a line of output.}
 
 \newdimen\mil  \mil=0.001in
 
-% Old definition--didn't work.
-%\parseargdef\need{\par %
-%% This method tries to make TeX break the page naturally
-%% if the depth of the box does not fit.
-%{\baselineskip=0pt%
-%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
-%\prevdepth=-1000pt
-%}}
-
 \parseargdef\need{%
   % Ensure vertical mode, so we don't make a big box in the middle of a
   % paragraph.
@@ -873,7 +764,7 @@ where each line of input produces a line of output.}
 
 % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
 % paragraph.  For more general purposes, use the \margin insertion
-% class.  WHICH is `l' or `r'.
+% class.  WHICH is `l' or `r'.  Not documented, written for gawk manual.
 %
 \newskip\inmarginspacing \inmarginspacing=1cm
 \def\strutdepth{\dp\strutbox}
@@ -920,6 +811,36 @@ where each line of input produces a line of output.}
   \temp
 }
 
+% @| inserts a changebar to the left of the current line.  It should
+% surround any changed text.  This approach does *not* work if the
+% change spans more than two lines of output.  To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).  This command
+% is not documented, not supported, and doesn't work.
+%
+\def\|{%
+  % \vadjust can only be used in horizontal mode.
+  \leavevmode
+  %
+  % Append this vertical mode material after the current line in the output.
+  \vadjust{%
+    % We want to insert a rule with the height and depth of the current
+    % leading; that is exactly what \strutbox is supposed to record.
+    \vskip-\baselineskip
+    %
+    % \vadjust-items are inserted at the left edge of the type.  So
+    % the \llap here moves out into the left-hand margin.
+    \llap{%
+      %
+      % For a thicker or thinner bar, change the `1pt'.
+      \vrule height\baselineskip width1pt
+      %
+      % This is the space between the bar and the text.
+      \hskip 12pt
+    }%
+  }%
+}
+
 % @include FILE -- \input text of FILE.
 %
 \def\include{\parseargusing\filenamecatcodes\includezzz}
@@ -930,6 +851,7 @@ where each line of input produces a line of output.}
     \makevalueexpandable  % we want to expand any @value in FILE.
     \turnoffactive        % and allow special characters in the expansion
     \indexnofonts         % Allow `@@' and other weird things in file names.
+    \wlog{texinfo.tex: doing @include of #1^^J}%
     \edef\temp{\noexpand\input #1 }%
     %
     % This trickery is to read FILE outside of a group, in case it makes
@@ -965,7 +887,7 @@ where each line of input produces a line of output.}
 \def\popthisfilestack{\errthisfilestackempty}
 \def\errthisfilestackempty{\errmessage{Internal error:
   the stack of filenames is empty.}}
-
+%
 \def\thisfile{}
 
 % @center line
@@ -973,36 +895,46 @@ where each line of input produces a line of output.}
 %
 \parseargdef\center{%
   \ifhmode
-    \let\next\centerH
+    \let\centersub\centerH
   \else
-    \let\next\centerV
+    \let\centersub\centerV
   \fi
-  \next{\hfil \ignorespaces#1\unskip \hfil}%
+  \centersub{\hfil \ignorespaces#1\unskip \hfil}%
+  \let\centersub\relax % don't let the definition persist, just in case
 }
-\def\centerH#1{%
-  {%
-    \hfil\break
-    \advance\hsize by -\leftskip
-    \advance\hsize by -\rightskip
-    \line{#1}%
-    \break
-  }%
+\def\centerH#1{{%
+  \hfil\break
+  \advance\hsize by -\leftskip
+  \advance\hsize by -\rightskip
+  \line{#1}%
+  \break
+}}
+%
+\newcount\centerpenalty
+\def\centerV#1{%
+  % The idea here is the same as in \startdefun, \cartouche, etc.: if
+  % @center is the first thing after a section heading, we need to wipe
+  % out the negative parskip inserted by \sectionheading, but still
+  % prevent a page break here.
+  \centerpenalty = \lastpenalty
+  \ifnum\centerpenalty>10000 \vskip\parskip \fi
+  \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
+  \line{\kern\leftskip #1\kern\rightskip}%
 }
-\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
 
 % @sp n   outputs n lines of vertical space
-
+%
 \parseargdef\sp{\vskip #1\baselineskip}
 
 % @comment ...line which is ignored...
 % @c is the same as @comment
 % @ignore ... @end ignore  is another way to write a comment
-
+%
 \def\comment{\begingroup \catcode`\^^M=\other%
 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
 \commentxxx}
 {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
-
+%
 \let\c=\comment
 
 % @paragraphindent NCHARS
@@ -1095,109 +1027,6 @@ where each line of input produces a line of output.}
 }
 
 
-% @asis just yields its argument.  Used with @table, for example.
-%
-\def\asis#1{#1}
-
-% @math outputs its argument in math mode.
-%
-% One complication: _ usually means subscripts, but it could also mean
-% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
-% _ active, and distinguish by seeing if the current family is \slfam,
-% which is what @var uses.
-{
-  \catcode`\_ = \active
-  \gdef\mathunderscore{%
-    \catcode`\_=\active
-    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
-  }
-}
-% Another complication: we want \\ (and @\) to output a \ character.
-% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
-% this is not advertised and we don't care.  Texinfo does not
-% otherwise define @\.
-%
-% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
-\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
-%
-\def\math{%
-  \tex
-  \mathunderscore
-  \let\\ = \mathbackslash
-  \mathactive
-  % make the texinfo accent commands work in math mode
-  \let\"=\ddot
-  \let\'=\acute
-  \let\==\bar
-  \let\^=\hat
-  \let\`=\grave
-  \let\u=\breve
-  \let\v=\check
-  \let\~=\tilde
-  \let\dotaccent=\dot
-  $\finishmath
-}
-\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
-
-% Some active characters (such as <) are spaced differently in math.
-% We have to reset their definitions in case the @math was an argument
-% to a command which sets the catcodes (such as @item or @section).
-%
-{
-  \catcode`^ = \active
-  \catcode`< = \active
-  \catcode`> = \active
-  \catcode`+ = \active
-  \catcode`' = \active
-  \gdef\mathactive{%
-    \let^ = \ptexhat
-    \let< = \ptexless
-    \let> = \ptexgtr
-    \let+ = \ptexplus
-    \let' = \ptexquoteright
-  }
-}
-
-% Some math mode symbols.
-\def\bullet{$\ptexbullet$}
-\def\geq{\ifmmode \ge\else $\ge$\fi}
-\def\leq{\ifmmode \le\else $\le$\fi}
-\def\minus{\ifmmode -\else $-$\fi}
-
-% @dots{} outputs an ellipsis using the current font.
-% We do .5em per period so that it has the same spacing in the cm
-% typewriter fonts as three actual period characters; on the other hand,
-% in other typewriter fonts three periods are wider than 1.5em.  So do
-% whichever is larger.
-%
-\def\dots{%
-  \leavevmode
-  \setbox0=\hbox{...}% get width of three periods
-  \ifdim\wd0 > 1.5em
-    \dimen0 = \wd0
-  \else
-    \dimen0 = 1.5em
-  \fi
-  \hbox to \dimen0{%
-    \hskip 0pt plus.25fil
-    .\hskip 0pt plus1fil
-    .\hskip 0pt plus1fil
-    .\hskip 0pt plus.5fil
-  }%
-}
-
-% @enddots{} is an end-of-sentence ellipsis.
-%
-\def\enddots{%
-  \dots
-  \spacefactor=\endofsentencespacefactor
-}
-
-% @comma{} is so commas can be inserted into text without messing up
-% Texinfo's parsing.
-%
-\let\comma = ,
-
 % @refill is a no-op.
 \let\refill=\relax
 
@@ -1262,9 +1091,8 @@ where each line of input produces a line of output.}
 \newif\ifpdfmakepagedest
 
 % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
-% can be set).  So we test for \relax and 0 as well as \undefined,
-% borrowed from ifpdf.sty.
-\ifx\pdfoutput\undefined
+% can be set).  So we test for \relax and 0 as well as being undefined.
+\ifx\pdfoutput\thisisundefined
 \else
   \ifx\pdfoutput\relax
   \else
@@ -1279,50 +1107,24 @@ where each line of input produces a line of output.}
 % for display in the outlines, and in other places.  Thus, we have to
 % double any backslashes.  Otherwise, a name like "\node" will be
 % interpreted as a newline (\n), followed by o, d, e.  Not good.
-% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
-% (and related messages, the final outcome is that it is up to the TeX
-% user to double the backslashes and otherwise make the string valid, so
-% that's what we do).
-
-% double active backslashes.
-%
-{\catcode`\@=0 \catcode`\\=\active
- @gdef@activebackslashdouble{%
-   @catcode`@\=@active
-   @let\=@doublebackslash}
-}
-
-% To handle parens, we must adopt a different approach, since parens are
-% not active characters.  hyperref.dtx (which has the same problem as
-% us) handles it with this amazing macro to replace tokens, with minor
-% changes for Texinfo.  It is included here under the GPL by permission
-% from the author, Heiko Oberdiek.
-%
-% #1 is the tokens to replace.
-% #2 is the replacement.
-% #3 is the control sequence with the string.
-%
-\def\HyPsdSubst#1#2#3{%
-  \def\HyPsdReplace##1#1##2\END{%
-    ##1%
-    \ifx\\##2\\%
-    \else
-      #2%
-      \HyReturnAfterFi{%
-        \HyPsdReplace##2\END
-      }%
-    \fi
-  }%
-  \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
-}
-\long\def\HyReturnAfterFi#1\fi{\fi#1}
-
-% #1 is a control sequence in which to do the replacements.
-\def\backslashparens#1{%
-  \xdef#1{#1}% redefine it as its expansion; the definition is simply
-             % \lastnode when called from \setref -> \pdfmkdest.
-  \HyPsdSubst{(}{\realbackslash(}{#1}%
-  \HyPsdSubst{)}{\realbackslash)}{#1}%
+% 
+% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
+% related messages.  The final outcome is that it is up to the TeX user
+% to double the backslashes and otherwise make the string valid, so
+% that's what we do.  pdftex 1.30.0 (ca.2005) introduced a primitive to
+% do this reliably, so we use it.
+
+% #1 is a control sequence in which to do the replacements,
+% which we \xdef.
+\def\txiescapepdf#1{%
+  \ifx\pdfescapestring\thisisundefined
+    % No primitive available; should we give a warning or log?
+    % Many times it won't matter.
+  \else
+    % The expandable \pdfescapestring primitive escapes parentheses,
+    % backslashes, and other special chars.
+    \xdef#1{\pdfescapestring{#1}}%
+  \fi
 }
 
 \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
@@ -1381,32 +1183,34 @@ output) for that.)}
   %
   % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
   \def\dopdfimage#1#2#3{%
-    \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
-    \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+    \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+    \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
     %
-    % pdftex (and the PDF format) support .png, .jpg, .pdf (among
-    % others).  Let's try in that order.
+    % pdftex (and the PDF format) support .pdf, .png, .jpg (among
+    % others).  Let's try in that order, PDF first since if
+    % someone has a scalable image, presumably better to use that than a
+    % bitmap.
     \let\pdfimgext=\empty
     \begingroup
-      \openin 1 #1.png \ifeof 1
-        \openin 1 #1.jpg \ifeof 1
-          \openin 1 #1.jpeg \ifeof 1
-            \openin 1 #1.JPG \ifeof 1
-              \openin 1 #1.pdf \ifeof 1
-                \openin 1 #1.PDF \ifeof 1
+      \openin 1 #1.pdf \ifeof 1
+        \openin 1 #1.PDF \ifeof 1
+          \openin 1 #1.png \ifeof 1
+            \openin 1 #1.jpg \ifeof 1
+              \openin 1 #1.jpeg \ifeof 1
+                \openin 1 #1.JPG \ifeof 1
                   \errhelp = \nopdfimagehelp
                   \errmessage{Could not find image file #1 for pdf}%
-                \else \gdef\pdfimgext{PDF}%
+                \else \gdef\pdfimgext{JPG}%
                 \fi
-              \else \gdef\pdfimgext{pdf}%
+              \else \gdef\pdfimgext{jpeg}%
               \fi
-            \else \gdef\pdfimgext{JPG}%
+            \else \gdef\pdfimgext{jpg}%
             \fi
-          \else \gdef\pdfimgext{jpeg}%
+          \else \gdef\pdfimgext{png}%
           \fi
-        \else \gdef\pdfimgext{jpg}%
+        \else \gdef\pdfimgext{PDF}%
         \fi
-      \else \gdef\pdfimgext{png}%
+      \else \gdef\pdfimgext{pdf}%
       \fi
       \closein 1
     \endgroup
@@ -1418,8 +1222,8 @@ output) for that.)}
     \else
       \immediate\pdfximage
     \fi
-      \ifdim \wd0 >0pt width \imagewidth \fi
-      \ifdim \wd2 >0pt height \imageheight \fi
+      \ifdim \wd0 >0pt width \pdfimagewidth \fi
+      \ifdim \wd2 >0pt height \pdfimageheight \fi
       \ifnum\pdftexversion<13
          #1.\pdfimgext
        \else
@@ -1434,10 +1238,9 @@ output) for that.)}
     % such as \, aren't expanded when present in a section title.
     \indexnofonts
     \turnoffactive
-    \activebackslashdouble
     \makevalueexpandable
     \def\pdfdestname{#1}%
-    \backslashparens\pdfdestname
+    \txiescapepdf\pdfdestname
     \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
   }}
   %
@@ -1469,29 +1272,24 @@ output) for that.)}
     % page number.  We could generate a destination for the section
     % text in the case where a section has no node, but it doesn't
     % seem worth the trouble, since most documents are normally structured.
-    \def\pdfoutlinedest{#3}%
+    \edef\pdfoutlinedest{#3}%
     \ifx\pdfoutlinedest\empty
       \def\pdfoutlinedest{#4}%
     \else
-      % Doubled backslashes in the name.
-      {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
-       \backslashparens\pdfoutlinedest}%
+      \txiescapepdf\pdfoutlinedest
     \fi
     %
-    % Also double the backslashes in the display string.
-    {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
-     \backslashparens\pdfoutlinetext}%
+    % Also escape PDF chars in the display string.
+    \edef\pdfoutlinetext{#1}%
+    \txiescapepdf\pdfoutlinetext
     %
     \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
   }
   %
   \def\pdfmakeoutlines{%
     \begingroup
-      % Thanh's hack / proper braces in bookmarks
-      \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
-      \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
-      %
       % Read toc silently, to get counts of subentries for \pdfoutline.
+      \def\partentry##1##2##3##4{}% ignore parts in the outlines
       \def\numchapentry##1##2##3##4{%
        \def\thischapnum{##2}%
        \def\thissecnum{0}%
@@ -1545,25 +1343,41 @@ output) for that.)}
       % Latin 2 (0xea) gets translated to a | character.  Info from
       % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
       %
-      % xx to do this right, we have to translate 8-bit characters to
-      % their "best" equivalent, based on the @documentencoding.  Right
-      % now, I guess we'll just let the pdf reader have its way.
+      % TODO this right, we have to translate 8-bit characters to
+      % their "best" equivalent, based on the @documentencoding.  Too
+      % much work for too little return.  Just use the ASCII equivalents
+      % we use for the index sort strings.
+      % 
       \indexnofonts
       \setupdatafile
+      % We can have normal brace characters in the PDF outlines, unlike
+      % Texinfo index files.  So set that up.
+      \def\{{\lbracecharliteral}%
+      \def\}{\rbracecharliteral}%
       \catcode`\\=\active \otherbackslash
       \input \tocreadfilename
     \endgroup
   }
+  {\catcode`[=1 \catcode`]=2
+   \catcode`{=\other \catcode`}=\other
+   \gdef\lbracecharliteral[{]%
+   \gdef\rbracecharliteral[}]%
+  ]
   %
   \def\skipspaces#1{\def\PP{#1}\def\D{|}%
     \ifx\PP\D\let\nextsp\relax
     \else\let\nextsp\skipspaces
-      \ifx\p\space\else\addtokens{\filename}{\PP}%
-        \advance\filenamelength by 1
-      \fi
+      \addtokens{\filename}{\PP}%
+      \advance\filenamelength by 1
     \fi
     \nextsp}
-  \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+  \def\getfilename#1{%
+    \filenamelength=0
+    % If we don't expand the argument now, \skipspaces will get
+    % snagged on things like "@value{foo}".
+    \edef\temp{#1}%
+    \expandafter\skipspaces\temp|\relax
+  }
   \ifnum\pdftexversion < 14
     \let \startlink \pdfannotlink
   \else
@@ -1660,9 +1474,6 @@ output) for that.)}
 \def\ttsl{\setfontstyle{ttsl}}
 
 
-% Default leading.
-\newdimen\textleading  \textleading = 13.2pt
-
 % Set the baselineskip to #1, and the lineskip and strut size
 % correspondingly.  There is no deep meaning behind these magic numbers
 % used as factors; they just match (closely enough) what Knuth defined.
@@ -1674,6 +1485,7 @@ output) for that.)}
 % can get a sort of poor man's double spacing by redefining this.
 \def\baselinefactor{1}
 %
+\newdimen\textleading
 \def\setleading#1{%
   \dimen0 = #1\relax
   \normalbaselineskip = \baselinefactor\dimen0
@@ -1695,7 +1507,7 @@ output) for that.)}
 % if we are producing pdf, and we have \pdffontattr, then define cmaps.
 % (\pdffontattr was introduced many years ago, but people still run
 % older pdftex's; it's easy to conditionalize, so we do.)
-\ifpdf \ifx\pdffontattr\undefined \else
+\ifpdf \ifx\pdffontattr\thisisundefined \else
   \begingroup
     \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
     \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
@@ -1946,28 +1758,34 @@ end
 \fi\fi
 
 
-% Set the font macro #1 to the font named #2, adding on the
-% specified font prefix (normally `cm').
+% Set the font macro #1 to the font named \fontprefix#2.
 % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
-% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
-% empty to omit).
+% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
+% Example:
+% #1 = \textrm
+% #2 = \rmshape
+% #3 = 10
+% #4 = \mainmagstep
+% #5 = OT1
+%
 \def\setfont#1#2#3#4#5{%
   \font#1=\fontprefix#2#3 scaled #4
   \csname cmap#5\endcsname#1%
 }
 % This is what gets called when #5 of \setfont is empty.
 \let\cmap\gobble
-% emacs-page end of cmaps
+%
+% (end of cmaps)
 
 % Use cm as the default font prefix.
 % To specify the font prefix, you must define \fontprefix
 % before you read in texinfo.tex.
-\ifx\fontprefix\undefined
+\ifx\fontprefix\thisisundefined
 \def\fontprefix{cm}
 \fi
 % Support font families that don't use the same naming scheme as CM.
 \def\rmshape{r}
-\def\rmbshape{bx}               %where the normal face is bold
+\def\rmbshape{bx}               % where the normal face is bold
 \def\bfshape{b}
 \def\bxshape{bx}
 \def\ttshape{tt}
@@ -1982,8 +1800,7 @@ end
 \def\scshape{csc}
 \def\scbshape{csc}
 
-% Definitions for a main text size of 11pt.  This is the default in
-% Texinfo.
+% Definitions for a main text size of 11pt.  (The default in Texinfo.)
 %
 \def\definetextfontsizexi{%
 % Text fonts (11.2pt, magstep1).
@@ -2105,10 +1922,10 @@ end
 \font\reducedsy=cmsy10
 \def\reducedecsize{1000}
 
-% reset the current fonts
-\textfonts
+\textleading = 13.2pt % line spacing for 11pt CM
+\textfonts            % reset the current fonts
 \rm
-} % end of 11pt text font size definitions
+} % end of 11pt text font size definitions, \definetextfontsizexi
 
 
 % Definitions to make the main text be 10pt Computer Modern, with
@@ -2236,25 +2053,24 @@ end
 \font\reducedsy=cmsy9
 \def\reducedecsize{0900}
 
-% reduce space between paragraphs
-\divide\parskip by 2
-
-% reset the current fonts
-\textfonts
+\divide\parskip by 2  % reduce space between paragraphs
+\textleading = 12pt   % line spacing for 10pt CM
+\textfonts            % reset the current fonts
 \rm
-} % end of 10pt text font size definitions
+} % end of 10pt text font size definitions, \definetextfontsizex
 
 
 % We provide the user-level command
 %   @fonttextsize 10
 % (or 11) to redefine the text font size.  pt is assumed.
 %
-\def\xword{10}
 \def\xiword{11}
+\def\xword{10}
+\def\xwordpt{10pt}
 %
 \parseargdef\fonttextsize{%
   \def\textsizearg{#1}%
-  \wlog{doing @fonttextsize \textsizearg}%
+  %\wlog{doing @fonttextsize \textsizearg}%
   %
   % Set \globaldefs so that documents can use this inside @tex, since
   % makeinfo 4.8 does not support it, but we need it nonetheless.
@@ -2308,7 +2124,7 @@ end
   \let\tenttsl=\titlettsl
   \def\curfontsize{title}%
   \def\lsize{chap}\def\lllsize{subsec}%
-  \resetmathfonts \setleading{25pt}}
+  \resetmathfonts \setleading{27pt}}
 \def\titlefont#1{{\titlefonts\rmisbold #1}}
 \def\chapfonts{%
   \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
@@ -2436,12 +2252,14 @@ end
 
 % Markup style setup for left and right quotes.
 \defmarkupstylesetup\markupsetuplq{%
-  \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname
+  \expandafter\let\expandafter \temp
+    \csname markupsetuplq\currentmarkupstyle\endcsname
   \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
 }
 
 \defmarkupstylesetup\markupsetuprq{%
-  \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname
+  \expandafter\let\expandafter \temp
+    \csname markupsetuprq\currentmarkupstyle\endcsname
   \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
 }
 
@@ -2460,22 +2278,26 @@ end
 
 \let\markupsetuplqcode \markupsetcodequoteleft
 \let\markupsetuprqcode \markupsetcodequoteright
+%
 \let\markupsetuplqexample \markupsetcodequoteleft
 \let\markupsetuprqexample \markupsetcodequoteright
+%
+\let\markupsetuplqsamp \markupsetcodequoteleft
+\let\markupsetuprqsamp \markupsetcodequoteright
+%
 \let\markupsetuplqverb \markupsetcodequoteleft
 \let\markupsetuprqverb \markupsetcodequoteright
+%
 \let\markupsetuplqverbatim \markupsetcodequoteleft
 \let\markupsetuprqverbatim \markupsetcodequoteright
 
-\let\markupsetuplqsamp \markupsetnoligaturesquoteleft
 \let\markupsetuplqkbd \markupsetnoligaturesquoteleft
 
-% Allow an option to not replace quotes with a regular directed right
-% quote/apostrophe (char 0x27), but instead use the undirected quote
-% from cmtt (char 0x0d).  The undirected quote is ugly, so don't make it
-% the default, but it works for pasting with more pdf viewers (at least
-% evince), the lilypond developers report.  xpdf does work with the
-% regular 0x27.
+% Allow an option to not use regular directed right quote/apostrophe
+% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
+% The undirected quote is ugly, so don't make it the default, but it
+% works for pasting with more pdf viewers (at least evince), the
+% lilypond developers report.  xpdf does work with the regular 0x27.
 %
 \def\codequoteright{%
   \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
@@ -2499,33 +2321,84 @@ end
   \else \char'22 \fi
 }
 
+% Commands to set the quote options.
+% 
+\parseargdef\codequoteundirected{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETtxicodequoteundirected\endcsname
+      = t%
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETtxicodequoteundirected\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
+  \fi\fi
+}
+%
+\parseargdef\codequotebacktick{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETtxicodequotebacktick\endcsname
+      = t%
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETtxicodequotebacktick\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
+  \fi\fi
+}
+
 % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
 \def\noligaturesquoteleft{\relax\lq}
 
 % Count depth in font-changes, for error checks
 \newcount\fontdepth \fontdepth=0
 
-%% Add scribe-like font environments, plus @l for inline lisp (usually sans
-%% serif) and @ii for TeX italic
+% Font commands.
 
-% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
-% unless the following character is such as not to need one.
-\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
-                    \ptexslash\fi\fi\fi}
-\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
-\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
+% #1 is the font command (\sl or \it), #2 is the text to slant.
+% If we are in a monospaced environment, however, 1) always use \ttsl,
+% and 2) do not add an italic correction.
+\def\dosmartslant#1#2{%
+  \ifusingtt 
+    {{\ttsl #2}\let\next=\relax}%
+    {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
+  \next
+}
+\def\smartslanted{\dosmartslant\sl}
+\def\smartitalic{\dosmartslant\it}
 
-% like \smartslanted except unconditionally uses \ttsl.
+% Output an italic correction unless \next (presumed to be the following
+% character) is such as not to need one.
+\def\smartitaliccorrection{%
+  \ifx\next,%
+  \else\ifx\next-%
+  \else\ifx\next.%
+  \else\ptexslash
+  \fi\fi\fi
+  \aftersmartic
+}
+
+% like \smartslanted except unconditionally uses \ttsl, and no ic.
 % @var is set to this for defun arguments.
-\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
+\def\ttslanted#1{{\ttsl #1}}
 
 % @cite is like \smartslanted except unconditionally use \sl.  We never want
 % ttsl for book titles, do we?
-\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
+
+\def\aftersmartic{}
+\def\var#1{%
+  \let\saveaftersmartic = \aftersmartic
+  \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
+  \smartslanted{#1}%
+}
 
 \let\i=\smartitalic
 \let\slanted=\smartslanted
-\def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}}
 \let\dfn=\smartslanted
 \let\emph=\smartitalic
 
@@ -2621,7 +2494,7 @@ end
     \plainfrenchspacing
     #1%
   }%
-  \null
+  \null % reset spacefactor to 1000
 }
 
 % We *must* turn on hyphenation at `-' and `_' in @code.
@@ -2653,6 +2526,8 @@ end
   }
 }
 
+\def\codex #1{\tclose{#1}\endgroup}
+
 \def\realdash{-}
 \def\codedash{-\discretionary{}{}{}}
 \def\codeunder{%
@@ -2666,7 +2541,6 @@ end
              \discretionary{}{}{}}%
             {\_}%
 }
-\def\codex #1{\tclose{#1}\endgroup}
 
 % An additional complication: the above will allow breaks after, e.g.,
 % each of the four underscores in __typeof__.  This is undesirable in
@@ -2686,63 +2560,18 @@ end
     \allowcodebreaksfalse
   \else
     \errhelp = \EMsimple
-    \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
+    \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
   \fi\fi
 }
 
-% @kbd is like @code, except that if the argument is just one @key command,
-% then @kbd has no effect.
-\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
-
-% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
-%   `example' (@kbd uses ttsl only inside of @example and friends),
-%   or `code' (@kbd uses normal tty font always).
-\parseargdef\kbdinputstyle{%
-  \def\txiarg{#1}%
-  \ifx\txiarg\worddistinct
-    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
-  \else\ifx\txiarg\wordexample
-    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
-  \else\ifx\txiarg\wordcode
-    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
-  \else
-    \errhelp = \EMsimple
-    \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
-  \fi\fi\fi
-}
-\def\worddistinct{distinct}
-\def\wordexample{example}
-\def\wordcode{code}
-
-% Default is `distinct'.
-\kbdinputstyle distinct
-
-\def\xkey{\key}
-\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
-\ifx\one\xkey\ifx\threex\three \key{#2}%
-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
-
-% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
-\let\indicateurl=\code
-\let\env=\code
-\let\command=\code
-
-% @clicksequence{File @click{} Open ...}
-\def\clicksequence#1{\begingroup #1\endgroup}
-
-% @clickstyle @arrow   (by default)
-\parseargdef\clickstyle{\def\click{#1}}
-\def\click{\arrow}
-
 % @uref (abbreviation for `urlref') takes an optional (comma-separated)
 % second argument specifying the text to display and an optional third
 % arg as text to display instead of (rather than in addition to) the url
-% itself.  First (mandatory) arg is the url.  Perhaps eventually put in
-% a hypertex \special here.
-%
-\def\uref#1{\douref #1,,,\finish}
-\def\douref#1,#2,#3,#4\finish{\begingroup
+% itself.  First (mandatory) arg is the url.
+% (This \urefnobreak definition isn't used now, leaving it for a while
+% for comparison.)
+\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
+\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
   \unsepspaces
   \pdfurl{#1}%
   \setbox0 = \hbox{\ignorespaces #3}%
@@ -2763,6 +2592,103 @@ end
   \endlink
 \endgroup}
 
+% This \urefbreak definition is the active one.
+\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
+\let\uref=\urefbreak
+\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
+\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
+  \unsepspaces
+  \pdfurl{#1}%
+  \setbox0 = \hbox{\ignorespaces #3}%
+  \ifdim\wd0 > 0pt
+    \unhbox0 % third arg given, show only that
+  \else
+    \setbox0 = \hbox{\ignorespaces #2}%
+    \ifdim\wd0 > 0pt
+      \ifpdf
+        \unhbox0             % PDF: 2nd arg given, show only it
+      \else
+        \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
+      \fi
+    \else
+      \urefcode{#1}% only url given, so show it
+    \fi
+  \fi
+  \endlink
+\endgroup}
+
+% Allow line breaks around only a few characters (only).
+\def\urefcatcodes{%
+  \catcode\ampChar=\active   \catcode\dotChar=\active
+  \catcode\hashChar=\active  \catcode\questChar=\active
+  \catcode\slashChar=\active
+}
+{
+  \urefcatcodes
+  %
+  \global\def\urefcode{\begingroup
+    \setupmarkupstyle{code}%
+    \urefcatcodes
+    \let&\urefcodeamp
+    \let.\urefcodedot
+    \let#\urefcodehash
+    \let?\urefcodequest
+    \let/\urefcodeslash
+    \codex
+  }
+  %
+  % By default, they are just regular characters.
+  \global\def&{\normalamp}
+  \global\def.{\normaldot}
+  \global\def#{\normalhash}
+  \global\def?{\normalquest}
+  \global\def/{\normalslash}
+}
+
+% we put a little stretch before and after the breakable chars, to help
+% line breaking of long url's.  The unequal skips make look better in
+% cmtt at least, especially for dots.
+\def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
+\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
+%
+\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
+\def\urefcodedot{\urefprestretch .\urefpoststretch}
+\def\urefcodehash{\urefprestretch \#\urefpoststretch}
+\def\urefcodequest{\urefprestretch ?\urefpoststretch}
+\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
+{
+  \catcode`\/=\active
+  \global\def\urefcodeslashfinish{%
+    \urefprestretch \slashChar
+    % Allow line break only after the final / in a sequence of
+    % slashes, to avoid line break between the slashes in http://.
+    \ifx\next/\else \urefpoststretch \fi
+  }
+}
+
+% One more complication: by default we'll break after the special
+% characters, but some people like to break before the special chars, so
+% allow that.  Also allow no breaking at all, for manual control.
+% 
+\parseargdef\urefbreakstyle{%
+  \def\txiarg{#1}%
+  \ifx\txiarg\wordnone
+    \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
+  \else\ifx\txiarg\wordbefore
+    \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
+  \else\ifx\txiarg\wordafter
+    \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
+  \fi\fi\fi
+}
+\def\wordafter{after}
+\def\wordbefore{before}
+\def\wordnone{none}
+
+\urefbreakstyle after
+
 % @url synonym for @uref, since that's how everyone uses it.
 %
 \let\url=\uref
@@ -2784,6 +2710,51 @@ end
   \let\email=\uref
 \fi
 
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+%   `example' (@kbd uses ttsl only inside of @example and friends),
+%   or `code' (@kbd uses normal tty font always).
+\parseargdef\kbdinputstyle{%
+  \def\txiarg{#1}%
+  \ifx\txiarg\worddistinct
+    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+  \else\ifx\txiarg\wordexample
+    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+  \else\ifx\txiarg\wordcode
+    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
+  \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct'.
+\kbdinputstyle distinct
+
+\def\xkey{\key}
+\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
+\ifx\one\xkey\ifx\threex\three \key{#2}%
+\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
+
+% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
+\let\indicateurl=\code
+\let\env=\code
+\let\command=\code
+
+% @clicksequence{File @click{} Open ...}
+\def\clicksequence#1{\begingroup #1\endgroup}
+
+% @clickstyle @arrow   (by default)
+\parseargdef\clickstyle{\def\click{#1}}
+\def\click{\arrow}
+
 % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
 %
@@ -2794,34 +2765,244 @@ end
 % Polish suppressed-l.  --karl, 22sep96.
 %\def\l#1{{\li #1}\null}
 
-% @acronym for "FBI", "NATO", and the like.
-% We print this one point size smaller, since it's intended for
-% all-uppercase.
+% @acronym for "FBI", "NATO", and the like.
+% We print this one point size smaller, since it's intended for
+% all-uppercase.
+%
+\def\acronym#1{\doacronym #1,,\finish}
+\def\doacronym#1,#2,#3\finish{%
+  {\selectfonts\lsize #1}%
+  \def\temp{#2}%
+  \ifx\temp\empty \else
+    \space ({\unsepspaces \ignorespaces \temp \unskip})%
+  \fi
+  \null % reset \spacefactor=1000
+}
+
+% @abbr for "Comput. J." and the like.
+% No font change, but don't do end-of-sentence spacing.
+%
+\def\abbr#1{\doabbr #1,,\finish}
+\def\doabbr#1,#2,#3\finish{%
+  {\plainfrenchspacing #1}%
+  \def\temp{#2}%
+  \ifx\temp\empty \else
+    \space ({\unsepspaces \ignorespaces \temp \unskip})%
+  \fi
+  \null % reset \spacefactor=1000
+}
+
+% @asis just yields its argument.  Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math outputs its argument in math mode.
+%
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+  \catcode`\_ = \active
+  \gdef\mathunderscore{%
+    \catcode`\_=\active
+    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+  }
+}
+% Another complication: we want \\ (and @\) to output a math (or tt) \.
+% FYI, plain.tex uses \\ as a temporary control sequence (for no
+% particular reason), but this is not advertised and we don't care.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+  \tex
+  \mathunderscore
+  \let\\ = \mathbackslash
+  \mathactive
+  % make the texinfo accent commands work in math mode
+  \let\"=\ddot
+  \let\'=\acute
+  \let\==\bar
+  \let\^=\hat
+  \let\`=\grave
+  \let\u=\breve
+  \let\v=\check
+  \let\~=\tilde
+  \let\dotaccent=\dot
+  $\finishmath
+}
+\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
+{
+  \catcode`^ = \active
+  \catcode`< = \active
+  \catcode`> = \active
+  \catcode`+ = \active
+  \catcode`' = \active
+  \gdef\mathactive{%
+    \let^ = \ptexhat
+    \let< = \ptexless
+    \let> = \ptexgtr
+    \let+ = \ptexplus
+    \let' = \ptexquoteright
+  }
+}
+
+% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
+% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
+% except specified as a normal braced arg, so no newlines to worry about.
+% 
+\def\outfmtnametex{tex}
+%
+\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
+\long\def\doinlinefmt#1,#2,\finish{%
+  \def\inlinefmtname{#1}%
+  \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
+}
+% For raw, must switch into @tex before parsing the argument, to avoid
+% setting catcodes prematurely.  Doing it this way means that, for
+% example, @inlineraw{html, foo{bar} gets a parse error instead of being
+% ignored.  But this isn't important because if people want a literal
+% *right* brace they would have to use a command anyway, so they may as
+% well use a command to get a left brace too.  We could re-use the
+% delimiter character idea from \verb, but it seems like overkill.
+% 
+\long\def\inlineraw{\tex \doinlineraw}
+\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
+\def\doinlinerawtwo#1,#2,\finish{%
+  \def\inlinerawname{#1}%
+  \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
+  \endgroup % close group opened by \tex.
+}
+
+
+\message{glyphs,}
+% and logos.
+
+% @@ prints an @, as does @atchar{}.
+\def\@{\char64 }
+\let\atchar=\@
+
+% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
+% Unless we're in typewriter, use \ecfont because the CM text fonts do
+% not have braces, and we don't want to switch into math.
+\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
+\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
+\let\{=\mylbrace \let\lbracechar=\{
+\let\}=\myrbrace \let\rbracechar=\}
+\begingroup
+  % Definitions to produce \{ and \} commands for indices,
+  % and @{ and @} for the aux/toc files.
+  \catcode`\{ = \other \catcode`\} = \other
+  \catcode`\[ = 1 \catcode`\] = 2
+  \catcode`\! = 0 \catcode`\\ = \other
+  !gdef!lbracecmd[\{]%
+  !gdef!rbracecmd[\}]%
+  !gdef!lbraceatcmd[@{]%
+  !gdef!rbraceatcmd[@}]%
+!endgroup
+
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
+\let\, = \ptexc
+\let\dotaccent = \ptexdot
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \ptext
+\let\ubaraccent = \ptexb
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown @ordf @ordm
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+  \def\temp{#1}%
+  \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
+  \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
+  \else \errmessage{@dotless can be used only with i or j}%
+  \fi\fi
+}
+
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence.  (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=1000 }
+
+% @LaTeX{} logo.  Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+  L\kern-.36em
+  {\setbox0=\hbox{T}%
+   \vbox to \ht0{\hbox{%
+     \ifx\textnominalsize\xwordpt
+       % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
+       % Revert to plain's \scriptsize, which is 7pt.
+       \count255=\the\fam $\fam\count255 \scriptstyle A$%
+     \else
+       % For 11pt, we can use our lllsize.
+       \selectfonts\lllsize A%
+     \fi
+     }%
+     \vss
+  }}%
+  \kern-.15em
+  \TeX
+}
+
+% Some math mode symbols.
+\def\bullet{$\ptexbullet$}
+\def\geq{\ifmmode \ge\else $\ge$\fi}
+\def\leq{\ifmmode \le\else $\le$\fi}
+\def\minus{\ifmmode -\else $-$\fi}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in the cm
+% typewriter fonts as three actual period characters; on the other hand,
+% in other typewriter fonts three periods are wider than 1.5em.  So do
+% whichever is larger.
 %
-\def\acronym#1{\doacronym #1,,\finish}
-\def\doacronym#1,#2,#3\finish{%
-  {\selectfonts\lsize #1}%
-  \def\temp{#2}%
-  \ifx\temp\empty \else
-    \space ({\unsepspaces \ignorespaces \temp \unskip})%
+\def\dots{%
+  \leavevmode
+  \setbox0=\hbox{...}% get width of three periods
+  \ifdim\wd0 > 1.5em
+    \dimen0 = \wd0
+  \else
+    \dimen0 = 1.5em
   \fi
+  \hbox to \dimen0{%
+    \hskip 0pt plus.25fil
+    .\hskip 0pt plus1fil
+    .\hskip 0pt plus1fil
+    .\hskip 0pt plus.5fil
+  }%
 }
 
-% @abbr for "Comput. J." and the like.
-% No font change, but don't do end-of-sentence spacing.
+% @enddots{} is an end-of-sentence ellipsis.
 %
-\def\abbr#1{\doabbr #1,,\finish}
-\def\doabbr#1,#2,#3\finish{%
-  {\plainfrenchspacing #1}%
-  \def\temp{#2}%
-  \ifx\temp\empty \else
-    \space ({\unsepspaces \ignorespaces \temp \unskip})%
-  \fi
+\def\enddots{%
+  \dots
+  \spacefactor=\endofsentencespacefactor
 }
 
-
-\message{glyphs,}
-
 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
 %
 % Since these characters are used in examples, they should be an even number of
@@ -2842,7 +3023,7 @@ end
 {\tentt \global\dimen0 = 3em}% Width of the box.
 \dimen2 = .55pt % Thickness of rules
 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
-\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
+\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
 %
 \setbox\errorbox=\hbox to \dimen0{\hfil
    \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
@@ -2991,7 +3172,7 @@ end
 %  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
 % so we'll define it if necessary.
 %
-\ifx\Orb\undefined
+\ifx\Orb\thisisundefined
 \def\Orb{\mathhexbox20D}
 \fi
 
@@ -3019,8 +3200,9 @@ end
 \newif\ifsetshortcontentsaftertitlepage
  \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
 
-\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
-        \endgroup\page\hbox{}\page}
+\parseargdef\shorttitlepage{%
+  \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+  \endgroup\page\hbox{}\page}
 
 \envdef\titlepage{%
   % Open one extra group, as we want to close it in the middle of \Etitlepage.
@@ -3080,7 +3262,7 @@ end
   \finishedtitlepagetrue
 }
 
-%%% Macros to be used within @titlepage:
+% Macros to be used within @titlepage:
 
 \let\subtitlerm=\tenrm
 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
@@ -3113,7 +3295,7 @@ end
 }
 
 
-%%% Set up page headings and footings.
+% Set up page headings and footings.
 
 \let\thispage=\folio
 
@@ -3207,10 +3389,14 @@ end
 
 \def\headings #1 {\csname HEADINGS#1\endcsname}
 
-\def\HEADINGSoff{%
-\global\evenheadline={\hfil} \global\evenfootline={\hfil}
-\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
-\HEADINGSoff
+\def\headingsoff{% non-global headings elimination
+  \evenheadline={\hfil}\evenfootline={\hfil}%
+   \oddheadline={\hfil}\oddfootline={\hfil}%
+}
+
+\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
+\HEADINGSoff  % it's the default
+
 % When we turn headings on, set the page number to 1.
 % For double-sided printing, put current file name in lower left corner,
 % chapter name on inside top of right hand pages, document
@@ -3261,7 +3447,7 @@ end
 % This produces Day Month Year style of output.
 % Only define if not already defined, in case a txi-??.tex file has set
 % up a different format (e.g., txi-cs.tex does this).
-\ifx\today\undefined
+\ifx\today\thisisundefined
 \def\today{%
   \number\day\space
   \ifcase\month
@@ -3322,7 +3508,7 @@ end
     \begingroup
       \advance\leftskip by-\tableindent
       \advance\hsize by\tableindent
-      \advance\rightskip by0pt plus1fil
+      \advance\rightskip by0pt plus1fil\relax
       \leavevmode\unhbox0\par
     \endgroup
     %
@@ -3808,18 +3994,18 @@ end
 \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
 \global\advance\multitablelinespace by-\ht0
 \fi
-%% Test to see if parskip is larger than space between lines of
-%% table. If not, do nothing.
-%%        If so, set to same dimension as multitablelinespace.
+% Test to see if parskip is larger than space between lines of
+% table. If not, do nothing.
+%        If so, set to same dimension as multitablelinespace.
 \ifdim\multitableparskip>\multitablelinespace
 \global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
-                                      %% than skip between lines in the table.
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+                                      % than skip between lines in the table.
 \fi%
 \ifdim\multitableparskip=0pt
 \global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
-                                      %% than skip between lines in the table.
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+                                      % than skip between lines in the table.
 \fi}
 
 
@@ -4134,11 +4320,14 @@ end
   \def\@{@}% change to @@ when we switch to @ as escape char in index files.
   \def\ {\realbackslash\space }%
   %
-  % Need these in case \tex is in effect and \{ is a \delimiter again.
-  % But can't use \lbracecmd and \rbracecmd because texindex assumes
-  % braces and backslashes are used only as delimiters.
-  \let\{ = \mylbrace
-  \let\} = \myrbrace
+  % Need these unexpandable (because we define \tt as a dummy)
+  % definitions when @{ or @} appear in index entry text.  Also, more
+  % complicated, when \tex is in effect and \{ is a \delimiter again.
+  % We can't use \lbracecmd and \rbracecmd because texindex assumes
+  % braces and backslashes are used only as delimiters.  Perhaps we
+  % should define @lbrace and @rbrace commands a la @comma.
+  \def\{{{\tt\char123}}%
+  \def\}{{\tt\char125}}%
   %
   % I don't entirely understand this, but when an index entry is
   % generated from a macro call, the \endinput which \scanmacro inserts
@@ -4191,7 +4380,7 @@ end
 \def\commondummies{%
   %
   % \definedummyword defines \#1 as \string\#1\space, thus effectively
-  % preventing its expansion.  This is used only for control% words,
+  % preventing its expansion.  This is used only for control words,
   % not control letters, because the \space would be incorrect for
   % control characters, but is needed to separate the control word
   % from whatever follows.
@@ -4210,6 +4399,7 @@ end
   \commondummiesnofonts
   %
   \definedummyletter\_%
+  \definedummyletter\-%
   %
   % Non-English letters.
   \definedummyword\AA
@@ -4246,20 +4436,25 @@ end
   \definedummyword\TeX
   %
   % Assorted special characters.
+  \definedummyword\arrow
   \definedummyword\bullet
   \definedummyword\comma
   \definedummyword\copyright
   \definedummyword\registeredsymbol
   \definedummyword\dots
   \definedummyword\enddots
+  \definedummyword\entrybreak
   \definedummyword\equiv
   \definedummyword\error
   \definedummyword\euro
+  \definedummyword\expansion
+  \definedummyword\geq
   \definedummyword\guillemetleft
   \definedummyword\guillemetright
   \definedummyword\guilsinglleft
   \definedummyword\guilsinglright
-  \definedummyword\expansion
+  \definedummyword\lbracechar
+  \definedummyword\leq
   \definedummyword\minus
   \definedummyword\ogonek
   \definedummyword\pounds
@@ -4271,6 +4466,7 @@ end
   \definedummyword\quoteleft
   \definedummyword\quoteright
   \definedummyword\quotesinglbase
+  \definedummyword\rbracechar
   \definedummyword\result
   \definedummyword\textdegree
   %
@@ -4316,19 +4512,27 @@ end
   \definedummyword\b
   \definedummyword\i
   \definedummyword\r
+  \definedummyword\sansserif
   \definedummyword\sc
+  \definedummyword\slanted
   \definedummyword\t
   %
   % Commands that take arguments.
+  \definedummyword\abbr
   \definedummyword\acronym
+  \definedummyword\anchor
   \definedummyword\cite
   \definedummyword\code
   \definedummyword\command
   \definedummyword\dfn
+  \definedummyword\dmn
   \definedummyword\email
   \definedummyword\emph
   \definedummyword\env
   \definedummyword\file
+  \definedummyword\image
+  \definedummyword\indicateurl
+  \definedummyword\inforef
   \definedummyword\kbd
   \definedummyword\key
   \definedummyword\math
@@ -4356,7 +4560,7 @@ end
   \def\definedummyaccent##1{\let##1\asis}%
   % We can just ignore other control letters.
   \def\definedummyletter##1{\let##1\empty}%
-  % Hopefully, all control words can become @asis.
+  % All control words become @asis by default; overrides below.
   \let\definedummyword\definedummyaccent
   %
   \commondummiesnofonts
@@ -4368,8 +4572,17 @@ end
   %
   \def\ { }%
   \def\@{@}%
-  % how to handle braces?
   \def\_{\normalunderscore}%
+  \def\-{}% @- shouldn't affect sorting
+  %
+  % Unfortunately, texindex is not prepared to handle braces in the
+  % content at all.  So for index sorting, we map @{ and @} to strings
+  % starting with |, since that ASCII character is between ASCII { and }.
+  \def\{{|a}%
+  \def\lbracechar{|a}%
+  %
+  \def\}{|b}%
+  \def\rbracechar{|b}%
   %
   % Non-English letters.
   \def\AA{AA}%
@@ -4397,6 +4610,7 @@ end
   %
   % Assorted special characters.
   % (The following {} will end up in the sort string, but that's ok.)
+  \def\arrow{->}%
   \def\bullet{bullet}%
   \def\comma{,}%
   \def\copyright{copyright}%
@@ -4406,10 +4620,12 @@ end
   \def\error{error}%
   \def\euro{euro}%
   \def\expansion{==>}%
+  \def\geq{>=}%
   \def\guillemetleft{<<}%
   \def\guillemetright{>>}%
   \def\guilsinglleft{<}%
   \def\guilsinglright{>}%
+  \def\leq{<=}%
   \def\minus{-}%
   \def\point{.}%
   \def\pounds{pounds}%
@@ -4424,6 +4640,9 @@ end
   \def\result{=>}%
   \def\textdegree{o}%
   %
+  \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
+  \else \indexlquoteignore \fi
+  %
   % We need to get rid of all macros, leaving only the arguments (if present).
   % Of course this is not nearly correct, but it is the best we can do for now.
   % makeinfo does not expand macros in the argument to @deffn, which ends up
@@ -4437,6 +4656,11 @@ end
   \macrolist
 }
 
+% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
+% ignore left quotes in the sort term.
+{\catcode`\`=\active
+ \gdef\indexlquoteignore{\let`=\empty}}
+
 \let\indexbackslash=0  %overridden during \printindex.
 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
 
@@ -4534,10 +4758,9 @@ end
 %
 % ..., ready, GO:
 %
-\def\safewhatsit#1{%
-\ifhmode
+\def\safewhatsit#1{\ifhmode
   #1%
-\else
+ \else
   % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
   \whatsitskip = \lastskip
   \edef\lastskipmacro{\the\lastskip}%
@@ -4561,7 +4784,6 @@ end
     % to re-insert the same penalty (values >10000 are used for various
     % signals); since we just inserted a non-discardable item, any
     % following glue (such as a \parskip) would be a breakpoint.  For example:
-    %
     %   @deffn deffn-whatever
     %   @vindex index-whatever
     %   Description.
@@ -4574,8 +4796,7 @@ end
     % (the whatsit from the \write), so we must insert a \nobreak.
     \nobreak\vskip\whatsitskip
   \fi
-\fi
-}
+\fi}
 
 % The index entry written in the file actually looks like
 %  \entry {sortstring}{page}{topic}
@@ -4694,7 +4915,6 @@ end
 % But this freezes the catcodes in the argument, and can cause problems to
 % @code, which sets - active.  This problem was fixed by a kludge---
 % ``-'' was active throughout whole index, but this isn't really right.
-%
 % The right solution is to prevent \entry from swallowing the whole text.
 %                                 --kasal, 21nov03
 \def\entry{%
@@ -4731,10 +4951,17 @@ end
     % columns.
     \vskip 0pt plus1pt
     %
+    % When reading the text of entry, convert explicit line breaks
+    % from @* into spaces.  The user might give these in long section
+    % titles, for instance.
+    \def\*{\unskip\space\ignorespaces}%
+    \def\entrybreak{\hfil\break}%
+    %
     % Swallow the left brace of the text (first parameter):
     \afterassignment\doentry
     \let\temp =
 }
+\def\entrybreak{\unskip\space\ignorespaces}%
 \def\doentry{%
     \bgroup % Instead of the swallowed brace.
       \noindent
@@ -4967,7 +5194,22 @@ end
 \message{sectioning,}
 % Chapters, sections, etc.
 
-% \unnumberedno is an oxymoron, of course.  But we count the unnumbered
+% Let's start with @part.
+\outer\parseargdef\part{\partzzz{#1}}
+\def\partzzz#1{%
+  \chapoddpage
+  \null
+  \vskip.3\vsize  % move it down on the page a bit
+  \begingroup
+    \noindent \titlefonts\rmisbold #1\par % the text
+    \let\lastnode=\empty      % no node to associate with
+    \writetocentry{part}{#1}{}% but put it in the toc
+    \headingsoff              % no headline or footline on the part page
+    \chapoddpage
+  \endgroup
+}
+
+% \unnumberedno is an oxymoron.  But we count the unnumbered
 % sections so that we can refer to them unambiguously in the pdf
 % outlines by their "section number".  We avoid collisions with chapter
 % numbers by starting them at 10000.  (If a document ever has 10000
@@ -5046,8 +5288,8 @@ end
 \chardef\maxseclevel = 3
 %
 % A numbered section within an unnumbered changes to unnumbered too.
-% To achive this, remember the "biggest" unnum. sec. we are currently in:
-\chardef\unmlevel = \maxseclevel
+% To achieve this, remember the "biggest" unnum. sec. we are currently in:
+\chardef\unnlevel = \maxseclevel
 %
 % Trace whether the current chapter is an appendix or not:
 % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
@@ -5072,8 +5314,8 @@ end
   % The heading type:
   \def\headtype{#1}%
   \if \headtype U%
-    \ifnum \absseclevel < \unmlevel
-      \chardef\unmlevel = \absseclevel
+    \ifnum \absseclevel < \unnlevel
+      \chardef\unnlevel = \absseclevel
     \fi
   \else
     % Check for appendix sections:
@@ -5085,10 +5327,10 @@ end
       \fi\fi
     \fi
     % Check for numbered within unnumbered:
-    \ifnum \absseclevel > \unmlevel
+    \ifnum \absseclevel > \unnlevel
       \def\headtype{U}%
     \else
-      \chardef\unmlevel = 3
+      \chardef\unnlevel = 3
     \fi
   \fi
   % Now print the heading:
@@ -5174,7 +5416,8 @@ end
   \global\let\subsubsection = \appendixsubsubsec
 }
 
-\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+% normally unnmhead0 calls unnumberedzzz:
+\outer\parseargdef\unnumbered{\unnmhead0{#1}}
 \def\unnumberedzzz#1{%
   \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
     \global\advance\unnumberedno by 1
@@ -5218,40 +5461,47 @@ end
 \let\top\unnumbered
 
 % Sections.
+% 
 \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
 \def\seczzz#1{%
   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
   \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
 }
 
-\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
+% normally calls appendixsectionzzz:
+\outer\parseargdef\appendixsection{\apphead1{#1}}
 \def\appendixsectionzzz#1{%
   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
   \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
 }
 \let\appendixsec\appendixsection
 
-\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
+% normally calls unnumberedseczzz:
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
 \def\unnumberedseczzz#1{%
   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
   \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
 }
 
 % Subsections.
-\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
+% 
+% normally calls numberedsubseczzz:
+\outer\parseargdef\numberedsubsec{\numhead2{#1}}
 \def\numberedsubseczzz#1{%
   \global\subsubsecno=0  \global\advance\subsecno by 1
   \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
 }
 
-\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
+% normally calls appendixsubseczzz:
+\outer\parseargdef\appendixsubsec{\apphead2{#1}}
 \def\appendixsubseczzz#1{%
   \global\subsubsecno=0  \global\advance\subsecno by 1
   \sectionheading{#1}{subsec}{Yappendix}%
                  {\appendixletter.\the\secno.\the\subsecno}%
 }
 
-\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+% normally calls unnumberedsubseczzz:
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
 \def\unnumberedsubseczzz#1{%
   \global\subsubsecno=0  \global\advance\subsecno by 1
   \sectionheading{#1}{subsec}{Ynothing}%
@@ -5259,21 +5509,25 @@ end
 }
 
 % Subsubsections.
-\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
+% 
+% normally numberedsubsubseczzz:
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
 \def\numberedsubsubseczzz#1{%
   \global\advance\subsubsecno by 1
   \sectionheading{#1}{subsubsec}{Ynumbered}%
                  {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
 }
 
-\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
+% normally appendixsubsubseczzz:
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
 \def\appendixsubsubseczzz#1{%
   \global\advance\subsubsecno by 1
   \sectionheading{#1}{subsubsec}{Yappendix}%
                  {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
 }
 
-\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+% normally unnumberedsubsubseczzz:
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
 \def\unnumberedsubsubseczzz#1{%
   \global\advance\subsubsecno by 1
   \sectionheading{#1}{subsubsec}{Ynothing}%
@@ -5323,14 +5577,13 @@ end
 % (including whitespace, linebreaking, etc. around it),
 % given all the information in convenient, parsed form.
 
-%%% Args are the skip and penalty (usually negative)
+% Args are the skip and penalty (usually negative)
 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
 
-%%% Define plain chapter starts, and page on/off switching for it
 % Parameter controlling skip before chapter headings (if needed)
-
 \newskip\chapheadingskip
 
+% Define plain chapter starts, and page on/off switching for it.
 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
 \def\chappager{\par\vfill\supereject}
 % Because \domark is called before \chapoddpage, the filler page will
@@ -5340,9 +5593,8 @@ end
   \chappager
   \ifodd\pageno \else
     \begingroup
-      \evenheadline={\hfil}\evenfootline={\hfil}%
-      \oddheadline={\hfil}\oddfootline={\hfil}%
-      \hbox to 0pt{}%
+      \headingsoff
+      \null
       \chappager
     \endgroup
   \fi
@@ -5534,6 +5786,8 @@ end
 %
 \def\sectionheading#1#2#3#4{%
   {%
+    \checkenv{}% should not be in an environment.
+    %
     % Switch to the right set of fonts.
     \csname #2fonts\endcsname \rmisbold
     %
@@ -5645,15 +5899,15 @@ end
   %
   % We'll almost certainly start a paragraph next, so don't let that
   % glue accumulate.  (Not a breakpoint because it's preceded by a
-  % discardable item.)
+  % discardable item.)  However, when a paragraph is not started next
+  % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
+  % or the negative glue will cause weirdly wrong output, typically
+  % obscuring the section heading with something else.
   \vskip-\parskip
   %
-  % This is purely so the last item on the list is a known \penalty >
-  % 10000.  This is so \startdefun can avoid allowing breakpoints after
-  % section headings.  Otherwise, it would insert a valid breakpoint between:
-  %
-  %   @section sec-whatever
-  %   @deffn def-whatever
+  % This is so the last item on the main vertical list is a known
+  % \penalty > 10000, so \startdefun, etc., can recognize the situation
+  % and do the needful.
   \penalty 10001
 }
 
@@ -5785,6 +6039,7 @@ end
 \def\summarycontents{%
   \startcontents{\putwordShortTOC}%
     %
+    \let\partentry = \shortpartentry
     \let\numchapentry = \shortchapentry
     \let\appentry = \shortchapentry
     \let\unnchapentry = \shortunnchapentry
@@ -5840,6 +6095,19 @@ end
 % The last argument is the page number.
 % The arguments in between are the chapter number, section number, ...
 
+% Parts, in the main contents.  Replace the part number, which doesn't
+% exist, with an empty box.  Let's hope all the numbers have the same width.
+% Also ignore the page number, which is conventionally not printed.
+\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
+\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
+%
+% Parts, in the short toc.
+\def\shortpartentry#1#2#3#4{%
+  \penalty-300
+  \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
+  \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
+}
+
 % Chapters, in the main contents.
 \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
 %
@@ -5929,9 +6197,9 @@ end
 \message{environments,}
 % @foo ... @end foo.
 
-% @tex ... @end tex    escapes into raw Tex temporarily.
+% @tex ... @end tex    escapes into raw TeX temporarily.
 % One exception: @ is still an escape character, so that @end tex works.
-% But \@ or @@ will get a plain tex @ character.
+% But \@ or @@ will get a plain @ character.
 
 \envdef\tex{%
   \setupmarkupstyle{tex}%
@@ -5948,6 +6216,10 @@ end
   \catcode`\'=\other
   \escapechar=`\\
   %
+  % ' is active in math mode (mathcode"8000).  So reset it, and all our
+  % other math active characters (just in case), to plain's definitions.
+  \mathactive
+  %
   \let\b=\ptexb
   \let\bullet=\ptexbullet
   \let\c=\ptexc
@@ -6051,6 +6323,12 @@ end
   \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
   % Flag to tell @lisp, etc., not to narrow margin.
   \let\nonarrowing = t%
+  %
+  % If this cartouche directly follows a sectioning command, we need the
+  % \parskip glue (backspaced over by default) or the cartouche can
+  % collide with the section heading.
+  \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
+  %
   \vbox\bgroup
       \baselineskip=0pt\parskip=0pt\lineskip=0pt
       \carttop
@@ -6064,7 +6342,7 @@ end
              \lineskip=\normlskip
              \parskip=\normpskip
              \vskip -\parskip
-             \comment % For explanation, see the end of \def\group.
+             \comment % For explanation, see the end of def\group.
 }
 \def\Ecartouche{%
               \ifhmode\par\fi
@@ -6150,41 +6428,42 @@ end
 }
 
 % We often define two environments, @foo and @smallfoo.
-% Let's do it by one command:
-\def\makedispenv #1#2{
-  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
-  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
+% Let's do it in one command.  #1 is the env name, #2 the definition.
+\def\makedispenvdef#1#2{%
+  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
+  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
   \expandafter\let\csname E#1\endcsname \afterenvbreak
   \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
 }
 
-% Define two synonyms:
-\def\maketwodispenvs #1#2#3{
-  \makedispenv{#1}{#3}
-  \makedispenv{#2}{#3}
+% Define two environment synonyms (#1 and #2) for an environment.
+\def\maketwodispenvdef#1#2#3{%
+  \makedispenvdef{#1}{#3}%
+  \makedispenvdef{#2}{#3}%
 }
-
-% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
+%
+% @lisp: indented, narrowed, typewriter font;
+% @example: same as @lisp.
 %
 % @smallexample and @smalllisp: use smaller fonts.
 % Originally contributed by Pavel@xerox.
 %
-\maketwodispenv{lisp}{example}{%
+\maketwodispenvdef{lisp}{example}{%
   \nonfillstart
   \tt\setupmarkupstyle{example}%
   \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
-  \gobble       % eat return
+  \gobble % eat return
 }
 % @display/@smalldisplay: same as @lisp except keep current font.
 %
-\makedispenv {display}{%
+\makedispenvdef{display}{%
   \nonfillstart
   \gobble
 }
 
 % @format/@smallformat: same as @display except don't narrow margins.
 %
-\makedispenv{format}{%
+\makedispenvdef{format}{%
   \let\nonarrowing = t%
   \nonfillstart
   \gobble
@@ -6203,7 +6482,7 @@ end
 \envdef\flushright{%
   \let\nonarrowing = t%
   \nonfillstart
-  \advance\leftskip by 0pt plus 1fill
+  \advance\leftskip by 0pt plus 1fill\relax
   \gobble
 }
 \let\Eflushright = \afterenvbreak
@@ -6238,6 +6517,8 @@ end
 % we're doing normal filling.  So, when using \aboveenvbreak and
 % \afterenvbreak, temporarily make \parskip 0.
 %
+\makedispenvdef{quotation}{\quotationstart}
+%
 \def\quotationstart{%
   {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
   \parindent=0pt
@@ -6253,28 +6534,18 @@ end
   \parsearg\quotationlabel
 }
 
-\envdef\quotation{%
-  \setnormaldispenv
-  \quotationstart
-}
-
-\envdef\smallquotation{%
-  \setsmalldispenv
-  \quotationstart
-}
-\let\Esmallquotation = \Equotation
-
 % We have retained a nonzero parskip for the environment, since we're
 % doing normal filling.
 %
 \def\Equotation{%
   \par
-  \ifx\quotationauthor\undefined\else
+  \ifx\quotationauthor\thisisundefined\else
     % indent a bit.
     \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
   \fi
   {\parskip=0pt \afterenvbreak}%
 }
+\def\Esmallquotation{\Equotation}
 
 % If we're given an argument, typeset it in bold with a colon after.
 \def\quotationlabel#1{%
@@ -6331,21 +6602,28 @@ end
 
 % Setup for the @verbatim environment
 %
-% Real tab expansion
+% Real tab expansion.
 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
 %
-\def\starttabbox{\setbox0=\hbox\bgroup}
+% We typeset each line of the verbatim in an \hbox, so we can handle
+% tabs.  The \global is in case the verbatim line starts with an accent,
+% or some other command that starts with a begin-group.  Otherwise, the
+% entire \verbbox would disappear at the corresponding end-group, before
+% it is typeset.  Meanwhile, we can't have nested verbatim commands
+% (can we?), so the \global won't be overwriting itself.
+\newbox\verbbox
+\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
 %
 \begingroup
   \catcode`\^^I=\active
   \gdef\tabexpand{%
     \catcode`\^^I=\active
     \def^^I{\leavevmode\egroup
-      \dimen0=\wd0 % the width so far, or since the previous tab
-      \divide\dimen0 by\tabw
-      \multiply\dimen0 by\tabw % compute previous multiple of \tabw
-      \advance\dimen0 by\tabw  % advance to next multiple of \tabw
-      \wd0=\dimen0 \box0 \starttabbox
+      \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
+      \divide\dimen\verbbox by\tabw
+      \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
+      \advance\dimen\verbbox by\tabw  % advance to next multiple of \tabw
+      \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
     }%
   }
 \endgroup
@@ -6354,15 +6632,16 @@ end
 \def\setupverbatim{%
   \let\nonarrowing = t%
   \nonfillstart
-  % Easiest (and conventionally used) font for verbatim
-  \tt
-  \def\par{\leavevmode\egroup\box0\endgraf}%
+  \tt % easiest (and conventionally used) font for verbatim
+  % The \leavevmode here is for blank lines.  Otherwise, we would
+  % never \starttabox and the \egroup would end verbatim mode.
+  \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
   \tabexpand
   \setupmarkupstyle{verbatim}%
   % Respect line breaks,
   % print special symbols as themselves, and
-  % make each space count
-  % must do in this order:
+  % make each space count.
+  % Must do in this order:
   \obeylines \uncatcodespecials \sepspaces
   \everypar{\starttabbox}%
 }
@@ -6419,6 +6698,7 @@ end
     \makevalueexpandable
     \setupverbatim
     \indexnofonts       % Allow `@@' and other weird things in file names.
+    \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
     \input #1
     \afterenvbreak
   }%
@@ -6468,7 +6748,7 @@ end
     % commands also insert a nobreak penalty, and we don't want to allow
     % a break between a section heading and a defun.
     %
-    % As a minor refinement, we avoid "club" headers by signalling
+    % As a further refinement, we avoid "club" headers by signalling
     % with penalty of 10003 after the very first @deffn in the
     % sequence (see above), and penalty of 10002 after any following
     % @def command.
@@ -6505,7 +6785,7 @@ end
     #1#2 \endheader
     % common ending:
     \interlinepenalty = 10000
-    \advance\rightskip by 0pt plus 1fil
+    \advance\rightskip by 0pt plus 1fil\relax
     \endgraf
     \nobreak\vskip -\parskip
     \penalty\defunpenalty  % signal to \startdefun and \dodefunx
@@ -6535,13 +6815,36 @@ end
 \def\domakedefun#1#2#3{%
   \envdef#1{%
     \startdefun
+    \doingtypefnfalse    % distinguish typed functions from all else
     \parseargusing\activeparens{\printdefunline#3}%
   }%
   \def#2{\dodefunx#1}%
   \def#3%
 }
 
-%%% Untyped functions:
+\newif\ifdoingtypefn       % doing typed function?
+\newif\ifrettypeownline    % typeset return type on its own line?
+
+% @deftypefnnewline on|off says whether the return type of typed functions
+% are printed on their own line.  This affects @deftypefn, @deftypefun,
+% @deftypeop, and @deftypemethod.
+% 
+\parseargdef\deftypefnnewline{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETtxideftypefnnl\endcsname
+      = \empty
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETtxideftypefnnl\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @txideftypefnnl value `\temp',
+                must be on|off}%
+  \fi\fi
+}
+
+% Untyped functions:
 
 % @deffn category name args
 \makedefun{deffn}{\deffngeneral{}}
@@ -6560,7 +6863,7 @@ end
   \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
 }
 
-%%% Typed functions:
+% Typed functions:
 
 % @deftypefn category type name args
 \makedefun{deftypefn}{\deftypefngeneral{}}
@@ -6575,10 +6878,11 @@ end
 %
 \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
   \dosubind{fn}{\code{#4}}{#1}%
+  \doingtypefntrue
   \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
 }
 
-%%% Typed variables:
+% Typed variables:
 
 % @deftypevr category type var args
 \makedefun{deftypevr}{\deftypecvgeneral{}}
@@ -6596,7 +6900,7 @@ end
   \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
 }
 
-%%% Untyped variables:
+% Untyped variables:
 
 % @defvr category var args
 \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
@@ -6607,7 +6911,8 @@ end
 % \defcvof {category of}class var args
 \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
 
-%%% Type:
+% Types:
+
 % @deftp category name args
 \makedefun{deftp}#1 #2 #3\endheader{%
   \doind{tp}{\code{#2}}%
@@ -6635,25 +6940,49 @@ end
 % We are followed by (but not passed) the arguments, if any.
 %
 \def\defname#1#2#3{%
+  \par
   % Get the values of \leftskip and \rightskip as they were outside the @def...
   \advance\leftskip by -\defbodyindent
   %
-  % How we'll format the type name.  Putting it in brackets helps
+  % Determine if we are typesetting the return type of a typed function
+  % on a line by itself.
+  \rettypeownlinefalse
+  \ifdoingtypefn  % doing a typed function specifically?
+    % then check user option for putting return type on its own line:
+    \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
+      \rettypeownlinetrue
+    \fi
+  \fi
+  %
+  % How we'll format the category name.  Putting it in brackets helps
   % distinguish it from the body text that may end up on the next line
   % just below it.
   \def\temp{#1}%
   \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
   %
-  % Figure out line sizes for the paragraph shape.
+  % Figure out line sizes for the paragraph shape.  We'll always have at
+  % least two.
+  \tempnum = 2
+  %
   % The first line needs space for \box0; but if \rightskip is nonzero,
   % we need only space for the part of \box0 which exceeds it:
   \dimen0=\hsize  \advance\dimen0 by -\wd0  \advance\dimen0 by \rightskip
+  %
+  % If doing a return type on its own line, we'll have another line.
+  \ifrettypeownline
+    \advance\tempnum by 1
+    \def\maybeshapeline{0in \hsize}%
+  \else
+    \def\maybeshapeline{}%
+  \fi
+  %
   % The continuations:
   \dimen2=\hsize  \advance\dimen2 by -\defargsindent
-  % (plain.tex says that \dimen1 should be used only as global.)
-  \parshape 2 0in \dimen0 \defargsindent \dimen2
   %
-  % Put the type name to the right margin.
+  % The final paragraph shape:
+  \parshape \tempnum  0in \dimen0  \maybeshapeline  \defargsindent \dimen2
+  %
+  % Put the category name at the right margin.
   \noindent
   \hbox to 0pt{%
     \hfil\box0 \kern-\hsize
@@ -6675,8 +7004,16 @@ end
     % . this still does not fix the ?` and !` ligatures, but so far no
     %   one has made identifiers using them :).
     \df \tt
-    \def\temp{#2}% return value type
-    \ifx\temp\empty\else \tclose{\temp} \fi
+    \def\temp{#2}% text of the return type
+    \ifx\temp\empty\else
+      \tclose{\temp}% typeset the return type
+      \ifrettypeownline
+        % put return type on its own line; prohibit line break following:
+        \hfil\vadjust{\nobreak}\break  
+      \else
+        \space  % type on same line, so just followed by a space
+      \fi
+    \fi           % no return type
     #3% output function name
   }%
   {\rm\enskip}% hskip 0.5 em of \tenrm
@@ -6794,7 +7131,7 @@ end
 
 % To do this right we need a feature of e-TeX, \scantokens,
 % which we arrange to emulate with a temporary file in ordinary TeX.
-\ifx\eTeXversion\undefined
+\ifx\eTeXversion\thisisundefined
   \newwrite\macscribble
   \def\scantokens#1{%
     \toks0={#1}%
@@ -6805,25 +7142,30 @@ end
   }
 \fi
 
-\def\scanmacro#1{%
-  \begingroup
-    \newlinechar`\^^M
-    \let\xeatspaces\eatspaces
-    % Undo catcode changes of \startcontents and \doprintindex
-    % When called from @insertcopying or (short)caption, we need active
-    % backslash to get it printed correctly.  Previously, we had
-    % \catcode`\\=\other instead.  We'll see whether a problem appears
-    % with macro expansion.                            --kasal, 19aug04
-    \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
-    % ... and \example
-    \spaceisspace
-    %
-    % Append \endinput to make sure that TeX does not see the ending newline.
-    % I've verified that it is necessary both for e-TeX and for ordinary TeX
-    %                                                  --kasal, 29nov03
-    \scantokens{#1\endinput}%
-  \endgroup
-}
+\def\scanmacro#1{\begingroup
+  \newlinechar`\^^M
+  \let\xeatspaces\eatspaces
+  %
+  % Undo catcode changes of \startcontents and \doprintindex
+  % When called from @insertcopying or (short)caption, we need active
+  % backslash to get it printed correctly.  Previously, we had
+  % \catcode`\\=\other instead.  We'll see whether a problem appears
+  % with macro expansion.                              --kasal, 19aug04
+  \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
+  %
+  % ... and for \example:
+  \spaceisspace
+  %
+  % The \empty here causes a following catcode 5 newline to be eaten as
+  % part of reading whitespace after a control sequence.  It does not
+  % eat a catcode 13 newline.  There's no good way to handle the two
+  % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
+  % would then have different behavior).  See the Macro Details node in
+  % the manual for the workaround we recommend for macros and
+  % line-oriented commands.
+  % 
+  \scantokens{#1\empty}%
+\endgroup}
 
 \def\scanexp#1{%
   \edef\temp{\noexpand\scanmacro{#1}}%
@@ -6877,17 +7219,18 @@ end
 
 % Macro bodies are absorbed as an argument in a context where
 % all characters are catcode 10, 11 or 12, except \ which is active
-% (as in normal texinfo). It is necessary to change the definition of \.
-
+% (as in normal texinfo). It is necessary to change the definition of \
+% to recognize macro arguments; this is the job of \mbodybackslash.
+%
 % Non-ASCII encodings make 8-bit characters active, so un-activate
 % them to avoid their expansion.  Must do this non-globally, to
 % confine the change to the current group.
-
+%
 % It's necessary to have hard CRs when the macro is executed. This is
-% done by  making ^^M (\endlinechar) catcode 12 when reading the macro
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
 % body, and then making it the \newlinechar in \scanmacro.
-
-\def\scanctxt{%
+%
+\def\scanctxt{% used as subroutine
   \catcode`\"=\other
   \catcode`\+=\other
   \catcode`\<=\other
@@ -6900,13 +7243,13 @@ end
   \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
 }
 
-\def\scanargctxt{%
+\def\scanargctxt{% used for copying and captions, not macros.
   \scanctxt
   \catcode`\\=\other
   \catcode`\^^M=\other
 }
 
-\def\macrobodyctxt{%
+\def\macrobodyctxt{% used for @macro definitions
   \scanctxt
   \catcode`\{=\other
   \catcode`\}=\other
@@ -6914,32 +7257,56 @@ end
   \usembodybackslash
 }
 
-\def\macroargctxt{%
+\def\macroargctxt{% used when scanning invocations
   \scanctxt
-  \catcode`\\=\other
+  \catcode`\\=0
 }
+% why catcode 0 for \ in the above?  To recognize \\ \{ \} as "escapes"
+% for the single characters \ { }.  Thus, we end up with the "commands"
+% that would be written @\ @{ @} in a Texinfo document.
+% 
+% We already have @{ and @}.  For @\, we define it here, and only for
+% this purpose, to produce a typewriter backslash (so, the @\ that we
+% define for @math can't be used with @macro calls):
+%
+\def\\{\normalbackslash}%
+% 
+% We would like to do this for \, too, since that is what makeinfo does.
+% But it is not possible, because Texinfo already has a command @, for a
+% cedilla accent.  Documents must use @comma{} instead.
+%
+% \anythingelse will almost certainly be an error of some kind.
+
 
 % \mbodybackslash is the definition of \ in @macro bodies.
 % It maps \foo\ => \csname macarg.foo\endcsname => #N
 % where N is the macro parameter number.
 % We define \csname macarg.\endcsname to be \realbackslash, so
 % \\ in macro replacement text gets you a backslash.
-
+%
 {\catcode`@=0 @catcode`@\=@active
  @gdef@usembodybackslash{@let\=@mbodybackslash}
  @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
 }
 \expandafter\def\csname macarg.\endcsname{\realbackslash}
 
+\def\margbackslash#1{\char`\#1 }
+
 \def\macro{\recursivefalse\parsearg\macroxxx}
 \def\rmacro{\recursivetrue\parsearg\macroxxx}
 
 \def\macroxxx#1{%
-  \getargs{#1}%           now \macname is the macname and \argl the arglist
+  \getargs{#1}% now \macname is the macname and \argl the arglist
   \ifx\argl\empty       % no arguments
-     \paramno=0%
+     \paramno=0\relax
   \else
      \expandafter\parsemargdef \argl;%
+     \if\paramno>256\relax
+       \ifx\eTeXversion\thisisundefined
+         \errhelp = \EMsimple
+         \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
+       \fi
+     \fi
   \fi
   \if1\csname ismacro.\the\macname\endcsname
      \message{Warning: redefining \the\macname}%
@@ -6986,46 +7353,269 @@ end
 % an opening brace, and that opening brace is not consumed.
 \def\getargs#1{\getargsxxx#1{}}
 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
-\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacname#1 #2\relax{\macname={#1}}
 \def\getmacargs#1{\def\argl{#1}}
 
+% For macro processing make @ a letter so that we can make Texinfo private macro names.
+\edef\texiatcatcode{\the\catcode`\@}
+\catcode `@=11\relax
+
 % Parse the optional {params} list.  Set up \paramno and \paramlist
-% so \defmacro knows what to do.  Define \macarg.blah for each blah
-% in the params list, to be ##N where N is the position in that list.
+% so \defmacro knows what to do.  Define \macarg.BLAH for each BLAH
+% in the params list to some hook where the argument si to be expanded.  If
+% there are less than 10 arguments that hook is to be replaced by ##N where N
+% is the position in that list, that is to say the macro arguments are to be
+% defined `a la TeX in the macro body.  
+%
 % That gets used by \mbodybackslash (above).
-
+%
 % We need to get `macro parameter char #' into several definitions.
-% The technique used is stolen from LaTeX:  let \hash be something
+% The technique used is stolen from LaTeX: let \hash be something
 % unexpandable, insert that wherever you need a #, and then redefine
 % it to # just before using the token list produced.
 %
 % The same technique is used to protect \eatspaces till just before
 % the macro is used.
-
-\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
-        \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+%
+% If there are 10 or more arguments, a different technique is used, where the
+% hook remains in the body, and when macro is to be expanded the body is
+% processed again to replace the arguments.
+%
+% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
+% argument N value and then \edef  the body (nothing else will expand because of
+% the catcode regime underwhich the body was input).
+%
+% If you compile with TeX (not eTeX), and you have macros with 10 or more
+% arguments, you need that no macro has more than 256 arguments, otherwise an
+% error is produced.
+\def\parsemargdef#1;{%
+  \paramno=0\def\paramlist{}%
+  \let\hash\relax
+  \let\xeatspaces\relax
+  \parsemargdefxxx#1,;,%
+  % In case that there are 10 or more arguments we parse again the arguments
+  % list to set new definitions for the \macarg.BLAH macros corresponding to
+  % each BLAH argument. It was anyhow needed to parse already once this list
+  % in order to count the arguments, and as macros with at most 9 arguments
+  % are by far more frequent than macro with 10 or more arguments, defining
+  % twice the \macarg.BLAH macros does not cost too much processing power.
+  \ifnum\paramno<10\relax\else
+    \paramno0\relax
+    \parsemmanyargdef@@#1,;,% 10 or more arguments
+  \fi
+}
 \def\parsemargdefxxx#1,{%
   \if#1;\let\next=\relax
   \else \let\next=\parsemargdefxxx
-    \advance\paramno by 1%
+    \advance\paramno by 1
     \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
         {\xeatspaces{\hash\the\paramno}}%
     \edef\paramlist{\paramlist\hash\the\paramno,}%
   \fi\next}
 
+\def\parsemmanyargdef@@#1,{%
+  \if#1;\let\next=\relax
+  \else 
+    \let\next=\parsemmanyargdef@@
+    \edef\tempb{\eatspaces{#1}}%
+    \expandafter\def\expandafter\tempa
+       \expandafter{\csname macarg.\tempb\endcsname}%
+    % Note that we need some extra \noexpand\noexpand, this is because we
+    % don't want \the  to be expanded in the \parsermacbody  as it uses an
+    % \xdef .
+    \expandafter\edef\tempa
+      {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
+    \advance\paramno by 1\relax
+  \fi\next}
+
 % These two commands read recursive and nonrecursive macro bodies.
 % (They're different since rec and nonrec macros end differently.)
+%
 
+\catcode `\@\texiatcatcode
 \long\def\parsemacbody#1@end macro%
 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
 \long\def\parsermacbody#1@end rmacro%
 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\catcode `\@=11\relax
+
+\let\endargs@\relax
+\let\nil@\relax
+\def\nilm@{\nil@}%
+\long\def\nillm@{\nil@}%
+
+% This macro is expanded during the Texinfo macro expansion, not during its
+% definition.  It gets all the arguments values and assigns them to macros
+% macarg.ARGNAME
+%
+% #1 is the macro name
+% #2 is the list of argument names
+% #3 is the list of argument values
+\def\getargvals@#1#2#3{%
+  \def\macargdeflist@{}%
+  \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
+  \def\paramlist{#2,\nil@}%
+  \def\macroname{#1}%
+  \begingroup
+  \macroargctxt
+  \def\argvaluelist{#3,\nil@}%
+  \def\@tempa{#3}%
+  \ifx\@tempa\empty
+    \setemptyargvalues@
+  \else
+    \getargvals@@
+  \fi
+}
+
+% 
+\def\getargvals@@{%
+  \ifx\paramlist\nilm@
+      % Some sanity check needed here that \argvaluelist is also empty.
+      \ifx\argvaluelist\nillm@
+      \else
+        \errhelp = \EMsimple
+        \errmessage{Too many arguments in macro `\macroname'!}%
+      \fi
+      \let\next\macargexpandinbody@
+  \else
+    \ifx\argvaluelist\nillm@
+       % No more arguments values passed to macro.  Set remaining named-arg
+       % macros to empty.
+       \let\next\setemptyargvalues@
+    \else
+      % pop current arg name into \@tempb
+      \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
+      \expandafter\@tempa\expandafter{\paramlist}%
+       % pop current argument value into \@tempc
+      \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
+      \expandafter\@tempa\expandafter{\argvaluelist}%
+       % Here \@tempb is the current arg name and \@tempc is the current arg value.
+       % First place the new argument macro definition into \@tempd
+       \expandafter\macname\expandafter{\@tempc}%
+       \expandafter\let\csname macarg.\@tempb\endcsname\relax
+       \expandafter\def\expandafter\@tempe\expandafter{%
+         \csname macarg.\@tempb\endcsname}%
+       \edef\@tempd{\long\def\@tempe{\the\macname}}%
+       \push@\@tempd\macargdeflist@
+       \let\next\getargvals@@
+    \fi
+  \fi
+  \next
+}
+
+\def\push@#1#2{%
+  \expandafter\expandafter\expandafter\def
+  \expandafter\expandafter\expandafter#2%
+  \expandafter\expandafter\expandafter{%
+  \expandafter#1#2}%
+}
+
+% Replace arguments by their values in the macro body, and place the result
+% in macro \@tempa
+\def\macvalstoargs@{%
+  %  To do this we use the property that token registers that are \the'ed
+  % within an \edef  expand only once. So we are going to place all argument
+  % values into respective token registers.
+  %
+  % First we save the token context, and initialize argument numbering.
+  \begingroup
+    \paramno0\relax
+    % Then, for each argument number #N, we place the corresponding argument
+    % value into a new token list register \toks#N
+    \expandafter\putargsintokens@\saveparamlist@,;,%
+    % Then, we expand the body so that argument are replaced by their
+    % values. The trick for values not to be expanded themselves is that they
+    % are within tokens and that tokens expand only once in an \edef .
+    \edef\@tempc{\csname mac.\macroname .body\endcsname}%
+    % Now we restore the token stack pointer to free the token list registers
+    % which we have used, but we make sure that expanded body is saved after
+    % group.
+    \expandafter
+  \endgroup
+  \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
+  }
+
+\def\macargexpandinbody@{% 
+  %% Define the named-macro outside of this group and then close this group. 
+  \expandafter
+  \endgroup
+  \macargdeflist@
+  % First the replace in body the macro arguments by their values, the result
+  % is in \@tempa .
+  \macvalstoargs@
+  % Then we point at the \norecurse or \gobble (for recursive) macro value
+  % with \@tempb .
+  \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
+  % Depending on whether it is recursive or not, we need some tailing
+  % \egroup .
+  \ifx\@tempb\gobble
+     \let\@tempc\relax
+  \else
+     \let\@tempc\egroup
+  \fi
+  % And now we do the real job:
+  \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
+  \@tempd
+}
+
+\def\putargsintokens@#1,{%
+  \if#1;\let\next\relax
+  \else
+    \let\next\putargsintokens@
+    % First we allocate the new token list register, and give it a temporary
+    % alias \@tempb .
+    \toksdef\@tempb\the\paramno
+    % Then we place the argument value into that token list register.
+    \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
+    \expandafter\@tempb\expandafter{\@tempa}%
+    \advance\paramno by 1\relax
+  \fi
+  \next
+}
+
+% Save the token stack pointer into macro #1
+\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
+% Restore the token stack pointer from number in macro #1
+\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
+% newtoks that can be used non \outer .
+\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
+
+% Tailing missing arguments are set to empty
+\def\setemptyargvalues@{%
+  \ifx\paramlist\nilm@
+    \let\next\macargexpandinbody@
+  \else
+    \expandafter\setemptyargvaluesparser@\paramlist\endargs@
+    \let\next\setemptyargvalues@
+  \fi
+  \next
+}
+
+\def\setemptyargvaluesparser@#1,#2\endargs@{%
+  \expandafter\def\expandafter\@tempa\expandafter{%
+    \expandafter\def\csname macarg.#1\endcsname{}}%
+  \push@\@tempa\macargdeflist@
+  \def\paramlist{#2}%
+}
 
-% This defines the macro itself. There are six cases: recursive and
-% nonrecursive macros of zero, one, and many arguments.
+% #1 is the element target macro
+% #2 is the list macro
+% #3,#4\endargs@ is the list value
+\def\pop@#1#2#3,#4\endargs@{%
+   \def#1{#3}%
+   \def#2{#4}%
+}
+\long\def\longpop@#1#2#3,#4\endargs@{%
+   \long\def#1{#3}%
+   \long\def#2{#4}%
+}
+
+% This defines a Texinfo @macro. There are eight cases: recursive and
+% nonrecursive macros of zero, one, up to nine, and many arguments.
 % Much magic with \expandafter here.
 % \xdef is used so that macro definitions will survive the file
 % they're defined in; @include reads the file inside a group.
+%
 \def\defmacro{%
   \let\hash=##% convert placeholders to macro parameter chars
   \ifrecursive
@@ -7040,17 +7630,25 @@ end
          \expandafter\noexpand\csname\the\macname xxx\endcsname}%
       \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
          \egroup\noexpand\scanmacro{\temp}}%
-    \else % many
-      \expandafter\xdef\csname\the\macname\endcsname{%
-         \bgroup\noexpand\macroargctxt
-         \noexpand\csname\the\macname xx\endcsname}%
-      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
-          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
-      \expandafter\expandafter
-      \expandafter\xdef
-      \expandafter\expandafter
-        \csname\the\macname xxx\endcsname
-          \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+    \else
+      \ifnum\paramno<10\relax % at most 9
+        \expandafter\xdef\csname\the\macname\endcsname{%
+           \bgroup\noexpand\macroargctxt
+           \noexpand\csname\the\macname xx\endcsname}%
+        \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+            \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+        \expandafter\expandafter
+        \expandafter\xdef
+        \expandafter\expandafter
+          \csname\the\macname xxx\endcsname
+            \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+      \else % 10 or more
+        \expandafter\xdef\csname\the\macname\endcsname{%
+          \noexpand\getargvals@{\the\macname}{\argl}%
+        }%    
+        \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+        \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
+      \fi
     \fi
   \else
     \ifcase\paramno
@@ -7067,29 +7665,40 @@ end
         \egroup
         \noexpand\norecurse{\the\macname}%
         \noexpand\scanmacro{\temp}\egroup}%
-    \else % many
-      \expandafter\xdef\csname\the\macname\endcsname{%
-         \bgroup\noexpand\macroargctxt
-         \expandafter\noexpand\csname\the\macname xx\endcsname}%
-      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
-          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
-      \expandafter\expandafter
-      \expandafter\xdef
-      \expandafter\expandafter
-      \csname\the\macname xxx\endcsname
-      \paramlist{%
-          \egroup
-          \noexpand\norecurse{\the\macname}%
-          \noexpand\scanmacro{\temp}\egroup}%
+    \else % at most 9
+      \ifnum\paramno<10\relax
+        \expandafter\xdef\csname\the\macname\endcsname{%
+           \bgroup\noexpand\macroargctxt
+           \expandafter\noexpand\csname\the\macname xx\endcsname}%
+        \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+            \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+        \expandafter\expandafter
+        \expandafter\xdef
+        \expandafter\expandafter
+        \csname\the\macname xxx\endcsname
+        \paramlist{%
+            \egroup
+            \noexpand\norecurse{\the\macname}%
+            \noexpand\scanmacro{\temp}\egroup}%
+      \else % 10 or more:
+        \expandafter\xdef\csname\the\macname\endcsname{%
+          \noexpand\getargvals@{\the\macname}{\argl}%
+        }%
+        \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+        \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
+      \fi
     \fi
   \fi}
 
+\catcode `\@\texiatcatcode\relax
+
 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
 
 % \braceorline decides whether the next nonwhitespace character is a
 % {.  If so it reads up to the closing }, if not, it reads the whole
 % line.  Whatever was read is then fed to the next control sequence
-% as an argument (by \parsebrace or \parsearg)
+% as an argument (by \parsebrace or \parsearg).
+% 
 \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
 \def\braceorlinexxx{%
   \ifx\nchar\bgroup\else
@@ -7099,7 +7708,8 @@ end
 
 % @alias.
 % We need some trickery to remove the optional spaces around the equal
-% sign.  Just make them active and then expand them all to nothing.
+% sign.  Make them active and then expand them all to nothing.
+%
 \def\alias{\parseargusing\obeyspaces\aliasxxx}
 \def\aliasxxx #1{\aliasyyy#1\relax}
 \def\aliasyyy #1=#2\relax{%
@@ -7120,7 +7730,8 @@ end
 
 % @inforef is relatively simple.
 \def\inforef #1{\inforefzzz #1,,,,**}
-\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+\def\inforefzzz #1,#2,#3,#4**{%
+  \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
   node \samp{\ignorespaces#1{}}}
 
 % @node's only job in TeX is to define \lastnode, which is used in
@@ -7181,11 +7792,32 @@ end
       \toks0 = \expandafter{\lastsection}%
       \immediate \writexrdef{title}{\the\toks0 }%
       \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
-      \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout
+      \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
     }%
   \fi
 }
 
+% @xrefautosectiontitle on|off says whether @section(ing) names are used
+% automatically in xrefs, if the third arg is not explicitly specified.
+% This was provided as a "secret" @set xref-automatic-section-title
+% variable, now it's official.
+% 
+\parseargdef\xrefautomaticsectiontitle{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETxref-automatic-section-title\endcsname
+      = \empty
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETxref-automatic-section-title\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
+                must be on|off}%
+  \fi\fi
+}
+
+% \f
 % @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
 % the node name, #2 the name of the Info cross-reference, #3 the printed
 % node name, #4 the name of the Info file, #5 the name of the printed
@@ -7194,26 +7826,41 @@ end
 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
 \def\ref#1{\xrefX[#1,,,,,,,]}
+%
+\newbox\toprefbox
+\newbox\printedrefnamebox
+\newbox\infofilenamebox
+\newbox\printedmanualbox
+%
 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
   \unsepspaces
-  \def\printedmanual{\ignorespaces #5}%
+  %
+  % Get args without leading/trailing spaces.
   \def\printedrefname{\ignorespaces #3}%
-  \setbox1=\hbox{\printedmanual\unskip}%
-  \setbox0=\hbox{\printedrefname\unskip}%
-  \ifdim \wd0 = 0pt
+  \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
+  %
+  \def\infofilename{\ignorespaces #4}%
+  \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
+  %
+  \def\printedmanual{\ignorespaces #5}%
+  \setbox\printedmanualbox  = \hbox{\printedmanual\unskip}%
+  %
+  % If the printed reference name (arg #3) was not explicitly given in
+  % the @xref, figure out what we want to use.
+  \ifdim \wd\printedrefnamebox = 0pt
     % No printed node name was explicitly given.
-    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
-      % Use the node name inside the square brackets.
+    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
+      % Not auto section-title: use node name inside the square brackets.
       \def\printedrefname{\ignorespaces #1}%
     \else
-      % Use the actual chapter/section title appear inside
-      % the square brackets.  Use the real section title if we have it.
-      \ifdim \wd1 > 0pt
-        % It is in another manual, so we don't have it.
+      % Auto section-title: use chapter/section title inside
+      % the square brackets if we have it.
+      \ifdim \wd\printedmanualbox > 0pt
+        % It is in another manual, so we don't have it; use node name.
         \def\printedrefname{\ignorespaces #1}%
       \else
         \ifhavexrefs
-          % We know the real title if we have the xref values.
+          % We (should) know the real title if we have the xref values.
           \def\printedrefname{\refx{#1-title}{}}%
         \else
           % Otherwise just copy the Info node name.
@@ -7227,13 +7874,20 @@ end
   \ifpdf
     {\indexnofonts
      \turnoffactive
+     \makevalueexpandable
      % This expands tokens, so do it after making catcode changes, so _
-     % etc. don't get their TeX definitions.
+     % etc. don't get their TeX definitions.  This ignores all spaces in
+     % #4, including (wrongly) those in the middle of the filename.
      \getfilename{#4}%
      %
-     % See comments at \activebackslashdouble.
-     {\activebackslashdouble \xdef\pdfxrefdest{#1}%
-      \backslashparens\pdfxrefdest}%
+     % This (wrongly) does not take account of leading or trailing
+     % spaces in #1, which should be ignored.
+     \edef\pdfxrefdest{#1}%
+     \ifx\pdfxrefdest\empty
+       \def\pdfxrefdest{Top}% no empty targets
+     \else
+       \txiescapepdf\pdfxrefdest  % escape PDF special chars
+     \fi
      %
      \leavevmode
      \startlink attr{/Border [0 0 0]}%
@@ -7260,29 +7914,42 @@ end
   \iffloat\Xthisreftitle
     % If the user specified the print name (third arg) to the ref,
     % print it instead of our usual "Figure 1.2".
-    \ifdim\wd0 = 0pt
+    \ifdim\wd\printedrefnamebox = 0pt
       \refx{#1-snt}{}%
     \else
       \printedrefname
     \fi
     %
-    % if the user also gave the printed manual name (fifth arg), append
+    % If the user also gave the printed manual name (fifth arg), append
     % "in MANUALNAME".
-    \ifdim \wd1 > 0pt
+    \ifdim \wd\printedmanualbox > 0pt
       \space \putwordin{} \cite{\printedmanual}%
     \fi
   \else
     % node/anchor (non-float) references.
+    % 
+    % If we use \unhbox to print the node names, TeX does not insert
+    % empty discretionaries after hyphens, which means that it will not
+    % find a line break at a hyphen in a node names.  Since some manuals
+    % are best written with fairly long node names, containing hyphens,
+    % this is a loss.  Therefore, we give the text of the node name
+    % again, so it is as if TeX is seeing it for the first time.
+    % 
+    \ifdim \wd\printedmanualbox > 0pt
+      % Cross-manual reference with a printed manual name.
+      % 
+      \crossmanualxref{\cite{\printedmanual\unskip}}%
+    %
+    \else\ifdim \wd\infofilenamebox > 0pt
+      % Cross-manual reference with only an info filename (arg 4), no
+      % printed manual name (arg 5).  This is essentially the same as
+      % the case above; we output the filename, since we have nothing else.
+      % 
+      \crossmanualxref{\code{\infofilename\unskip}}%
     %
-    % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
-    % insert empty discretionaries after hyphens, which means that it will
-    % not find a line break at a hyphen in a node names.  Since some manuals
-    % are best written with fairly long node names, containing hyphens, this
-    % is a loss.  Therefore, we give the text of the node name again, so it
-    % is as if TeX is seeing it for the first time.
-    \ifdim \wd1 > 0pt
-      \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
     \else
+      % Reference within this manual.
+      %
       % _ (for example) has to be the character _ for the purposes of the
       % control sequence corresponding to the node, but it has to expand
       % into the usual \leavevmode...\vrule stuff for purposes of
@@ -7294,7 +7961,7 @@ end
        \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
        \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
       }%
-      % output the `[mynode]' via a macro so it can be overridden.
+      % output the `[mynode]' via the macro below so it can be overridden.
       \xrefprintnodename\printedrefname
       %
       % But we always want a comma and a space:
@@ -7302,11 +7969,37 @@ end
       %
       % output the `page 3'.
       \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
-    \fi
+    \fi\fi
   \fi
   \endlink
 \endgroup}
 
+% Output a cross-manual xref to #1.  Used just above (twice).
+% 
+% Only include the text "Section ``foo'' in" if the foo is neither
+% missing or Top.  Thus, @xref{,,,foo,The Foo Manual} outputs simply
+% "see The Foo Manual", the idea being to refer to the whole manual.
+% 
+% But, this being TeX, we can't easily compare our node name against the
+% string "Top" while ignoring the possible spaces before and after in
+% the input.  By adding the arbitrary 7sp below, we make it much less
+% likely that a real node name would have the same width as "Top" (e.g.,
+% in a monospaced font).  Hopefully it will never happen in practice.
+% 
+% For the same basic reason, we retypeset the "Top" at every
+% reference, since the current font is indeterminate.
+% 
+\def\crossmanualxref#1{%
+  \setbox\toprefbox = \hbox{Top\kern7sp}%
+  \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
+  \ifdim \wd2 > 7sp  % nonempty?
+    \ifdim \wd2 = \wd\toprefbox \else  % same as Top?
+      \putwordSection{} ``\printedrefname'' \putwordin{}\space
+    \fi
+  \fi
+  #1%
+}
+
 % This macro is called from \xrefX for the `[nodename]' part of xref
 % output.  It's a separate macro only so it can be changed more easily,
 % since square brackets don't work well in some documents.  Particularly
@@ -7357,7 +8050,8 @@ end
     \angleleft un\-de\-fined\angleright
     \iflinks
       \ifhavexrefs
-        \message{\linenumber Undefined cross reference `#1'.}%
+        {\toks0 = {#1}% avoid expansion of possibly-complex value
+         \message{\linenumber Undefined cross reference `\the\toks0'.}}%
       \else
         \ifwarnedxrefs\else
           \global\warnedxrefstrue
@@ -7521,7 +8215,7 @@ end
 % space to prevent strange expansion errors.)
 \def\supereject{\par\penalty -20000\footnoteno =0 }
 
-% @footnotestyle is meaningful for info output only.
+% @footnotestyle is meaningful for Info output only.
 \let\footnotestyle=\comment
 
 {\catcode `\@=11
@@ -7584,6 +8278,8 @@ end
   % expands into a box, it must come within the paragraph, lest it
   % provide a place where TeX can split the footnote.
   \footstrut
+  %
+  % Invoke rest of plain TeX footnote routine.
   \futurelet\next\fo@t
 }
 }%end \catcode `\@=11
@@ -7671,7 +8367,7 @@ end
   it from ftp://tug.org/tex/epsf.tex.}
 %
 \def\image#1{%
-  \ifx\epsfbox\undefined
+  \ifx\epsfbox\thisisundefined
     \ifwarnednoepsf \else
       \errhelp = \noepsfhelp
       \errmessage{epsf.tex not found, images will be ignored}%
@@ -7687,7 +8383,7 @@ end
 % #2 is (optional) width, #3 is (optional) height.
 % #4 is (ignored optional) html alt text.
 % #5 is (ignored optional) extension.
-% #6 is just the usual extra ignored arg for parsing this stuff.
+% #6 is just the usual extra ignored arg for parsing stuff.
 \newif\ifimagevmode
 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
   \catcode`\^^M = 5     % in case we're inside an example
@@ -7695,6 +8391,13 @@ end
   % If the image is by itself, center it.
   \ifvmode
     \imagevmodetrue
+  \else \ifx\centersub\centerV
+    % for @center @image, we need a vbox so we can have our vertical space
+    \imagevmodetrue
+    \vbox\bgroup % vbox has better behavior than vtop herev
+  \fi\fi
+  %
+  \ifimagevmode
     \nobreak\medskip
     % Usually we'll have text after the image which will insert
     % \parskip glue, so insert it here too to equalize the space
@@ -7704,9 +8407,13 @@ end
   \fi
   %
   % Leave vertical mode so that indentation from an enclosing
-  % environment such as @quotation is respected.  On the other hand, if
-  % it's at the top level, we don't want the normal paragraph indentation.
-  \noindent
+  %  environment such as @quotation is respected.
+  % However, if we're at the top level, we don't want the
+  %  normal paragraph indentation.
+  % On the other hand, if we are in the case of @center @image, we don't
+  %  want to start a paragraph, which will create a hsize-width box and
+  %  eradicate the centering.
+  \ifx\centersub\centerV\else \noindent \fi
   %
   % Output the image.
   \ifpdf
@@ -7718,7 +8425,10 @@ end
     \epsfbox{#1.eps}%
   \fi
   %
-  \ifimagevmode \medskip \fi  % space after the standalone image
+  \ifimagevmode
+    \medskip  % space after a standalone image
+  \fi  
+  \ifx\centersub\centerV \egroup \fi
 \endgroup}
 
 
@@ -8136,7 +8846,7 @@ directory should work if nowhere else does.}
 %
 % Latin1 (ISO-8859-1) character definitions.
 \def\latonechardefs{%
-  \gdef^^a0{~}
+  \gdef^^a0{\tie}
   \gdef^^a1{\exclamdown}
   \gdef^^a2{\missingcharmsg{CENT SIGN}}
   \gdef^^a3{{\pounds}}
@@ -8166,7 +8876,7 @@ directory should work if nowhere else does.}
   \gdef^^b9{$^1$}
   \gdef^^ba{\ordm}
   %
-  \gdef^^bb{\guilletright}
+  \gdef^^bb{\guillemetright}
   \gdef^^bc{$1\over4$}
   \gdef^^bd{$1\over2$}
   \gdef^^be{$3\over4$}
@@ -8258,7 +8968,7 @@ directory should work if nowhere else does.}
 
 % Latin2 (ISO-8859-2) character definitions.
 \def\lattwochardefs{%
-  \gdef^^a0{~}
+  \gdef^^a0{\tie}
   \gdef^^a1{\ogonek{A}}
   \gdef^^a2{\u{}}
   \gdef^^a3{\L}
@@ -8339,8 +9049,8 @@ directory should work if nowhere else does.}
   \gdef^^ea{\ogonek{e}}
   \gdef^^eb{\"e}
   \gdef^^ec{\v e}
-  \gdef^^ed{\'\i}
-  \gdef^^ee{\^\i}
+  \gdef^^ed{\'{\dotless{i}}}
+  \gdef^^ee{\^{\dotless{i}}}
   \gdef^^ef{\v d}
   %
   \gdef^^f0{\dh}
@@ -8431,7 +9141,7 @@ directory should work if nowhere else does.}
 
   \gdef\DeclareUnicodeCharacter#1#2{%
     \countUTFz = "#1\relax
-    \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
+    %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
     \begingroup
       \parseXMLCharref
       \def\UTFviiiTwoOctets##1##2{%
@@ -8899,8 +9609,8 @@ directory should work if nowhere else does.}
 % Prevent underfull vbox error messages.
 \vbadness = 10000
 
-% Don't be so finicky about underfull hboxes, either.
-\hbadness = 2000
+% Don't be very finicky about underfull hboxes, either.
+\hbadness = 6666
 
 % Following George Bush, get rid of widows and orphans.
 \widowpenalty=10000
@@ -9107,28 +9817,21 @@ directory should work if nowhere else does.}
 
 \message{and turning on texinfo input format.}
 
+\def^^L{\par} % remove \outer, so ^L can appear in an @comment
+
 % DEL is a comment character, in case @c does not suffice.
 \catcode`\^^? = 14
 
 % Define macros to output various characters with catcode for normal text.
-\catcode`\"=\other
-\catcode`\~=\other
-\catcode`\^=\other
-\catcode`\_=\other
-\catcode`\|=\other
-\catcode`\<=\other
-\catcode`\>=\other
-\catcode`\+=\other
-\catcode`\$=\other
-\def\normaldoublequote{"}
-\def\normaltilde{~}
-\def\normalcaret{^}
-\def\normalunderscore{_}
-\def\normalverticalbar{|}
-\def\normalless{<}
-\def\normalgreater{>}
-\def\normalplus{+}
-\def\normaldollar{$}%$ font-lock fix
+\catcode`\"=\other \def\normaldoublequote{"}
+\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
+\catcode`\+=\other \def\normalplus{+}
+\catcode`\<=\other \def\normalless{<}
+\catcode`\>=\other \def\normalgreater{>}
+\catcode`\^=\other \def\normalcaret{^}
+\catcode`\_=\other \def\normalunderscore{_}
+\catcode`\|=\other \def\normalverticalbar{|}
+\catcode`\~=\other \def\normaltilde{~}
 
 % This macro is used to make a character print one way in \tt
 % (where it can probably be output as-is), and another way in other fonts,
@@ -9206,14 +9909,24 @@ directory should work if nowhere else does.}
 
 % In texinfo, backslash is an active character; it prints the backslash
 % in fixed width font.
-\catcode`\\=\active
-@def@normalbackslash{{@tt@backslashcurfont}}
+\catcode`\\=\active  % @ for escape char from now on.
+
+% The story here is that in math mode, the \char of \backslashcurfont
+% ends up printing the roman \ from the math symbol font (because \char
+% in math mode uses the \mathcode, and plain.tex sets
+% \mathcode`\\="026E).  It seems better for @backslashchar{} to always
+% print a typewriter backslash, hence we use an explicit \mathchar,
+% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
+% ignored family value; char position "5C).  We can't use " for the
+% usual hex value because it has already been made active.
+@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
+@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
+
 % On startup, @fixbackslash assigns:
 %  @let \ = @normalbackslash
-
 % \rawbackslash defines an active \ to do \backslashcurfont.
 % \otherbackslash defines an active \ to be a literal `\' character with
-% catcode other.
+% catcode other.  We switch back and forth between these.
 @gdef@rawbackslash{@let\=@backslashcurfont}
 @gdef@otherbackslash{@let\=@realbackslash}
 
@@ -9221,16 +9934,16 @@ directory should work if nowhere else does.}
 % the literal character `\'.
 %
 @def@normalturnoffactive{%
-  @let\=@normalbackslash
   @let"=@normaldoublequote
-  @let~=@normaltilde
+  @let$=@normaldollar %$ font-lock fix
+  @let+=@normalplus
+  @let<=@normalless
+  @let>=@normalgreater
+  @let\=@normalbackslash
   @let^=@normalcaret
   @let_=@normalunderscore
   @let|=@normalverticalbar
-  @let<=@normalless
-  @let>=@normalgreater
-  @let+=@normalplus
-  @let$=@normaldollar %$ font-lock fix
+  @let~=@normaltilde
   @markupsetuplqdefault
   @markupsetuprqdefault
   @unsepspaces
@@ -9262,10 +9975,19 @@ directory should work if nowhere else does.}
 % Say @foo, not \foo, in error messages.
 @escapechar = `@@
 
+% These (along with & and #) are made active for url-breaking, so need
+% active definitions as the normal characters.
+@def@normaldot{.}
+@def@normalquest{?}
+@def@normalslash{/}
+
 % These look ok in all fonts, so just make them not special.
-@catcode`@& = @other
-@catcode`@# = @other
-@catcode`@% = @other
+% @hashchar{} gets its own user-level command, because of #line.
+@catcode`@& = @other @def@normalamp{&}
+@catcode`@# = @other @def@normalhash{#}
+@catcode`@% = @other @def@normalpercent{%}
+
+@let @hashchar = @normalhash
 
 @c Finally, make ` and ' active, so that txicodequoteundirected and
 @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}.  If we
index 28ff44180e75e8a305c4edee0bf1d9e7755d2370..082b749d62314bfbe49165db6bfa662e0944493a 100755 (executable)
@@ -3,9 +3,9 @@ eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" ${1+"$@"}'
     if 0;
 # Update an FSF copyright year list to include the current year.
 
-my $VERSION = '2009-12-28.11:09'; # UTC
+my $VERSION = '2012-02-05.21:39'; # UTC
 
-# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 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,12 +22,16 @@ my $VERSION = '2009-12-28.11:09'; # UTC
 
 # Written by Jim Meyering and Joel E. Denny
 
-# The arguments to this script should be names of files that contain FSF
-# copyright statements to be updated.  For example, you might wish to
-# use the update-copyright target rule in maint.mk from gnulib's
-# maintainer-makefile module.
+# The arguments to this script should be names of files that contain
+# copyright statements to be updated.  The copyright holder's name
+# defaults to "Free Software Foundation, Inc." but may be changed to
+# any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment
+# variable.
 #
-# Iff an FSF copyright statement is recognized in a file and the final
+# For example, you might wish to use the update-copyright target rule
+# in maint.mk from gnulib's maintainer-makefile module.
+#
+# Iff a copyright statement is recognized in a file and the final
 # year is not the current year, then the statement is updated for the
 # new year and it is reformatted to:
 #
@@ -36,10 +40,10 @@ my $VERSION = '2009-12-28.11:09'; # UTC
 #   3. Expand copyright year intervals.  (See "Environment variables"
 #      below.)
 #
-# A warning is printed for every file for which no FSF copyright
+# A warning is printed for every file for which no copyright
 # statement is recognized.
 #
-# Each file's FSF copyright statement must be formated correctly in
+# Each file's copyright statement must be formatted correctly in
 # order to be recognized.  For example, each of these is fine:
 #
 #   Copyright @copyright{} 1990-2005, 2007-2009 Free Software
@@ -59,23 +63,17 @@ my $VERSION = '2009-12-28.11:09'; # UTC
 #   ## Copyright (C) 1990-2005, 2007-2009 Free Software
 #   #  Foundation, Inc.
 #
-# The following copyright statement is not recognized because the
-# copyright holder is not the FSF:
-#
-#   Copyright (C) 1990-2005, 2007-2009 Acme, Inc.
+# However, any correctly formatted copyright statement following
+# a non-matching copyright statements would be recognized.
 #
-# However, any correctly formatted FSF copyright statement following
-# either of the previous two copyright statements would be recognized.
-#
-# The exact conditions that a file's FSF copyright statement must meet
+# The exact conditions that a file's copyright statement must meet
 # to be recognized are:
 #
-#   1. It is the first FSF copyright statement that meets all of the
-#      following conditions.  Subsequent FSF copyright statements are
+#   1. It is the first copyright statement that meets all of the
+#      following conditions.  Subsequent copyright statements are
 #      ignored.
 #   2. Its format is "Copyright (C)", then a list of copyright years,
-#      and then the name of the copyright holder, which is "Free
-#      Software Foundation, Inc.".
+#      and then the name of the copyright holder.
 #   3. The "(C)" takes one of the following forms or is omitted
 #      entirely:
 #
@@ -84,9 +82,9 @@ my $VERSION = '2009-12-28.11:09'; # UTC
 #        C. @copyright{}
 #        D. &copy;
 #
-#   4. The "Copyright" appears at the beginning of a line except that it
+#   4. The "Copyright" appears at the beginning of a line, except that it
 #      may be prefixed by any sequence (e.g., a comment) of no more than
-#      5 characters.
+#      5 characters -- including white space.
 #   5. Iff such a prefix is present, the same prefix appears at the
 #      beginning of each remaining line within the FSF copyright
 #      statement.  There is one exception in order to support C-style
@@ -112,17 +110,23 @@ my $VERSION = '2009-12-28.11:09'; # UTC
 #      interval (such as 1990-2008).  If unset or set to 0, all existing
 #      copyright year intervals in a reformatted FSF copyright statement
 #      are expanded instead.
+#      If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps
+#      to the minimal containing range.  For example, convert
+#      2000, 2004-2007, 2009 to 2000-2009.
 #   3. For testing purposes, you can set the assumed current year in
 #      UPDATE_COPYRIGHT_YEAR.
 #   4. The default maximum line length for a copyright line is 72.
 #      Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length.
+#   5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other
+#      than "Free Software Foundation, Inc.".
 
 use strict;
 use warnings;
 
 my $copyright_re = 'Copyright';
 my $circle_c_re = '(?:\([cC]\)|@copyright{}|&copy;)';
-my $holder = 'Free Software Foundation, Inc.';
+my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
+$holder ||= 'Free Software Foundation, Inc.';
 my $prefix_max = 5;
 my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH};
 !$margin || $margin !~ m/^\d+$/
@@ -220,6 +224,10 @@ if (defined $stmt_re)
                   }))
                 )+
               /$1-$3/gx;
+
+            # When it's 2, emit a single range encompassing all year numbers.
+            $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
+              and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/;
           }
 
         # Format within margin.
@@ -252,7 +260,7 @@ if (defined $stmt_re)
   }
 else
   {
-    print STDERR "$ARGV: warning: FSF copyright statement not found\n";
+    print STDERR "$ARGV: warning: copyright statement not found\n";
   }
 
 # Local variables:
index 6aa7d3965f4514f480a74bf388aa9e3f44559d12..2b646308ec5a778d376f74a54808e395a83a3b22 100755 (executable)
@@ -2,17 +2,15 @@ eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}'
   & eval 'exec perl -wST "$0" $argv:q'
     if 0;
 # Detect instances of "if (p) free (p);".
-# Likewise for "if (p != NULL) free (p);".  And with braces.
-# Also detect "if (NULL != p) free (p);".
-# And with 0 in place of NULL.
+# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
 
-my $VERSION = '2009-04-16 15:57'; # UTC
+my $VERSION = '2012-01-06 07:23'; # UTC
 # The definition above must lie within the first 8 lines in order
 # for the Emacs time-stamp write hook (at end) to update it.
 # If you change this file with Emacs, please let the write hook
 # do its job.  Otherwise, update this string manually.
 
-# Copyright (C) 2008-2010 Free Software Foundation, Inc.
+# Copyright (C) 2008-2012 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
@@ -49,7 +47,7 @@ sub usage ($)
   my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
   if ($exit_code != 0)
     {
-      print $STREAM "Try `$ME --help' for more information.\n";
+      print $STREAM "Try '$ME --help' for more information.\n";
     }
   else
     {
@@ -63,8 +61,8 @@ detect free-like functions named FOO and BAR.
 
 OPTIONS:
 
-   --list       print only the name of each matching FILE (\0-terminated)
-   --name=N     add name N to the list of \`free\'-like functions to detect;
+   --list       print only the name of each matching FILE (\\0-terminated)
+   --name=N     add name N to the list of \'free\'-like functions to detect;
                   may be repeated
 
    --help       display this help and exit
@@ -127,14 +125,14 @@ sub is_NULL ($)
   foreach my $file (@ARGV)
     {
       open FH, '<', $file
-        or (warn "$ME: can't open `$file' for reading: $!\n"),
+        or (warn "$ME: can't open '$file' for reading: $!\n"),
           $err = EXIT_ERROR, next;
       while (defined (my $line = <FH>))
         {
           while ($line =~
               /\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\)
               #  1          2                  3
-               (?:   \s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)|
+               (?:   \s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;|
                 \s*\{\s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;\s*\}))/sxg)
             {
               my $all = $1;
@@ -181,7 +179,7 @@ free=xfree
 git grep -l -z "$free *(" \
   | xargs -0 useless-if-before-free -l --name="$free" \
   | xargs -0 perl -0x3b -pi -e \
-   's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\))/$2/s'
+   's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s'
 
 # Use the following to remove redundant uses of kfree inside braces.
 # Note that -0777 puts perl in slurp-whole-file mode;
index c07576d0d1423dc2457fee824f62f39a92abbc54..d477da8e9eb7a570feda2b7b07a81f68bdb7dfa5 100755 (executable)
@@ -2,9 +2,9 @@
 # List version-controlled file names.
 
 # Print a version string.
-scriptversion=2009-07-21.16; # UTC
+scriptversion=2011-05-16.22; # UTC
 
-# Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2006-2012 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
@@ -30,7 +30,7 @@ scriptversion=2009-07-21.16; # UTC
 postprocess=
 case $1 in
   --help) cat <<EOF
-Usage: $0 [-C SRCDIR] [DIR]
+Usage: $0 [-C SRCDIR] [DIR...]
 
 Output a list of version-controlled files in DIR (default .), relative to
 SRCDIR (default .).  SRCDIR must be the top directory of a checkout.
@@ -61,51 +61,48 @@ EOF
     shift; shift ;;
 esac
 
-dir=
-case $# in
-  0) ;;
-  1) dir=$1 ;;
-  *) echo "$0: too many arguments" 1>&2
-     echo "Usage: $0 [-C srcdir] [DIR]" 1>&2; exit 1;;
-esac
-
-test "x$dir" = x && dir=.
-
-if test -d .git; then
-  test "x$dir" = x. \
-    && dir= sed_esc= \
-    || { dir="$dir/"; sed_esc=`echo "$dir"|env sed 's,\([\\/]\),\\\\\1,g'`; }
-  # Ignore git symlinks - either they point into the tree, in which case
-  # we don't need to visit the target twice, or they point somewhere
-  # else (often into a submodule), in which case the content does not
-  # belong to this package.
-  eval exec git ls-tree -r 'HEAD:"$dir"' \
-    \| sed -n '"s/^100[^       ]*./$sed_esc/p"' $postprocess
-elif test -d .hg; then
-  eval exec hg locate '"$dir/*"' $postprocess
-elif test -d .bzr; then
-  test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
-  eval exec bzr ls --versioned '"$dir"' $postprocess
-elif test -d CVS; then
-  test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
-  if test -x build-aux/cvsu; then
-    eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess
-  elif (cvsu --help) >/dev/null 2>&1; then
-    eval cvsu --find --types=AFGM '"$dir"' $postprocess
+test $# = 0 && set .
+
+for dir
+do
+  if test -d .git; then
+    test "x$dir" = x. \
+      && dir= sed_esc= \
+      || { dir="$dir/"; sed_esc=`echo "$dir"|env sed 's,\([\\/]\),\\\\\1,g'`; }
+    # Ignore git symlinks - either they point into the tree, in which case
+    # we don't need to visit the target twice, or they point somewhere
+    # else (often into a submodule), in which case the content does not
+    # belong to this package.
+    eval exec git ls-tree -r 'HEAD:"$dir"' \
+      \| sed -n '"s/^100[^     ]*./$sed_esc/p"' $postprocess
+  elif test -d .hg; then
+    eval exec hg locate '"$dir/*"' $postprocess
+  elif test -d .bzr; then
+    test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
+    eval exec bzr ls -R --versioned '"$dir"' $postprocess
+  elif test -d CVS; then
+    test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
+    if test -x build-aux/cvsu; then
+      eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess
+    elif (cvsu --help) >/dev/null 2>&1; then
+      eval cvsu --find --types=AFGM '"$dir"' $postprocess
+    else
+      eval awk -F/ \''{                        \
+          if (!$1 && $3 !~ /^-/) {     \
+            f=FILENAME;                        \
+            if (f ~ /CVS\/Entries$/)   \
+              f = substr(f, 1, length(f)-11); \
+            print f $2;                        \
+          }}'\''                               \
+        `find "$dir" -name Entries -print` /dev/null' $postprocess
+    fi
+  elif test -d .svn; then
+    eval exec svn list -R '"$dir"' $postprocess
   else
-    eval awk -F/ \''{                  \
-       if (!$1 && $3 !~ /^-/) {        \
-         f=FILENAME;                   \
-         if (f ~ /CVS\/Entries$/)      \
-           f = substr(f, 1, length(f)-11); \
-         print f $2;                   \
-       }}'\''                          \
-      `find "$dir" -name Entries -print` /dev/null' $postprocess
+    echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
+    exit 1
   fi
-else
-  echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
-  exit 1
-fi
+done
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/build-aux/warn-on-use.h b/build-aux/warn-on-use.h
deleted file mode 100644 (file)
index 7a3a9f0..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-/* A C macro for emitting warnings if a function is used.
-   Copyright (C) 2010 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 the Free Software Foundation; either version 3 of the License, 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* _GL_WARN_ON_USE(function, "literal string") issues a declaration
-   for FUNCTION which will then trigger a compiler warning containing
-   the text of "literal string" anywhere that function is called, if
-   supported by the compiler.  If the compiler does not support this
-   feature, the macro expands to an unused extern declaration.
-
-   This macro is useful for marking a function as a potential
-   portability trap, with the intent that "literal string" include
-   instructions on the replacement function that should be used
-   instead.  However, one of the reasons that a function is a
-   portability trap is if it has the wrong signature.  Declaring
-   FUNCTION with a different signature in C is a compilation error, so
-   this macro must use the same type as any existing declaration so
-   that programs that avoid the problematic FUNCTION do not fail to
-   compile merely because they included a header that poisoned the
-   function.  But this implies that _GL_WARN_ON_USE is only safe to
-   use if FUNCTION is known to already have a declaration.  Use of
-   this macro implies that there must not be any other macro hiding
-   the declaration of FUNCTION; but undefining FUNCTION first is part
-   of the poisoning process anyway (although for symbols that are
-   provided only via a macro, the result is a compilation error rather
-   than a warning containing "literal string").  Also note that in
-   C++, it is only safe to use if FUNCTION has no overloads.
-
-   For an example, it is possible to poison 'getline' by:
-   - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
-     [getline]) in configure.ac, which potentially defines
-     HAVE_RAW_DECL_GETLINE
-   - adding this code to a header that wraps the system <stdio.h>:
-     #undef getline
-     #if HAVE_RAW_DECL_GETLINE
-     _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
-       "not universally present; use the gnulib module getline");
-     #endif
-
-   It is not possible to directly poison global variables.  But it is
-   possible to write a wrapper accessor function, and poison that
-   (less common usage, like &environ, will cause a compilation error
-   rather than issue the nice warning, but the end result of informing
-   the developer about their portability problem is still achieved):
-   #if HAVE_RAW_DECL_ENVIRON
-   static inline char ***rpl_environ (void) { return &environ; }
-   _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
-   # undef environ
-   # define environ (*rpl_environ ())
-   #endif
-   */
-#ifndef _GL_WARN_ON_USE
-
-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
-/* A compiler attribute is available in gcc versions 4.3.0 and later.  */
-#  define _GL_WARN_ON_USE(function, message) \
-extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
-
-# else /* Unsupported.  */
-#  define _GL_WARN_ON_USE(function, message) \
-extern int _gl_warn_on_use
-# endif
-#endif
diff --git a/cfg.mk b/cfg.mk
new file mode 100644 (file)
index 0000000..3878c5c
--- /dev/null
+++ b/cfg.mk
@@ -0,0 +1,85 @@
+# Customize maint.mk                           -*- makefile -*-
+# Copyright (C) 2003-2012 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
+# the Free Software Foundation, either version 3 of the License, 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Used in maint.mk's web-manual rule
+manual_title = gzip: the data compression program
+
+# Tests not to run as part of "make distcheck".
+local-checks-to-skip =         \
+  sc_bindtextdomain            \
+  sc_error_message_period      \
+  sc_error_message_uppercase   \
+  sc_m4_quote_check            \
+  sc_obsolete_symbols          \
+  sc_program_name              \
+  sc_prohibit_S_IS_definition  \
+  sc_prohibit_atoi_atof                \
+  sc_prohibit_stat_st_blocks   \
+  sc_space_tab                 \
+  sc_texinfo_acronym           \
+  sc_useless_cpp_parens
+
+
+# Tools used to bootstrap this package, used for "announcement".
+bootstrap-tools = autoconf,automake,gnulib
+
+# Now that we have better tests, make this the default.
+export VERBOSE = yes
+
+old_NEWS_hash = 4e76bc5d3e489bb63342e85762172502
+
+sc_obs_header_regex = \
+  \<(STDC_HEADERS|HAVE_(LIMITS|STRING|UNISTD|STDLIB)_H)\>
+sc_prohibit_obsolete_HAVE_HEADER_H:
+       @prohibit='^[    ]*#[    ]*(el)?if.*$(sc_obs_header_regex)' \
+       halt='remove the above obsolete #if...HAVE_HEADER_H test(s)' \
+         $(_sc_search_regexp)
+
+update-copyright-env = \
+  UPDATE_COPYRIGHT_USE_INTERVALS=1 \
+  UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79
+
+# Indent only with spaces.
+sc_prohibit_tab_based_indentation:
+       @prohibit='^ *  '                                               \
+       halt='TAB in indentation; use only spaces'                      \
+         $(_sc_search_regexp)
+
+# Don't use "indent-tabs-mode: nil" anymore.  No longer needed.
+sc_prohibit_emacs__indent_tabs_mode__setting:
+       @prohibit='^( *[*#] *)?indent-tabs-mode:'                       \
+       halt='use of emacs indent-tabs-mode: setting'                   \
+         $(_sc_search_regexp)
+
+include $(srcdir)/dist-check.mk
+
+exclude_file_name_regexp--sc_file_system = ^NEWS$$
+exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \
+  (^|/)(GNU)?[Mm]akefile|(^|/)ChangeLog|\.(am|mk)$$
+exclude_file_name_regexp--sc_require_config_h = ^lib/match\.c$$
+exclude_file_name_regexp--sc_require_config_h_first = ^lib/match\.c$$
+exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \
+  ^tests/hufts-segv\.gz$$
+exclude_file_name_regexp--sc_prohibit_strcmp = ^gzip\.c$$
+exclude_file_name_regexp--sc_prohibit_always-defined_macros = ^tailor\.h$$
+
+# Tell the tight_scope rule that sources are in ".".
+export _gl_TS_dir = .
+
+# Tell the tight_scope rule that these variables are deliberately "extern".
+export _gl_TS_unmarked_extern_vars = \
+  block_start d_buf inbuf outbuf prev read_buf strstart window \
+  match_start prev_length max_chain_length good_match
index 2cf1128ba0a82e3284d4979c6e55e7810f671996..1aa577984838bf80b202decd816abccc3de63032 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65.23-13e35 for gzip 1.4.
+# Generated by GNU Autoconf 2.69.4-560f for gzip 1.5.
 #
 # Report bugs to <bug-gzip@gnu.org>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -91,6 +89,7 @@ fi
 IFS=" ""       $as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -135,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -168,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -213,14 +238,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-       # neutralization value for shells without unset; and this also
-       # works around shells that cannot unset nonexistent variables.
-       BASH_ENV=/dev/null
-       ENV=/dev/null
-       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-       export CONFIG_SHELL
-       exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -319,10 +355,18 @@ $as_echo X"$as_dir" |
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -359,19 +403,19 @@ else
 fi # as_fn_arith
 
 
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$?; test $as_status -eq 0 && as_status=1
-  if test "$3"; then
-    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-  $as_echo "$as_me: error: $1" >&2
+  $as_echo "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
@@ -444,6 +488,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -478,16 +526,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -499,28 +547,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -533,7 +561,7 @@ test -n "$DJDIR" || exec 7<&0 </dev/null
 exec 6>&1
 
 # Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
@@ -552,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='gzip'
 PACKAGE_TARNAME='gzip'
-PACKAGE_VERSION='1.4'
-PACKAGE_STRING='gzip 1.4'
+PACKAGE_VERSION='1.5'
+PACKAGE_STRING='gzip 1.5'
 PACKAGE_BUGREPORT='bug-gzip@gnu.org'
 PACKAGE_URL=''
 
@@ -594,14 +622,16 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_func_list=
+gl_use_threads_default=
 ac_header_list=
+ac_func_list=
 gl_getopt_required=POSIX
 gl_getopt_required=POSIX
 ac_subst_vars='gltests_LTLIBOBJS
 gltests_LIBOBJS
 gl_LTLIBOBJS
 gl_LIBOBJS
+CONFIG_INCLUDE
 am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
@@ -610,41 +640,58 @@ LIBOBJS
 ASCPPFLAGS
 ASCPPPOST
 GNULIB_WARN_CFLAGS
+WARN_CFLAGS
 WERROR_CFLAGS
 LIBGZIP_LTLIBDEPS
 LIBGZIP_LIBDEPS
+gltests_WITNESS
+REPLACE_TOWLOWER
 REPLACE_ISWCNTRL
-WCTYPE_H
 HAVE_WCTYPE_H
 NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
 NEXT_WCTYPE_H
 HAVE_ISWCNTRL
+REPLACE_ISWBLANK
+HAVE_WCTRANS_T
+HAVE_WCTYPE_T
+HAVE_ISWBLANK
+GNULIB_TOWCTRANS
+GNULIB_WCTRANS
+GNULIB_ISWCTYPE
+GNULIB_WCTYPE
+GNULIB_ISWBLANK
 HAVE_WINT_T
-HAVE_WCHAR_H
 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H
 NEXT_WCHAR_H
-WARN_CFLAGS
 HAVE_UNISTD_H
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
 NEXT_UNISTD_H
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
 TIME_H_DEFINES_STRUCT_TIMESPEC
 NEXT_AS_FIRST_DIRECTIVE_TIME_H
 NEXT_TIME_H
 REPLACE_TIMEGM
-REPLACE_STRPTIME
 REPLACE_NANOSLEEP
 REPLACE_MKTIME
 REPLACE_LOCALTIME_R
-NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
-NEXT_SYS_STAT_H
+HAVE_TIMEGM
+HAVE_STRPTIME
+HAVE_NANOSLEEP
+HAVE_DECL_LOCALTIME_R
+GNULIB_TIME_R
+GNULIB_TIMEGM
+GNULIB_STRPTIME
+GNULIB_NANOSLEEP
+GNULIB_MKTIME
 NEXT_AS_FIRST_DIRECTIVE_STRING_H
 NEXT_STRING_H
-HAVE_RANDOM_H
 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
 NEXT_STDLIB_H
 NEXT_AS_FIRST_DIRECTIVE_STDIO_H
 NEXT_STDIO_H
+GL_GENERATE_STDINT_H_FALSE
+GL_GENERATE_STDINT_H_TRUE
 STDINT_H
 WINT_T_SUFFIX
 WCHAR_T_SUFFIX
@@ -666,28 +713,39 @@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H
 NEXT_STDINT_H
 HAVE_SYS_TYPES_H
 HAVE_INTTYPES_H
+HAVE_WCHAR_H
 HAVE_UNSIGNED_LONG_LONG_INT
 HAVE_LONG_LONG_INT
 NEXT_AS_FIRST_DIRECTIVE_STDDEF_H
 NEXT_STDDEF_H
+GL_GENERATE_STDDEF_H_FALSE
+GL_GENERATE_STDDEF_H_TRUE
 STDDEF_H
 HAVE_WCHAR_T
 REPLACE_NULL
 HAVE__BOOL
+GL_GENERATE_STDBOOL_H_FALSE
+GL_GENERATE_STDBOOL_H_TRUE
 STDBOOL_H
+ASM_SYMBOL_PREFIX
 UNDEFINE_STRTOK_R
 REPLACE_STRTOK_R
 REPLACE_STRSIGNAL
+REPLACE_STRNLEN
 REPLACE_STRNDUP
+REPLACE_STRNCAT
+REPLACE_STRERROR_R
 REPLACE_STRERROR
+REPLACE_STRCHRNUL
 REPLACE_STRCASESTR
 REPLACE_STRSTR
 REPLACE_STRDUP
+REPLACE_STPNCPY
 REPLACE_MEMMEM
 REPLACE_MEMCHR
 HAVE_STRVERSCMP
 HAVE_DECL_STRSIGNAL
-HAVE_DECL_STRERROR
+HAVE_DECL_STRERROR_R
 HAVE_DECL_STRTOK_R
 HAVE_STRCASESTR
 HAVE_STRSEP
@@ -702,9 +760,13 @@ HAVE_RAWMEMCHR
 HAVE_DECL_MEMRCHR
 HAVE_MEMPCPY
 HAVE_DECL_MEMMEM
+HAVE_MEMCHR
+HAVE_FFSLL
+HAVE_FFSL
 HAVE_MBSLEN
 GNULIB_STRVERSCMP
 GNULIB_STRSIGNAL
+GNULIB_STRERROR_R
 GNULIB_STRERROR
 GNULIB_MBSTOK_R
 GNULIB_MBSSEP
@@ -727,6 +789,7 @@ GNULIB_STRSEP
 GNULIB_STRPBRK
 GNULIB_STRNLEN
 GNULIB_STRNDUP
+GNULIB_STRNCAT
 GNULIB_STRDUP
 GNULIB_STRCHRNUL
 GNULIB_STPNCPY
@@ -736,9 +799,12 @@ GNULIB_MEMRCHR
 GNULIB_MEMPCPY
 GNULIB_MEMMEM
 GNULIB_MEMCHR
+GNULIB_FFSLL
+GNULIB_FFSL
 LOCALE_FR_UTF8
 LOCALE_ZH_CN
 LOCALE_JA
+REPLACE_WCSWIDTH
 REPLACE_WCWIDTH
 REPLACE_WCSNRTOMBS
 REPLACE_WCSRTOMBS
@@ -753,6 +819,34 @@ REPLACE_BTOWC
 REPLACE_MBSTATE_T
 HAVE_DECL_WCWIDTH
 HAVE_DECL_WCTOB
+HAVE_WCSWIDTH
+HAVE_WCSTOK
+HAVE_WCSSTR
+HAVE_WCSPBRK
+HAVE_WCSSPN
+HAVE_WCSCSPN
+HAVE_WCSRCHR
+HAVE_WCSCHR
+HAVE_WCSDUP
+HAVE_WCSXFRM
+HAVE_WCSCOLL
+HAVE_WCSNCASECMP
+HAVE_WCSCASECMP
+HAVE_WCSNCMP
+HAVE_WCSCMP
+HAVE_WCSNCAT
+HAVE_WCSCAT
+HAVE_WCPNCPY
+HAVE_WCSNCPY
+HAVE_WCPCPY
+HAVE_WCSCPY
+HAVE_WCSNLEN
+HAVE_WCSLEN
+HAVE_WMEMSET
+HAVE_WMEMMOVE
+HAVE_WMEMCPY
+HAVE_WMEMCMP
+HAVE_WMEMCHR
 HAVE_WCSNRTOMBS
 HAVE_WCSRTOMBS
 HAVE_WCRTOMB
@@ -762,6 +856,34 @@ HAVE_MBRLEN
 HAVE_MBRTOWC
 HAVE_MBSINIT
 HAVE_BTOWC
+GNULIB_WCSWIDTH
+GNULIB_WCSTOK
+GNULIB_WCSSTR
+GNULIB_WCSPBRK
+GNULIB_WCSSPN
+GNULIB_WCSCSPN
+GNULIB_WCSRCHR
+GNULIB_WCSCHR
+GNULIB_WCSDUP
+GNULIB_WCSXFRM
+GNULIB_WCSCOLL
+GNULIB_WCSNCASECMP
+GNULIB_WCSCASECMP
+GNULIB_WCSNCMP
+GNULIB_WCSCMP
+GNULIB_WCSNCAT
+GNULIB_WCSCAT
+GNULIB_WCPNCPY
+GNULIB_WCSNCPY
+GNULIB_WCPCPY
+GNULIB_WCSCPY
+GNULIB_WCSNLEN
+GNULIB_WCSLEN
+GNULIB_WMEMSET
+GNULIB_WMEMMOVE
+GNULIB_WMEMCPY
+GNULIB_WMEMCMP
+GNULIB_WMEMCHR
 GNULIB_WCWIDTH
 GNULIB_WCSNRTOMBS
 GNULIB_WCSRTOMBS
@@ -775,107 +897,355 @@ GNULIB_WCTOB
 GNULIB_BTOWC
 NEXT_AS_FIRST_DIRECTIVE_MATH_H
 NEXT_MATH_H
+LTLIBMULTITHREAD
+LIBMULTITHREAD
+LTLIBTHREAD
+LIBTHREAD
+LIBPTH_PREFIX
+LTLIBPTH
+LIBPTH
 LOCALCHARSET_TESTS_ENVIRONMENT
 GLIBC21
+IGNORE_UNUSED_LIBRARIES_CFLAGS
 GNU_MAKE_FALSE
 GNU_MAKE_TRUE
-SYS_TIME_H
-REPLACE_GETTIMEOFDAY
-HAVE_STRUCT_TIMEVAL
-HAVE_SYS_TIME_H
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
 NEXT_SYS_TIME_H
+REPLACE_STRUCT_TIMEVAL
+REPLACE_GETTIMEOFDAY
+HAVE_SYS_TIME_H
+HAVE_STRUCT_TIMEVAL
+HAVE_GETTIMEOFDAY
+GNULIB_GETTIMEOFDAY
 LTLIBINTL
 LIBINTL
+GNULIB_GL_UNISTD_H_GETOPT
 GETOPT_H
 HAVE_GETOPT_H
 NEXT_AS_FIRST_DIRECTIVE_GETOPT_H
 NEXT_GETOPT_H
+WINDOWS_64_BIT_ST_SIZE
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
+NEXT_SYS_STAT_H
+REPLACE_UTIMENSAT
+REPLACE_STAT
+REPLACE_MKNOD
+REPLACE_MKFIFO
+REPLACE_MKDIR
+REPLACE_LSTAT
+REPLACE_FUTIMENS
+REPLACE_FSTATAT
+REPLACE_FSTAT
+HAVE_UTIMENSAT
+HAVE_MKNODAT
+HAVE_MKNOD
+HAVE_MKFIFOAT
+HAVE_MKFIFO
+HAVE_MKDIRAT
+HAVE_LSTAT
+HAVE_LCHMOD
+HAVE_FUTIMENS
+HAVE_FSTATAT
+HAVE_FCHMODAT
+GNULIB_UTIMENSAT
+GNULIB_STAT
+GNULIB_MKNODAT
+GNULIB_MKNOD
+GNULIB_MKFIFOAT
+GNULIB_MKFIFO
+GNULIB_MKDIRAT
+GNULIB_LSTAT
+GNULIB_LCHMOD
+GNULIB_FUTIMENS
+GNULIB_FSTATAT
+GNULIB_FSTAT
+GNULIB_FCHMODAT
+WINDOWS_64_BIT_OFF_T
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H
+NEXT_SYS_TYPES_H
 REPLACE_TRUNCL
+REPLACE_TRUNCF
+REPLACE_TRUNC
+REPLACE_SQRTL
 REPLACE_SIGNBIT_USING_GCC
 REPLACE_SIGNBIT
 REPLACE_ROUNDL
 REPLACE_ROUNDF
 REPLACE_ROUND
+REPLACE_REMAINDERL
+REPLACE_REMAINDERF
+REPLACE_REMAINDER
 REPLACE_NAN
+REPLACE_MODFL
+REPLACE_MODFF
+REPLACE_MODF
+REPLACE_LOGBL
+REPLACE_LOGBF
+REPLACE_LOGB
+REPLACE_LOG2L
+REPLACE_LOG2F
+REPLACE_LOG2
+REPLACE_LOG1PL
+REPLACE_LOG1PF
+REPLACE_LOG1P
+REPLACE_LOG10L
+REPLACE_LOG10F
+REPLACE_LOG10
+REPLACE_LOGL
+REPLACE_LOGF
+REPLACE_LOG
 REPLACE_LDEXPL
 REPLACE_ISNAN
 REPLACE_ISINF
 REPLACE_ISFINITE
+REPLACE_ILOGBF
+REPLACE_ILOGB
+REPLACE_HYPOTL
+REPLACE_HYPOTF
+REPLACE_HYPOT
 REPLACE_HUGE_VAL
 REPLACE_FREXPL
 REPLACE_FREXP
+REPLACE_FREXPF
+REPLACE_FMODL
+REPLACE_FMODF
+REPLACE_FMOD
+REPLACE_FMAL
+REPLACE_FMAF
+REPLACE_FMA
 REPLACE_FLOORL
 REPLACE_FLOORF
+REPLACE_FLOOR
+REPLACE_FABSL
+REPLACE_EXP2L
+REPLACE_EXP2
+REPLACE_EXPM1F
+REPLACE_EXPM1
 REPLACE_CEILL
 REPLACE_CEILF
+REPLACE_CEIL
+REPLACE_CBRTL
+REPLACE_CBRTF
+HAVE_DECL_TRUNCL
 HAVE_DECL_TRUNCF
 HAVE_DECL_TRUNC
 HAVE_DECL_TANL
 HAVE_DECL_SQRTL
 HAVE_DECL_SINL
+HAVE_DECL_ROUNDL
+HAVE_DECL_ROUNDF
+HAVE_DECL_ROUND
+HAVE_DECL_RINTF
+HAVE_DECL_REMAINDERL
+HAVE_DECL_REMAINDER
+HAVE_DECL_LOGB
+HAVE_DECL_LOG2L
+HAVE_DECL_LOG2F
+HAVE_DECL_LOG2
+HAVE_DECL_LOG10L
 HAVE_DECL_LOGL
 HAVE_DECL_LDEXPL
 HAVE_DECL_FREXPL
+HAVE_DECL_FLOORL
+HAVE_DECL_FLOORF
+HAVE_DECL_EXPM1L
+HAVE_DECL_EXP2L
+HAVE_DECL_EXP2F
+HAVE_DECL_EXP2
 HAVE_DECL_EXPL
 HAVE_DECL_COSL
+HAVE_DECL_COPYSIGNF
+HAVE_DECL_CEILL
+HAVE_DECL_CEILF
+HAVE_DECL_CBRTL
+HAVE_DECL_CBRTF
 HAVE_DECL_ATANL
 HAVE_DECL_ASINL
 HAVE_DECL_ACOSL
+HAVE_TANHF
 HAVE_TANL
+HAVE_TANF
 HAVE_SQRTL
+HAVE_SQRTF
+HAVE_SINHF
 HAVE_SINL
+HAVE_SINF
+HAVE_RINTL
+HAVE_RINT
+HAVE_REMAINDERF
+HAVE_REMAINDER
+HAVE_POWF
+HAVE_MODFL
+HAVE_MODFF
+HAVE_LOGBL
+HAVE_LOGBF
+HAVE_LOG1PL
+HAVE_LOG1PF
+HAVE_LOG1P
+HAVE_LOG10L
+HAVE_LOG10F
 HAVE_LOGL
+HAVE_LOGF
+HAVE_LDEXPF
 HAVE_ISNANL
 HAVE_ISNAND
 HAVE_ISNANF
+HAVE_ILOGBL
+HAVE_ILOGBF
+HAVE_ILOGB
+HAVE_HYPOTL
+HAVE_HYPOTF
+HAVE_FREXPF
+HAVE_FMODL
+HAVE_FMODF
+HAVE_FMAL
+HAVE_FMAF
+HAVE_FMA
+HAVE_FABSL
+HAVE_FABSF
+HAVE_EXPM1F
+HAVE_EXPM1
 HAVE_EXPL
+HAVE_EXPF
+HAVE_COSHF
 HAVE_COSL
+HAVE_COSF
+HAVE_COPYSIGNL
+HAVE_COPYSIGN
+HAVE_CBRTL
+HAVE_CBRTF
+HAVE_CBRT
+HAVE_ATAN2F
 HAVE_ATANL
+HAVE_ATANF
 HAVE_ASINL
+HAVE_ASINF
 HAVE_ACOSL
+HAVE_ACOSF
 GNULIB_TRUNCL
 GNULIB_TRUNCF
 GNULIB_TRUNC
+GNULIB_TANHF
 GNULIB_TANL
+GNULIB_TANF
 GNULIB_SQRTL
+GNULIB_SQRTF
+GNULIB_SINHF
 GNULIB_SINL
+GNULIB_SINF
 GNULIB_SIGNBIT
 GNULIB_ROUNDL
 GNULIB_ROUNDF
 GNULIB_ROUND
+GNULIB_RINTL
+GNULIB_RINTF
+GNULIB_RINT
+GNULIB_REMAINDERL
+GNULIB_REMAINDERF
+GNULIB_REMAINDER
+GNULIB_POWF
+GNULIB_MODFL
+GNULIB_MODFF
+GNULIB_MODF
+GNULIB_LOGBL
+GNULIB_LOGBF
+GNULIB_LOGB
+GNULIB_LOG2L
+GNULIB_LOG2F
+GNULIB_LOG2
+GNULIB_LOG1PL
+GNULIB_LOG1PF
+GNULIB_LOG1P
+GNULIB_LOG10L
+GNULIB_LOG10F
+GNULIB_LOG10
 GNULIB_LOGL
+GNULIB_LOGF
+GNULIB_LOG
 GNULIB_LDEXPL
+GNULIB_LDEXPF
 GNULIB_ISNANL
 GNULIB_ISNAND
 GNULIB_ISNANF
 GNULIB_ISNAN
 GNULIB_ISINF
 GNULIB_ISFINITE
+GNULIB_ILOGBL
+GNULIB_ILOGBF
+GNULIB_ILOGB
+GNULIB_HYPOTL
+GNULIB_HYPOTF
+GNULIB_HYPOT
 GNULIB_FREXPL
 GNULIB_FREXP
+GNULIB_FREXPF
+GNULIB_FMODL
+GNULIB_FMODF
+GNULIB_FMOD
+GNULIB_FMAL
+GNULIB_FMAF
+GNULIB_FMA
 GNULIB_FLOORL
 GNULIB_FLOORF
+GNULIB_FLOOR
+GNULIB_FABSL
+GNULIB_FABSF
+GNULIB_EXPM1L
+GNULIB_EXPM1F
+GNULIB_EXPM1
+GNULIB_EXP2L
+GNULIB_EXP2F
+GNULIB_EXP2
 GNULIB_EXPL
+GNULIB_EXPF
+GNULIB_COSHF
 GNULIB_COSL
+GNULIB_COSF
+GNULIB_COPYSIGNL
+GNULIB_COPYSIGNF
+GNULIB_COPYSIGN
 GNULIB_CEILL
 GNULIB_CEILF
+GNULIB_CEIL
+GNULIB_CBRTL
+GNULIB_CBRTF
+GNULIB_CBRT
+GNULIB_ATAN2F
 GNULIB_ATANL
+GNULIB_ATANF
 GNULIB_ASINL
+GNULIB_ASINF
 GNULIB_ACOSL
+GNULIB_ACOSF
+HAVE_FEATURES_H
 APPLE_UNIVERSAL_BUILD
+HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+REPLACE_ITOLD
+GL_GENERATE_FLOAT_H_FALSE
+GL_GENERATE_FLOAT_H_TRUE
 FLOAT_H
 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
 NEXT_FLOAT_H
 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
 NEXT_FCNTL_H
+REPLACE_OPENAT
+REPLACE_OPEN
+REPLACE_FCNTL
+HAVE_OPENAT
+HAVE_FCNTL
+GNULIB_OPENAT
+GNULIB_OPEN
+GNULIB_NONBLOCKING
+GNULIB_FCNTL
 REPLACE_VSPRINTF
 REPLACE_VSNPRINTF
 REPLACE_VPRINTF
 REPLACE_VFPRINTF
 REPLACE_VDPRINTF
 REPLACE_VASPRINTF
+REPLACE_TMPFILE
 REPLACE_STDIO_WRITE_FUNCS
+REPLACE_STDIO_READ_FUNCS
 REPLACE_SPRINTF
 REPLACE_SNPRINTF
 REPLACE_RENAMEAT
@@ -886,6 +1256,7 @@ REPLACE_POPEN
 REPLACE_PERROR
 REPLACE_OBSTACK_PRINTF
 REPLACE_GETLINE
+REPLACE_GETDELIM
 REPLACE_FTELLO
 REPLACE_FTELL
 REPLACE_FSEEKO
@@ -895,17 +1266,24 @@ REPLACE_FPURGE
 REPLACE_FPRINTF
 REPLACE_FOPEN
 REPLACE_FFLUSH
+REPLACE_FDOPEN
 REPLACE_FCLOSE
 REPLACE_DPRINTF
 HAVE_VDPRINTF
 HAVE_VASPRINTF
 HAVE_RENAMEAT
+HAVE_POPEN
+HAVE_PCLOSE
+HAVE_FTELLO
+HAVE_FSEEKO
 HAVE_DPRINTF
 HAVE_DECL_VSNPRINTF
 HAVE_DECL_SNPRINTF
 HAVE_DECL_OBSTACK_PRINTF
 HAVE_DECL_GETLINE
 HAVE_DECL_GETDELIM
+HAVE_DECL_FTELLO
+HAVE_DECL_FSEEKO
 HAVE_DECL_FPURGE
 GNULIB_VSPRINTF_POSIX
 GNULIB_VSNPRINTF
@@ -914,10 +1292,15 @@ GNULIB_VPRINTF
 GNULIB_VFPRINTF_POSIX
 GNULIB_VFPRINTF
 GNULIB_VDPRINTF
+GNULIB_VSCANF
+GNULIB_VFSCANF
 GNULIB_VASPRINTF
+GNULIB_TMPFILE
 GNULIB_STDIO_H_SIGPIPE
+GNULIB_STDIO_H_NONBLOCKING
 GNULIB_SPRINTF_POSIX
 GNULIB_SNPRINTF
+GNULIB_SCANF
 GNULIB_RENAMEAT
 GNULIB_RENAME
 GNULIB_REMOVE
@@ -928,90 +1311,76 @@ GNULIB_PRINTF_POSIX
 GNULIB_PRINTF
 GNULIB_POPEN
 GNULIB_PERROR
+GNULIB_PCLOSE
 GNULIB_OBSTACK_PRINTF_POSIX
 GNULIB_OBSTACK_PRINTF
 GNULIB_GETLINE
 GNULIB_GETDELIM
+GNULIB_GETCHAR
+GNULIB_GETC
 GNULIB_FWRITE
 GNULIB_FTELLO
 GNULIB_FTELL
 GNULIB_FSEEKO
 GNULIB_FSEEK
+GNULIB_FSCANF
 GNULIB_FREOPEN
+GNULIB_FREAD
 GNULIB_FPUTS
 GNULIB_FPUTC
 GNULIB_FPURGE
 GNULIB_FPRINTF_POSIX
 GNULIB_FPRINTF
 GNULIB_FOPEN
+GNULIB_FGETS
+GNULIB_FGETC
 GNULIB_FFLUSH
+GNULIB_FDOPEN
 GNULIB_FCLOSE
 GNULIB_DPRINTF
-REPLACE_OPENAT
-REPLACE_OPEN
-REPLACE_FCNTL
-HAVE_OPENAT
-HAVE_FCNTL
-GNULIB_OPENAT
-GNULIB_OPEN
-GNULIB_FCNTL
-REPLACE_UTIMENSAT
-REPLACE_STAT
-REPLACE_MKNOD
-REPLACE_MKFIFO
-REPLACE_MKDIR
-REPLACE_LSTAT
-REPLACE_FUTIMENS
-REPLACE_FSTATAT
-REPLACE_FSTAT
-HAVE_UTIMENSAT
-HAVE_MKNODAT
-HAVE_MKNOD
-HAVE_MKFIFOAT
-HAVE_MKFIFO
-HAVE_MKDIRAT
-HAVE_LSTAT
-HAVE_LCHMOD
-HAVE_FUTIMENS
-HAVE_FSTATAT
-HAVE_FCHMODAT
-GNULIB_UTIMENSAT
-GNULIB_STAT
-GNULIB_MKNODAT
-GNULIB_MKNOD
-GNULIB_MKFIFOAT
-GNULIB_MKFIFO
-GNULIB_MKDIRAT
-GNULIB_LSTAT
-GNULIB_LCHMOD
-GNULIB_FUTIMENS
-GNULIB_FSTATAT
-GNULIB_FCHMODAT
 EOVERFLOW_VALUE
 EOVERFLOW_HIDDEN
 ENOLINK_VALUE
 ENOLINK_HIDDEN
 EMULTIHOP_VALUE
 EMULTIHOP_HIDDEN
+GL_GENERATE_ERRNO_H_FALSE
+GL_GENERATE_ERRNO_H_TRUE
 ERRNO_H
 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
 NEXT_ERRNO_H
+HAVE_DIRENT_H
 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H
 NEXT_DIRENT_H
+PRAGMA_COLUMNS
 PRAGMA_SYSTEM_HEADER
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE
 INCLUDE_NEXT
-REPLACE_OPENDIR
+pkglibexecdir
+lispdir
 REPLACE_FDOPENDIR
+REPLACE_DIRFD
 REPLACE_CLOSEDIR
+REPLACE_OPENDIR
 HAVE_ALPHASORT
 HAVE_SCANDIR
 HAVE_FDOPENDIR
+HAVE_DECL_FDOPENDIR
 HAVE_DECL_DIRFD
+HAVE_CLOSEDIR
+HAVE_REWINDDIR
+HAVE_READDIR
+HAVE_OPENDIR
 GNULIB_ALPHASORT
 GNULIB_SCANDIR
 GNULIB_FDOPENDIR
 GNULIB_DIRFD
+GNULIB_CLOSEDIR
+GNULIB_REWINDDIR
+GNULIB_READDIR
+GNULIB_OPENDIR
+HAVE_WINSOCK2_H
+HAVE_MSVC_INVALID_PARAMETER_HANDLER
 LIB_CLOCK_GETTIME
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
 UNISTD_H_HAVE_WINSOCK2_H
@@ -1019,50 +1388,67 @@ REPLACE_WRITE
 REPLACE_USLEEP
 REPLACE_UNLINKAT
 REPLACE_UNLINK
+REPLACE_TTYNAME_R
 REPLACE_SYMLINK
 REPLACE_SLEEP
 REPLACE_RMDIR
 REPLACE_READLINK
+REPLACE_READ
+REPLACE_PWRITE
 REPLACE_PREAD
 REPLACE_LSEEK
 REPLACE_LINKAT
 REPLACE_LINK
 REPLACE_LCHOWN
+REPLACE_ISATTY
 REPLACE_GETPAGESIZE
 REPLACE_GETGROUPS
+REPLACE_GETLOGIN_R
+REPLACE_GETDOMAINNAME
 REPLACE_GETCWD
+REPLACE_FTRUNCATE
 REPLACE_FCHOWNAT
-REPLACE_FCHDIR
 REPLACE_DUP2
 REPLACE_DUP
 REPLACE_CLOSE
 REPLACE_CHOWN
-HAVE_USLEEP
-HAVE_UNLINKAT
 HAVE_SYS_PARAM_H
 HAVE_OS_H
+HAVE_DECL_TTYNAME_R
+HAVE_DECL_SETHOSTNAME
+HAVE_DECL_GETUSERSHELL
+HAVE_DECL_GETPAGESIZE
 HAVE_DECL_GETLOGIN_R
+HAVE_DECL_GETDOMAINNAME
+HAVE_DECL_FDATASYNC
+HAVE_DECL_FCHDIR
 HAVE_DECL_ENVIRON
+HAVE_USLEEP
+HAVE_UNLINKAT
 HAVE_SYMLINKAT
 HAVE_SYMLINK
 HAVE_SLEEP
+HAVE_SETHOSTNAME
 HAVE_READLINKAT
 HAVE_READLINK
+HAVE_PWRITE
 HAVE_PREAD
 HAVE_PIPE2
+HAVE_PIPE
 HAVE_LINKAT
 HAVE_LINK
 HAVE_LCHOWN
-HAVE_GETUSERSHELL
+HAVE_GROUP_MEMBER
 HAVE_GETPAGESIZE
 HAVE_GETLOGIN
 HAVE_GETHOSTNAME
 HAVE_GETGROUPS
 HAVE_GETDTABLESIZE
-HAVE_GETDOMAINNAME
 HAVE_FTRUNCATE
 HAVE_FSYNC
+HAVE_FDATASYNC
 HAVE_FCHOWNAT
+HAVE_FCHDIR
 HAVE_FACCESSAT
 HAVE_EUIDACCESS
 HAVE_DUP3
@@ -1073,19 +1459,26 @@ GNULIB_USLEEP
 GNULIB_UNLINKAT
 GNULIB_UNLINK
 GNULIB_UNISTD_H_SIGPIPE
-GNULIB_UNISTD_H_GETOPT
+GNULIB_UNISTD_H_NONBLOCKING
+GNULIB_TTYNAME_R
 GNULIB_SYMLINKAT
 GNULIB_SYMLINK
 GNULIB_SLEEP
+GNULIB_SETHOSTNAME
 GNULIB_RMDIR
 GNULIB_READLINKAT
 GNULIB_READLINK
+GNULIB_READ
+GNULIB_PWRITE
 GNULIB_PREAD
 GNULIB_PIPE2
+GNULIB_PIPE
 GNULIB_LSEEK
 GNULIB_LINKAT
 GNULIB_LINK
 GNULIB_LCHOWN
+GNULIB_ISATTY
+GNULIB_GROUP_MEMBER
 GNULIB_GETUSERSHELL
 GNULIB_GETPAGESIZE
 GNULIB_GETLOGIN_R
@@ -1097,6 +1490,7 @@ GNULIB_GETDOMAINNAME
 GNULIB_GETCWD
 GNULIB_FTRUNCATE
 GNULIB_FSYNC
+GNULIB_FDATASYNC
 GNULIB_FCHOWNAT
 GNULIB_FCHDIR
 GNULIB_FACCESSAT
@@ -1104,36 +1498,56 @@ GNULIB_EUIDACCESS
 GNULIB_ENVIRON
 GNULIB_DUP3
 GNULIB_DUP2
+GNULIB_DUP
 GNULIB_CLOSE
 GNULIB_CHOWN
+GNULIB_CHDIR
+REPLACE_WCTOMB
 REPLACE_UNSETENV
 REPLACE_STRTOD
 REPLACE_SETENV
 REPLACE_REALPATH
+REPLACE_REALLOC
+REPLACE_RANDOM_R
 REPLACE_PUTENV
+REPLACE_PTSNAME_R
 REPLACE_MKSTEMP
+REPLACE_MBTOWC
+REPLACE_MALLOC
 REPLACE_CANONICALIZE_FILE_NAME
-HAVE_UNSETENV
+REPLACE_CALLOC
+HAVE_DECL_UNSETENV
+HAVE_UNLOCKPT
 HAVE_SYS_LOADAVG_H
 HAVE_STRUCT_RANDOM_DATA
 HAVE_STRTOULL
 HAVE_STRTOLL
 HAVE_STRTOD
+HAVE_DECL_SETENV
 HAVE_SETENV
 HAVE_RPMATCH
 HAVE_REALPATH
-HAVE_REALLOC_POSIX
 HAVE_RANDOM_R
+HAVE_RANDOM_H
+HAVE_RANDOM
+HAVE_PTSNAME_R
+HAVE_PTSNAME
+HAVE_POSIX_OPENPT
 HAVE_MKSTEMPS
+HAVE_MKSTEMP
 HAVE_MKOSTEMPS
 HAVE_MKOSTEMP
 HAVE_MKDTEMP
-HAVE_MALLOC_POSIX
+HAVE_GRANTPT
 HAVE_GETSUBOPT
 HAVE_DECL_GETLOADAVG
 HAVE_CANONICALIZE_FILE_NAME
 HAVE_ATOLL
+HAVE__EXIT
+GNULIB_WCTOMB
 GNULIB_UNSETENV
+GNULIB_UNLOCKPT
+GNULIB_SYSTEM_POSIX
 GNULIB_STRTOULL
 GNULIB_STRTOLL
 GNULIB_STRTOD
@@ -1142,25 +1556,31 @@ GNULIB_RPMATCH
 GNULIB_REALPATH
 GNULIB_REALLOC_POSIX
 GNULIB_RANDOM_R
+GNULIB_RANDOM
 GNULIB_PUTENV
+GNULIB_PTSNAME_R
+GNULIB_PTSNAME
+GNULIB_POSIX_OPENPT
 GNULIB_MKSTEMPS
 GNULIB_MKSTEMP
 GNULIB_MKOSTEMPS
 GNULIB_MKOSTEMP
 GNULIB_MKDTEMP
+GNULIB_MBTOWC
 GNULIB_MALLOC_POSIX
+GNULIB_GRANTPT
 GNULIB_GETSUBOPT
 GNULIB_GETLOADAVG
 GNULIB_CANONICALIZE_FILE_NAME
 GNULIB_CALLOC_POSIX
 GNULIB_ATOLL
-HAVE_CALLOC_POSIX
+GNULIB__EXIT
+GL_GENERATE_ALLOCA_H_FALSE
+GL_GENERATE_ALLOCA_H_TRUE
 ALLOCA_H
 ALLOCA
 GL_COND_LIBTOOL_FALSE
 GL_COND_LIBTOOL_TRUE
-EGREP
-GREP
 host_os
 host_vendor
 host_cpu
@@ -1169,6 +1589,10 @@ build_os
 build_vendor
 build_cpu
 build
+ARFLAGS
+AR
+EGREP
+GREP
 RANLIB
 LN_S
 NM
@@ -1176,6 +1600,7 @@ CPP
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
+am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
@@ -1191,13 +1616,14 @@ CFLAGS
 CC
 AM_BACKSLASH
 AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
 am__untar
 am__tar
 AMTAR
 am__leading_dot
 SET_MAKE
 AWK
-mkdir_p
 MKDIR_P
 INSTALL_STRIP_PROGRAM
 STRIP
@@ -1258,6 +1684,10 @@ enable_option_checking
 enable_silent_rules
 enable_dependency_tracking
 enable_largefile
+enable_threads
+with_gnu_ld
+enable_rpath
+with_libpth_prefix
 enable_gcc_warnings
 '
       ac_precious_vars='build_alias
@@ -1331,8 +1761,9 @@ do
   fi
 
   case $ac_option in
-  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *)   ac_optarg=yes ;;
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
   esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
@@ -1377,7 +1808,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1403,7 +1834,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1607,7 +2038,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1623,7 +2054,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1653,8 +2084,8 @@ do
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) as_fn_error "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information."
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
   *=*)
@@ -1662,7 +2093,7 @@ Try \`$0 --help' for more information."
     # Reject names that are not valid shell variable names.
     case $ac_envvar in #(
       '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
     esac
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
@@ -1672,7 +2103,7 @@ Try \`$0 --help' for more information."
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1680,13 +2111,13 @@ done
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error "missing argument to $ac_option"
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
@@ -1709,7 +2140,7 @@ do
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1723,8 +2154,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1739,9 +2168,9 @@ test "$silent" = yes && exec 6>/dev/null
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error "working directory cannot be determined"
+  as_fn_error $? "working directory cannot be determined"
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error "pwd does not report name of working directory"
+  as_fn_error $? "pwd does not report name of working directory"
 
 
 # Find the source files, if location was not specified.
@@ -1780,11 +2209,11 @@ else
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
        pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1810,7 +2239,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures gzip 1.4 to adapt to many kinds of systems.
+\`configure' configures gzip 1.5 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1824,7 +2253,7 @@ Configuration:
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
+  -q, --quiet, --silent   do not print \`checking ...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
@@ -1880,7 +2309,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of gzip 1.4:";;
+     short | recursive ) echo "Configuration of gzip 1.5:";;
    esac
   cat <<\_ACEOF
 
@@ -1888,13 +2317,26 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-silent-rules          less verbose build output (undo: `make V=1')
-  --disable-silent-rules         verbose build output (undo: `make V=0')
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
   --disable-largefile     omit support for large files
+  --enable-threads={posix|solaris|pth|windows}
+                          specify multithreading API
+  --disable-threads       build without multithread safety
+  --disable-rpath         do not hardcode runtime library paths
   --enable-gcc-warnings   turn on lots of GCC warnings (for developers)
 
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gnu-ld           assume the C compiler uses GNU ld default=no
+  --with-libpth-prefix[=DIR]  search for libpth in DIR/include and DIR/lib
+  --without-libpth-prefix     don't search for libpth in includedir and libdir
+
 Some influential environment variables:
   CC          C compiler command
   CFLAGS      C compiler flags
@@ -1971,10 +2413,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-gzip configure 1.4
-generated by GNU Autoconf 2.65.23-13e35
+gzip configure 1.5
+generated by GNU Autoconf 2.69.4-560f
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -2018,7 +2460,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
        ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -2044,7 +2486,7 @@ $as_echo "$ac_try_echo"; } >&5
     mv -f conftest.er1 conftest.err
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } >/dev/null && {
+  test $ac_status = 0; } > conftest.i && {
         test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
        }; then :
@@ -2055,7 +2497,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -2068,10 +2510,10 @@ fi
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  if eval \${$3+:} false; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -2107,7 +2549,7 @@ if ac_fn_c_try_cpp "$LINENO"; then :
 else
   ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
 $as_echo "$ac_header_preproc" >&6; }
 
@@ -2130,17 +2572,15 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( cat <<\_ASBOX
-## ------------------------------- ##
+( $as_echo "## ------------------------------- ##
 ## Report this to bug-gzip@gnu.org ##
-## ------------------------------- ##
-_ASBOX
+## ------------------------------- ##"
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -2149,7 +2589,7 @@ eval ac_res=\$$3
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_mongrel
 
@@ -2190,7 +2630,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -2204,7 +2644,7 @@ ac_fn_c_check_header_compile ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2222,7 +2662,7 @@ fi
 eval ac_res=\$$3
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
 
@@ -2253,7 +2693,7 @@ $as_echo "$ac_try_echo"; } >&5
         test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
         test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
+        test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -2267,11 +2707,65 @@ fi
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
 
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+        return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+           return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
 # ac_fn_c_check_func LINENO FUNC VAR
 # ----------------------------------
 # Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -2280,7 +2774,7 @@ ac_fn_c_check_func ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2335,64 +2829,10 @@ fi
 eval ac_res=\$$3
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_func
 
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=no"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof ($2))
-        return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
-           return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_c_check_type
-
 # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
 # ---------------------------------------------
 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
@@ -2400,9 +2840,11 @@ $as_echo "$ac_res" >&6; }
 ac_fn_c_check_decl ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
-$as_echo_n "checking whether $2 is declared... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2411,8 +2853,12 @@ $4
 int
 main ()
 {
-#ifndef $2
-  (void) $2;
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
 #endif
 
   ;
@@ -2429,7 +2875,7 @@ fi
 eval ac_res=\$$3
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_decl
 
@@ -2450,7 +2896,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2466,7 +2913,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2492,7 +2940,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2508,7 +2957,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2542,7 +2992,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2606,7 +3057,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
 rm -f conftest.val
 
   fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_compute_int
@@ -2620,7 +3071,7 @@ ac_fn_c_check_member ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
 $as_echo_n "checking for $2.$3... " >&6; }
-if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$4+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2664,15 +3115,15 @@ fi
 eval ac_res=\$$4
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_member
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by gzip $as_me 1.4, which was
-generated by GNU Autoconf 2.65.23-13e35.  Invocation command line was
+It was created by gzip $as_me 1.5, which was
+generated by GNU Autoconf 2.69.4-560f.  Invocation command line was
 
   $ $0 $@
 
@@ -2782,11 +3233,9 @@ trap 'exit_status=$?
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
 (
@@ -2820,11 +3269,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
 )
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
@@ -2837,11 +3284,9 @@ _ASBOX
     echo
 
     if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------------- ##
+      $as_echo "## ------------------- ##
 ## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
       echo
       for ac_var in $ac_subst_files
       do
@@ -2855,11 +3300,9 @@ _ASBOX
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
       cat confdefs.h
       echo
@@ -2914,7 +3357,12 @@ _ACEOF
 ac_site_file1=NONE
 ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  ac_site_file1=$CONFIG_SITE
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
 elif test "x$prefix" != xNONE; then
   ac_site_file1=$prefix/share/config.site
   ac_site_file2=$prefix/etc/config.site
@@ -2929,7 +3377,11 @@ do
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -2950,45 +3402,46 @@ $as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
-as_fn_append ac_func_list " chown"
-as_fn_append ac_func_list " fchown"
-as_fn_append ac_header_list " dirent.h"
-as_fn_append ac_func_list " dup2"
-as_fn_append ac_header_list " errno.h"
+as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_header_list " sys/param.h"
+as_fn_append ac_func_list " _set_invalid_parameter_handler"
+as_fn_append ac_header_list " sys/socket.h"
 as_fn_append ac_func_list " fchdir"
-as_fn_append ac_func_list " fcntl"
-as_fn_append ac_header_list " fcntl.h"
+as_fn_append ac_header_list " dirent.h"
 as_fn_append ac_func_list " fdopendir"
-as_fn_append ac_header_list " float.h"
+as_fn_append ac_func_list " fcntl"
+as_fn_append ac_func_list " symlink"
+as_fn_append ac_func_list " mempcpy"
 as_fn_append ac_header_list " stdio_ext.h"
 as_fn_append ac_func_list " __fpending"
 as_fn_append ac_func_list " vasnprintf"
+as_fn_append ac_header_list " features.h"
+as_fn_append ac_func_list " snprintf"
 as_fn_append ac_func_list " fpurge"
 as_fn_append ac_func_list " __fpurge"
 as_fn_append ac_func_list " __freading"
+as_fn_append ac_func_list " alarm"
+as_fn_append ac_header_list " sys/stat.h"
+as_fn_append ac_func_list " getdtablesize"
 gl_getopt_required=GNU
 as_fn_append ac_header_list " getopt.h"
 as_fn_append ac_func_list " gettimeofday"
 as_fn_append ac_func_list " nanotime"
 as_fn_append ac_header_list " sys/time.h"
-as_fn_append ac_func_list " lchmod"
 as_fn_append ac_func_list " lstat"
 as_fn_append ac_header_list " math.h"
 as_fn_append ac_func_list " mbsinit"
 as_fn_append ac_func_list " mbrtowc"
 as_fn_append ac_header_list " sys/mman.h"
 as_fn_append ac_func_list " mprotect"
-as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_func_list " openat"
+as_fn_append ac_func_list " strerror_r"
+as_fn_append ac_func_list " __xpg_strerror_r"
 gl_printf_safe=yes
-as_fn_append ac_header_list " stddef.h"
-as_fn_append ac_header_list " stdint.h"
 as_fn_append ac_header_list " wchar.h"
-as_fn_append ac_header_list " stdio.h"
-as_fn_append ac_header_list " stdlib.h"
-as_fn_append ac_header_list " sys/socket.h"
-as_fn_append ac_header_list " string.h"
-as_fn_append ac_header_list " sys/stat.h"
-as_fn_append ac_header_list " time.h"
+as_fn_append ac_header_list " stdint.h"
+as_fn_append ac_func_list " strdup"
+as_fn_append ac_func_list " catgets"
 as_fn_append ac_func_list " pipe"
 as_fn_append ac_header_list " utime.h"
 as_fn_append ac_func_list " futimes"
@@ -2998,9 +3451,13 @@ as_fn_append ac_func_list " utimensat"
 as_fn_append ac_func_list " lutimes"
 as_fn_append ac_func_list " iswcntrl"
 as_fn_append ac_header_list " wctype.h"
+as_fn_append ac_header_list " fcntl.h"
 as_fn_append ac_header_list " limits.h"
 as_fn_append ac_header_list " memory.h"
+as_fn_append ac_header_list " time.h"
+as_fn_append ac_func_list " chown"
 as_fn_append ac_func_list " fchmod"
+as_fn_append ac_func_list " fchown"
 as_fn_append ac_func_list " siginterrupt"
 # Check that the precious variables saved in the cache have kept the same
 # value.
@@ -3057,7 +3514,7 @@ if $ac_cache_corrupted; then
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
   { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
 fi
 ## -------------------- ##
 ## Main body of script. ##
@@ -3089,7 +3546,7 @@ for ac_dir in build-aux "$srcdir"/build-aux; do
   fi
 done
 if test -z "$ac_aux_dir"; then
-  as_fn_error "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -3103,7 +3560,7 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin"
 
-am__api_version='1.11a'
+am__api_version='1.12a'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -3122,7 +3579,7 @@ am__api_version='1.11a'
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3142,7 +3599,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
          if test $ac_prog = install &&
            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # AIX install.  It has an incompatible calling convention.
@@ -3206,27 +3663,27 @@ am_lf='
 '
 case `pwd` in
   *[\\\"\#\$\&\'\`$am_lf]*)
-    as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
-    as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
+   am_has_slept=no
    for am_try in 1 2; do
-     echo timestamp > conftest.file
+     echo "timestamp, slept: $am_has_slept" > conftest.file
      set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
      if test "$*" = "X"; then
        # -L didn't work.
        set X `ls -t "$srcdir/configure" conftest.file`
      fi
-     rm -f conftest.file
      if test "$*" != "X $srcdir/configure conftest.file" \
        && test "$*" != "X conftest.file $srcdir/configure"; then
 
@@ -3234,7 +3691,7 @@ if (
        # if, for instance, CONFIG_SHELL is bash and it inherits a
        # broken ls alias from the environment.  This has actually
        # happened.  Such a system could not be considered "sane".
-       as_fn_error "ls -t appears to fail.  Make sure there is not a broken
+       as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
   alias in your environment" "$LINENO" 5
      fi
      if test "$2" = conftest.file || test $am_try -eq 2; then
@@ -3242,6 +3699,7 @@ if (
      fi
      # Just in case.
      sleep 1
+     am_has_slept=yes
    done
    test "$2" = conftest.file
    )
@@ -3249,11 +3707,21 @@ then
    # Ok.
    :
 else
-   as_fn_error "newly created file is older than distributed files!
+   as_fn_error $? "newly created file is older than distributed files!
 Check your system clock" "$LINENO" 5
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
@@ -3280,8 +3748,8 @@ if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
 if test x"${install_sh}" != xset; then
@@ -3293,17 +3761,17 @@ if test x"${install_sh}" != xset; then
   esac
 fi
 
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
+# will honor the 'STRIP' environment variable to overrule this program.
 if test "$cross_compiling" != no; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then :
+if ${ac_cv_prog_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$STRIP"; then
@@ -3315,7 +3783,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3343,7 +3811,7 @@ if test -z "$ac_cv_prog_STRIP"; then
 set dummy strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
@@ -3355,7 +3823,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3396,7 +3864,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
-  if test "${ac_cv_path_mkdir+set}" = set; then :
+  if ${ac_cv_path_mkdir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -3406,7 +3874,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_prog in mkdir gmkdir; do
         for ac_exec_ext in '' $ac_executable_extensions; do
-          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
           case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
             'mkdir (GNU coreutils) '* | \
             'mkdir (coreutils) '* | \
@@ -3435,11 +3903,6 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
 $as_echo "$MKDIR_P" >&6; }
 
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
-  [\\/$]* | ?:[\\/]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
 
 for ac_prog in gawk mawk nawk awk
 do
@@ -3447,7 +3910,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then :
+if ${ac_cv_prog_AWK+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
@@ -3459,7 +3922,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3487,7 +3950,7 @@ done
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -3495,7 +3958,7 @@ SHELL = /bin/sh
 all:
        @echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
 case `${MAKE-make} -f conftest.make 2>/dev/null` in
   *@@@%%%=?*=@@@%%%*)
     eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -3523,13 +3986,52 @@ else
 fi
 rmdir .tst 2>/dev/null
 
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
   # is not polluted with repeated "-I."
   am__isrc=' -I$(srcdir)'
   # test to see if srcdir already configured
   if test -f $srcdir/config.status; then
-    as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
   fi
 fi
 
@@ -3544,8 +4046,9 @@ fi
 
 
 # Define the identity of the package.
+
  PACKAGE='gzip'
- VERSION='1.4'
+ VERSION='1.5'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3575,11 +4078,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
 
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
@@ -3590,11 +4093,38 @@ if test "${enable_silent_rules+set}" = set; then :
   enableval=$enable_silent_rules;
 fi
 
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no)  AM_DEFAULT_VERBOSITY=1;;
-*)   AM_DEFAULT_VERBOSITY=0;;
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=0;;
 esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
 AM_BACKSLASH='\'
  # make --enable-silent-rules the default.
 
@@ -3617,7 +4147,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
 case `$am_make -s -f confmf 2> /dev/null` in #(
 *the\ am__doit\ target*)
   am__include=include
@@ -3650,6 +4180,7 @@ fi
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
  if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
@@ -3670,7 +4201,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3682,7 +4213,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3710,7 +4241,7 @@ if test -z "$ac_cv_prog_CC"; then
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3722,7 +4253,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3763,7 +4294,7 @@ if test -z "$CC"; then
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3775,7 +4306,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3803,7 +4334,7 @@ if test -z "$CC"; then
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3816,7 +4347,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -3862,7 +4393,7 @@ if test -z "$CC"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3874,7 +4405,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3906,7 +4437,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3918,7 +4449,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3960,8 +4491,8 @@ fi
 
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "no acceptable C compiler found in \$PATH
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -4075,9 +4606,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ as_fn_set_status 77
-as_fn_error "C compiler cannot create executables
-See \`config.log' for more details." "$LINENO" 5; }; }
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -4119,8 +4649,8 @@ done
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -4177,9 +4707,9 @@ $as_echo "$ac_try_echo"; } >&5
     else
        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run C compiled programs.
+as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -4190,7 +4720,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4230,8 +4760,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -4241,7 +4771,7 @@ OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4278,7 +4808,7 @@ ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -4356,7 +4886,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -4365,8 +4895,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4455,15 +4984,16 @@ depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4497,16 +5027,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -4515,16 +5045,16 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # 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
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -4584,7 +5114,7 @@ fi
   *) :
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
-if test "${ac_cv_prog_cc_c99+set}" = set; then :
+if ${ac_cv_prog_cc_c99+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c99=no
@@ -4728,7 +5258,7 @@ main ()
   return 0;
 }
 _ACEOF
-for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
 do
   CC="$ac_save_CC $ac_arg"
   if ac_fn_c_try_compile "$LINENO"; then :
@@ -4759,7 +5289,7 @@ if test "x$ac_cv_prog_cc_c99" != xno; then :
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -4768,8 +5298,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4855,7 +5384,7 @@ fi
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5
 $as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; }
-  if test "${ac_cv_prog_cc_stdc+set}" = set; then :
+  if ${ac_cv_prog_cc_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 
@@ -4880,7 +5409,7 @@ $as_echo_n "checking whether cc understands -c and -o together... " >&6; }
 fi
 set dummy $CC; ac_cc=`$as_echo "$2" |
                      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5009,7 +5538,7 @@ if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -5039,7 +5568,7 @@ else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
@@ -5055,11 +5584,11 @@ else
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
   break
 fi
@@ -5098,7 +5627,7 @@ else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
@@ -5114,18 +5643,18 @@ else
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
 
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -5139,7 +5668,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}nm; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_NM+set}" = set; then :
+if ${ac_cv_prog_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
@@ -5151,7 +5680,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_NM="${ac_tool_prefix}nm"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5179,7 +5708,7 @@ if test -z "$ac_cv_prog_NM"; then
 set dummy nm; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_NM+set}" = set; then :
+if ${ac_cv_prog_ac_ct_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_NM"; then
@@ -5191,7 +5720,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_NM="nm"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5242,7 +5771,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then :
+if ${ac_cv_prog_RANLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
@@ -5254,7 +5783,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5282,7 +5811,7 @@ if test -z "$ac_cv_prog_RANLIB"; then
 set dummy ranlib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
@@ -5294,7 +5823,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5331,56 +5860,56 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a POSIX-compliant shell" >&5
 $as_echo_n "checking for a POSIX-compliant shell... " >&6; }
-   if test "${ac_cv_path_shell+set}" = set; then :
+   if ${ac_cv_path_shell+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_command='
-       # Test the noclobber option, using the portable POSIX.2 syntax.
-       set -C
-       rm -f conftest.c
-       >conftest.c || exit
-       >|conftest.c || exit
-       !>conftest.c || exit
-       # Test that $(...) works.
-       test "$(expr 3 + 4)" -eq 7 || exit
+        # Test the noclobber option, using the portable POSIX.2 syntax.
+        set -C
+        rm -f conftest.c
+        >conftest.c || exit
+        >|conftest.c || exit
+        !>conftest.c || exit
+        # Test that $(...) works.
+        test "$(expr 3 + 4)" -eq 7 || exit
       '
       ac_cv_path_shell=no
 
       case $SHELL in
       (/*)
-       rm -f conftest.c
-       if ("$SHELL" -c "$ac_command") 2>/dev/null; then
-         ac_cv_path_shell=$SHELL
-       fi
+        rm -f conftest.c
+        if ("$SHELL" -c "$ac_command") 2>/dev/null; then
+          ac_cv_path_shell=$SHELL
+        fi
       esac
 
       case $ac_cv_path_shell in
       (no)
-       # Prefer shells that are more likely to be installed in the
-       # same place on all hosts of this platform.  Therefore, prefer
-       # shells in /bin and /usr/bin to shells in the installer's
-       # PATH.  Also, loop through PATH first and then through
-       # shells, since less-"nice" shells in /bin and /usr/bin are
-       # more likely to be installed than "nicer" shells elsewhere.
-       as_save_IFS=$IFS; IFS=:
-       for as_dir in /bin /usr/bin $PATH
-       do
-         IFS=$as_save_IFS
-         case $as_dir in
-         (/*)
-           for ac_base in sh bash ksh sh5; do
-             rm -f conftest.c
-             if ("$as_dir/$ac_base" -c "$ac_command") 2>/dev/null; then
-               ac_cv_path_shell=$as_dir/$ac_base
-               break
-             fi
-           done
-           case $ac_cv_path_shell in
-           (/*) break
-           esac
-         esac
-       done
-       rm -f conftest.c
+        # Prefer shells that are more likely to be installed in the
+        # same place on all hosts of this platform.  Therefore, prefer
+        # shells in /bin and /usr/bin to shells in the installer's
+        # PATH.  Also, loop through PATH first and then through
+        # shells, since less-"nice" shells in /bin and /usr/bin are
+        # more likely to be installed than "nicer" shells elsewhere.
+        as_save_IFS=$IFS; IFS=:
+        for as_dir in /bin /usr/bin $PATH
+        do
+          IFS=$as_save_IFS
+          case $as_dir in
+          (/*)
+            for ac_base in sh bash ksh sh5; do
+              rm -f conftest.c
+              if ("$as_dir/$ac_base" -c "$ac_command") 2>/dev/null; then
+                ac_cv_path_shell=$as_dir/$ac_base
+                break
+              fi
+            done
+            case $ac_cv_path_shell in
+            (/*) break
+            esac
+          esac
+        done
+        rm -f conftest.c
       esac
 fi
 
@@ -5394,82 +5923,11 @@ $as_echo "$as_me: WARNING: using $SHELL, even though it does not conform to POSI
    fi
 
 
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
-  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
-  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$host_alias" = x; then
-  ac_cv_host=$ac_cv_build
-else
-  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -5483,7 +5941,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -5518,7 +5976,7 @@ esac
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_GREP"; then
-    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_GREP=$GREP
@@ -5532,7 +5990,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -5549,7 +6007,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -5584,7 +6042,7 @@ esac
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_EGREP=$EGREP
@@ -5597,178 +6055,327 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
+$as_echo_n "checking for Minix Amsterdam compiler... " >&6; }
+if ${gl_cv_c_amsterdam_compiler+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <string.h>
+
+#ifdef __ACK__
+Amsterdam
+#endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
+  $EGREP "Amsterdam" >/dev/null 2>&1; then :
+  gl_cv_c_amsterdam_compiler=yes
 else
-  ac_cv_header_stdc=no
+  gl_cv_c_amsterdam_compiler=no
 fi
 rm -f conftest*
 
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
 
-else
-  ac_cv_header_stdc=no
 fi
-rm -f conftest*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
+$as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
+  if test -z "$AR"; then
+    if test $gl_cv_c_amsterdam_compiler = yes; then
+      AR='cc -c.a'
+      if test -z "$ARFLAGS"; then
+        ARFLAGS='-o'
+      fi
+    else
+                  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
 fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                  (('a' <= (c) && (c) <= 'i') \
-                    || ('j' <= (c) && (c) <= 'r') \
-                    || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-       || toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
 
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_header_stdc=no
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR="ar"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
 
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+      if test -z "$ARFLAGS"; then
+        ARFLAGS='cru'
+      fi
+    fi
+  else
+    if test -z "$ARFLAGS"; then
+      ARFLAGS='cru'
+    fi
+  fi
 
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                 inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
 
+  if test -z "$RANLIB"; then
+    if test $gl_cv_c_amsterdam_compiler = yes; then
+      RANLIB=':'
+    else
+            if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
+  done
+IFS=$as_save_IFS
 
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-
-  ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = x""yes; then :
-  MINIX=yes
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
 else
-  MINIX=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
 
-  if test "$MINIX" = yes; then
-
-$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
-
+    fi
+  fi
 
-$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
 
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
 
-$as_echo "#define _MINIX 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
 
-  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
-        case "$host_os" in
-    hpux*)
 
-$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
 
-      ;;
-  esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
-$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 
-#         define __EXTENSIONS__ 1
-          $ac_includes_default
 int
 main ()
 {
@@ -5778,53 +6385,214 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_safe_to_define___extensions__=yes
+  ac_cv_header_stdc=yes
 else
-  ac_cv_safe_to_define___extensions__=no
+  ac_cv_header_stdc=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
-$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
-  test $ac_cv_safe_to_define___extensions__ = yes &&
-    $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
-
-  $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
-
-  $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
-
-  $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
 
-  $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
 
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
+fi
 
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
 
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
+fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
-$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_source+set}" = set; then :
-  $as_echo_n "(cached) " >&6
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
 else
-  while :; do
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h> /* for off_t */
-     #include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 int
 main ()
 {
-int (*fp) (FILE *, off_t, int) = fseeko;
-     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
-  ;
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_sys_largefile_source=no; break
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+  ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
+  MINIX=yes
+else
+  MINIX=
+fi
+
+
+  if test "$MINIX" = yes; then
+
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+$as_echo "#define _MINIX 1" >>confdefs.h
+
+  fi
+
+        case "$host_os" in
+    hpux*)
+
+$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
+
+      ;;
+  esac
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#         define __EXTENSIONS__ 1
+          $ac_includes_default
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_safe_to_define___extensions__=yes
+else
+  ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+  test $ac_cv_safe_to_define___extensions__ = yes &&
+    $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+  $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+  $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_source+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h> /* for off_t */
+     #include <stdio.h>
+int
+main ()
+{
+int (*fp) (FILE *, off_t, int) = fseeko;
+     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_sys_largefile_source=no; break
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
@@ -5885,9 +6653,11 @@ fi
       # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM>
       if test -n "$GCC"; then
         # GCC has the option -mieee.
+        # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
         CPPFLAGS="$CPPFLAGS -mieee"
       else
-        # Compaq (ex-DEC) C has the option -ieee.
+        # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
+        # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
         CPPFLAGS="$CPPFLAGS -ieee"
       fi
       ;;
@@ -5899,14 +6669,6 @@ fi
       ;;
   esac
 
-
-
-
-
-
-
-
-
 # Check whether --enable-largefile was given.
 if test "${enable_largefile+set}" = set; then :
   enableval=$enable_largefile;
@@ -5916,7 +6678,7 @@ if test "$enable_largefile" != no; then
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_CC+set}" = set; then :
+if ${ac_cv_sys_largefile_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_sys_largefile_CC=no
@@ -5967,7 +6729,7 @@ $as_echo "$ac_cv_sys_largefile_CC" >&6; }
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
+if ${ac_cv_sys_file_offset_bits+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
@@ -6036,7 +6798,7 @@ rm -rf conftest*
   if test $ac_cv_sys_file_offset_bits = unknown; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if test "${ac_cv_sys_large_files+set}" = set; then :
+if ${ac_cv_sys_large_files+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
@@ -6103,19 +6865,260 @@ _ACEOF
 esac
 rm -rf conftest*
   fi
+
+
+fi
+
+
+
+
+
+
+  # Check whether --enable-threads was given.
+if test "${enable_threads+set}" = set; then :
+  enableval=$enable_threads; gl_use_threads=$enableval
+else
+  if test -n "$gl_use_threads_default"; then
+       gl_use_threads="$gl_use_threads_default"
+     else
+       case "$host_os" in
+                                                               osf*) gl_use_threads=no ;;
+         cygwin*)
+               case `uname -r` in
+                 1.[0-5].*) gl_use_threads=no ;;
+                 *)         gl_use_threads=yes ;;
+               esac
+               ;;
+         *)    gl_use_threads=yes ;;
+       esac
+     fi
+
 fi
 
+  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+    # For using <pthread.h>:
+    case "$host_os" in
+      osf*)
+        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+        # groks <pthread.h>. cc also understands the flag -pthread, but
+        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+        # 2. putting a flag into CPPFLAGS that has an effect on the linker
+        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
+        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+        ;;
+    esac
+    # Some systems optimize for single-threaded programs by default, and
+    # need special flags to disable these optimizations. For example, the
+    # definition of 'errno' in <errno.h>.
+    case "$host_os" in
+      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+    esac
+  fi
 
 
 
 
+  # Code from module alloca-opt:
+  # Code from module announce-gen:
+  # Code from module at-internal:
+  # Code from module c-ctype:
+  # Code from module c-strcase:
+  # Code from module c-strcaseeq:
+  # Code from module calloc:
+  # Code from module calloc-gnu:
+  # Code from module calloc-posix:
+  # Code from module chdir:
+  # Code from module chdir-long:
+  # Code from module clock-time:
+  # Code from module cloexec:
+  # Code from module close:
+  # Code from module close-stream:
+  # Code from module closedir:
+  # Code from module closein:
+  # Code from module closeout:
+  # Code from module configmake:
+  # Code from module dirent:
+  # Code from module dirent-safer:
+  # Code from module dirfd:
+  # Code from module dirname-lgpl:
+  # Code from module do-release-commit-and-tag:
+  # Code from module dosname:
+  # Code from module double-slash-root:
+  # Code from module dup:
+  # Code from module dup2:
+  # Code from module errno:
+  # Code from module error:
+  # Code from module exitfail:
+  # Code from module extensions:
+
+  # Code from module fchdir:
+  # Code from module fclose:
+  # Code from module fcntl:
+  # Code from module fcntl-h:
+  # Code from module fcntl-safer:
+  # Code from module fd-hook:
+  # Code from module fdl:
+  # Code from module fdopendir:
+  # Code from module fflush:
+
+  # Code from module filename:
+  # Code from module filenamecat-lgpl:
+  # Code from module float:
+  # Code from module fpending:
+  # Code from module fpieee:
+
+  # Code from module fprintf-posix:
+  # Code from module fpucw:
+  # Code from module fpurge:
+  # Code from module freadahead:
+  # Code from module freading:
+  # Code from module frexp-nolibm:
+  # Code from module frexpl-nolibm:
+  # Code from module fseek:
+  # Code from module fseeko:
+
+  # Code from module fseterr:
+  # Code from module fstat:
+  # Code from module ftell:
+  # Code from module ftello:
+
+  # Code from module gendocs:
+  # Code from module getcwd-lgpl:
+  # Code from module getdtablesize:
+  # Code from module getopt-gnu:
+  # Code from module getopt-posix:
+  # Code from module gettext-h:
+  # Code from module gettime:
+  # Code from module gettimeofday:
+  # Code from module git-version-gen:
+  # Code from module gitlog-to-changelog:
+  # Code from module gnu-make:
+  # Code from module gnu-web-doc-update:
+  # Code from module gnumakefile:
+  # Code from module gnupload:
+  # Code from module havelib:
+  # Code from module ignore-value:
+  # Code from module include_next:
+  # Code from module inline:
+  # Code from module intprops:
+  # Code from module isnand-nolibm:
+  # Code from module isnanf-nolibm:
+  # Code from module isnanl-nolibm:
+  # Code from module largefile:
+
+  # Code from module lib-ignore:
+  # Code from module localcharset:
+  # Code from module lock:
+  # Code from module lseek:
+  # Code from module lstat:
+  # Code from module maintainer-makefile:
+  # Code from module malloc-gnu:
+  # Code from module malloc-posix:
+  # Code from module manywarnings:
+  # Code from module math:
+  # Code from module mbrtowc:
+  # Code from module mbsinit:
+  # Code from module memchr:
+  # Code from module mempcpy:
+  # Code from module memrchr:
+  # Code from module msvc-inval:
+  # Code from module msvc-nothrow:
+  # Code from module multiarch:
+  # Code from module nocrash:
+  # Code from module open:
+  # Code from module openat:
+  # Code from module openat-die:
+  # Code from module openat-h:
+  # Code from module opendir:
+  # Code from module pathmax:
+  # Code from module perror:
+  # Code from module printf-frexp:
+  # Code from module printf-frexpl:
+  # Code from module printf-posix:
+  # Code from module printf-safe:
+  # Code from module quotearg:
+  # Code from module quotearg-simple:
+  # Code from module readdir:
+  # Code from module readme-release:
+  # Code from module realloc-gnu:
+  # Code from module realloc-posix:
+  # Code from module save-cwd:
+  # Code from module savedir:
+  # Code from module signbit:
+  # Code from module size_max:
+  # Code from module snippet/_Noreturn:
+  # Code from module snippet/arg-nonnull:
+  # Code from module snippet/c++defs:
+  # Code from module snippet/unused-parameter:
+  # Code from module snippet/warn-on-use:
+  # Code from module ssize_t:
+  # Code from module stat:
+  # Code from module stat-time:
+  # Code from module stdbool:
+  # Code from module stddef:
+  # Code from module stdint:
+  # Code from module stdio:
+  # Code from module stdlib:
+  # Code from module strdup-posix:
+  # Code from module streq:
+  # Code from module strerror:
+  # Code from module strerror-override:
+  # Code from module strerror_r-posix:
+  # Code from module string:
+  # Code from module sys_stat:
+  # Code from module sys_time:
+  # Code from module sys_types:
+  # Code from module threadlib:
+
+
+
+  # Code from module time:
+  # Code from module timespec:
+  # Code from module unistd:
+  # Code from module unistd-safer:
+  # Code from module update-copyright:
+  # Code from module useless-if-before-free:
+  # Code from module utimens:
+  # Code from module vasnprintf:
+  # Code from module vc-list-files:
+  # Code from module verify:
+  # Code from module vfprintf-posix:
+  # Code from module warnings:
+  # Code from module wchar:
+  # Code from module wctype-h:
+  # Code from module xalloc:
+  # Code from module xalloc-die:
+  # Code from module xalloc-oversized:
+  # Code from module xsize:
+  # Code from module yesno:
+
+
+
+
+
+
+
+          LIBC_FATAL_STDERR_=1
+  export LIBC_FATAL_STDERR_
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
 
+fi
 
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
 $as_echo_n "checking for working alloca.h... " >&6; }
-if test "${ac_cv_working_alloca_h+set}" = set; then :
+if ${ac_cv_working_alloca_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6148,7 +7151,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
 $as_echo_n "checking for alloca... " >&6; }
-if test "${ac_cv_func_alloca_works+set}" = set; then :
+if ${ac_cv_func_alloca_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6167,7 +7170,7 @@ else
  #pragma alloca
 #   else
 #    ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
+void *alloca (size_t);
 #    endif
 #   endif
 #  endif
@@ -6215,7 +7218,7 @@ $as_echo "#define C_ALLOCA 1" >>confdefs.h
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if test "${ac_cv_os_cray+set}" = set; then :
+if ${ac_cv_os_cray+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -6242,8 +7245,7 @@ if test $ac_cv_os_cray = yes; then
   for ac_func in _getb67 GETB67 getb67; do
     as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
 
 cat >>confdefs.h <<_ACEOF
 #define CRAY_STACKSEG_END $ac_func
@@ -6257,7 +7259,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
 $as_echo_n "checking stack direction for C alloca... " >&6; }
-if test "${ac_cv_c_stack_direction+set}" = set; then :
+if ${ac_cv_c_stack_direction+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -6267,23 +7269,20 @@ else
 /* end confdefs.h.  */
 $ac_includes_default
 int
-find_stack_direction ()
+find_stack_direction (int *addr, int depth)
 {
-  static char *addr = 0;
-  auto char dummy;
-  if (addr == 0)
-    {
-      addr = &dummy;
-      return find_stack_direction ();
-    }
-  else
-    return (&dummy > addr) ? 1 : -1;
+  int dir, dummy = 0;
+  if (! addr)
+    addr = &dummy;
+  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+  return dir + dummy;
 }
 
 int
-main ()
+main (int argc, char **argv)
 {
-  return find_stack_direction () < 0;
+  return find_stack_direction (0, argc + !argv + 20) < 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -6305,62 +7304,26 @@ _ACEOF
 
 fi
 
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = x""yes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
-$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
-if test "${gl_cv_func_malloc_posix+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-         choke me
-         #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_malloc_posix=yes
-else
-  gl_cv_func_malloc_posix=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
-$as_echo "$gl_cv_func_malloc_posix" >&6; }
-
 
+  GNULIB__EXIT=0;
   GNULIB_ATOLL=0;
   GNULIB_CALLOC_POSIX=0;
   GNULIB_CANONICALIZE_FILE_NAME=0;
   GNULIB_GETLOADAVG=0;
   GNULIB_GETSUBOPT=0;
+  GNULIB_GRANTPT=0;
   GNULIB_MALLOC_POSIX=0;
+  GNULIB_MBTOWC=0;
   GNULIB_MKDTEMP=0;
   GNULIB_MKOSTEMP=0;
   GNULIB_MKOSTEMPS=0;
   GNULIB_MKSTEMP=0;
   GNULIB_MKSTEMPS=0;
+  GNULIB_POSIX_OPENPT=0;
+  GNULIB_PTSNAME=0;
+  GNULIB_PTSNAME_R=0;
   GNULIB_PUTENV=0;
+  GNULIB_RANDOM=0;
   GNULIB_RANDOM_R=0;
   GNULIB_REALLOC_POSIX=0;
   GNULIB_REALPATH=0;
@@ -6369,81 +7332,90 @@ $as_echo "$gl_cv_func_malloc_posix" >&6; }
   GNULIB_STRTOD=0;
   GNULIB_STRTOLL=0;
   GNULIB_STRTOULL=0;
+  GNULIB_SYSTEM_POSIX=0;
+  GNULIB_UNLOCKPT=0;
   GNULIB_UNSETENV=0;
-    HAVE_ATOLL=1;
-  HAVE_CALLOC_POSIX=1;
+  GNULIB_WCTOMB=0;
+    HAVE__EXIT=1;
+  HAVE_ATOLL=1;
   HAVE_CANONICALIZE_FILE_NAME=1;
   HAVE_DECL_GETLOADAVG=1;
   HAVE_GETSUBOPT=1;
-  HAVE_MALLOC_POSIX=1;
+  HAVE_GRANTPT=1;
   HAVE_MKDTEMP=1;
   HAVE_MKOSTEMP=1;
   HAVE_MKOSTEMPS=1;
+  HAVE_MKSTEMP=1;
   HAVE_MKSTEMPS=1;
+  HAVE_POSIX_OPENPT=1;
+  HAVE_PTSNAME=1;
+  HAVE_PTSNAME_R=1;
+  HAVE_RANDOM=1;
+  HAVE_RANDOM_H=1;
   HAVE_RANDOM_R=1;
-  HAVE_REALLOC_POSIX=1;
   HAVE_REALPATH=1;
   HAVE_RPMATCH=1;
   HAVE_SETENV=1;
+  HAVE_DECL_SETENV=1;
   HAVE_STRTOD=1;
   HAVE_STRTOLL=1;
   HAVE_STRTOULL=1;
   HAVE_STRUCT_RANDOM_DATA=1;
   HAVE_SYS_LOADAVG_H=0;
-  HAVE_UNSETENV=1;
+  HAVE_UNLOCKPT=1;
+  HAVE_DECL_UNSETENV=1;
+  REPLACE_CALLOC=0;
   REPLACE_CANONICALIZE_FILE_NAME=0;
+  REPLACE_MALLOC=0;
+  REPLACE_MBTOWC=0;
   REPLACE_MKSTEMP=0;
+  REPLACE_PTSNAME_R=0;
   REPLACE_PUTENV=0;
+  REPLACE_RANDOM_R=0;
+  REPLACE_REALLOC=0;
   REPLACE_REALPATH=0;
   REPLACE_SETENV=0;
   REPLACE_STRTOD=0;
   REPLACE_UNSETENV=0;
+  REPLACE_WCTOMB=0;
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if test "${ac_cv_c_inline+set}" = set; then :
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
+$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
+if ${gl_cv_func_malloc_posix+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
 
+int
+main ()
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+             choke me
+             #endif
+
+  ;
+  return 0;
+}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_inline=$ac_kw
+  gl_cv_func_malloc_posix=yes
+else
+  gl_cv_func_malloc_posix=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  test "$ac_cv_c_inline" != no && break
-done
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
-  inline | yes) ;;
-  *)
-    case $ac_cv_c_inline in
-      no) ac_val=;;
-      *) ac_val=$ac_cv_c_inline;;
-    esac
-    cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
-    ;;
-esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
+$as_echo "$gl_cv_func_malloc_posix" >&6; }
 
 
+  GNULIB_CHDIR=0;
   GNULIB_CHOWN=0;
   GNULIB_CLOSE=0;
+  GNULIB_DUP=0;
   GNULIB_DUP2=0;
   GNULIB_DUP3=0;
   GNULIB_ENVIRON=0;
@@ -6451,6 +7423,7 @@ esac
   GNULIB_FACCESSAT=0;
   GNULIB_FCHDIR=0;
   GNULIB_FCHOWNAT=0;
+  GNULIB_FDATASYNC=0;
   GNULIB_FSYNC=0;
   GNULIB_FTRUNCATE=0;
   GNULIB_GETCWD=0;
@@ -6462,19 +7435,26 @@ esac
   GNULIB_GETLOGIN_R=0;
   GNULIB_GETPAGESIZE=0;
   GNULIB_GETUSERSHELL=0;
+  GNULIB_GROUP_MEMBER=0;
+  GNULIB_ISATTY=0;
   GNULIB_LCHOWN=0;
   GNULIB_LINK=0;
   GNULIB_LINKAT=0;
   GNULIB_LSEEK=0;
+  GNULIB_PIPE=0;
   GNULIB_PIPE2=0;
   GNULIB_PREAD=0;
+  GNULIB_PWRITE=0;
+  GNULIB_READ=0;
   GNULIB_READLINK=0;
   GNULIB_READLINKAT=0;
   GNULIB_RMDIR=0;
+  GNULIB_SETHOSTNAME=0;
   GNULIB_SLEEP=0;
   GNULIB_SYMLINK=0;
   GNULIB_SYMLINKAT=0;
-  GNULIB_UNISTD_H_GETOPT=0;
+  GNULIB_TTYNAME_R=0;
+  GNULIB_UNISTD_H_NONBLOCKING=0;
   GNULIB_UNISTD_H_SIGPIPE=0;
   GNULIB_UNLINK=0;
   GNULIB_UNLINKAT=0;
@@ -6485,50 +7465,67 @@ esac
   HAVE_DUP3=1;
   HAVE_EUIDACCESS=1;
   HAVE_FACCESSAT=1;
+  HAVE_FCHDIR=1;
   HAVE_FCHOWNAT=1;
+  HAVE_FDATASYNC=1;
   HAVE_FSYNC=1;
   HAVE_FTRUNCATE=1;
-  HAVE_GETDOMAINNAME=1;
   HAVE_GETDTABLESIZE=1;
   HAVE_GETGROUPS=1;
   HAVE_GETHOSTNAME=1;
   HAVE_GETLOGIN=1;
   HAVE_GETPAGESIZE=1;
-  HAVE_GETUSERSHELL=1;
+  HAVE_GROUP_MEMBER=1;
   HAVE_LCHOWN=1;
   HAVE_LINK=1;
   HAVE_LINKAT=1;
+  HAVE_PIPE=1;
   HAVE_PIPE2=1;
   HAVE_PREAD=1;
+  HAVE_PWRITE=1;
   HAVE_READLINK=1;
   HAVE_READLINKAT=1;
+  HAVE_SETHOSTNAME=1;
   HAVE_SLEEP=1;
   HAVE_SYMLINK=1;
   HAVE_SYMLINKAT=1;
+  HAVE_UNLINKAT=1;
+  HAVE_USLEEP=1;
   HAVE_DECL_ENVIRON=1;
+  HAVE_DECL_FCHDIR=1;
+  HAVE_DECL_FDATASYNC=1;
+  HAVE_DECL_GETDOMAINNAME=1;
   HAVE_DECL_GETLOGIN_R=1;
+  HAVE_DECL_GETPAGESIZE=1;
+  HAVE_DECL_GETUSERSHELL=1;
+  HAVE_DECL_SETHOSTNAME=1;
+  HAVE_DECL_TTYNAME_R=1;
   HAVE_OS_H=0;
   HAVE_SYS_PARAM_H=0;
-  HAVE_UNLINKAT=1;
-  HAVE_USLEEP=1;
   REPLACE_CHOWN=0;
   REPLACE_CLOSE=0;
   REPLACE_DUP=0;
   REPLACE_DUP2=0;
-  REPLACE_FCHDIR=0;
   REPLACE_FCHOWNAT=0;
+  REPLACE_FTRUNCATE=0;
   REPLACE_GETCWD=0;
+  REPLACE_GETDOMAINNAME=0;
+  REPLACE_GETLOGIN_R=0;
   REPLACE_GETGROUPS=0;
   REPLACE_GETPAGESIZE=0;
+  REPLACE_ISATTY=0;
   REPLACE_LCHOWN=0;
   REPLACE_LINK=0;
   REPLACE_LINKAT=0;
   REPLACE_LSEEK=0;
   REPLACE_PREAD=0;
+  REPLACE_PWRITE=0;
+  REPLACE_READ=0;
   REPLACE_READLINK=0;
   REPLACE_RMDIR=0;
   REPLACE_SLEEP=0;
   REPLACE_SYMLINK=0;
+  REPLACE_TTYNAME_R=0;
   REPLACE_UNLINK=0;
   REPLACE_UNLINKAT=0;
   REPLACE_USLEEP=0;
@@ -6537,155 +7534,71 @@ esac
   UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
-$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
-if test "${ac_cv_type_uid_t+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "uid_t" >/dev/null 2>&1; then :
-  ac_cv_type_uid_t=yes
-else
-  ac_cv_type_uid_t=no
-fi
-rm -f conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
-$as_echo "$ac_cv_type_uid_t" >&6; }
-if test $ac_cv_type_uid_t = no; then
-
-$as_echo "#define uid_t int" >>confdefs.h
-
 
-$as_echo "#define gid_t int" >>confdefs.h
 
-fi
 
-for ac_header in unistd.h
+  for ac_header in $ac_header_list
 do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = x""yes; then :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 
 done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5
-$as_echo_n "checking for working chown... " >&6; }
-if test "${ac_cv_func_chown_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_chown_works=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-#include <fcntl.h>
-
-int
-main ()
-{
-  char *f = "conftest.chown";
-  struct stat before, after;
-
-  if (creat (f, 0600) < 0)
-    return 1;
-  if (stat (f, &before) < 0)
-    return 1;
-  if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
-    return 1;
-  if (stat (f, &after) < 0)
-    return 1;
-  return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid);
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_chown_works=yes
-else
-  ac_cv_func_chown_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-rm -f conftest.chown
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5
-$as_echo "$ac_cv_func_chown_works" >&6; }
-if test $ac_cv_func_chown_works = yes; then
 
-$as_echo "#define HAVE_CHOWN 1" >>confdefs.h
 
-fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether chown dereferences symlinks" >&5
-$as_echo_n "checking whether chown dereferences symlinks... " >&6; }
-if test "${gl_cv_func_chown_follows_symlink+set}" = set; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-
-      if test "$cross_compiling" = yes; then :
-  gl_cv_func_chown_follows_symlink=yes
-
-else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-
-        int
-        main ()
-        {
-          char const *dangling_symlink = "conftest.dangle";
-
-          unlink (dangling_symlink);
-          if (symlink ("conftest.no-such", dangling_symlink))
-            abort ();
-
-          /* Exit successfully on a conforming system,
-             i.e., where chown must fail with ENOENT.  */
-          exit ( ! (chown (dangling_symlink, getuid (), getgid ()) != 0
-                    && errno == ENOENT));
-        }
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
 
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_chown_follows_symlink=yes
-else
-  gl_cv_func_chown_follows_symlink=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_inline=$ac_kw
 fi
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+done
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_chown_follows_symlink" >&5
-$as_echo "$gl_cv_func_chown_follows_symlink" >&6; }
-
-  if test $gl_cv_func_chown_follows_symlink = no; then
-
-$as_echo "#define CHOWN_MODIFIES_SYMLINK 1" >>confdefs.h
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
 
-  fi
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
+esac
 
 
 
@@ -6694,8 +7607,7 @@ $as_echo "#define CHOWN_MODIFIES_SYMLINK 1" >>confdefs.h
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -6707,207 +7619,48 @@ done
 
 
 
+  if test $ac_cv_func__set_invalid_parameter_handler = yes; then
+    HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
 
-
-
-
-
-
-
-    if test $ac_cv_func_chown = no; then
-    HAVE_CHOWN=0
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS chown.$ac_objext"
+$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
 
   else
-        if test $gl_cv_func_chown_follows_symlink = no; then
-      REPLACE_CHOWN=1
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS chown.$ac_objext"
-
-    fi
-
-        if test $ac_cv_func_chown_works = no; then
-
-$as_echo "#define CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE 1" >>confdefs.h
-
-      REPLACE_CHOWN=1
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS chown.$ac_objext"
-
-    fi
-
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether chown honors trailing slash" >&5
-$as_echo_n "checking whether chown honors trailing slash... " >&6; }
-if test "${gl_cv_func_chown_slash_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  touch conftest.file && rm -f conftest.link
-       if test "$cross_compiling" = yes; then :
-  gl_cv_func_chown_slash_works="guessing no"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-
-int
-main ()
-{
-    if (symlink ("conftest.file", "conftest.link")) return 1;
-          if (chown ("conftest.link/", getuid (), getgid ()) == 0) return 2;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_chown_slash_works=yes
-else
-  gl_cv_func_chown_slash_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-      rm -f conftest.link conftest.file
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_chown_slash_works" >&5
-$as_echo "$gl_cv_func_chown_slash_works" >&6; }
-    if test "$gl_cv_func_chown_slash_works" != yes; then
-
-$as_echo "#define CHOWN_TRAILING_SLASH_BUG 1" >>confdefs.h
-
-      REPLACE_CHOWN=1
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS chown.$ac_objext"
-
-    fi
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether chown always updates ctime" >&5
-$as_echo_n "checking whether chown always updates ctime... " >&6; }
-if test "${gl_cv_func_chown_ctime_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  gl_cv_func_chown_ctime_works="guessing no"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-int
-main ()
-{
-    struct stat st1, st2;
-          if (close (creat ("conftest.file", 0600))) return 1;
-          if (stat ("conftest.file", &st1)) return 2;
-          sleep (1);
-          if (chown ("conftest.file", st1.st_uid, st1.st_gid)) return 3;
-          if (stat ("conftest.file", &st2)) return 4;
-          if (st2.st_ctime <= st1.st_ctime) return 5;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_chown_ctime_works=yes
-else
-  gl_cv_func_chown_ctime_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-      rm -f conftest.file
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_chown_ctime_works" >&5
-$as_echo "$gl_cv_func_chown_ctime_works" >&6; }
-    if test "$gl_cv_func_chown_ctime_works" != yes; then
-
-$as_echo "#define CHOWN_CHANGE_TIME_BUG 1" >>confdefs.h
-
-      REPLACE_CHOWN=1
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS chown.$ac_objext"
-
-    fi
-
-    if test $REPLACE_CHOWN = 1 && test $ac_cv_func_fchown = no; then
-
-
-
-
+    HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
+  fi
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fchown-stub.$ac_objext"
 
-    fi
-  fi
 
 
-     GNULIB_DIRFD=0;
+     GNULIB_OPENDIR=0;
+  GNULIB_READDIR=0;
+  GNULIB_REWINDDIR=0;
+  GNULIB_CLOSEDIR=0;
+  GNULIB_DIRFD=0;
   GNULIB_FDOPENDIR=0;
   GNULIB_SCANDIR=0;
   GNULIB_ALPHASORT=0;
-    HAVE_DECL_DIRFD=1;
+    HAVE_OPENDIR=1;
+  HAVE_READDIR=1;
+  HAVE_REWINDDIR=1;
+  HAVE_CLOSEDIR=1;
+  HAVE_DECL_DIRFD=1;
+  HAVE_DECL_FDOPENDIR=1;
   HAVE_FDOPENDIR=1;
   HAVE_SCANDIR=1;
   HAVE_ALPHASORT=1;
+  REPLACE_OPENDIR=0;
   REPLACE_CLOSEDIR=0;
+  REPLACE_DIRFD=0;
   REPLACE_FDOPENDIR=0;
-  REPLACE_OPENDIR=0;
 
 
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
 $as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
-if test "${gl_cv_have_include_next+set}" = set; then :
+if ${gl_cv_have_include_next+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   rm -rf conftestd1a conftestd1b conftestd2
@@ -6985,128 +7738,47 @@ $as_echo "$gl_cv_have_include_next" >&6; }
 
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5
+$as_echo_n "checking whether system header files limit the line length... " >&6; }
+if ${gl_cv_pragma_columns+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#ifdef __TANDEM
+choke me
+#endif
 
-
-
-  for ac_header in $ac_header_list
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
-
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "choke me" >/dev/null 2>&1; then :
+  gl_cv_pragma_columns=yes
+else
+  gl_cv_pragma_columns=no
 fi
+rm -f conftest*
 
-done
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system is Windows or MSDOS" >&5
-$as_echo_n "checking whether system is Windows or MSDOS... " >&6; }
-if test "${ac_cv_win_or_dos+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
-neither MSDOS nor Windows
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_win_or_dos=yes
-else
-  ac_cv_win_or_dos=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_win_or_dos" >&5
-$as_echo "$ac_cv_win_or_dos" >&6; }
-
-    if test x"$ac_cv_win_or_dos" = xyes; then
-      ac_fs_accepts_drive_letter_prefix=1
-      ac_fs_backslash_is_file_name_separator=1
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether drive letter can start relative path" >&5
-$as_echo_n "checking whether drive letter can start relative path... " >&6; }
-if test "${ac_cv_drive_letter_can_be_relative+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-#if defined __CYGWIN__
-drive letters are always absolute
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_drive_letter_can_be_relative=yes
-else
-  ac_cv_drive_letter_can_be_relative=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_drive_letter_can_be_relative" >&5
-$as_echo "$ac_cv_drive_letter_can_be_relative" >&6; }
-      if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
-        ac_fs_drive_letter_can_be_relative=1
-      else
-        ac_fs_drive_letter_can_be_relative=0
-      fi
-    else
-      ac_fs_accepts_drive_letter_prefix=0
-      ac_fs_backslash_is_file_name_separator=0
-      ac_fs_drive_letter_can_be_relative=0
-    fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX $ac_fs_accepts_drive_letter_prefix
-_ACEOF
-
-
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5
+$as_echo "$gl_cv_pragma_columns" >&6; }
+  if test $gl_cv_pragma_columns = yes; then
+    PRAGMA_COLUMNS="#pragma COLUMNS 10000"
+  else
+    PRAGMA_COLUMNS=
+  fi
 
-cat >>confdefs.h <<_ACEOF
-#define FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator
-_ACEOF
 
 
 
-cat >>confdefs.h <<_ACEOF
-#define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE $ac_fs_drive_letter_can_be_relative
-_ACEOF
 
 
 
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
 $as_echo_n "checking whether // is distinct from /... " >&6; }
-if test "${gl_cv_double_slash_root+set}" = set; then :
+if ${gl_cv_double_slash_root+:} false; then :
   $as_echo_n "(cached) " >&6
 else
    if test x"$cross_compiling" = xyes ; then
@@ -7143,13 +7815,9 @@ $as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
 
 
 
-
-
-
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
 $as_echo_n "checking for complete errno.h... " >&6; }
-if test "${gl_cv_header_errno_h_complete+set}" = set; then :
+if ${gl_cv_header_errno_h_complete+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -7157,6 +7825,9 @@ else
 /* end confdefs.h.  */
 
 #include <errno.h>
+#if !defined ETXTBSY
+booboo
+#endif
 #if !defined ENOMSG
 booboo
 #endif
@@ -7181,12 +7852,27 @@ booboo
 #if !defined ENOTSUP
 booboo
 #endif
+#if !defined ENETRESET
+booboo
+#endif
+#if !defined ECONNABORTED
+booboo
+#endif
 #if !defined ESTALE
 booboo
 #endif
+#if !defined EDQUOT
+booboo
+#endif
 #if !defined ECANCELED
 booboo
 #endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
+#endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
@@ -7210,35 +7896,48 @@ $as_echo "$gl_cv_header_errno_h_complete" >&6; }
 
 
 
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_errno_h='<'errno.h'>'
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
 $as_echo_n "checking absolute name of <errno.h>... " >&6; }
-if test "${gl_cv_next_errno_h+set}" = set; then :
+if ${gl_cv_next_errno_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_errno_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <errno.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/errno.h#{
-                 s#.*"\(.*/errno.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_errno_h='<'errno.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'errno.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_errno_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
@@ -7257,14 +7956,23 @@ $as_echo "$gl_cv_next_errno_h" >&6; }
 
 
 
+
     ERRNO_H='errno.h'
   fi
 
+   if test -n "$ERRNO_H"; then
+  GL_GENERATE_ERRNO_H_TRUE=
+  GL_GENERATE_ERRNO_H_FALSE='#'
+else
+  GL_GENERATE_ERRNO_H_TRUE='#'
+  GL_GENERATE_ERRNO_H_FALSE=
+fi
+
 
   if test -n "$ERRNO_H"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
 $as_echo_n "checking for EMULTIHOP value... " >&6; }
-if test "${gl_cv_header_errno_h_EMULTIHOP+set}" = set; then :
+if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -7335,7 +8043,7 @@ $as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
   if test -n "$ERRNO_H"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
 $as_echo_n "checking for ENOLINK value... " >&6; }
-if test "${gl_cv_header_errno_h_ENOLINK+set}" = set; then :
+if ${gl_cv_header_errno_h_ENOLINK+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -7406,7 +8114,7 @@ $as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
   if test -n "$ERRNO_H"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
 $as_echo_n "checking for EOVERFLOW value... " >&6; }
-if test "${gl_cv_header_errno_h_EOVERFLOW+set}" = set; then :
+if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -7475,7 +8183,7 @@ $as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
 
 
 ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror_r" = x""yes; then :
+if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
@@ -7488,7 +8196,7 @@ _ACEOF
 for ac_func in strerror_r
 do :
   ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
-if test "x$ac_cv_func_strerror_r" = x""yes; then :
+if test "x$ac_cv_func_strerror_r" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STRERROR_R 1
 _ACEOF
@@ -7498,7 +8206,7 @@ done
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
 $as_echo_n "checking whether strerror_r returns char *... " >&6; }
-if test "${ac_cv_func_strerror_r_char_p+set}" = set; then :
+if ${ac_cv_func_strerror_r_char_p+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
 
   XGETTEXT_EXTRA_OPTIONS=
 
-
-     GNULIB_FCHMODAT=0;
-  GNULIB_FSTATAT=0;
-  GNULIB_FUTIMENS=0;
-  GNULIB_LCHMOD=0;
-  GNULIB_LSTAT=0;
-  GNULIB_MKDIRAT=0;
-  GNULIB_MKFIFO=0;
-  GNULIB_MKFIFOAT=0;
-  GNULIB_MKNOD=0;
-  GNULIB_MKNODAT=0;
-  GNULIB_STAT=0;
-  GNULIB_UTIMENSAT=0;
-    HAVE_FCHMODAT=1;
-  HAVE_FSTATAT=1;
-  HAVE_FUTIMENS=1;
-  HAVE_LCHMOD=1;
-  HAVE_LSTAT=1;
-  HAVE_MKDIRAT=1;
-  HAVE_MKFIFO=1;
-  HAVE_MKFIFOAT=1;
-  HAVE_MKNOD=1;
-  HAVE_MKNODAT=1;
-  HAVE_UTIMENSAT=1;
-  REPLACE_FSTAT=0;
-  REPLACE_FSTATAT=0;
-  REPLACE_FUTIMENS=0;
-  REPLACE_LSTAT=0;
-  REPLACE_MKDIR=0;
-  REPLACE_MKFIFO=0;
-  REPLACE_MKNOD=0;
-  REPLACE_STAT=0;
-  REPLACE_UTIMENSAT=0;
-
-
-
-
-  GNULIB_FCNTL=0;
-  GNULIB_OPEN=0;
-  GNULIB_OPENAT=0;
-    HAVE_FCNTL=1;
-  HAVE_OPENAT=1;
-  REPLACE_FCNTL=0;
-  REPLACE_OPEN=0;
-  REPLACE_OPENAT=0;
-
-ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
-if test "x$ac_cv_type_mode_t" = x""yes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define mode_t int
-_ACEOF
-
-fi
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
-$as_echo_n "checking for promoted mode_t type... " >&6; }
-if test "${gl_cv_promoted_mode_t+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-int
-main ()
-{
-typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_promoted_mode_t='int'
+ac_fn_c_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fchdir" = xyes; then :
+  ac_have_decl=1
 else
-  gl_cv_promoted_mode_t='mode_t'
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
+  ac_have_decl=0
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
-$as_echo "$gl_cv_promoted_mode_t" >&6; }
 
 cat >>confdefs.h <<_ACEOF
-#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
+#define HAVE_DECL_FCHDIR $ac_have_decl
 _ACEOF
 
 
-
   GNULIB_DPRINTF=0;
   GNULIB_FCLOSE=0;
+  GNULIB_FDOPEN=0;
   GNULIB_FFLUSH=0;
+  GNULIB_FGETC=0;
+  GNULIB_FGETS=0;
   GNULIB_FOPEN=0;
   GNULIB_FPRINTF=0;
   GNULIB_FPRINTF_POSIX=0;
   GNULIB_FPURGE=0;
   GNULIB_FPUTC=0;
   GNULIB_FPUTS=0;
+  GNULIB_FREAD=0;
   GNULIB_FREOPEN=0;
+  GNULIB_FSCANF=0;
   GNULIB_FSEEK=0;
   GNULIB_FSEEKO=0;
   GNULIB_FTELL=0;
   GNULIB_FTELLO=0;
   GNULIB_FWRITE=0;
+  GNULIB_GETC=0;
+  GNULIB_GETCHAR=0;
   GNULIB_GETDELIM=0;
   GNULIB_GETLINE=0;
   GNULIB_OBSTACK_PRINTF=0;
   GNULIB_OBSTACK_PRINTF_POSIX=0;
+  GNULIB_PCLOSE=0;
   GNULIB_PERROR=0;
   GNULIB_POPEN=0;
   GNULIB_PRINTF=0;
@@ -7691,10 +8326,15 @@ _ACEOF
   GNULIB_REMOVE=0;
   GNULIB_RENAME=0;
   GNULIB_RENAMEAT=0;
+  GNULIB_SCANF=0;
   GNULIB_SNPRINTF=0;
   GNULIB_SPRINTF_POSIX=0;
+  GNULIB_STDIO_H_NONBLOCKING=0;
   GNULIB_STDIO_H_SIGPIPE=0;
+  GNULIB_TMPFILE=0;
   GNULIB_VASPRINTF=0;
+  GNULIB_VFSCANF=0;
+  GNULIB_VSCANF=0;
   GNULIB_VDPRINTF=0;
   GNULIB_VFPRINTF=0;
   GNULIB_VFPRINTF_POSIX=0;
@@ -7703,17 +8343,24 @@ _ACEOF
   GNULIB_VSNPRINTF=0;
   GNULIB_VSPRINTF_POSIX=0;
     HAVE_DECL_FPURGE=1;
+  HAVE_DECL_FSEEKO=1;
+  HAVE_DECL_FTELLO=1;
   HAVE_DECL_GETDELIM=1;
   HAVE_DECL_GETLINE=1;
   HAVE_DECL_OBSTACK_PRINTF=1;
   HAVE_DECL_SNPRINTF=1;
   HAVE_DECL_VSNPRINTF=1;
   HAVE_DPRINTF=1;
+  HAVE_FSEEKO=1;
+  HAVE_FTELLO=1;
+  HAVE_PCLOSE=1;
+  HAVE_POPEN=1;
   HAVE_RENAMEAT=1;
   HAVE_VASPRINTF=1;
   HAVE_VDPRINTF=1;
   REPLACE_DPRINTF=0;
   REPLACE_FCLOSE=0;
+  REPLACE_FDOPEN=0;
   REPLACE_FFLUSH=0;
   REPLACE_FOPEN=0;
   REPLACE_FPRINTF=0;
@@ -7723,6 +8370,7 @@ _ACEOF
   REPLACE_FSEEKO=0;
   REPLACE_FTELL=0;
   REPLACE_FTELLO=0;
+  REPLACE_GETDELIM=0;
   REPLACE_GETLINE=0;
   REPLACE_OBSTACK_PRINTF=0;
   REPLACE_PERROR=0;
@@ -7733,7 +8381,9 @@ _ACEOF
   REPLACE_RENAMEAT=0;
   REPLACE_SNPRINTF=0;
   REPLACE_SPRINTF=0;
+  REPLACE_STDIO_READ_FUNCS=0;
   REPLACE_STDIO_WRITE_FUNCS=0;
+  REPLACE_TMPFILE=0;
   REPLACE_VASPRINTF=0;
   REPLACE_VDPRINTF=0;
   REPLACE_VFPRINTF=0;
@@ -7742,12 +8392,28 @@ _ACEOF
   REPLACE_VSPRINTF=0;
 
 
+  GNULIB_FCNTL=0;
+  GNULIB_NONBLOCKING=0;
+  GNULIB_OPEN=0;
+  GNULIB_OPENAT=0;
+    HAVE_FCNTL=1;
+  HAVE_OPENAT=1;
+  REPLACE_FCNTL=0;
+  REPLACE_OPEN=0;
+  REPLACE_OPENAT=0;
+
+
+
+
+
+
+
 
 
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
 $as_echo_n "checking for working fcntl.h... " >&6; }
-if test "${gl_cv_header_working_fcntl_h+set}" = set; then :
+if ${gl_cv_header_working_fcntl_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7757,7 +8423,13 @@ else
 /* end confdefs.h.  */
 #include <sys/types.h>
            #include <sys/stat.h>
-           #include <unistd.h>
+           #if HAVE_UNISTD_H
+           # include <unistd.h>
+           #else /* on Windows with MSVC */
+           # include <io.h>
+           # include <stdlib.h>
+           # defined sleep(n) _sleep ((n) * 1000)
+           #endif
            #include <fcntl.h>
            #ifndef O_NOATIME
             #define O_NOATIME 0
@@ -7775,29 +8447,58 @@ int
 main ()
 {
 
-            int status = !constants;
+            int result = !constants;
+            #if HAVE_SYMLINK
             {
               static char const sym[] = "conftest.sym";
-              if (symlink (".", sym) != 0
-                  || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
-                status |= 32;
+              if (symlink (".", sym) != 0)
+                result |= 2;
+              else
+                {
+                  int fd = open (sym, O_RDONLY | O_NOFOLLOW);
+                  if (fd >= 0)
+                    {
+                      close (fd);
+                      result |= 4;
+                    }
+                }
               unlink (sym);
             }
+            #endif
             {
               static char const file[] = "confdefs.h";
               int fd = open (file, O_RDONLY | O_NOATIME);
-              char c;
-              struct stat st0, st1;
-              if (fd < 0
-                  || fstat (fd, &st0) != 0
-                  || sleep (1) != 0
-                  || read (fd, &c, 1) != 1
-                  || close (fd) != 0
-                  || stat (file, &st1) != 0
-                  || st0.st_atime != st1.st_atime)
-                status |= 64;
+              if (fd < 0)
+                result |= 8;
+              else
+                {
+                  struct stat st0;
+                  if (fstat (fd, &st0) != 0)
+                    result |= 16;
+                  else
+                    {
+                      char c;
+                      sleep (1);
+                      if (read (fd, &c, 1) != 1)
+                        result |= 24;
+                      else
+                        {
+                          if (close (fd) != 0)
+                            result |= 32;
+                          else
+                            {
+                              struct stat st1;
+                              if (stat (file, &st1) != 0)
+                                result |= 40;
+                              else
+                                if (st0.st_atime != st1.st_atime)
+                                  result |= 64;
+                            }
+                        }
+                    }
+                }
             }
-            return status;
+            return result;
   ;
   return 0;
 }
@@ -7806,9 +8507,9 @@ if ac_fn_c_try_run "$LINENO"; then :
   gl_cv_header_working_fcntl_h=yes
 else
   case $? in #(
-        32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+        4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
         64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
-        96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+        68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
          *) gl_cv_header_working_fcntl_h='no';;
         esac
 fi
@@ -7840,8 +8541,61 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
+if test "x$ac_cv_type_mode_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define mode_t int
+_ACEOF
+
+fi
+
+
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
+$as_echo_n "checking for promoted mode_t type... " >&6; }
+if ${gl_cv_promoted_mode_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+int
+main ()
+{
+typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_promoted_mode_t='int'
+else
+  gl_cv_promoted_mode_t='mode_t'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
+$as_echo "$gl_cv_promoted_mode_t" >&6; }
 
+cat >>confdefs.h <<_ACEOF
+#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
+_ACEOF
 
 
 
@@ -7853,13 +8607,13 @@ _ACEOF
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5
 $as_echo_n "checking for stdint.h... " >&6; }
-if test "${gl_cv_header_stdint_h+set}" = set; then :
+if ${gl_cv_header_stdint_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
-#include <stdint.h>
+            #include <stdint.h>
 int
 main ()
 {
@@ -7888,13 +8642,15 @@ _ACEOF
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5
 $as_echo_n "checking for inttypes.h... " >&6; }
-if test "${gl_cv_header_inttypes_h+set}" = set; then :
+if ${gl_cv_header_inttypes_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <sys/types.h>
 #include <inttypes.h>
+
 int
 main ()
 {
@@ -7926,35 +8682,35 @@ _ACEOF
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports size specifiers as in C99" >&5
 $as_echo_n "checking whether printf supports size specifiers as in C99... " >&6; }
-if test "${gl_cv_func_printf_sizes_c99+set}" = set; then :
+if ${gl_cv_func_printf_sizes_c99+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
 
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on FreeBSD >= 5.
-         freebsd[1-4]*)        gl_cv_func_printf_sizes_c99="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
-         darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on OpenBSD >= 3.9.
-         openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
-                               gl_cv_func_printf_sizes_c99="guessing no";;
-         openbsd*)             gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on Solaris >= 2.10.
-         solaris2.[0-9]*)      gl_cv_func_printf_sizes_c99="guessing no";;
-         solaris*)             gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_printf_sizes_c99="guessing no";;
-         netbsd*)              gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_sizes_c99="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_printf_sizes_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
+           darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_printf_sizes_c99="guessing no";;
+           openbsd*)             gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.10.
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_printf_sizes_c99="guessing no";;
+           netbsd*)              gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_sizes_c99="guessing no";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7973,25 +8729,26 @@ else
 static char buf[100];
 int main ()
 {
+  int result = 0;
 #if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
   buf[0] = '\0';
   if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
       || strcmp (buf, "12345671 33") != 0)
-    return 1;
+    result |= 1;
 #endif
   buf[0] = '\0';
   if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
       || strcmp (buf, "12345672 33") != 0)
-    return 1;
+    result |= 2;
   buf[0] = '\0';
   if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
       || strcmp (buf, "12345673 33") != 0)
-    return 1;
+    result |= 4;
   buf[0] = '\0';
   if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
       || strcmp (buf, "1.5 33") != 0)
-    return 1;
-  return 0;
+    result |= 8;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -8012,17 +8769,17 @@ $as_echo "$gl_cv_func_printf_sizes_c99" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports 'long double' arguments" >&5
 $as_echo_n "checking whether printf supports 'long double' arguments... " >&6; }
-if test "${gl_cv_func_printf_long_double+set}" = set; then :
+if ${gl_cv_func_printf_long_double+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
 
-       case "$host_os" in
-         beos*)        gl_cv_func_printf_long_double="guessing no";;
-         mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
-         *)            gl_cv_func_printf_long_double="guessing yes";;
-       esac
+         case "$host_os" in
+           beos*)        gl_cv_func_printf_long_double="guessing no";;
+           mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
+           *)            gl_cv_func_printf_long_double="guessing yes";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8033,19 +8790,20 @@ else
 static char buf[10000];
 int main ()
 {
+  int result = 0;
   buf[0] = '\0';
   if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.750000 33") != 0)
-    return 1;
+    result |= 1;
   buf[0] = '\0';
   if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.750000e+00 33") != 0)
-    return 1;
+    result |= 2;
   buf[0] = '\0';
   if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.75 33") != 0)
-    return 1;
-  return 0;
+    result |= 4;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -8066,33 +8824,33 @@ $as_echo "$gl_cv_func_printf_long_double" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'double' arguments" >&5
 $as_echo_n "checking whether printf supports infinite 'double' arguments... " >&6; }
-if test "${gl_cv_func_printf_infinite+set}" = set; then :
+if ${gl_cv_func_printf_infinite+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
 
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on FreeBSD >= 6.
-         freebsd[1-5]*)        gl_cv_func_printf_infinite="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_printf_infinite="guessing no";;
-         darwin*)              gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on HP-UX >= 11.
-         hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
-         hpux*)                gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_printf_infinite="guessing no";;
-         netbsd*)              gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on BeOS.
-         beos*)                gl_cv_func_printf_infinite="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_infinite="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on FreeBSD >= 6.
+           freebsd[1-5]*)        gl_cv_func_printf_infinite="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_infinite="guessing no";;
+           darwin*)              gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on HP-UX >= 11.
+           hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
+           hpux*)                gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_printf_infinite="guessing no";;
+           netbsd*)              gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_printf_infinite="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_infinite="guessing no";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8129,39 +8887,40 @@ static char buf[10000];
 static double zero = 0.0;
 int main ()
 {
-  if (sprintf (buf, "%f", 1.0 / 0.0) < 0
+  int result = 0;
+  if (sprintf (buf, "%f", 1.0 / zero) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%f", -1.0 / 0.0) < 0
+    result |= 1;
+  if (sprintf (buf, "%f", -1.0 / zero) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%f", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
-  if (sprintf (buf, "%e", 1.0 / 0.0) < 0
+    result |= 2;
+  if (sprintf (buf, "%e", 1.0 / zero) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%e", -1.0 / 0.0) < 0
+    result |= 4;
+  if (sprintf (buf, "%e", -1.0 / zero) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 4;
   if (sprintf (buf, "%e", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
-  if (sprintf (buf, "%g", 1.0 / 0.0) < 0
+    result |= 8;
+  if (sprintf (buf, "%g", 1.0 / zero) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%g", -1.0 / 0.0) < 0
+    result |= 16;
+  if (sprintf (buf, "%g", -1.0 / zero) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 16;
   if (sprintf (buf, "%g", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 32;
   /* This test fails on HP-UX 10.20.  */
   if (have_minus_zero ())
     if (sprintf (buf, "%g", - zero) < 0
         || strcmp (buf, "-0") != 0)
-    return 1;
-  return 0;
+    result |= 64;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -8181,7 +8940,7 @@ $as_echo "$gl_cv_func_printf_infinite" >&6; }
 
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then :
+if ${ac_cv_c_bigendian+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_bigendian=unknown
@@ -8399,12 +9158,55 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
 
      ;; #(
    *)
-     as_fn_error "unknown endianness
+     as_fn_error $? "unknown endianness
  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
  esac
 
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5
+$as_echo_n "checking whether long double and double are the same... " >&6; }
+if ${gl_cv_long_double_equals_double+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <float.h>
+int
+main ()
+{
+typedef int check[sizeof (long double) == sizeof (double)
+                              && LDBL_MANT_DIG == DBL_MANT_DIG
+                              && LDBL_MAX_EXP == DBL_MAX_EXP
+                              && LDBL_MIN_EXP == DBL_MIN_EXP
+                              ? 1 : -1];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_long_double_equals_double=yes
+else
+  gl_cv_long_double_equals_double=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5
+$as_echo "$gl_cv_long_double_equals_double" >&6; }
+  if test $gl_cv_long_double_equals_double = yes; then
+
+$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h
+
+    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
+  else
+    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
+  fi
+
+
+
+
 
 
 
@@ -8417,37 +9219,30 @@ $as_echo "#define CHECK_PRINTF_SAFE 1" >>confdefs.h
     *yes)
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'long double' arguments" >&5
 $as_echo_n "checking whether printf supports infinite 'long double' arguments... " >&6; }
-if test "${gl_cv_func_printf_infinite_long_double+set}" = set; then :
+if ${gl_cv_func_printf_infinite_long_double+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
           if test "$cross_compiling" = yes; then :
 
-           case "$host_cpu" in
-                                   # Guess no on ia64, x86_64, i386.
-             ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
-             *)
-               case "$host_os" in
-                                       # Guess yes on glibc systems.
-                 *-gnu*)               gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on FreeBSD >= 6.
-                 freebsd[1-5]*)        gl_cv_func_printf_infinite_long_double="guessing no";;
-                 freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on MacOS X >= 10.3.
-                 darwin[1-6].*)        gl_cv_func_printf_infinite_long_double="guessing no";;
-                 darwin*)              gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on HP-UX >= 11.
-                 hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
-                 hpux*)                gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on NetBSD >= 3.
-                 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                                       gl_cv_func_printf_infinite_long_double="guessing no";;
-                 netbsd*)              gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # If we don't know, assume the worst.
-                 *)                    gl_cv_func_printf_infinite_long_double="guessing no";;
-               esac
-               ;;
-           esac
+             case "$host_cpu" in
+                                     # Guess no on ia64, x86_64, i386.
+               ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
+               *)
+                 case "$host_os" in
+                                         # Guess yes on glibc systems.
+                   *-gnu*)               gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on FreeBSD >= 6.
+                   freebsd[1-5]*)        gl_cv_func_printf_infinite_long_double="guessing no";;
+                   freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on HP-UX >= 11.
+                   hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
+                   hpux*)                gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # If we don't know, assume the worst.
+                   *)                    gl_cv_func_printf_infinite_long_double="guessing no";;
+                 esac
+                 ;;
+             esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8517,6 +9312,34 @@ nocrash_init (void)
     }
   }
 }
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Avoid a crash on native Windows.  */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+    {
+    case EXCEPTION_ACCESS_VIOLATION:
+    case EXCEPTION_IN_PAGE_ERROR:
+    case EXCEPTION_STACK_OVERFLOW:
+    case EXCEPTION_GUARD_PAGE:
+    case EXCEPTION_PRIV_INSTRUCTION:
+    case EXCEPTION_ILLEGAL_INSTRUCTION:
+    case EXCEPTION_DATATYPE_MISALIGNMENT:
+    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+      exit (1);
+    }
+  return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
 #else
 /* Avoid a crash on POSIX systems.  */
 #include <signal.h>
@@ -8563,35 +9386,36 @@ static char buf[10000];
 static long double zeroL = 0.0L;
 int main ()
 {
+  int result = 0;
   nocrash_init();
-  if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0
+  if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0
+    result |= 1;
+  if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
-  if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0
+    result |= 1;
+  if (sprintf (buf, "%Le", 1.0L / zeroL) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0
+    result |= 1;
+  if (sprintf (buf, "%Le", -1.0L / zeroL) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Le", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
-  if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0
+    result |= 1;
+  if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0
+    result |= 1;
+  if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
-#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
+    result |= 1;
+#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
 /* Representation of an 80-bit 'long double' as an initializer for a sequence
    of 'unsigned int' words.  */
 # ifdef WORDS_BIGENDIAN
@@ -8609,13 +9433,13 @@ int main ()
       { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
   }
   {
     /* Signalling NaN.  */
@@ -8623,81 +9447,81 @@ int main ()
       { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
   }
   { /* Pseudo-NaN.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
   }
   { /* Pseudo-Infinity.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
   }
   { /* Pseudo-Zero.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
   }
   { /* Unnormalized number.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
   }
   { /* Pseudo-Denormal.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
   }
 #endif
-  return 0;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -8723,24 +9547,24 @@ $as_echo "$gl_cv_func_printf_infinite_long_double" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'a' and 'A' directives" >&5
 $as_echo_n "checking whether printf supports the 'a' and 'A' directives... " >&6; }
-if test "${gl_cv_func_printf_directive_a+set}" = set; then :
+if ${gl_cv_func_printf_directive_a+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
 
-       case "$host_os" in
-                               # Guess yes on glibc >= 2.5 systems.
-         *-gnu*)
-           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+         case "$host_os" in
+                                 # Guess yes on glibc >= 2.5 systems.
+           *-gnu*)
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-             #include <features.h>
-             #ifdef __GNU_LIBRARY__
-              #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
-               BZ2908
-              #endif
-             #endif
+               #include <features.h>
+               #ifdef __GNU_LIBRARY__
+                #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__
+                 BZ2908
+                #endif
+               #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
@@ -8751,10 +9575,10 @@ else
 fi
 rm -f conftest*
 
-           ;;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_directive_a="guessing no";;
-       esac
+             ;;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_directive_a="guessing no";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8763,39 +9587,41 @@ else
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
+static double zero = 0.0;
 int main ()
 {
+  int result = 0;
   if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
       || (strcmp (buf, "0x1.922p+1 33") != 0
           && strcmp (buf, "0x3.244p+0 33") != 0
           && strcmp (buf, "0x6.488p-1 33") != 0
           && strcmp (buf, "0xc.91p-2 33") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
       || (strcmp (buf, "-0X1.922P+1 33") != 0
           && strcmp (buf, "-0X3.244P+0 33") != 0
           && strcmp (buf, "-0X6.488P-1 33") != 0
           && strcmp (buf, "-0XC.91P-2 33") != 0))
-    return 1;
+    result |= 2;
   /* This catches a FreeBSD 6.1 bug: it doesn't round.  */
   if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
       || (strcmp (buf, "0x1.83p+0 33") != 0
           && strcmp (buf, "0x3.05p-1 33") != 0
           && strcmp (buf, "0x6.0ap-2 33") != 0
           && strcmp (buf, "0xc.14p-3 33") != 0))
-    return 1;
+    result |= 4;
   /* This catches a FreeBSD 6.1 bug.  See
      <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
-  if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
+  if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
       || buf[0] == '0')
-    return 1;
+    result |= 8;
   /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug.  */
   if (sprintf (buf, "%.1a", 1.999) < 0
       || (strcmp (buf, "0x1.0p+1") != 0
           && strcmp (buf, "0x2.0p+0") != 0
           && strcmp (buf, "0x4.0p-1") != 0
           && strcmp (buf, "0x8.0p-2") != 0))
-    return 1;
+    result |= 16;
   /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
      glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
   if (sprintf (buf, "%.1La", 1.999L) < 0
@@ -8803,8 +9629,8 @@ int main ()
           && strcmp (buf, "0x2.0p+0") != 0
           && strcmp (buf, "0x4.0p-1") != 0
           && strcmp (buf, "0x8.0p-2") != 0))
-    return 1;
-  return 0;
+    result |= 32;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -8825,27 +9651,27 @@ $as_echo "$gl_cv_func_printf_directive_a" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'F' directive" >&5
 $as_echo_n "checking whether printf supports the 'F' directive... " >&6; }
-if test "${gl_cv_func_printf_directive_f+set}" = set; then :
+if ${gl_cv_func_printf_directive_f+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
 
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_printf_directive_f="guessing yes";;
-                               # Guess yes on FreeBSD >= 6.
-         freebsd[1-5]*)        gl_cv_func_printf_directive_f="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
-         darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
-                               # Guess yes on Solaris >= 2.10.
-         solaris2.[0-9]*)      gl_cv_func_printf_directive_f="guessing no";;
-         solaris*)             gl_cv_func_printf_directive_f="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_directive_f="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on FreeBSD >= 6.
+           freebsd[1-5]*)        gl_cv_func_printf_directive_f="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
+           darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on Solaris >= 2.10.
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_directive_f="guessing no";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8854,19 +9680,21 @@ else
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
+static double zero = 0.0;
 int main ()
 {
+  int result = 0;
   if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
       || strcmp (buf, "1234567.000000 33") != 0)
-    return 1;
-  if (sprintf (buf, "%F", 1.0 / 0.0) < 0
+    result |= 1;
+  if (sprintf (buf, "%F", 1.0 / zero) < 0
       || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
-    return 1;
+    result |= 2;
   /* This catches a Cygwin 1.5.x bug.  */
   if (sprintf (buf, "%.F", 1234.0) < 0
       || strcmp (buf, "1234") != 0)
-    return 1;
-  return 0;
+    result |= 4;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -8887,27 +9715,43 @@ $as_echo "$gl_cv_func_printf_directive_f" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'n' directive" >&5
 $as_echo_n "checking whether printf supports the 'n' directive... " >&6; }
-if test "${gl_cv_func_printf_directive_n+set}" = set; then :
+if ${gl_cv_func_printf_directive_n+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
 
-       case "$host_os" in
-         *)     gl_cv_func_printf_directive_n="guessing yes";;
-       esac
+         case "$host_os" in
+           mingw*) gl_cv_func_printf_directive_n="guessing no";;
+           *)      gl_cv_func_printf_directive_n="guessing yes";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
+#ifdef _MSC_VER
+/* See page about "Parameter Validation" on msdn.microsoft.com.  */
+static void cdecl
+invalid_parameter_handler (const wchar_t *expression,
+                           const wchar_t *function,
+                           const wchar_t *file, unsigned int line,
+                           uintptr_t dummy)
+{
+  exit (1);
+}
+#endif
 static char fmtstring[10];
 static char buf[100];
 int main ()
 {
   int count = -1;
+#ifdef _MSC_VER
+  _set_invalid_parameter_handler (invalid_parameter_handler);
+#endif
   /* Copy the format string.  Some systems (glibc with _FORTIFY_SOURCE=2)
      support %n in format strings in read-only memory but not in writable
      memory.  */
@@ -8937,20 +9781,20 @@ $as_echo "$gl_cv_func_printf_directive_n" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'ls' directive" >&5
 $as_echo_n "checking whether printf supports the 'ls' directive... " >&6; }
-if test "${gl_cv_func_printf_directive_ls+set}" = set; then :
+if ${gl_cv_func_printf_directive_ls+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
 
-       case "$host_os" in
-         openbsd*)        gl_cv_func_printf_directive_ls="guessing no";;
-         irix*)           gl_cv_func_printf_directive_ls="guessing no";;
-         solaris*)        gl_cv_func_printf_directive_ls="guessing no";;
-         cygwin*)         gl_cv_func_printf_directive_ls="guessing no";;
-         beos* | haiku*)  gl_cv_func_printf_directive_ls="guessing no";;
-         *)               gl_cv_func_printf_directive_ls="guessing yes";;
-       esac
+         case "$host_os" in
+           openbsd*)        gl_cv_func_printf_directive_ls="guessing no";;
+           irix*)           gl_cv_func_printf_directive_ls="guessing no";;
+           solaris*)        gl_cv_func_printf_directive_ls="guessing no";;
+           cygwin*)         gl_cv_func_printf_directive_ls="guessing no";;
+           beos* | haiku*)  gl_cv_func_printf_directive_ls="guessing no";;
+           *)               gl_cv_func_printf_directive_ls="guessing yes";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8967,6 +9811,7 @@ else
 #include <string.h>
 int main ()
 {
+  int result = 0;
   char buf[100];
   /* Test whether %ls works at all.
      This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
@@ -8976,7 +9821,7 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%ls", wstring) < 0
         || strcmp (buf, "abc") != 0)
-      return 1;
+      result |= 1;
   }
   /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
      assertion failure inside libc), but not on OpenBSD 4.0.  */
@@ -8985,7 +9830,7 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%ls", wstring) < 0
         || strcmp (buf, "a") != 0)
-      return 1;
+      result |= 2;
   }
   /* Test whether precisions in %ls are supported as specified in ISO C 99
      section 7.19.6.1:
@@ -9000,9 +9845,9 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%.2ls", wstring) < 0
         || strcmp (buf, "ab") != 0)
-      return 1;
+      result |= 8;
   }
-  return 0;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -9023,19 +9868,19 @@ $as_echo "$gl_cv_func_printf_directive_ls" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5
 $as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; }
-if test "${gl_cv_func_printf_positions+set}" = set; then :
+if ${gl_cv_func_printf_positions+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
 
-       case "$host_os" in
-         netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
-                       gl_cv_func_printf_positions="guessing no";;
-         beos*)        gl_cv_func_printf_positions="guessing no";;
-         mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
-         *)            gl_cv_func_printf_positions="guessing yes";;
-       esac
+         case "$host_os" in
+           netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
+                         gl_cv_func_printf_positions="guessing no";;
+           beos*)        gl_cv_func_printf_positions="guessing no";;
+           mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
+           *)            gl_cv_func_printf_positions="guessing yes";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -9071,18 +9916,18 @@ $as_echo "$gl_cv_func_printf_positions" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the grouping flag" >&5
 $as_echo_n "checking whether printf supports the grouping flag... " >&6; }
-if test "${gl_cv_func_printf_flag_grouping+set}" = set; then :
+if ${gl_cv_func_printf_flag_grouping+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
 
-       case "$host_os" in
-         cygwin*)      gl_cv_func_printf_flag_grouping="guessing no";;
-         netbsd*)      gl_cv_func_printf_flag_grouping="guessing no";;
-         mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
-         *)            gl_cv_func_printf_flag_grouping="guessing yes";;
-       esac
+         case "$host_os" in
+           cygwin*)      gl_cv_func_printf_flag_grouping="guessing no";;
+           netbsd*)      gl_cv_func_printf_flag_grouping="guessing no";;
+           mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
+           *)            gl_cv_func_printf_flag_grouping="guessing yes";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -9117,7 +9962,7 @@ $as_echo "$gl_cv_func_printf_flag_grouping" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the left-adjust flag correctly" >&5
 $as_echo_n "checking whether printf supports the left-adjust flag correctly... " >&6; }
-if test "${gl_cv_func_printf_flag_leftadjust+set}" = set; then :
+if ${gl_cv_func_printf_flag_leftadjust+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -9166,20 +10011,20 @@ $as_echo "$gl_cv_func_printf_flag_leftadjust" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the zero flag correctly" >&5
 $as_echo_n "checking whether printf supports the zero flag correctly... " >&6; }
-if test "${gl_cv_func_printf_flag_zero+set}" = set; then :
+if ${gl_cv_func_printf_flag_zero+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
 
-       case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
-                 # Guess yes on BeOS.
-         beos*)  gl_cv_func_printf_flag_zero="guessing yes";;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_printf_flag_zero="guessing no";;
-       esac
+         case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
+                   # Guess yes on BeOS.
+           beos*)  gl_cv_func_printf_flag_zero="guessing yes";;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_printf_flag_zero="guessing no";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -9188,9 +10033,10 @@ else
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
+static double zero = 0.0;
 int main ()
 {
-  if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0
+  if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0
       || (strcmp (buf, "       inf") != 0
           && strcmp (buf, "  infinity") != 0))
     return 1;
@@ -9215,18 +10061,19 @@ $as_echo "$gl_cv_func_printf_flag_zero" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports large precisions" >&5
 $as_echo_n "checking whether printf supports large precisions... " >&6; }
-if test "${gl_cv_func_printf_precision+set}" = set; then :
+if ${gl_cv_func_printf_precision+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
 
-       case "$host_os" in
-         # Guess no only on native Win32 and BeOS systems.
-         mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
-         beos*)        gl_cv_func_printf_precision="guessing no" ;;
-         *)            gl_cv_func_printf_precision="guessing yes" ;;
-       esac
+         case "$host_os" in
+           # Guess no only on Solaris, native Windows, and BeOS systems.
+           solaris*)     gl_cv_func_printf_precision="guessing no" ;;
+           mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
+           beos*)        gl_cv_func_printf_precision="guessing no" ;;
+           *)            gl_cv_func_printf_precision="guessing yes" ;;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -9237,13 +10084,22 @@ else
 static char buf[5000];
 int main ()
 {
+  int result = 0;
 #ifdef __BEOS__
   /* On BeOS, this would crash and show a dialog box.  Avoid the crash.  */
   return 1;
 #endif
   if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
-    return 1;
-  return 0;
+    result |= 1;
+  if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
+    result |= 2;
+  if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
+      || buf[0] != '1')
+    result |= 4;
+  if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5
+      || buf[0] != '1')
+    result |= 4;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -9296,9 +10152,6 @@ if ac_fn_c_try_compile "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   if test $gl_cv_c_multiarch = yes; then
-
-$as_echo "#define AA_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-
     APPLE_UNIVERSAL_BUILD=1
   else
     APPLE_UNIVERSAL_BUILD=0
@@ -9310,7 +10163,7 @@ $as_echo "#define AA_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf survives out-of-memory conditions" >&5
 $as_echo_n "checking whether printf survives out-of-memory conditions... " >&6; }
-if test "${gl_cv_func_printf_enomem+set}" = set; then :
+if ${gl_cv_func_printf_enomem+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -9384,6 +10237,34 @@ nocrash_init (void)
     }
   }
 }
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Avoid a crash on native Windows.  */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+    {
+    case EXCEPTION_ACCESS_VIOLATION:
+    case EXCEPTION_IN_PAGE_ERROR:
+    case EXCEPTION_STACK_OVERFLOW:
+    case EXCEPTION_GUARD_PAGE:
+    case EXCEPTION_PRIV_INSTRUCTION:
+    case EXCEPTION_ILLEGAL_INSTRUCTION:
+    case EXCEPTION_DATATYPE_MISALIGNMENT:
+    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+      exit (1);
+    }
+  return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
 #else
 /* Avoid a crash on POSIX systems.  */
 #include <signal.h>
@@ -9520,12 +10401,14 @@ $as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
-$as_echo_n "checking for long long int... " >&6; }
-if test "${ac_cv_type_long_long_int+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
+$as_echo_n "checking for unsigned long long int... " >&6; }
+if ${ac_cv_type_unsigned_long_long_int+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ac_cv_type_unsigned_long_long_int=yes
+     if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
   /* For now, do not test the preprocessor; as of 2007 there are too many
@@ -9558,37 +10441,64 @@ main ()
 
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-                          if test "$cross_compiling" = yes; then :
+
+else
+  ac_cv_type_unsigned_long_long_int=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
+$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
+  if test $ac_cv_type_unsigned_long_long_int = yes; then
+
+$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+
+  fi
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
+$as_echo_n "checking for long long int... " >&6; }
+if ${ac_cv_type_long_long_int+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
   ac_cv_type_long_long_int=yes
+      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+        ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+        if test $ac_cv_type_long_long_int = yes; then
+                                        if test "$cross_compiling" = yes; then :
+  :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <limits.h>
-               #ifndef LLONG_MAX
-               # define HALF \
-                        (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-               # define LLONG_MAX (HALF - 1 + HALF)
-               #endif
+                 #ifndef LLONG_MAX
+                 # define HALF \
+                          (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+                 # define LLONG_MAX (HALF - 1 + HALF)
+                 #endif
 int
 main ()
 {
 long long int n = 1;
-               int i;
-               for (i = 0; ; i++)
-                 {
-                   long long int m = n << i;
-                   if (m >> i != n)
-                     return 1;
-                   if (LLONG_MAX / 2 < m)
-                     break;
-                 }
-               return 0;
+                 int i;
+                 for (i = 0; ; i++)
+                   {
+                     long long int m = n << i;
+                     if (m >> i != n)
+                       return 1;
+                     if (LLONG_MAX / 2 < m)
+                       break;
+                   }
+                 return 0;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_type_long_long_int=yes
+
 else
   ac_cv_type_long_long_int=no
 fi
@@ -9596,11 +10506,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-else
-  ac_cv_type_long_long_int=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+        fi
+      fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
 $as_echo "$ac_cv_type_long_long_int" >&6; }
@@ -9613,13 +10520,13 @@ $as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
 $as_echo_n "checking for wchar_t... " >&6; }
-if test "${gt_cv_c_wchar_t+set}" = set; then :
+if ${gt_cv_c_wchar_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stddef.h>
-       wchar_t foo = (wchar_t)'\0';
+            wchar_t foo = (wchar_t)'\0';
 int
 main ()
 {
@@ -9646,7 +10553,7 @@ $as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
 $as_echo_n "checking for wint_t... " >&6; }
-if test "${gt_cv_c_wint_t+set}" = set; then :
+if ${gt_cv_c_wint_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -9660,7 +10567,7 @@ else
 #include <stdio.h>
 #include <time.h>
 #include <wchar.h>
-       wint_t foo = (wchar_t)'\0';
+            wint_t foo = (wchar_t)'\0';
 int
 main ()
 {
@@ -9687,9 +10594,20 @@ $as_echo "#define HAVE_WINT_T 1" >>confdefs.h
 
 
 
+
+  if test $ac_cv_header_features_h = yes; then
+    HAVE_FEATURES_H=1
+  else
+    HAVE_FEATURES_H=0
+  fi
+
+
+
+
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5
 $as_echo_n "checking for intmax_t... " >&6; }
-if test "${gt_cv_c_intmax_t+set}" = set; then :
+if ${gt_cv_c_intmax_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -9738,223 +10656,2214 @@ _ACEOF
   fi
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
+$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
+if ${gl_cv_cc_double_expbit0+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+      if test "$cross_compiling" = yes; then :
 
+                                                                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#if defined arm || defined __arm || defined __arm__
+  mixed_endianness
+#endif
 
-  for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-
-fi
-done
-
-      ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h>
-"
-if test "x$ac_cv_have_decl__snprintf" = x""yes; then :
-  ac_have_decl=1
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "mixed_endianness" >/dev/null 2>&1; then :
+  gl_cv_cc_double_expbit0="unknown"
 else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
+                                                         :
+if ${ac_cv_c_bigendian+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+              not a universal capable compiler
+            #endif
+            typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+       # Check for potential -arch flags.  It is not universal unless
+       # there are at least two -arch flags with different values.
+       ac_arch=
+       ac_prev=
+       for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+        if test -n "$ac_prev"; then
+          case $ac_word in
+            i?86 | x86_64 | ppc | ppc64)
+              if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+                ac_arch=$ac_word
+              else
+                ac_cv_c_bigendian=universal
+                break
+              fi
+              ;;
+          esac
+          ac_prev=
+        elif test "x$ac_word" = "x-arch"; then
+          ac_prev=arch
+        fi
+       done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+            #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+                    && LITTLE_ENDIAN)
+             bogus endian macros
+            #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+               #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+                not big endian
+               #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
+else
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+             bogus endian macros
+            #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+                not big endian
+               #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
+else
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes; then :
+  # Try to guess by grepping values from an object file.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+short int ascii_mm[] =
+                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+               short int ascii_ii[] =
+                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+               int use_ascii (int i) {
+                 return ascii_mm[i] + ascii_ii[i];
+               }
+               short int ebcdic_ii[] =
+                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+               short int ebcdic_mm[] =
+                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+               int use_ebcdic (int i) {
+                 return ebcdic_mm[i] + ebcdic_ii[i];
+               }
+               extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+             ac_cv_c_bigendian=yes
+           fi
+           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+             if test "$ac_cv_c_bigendian" = unknown; then
+               ac_cv_c_bigendian=no
+             else
+               # finding both strings is unlikely to happen, but who knows?
+               ac_cv_c_bigendian=unknown
+             fi
+           fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+
+            /* Are we little or big endian?  From Harbison&Steele.  */
+            union
+            {
+              long int l;
+              char c[sizeof (long int)];
+            } u;
+            u.l = 1;
+            return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_c_bigendian=no
+else
+  ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    fi
+fi
+:
+ case $ac_cv_c_bigendian in #(
+   yes)
+     gl_cv_cc_double_expbit0="word 0 bit 20";; #(
+   no)
+     gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
+   universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+     ;; #(
+   *)
+     gl_cv_cc_double_expbit0="unknown" ;;
+ esac
+
+
+fi
+rm -f conftest*
+
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { double value; unsigned int word[NWORDS]; } memory_double;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (double x)
+{
+  memory_double m;
+  size_t i;
+  /* Clear it first, in case sizeof (double) < sizeof (memory_double).  */
+  memset (&m, 0, sizeof (memory_double));
+  m.value = x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
+}
+int main ()
+{
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  add_to_ored_words (0.25);
+  add_to_ored_words (0.5);
+  add_to_ored_words (1.0);
+  add_to_ored_words (2.0);
+  add_to_ored_words (4.0);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_cc_double_expbit0=`cat conftest.out`
+else
+  gl_cv_cc_double_expbit0="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      rm -f conftest.out
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
+$as_echo "$gl_cv_cc_double_expbit0" >&6; }
+  case "$gl_cv_cc_double_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
+
+cat >>confdefs.h <<_ACEOF
+#define DBL_EXPBIT0_WORD $word
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define DBL_EXPBIT0_BIT $bit
+_ACEOF
+
+      ;;
+  esac
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5
+$as_echo_n "checking whether snprintf returns a byte count as in C99... " >&6; }
+if ${gl_cv_func_snprintf_retval_c99+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      if test "$cross_compiling" = yes; then :
+
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_snprintf_retval_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
+           darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_snprintf_retval_c99="guessing no";;
+           openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.10.
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
+           aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_snprintf_retval_c99="guessing no";;
+           netbsd*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_snprintf_retval_c99="guessing no";;
+         esac
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+  va_list args;
+  int ret;
+  va_start (args, format);
+  ret = vsnprintf (buf, size, format, args);
+  va_end (args);
+  return ret;
+}
+#endif
+static char buf[100];
+int main ()
+{
+  strcpy (buf, "ABCDEF");
+  if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7)
+    return 1;
+  if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+    return 2;
+  if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+    return 3;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_snprintf_retval_c99=yes
+else
+  gl_cv_func_snprintf_retval_c99=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5
+$as_echo "$gl_cv_func_snprintf_retval_c99" >&6; }
+
+
+
+
+
+
+
+  for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+      ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h>
+"
+if test "x$ac_cv_have_decl__snprintf" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL__SNPRINTF $ac_have_decl
 _ACEOF
 
 
 
+  case "$gl_cv_func_snprintf_retval_c99" in
+    *yes)
+
+$as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+
+
+
+
+
+  GNULIB_ACOSF=0;
+  GNULIB_ACOSL=0;
+  GNULIB_ASINF=0;
+  GNULIB_ASINL=0;
+  GNULIB_ATANF=0;
+  GNULIB_ATANL=0;
+  GNULIB_ATAN2F=0;
+  GNULIB_CBRT=0;
+  GNULIB_CBRTF=0;
+  GNULIB_CBRTL=0;
+  GNULIB_CEIL=0;
+  GNULIB_CEILF=0;
+  GNULIB_CEILL=0;
+  GNULIB_COPYSIGN=0;
+  GNULIB_COPYSIGNF=0;
+  GNULIB_COPYSIGNL=0;
+  GNULIB_COSF=0;
+  GNULIB_COSL=0;
+  GNULIB_COSHF=0;
+  GNULIB_EXPF=0;
+  GNULIB_EXPL=0;
+  GNULIB_EXP2=0;
+  GNULIB_EXP2F=0;
+  GNULIB_EXP2L=0;
+  GNULIB_EXPM1=0;
+  GNULIB_EXPM1F=0;
+  GNULIB_EXPM1L=0;
+  GNULIB_FABSF=0;
+  GNULIB_FABSL=0;
+  GNULIB_FLOOR=0;
+  GNULIB_FLOORF=0;
+  GNULIB_FLOORL=0;
+  GNULIB_FMA=0;
+  GNULIB_FMAF=0;
+  GNULIB_FMAL=0;
+  GNULIB_FMOD=0;
+  GNULIB_FMODF=0;
+  GNULIB_FMODL=0;
+  GNULIB_FREXPF=0;
+  GNULIB_FREXP=0;
+  GNULIB_FREXPL=0;
+  GNULIB_HYPOT=0;
+  GNULIB_HYPOTF=0;
+  GNULIB_HYPOTL=0;
+  GNULIB_ILOGB=0;
+  GNULIB_ILOGBF=0;
+  GNULIB_ILOGBL=0;
+  GNULIB_ISFINITE=0;
+  GNULIB_ISINF=0;
+  GNULIB_ISNAN=0;
+  GNULIB_ISNANF=0;
+  GNULIB_ISNAND=0;
+  GNULIB_ISNANL=0;
+  GNULIB_LDEXPF=0;
+  GNULIB_LDEXPL=0;
+  GNULIB_LOG=0;
+  GNULIB_LOGF=0;
+  GNULIB_LOGL=0;
+  GNULIB_LOG10=0;
+  GNULIB_LOG10F=0;
+  GNULIB_LOG10L=0;
+  GNULIB_LOG1P=0;
+  GNULIB_LOG1PF=0;
+  GNULIB_LOG1PL=0;
+  GNULIB_LOG2=0;
+  GNULIB_LOG2F=0;
+  GNULIB_LOG2L=0;
+  GNULIB_LOGB=0;
+  GNULIB_LOGBF=0;
+  GNULIB_LOGBL=0;
+  GNULIB_MODF=0;
+  GNULIB_MODFF=0;
+  GNULIB_MODFL=0;
+  GNULIB_POWF=0;
+  GNULIB_REMAINDER=0;
+  GNULIB_REMAINDERF=0;
+  GNULIB_REMAINDERL=0;
+  GNULIB_RINT=0;
+  GNULIB_RINTF=0;
+  GNULIB_RINTL=0;
+  GNULIB_ROUND=0;
+  GNULIB_ROUNDF=0;
+  GNULIB_ROUNDL=0;
+  GNULIB_SIGNBIT=0;
+  GNULIB_SINF=0;
+  GNULIB_SINL=0;
+  GNULIB_SINHF=0;
+  GNULIB_SQRTF=0;
+  GNULIB_SQRTL=0;
+  GNULIB_TANF=0;
+  GNULIB_TANL=0;
+  GNULIB_TANHF=0;
+  GNULIB_TRUNC=0;
+  GNULIB_TRUNCF=0;
+  GNULIB_TRUNCL=0;
+    HAVE_ACOSF=1;
+  HAVE_ACOSL=1;
+  HAVE_ASINF=1;
+  HAVE_ASINL=1;
+  HAVE_ATANF=1;
+  HAVE_ATANL=1;
+  HAVE_ATAN2F=1;
+  HAVE_CBRT=1;
+  HAVE_CBRTF=1;
+  HAVE_CBRTL=1;
+  HAVE_COPYSIGN=1;
+  HAVE_COPYSIGNL=1;
+  HAVE_COSF=1;
+  HAVE_COSL=1;
+  HAVE_COSHF=1;
+  HAVE_EXPF=1;
+  HAVE_EXPL=1;
+  HAVE_EXPM1=1;
+  HAVE_EXPM1F=1;
+  HAVE_FABSF=1;
+  HAVE_FABSL=1;
+  HAVE_FMA=1;
+  HAVE_FMAF=1;
+  HAVE_FMAL=1;
+  HAVE_FMODF=1;
+  HAVE_FMODL=1;
+  HAVE_FREXPF=1;
+  HAVE_HYPOTF=1;
+  HAVE_HYPOTL=1;
+  HAVE_ILOGB=1;
+  HAVE_ILOGBF=1;
+  HAVE_ILOGBL=1;
+  HAVE_ISNANF=1;
+  HAVE_ISNAND=1;
+  HAVE_ISNANL=1;
+  HAVE_LDEXPF=1;
+  HAVE_LOGF=1;
+  HAVE_LOGL=1;
+  HAVE_LOG10F=1;
+  HAVE_LOG10L=1;
+  HAVE_LOG1P=1;
+  HAVE_LOG1PF=1;
+  HAVE_LOG1PL=1;
+  HAVE_LOGBF=1;
+  HAVE_LOGBL=1;
+  HAVE_MODFF=1;
+  HAVE_MODFL=1;
+  HAVE_POWF=1;
+  HAVE_REMAINDER=1;
+  HAVE_REMAINDERF=1;
+  HAVE_RINT=1;
+  HAVE_RINTL=1;
+  HAVE_SINF=1;
+  HAVE_SINL=1;
+  HAVE_SINHF=1;
+  HAVE_SQRTF=1;
+  HAVE_SQRTL=1;
+  HAVE_TANF=1;
+  HAVE_TANL=1;
+  HAVE_TANHF=1;
+  HAVE_DECL_ACOSL=1;
+  HAVE_DECL_ASINL=1;
+  HAVE_DECL_ATANL=1;
+  HAVE_DECL_CBRTF=1;
+  HAVE_DECL_CBRTL=1;
+  HAVE_DECL_CEILF=1;
+  HAVE_DECL_CEILL=1;
+  HAVE_DECL_COPYSIGNF=1;
+  HAVE_DECL_COSL=1;
+  HAVE_DECL_EXPL=1;
+  HAVE_DECL_EXP2=1;
+  HAVE_DECL_EXP2F=1;
+  HAVE_DECL_EXP2L=1;
+  HAVE_DECL_EXPM1L=1;
+  HAVE_DECL_FLOORF=1;
+  HAVE_DECL_FLOORL=1;
+  HAVE_DECL_FREXPL=1;
+  HAVE_DECL_LDEXPL=1;
+  HAVE_DECL_LOGL=1;
+  HAVE_DECL_LOG10L=1;
+  HAVE_DECL_LOG2=1;
+  HAVE_DECL_LOG2F=1;
+  HAVE_DECL_LOG2L=1;
+  HAVE_DECL_LOGB=1;
+  HAVE_DECL_REMAINDER=1;
+  HAVE_DECL_REMAINDERL=1;
+  HAVE_DECL_RINTF=1;
+  HAVE_DECL_ROUND=1;
+  HAVE_DECL_ROUNDF=1;
+  HAVE_DECL_ROUNDL=1;
+  HAVE_DECL_SINL=1;
+  HAVE_DECL_SQRTL=1;
+  HAVE_DECL_TANL=1;
+  HAVE_DECL_TRUNC=1;
+  HAVE_DECL_TRUNCF=1;
+  HAVE_DECL_TRUNCL=1;
+  REPLACE_CBRTF=0;
+  REPLACE_CBRTL=0;
+  REPLACE_CEIL=0;
+  REPLACE_CEILF=0;
+  REPLACE_CEILL=0;
+  REPLACE_EXPM1=0;
+  REPLACE_EXPM1F=0;
+  REPLACE_EXP2=0;
+  REPLACE_EXP2L=0;
+  REPLACE_FABSL=0;
+  REPLACE_FLOOR=0;
+  REPLACE_FLOORF=0;
+  REPLACE_FLOORL=0;
+  REPLACE_FMA=0;
+  REPLACE_FMAF=0;
+  REPLACE_FMAL=0;
+  REPLACE_FMOD=0;
+  REPLACE_FMODF=0;
+  REPLACE_FMODL=0;
+  REPLACE_FREXPF=0;
+  REPLACE_FREXP=0;
+  REPLACE_FREXPL=0;
+  REPLACE_HUGE_VAL=0;
+  REPLACE_HYPOT=0;
+  REPLACE_HYPOTF=0;
+  REPLACE_HYPOTL=0;
+  REPLACE_ILOGB=0;
+  REPLACE_ILOGBF=0;
+  REPLACE_ISFINITE=0;
+  REPLACE_ISINF=0;
+  REPLACE_ISNAN=0;
+  REPLACE_LDEXPL=0;
+  REPLACE_LOG=0;
+  REPLACE_LOGF=0;
+  REPLACE_LOGL=0;
+  REPLACE_LOG10=0;
+  REPLACE_LOG10F=0;
+  REPLACE_LOG10L=0;
+  REPLACE_LOG1P=0;
+  REPLACE_LOG1PF=0;
+  REPLACE_LOG1PL=0;
+  REPLACE_LOG2=0;
+  REPLACE_LOG2F=0;
+  REPLACE_LOG2L=0;
+  REPLACE_LOGB=0;
+  REPLACE_LOGBF=0;
+  REPLACE_LOGBL=0;
+  REPLACE_MODF=0;
+  REPLACE_MODFF=0;
+  REPLACE_MODFL=0;
+  REPLACE_NAN=0;
+  REPLACE_REMAINDER=0;
+  REPLACE_REMAINDERF=0;
+  REPLACE_REMAINDERL=0;
+  REPLACE_ROUND=0;
+  REPLACE_ROUNDF=0;
+  REPLACE_ROUNDL=0;
+  REPLACE_SIGNBIT=0;
+  REPLACE_SIGNBIT_USING_GCC=0;
+  REPLACE_SQRTL=0;
+  REPLACE_TRUNC=0;
+  REPLACE_TRUNCF=0;
+  REPLACE_TRUNCL=0;
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
+$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; }
+if ${gl_cv_func_frexp_no_libm+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             double x;
+int
+main ()
+{
+int e; return frexp (x, &e) > 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func_frexp_no_libm=yes
+else
+  gl_cv_func_frexp_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
+$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdin defaults to large file offsets" >&5
+$as_echo_n "checking whether stdin defaults to large file offsets... " >&6; }
+if ${gl_cv_var_stdin_large_offset+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+#if defined __SL64 && defined __SCLE /* cygwin */
+  /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
+     fseeko/ftello needlessly fail.  This bug was fixed in 1.5.25, and
+     it is easier to do a version check than building a runtime test.  */
+# include <cygwin/version.h>
+# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
+  choke me
+# endif
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_var_stdin_large_offset=yes
+else
+  gl_cv_var_stdin_large_offset=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var_stdin_large_offset" >&5
+$as_echo "$gl_cv_var_stdin_large_offset" >&6; }
+
+
+
+
+
+  case "$host_os" in
+    mingw*)
+                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
+$as_echo_n "checking for 64-bit off_t... " >&6; }
+if ${gl_cv_type_off_t_64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+                int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_type_off_t_64=yes
+else
+  gl_cv_type_off_t_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
+$as_echo "$gl_cv_type_off_t_64" >&6; }
+      if test $gl_cv_type_off_t_64 = no; then
+        WINDOWS_64_BIT_OFF_T=1
+      else
+        WINDOWS_64_BIT_OFF_T=0
+      fi
+                  WINDOWS_64_BIT_ST_SIZE=1
+      ;;
+    *)
+                                                      WINDOWS_64_BIT_OFF_T=0
+      WINDOWS_64_BIT_ST_SIZE=0
+      ;;
+  esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_types_h='<'sys/types.h'>'
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
+$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
+if ${gl_cv_next_sys_types_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+
+_ACEOF
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'sys/types.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_sys_types_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
+$as_echo "$gl_cv_next_sys_types_h" >&6; }
+     fi
+     NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'sys/types.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_types_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+ac_fn_c_check_decl "$LINENO" "fseeko" "ac_cv_have_decl_fseeko" "$ac_includes_default"
+if test "x$ac_cv_have_decl_fseeko" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FSEEKO $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5
+$as_echo_n "checking for fseeko... " >&6; }
+if ${gl_cv_func_fseeko+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+
+int
+main ()
+{
+fseeko (stdin, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func_fseeko=yes
+else
+  gl_cv_func_fseeko=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5
+$as_echo "$gl_cv_func_fseeko" >&6; }
+
+
+  if test $ac_cv_have_decl_fseeko = no; then
+    HAVE_DECL_FSEEKO=0
+  fi
+
+  if test $gl_cv_func_fseeko = no; then
+    HAVE_FSEEKO=0
+  else
+    if test $WINDOWS_64_BIT_OFF_T = 1; then
+      REPLACE_FSEEKO=1
+    fi
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FSEEKO=1
+    fi
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
+$as_echo_n "checking whether fflush works on input streams... " >&6; }
+if ${gl_cv_func_fflush_stdin+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  echo hello world > conftest.txt
+     if test "$cross_compiling" = yes; then :
+        gl_cv_func_fflush_stdin=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
+
+int
+main ()
+{
+FILE *f = fopen ("conftest.txt", "r");
+         char buffer[10];
+         int fd;
+         int c;
+         if (f == NULL)
+           return 1;
+         fd = fileno (f);
+         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
+           return 2;
+         /* For deterministic results, ensure f read a bigger buffer.  */
+         if (lseek (fd, 0, SEEK_CUR) == 5)
+           return 3;
+         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
+            on BSD systems and on mingw.  */
+         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
+           return 4;
+         if (lseek (fd, 0, SEEK_CUR) != 5)
+           return 5;
+         /* Verify behaviour of fflush after ungetc. See
+            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
+         /* Verify behaviour of fflush after a backup ungetc.  This fails on
+            mingw.  */
+         c = fgetc (f);
+         ungetc (c, f);
+         fflush (f);
+         if (fgetc (f) != c)
+           return 6;
+         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
+            on glibc 2.8 and on BSD systems.  */
+         c = fgetc (f);
+         ungetc ('@', f);
+         fflush (f);
+         if (fgetc (f) != c)
+           return 7;
+         return 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_fflush_stdin=yes
+else
+  gl_cv_func_fflush_stdin=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+     rm conftest.txt
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
+$as_echo "$gl_cv_func_fflush_stdin" >&6; }
+
+      if test $gl_cv_func_fflush_stdin = no; then
+        REPLACE_FSEEKO=1
+      fi
+
+  fi
+
+
+     GNULIB_FCHMODAT=0;
+  GNULIB_FSTAT=0;
+  GNULIB_FSTATAT=0;
+  GNULIB_FUTIMENS=0;
+  GNULIB_LCHMOD=0;
+  GNULIB_LSTAT=0;
+  GNULIB_MKDIRAT=0;
+  GNULIB_MKFIFO=0;
+  GNULIB_MKFIFOAT=0;
+  GNULIB_MKNOD=0;
+  GNULIB_MKNODAT=0;
+  GNULIB_STAT=0;
+  GNULIB_UTIMENSAT=0;
+    HAVE_FCHMODAT=1;
+  HAVE_FSTATAT=1;
+  HAVE_FUTIMENS=1;
+  HAVE_LCHMOD=1;
+  HAVE_LSTAT=1;
+  HAVE_MKDIRAT=1;
+  HAVE_MKFIFO=1;
+  HAVE_MKFIFOAT=1;
+  HAVE_MKNOD=1;
+  HAVE_MKNODAT=1;
+  HAVE_UTIMENSAT=1;
+  REPLACE_FSTAT=0;
+  REPLACE_FSTATAT=0;
+  REPLACE_FUTIMENS=0;
+  REPLACE_LSTAT=0;
+  REPLACE_MKDIR=0;
+  REPLACE_MKFIFO=0;
+  REPLACE_MKNOD=0;
+  REPLACE_STAT=0;
+  REPLACE_UTIMENSAT=0;
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
+$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
+if ${ac_cv_header_stat_broken+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined S_ISBLK && defined S_IFDIR
+extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
+#endif
+
+#if defined S_ISBLK && defined S_IFCHR
+extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
+#endif
+
+#if defined S_ISLNK && defined S_IFREG
+extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
+#endif
+
+#if defined S_ISSOCK && defined S_IFREG
+extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stat_broken=no
+else
+  ac_cv_header_stat_broken=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
+$as_echo "$ac_cv_header_stat_broken" >&6; }
+if test $ac_cv_header_stat_broken = yes; then
+
+$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
+$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
+if ${gl_cv_next_sys_stat_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+             if test $ac_cv_header_sys_stat_h = yes; then
+
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/stat.h>
+
+_ACEOF
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'sys/stat.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+          else
+               gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+             fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
+$as_echo "$gl_cv_next_sys_stat_h" >&6; }
+     fi
+     NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'sys/stat.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_stat_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+  if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+
+$as_echo "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h
+
+  fi
+
+      ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
+     #include <sys/stat.h>
+"
+if test "x$ac_cv_type_nlink_t" = xyes; then :
+
+else
+
+$as_echo "#define nlink_t int" >>confdefs.h
+
+fi
+
+
+
+    for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat     mknod mknodat stat utimensat; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/stat.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
+else
+  eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+      done
+
+
+ac_fn_c_check_decl "$LINENO" "ftello" "ac_cv_have_decl_ftello" "$ac_includes_default"
+if test "x$ac_cv_have_decl_ftello" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FTELLO $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+  if test $ac_cv_have_decl_ftello = no; then
+    HAVE_DECL_FTELLO=0
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5
+$as_echo_n "checking for ftello... " >&6; }
+if ${gl_cv_func_ftello+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+ftello (stdin);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func_ftello=yes
+else
+  gl_cv_func_ftello=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5
+$as_echo "$gl_cv_func_ftello" >&6; }
+  if test $gl_cv_func_ftello = no; then
+    HAVE_FTELLO=0
+  else
+    if test $WINDOWS_64_BIT_OFF_T = 1; then
+      REPLACE_FTELLO=1
+    fi
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FTELLO=1
+    fi
+    if test $REPLACE_FTELLO = 0; then
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ftello works" >&5
+$as_echo_n "checking whether ftello works... " >&6; }
+if ${gl_cv_func_ftello_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+                              case "$host_os" in
+                      # Guess no on Solaris.
+            solaris*) gl_cv_func_ftello_works="guessing no" ;;
+                      # Guess yes otherwise.
+            *)        gl_cv_func_ftello_works="guessing yes" ;;
+          esac
+          if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define TESTFILE "conftest.tmp"
+int
+main (void)
+{
+  FILE *fp;
 
+  /* Create a file with some contents.  */
+  fp = fopen (TESTFILE, "w");
+  if (fp == NULL)
+    return 70;
+  if (fwrite ("foogarsh", 1, 8, fp) < 8)
+    return 71;
+  if (fclose (fp))
+    return 72;
 
+  /* The file's contents is now "foogarsh".  */
 
+  /* Try writing after reading to EOF.  */
+  fp = fopen (TESTFILE, "r+");
+  if (fp == NULL)
+    return 73;
+  if (fseek (fp, -1, SEEK_END))
+    return 74;
+  if (!(getc (fp) == 'h'))
+    return 1;
+  if (!(getc (fp) == EOF))
+    return 2;
+  if (!(ftell (fp) == 8))
+    return 3;
+  if (!(ftell (fp) == 8))
+    return 4;
+  if (!(putc ('!', fp) == '!'))
+    return 5;
+  if (!(ftell (fp) == 9))
+    return 6;
+  if (!(fclose (fp) == 0))
+    return 7;
+  fp = fopen (TESTFILE, "r");
+  if (fp == NULL)
+    return 75;
+  {
+    char buf[10];
+    if (!(fread (buf, 1, 10, fp) == 9))
+      return 10;
+    if (!(memcmp (buf, "foogarsh!", 9) == 0))
+      return 11;
+  }
+  if (!(fclose (fp) == 0))
+    return 12;
 
+  /* The file's contents is now "foogarsh!".  */
 
-  GNULIB_ACOSL=0;
-  GNULIB_ASINL=0;
-  GNULIB_ATANL=0;
-  GNULIB_CEILF=0;
-  GNULIB_CEILL=0;
-  GNULIB_COSL=0;
-  GNULIB_EXPL=0;
-  GNULIB_FLOORF=0;
-  GNULIB_FLOORL=0;
-  GNULIB_FREXP=0;
-  GNULIB_FREXPL=0;
-  GNULIB_ISFINITE=0;
-  GNULIB_ISINF=0;
-  GNULIB_ISNAN=0;
-  GNULIB_ISNANF=0;
-  GNULIB_ISNAND=0;
-  GNULIB_ISNANL=0;
-  GNULIB_LDEXPL=0;
-  GNULIB_LOGL=0;
-  GNULIB_ROUND=0;
-  GNULIB_ROUNDF=0;
-  GNULIB_ROUNDL=0;
-  GNULIB_SIGNBIT=0;
-  GNULIB_SINL=0;
-  GNULIB_SQRTL=0;
-  GNULIB_TANL=0;
-  GNULIB_TRUNC=0;
-  GNULIB_TRUNCF=0;
-  GNULIB_TRUNCL=0;
-    HAVE_ACOSL=1;
-  HAVE_ASINL=1;
-  HAVE_ATANL=1;
-  HAVE_COSL=1;
-  HAVE_EXPL=1;
-  HAVE_ISNANF=1;
-  HAVE_ISNAND=1;
-  HAVE_ISNANL=1;
-  HAVE_LOGL=1;
-  HAVE_SINL=1;
-  HAVE_SQRTL=1;
-  HAVE_TANL=1;
-  HAVE_DECL_ACOSL=1;
-  HAVE_DECL_ASINL=1;
-  HAVE_DECL_ATANL=1;
-  HAVE_DECL_COSL=1;
-  HAVE_DECL_EXPL=1;
-  HAVE_DECL_FREXPL=1;
-  HAVE_DECL_LDEXPL=1;
-  HAVE_DECL_LOGL=1;
-  HAVE_DECL_SINL=1;
-  HAVE_DECL_SQRTL=1;
-  HAVE_DECL_TANL=1;
-  HAVE_DECL_TRUNC=1;
-  HAVE_DECL_TRUNCF=1;
-  REPLACE_CEILF=0;
-  REPLACE_CEILL=0;
-  REPLACE_FLOORF=0;
-  REPLACE_FLOORL=0;
-  REPLACE_FREXP=0;
-  REPLACE_FREXPL=0;
-  REPLACE_HUGE_VAL=0;
-  REPLACE_ISFINITE=0;
-  REPLACE_ISINF=0;
-  REPLACE_ISNAN=0;
-  REPLACE_LDEXPL=0;
-  REPLACE_NAN=0;
-  REPLACE_ROUND=0;
-  REPLACE_ROUNDF=0;
-  REPLACE_ROUNDL=0;
-  REPLACE_SIGNBIT=0;
-  REPLACE_SIGNBIT_USING_GCC=0;
-  REPLACE_TRUNCL=0;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_ftello_works=yes
+else
+  gl_cv_func_ftello_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello_works" >&5
+$as_echo "$gl_cv_func_ftello_works" >&6; }
+      case "$gl_cv_func_ftello_works" in
+        *yes) ;;
+        *)
+          REPLACE_FTELLO=1
+
+$as_echo "#define FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE 1" >>confdefs.h
+
+          ;;
+      esac
+    fi
+  fi
+
+
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
+$as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
+if ${gl_cv_func_getcwd_null+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+                     # Guess yes on glibc systems.
+            *-gnu*)  gl_cv_func_getcwd_null="guessing yes";;
+                     # Guess yes on Cygwin.
+            cygwin*) gl_cv_func_getcwd_null="guessing yes";;
+                     # If we don't know, assume the worst.
+            *)       gl_cv_func_getcwd_null="guessing no";;
+          esac
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#        if HAVE_UNISTD_H
+#         include <unistd.h>
+#        else /* on Windows with MSVC */
+#         include <direct.h>
+#        endif
+#        ifndef getcwd
+         char *getcwd ();
+#        endif
+
+int
+main ()
+{
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* mingw cwd does not start with '/', but getcwd does allocate.
+   However, mingw fails to honor non-zero size.  */
+#else
+           if (chdir ("/") != 0)
+             return 1;
+           else
+             {
+               char *f = getcwd (NULL, 0);
+               if (! f)
+                 return 2;
+               if (f[0] != '/')
+                 return 3;
+               if (f[1] != '\0')
+                 return 4;
+               return 0;
+             }
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_getcwd_null=yes
+else
+  gl_cv_func_getcwd_null=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
+$as_echo "$gl_cv_func_getcwd_null" >&6; }
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
+$as_echo_n "checking for getcwd with POSIX signature... " >&6; }
+if ${gl_cv_func_getcwd_posix_signature+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+int
+main ()
+{
+extern
+           #ifdef __cplusplus
+           "C"
+           #endif
+           char *getcwd (char *, size_t);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_func_getcwd_posix_signature=yes
+else
+  gl_cv_func_getcwd_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
+$as_echo "$gl_cv_func_getcwd_posix_signature" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_getopt_h='<'getopt.h'>'
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5
+$as_echo_n "checking absolute name of <getopt.h>... " >&6; }
+if ${gl_cv_next_getopt_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+             if test $ac_cv_header_getopt_h = yes; then
+
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <getopt.h>
+
+_ACEOF
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'getopt.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_getopt_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+          else
+               gl_cv_next_getopt_h='<'getopt.h'>'
+             fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5
+$as_echo "$gl_cv_next_getopt_h" >&6; }
+     fi
+     NEXT_GETOPT_H=$gl_cv_next_getopt_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'getopt.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_getopt_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdin defaults to large file offsets" >&5
-$as_echo_n "checking whether stdin defaults to large file offsets... " >&6; }
-if test "${gl_cv_var_stdin_large_offset+set}" = set; then :
+
+
+  if test $ac_cv_header_getopt_h = yes; then
+    HAVE_GETOPT_H=1
+  else
+    HAVE_GETOPT_H=0
+  fi
+
+
+  gl_replace_getopt=
+
+    if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+    for ac_header in getopt.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
+if test "x$ac_cv_header_getopt_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETOPT_H 1
+_ACEOF
+
+else
+  gl_replace_getopt=yes
+fi
+
+done
+
+  fi
+
+    if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+    for ac_func in getopt_long_only
+do :
+  ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only"
+if test "x$ac_cv_func_getopt_long_only" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETOPT_LONG_ONLY 1
+_ACEOF
+
+else
+  gl_replace_getopt=yes
+fi
+done
+
+  fi
+
+                    if test -z "$gl_replace_getopt"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5
+$as_echo_n "checking whether getopt is POSIX compatible... " >&6; }
+if ${gl_cv_func_getopt_posix+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+                                                                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdio.h>
+#include <unistd.h>
 int
 main ()
 {
-#if defined __SL64 && defined __SCLE /* cygwin */
-  /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
-     fseeko/ftello needlessly fail.  This bug was fixed in 1.5.25, and
-     it is easier to do a version check than building a runtime test.  */
-# include <cygwin/version.h>
-# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
-  choke me
-# endif
-#endif
+int *p = &optreset; return optreset;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_var_stdin_large_offset=yes
+  gl_optind_min=1
 else
-  gl_cv_var_stdin_large_offset=no
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <getopt.h>
+int
+main ()
+{
+return !getopt_clip;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_optind_min=1
+else
+  gl_optind_min=0
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+
+                gl_save_CPPFLAGS=$CPPFLAGS
+        CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min"
+        if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+             mingw*)         gl_cv_func_getopt_posix="guessing no";;
+             darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
+             *)              gl_cv_func_getopt_posix="guessing yes";;
+           esac
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+  {
+    static char program[] = "program";
+    static char a[] = "-a";
+    static char foo[] = "foo";
+    static char bar[] = "bar";
+    char *argv[] = { program, a, foo, bar, NULL };
+    int c;
+
+    optind = OPTIND_MIN;
+    opterr = 0;
+
+    c = getopt (4, argv, "ab");
+    if (!(c == 'a'))
+      return 1;
+    c = getopt (4, argv, "ab");
+    if (!(c == -1))
+      return 2;
+    if (!(optind == 2))
+      return 3;
+  }
+  /* Some internal state exists at this point.  */
+  {
+    static char program[] = "program";
+    static char donald[] = "donald";
+    static char p[] = "-p";
+    static char billy[] = "billy";
+    static char duck[] = "duck";
+    static char a[] = "-a";
+    static char bar[] = "bar";
+    char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+    int c;
+
+    optind = OPTIND_MIN;
+    opterr = 0;
+
+    c = getopt (7, argv, "+abp:q:");
+    if (!(c == -1))
+      return 4;
+    if (!(strcmp (argv[0], "program") == 0))
+      return 5;
+    if (!(strcmp (argv[1], "donald") == 0))
+      return 6;
+    if (!(strcmp (argv[2], "-p") == 0))
+      return 7;
+    if (!(strcmp (argv[3], "billy") == 0))
+      return 8;
+    if (!(strcmp (argv[4], "duck") == 0))
+      return 9;
+    if (!(strcmp (argv[5], "-a") == 0))
+      return 10;
+    if (!(strcmp (argv[6], "bar") == 0))
+      return 11;
+    if (!(optind == 1))
+      return 12;
+  }
+  /* Detect MacOS 10.5, AIX 7.1 bug.  */
+  {
+    static char program[] = "program";
+    static char ab[] = "-ab";
+    char *argv[3] = { program, ab, NULL };
+    optind = OPTIND_MIN;
+    opterr = 0;
+    if (getopt (2, argv, "ab:") != 'a')
+      return 13;
+    if (getopt (2, argv, "ab:") != '?')
+      return 14;
+    if (optopt != 'b')
+      return 15;
+    if (optind != 2)
+      return 16;
+  }
+
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_getopt_posix=yes
+else
+  gl_cv_func_getopt_posix=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var_stdin_large_offset" >&5
-$as_echo "$gl_cv_var_stdin_large_offset" >&6; }
 
+        CPPFLAGS=$gl_save_CPPFLAGS
 
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
-$as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
-if test "${gl_cv_func_getcwd_null+set}" = set; then :
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5
+$as_echo "$gl_cv_func_getopt_posix" >&6; }
+    case "$gl_cv_func_getopt_posix" in
+      *no) gl_replace_getopt=yes ;;
+    esac
+  fi
+
+  if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5
+$as_echo_n "checking for working GNU getopt function... " >&6; }
+if ${gl_cv_func_getopt_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_getcwd_null="guessing yes";;
-                               # Guess yes on Cygwin.
-         cygwin*)              gl_cv_func_getcwd_null="guessing yes";;
-                               # Guess yes on mingw.
-         mingw*)               gl_cv_func_getcwd_null="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_getcwd_null="guessing no";;
+  # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
+       # optstring is necessary for programs like m4 that have POSIX-mandated
+       # semantics for supporting options interspersed with files.
+       # Also, since getopt_long is a GNU extension, we require optind=0.
+       # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
+       # so take care to revert to the correct (non-)export state.
+       gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
+       case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
+         xx) gl_had_POSIXLY_CORRECT=exported ;;
+         x)  gl_had_POSIXLY_CORRECT=yes      ;;
+         *)  gl_had_POSIXLY_CORRECT=         ;;
        esac
+       POSIXLY_CORRECT=1
+       export POSIXLY_CORRECT
+       if test "$cross_compiling" = yes; then :
+           case $host_os:$ac_cv_have_decl_optreset in
+           *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
+           *:yes)               gl_cv_func_getopt_gnu=no;;
+           *)                   gl_cv_func_getopt_gnu=yes;;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <getopt.h>
+                           #include <stddef.h>
+                           #include <string.h>
+
+#include <stdlib.h>
+#if defined __MACH__ && defined __APPLE__
+/* Avoid a crash on MacOS X.  */
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <mach/thread_status.h>
+#include <mach/exception.h>
+#include <mach/task.h>
+#include <pthread.h>
+/* The exception port on which our thread listens.  */
+static mach_port_t our_exception_port;
+/* The main function of the thread listening for exceptions of type
+   EXC_BAD_ACCESS.  */
+static void *
+mach_exception_thread (void *arg)
+{
+  /* Buffer for a message to be received.  */
+  struct {
+    mach_msg_header_t head;
+    mach_msg_body_t msgh_body;
+    char data[1024];
+  } msg;
+  mach_msg_return_t retval;
+  /* Wait for a message on the exception port.  */
+  retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
+                     our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+  if (retval != MACH_MSG_SUCCESS)
+    abort ();
+  exit (1);
+}
+static void
+nocrash_init (void)
+{
+  mach_port_t self = mach_task_self ();
+  /* Allocate a port on which the thread shall listen for exceptions.  */
+  if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
+      == KERN_SUCCESS) {
+    /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
+    if (mach_port_insert_right (self, our_exception_port, our_exception_port,
+                                MACH_MSG_TYPE_MAKE_SEND)
+        == KERN_SUCCESS) {
+      /* The exceptions we want to catch.  Only EXC_BAD_ACCESS is interesting
+         for us.  */
+      exception_mask_t mask = EXC_MASK_BAD_ACCESS;
+      /* Create the thread listening on the exception port.  */
+      pthread_attr_t attr;
+      pthread_t thread;
+      if (pthread_attr_init (&attr) == 0
+          && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
+          && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
+        pthread_attr_destroy (&attr);
+        /* Replace the exception port info for these exceptions with our own.
+           Note that we replace the exception port for the entire task, not only
+           for a particular thread.  This has the effect that when our exception
+           port gets the message, the thread specific exception port has already
+           been asked, and we don't need to bother about it.
+           See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
+        task_set_exception_ports (self, mask, our_exception_port,
+                                  EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
+      }
+    }
+  }
+}
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Avoid a crash on native Windows.  */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+    {
+    case EXCEPTION_ACCESS_VIOLATION:
+    case EXCEPTION_IN_PAGE_ERROR:
+    case EXCEPTION_STACK_OVERFLOW:
+    case EXCEPTION_GUARD_PAGE:
+    case EXCEPTION_PRIV_INSTRUCTION:
+    case EXCEPTION_ILLEGAL_INSTRUCTION:
+    case EXCEPTION_DATATYPE_MISALIGNMENT:
+    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+      exit (1);
+    }
+  return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
+#else
+/* Avoid a crash on POSIX systems.  */
+#include <signal.h>
+/* A POSIX signal handler.  */
+static void
+exception_handler (int sig)
+{
+  exit (1);
+}
+static void
+nocrash_init (void)
+{
+#ifdef SIGSEGV
+  signal (SIGSEGV, exception_handler);
+#endif
+#ifdef SIGBUS
+  signal (SIGBUS, exception_handler);
+#endif
+}
+#endif
 
-#        include <unistd.h>
-#        ifndef getcwd
-         char *getcwd ();
-#        endif
 
 int
 main ()
 {
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* mingw cwd does not start with '/', but getcwd does allocate.  */
-#else
-           if (chdir ("/") != 0)
-             return 1;
-           else
+             int result = 0;
+
+             nocrash_init();
+
+             /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
+                and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+                OSF/1 5.1, Solaris 10.  */
              {
-               char *f = getcwd (NULL, 0);
-               return ! (f && f[0] == '/' && !f[1]);
+               static char conftest[] = "conftest";
+               static char plus[] = "-+";
+               char *argv[3] = { conftest, plus, NULL };
+               opterr = 0;
+               if (getopt (2, argv, "+a") != '?')
+                 result |= 1;
              }
-#endif
+             /* This code succeeds on glibc 2.8, mingw,
+                and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+                IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x.  */
+             {
+               static char program[] = "program";
+               static char p[] = "-p";
+               static char foo[] = "foo";
+               static char bar[] = "bar";
+               char *argv[] = { program, p, foo, bar, NULL };
+
+               optind = 1;
+               if (getopt (4, argv, "p::") != 'p')
+                 result |= 2;
+               else if (optarg != NULL)
+                 result |= 4;
+               else if (getopt (4, argv, "p::") != -1)
+                 result |= 6;
+               else if (optind != 2)
+                 result |= 8;
+             }
+             /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0.  */
+             {
+               static char program[] = "program";
+               static char foo[] = "foo";
+               static char p[] = "-p";
+               char *argv[] = { program, foo, p, NULL };
+               optind = 0;
+               if (getopt (3, argv, "-p") != 1)
+                 result |= 16;
+               else if (getopt (3, argv, "-p") != 'p')
+                 result |= 32;
+             }
+             /* This code fails on glibc 2.11.  */
+             {
+               static char program[] = "program";
+               static char b[] = "-b";
+               static char a[] = "-a";
+               char *argv[] = { program, b, a, NULL };
+               optind = opterr = 0;
+               if (getopt (3, argv, "+:a:b") != 'b')
+                 result |= 64;
+               else if (getopt (3, argv, "+:a:b") != ':')
+                 result |= 64;
+             }
+             /* This code dumps core on glibc 2.14.  */
+             {
+               static char program[] = "program";
+               static char w[] = "-W";
+               static char dummy[] = "dummy";
+               char *argv[] = { program, w, dummy, NULL };
+               optind = opterr = 1;
+               if (getopt (3, argv, "W;") != 'W')
+                 result |= 128;
+             }
+             return result;
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_getcwd_null=yes
+  gl_cv_func_getopt_gnu=yes
 else
-  gl_cv_func_getcwd_null=no
+  gl_cv_func_getopt_gnu=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+       case $gl_had_POSIXLY_CORRECT in
+         exported) ;;
+         yes) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}; POSIXLY_CORRECT=1 ;;
+         *) { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;} ;;
+       esac
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
-$as_echo "$gl_cv_func_getcwd_null" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5
+$as_echo "$gl_cv_func_getopt_gnu" >&6; }
+    if test "$gl_cv_func_getopt_gnu" = "no"; then
+      gl_replace_getopt=yes
+    fi
+  fi
+
 
-ac_fn_c_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getcwd" = x""yes; then :
+
+
+
+    REPLACE_GETOPT=0
+
+
+  if test -n "$gl_replace_getopt"; then :
+
+      REPLACE_GETOPT=1
+
+fi
+
+
+  if test $REPLACE_GETOPT = 1; then
+
+  GETOPT_H=getopt.h
+
+$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
+
+
+
+  fi
+
+ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getenv" = xyes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
 fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETCWD $ac_have_decl
+#define HAVE_DECL_GETENV $ac_have_decl
+_ACEOF
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
+$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
+if ${ac_cv_c_restrict+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_restrict=no
+   # The order here caters to the fact that C++ does not require restrict.
+   for ac_kw in __restrict __restrict__ _Restrict restrict; do
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+typedef int * int_ptr;
+       int foo (int_ptr $ac_kw ip) {
+       return ip[0];
+       }
+int
+main ()
+{
+int s[1];
+       int * $ac_kw t = s;
+       t[0] = 0;
+       return foo(t)
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_restrict=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+     test "$ac_cv_c_restrict" != no && break
+   done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
+$as_echo "$ac_cv_c_restrict" >&6; }
+
+ case $ac_cv_c_restrict in
+   restrict) ;;
+   no) $as_echo "#define restrict /**/" >>confdefs.h
+ ;;
+   *)  cat >>confdefs.h <<_ACEOF
+#define restrict $ac_cv_c_restrict
 _ACEOF
+ ;;
+ esac
+
+
+  GNULIB_GETTIMEOFDAY=0;
+    HAVE_GETTIMEOFDAY=1;
+  HAVE_STRUCT_TIMEVAL=1;
+  HAVE_SYS_TIME_H=1;
+  REPLACE_GETTIMEOFDAY=0;
+  REPLACE_STRUCT_TIMEVAL=0;
+
+
+
 
 
 
@@ -9969,533 +12878,1426 @@ _ACEOF
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_getopt_h='<'getopt.h'>'
+       gl_cv_next_sys_time_h='<'sys/time.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5
-$as_echo_n "checking absolute name of <getopt.h>... " >&6; }
-if test "${gl_cv_next_getopt_h+set}" = set; then :
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
+$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
+if ${gl_cv_next_sys_time_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_getopt_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+             if test $ac_cv_header_sys_time_h = yes; then
+
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <getopt.h>
+#include <sys/time.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_getopt_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/getopt.h#{
-                 s#.*"\(.*/getopt.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'sys/time.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_sys_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
-            gl_cv_next_getopt_h='<'getopt.h'>'
-          fi
+               gl_cv_next_sys_time_h='<'sys/time.h'>'
+             fi
+
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5
-$as_echo "$gl_cv_next_getopt_h" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
+$as_echo "$gl_cv_next_sys_time_h" >&6; }
      fi
-     NEXT_GETOPT_H=$gl_cv_next_getopt_h
+     NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
 
      if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
-       gl_next_as_first_directive='<'getopt.h'>'
+       gl_next_as_first_directive='<'sys/time.h'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_getopt_h
+       gl_next_as_first_directive=$gl_cv_next_sys_time_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_GETOPT_H=$gl_next_as_first_directive
+     NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
 
 
 
 
-  if test $ac_cv_header_getopt_h = yes; then
-    HAVE_GETOPT_H=1
+
+  if test $ac_cv_header_sys_time_h != yes; then
+    HAVE_SYS_TIME_H=0
+  fi
+
+
+
+
+
+  if test $ac_cv_header_sys_socket_h != yes; then
+                    for ac_header in winsock2.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+
+done
+
+  fi
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    HAVE_WINSOCK2_H=1
+    UNISTD_H_HAVE_WINSOCK2_H=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
   else
-    HAVE_GETOPT_H=0
+    HAVE_WINSOCK2_H=0
   fi
 
 
-  gl_replace_getopt=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
+$as_echo_n "checking for struct timeval... " >&6; }
+if ${gl_cv_sys_struct_timeval+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if HAVE_SYS_TIME_H
+             #include <sys/time.h>
+            #endif
+            #include <time.h>
+            #if HAVE_WINSOCK2_H
+            # include <winsock2.h>
+            #endif
+
+int
+main ()
+{
+static struct timeval x; x.tv_sec = x.tv_usec;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_sys_struct_timeval=yes
+else
+  gl_cv_sys_struct_timeval=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
+$as_echo "$gl_cv_sys_struct_timeval" >&6; }
+  if test $gl_cv_sys_struct_timeval != yes; then
+    HAVE_STRUCT_TIMEVAL=0
+  else
+                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct struct timeval.tv_sec member" >&5
+$as_echo_n "checking for correct struct timeval.tv_sec member... " >&6; }
+if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if HAVE_SYS_TIME_H
+               #include <sys/time.h>
+              #endif
+              #include <time.h>
+              #if HAVE_WINSOCK2_H
+              # include <winsock2.h>
+              #endif
+
+int
+main ()
+{
+static struct timeval x;
+              typedef int verify_tv_sec_type[sizeof (x.tv_sec) == sizeof (time_t) ? 1 : -1];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_sys_struct_timeval_tv_sec=yes
+else
+  gl_cv_sys_struct_timeval_tv_sec=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
+$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
+    if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
+      REPLACE_STRUCT_TIMEVAL=1
+    fi
+  fi
+
+
+    for gl_func in gettimeofday; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <time.h>
 
-    if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
-    for ac_header in getopt.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
-if test "x$ac_cv_header_getopt_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETOPT_H 1
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
 _ACEOF
-
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
 else
-  gl_replace_getopt=yes
+  eval "$as_gl_Symbol=no"
 fi
-
-done
-
-  fi
-
-    if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
-    for ac_func in getopt_long_only
-do :
-  ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only"
-if test "x$ac_cv_func_getopt_long_only" = x""yes; then :
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_GETOPT_LONG_ONLY 1
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
 
-else
-  gl_replace_getopt=yes
+                     eval ac_cv_have_decl_$gl_func=yes
 fi
-done
+      done
 
-  fi
 
-          if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
-    ac_fn_c_check_decl "$LINENO" "optreset" "ac_cv_have_decl_optreset" "#include <getopt.h>
-"
-if test "x$ac_cv_have_decl_optreset" = x""yes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_OPTRESET $ac_have_decl
-_ACEOF
 
-  fi
 
-            if test -z "$gl_replace_getopt"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5
-$as_echo_n "checking whether getopt is POSIX compatible... " >&6; }
-if test "${gl_cv_func_getopt_posix+set}" = set; then :
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
+$as_echo_n "checking where to find the exponent in a 'float'... " >&6; }
+if ${gl_cv_cc_float_expbit0+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-                if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-             mingw*) gl_cv_func_getopt_posix="guessing no";;
-             *)      gl_cv_func_getopt_posix="guessing yes";;
-           esac
-
+      if test "$cross_compiling" = yes; then :
+  gl_cv_cc_float_expbit0="word 0 bit 23"
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <unistd.h>
-#include <stdlib.h>
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
 #include <string.h>
-
-#if !HAVE_DECL_OPTRESET
-# define OPTIND_MIN 0
-#else
-# define OPTIND_MIN 1
-#endif
-
-int
-main ()
+#define NWORDS \
+  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { float value; unsigned int word[NWORDS]; } memory_float;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (float x)
 {
-  {
-    int argc = 0;
-    char *argv[10];
-    int c;
-
-    argv[argc++] = "program";
-    argv[argc++] = "-a";
-    argv[argc++] = "foo";
-    argv[argc++] = "bar";
-    argv[argc] = NULL;
-    optind = OPTIND_MIN;
-    opterr = 0;
-
-    c = getopt (argc, argv, "ab");
-    if (!(c == 'a'))
-      return 1;
-    c = getopt (argc, argv, "ab");
-    if (!(c == -1))
-      return 2;
-    if (!(optind == 2))
-      return 3;
-  }
-  /* Some internal state exists at this point.  */
-  {
-    int argc = 0;
-    char *argv[10];
-    int c;
-
-    argv[argc++] = "program";
-    argv[argc++] = "donald";
-    argv[argc++] = "-p";
-    argv[argc++] = "billy";
-    argv[argc++] = "duck";
-    argv[argc++] = "-a";
-    argv[argc++] = "bar";
-    argv[argc] = NULL;
-    optind = OPTIND_MIN;
-    opterr = 0;
-
-    c = getopt (argc, argv, "+abp:q:");
-    if (!(c == -1))
-      return 4;
-    if (!(strcmp (argv[0], "program") == 0))
-      return 5;
-    if (!(strcmp (argv[1], "donald") == 0))
-      return 6;
-    if (!(strcmp (argv[2], "-p") == 0))
-      return 7;
-    if (!(strcmp (argv[3], "billy") == 0))
-      return 8;
-    if (!(strcmp (argv[4], "duck") == 0))
-      return 9;
-    if (!(strcmp (argv[5], "-a") == 0))
-      return 10;
-    if (!(strcmp (argv[6], "bar") == 0))
-      return 11;
-    if (!(optind == 1))
-      return 12;
-  }
-
-  return 0;
+  memory_float m;
+  size_t i;
+  /* Clear it first, in case
+     sizeof (float) < sizeof (memory_float).  */
+  memset (&m, 0, sizeof (memory_float));
+  m.value = x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
+}
+int main ()
+{
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  add_to_ored_words (0.25f);
+  add_to_ored_words (0.5f);
+  add_to_ored_words (1.0f);
+  add_to_ored_words (2.0f);
+  add_to_ored_words (4.0f);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
 }
 
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_getopt_posix=yes
+  gl_cv_cc_float_expbit0=`cat conftest.out`
 else
-  gl_cv_func_getopt_posix=no
+  gl_cv_cc_float_expbit0="unknown"
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+      rm -f conftest.out
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5
-$as_echo "$gl_cv_func_getopt_posix" >&6; }
-    case "$gl_cv_func_getopt_posix" in
-      *no) gl_replace_getopt=yes ;;
-    esac
-  fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5
+$as_echo "$gl_cv_cc_float_expbit0" >&6; }
+  case "$gl_cv_cc_float_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
 
-  if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5
-$as_echo_n "checking for working GNU getopt function... " >&6; }
-if test "${gl_cv_func_getopt_gnu+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
-       # optstring is necessary for programs like m4 that have POSIX-mandated
-       # semantics for supporting options interspersed with files.
-       # Also, since getopt_long is a GNU extension, we require optind=0.
-       gl_had_POSIXLY_CORRECT=${POSIXLY_CORRECT:+yes}
-       POSIXLY_CORRECT=1
-       export POSIXLY_CORRECT
-       if test "$cross_compiling" = yes; then :
-           case $host_os:$ac_cv_have_decl_optreset in
-           *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
-           *:yes)               gl_cv_func_getopt_gnu=no;;
-           *)                   gl_cv_func_getopt_gnu=yes;;
-         esac
+cat >>confdefs.h <<_ACEOF
+#define FLT_EXPBIT0_WORD $word
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define FLT_EXPBIT0_BIT $bit
+_ACEOF
 
+      ;;
+  esac
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
+$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
+if ${am_cv_langinfo_codeset+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <getopt.h>
-                           #include <stddef.h>
-                           #include <string.h>
-
+#include <langinfo.h>
 int
 main ()
 {
-
-             /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
-                and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
-                OSF/1 5.1, Solaris 10.  */
-             {
-               char *myargv[3];
-               myargv[0] = "conftest";
-               myargv[1] = "-+";
-               myargv[2] = 0;
-               opterr = 0;
-               if (getopt (2, myargv, "+a") != '?')
-                 return 1;
-             }
-             /* This code succeeds on glibc 2.8, mingw,
-                and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
-                IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x.  */
-             {
-               char *argv[] = { "program", "-p", "foo", "bar", NULL };
-
-               optind = 1;
-               if (getopt (4, argv, "p::") != 'p')
-                 return 2;
-               if (optarg != NULL)
-                 return 3;
-               if (getopt (4, argv, "p::") != -1)
-                 return 4;
-               if (optind != 2)
-                 return 5;
-             }
-             /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0.  */
-             {
-               char *argv[] = { "program", "foo", "-p", NULL };
-               optind = 0;
-               if (getopt (3, argv, "-p") != 1)
-                 return 6;
-               if (getopt (3, argv, "-p") != 'p')
-                 return 7;
-             }
-             return 0;
-
+char* cs = nl_langinfo(CODESET); return !cs;
   ;
   return 0;
 }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_getopt_gnu=yes
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  am_cv_langinfo_codeset=yes
 else
-  gl_cv_func_getopt_gnu=no
+  am_cv_langinfo_codeset=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
+$as_echo "$am_cv_langinfo_codeset" >&6; }
+  if test $am_cv_langinfo_codeset = yes; then
 
-       if test "$gl_had_POSIXLY_CORRECT" != yes; then
-         { POSIXLY_CORRECT=; unset POSIXLY_CORRECT;}
-       fi
+$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5
-$as_echo "$gl_cv_func_getopt_gnu" >&6; }
-    if test "$gl_cv_func_getopt_gnu" = "no"; then
-      gl_replace_getopt=yes
-    fi
   fi
 
-ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getenv" = x""yes; then :
+ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
+if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
 fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETENV $ac_have_decl
+#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
 _ACEOF
 
 
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5
+$as_echo_n "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; }
+if ${ac_cv_gnu_library_2_1+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+  Lucky GNU user
+ #endif
+#endif
+#ifdef __UCLIBC__
+ Lucky user
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Lucky" >/dev/null 2>&1; then :
+  ac_cv_gnu_library_2_1=yes
+else
+  ac_cv_gnu_library_2_1=no
+fi
+rm -f conftest*
 
 
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5
+$as_echo "$ac_cv_gnu_library_2_1" >&6; }
 
-  if test -n "$gl_replace_getopt"; then :
+    GLIBC21="$ac_cv_gnu_library_2_1"
 
 
 
-  GETOPT_H=getopt.h
+      if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  prefix="$acl_save_prefix"
 
-$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
 
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
 
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
+$as_echo_n "checking for ld used by GCC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${acl_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      acl_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+      *GNU* | *'with BFD'*)
+        test "$with_gnu_ld" != no && break ;;
+      *)
+        test "$with_gnu_ld" != yes && break ;;
+      esac
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
 
-    GNULIB_UNISTD_H_GETOPT=1
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${acl_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  acl_cv_prog_gnu_ld=yes ;;
+*)
+  acl_cv_prog_gnu_ld=no ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
+$as_echo "$acl_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$acl_cv_prog_gnu_ld
 
 
 
 
+                                                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
+$as_echo_n "checking for shared library run path origin... " >&6; }
+if ${acl_cv_rpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+    . ./conftest.sh
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
+$as_echo "$acl_cv_rpath" >&6; }
+  wl="$acl_cv_wl"
+  acl_libext="$acl_cv_libext"
+  acl_shlibext="$acl_cv_shlibext"
+  acl_libname_spec="$acl_cv_libname_spec"
+  acl_library_names_spec="$acl_cv_library_names_spec"
+  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  acl_hardcode_direct="$acl_cv_hardcode_direct"
+  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+    # Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then :
+  enableval=$enable_rpath; :
+else
+  enable_rpath=yes
+fi
 
 
-  gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
 
 
+  acl_libdirstem=lib
+  acl_libdirstem2=
+  case "$host_os" in
+    solaris*)
+                                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
+$as_echo_n "checking for 64-bit host... " >&6; }
+if ${gl_cv_solaris_64bit+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#ifdef _LP64
+sixtyfour bits
+#endif
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "sixtyfour bits" >/dev/null 2>&1; then :
+  gl_cv_solaris_64bit=yes
+else
+  gl_cv_solaris_64bit=no
+fi
+rm -f conftest*
 
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5
+$as_echo "$gl_cv_solaris_64bit" >&6; }
+      if test $gl_cv_solaris_64bit = yes; then
+        acl_libdirstem=lib/64
+        case "$host_cpu" in
+          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
+          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+        esac
+      fi
+      ;;
+    *)
+      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+      if test -n "$searchpath"; then
+        acl_save_IFS="${IFS=   }"; IFS=":"
+        for searchdir in $searchpath; do
+          if test -d "$searchdir"; then
+            case "$searchdir" in
+              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+              */../ | */.. )
+                # Better ignore directories of this form. They are misleading.
+                ;;
+              *) searchdir=`cd "$searchdir" && pwd`
+                 case "$searchdir" in
+                   */lib64 ) acl_libdirstem=lib64 ;;
+                 esac ;;
+            esac
+          fi
+        done
+        IFS="$acl_save_IFS"
+      fi
+      ;;
+  esac
+  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
+  gl_threads_api=none
+  LIBTHREAD=
+  LTLIBTHREAD=
+  LIBMULTITHREAD=
+  LTLIBMULTITHREAD=
+  if test "$gl_use_threads" != no; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
+$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
+if ${gl_cv_have_weak+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  gl_cv_have_weak=no
+              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+extern void xyzzy ();
+#pragma weak xyzzy
+int
+main ()
+{
+xyzzy();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_have_weak=maybe
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+       if test $gl_cv_have_weak = maybe; then
+                           if test "$cross_compiling" = yes; then :
+                          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __ELF__
+               Extensible Linking Format
+               #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
+  gl_cv_have_weak="guessing yes"
+else
+  gl_cv_have_weak="guessing no"
+fi
+rm -f conftest*
+
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+  return (fputs == NULL);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_have_weak=yes
+else
+  gl_cv_have_weak=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+       fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
+$as_echo "$gl_cv_have_weak" >&6; }
+    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+      # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
+      ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+  gl_have_pthread_h=yes
+else
+  gl_have_pthread_h=no
+fi
+
+
+      if test "$gl_have_pthread_h" = yes; then
+        # Other possible tests:
+        #   -lpthreads (FSU threads, PCthreads)
+        #   -lgthreads
+        gl_have_pthread=
+        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+        # the second one only in libpthread, and lock.c needs it.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+pthread_mutex_lock((pthread_mutex_t*)0);
+               pthread_mutexattr_init((pthread_mutexattr_t*)0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_have_pthread=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+        # since it is defined as a macro on OSF/1.)
+        if test -n "$gl_have_pthread"; then
+          # The program links fine without libpthread. But it may actually
+          # need to link with libpthread in order to create multiple threads.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthread_pthread_kill=yes
+else
+  ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
+  LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+             # On Solaris and HP-UX, most pthread functions exist also in libc.
+             # Therefore pthread_in_use() needs to actually try to create a
+             # thread: pthread_create from libc will fail, whereas
+             # pthread_create will actually create a thread.
+             case "$host_os" in
+               solaris* | hpux*)
 
+$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
+
+             esac
 
+fi
 
+        else
+          # Some library is needed. Try libpthread and libc_r.
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthread_pthread_kill=yes
+else
+  ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
+  gl_have_pthread=yes
+             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
+             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+fi
 
+          if test -z "$gl_have_pthread"; then
+            # For FreeBSD 4.
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
+$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
+if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_kill ();
+int
+main ()
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_r_pthread_kill=yes
+else
+  ac_cv_lib_c_r_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
+$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
+  gl_have_pthread=yes
+               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
+               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r
 fi
 
+          fi
+        fi
+        if test -n "$gl_have_pthread"; then
+          gl_threads_api=posix
 
+$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
 
+          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
+            if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
 
+$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
 
+              LIBTHREAD=
+              LTLIBTHREAD=
+            fi
+          fi
+        fi
+      fi
+    fi
+    if test -z "$gl_have_pthread"; then
+      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
+        gl_have_solaristhread=
+        gl_save_LIBS="$LIBS"
+        LIBS="$LIBS -lthread"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <thread.h>
+#include <synch.h>
 
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
-$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
-if test "${ac_cv_c_restrict+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_restrict=no
-   # The order here caters to the fact that C++ does not require restrict.
-   for ac_kw in __restrict __restrict__ _Restrict restrict; do
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-typedef int * int_ptr;
-        int foo (int_ptr $ac_kw ip) {
-        return ip[0];
-       }
 int
 main ()
 {
-int s[1];
-        int * $ac_kw t = s;
-        t[0] = 0;
-        return foo(t)
+thr_self();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_restrict=$ac_kw
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_have_solaristhread=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-     test "$ac_cv_c_restrict" != no && break
-   done
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        LIBS="$gl_save_LIBS"
+        if test -n "$gl_have_solaristhread"; then
+          gl_threads_api=solaris
+          LIBTHREAD=-lthread
+          LTLIBTHREAD=-lthread
+          LIBMULTITHREAD="$LIBTHREAD"
+          LTLIBMULTITHREAD="$LTLIBTHREAD"
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
-$as_echo "$ac_cv_c_restrict" >&6; }
+$as_echo "#define USE_SOLARIS_THREADS 1" >>confdefs.h
 
- case $ac_cv_c_restrict in
-   restrict) ;;
-   no) $as_echo "#define restrict /**/" >>confdefs.h
- ;;
-   *)  cat >>confdefs.h <<_ACEOF
-#define restrict $ac_cv_c_restrict
-_ACEOF
- ;;
- esac
+          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
 
+$as_echo "#define USE_SOLARIS_THREADS_WEAK 1" >>confdefs.h
 
+            LIBTHREAD=
+            LTLIBTHREAD=
+          fi
+        fi
+      fi
+    fi
+    if test "$gl_use_threads" = pth; then
+      gl_save_CPPFLAGS="$CPPFLAGS"
 
 
 
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libpth" >&5
+$as_echo_n "checking how to link with libpth... " >&6; }
+if ${ac_cv_libpth_libs+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
 
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_sys_time_h='<'sys/time.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
-$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
-if test "${gl_cv_next_sys_time_h+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-          if test $ac_cv_header_sys_time_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/time.h>
 
-_ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_sys_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/sys/time.h#{
-                 s#.*"\(.*/sys/time.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_sys_time_h='<'sys/time.h'>'
-          fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
-$as_echo "$gl_cv_next_sys_time_h" >&6; }
-     fi
-     NEXT_SYS_TIME_H=$gl_cv_next_sys_time_h
+    use_additional=yes
 
-     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
-       gl_next_as_first_directive='<'sys/time.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_sys_time_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
 
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
 
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 
 
-  if test $ac_cv_header_sys_time_h = yes; then
-    HAVE_SYS_TIME_H=1
-  else
-    HAVE_SYS_TIME_H=0
-  fi
+# Check whether --with-libpth-prefix was given.
+if test "${with_libpth_prefix+set}" = set; then :
+  withval=$with_libpth_prefix;
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
 
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
-$as_echo_n "checking for struct timeval... " >&6; }
-if test "${gl_cv_sys_struct_timeval+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if HAVE_SYS_TIME_H
-             #include <sys/time.h>
-            #endif
-            #include <time.h>
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
 
-int
-main ()
-{
-static struct timeval x; x.tv_sec = x.tv_usec;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_sys_struct_timeval=yes
-else
-  gl_cv_sys_struct_timeval=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
-$as_echo "$gl_cv_sys_struct_timeval" >&6; }
-  if test $gl_cv_sys_struct_timeval = yes; then
-    HAVE_STRUCT_TIMEVAL=1
-  else
-    HAVE_STRUCT_TIMEVAL=0
-  fi
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+        if test "$acl_libdirstem2" != "$acl_libdirstem" \
+           && ! test -d "$withval/$acl_libdirstem"; then
+          additional_libdir="$withval/$acl_libdirstem2"
+        fi
+      fi
+    fi
 
-    REPLACE_GETTIMEOFDAY=0
+fi
 
-  if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then
-    SYS_TIME_H=sys/time.h
-  else
-    SYS_TIME_H=
+      LIBPTH=
+  LTLIBPTH=
+  INCPTH=
+  LIBPTH_PREFIX=
+      HAVE_LIBPTH=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='pth '
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIBPTH="${LIBPTH}${LIBPTH:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$value"
+          else
+                                    :
+          fi
+        else
+                              found_dir=
+          found_la=
+          found_so=
+          found_a=
+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
+          if test -n "$acl_shlibext"; then
+            shrext=".$acl_shlibext"             # typically: shrext=.so
+          else
+            shrext=
+          fi
+          if test $use_additional = yes; then
+            dir="$additional_libdir"
+                                    if test -n "$acl_shlibext"; then
+              if test -f "$dir/$libname$shrext"; then
+                found_dir="$dir"
+                found_so="$dir/$libname$shrext"
+              else
+                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                  ver=`(cd "$dir" && \
+                        for f in "$libname$shrext".*; do echo "$f"; done \
+                        | sed -e "s,^$libname$shrext\\\\.,," \
+                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                        | sed 1q ) 2>/dev/null`
+                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                    found_dir="$dir"
+                    found_so="$dir/$libname$shrext.$ver"
+                  fi
+                else
+                  eval library_names=\"$acl_library_names_spec\"
+                  for f in $library_names; do
+                    if test -f "$dir/$f"; then
+                      found_dir="$dir"
+                      found_so="$dir/$f"
+                      break
+                    fi
+                  done
+                fi
+              fi
+            fi
+                        if test "X$found_dir" = "X"; then
+              if test -f "$dir/$libname.$acl_libext"; then
+                found_dir="$dir"
+                found_a="$dir/$libname.$acl_libext"
+              fi
+            fi
+            if test "X$found_dir" != "X"; then
+              if test -f "$dir/$libname.la"; then
+                found_la="$dir/$libname.la"
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIBPTH; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                                    if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+                        LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+                                                        if test "$enable_rpath" = no \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+                                LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+              else
+                                                                                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                                if test "$acl_hardcode_direct" = yes; then
+                                                      LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+                else
+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+                                                            LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+                                                            haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                                                                                haveit=
+                    for x in $LDFLAGS $LIBPTH; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir"
+                    fi
+                    if test "$acl_hardcode_minus_L" != no; then
+                                                                                        LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+                    else
+                                                                                                                                                                                LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                                LIBPTH="${LIBPTH}${LIBPTH:+ }$found_a"
+              else
+                                                LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir -l$name"
+              fi
+            fi
+                        additional_includedir=
+            case "$found_dir" in
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                if test "$name" = 'pth'; then
+                  LIBPTH_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem2 | */$acl_libdirstem2/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+                if test "$name" = 'pth'; then
+                  LIBPTH_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INCPTH; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                                            INCPTH="${INCPTH}${INCPTH:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+                        if test -n "$found_la"; then
+                                                        save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+                            for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIBPTH; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LIBPTH="${LIBPTH}${LIBPTH:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIBPTH; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                                                                  haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                                                                  haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                                        LIBPTH="${LIBPTH}${LIBPTH:+ }$dep"
+                    LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+                                                            LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name"
+            LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
+                        alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+      done
+            acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIBPTH="${LIBPTH}${LIBPTH:+ }$flag"
+    else
+            for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIBPTH="${LIBPTH}${LIBPTH:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+            for found_dir in $ltrpathdirs; do
+      LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-R$found_dir"
+    done
   fi
 
 
@@ -10503,207 +14305,139 @@ $as_echo "$gl_cv_sys_struct_timeval" >&6; }
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
-$as_echo_n "checking where to find the exponent in a 'float'... " >&6; }
-if test "${gl_cv_cc_float_expbit0+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-      if test "$cross_compiling" = yes; then :
-  gl_cv_cc_float_expbit0="word 0 bit 23"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
-  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { float value; unsigned int word[NWORDS]; } memory_float;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (float x)
-{
-  memory_float m;
-  size_t i;
-  /* Clear it first, in case
-     sizeof (float) < sizeof (memory_float).  */
-  memset (&m, 0, sizeof (memory_float));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
-}
-int main ()
-{
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25f);
-  add_to_ored_words (0.5f);
-  add_to_ored_words (1.0f);
-  add_to_ored_words (2.0f);
-  add_to_ored_words (4.0f);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
-}
+    ac_cv_libpth_libs="$LIBPTH"
+    ac_cv_libpth_ltlibs="$LTLIBPTH"
+    ac_cv_libpth_cppflags="$INCPTH"
+    ac_cv_libpth_prefix="$LIBPTH_PREFIX"
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_float_expbit0=`cat conftest.out`
-else
-  gl_cv_cc_float_expbit0="unknown"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libpth_libs" >&5
+$as_echo "$ac_cv_libpth_libs" >&6; }
+  LIBPTH="$ac_cv_libpth_libs"
+  LTLIBPTH="$ac_cv_libpth_ltlibs"
+  INCPTH="$ac_cv_libpth_cppflags"
+  LIBPTH_PREFIX="$ac_cv_libpth_prefix"
 
-      rm -f conftest.out
+  for element in $INCPTH; do
+    haveit=
+    for x in $CPPFLAGS; do
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5
-$as_echo "$gl_cv_cc_float_expbit0" >&6; }
-  case "$gl_cv_cc_float_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 
-cat >>confdefs.h <<_ACEOF
-#define FLT_EXPBIT0_WORD $word
-_ACEOF
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+    fi
+  done
 
 
-cat >>confdefs.h <<_ACEOF
-#define FLT_EXPBIT0_BIT $bit
-_ACEOF
 
-      ;;
-  esac
 
+      HAVE_LIBPTH=yes
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
-$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
-if test "${am_cv_langinfo_codeset+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      gl_have_pth=
+      gl_save_LIBS="$LIBS"
+      LIBS="$LIBS $LIBPTH"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <langinfo.h>
+#include <pth.h>
 int
 main ()
 {
-char* cs = nl_langinfo(CODESET); return !cs;
+pth_self();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  am_cv_langinfo_codeset=yes
-else
-  am_cv_langinfo_codeset=no
+  gl_have_pth=yes
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+      LIBS="$gl_save_LIBS"
+      if test -n "$gl_have_pth"; then
+        gl_threads_api=pth
+        LIBTHREAD="$LIBPTH"
+        LTLIBTHREAD="$LTLIBPTH"
+        LIBMULTITHREAD="$LIBTHREAD"
+        LTLIBMULTITHREAD="$LTLIBTHREAD"
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
-$as_echo "$am_cv_langinfo_codeset" >&6; }
-  if test $am_cv_langinfo_codeset = yes; then
+$as_echo "#define USE_PTH_THREADS 1" >>confdefs.h
 
-$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
+        if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
+          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
 
-  fi
+$as_echo "#define USE_PTH_THREADS_WEAK 1" >>confdefs.h
 
-ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getc_unlocked" = x""yes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+            LIBTHREAD=
+            LTLIBTHREAD=
+          fi
+        fi
+      else
+        CPPFLAGS="$gl_save_CPPFLAGS"
+      fi
+    fi
+    if test -z "$gl_have_pthread"; then
+      case "$gl_use_threads" in
+        yes | windows | win32) # The 'win32' is for backward compatibility.
+          if { case "$host_os" in
+                 mingw*) true;;
+                 *) false;;
+               esac
+             }; then
+            gl_threads_api=windows
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
-_ACEOF
+$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
 
+          fi
+          ;;
+      esac
+    fi
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
+$as_echo_n "checking for multithread API to use... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
+$as_echo "$gl_threads_api" >&6; }
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library 2.1 or newer" >&5
-$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; }
-if test "${ac_cv_gnu_library_2_1+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
-  Lucky GNU user
- #endif
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
-  ac_cv_gnu_library_2_1=yes
-else
-  ac_cv_gnu_library_2_1=no
-fi
-rm -f conftest*
 
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5
-$as_echo "$ac_cv_gnu_library_2_1" >&6; }
 
-    GLIBC21="$ac_cv_gnu_library_2_1"
 
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
 $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
-if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then :
+if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   rm -f conftest.sym conftest.file
-echo >conftest.file
-if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_lstat_dereferences_slashed_symlink=no
+     echo >conftest.file
+     if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
+       if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+                    # Guess yes on glibc systems.
+            *-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+                    # If we don't know, assume the worst.
+            *)      gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
+          esac
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -10712,53 +14446,43 @@ int
 main ()
 {
 struct stat sbuf;
-     /* Linux will dereference the symlink and fail, as required by POSIX.
-       That is better in the sense that it means we will not
-       have to compile and use the lstat wrapper.  */
-     return lstat ("conftest.sym/", &sbuf) == 0;
+              /* Linux will dereference the symlink and fail, as required by
+                 POSIX.  That is better in the sense that it means we will not
+                 have to compile and use the lstat wrapper.  */
+              return lstat ("conftest.sym/", &sbuf) == 0;
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_lstat_dereferences_slashed_symlink=yes
+  gl_cv_func_lstat_dereferences_slashed_symlink=yes
 else
-  ac_cv_func_lstat_dereferences_slashed_symlink=no
+  gl_cv_func_lstat_dereferences_slashed_symlink=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-else
-  # If the `ln -s' command failed, then we probably don't even
-  # have an lstat function.
-  ac_cv_func_lstat_dereferences_slashed_symlink=no
-fi
-rm -f conftest.sym conftest.file
+     else
+       # If the 'ln -s' command failed, then we probably don't even
+       # have an lstat function.
+       gl_cv_func_lstat_dereferences_slashed_symlink="guessing no"
+     fi
+     rm -f conftest.sym conftest.file
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
-$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
-
-test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
+$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+  case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+    *yes)
 
 cat >>confdefs.h <<_ACEOF
 #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
 _ACEOF
 
-
-if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
-
-fi
+      ;;
+  esac
 
 
 
   GNULIB_WCSRTOMBS=0;
   GNULIB_WCSNRTOMBS=0;
   GNULIB_WCWIDTH=0;
+  GNULIB_WMEMCHR=0;
+  GNULIB_WMEMCMP=0;
+  GNULIB_WMEMCPY=0;
+  GNULIB_WMEMMOVE=0;
+  GNULIB_WMEMSET=0;
+  GNULIB_WCSLEN=0;
+  GNULIB_WCSNLEN=0;
+  GNULIB_WCSCPY=0;
+  GNULIB_WCPCPY=0;
+  GNULIB_WCSNCPY=0;
+  GNULIB_WCPNCPY=0;
+  GNULIB_WCSCAT=0;
+  GNULIB_WCSNCAT=0;
+  GNULIB_WCSCMP=0;
+  GNULIB_WCSNCMP=0;
+  GNULIB_WCSCASECMP=0;
+  GNULIB_WCSNCASECMP=0;
+  GNULIB_WCSCOLL=0;
+  GNULIB_WCSXFRM=0;
+  GNULIB_WCSDUP=0;
+  GNULIB_WCSCHR=0;
+  GNULIB_WCSRCHR=0;
+  GNULIB_WCSCSPN=0;
+  GNULIB_WCSSPN=0;
+  GNULIB_WCSPBRK=0;
+  GNULIB_WCSSTR=0;
+  GNULIB_WCSTOK=0;
+  GNULIB_WCSWIDTH=0;
     HAVE_BTOWC=1;
   HAVE_MBSINIT=1;
   HAVE_MBRTOWC=1;
   HAVE_WCRTOMB=1;
   HAVE_WCSRTOMBS=1;
   HAVE_WCSNRTOMBS=1;
+  HAVE_WMEMCHR=1;
+  HAVE_WMEMCMP=1;
+  HAVE_WMEMCPY=1;
+  HAVE_WMEMMOVE=1;
+  HAVE_WMEMSET=1;
+  HAVE_WCSLEN=1;
+  HAVE_WCSNLEN=1;
+  HAVE_WCSCPY=1;
+  HAVE_WCPCPY=1;
+  HAVE_WCSNCPY=1;
+  HAVE_WCPNCPY=1;
+  HAVE_WCSCAT=1;
+  HAVE_WCSNCAT=1;
+  HAVE_WCSCMP=1;
+  HAVE_WCSNCMP=1;
+  HAVE_WCSCASECMP=1;
+  HAVE_WCSNCASECMP=1;
+  HAVE_WCSCOLL=1;
+  HAVE_WCSXFRM=1;
+  HAVE_WCSDUP=1;
+  HAVE_WCSCHR=1;
+  HAVE_WCSRCHR=1;
+  HAVE_WCSCSPN=1;
+  HAVE_WCSSPN=1;
+  HAVE_WCSPBRK=1;
+  HAVE_WCSSTR=1;
+  HAVE_WCSTOK=1;
+  HAVE_WCSWIDTH=1;
   HAVE_DECL_WCTOB=1;
   HAVE_DECL_WCWIDTH=1;
   REPLACE_MBSTATE_T=0;
   REPLACE_WCSRTOMBS=0;
   REPLACE_WCSNRTOMBS=0;
   REPLACE_WCWIDTH=0;
+  REPLACE_WCSWIDTH=0;
 
 
 
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
 $as_echo_n "checking for mbstate_t... " >&6; }
-if test "${ac_cv_type_mbstate_t+set}" = set; then :
+if ${ac_cv_type_mbstate_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
-#           include <wchar.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
 int
 main ()
 {
@@ -10845,7 +14633,7 @@ $as_echo "#define mbstate_t int" >>confdefs.h
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
 $as_echo_n "checking for a traditional japanese locale... " >&6; }
-if test "${gt_cv_locale_ja+set}" = set; then :
+if ${gt_cv_locale_ja+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -10865,17 +14653,30 @@ int main ()
 {
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+     category of the locale to "C".  */
+  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+    return 1;
+#else
   if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
      On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
      succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
 #if HAVE_LANGINFO_CODESET
   {
     const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
       return 1;
   }
 #endif
@@ -10890,7 +14691,7 @@ int main ()
   if (MB_CUR_MAX == 1)
     return 1;
   /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding.  */
+     This excludes the UTF-8 encoding (except on MirBSD).  */
   t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
   if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
   for (p = buf; *p != '\0'; p++)
@@ -10905,42 +14706,58 @@ _ACEOF
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the AIX locale name.
-      if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_ja=ja_JP
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_ja=ja_JP.EUC-JP
-        else
-          # Test for the HP-UX, OSF/1, NetBSD locale name.
-          if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_ja=ja_JP.eucJP
+      case "$host_os" in
+        # Handle native Windows specially, because there setlocale() interprets
+        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+        # "fr" or "fra" as "French" or "French_France.1252",
+        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+        # "ja" as "Japanese" or "Japanese_Japan.932",
+        # and similar.
+        mingw*)
+          # Note that on native Windows, the Japanese locale is
+          # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
+          # cannot use it here.
+          gt_cv_locale_ja=none
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # configure script would override the LC_ALL setting. Likewise for
+          # LC_CTYPE, which is also set at the beginning of the configure script.
+          # Test for the AIX locale name.
+          if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_ja=ja_JP
           else
-            # Test for the IRIX, FreeBSD locale name.
-            if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-              gt_cv_locale_ja=ja_JP.EUC
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_ja=ja_JP.EUC-JP
             else
-              # Test for the Solaris 7 locale name.
-              if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-                gt_cv_locale_ja=ja
+              # Test for the HP-UX, OSF/1, NetBSD locale name.
+              if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                gt_cv_locale_ja=ja_JP.eucJP
               else
-                # Special test for NetBSD 1.6.
-                if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
-                  gt_cv_locale_ja=ja_JP.eucJP
+                # Test for the IRIX, FreeBSD locale name.
+                if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                  gt_cv_locale_ja=ja_JP.EUC
                 else
-                  # None found.
-                  gt_cv_locale_ja=none
+                  # Test for the Solaris 7 locale name.
+                  if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                    gt_cv_locale_ja=ja
+                  else
+                    # Special test for NetBSD 1.6.
+                    if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
+                      gt_cv_locale_ja=ja_JP.eucJP
+                    else
+                      # None found.
+                      gt_cv_locale_ja=none
+                    fi
+                  fi
                 fi
               fi
             fi
           fi
-        fi
-      fi
+          ;;
+      esac
     fi
     rm -fr conftest*
 
@@ -10955,7 +14772,7 @@ $as_echo "$gt_cv_locale_ja" >&6; }
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
 $as_echo_n "checking for a transitional chinese locale... " >&6; }
-if test "${gt_cv_locale_zh_CN+set}" = set; then :
+if ${gt_cv_locale_zh_CN+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -10976,17 +14793,30 @@ int main ()
 {
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+     category of the locale to "C".  */
+  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+    return 1;
+#else
   if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
      On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
      succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
 #if HAVE_LANGINFO_CODESET
   {
     const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
       return 1;
   }
 #endif
@@ -10997,7 +14827,7 @@ int main ()
   if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
 #endif
   /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding.  */
+     This excludes the UTF-8 encoding (except on MirBSD).  */
   t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
   if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
   for (p = buf; *p != '\0'; p++)
@@ -11016,22 +14846,47 @@ _ACEOF
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the locale name without encoding suffix.
-      if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_zh_CN=zh_CN
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_zh_CN=zh_CN.GB18030
-        else
-          # None found.
+      case "$host_os" in
+        # Handle native Windows specially, because there setlocale() interprets
+        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+        # "fr" or "fra" as "French" or "French_France.1252",
+        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+        # "ja" as "Japanese" or "Japanese_Japan.932",
+        # and similar.
+        mingw*)
+          # Test for the hypothetical native Windows locale name.
+          if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_zh_CN=Chinese_China.54936
+          else
+            # None found.
+            gt_cv_locale_zh_CN=none
+          fi
+          ;;
+        solaris2.8)
+          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
           gt_cv_locale_zh_CN=none
-        fi
-      fi
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # configure script would override the LC_ALL setting. Likewise for
+          # LC_CTYPE, which is also set at the beginning of the configure script.
+          # Test for the locale name without encoding suffix.
+          if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_zh_CN=zh_CN
+          else
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_zh_CN=zh_CN.GB18030
+            else
+              # None found.
+              gt_cv_locale_zh_CN=none
+            fi
+          fi
+          ;;
+      esac
     else
       # If there was a link error, due to mblen(), the system is so old that
       # it certainly doesn't have a chinese locale.
@@ -11049,7 +14904,7 @@ $as_echo "$gt_cv_locale_zh_CN" >&6; }
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
 $as_echo_n "checking for a french Unicode locale... " >&6; }
-if test "${gt_cv_locale_fr_utf8+set}" = set; then :
+if ${gt_cv_locale_fr_utf8+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -11071,7 +14926,17 @@ int main () {
      variables, and all locales use the UTF-8 encoding.  */
 #if !(defined __BEOS__ || defined __HAIKU__)
   /* Check whether the given locale name is recognized by the system.  */
+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+     category of the locale to "C".  */
+  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+    return 1;
+# else
   if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@@ -11099,10 +14964,12 @@ int main () {
       || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
     return 1;
 #endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
   /* Check whether the decimal separator is a comma.
      On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
      are nl_langinfo(RADIXCHAR) are both ".".  */
   if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
   return 0;
 }
 
@@ -11112,27 +14979,46 @@ _ACEOF
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the usual locale name.
-      if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_fr_utf8=fr_FR
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_fr_utf8=fr_FR.UTF-8
-        else
-          # Test for the Solaris 7 locale name.
-          if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr_utf8=fr.UTF-8
+      case "$host_os" in
+        # Handle native Windows specially, because there setlocale() interprets
+        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+        # "fr" or "fra" as "French" or "French_France.1252",
+        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+        # "ja" as "Japanese" or "Japanese_Japan.932",
+        # and similar.
+        mingw*)
+          # Test for the hypothetical native Windows locale name.
+          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr_utf8=French_France.65001
           else
             # None found.
             gt_cv_locale_fr_utf8=none
           fi
-        fi
-      fi
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # configure script would override the LC_ALL setting. Likewise for
+          # LC_CTYPE, which is also set at the beginning of the configure script.
+          # Test for the usual locale name.
+          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr_utf8=fr_FR
+          else
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_fr_utf8=fr_FR.UTF-8
+            else
+              # Test for the Solaris 7 locale name.
+              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                gt_cv_locale_fr_utf8=fr.UTF-8
+              else
+                # None found.
+                gt_cv_locale_fr_utf8=none
+              fi
+            fi
+          fi
+          ;;
+      esac
     fi
     rm -fr conftest*
 
@@ -11147,6 +15033,8 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
 
 
 
+  GNULIB_FFSL=0;
+  GNULIB_FFSLL=0;
   GNULIB_MEMCHR=0;
   GNULIB_MEMMEM=0;
   GNULIB_MEMPCPY=0;
@@ -11156,6 +15044,7 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
   GNULIB_STPNCPY=0;
   GNULIB_STRCHRNUL=0;
   GNULIB_STRDUP=0;
+  GNULIB_STRNCAT=0;
   GNULIB_STRNDUP=0;
   GNULIB_STRNLEN=0;
   GNULIB_STRPBRK=0;
@@ -11178,10 +15067,14 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
   GNULIB_MBSSEP=0;
   GNULIB_MBSTOK_R=0;
   GNULIB_STRERROR=0;
+  GNULIB_STRERROR_R=0;
   GNULIB_STRSIGNAL=0;
   GNULIB_STRVERSCMP=0;
   HAVE_MBSLEN=0;
-    HAVE_DECL_MEMMEM=1;
+    HAVE_FFSL=1;
+  HAVE_FFSLL=1;
+  HAVE_MEMCHR=1;
+  HAVE_DECL_MEMMEM=1;
   HAVE_MEMPCPY=1;
   HAVE_DECL_MEMRCHR=1;
   HAVE_RAWMEMCHR=1;
@@ -11195,16 +15088,21 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
   HAVE_STRSEP=1;
   HAVE_STRCASESTR=1;
   HAVE_DECL_STRTOK_R=1;
-  HAVE_DECL_STRERROR=1;
+  HAVE_DECL_STRERROR_R=1;
   HAVE_DECL_STRSIGNAL=1;
   HAVE_STRVERSCMP=1;
   REPLACE_MEMCHR=0;
   REPLACE_MEMMEM=0;
+  REPLACE_STPNCPY=0;
   REPLACE_STRDUP=0;
   REPLACE_STRSTR=0;
   REPLACE_STRCASESTR=0;
+  REPLACE_STRCHRNUL=0;
   REPLACE_STRERROR=0;
+  REPLACE_STRERROR_R=0;
+  REPLACE_STRNCAT=0;
   REPLACE_STRNDUP=0;
+  REPLACE_STRNLEN=0;
   REPLACE_STRSIGNAL=0;
   REPLACE_STRTOK_R=0;
   UNDEFINE_STRTOK_R=0;
@@ -11213,14 +15111,11 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
 
 
 
-
-
-
   # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
   # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
   # irrelevant for anonymous mappings.
   ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
-if test "x$ac_cv_func_mmap" = x""yes; then :
+if test "x$ac_cv_func_mmap" = xyes; then :
   gl_have_mmap=yes
 else
   gl_have_mmap=no
@@ -11237,12 +15132,12 @@ $as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
 
 #include <sys/mman.h>
 #ifdef MAP_ANONYMOUS
-    I cant identify this map.
+    I cannot identify this map
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cant identify this map." >/dev/null 2>&1; then :
+  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
   gl_have_mmap_anonymous=yes
 fi
 rm -f conftest*
@@ -11253,12 +15148,12 @@ rm -f conftest*
 
 #include <sys/mman.h>
 #ifdef MAP_ANON
-    I cant identify this map.
+    I cannot identify this map
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cant identify this map." >/dev/null 2>&1; then :
+  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
 
 $as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
 
@@ -11281,48 +15176,7 @@ $as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
 
 
-
-
-
-
-
-
-
-  for ac_func in memchr
-do :
-  ac_fn_c_check_func "$LINENO" "memchr" "ac_cv_func_memchr"
-if test "x$ac_cv_func_memchr" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMCHR 1
-_ACEOF
-
-else
-
-    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
-
-fi
-done
-
-
-  if test $ac_cv_func_memchr = no; then
-
-  for ac_header in bp-sym.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
-if test "x$ac_cv_header_bp_sym_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_BP_SYM_H 1
-_ACEOF
-
-fi
-
-done
-
-
-    REPLACE_MEMCHR=1
-  fi
-
-  if test $ac_cv_func_memchr = yes; then
+  if test $HAVE_MEMCHR = 1; then
     # Detect platform-specific bugs in some versions of glibc:
     # memchr should not dereference anything with length 0
     #   http://bugzilla.redhat.com/499689
@@ -11332,7 +15186,7 @@ done
     # Assume that memchr works on platforms that lack mprotect.
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
 $as_echo_n "checking whether memchr works... " >&6; }
-if test "${gl_cv_func_memchr_works+set}" = set; then :
+if ${gl_cv_func_memchr_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -11356,6 +15210,7 @@ int
 main ()
 {
 
+  int result = 0;
   char *fence = NULL;
 #if HAVE_SYS_MMAN_H && HAVE_MPROTECT
 # if HAVE_MAP_ANONYMOUS
@@ -11379,45 +15234,110 @@ main ()
   if (fence)
     {
       if (memchr (fence, 0, 0))
-        return 1;
+        result |= 1;
       strcpy (fence - 9, "12345678");
       if (memchr (fence - 9, 0, 79) != fence - 1)
-        return 2;
+        result |= 2;
+      if (memchr (fence - 1, 0, 3) != fence - 1)
+        result |= 4;
     }
+  return result;
+
+  ;
   return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_memchr_works=yes
+else
+  gl_cv_func_memchr_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
+$as_echo "$gl_cv_func_memchr_works" >&6; }
+    if test "$gl_cv_func_memchr_works" != yes; then
+      REPLACE_MEMCHR=1
+    fi
+  fi
+
+ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default"
+if test "x$ac_cv_have_decl_memrchr" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MEMRCHR $ac_have_decl
+_ACEOF
+
+
+
+
+     REPLACE_STRERROR_0=0
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
+$as_echo_n "checking whether strerror(0) succeeds... " >&6; }
+if ${gl_cv_func_strerror_0_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+                 # Guess yes on glibc systems.
+         *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+                 # If we don't know, assume the worst.
+         *)      gl_cv_func_strerror_0_works="guessing no" ;;
+       esac
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+           #include <errno.h>
 
+int
+main ()
+{
+int result = 0;
+           char *str;
+           errno = 0;
+           str = strerror (0);
+           if (!*str) result |= 1;
+           if (errno) result |= 2;
+           if (strstr (str, "nknown") || strstr (str, "ndefined"))
+             result |= 4;
+           return result;
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_memchr_works=yes
+  gl_cv_func_strerror_0_works=yes
 else
-  gl_cv_func_memchr_works=no
+  gl_cv_func_strerror_0_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
-$as_echo "$gl_cv_func_memchr_works" >&6; }
-    if test "$gl_cv_func_memchr_works" != yes; then
-
-  for ac_header in bp-sym.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
-if test "x$ac_cv_header_bp_sym_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_BP_SYM_H 1
-_ACEOF
 
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
+$as_echo "$gl_cv_func_strerror_0_works" >&6; }
+  case "$gl_cv_func_strerror_0_works" in
+    *yes) ;;
+    *)
+      REPLACE_STRERROR_0=1
 
-done
+$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
+
+      ;;
+  esac
 
 
-      REPLACE_MEMCHR=1
 
 
 
@@ -11426,72 +15346,176 @@ done
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
+  if test $ac_cv_func_strerror_r = yes; then
+    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5
+$as_echo_n "checking for strerror_r with POSIX signature... " >&6; }
+if ${gl_cv_func_strerror_r_posix_signature+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+                int strerror_r (int, char *, size_t);
 
-    fi
-  fi
+int
+main ()
+{
 
-ac_fn_c_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default"
-if test "x$ac_cv_have_decl_memrchr" = x""yes; then :
-  ac_have_decl=1
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_func_strerror_r_posix_signature=yes
 else
-  ac_have_decl=0
+  gl_cv_func_strerror_r_posix_signature=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MEMRCHR $ac_have_decl
-_ACEOF
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5
+$as_echo "$gl_cv_func_strerror_r_posix_signature" >&6; }
+      if test $gl_cv_func_strerror_r_posix_signature = yes; then
+                                                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5
+$as_echo_n "checking whether strerror_r works... " >&6; }
+if ${gl_cv_func_strerror_r_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+
+              case "$host_os" in
+                       # Guess no on AIX.
+                aix*)  gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess no on HP-UX.
+                hpux*) gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess no on BSD variants.
+                *bsd*)  gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess yes otherwise.
+                *)     gl_cv_func_strerror_r_works="guessing yes";;
+              esac
 
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <errno.h>
+                  #include <string.h>
 
+int
+main ()
+{
+int result = 0;
+                  char buf[79];
+                  if (strerror_r (EACCES, buf, 0) < 0)
+                    result |= 1;
+                  errno = 0;
+                  if (strerror_r (EACCES, buf, sizeof buf) != 0)
+                    result |= 2;
+                  strcpy (buf, "Unknown");
+                  if (strerror_r (0, buf, sizeof buf) != 0)
+                    result |= 4;
+                  if (errno)
+                    result |= 8;
+                  if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
+                    result |= 0x10;
+                  errno = 0;
+                  *buf = 0;
+                  if (strerror_r (-3, buf, sizeof buf) < 0)
+                    result |= 0x20;
+                  if (errno)
+                    result |= 0x40;
+                  if (!*buf)
+                    result |= 0x80;
+                  return result;
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_strerror_r_works=yes
+else
+  gl_cv_func_strerror_r_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
+$as_echo "$gl_cv_func_strerror_r_works" >&6; }
+      else
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unlink honors trailing slashes" >&5
-$as_echo_n "checking whether unlink honors trailing slashes... " >&6; }
-if test "${gl_cv_func_unlink_works+set}" = set; then :
+                        if test $ac_cv_func___xpg_strerror_r = yes; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5
+$as_echo_n "checking whether __xpg_strerror_r works... " >&6; }
+if ${gl_cv_func_strerror_r_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  touch conftest.file
-     # Assume that if we have lstat, we can also check symlinks.
-     if test $ac_cv_func_lstat = yes; then
-       ln -s conftest.file conftest.lnk
-     fi
-     if test "$cross_compiling" = yes; then :
-  gl_cv_func_unlink_works="guessing no"
+  if test "$cross_compiling" = yes; then :
+                                  gl_cv_func_strerror_r_works="guessing no"
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
-           #include <errno.h>
+#include <errno.h>
+                    #include <string.h>
+                    extern
+                    #ifdef __cplusplus
+                    "C"
+                    #endif
+                    int __xpg_strerror_r(int, char *, size_t);
 
 int
 main ()
 {
-if (!unlink ("conftest.file/") || errno != ENOTDIR) return 1;
-#if HAVE_LSTAT
-      if (!unlink ("conftest.lnk/") || errno != ENOTDIR) return 2;
-#endif
+int result = 0;
+                    char buf[256] = "^";
+                    char copy[256];
+                    char *str = strerror (-1);
+                    strcpy (copy, str);
+                    if (__xpg_strerror_r (-2, buf, 1) == 0)
+                      result |= 1;
+                    if (*buf)
+                      result |= 2;
+                    __xpg_strerror_r (-2, buf, 256);
+                    if (strcmp (str, copy))
+                      result |= 4;
+                    return result;
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_unlink_works=yes
+  gl_cv_func_strerror_r_works=yes
 else
-  gl_cv_func_unlink_works=no
+  gl_cv_func_strerror_r_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-     rm -f conftest.file conftest.lnk
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
+$as_echo "$gl_cv_func_strerror_r_works" >&6; }
+        fi
+      fi
+    fi
+  fi
+
+ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_works" >&5
-$as_echo "$gl_cv_func_unlink_works" >&6; }
-  if test x"$gl_cv_func_unlink_works" != xyes; then
-    REPLACE_UNLINK=1
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRERROR_R $ac_have_decl
+_ACEOF
 
 
 
@@ -11500,8 +15524,22 @@ $as_echo "$gl_cv_func_unlink_works" >&6; }
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS unlink.$ac_objext"
+  if test $ac_cv_have_decl_strerror_r = no; then
+    HAVE_DECL_STRERROR_R=0
+  fi
 
+  if test $ac_cv_func_strerror_r = yes; then
+    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+      if test $gl_cv_func_strerror_r_posix_signature = yes; then
+        case "$gl_cv_func_strerror_r_works" in
+                    *no) REPLACE_STRERROR_R=1 ;;
+        esac
+      else
+                REPLACE_STRERROR_R=1
+      fi
+    else
+                  REPLACE_STRERROR_R=1
+    fi
   fi
 
 
@@ -11622,7 +15660,7 @@ $as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h
       for ac_func in nl_langinfo
 do :
   ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo"
-if test "x$ac_cv_func_nl_langinfo" = x""yes; then :
+if test "x$ac_cv_func_nl_langinfo" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_NL_LANGINFO 1
 _ACEOF
@@ -11708,27 +15746,276 @@ $as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h
 
 $as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
 
-      ;;
-  esac
+      ;;
+  esac
+
+
+
+  case "$gl_cv_func_printf_enomem" in
+    *yes)
+      ;;
+    *)
+
+$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h
+
+
+$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h
+
+
+$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext"
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
+
+  if test $ac_cv_func_vasnprintf = yes; then
+
+$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
+
+  fi
+
+
+
+
+
+
+
+
+
+
+
+  ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
+
+else
+
+$as_echo "#define ptrdiff_t long" >>confdefs.h
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS vfprintf.$ac_objext"
+
+  REPLACE_VFPRINTF=1
+
+$as_echo "#define REPLACE_VFPRINTF_POSIX 1" >>confdefs.h
+
+  :
+
+  fi
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef _MSC_VER
+MicrosoftCompiler
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "MicrosoftCompiler" >/dev/null 2>&1; then :
+  gl_asmext='asm'
+     gl_c_asm_opt='-c -Fa'
+
+else
+  gl_asmext='s'
+     gl_c_asm_opt='-S'
+
+fi
+rm -f conftest*
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C symbols are prefixed with underscore at the linker level" >&5
+$as_echo_n "checking whether C symbols are prefixed with underscore at the linker level... " >&6; }
+if ${gl_cv_prog_as_underscore+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" int foo (void);
+#endif
+int foo(void) { return 0; }
+EOF
+     # Look for the assembly language name in the .s file.
+     { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null 2>&1
+     if grep _foo conftest.$gl_asmext >/dev/null ; then
+       gl_cv_prog_as_underscore=yes
+     else
+       gl_cv_prog_as_underscore=no
+     fi
+     rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_prog_as_underscore" >&5
+$as_echo "$gl_cv_prog_as_underscore" >&6; }
+  if test $gl_cv_prog_as_underscore = yes; then
+    USER_LABEL_PREFIX=_
+  else
+    USER_LABEL_PREFIX=
+  fi
+
+cat >>confdefs.h <<_ACEOF
+#define USER_LABEL_PREFIX $USER_LABEL_PREFIX
+_ACEOF
+
+  ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if ${ac_cv_header_stdbool_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+             #include <stdbool.h>
+             #ifndef bool
+              "error: bool is not defined"
+             #endif
+             #ifndef false
+              "error: false is not defined"
+             #endif
+             #if false
+              "error: false is not 0"
+             #endif
+             #ifndef true
+              "error: true is not defined"
+             #endif
+             #if true != 1
+              "error: true is not 1"
+             #endif
+             #ifndef __bool_true_false_are_defined
+              "error: __bool_true_false_are_defined is not defined"
+             #endif
 
+             struct s { _Bool s: 1; _Bool t; } s;
+
+             char a[true == 1 ? 1 : -1];
+             char b[false == 0 ? 1 : -1];
+             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+             char d[(bool) 0.5 == true ? 1 : -1];
+             /* See body of main program for 'e'.  */
+             char f[(_Bool) 0.0 == false ? 1 : -1];
+             char g[true];
+             char h[sizeof (_Bool)];
+             char i[sizeof s.t];
+             enum { j = false, k = true, l = false * true, m = true * 256 };
+             /* The following fails for
+                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+             _Bool n[m];
+             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+             char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+             /* Catch a bug in an HP-UX C compiler.  See
+                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+              */
+             _Bool q = true;
+             _Bool *pq = &q;
 
+int
+main ()
+{
 
-  case "$gl_cv_func_printf_enomem" in
-    *yes)
-      ;;
-    *)
+             bool e = &s;
+             *pq |= q;
+             *pq |= ! q;
+             /* Refer to every declared value, to avoid compiler optimizations.  */
+             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                     + !m + !n + !o + !p + !q + !pq);
 
-$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdbool_h=yes
+else
+  ac_cv_header_stdbool_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+   ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes; then :
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
 
-$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h
 
+fi
 
-$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
 
-      ;;
-  esac
 
+    REPLACE_NULL=0;
+  HAVE_WCHAR_T=1;
 
 
 
@@ -11737,19 +16024,42 @@ $as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
 
 
 
+  if test $ac_cv_type_long_long_int = yes; then
+    HAVE_LONG_LONG_INT=1
+  else
+    HAVE_LONG_LONG_INT=0
+  fi
 
 
-  gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext"
+  if test $ac_cv_type_unsigned_long_long_int = yes; then
+    HAVE_UNSIGNED_LONG_LONG_INT=1
+  else
+    HAVE_UNSIGNED_LONG_LONG_INT=0
+  fi
 
 
 
+  if test $ac_cv_header_wchar_h = yes; then
+    HAVE_WCHAR_H=1
+  else
+    HAVE_WCHAR_H=0
+  fi
 
 
+      if test $ac_cv_header_inttypes_h = yes; then
+    HAVE_INTTYPES_H=1
+  else
+    HAVE_INTTYPES_H=0
+  fi
 
 
+      if test $ac_cv_header_sys_types_h = yes; then
+    HAVE_SYS_TYPES_H=1
+  else
+    HAVE_SYS_TYPES_H=0
+  fi
 
 
-  gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
 
 
 
@@ -11759,349 +16069,697 @@ $as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_stdint_h='<'stdint.h'>'
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
+$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
+if ${gl_cv_next_stdint_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+             if test $ac_cv_header_stdint_h = yes; then
 
 
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdint.h>
 
+_ACEOF
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
 
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'stdint.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+          else
+               gl_cv_next_stdint_h='<'stdint.h'>'
+             fi
 
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
+$as_echo "$gl_cv_next_stdint_h" >&6; }
+     fi
+     NEXT_STDINT_H=$gl_cv_next_stdint_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'stdint.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_stdint_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
 
-  gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
 
-  if test $ac_cv_func_vasnprintf = yes; then
 
-$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
 
+  if test $ac_cv_header_stdint_h = yes; then
+    HAVE_STDINT_H=1
+  else
+    HAVE_STDINT_H=0
   fi
 
 
+    if test $ac_cv_header_stdint_h = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
+$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
+if ${gl_cv_header_working_stdint_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  gl_cv_header_working_stdint_h=no
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
+/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
+#if !(defined WCHAR_MIN && defined WCHAR_MAX)
+#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
+#endif
 
 
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
 
+#ifdef INT8_MAX
+int8_t a1 = INT8_MAX;
+int8_t a1min = INT8_MIN;
+#endif
+#ifdef INT16_MAX
+int16_t a2 = INT16_MAX;
+int16_t a2min = INT16_MIN;
+#endif
+#ifdef INT32_MAX
+int32_t a3 = INT32_MAX;
+int32_t a3min = INT32_MIN;
+#endif
+#ifdef INT64_MAX
+int64_t a4 = INT64_MAX;
+int64_t a4min = INT64_MIN;
+#endif
+#ifdef UINT8_MAX
+uint8_t b1 = UINT8_MAX;
+#else
+typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
+#endif
+#ifdef UINT16_MAX
+uint16_t b2 = UINT16_MAX;
+#endif
+#ifdef UINT32_MAX
+uint32_t b3 = UINT32_MAX;
+#endif
+#ifdef UINT64_MAX
+uint64_t b4 = UINT64_MAX;
+#endif
+int_least8_t c1 = INT8_C (0x7f);
+int_least8_t c1max = INT_LEAST8_MAX;
+int_least8_t c1min = INT_LEAST8_MIN;
+int_least16_t c2 = INT16_C (0x7fff);
+int_least16_t c2max = INT_LEAST16_MAX;
+int_least16_t c2min = INT_LEAST16_MIN;
+int_least32_t c3 = INT32_C (0x7fffffff);
+int_least32_t c3max = INT_LEAST32_MAX;
+int_least32_t c3min = INT_LEAST32_MIN;
+int_least64_t c4 = INT64_C (0x7fffffffffffffff);
+int_least64_t c4max = INT_LEAST64_MAX;
+int_least64_t c4min = INT_LEAST64_MIN;
+uint_least8_t d1 = UINT8_C (0xff);
+uint_least8_t d1max = UINT_LEAST8_MAX;
+uint_least16_t d2 = UINT16_C (0xffff);
+uint_least16_t d2max = UINT_LEAST16_MAX;
+uint_least32_t d3 = UINT32_C (0xffffffff);
+uint_least32_t d3max = UINT_LEAST32_MAX;
+uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
+uint_least64_t d4max = UINT_LEAST64_MAX;
+int_fast8_t e1 = INT_FAST8_MAX;
+int_fast8_t e1min = INT_FAST8_MIN;
+int_fast16_t e2 = INT_FAST16_MAX;
+int_fast16_t e2min = INT_FAST16_MIN;
+int_fast32_t e3 = INT_FAST32_MAX;
+int_fast32_t e3min = INT_FAST32_MIN;
+int_fast64_t e4 = INT_FAST64_MAX;
+int_fast64_t e4min = INT_FAST64_MIN;
+uint_fast8_t f1 = UINT_FAST8_MAX;
+uint_fast16_t f2 = UINT_FAST16_MAX;
+uint_fast32_t f3 = UINT_FAST32_MAX;
+uint_fast64_t f4 = UINT_FAST64_MAX;
+#ifdef INTPTR_MAX
+intptr_t g = INTPTR_MAX;
+intptr_t gmin = INTPTR_MIN;
+#endif
+#ifdef UINTPTR_MAX
+uintptr_t h = UINTPTR_MAX;
+#endif
+intmax_t i = INTMAX_MAX;
+uintmax_t j = UINTMAX_MAX;
 
+#include <limits.h> /* for CHAR_BIT */
+#define TYPE_MINIMUM(t) \
+  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
+#define TYPE_MAXIMUM(t) \
+  ((t) ((t) 0 < (t) -1 \
+        ? (t) -1 \
+        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+struct s {
+  int check_PTRDIFF:
+      PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
+      && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
+      ? 1 : -1;
+  /* Detect bug in FreeBSD 6.0 / ia64.  */
+  int check_SIG_ATOMIC:
+      SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
+      && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
+      ? 1 : -1;
+  int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
+  int check_WCHAR:
+      WCHAR_MIN == TYPE_MINIMUM (wchar_t)
+      && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
+      ? 1 : -1;
+  /* Detect bug in mingw.  */
+  int check_WINT:
+      WINT_MIN == TYPE_MINIMUM (wint_t)
+      && WINT_MAX == TYPE_MAXIMUM (wint_t)
+      ? 1 : -1;
 
-  ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
+  /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others.  */
+  int check_UINT8_C:
+        (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
+  int check_UINT16_C:
+        (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
 
-else
+  /* Detect bugs in OpenBSD 3.9 stdint.h.  */
+#ifdef UINT8_MAX
+  int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
+#endif
+#ifdef UINT16_MAX
+  int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
+#endif
+#ifdef UINT32_MAX
+  int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
+#endif
+#ifdef UINT64_MAX
+  int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
+#endif
+  int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
+  int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
+  int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
+  int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
+  int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
+  int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
+  int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
+  int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
+  int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
+  int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
+  int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
+};
 
-$as_echo "#define ptrdiff_t long" >>confdefs.h
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+                                                    if test "$cross_compiling" = yes; then :
+                 gl_cv_header_working_stdint_h=yes
 
-fi
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
 
 
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
 
+#include <stdio.h>
+#include <string.h>
+#define MVAL(macro) MVAL1(macro)
+#define MVAL1(expression) #expression
+static const char *macro_values[] =
+  {
+#ifdef INT8_MAX
+    MVAL (INT8_MAX),
+#endif
+#ifdef INT16_MAX
+    MVAL (INT16_MAX),
+#endif
+#ifdef INT32_MAX
+    MVAL (INT32_MAX),
+#endif
+#ifdef INT64_MAX
+    MVAL (INT64_MAX),
+#endif
+#ifdef UINT8_MAX
+    MVAL (UINT8_MAX),
+#endif
+#ifdef UINT16_MAX
+    MVAL (UINT16_MAX),
+#endif
+#ifdef UINT32_MAX
+    MVAL (UINT32_MAX),
+#endif
+#ifdef UINT64_MAX
+    MVAL (UINT64_MAX),
+#endif
+    NULL
+  };
 
+int
+main ()
+{
 
+  const char **mv;
+  for (mv = macro_values; *mv != NULL; mv++)
+    {
+      const char *value = *mv;
+      /* Test whether it looks like a cast expression.  */
+      if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
+          || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
+          || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
+          || strncmp (value, "((int)"/*)*/, 6) == 0
+          || strncmp (value, "((signed short)"/*)*/, 15) == 0
+          || strncmp (value, "((signed char)"/*)*/, 14) == 0)
+        return mv - macro_values + 1;
+    }
+  return 0;
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_header_working_stdint_h=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
+$as_echo "$gl_cv_header_working_stdint_h" >&6; }
+  fi
+  if test "$gl_cv_header_working_stdint_h" = yes; then
+    STDINT_H=
+  else
+            for ac_header in sys/inttypes.h sys/bitypes.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
+fi
 
+done
 
+    if test $ac_cv_header_sys_inttypes_h = yes; then
+      HAVE_SYS_INTTYPES_H=1
+    else
+      HAVE_SYS_INTTYPES_H=0
+    fi
 
+    if test $ac_cv_header_sys_bitypes_h = yes; then
+      HAVE_SYS_BITYPES_H=1
+    else
+      HAVE_SYS_BITYPES_H=0
+    fi
 
-  gl_LIBOBJS="$gl_LIBOBJS vfprintf.$ac_objext"
 
-  REPLACE_VFPRINTF=1
 
-$as_echo "#define REPLACE_VFPRINTF_POSIX 1" >>confdefs.h
 
-  :
+  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
-  fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
-$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if test "${ac_cv_header_stdbool_h+set}" = set; then :
+  for gltype in ptrdiff_t size_t ; do
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
+$as_echo_n "checking for bit size of $gltype... " >&6; }
+if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-          #include <stdbool.h>
-          #ifndef bool
-           "error: bool is not defined"
-          #endif
-          #ifndef false
-           "error: false is not defined"
-          #endif
-          #if false
-           "error: false is not 0"
-          #endif
-          #ifndef true
-           "error: true is not defined"
-          #endif
-          #if true != 1
-           "error: true is not 1"
-          #endif
-          #ifndef __bool_true_false_are_defined
-           "error: __bool_true_false_are_defined is not defined"
-          #endif
-
-          struct s { _Bool s: 1; _Bool t; } s;
-
-          char a[true == 1 ? 1 : -1];
-          char b[false == 0 ? 1 : -1];
-          char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-          char d[(bool) 0.5 == true ? 1 : -1];
-          bool e = &s;
-          char f[(_Bool) 0.0 == false ? 1 : -1];
-          char g[true];
-          char h[sizeof (_Bool)];
-          char i[sizeof s.t];
-          enum { j = false, k = true, l = false * true, m = true * 256 };
-          _Bool n[m];
-          char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-          char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-          #if defined __xlc__ || defined __GNUC__
-           /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-              reported by James Lemley on 2005-10-05; see
-              http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-              This test is not quite right, since xlc is allowed to
-              reject this program, as the initializer for xlcbug is
-              not one of the forms that C requires support for.
-              However, doing the test right would require a run-time
-              test, and that would make cross-compilation harder.
-              Let us hope that IBM fixes the xlc bug, and also adds
-              support for this kind of constant expression.  In the
-              meantime, this test will reject xlc, which is OK, since
-              our stdbool.h substitute should suffice.  We also test
-              this with GCC, where it should work, to detect more
-              quickly whether someone messes up the test in the
-              future.  */
-           char digs[] = "0123456789";
-           int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-          #endif
-          /* Catch a bug in an HP-UX C compiler.  See
-             http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-             http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-           */
-          _Bool q = true;
-          _Bool *pq = &q;
-
-int
-main ()
-{
+  if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result"        "
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
-          *pq |= q;
-          *pq |= ! q;
-          /* Refer to every declared value, to avoid compiler optimizations.  */
-          return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-                  + !m + !n + !o + !p + !q + !pq);
+#include <limits.h>"; then :
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdbool_h=yes
 else
-  ac_cv_header_stdbool_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  result=unknown
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
-$as_echo "$ac_cv_header_stdbool_h" >&6; }
-   ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = x""yes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE__BOOL 1
-_ACEOF
 
+       eval gl_cv_bitsizeof_${gltype}=\$result
 
 fi
+eval ac_res=\$gl_cv_bitsizeof_${gltype}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    eval result=\$gl_cv_bitsizeof_${gltype}
+    if test $result = unknown; then
+                                                result=0
+    fi
+    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    cat >>confdefs.h <<_ACEOF
+#define BITSIZEOF_${GLTYPE} $result
+_ACEOF
 
-   if test $ac_cv_header_stdbool_h = yes; then
-
-$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
-
-   fi
-
-    REPLACE_NULL=0;
-  HAVE_WCHAR_T=1;
-  STDDEF_H='';
+    eval BITSIZEOF_${GLTYPE}=\$result
+  done
 
 
+  fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
-$as_echo_n "checking for unsigned long long int... " >&6; }
-if test "${ac_cv_type_unsigned_long_long_int+set}" = set; then :
+  for gltype in sig_atomic_t wchar_t wint_t ; do
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
+$as_echo_n "checking for bit size of $gltype... " >&6; }
+if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result"        "
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
-  /* For now, do not test the preprocessor; as of 2007 there are too many
-         implementations with broken preprocessors.  Perhaps this can
-         be revisited in 2012.  In the meantime, code should not expect
-         #if to work with literals wider than 32 bits.  */
-      /* Test literals.  */
-      long long int ll = 9223372036854775807ll;
-      long long int nll = -9223372036854775807LL;
-      unsigned long long int ull = 18446744073709551615ULL;
-      /* Test constant expressions.   */
-      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                     ? 1 : -1)];
-      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                     ? 1 : -1)];
-      int i = 63;
-int
-main ()
-{
-/* Test availability of runtime routines for shift and division.  */
-      long long int llmax = 9223372036854775807ll;
-      unsigned long long int ullmax = 18446744073709551615ull;
-      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-              | (llmax / ll) | (llmax % ll)
-              | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-              | (ullmax / ull) | (ullmax % ull));
-  ;
-  return 0;
-}
+#include <limits.h>"; then :
 
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_type_unsigned_long_long_int=yes
 else
-  ac_cv_type_unsigned_long_long_int=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  result=unknown
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
-$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
-  if test $ac_cv_type_unsigned_long_long_int = yes; then
-
-$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
 
-  fi
+       eval gl_cv_bitsizeof_${gltype}=\$result
 
+fi
+eval ac_res=\$gl_cv_bitsizeof_${gltype}
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    eval result=\$gl_cv_bitsizeof_${gltype}
+    if test $result = unknown; then
+                                                result=0
+    fi
+    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    cat >>confdefs.h <<_ACEOF
+#define BITSIZEOF_${GLTYPE} $result
+_ACEOF
 
+    eval BITSIZEOF_${GLTYPE}=\$result
+  done
 
 
 
 
+  for gltype in sig_atomic_t wchar_t wint_t ; do
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
+$as_echo_n "checking whether $gltype is signed... " >&6; }
+if eval \${gl_cv_type_${gltype}_signed+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
 
+            int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
+int
+main ()
+{
 
-ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strdup" = x""yes; then :
-  ac_have_decl=1
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  result=yes
 else
-  ac_have_decl=0
+  result=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       eval gl_cv_type_${gltype}_signed=\$result
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRDUP $ac_have_decl
+fi
+eval ac_res=\$gl_cv_type_${gltype}_signed
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    eval result=\$gl_cv_type_${gltype}_signed
+    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    if test "$result" = yes; then
+      cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGNED_${GLTYPE} 1
 _ACEOF
 
+      eval HAVE_SIGNED_${GLTYPE}=1
+    else
+      eval HAVE_SIGNED_${GLTYPE}=0
+    fi
+  done
 
 
+  gl_cv_type_ptrdiff_t_signed=yes
+  gl_cv_type_size_t_signed=no
+  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
 
-
-  if test -z "$ERRNO_H"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
-$as_echo_n "checking for working strerror function... " >&6; }
-if test "${gl_cv_func_working_strerror+set}" = set; then :
+  for gltype in ptrdiff_t size_t ; do
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
+$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
+if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  eval gl_cv_type_${gltype}_suffix=no
+       eval result=\$gl_cv_type_${gltype}_signed
+       if test "$result" = yes; then
+         glsufu=
+       else
+         glsufu=u
+       fi
+       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+         case $glsuf in
+           '')  gltype1='int';;
+           l)   gltype1='long int';;
+           ll)  gltype1='long long int';;
+           i64) gltype1='__int64';;
+           u)   gltype1='unsigned int';;
+           ul)  gltype1='unsigned long int';;
+           ull) gltype1='unsigned long long int';;
+           ui64)gltype1='unsigned __int64';;
+         esac
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <string.h>
 
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
+
+              extern $gltype foo;
+              extern $gltype1 foo;
 int
 main ()
 {
-return !*strerror (-2);
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_working_strerror=yes
-else
-  gl_cv_func_working_strerror=no
+  eval gl_cv_type_${gltype}_suffix=\$glsuf
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+         eval result=\$gl_cv_type_${gltype}_suffix
+         test "$result" != no && break
+       done
+fi
+eval ac_res=\$gl_cv_type_${gltype}_suffix
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    eval result=\$gl_cv_type_${gltype}_suffix
+    test "$result" = no && result=
+    eval ${GLTYPE}_SUFFIX=\$result
+    cat >>confdefs.h <<_ACEOF
+#define ${GLTYPE}_SUFFIX $result
+_ACEOF
+
+  done
+
+
+  fi
 
+
+  for gltype in sig_atomic_t wchar_t wint_t ; do
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
+$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
+if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  eval gl_cv_type_${gltype}_suffix=no
+       eval result=\$gl_cv_type_${gltype}_signed
+       if test "$result" = yes; then
+         glsufu=
+       else
+         glsufu=u
+       fi
+       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+         case $glsuf in
+           '')  gltype1='int';;
+           l)   gltype1='long int';;
+           ll)  gltype1='long long int';;
+           i64) gltype1='__int64';;
+           u)   gltype1='unsigned int';;
+           ul)  gltype1='unsigned long int';;
+           ull) gltype1='unsigned long long int';;
+           ui64)gltype1='unsigned __int64';;
+         esac
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <string.h>
 
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <stdio.h>
+  # include <time.h>
+  # include <wchar.h>
+  #endif
+
+              extern $gltype foo;
+              extern $gltype1 foo;
 int
 main ()
 {
-return !*strerror (-2);
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_working_strerror=yes
-else
-  gl_cv_func_working_strerror=no
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval gl_cv_type_${gltype}_suffix=\$glsuf
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+         eval result=\$gl_cv_type_${gltype}_suffix
+         test "$result" != no && break
+       done
 fi
+eval ac_res=\$gl_cv_type_${gltype}_suffix
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    eval result=\$gl_cv_type_${gltype}_suffix
+    test "$result" = no && result=
+    eval ${GLTYPE}_SUFFIX=\$result
+    cat >>confdefs.h <<_ACEOF
+#define ${GLTYPE}_SUFFIX $result
+_ACEOF
 
+  done
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
-$as_echo "$gl_cv_func_working_strerror" >&6; }
-    if test $gl_cv_func_working_strerror = no; then
-                  REPLACE_STRERROR=1
-    fi
-  else
-            REPLACE_STRERROR=1
+
+
+          if test $BITSIZEOF_WINT_T -lt 32; then
+    BITSIZEOF_WINT_T=32
   fi
-  if test $REPLACE_STRERROR = 1; then
 
-  ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror" = x""yes; then :
-  ac_have_decl=1
+    STDINT_H=stdint.h
+  fi
+
+   if test -n "$STDINT_H"; then
+  GL_GENERATE_STDINT_H_TRUE=
+  GL_GENERATE_STDINT_H_FALSE='#'
 else
-  ac_have_decl=0
+  GL_GENERATE_STDINT_H_TRUE='#'
+  GL_GENERATE_STDINT_H_FALSE=
 fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR $ac_have_decl
-_ACEOF
 
 
-  if test $ac_cv_header_sys_socket_h != yes; then
-                    for ac_header in winsock2.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
-if test "x$ac_cv_header_winsock2_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_WINSOCK2_H 1
-_ACEOF
 
+ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strdup" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
 fi
 
-done
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRDUP $ac_have_decl
+_ACEOF
 
-  fi
 
-  fi
 
 
 
@@ -12119,30 +16777,41 @@ done
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
 $as_echo_n "checking absolute name of <string.h>... " >&6; }
-if test "${gl_cv_next_string_h+set}" = set; then :
+if ${gl_cv_next_string_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_string_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <string.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/string.h#{
-                 s#.*"\(.*/string.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_string_h='<'string.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'string.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_string_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
@@ -12162,64 +16831,68 @@ $as_echo "$gl_cv_next_string_h" >&6; }
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
-$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
-if test "${ac_cv_header_stat_broken+set}" = set; then :
+
+
+    for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul      strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r      strerror_r strsignal strverscmp; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#if defined S_ISBLK && defined S_IFDIR
-extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
-#endif
-
-#if defined S_ISBLK && defined S_IFCHR
-extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
-#endif
-
-#if defined S_ISLNK && defined S_IFREG
-extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
-#endif
-
-#if defined S_ISSOCK && defined S_IFREG
-extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
-#endif
+#include <string.h>
 
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stat_broken=no
+  eval "$as_gl_Symbol=yes"
 else
-  ac_cv_header_stat_broken=yes
+  eval "$as_gl_Symbol=no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
-$as_echo "$ac_cv_header_stat_broken" >&6; }
-if test $ac_cv_header_stat_broken = yes; then
-
-$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
+                     eval ac_cv_have_decl_$gl_func=yes
 fi
+      done
 
 
 
-
+  GNULIB_MKTIME=0;
+  GNULIB_NANOSLEEP=0;
+  GNULIB_STRPTIME=0;
+  GNULIB_TIMEGM=0;
+  GNULIB_TIME_R=0;
+    HAVE_DECL_LOCALTIME_R=1;
+  HAVE_NANOSLEEP=1;
+  HAVE_STRPTIME=1;
+  HAVE_TIMEGM=1;
         REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
   REPLACE_MKTIME=GNULIB_PORTCHECK;
   REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
-  REPLACE_STRPTIME=GNULIB_PORTCHECK;
   REPLACE_TIMEGM=GNULIB_PORTCHECK;
 
 
 
-
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
 $as_echo_n "checking for struct timespec in <time.h>... " >&6; }
-if test "${gl_cv_sys_struct_timespec_in_time_h+set}" = set; then :
+if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12246,12 +16919,13 @@ $as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
 
   TIME_H_DEFINES_STRUCT_TIMESPEC=0
   SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+  PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
   if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
     TIME_H_DEFINES_STRUCT_TIMESPEC=1
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
 $as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
-if test "${gl_cv_sys_struct_timespec_in_sys_time_h+set}" = set; then :
+if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 $as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
     if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
       SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
+$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
+if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+
+int
+main ()
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_sys_struct_timespec_in_pthread_h=yes
+else
+  gl_cv_sys_struct_timespec_in_pthread_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
+      if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+        PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+      fi
     fi
   fi
 
@@ -12291,35 +16995,49 @@ $as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
 
 
 
+
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_time_h='<'time.h'>'
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
 $as_echo_n "checking absolute name of <time.h>... " >&6; }
-if test "${gl_cv_next_time_h+set}" = set; then :
+if ${gl_cv_next_time_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_time_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <time.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/time.h#{
-                 s#.*"\(.*/time.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_time_h='<'time.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'time.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_time_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
@@ -12343,9 +17061,10 @@ $as_echo "$gl_cv_next_time_h" >&6; }
 
 
 
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the utimes function works" >&5
 $as_echo_n "checking whether the utimes function works... " >&6; }
-if test "${gl_cv_func_working_utimes+set}" = set; then :
+if ${gl_cv_func_working_utimes+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -12365,44 +17084,96 @@ else
 #include <stdio.h>
 #include <utime.h>
 
+static int
+inorder (time_t a, time_t b, time_t c)
+{
+  return a <= b && b <= c;
+}
+
 int
 main ()
 {
-  static struct timeval timeval[2] = {{9, 10}, {999999, 999999}};
-  struct stat sbuf;
+  int result = 0;
   char const *file = "conftest.utimes";
-  FILE *f;
-  time_t now;
-  int fd;
-
-  int ok = ((f = fopen (file, "w"))
-            && fclose (f) == 0
-            && utimes (file, timeval) == 0
-            && lstat (file, &sbuf) == 0
-            && sbuf.st_atime == timeval[0].tv_sec
-            && sbuf.st_mtime == timeval[1].tv_sec);
-  unlink (file);
-  if (!ok)
-    exit (1);
-
-  ok =
-    ((f = fopen (file, "w"))
-     && fclose (f) == 0
-     && time (&now) != (time_t)-1
-     && utimes (file, NULL) == 0
-     && lstat (file, &sbuf) == 0
-     && now - sbuf.st_atime <= 2
-     && now - sbuf.st_mtime <= 2);
-  unlink (file);
-  if (!ok)
-    exit (1);
-
-  ok = (0 <= (fd = open (file, O_WRONLY|O_CREAT, 0444))
-              && close (fd) == 0
-              && utimes (file, NULL) == 0);
-  unlink (file);
-
-  exit (!ok);
+  static struct timeval timeval[2] = {{9, 10}, {999999, 999999}};
+
+  /* Test whether utimes() essentially works.  */
+  {
+    struct stat sbuf;
+    FILE *f = fopen (file, "w");
+    if (f == NULL)
+      result |= 1;
+    else if (fclose (f) != 0)
+      result |= 1;
+    else if (utimes (file, timeval) != 0)
+      result |= 2;
+    else if (lstat (file, &sbuf) != 0)
+      result |= 1;
+    else if (!(sbuf.st_atime == timeval[0].tv_sec
+               && sbuf.st_mtime == timeval[1].tv_sec))
+      result |= 4;
+    if (unlink (file) != 0)
+      result |= 1;
+  }
+
+  /* Test whether utimes() with a NULL argument sets the file's timestamp
+     to the current time.  Use 'fstat' as well as 'time' to
+     determine the "current" time, to accommodate NFS file systems
+     if there is a time skew between the host and the NFS server.  */
+  {
+    int fd = open (file, O_WRONLY|O_CREAT, 0644);
+    if (fd < 0)
+      result |= 1;
+    else
+      {
+        time_t t0, t2;
+        struct stat st0, st1, st2;
+        if (time (&t0) == (time_t) -1)
+          result |= 1;
+        else if (fstat (fd, &st0) != 0)
+          result |= 1;
+        else if (utimes (file, timeval) != 0)
+          result |= 2;
+        else if (utimes (file, NULL) != 0)
+          result |= 8;
+        else if (fstat (fd, &st1) != 0)
+          result |= 1;
+        else if (write (fd, "\n", 1) != 1)
+          result |= 1;
+        else if (fstat (fd, &st2) != 0)
+          result |= 1;
+        else if (time (&t2) == (time_t) -1)
+          result |= 1;
+        else
+          {
+            int m_ok_POSIX = inorder (t0, st1.st_mtime, t2);
+            int m_ok_NFS = inorder (st0.st_mtime, st1.st_mtime, st2.st_mtime);
+            if (! (st1.st_atime == st1.st_mtime))
+              result |= 16;
+            if (! (m_ok_POSIX || m_ok_NFS))
+              result |= 32;
+          }
+        if (close (fd) != 0)
+          result |= 1;
+      }
+    if (unlink (file) != 0)
+      result |= 1;
+  }
+
+  /* Test whether utimes() with a NULL argument works on read-only files.  */
+  {
+    int fd = open (file, O_WRONLY|O_CREAT, 0444);
+    if (fd < 0)
+      result |= 1;
+    else if (close (fd) != 0)
+      result |= 1;
+    else if (utimes (file, NULL) != 0)
+      result |= 64;
+    if (unlink (file) != 0)
+      result |= 1;
+  }
+
+  return result;
 }
 
 _ACEOF
@@ -12431,7 +17202,7 @@ $as_echo "#define HAVE_WORKING_UTIMES 1" >>confdefs.h
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct utimbuf" >&5
 $as_echo_n "checking for struct utimbuf... " >&6; }
-if test "${gl_cv_sys_struct_utimbuf+set}" = set; then :
+if ${gl_cv_sys_struct_utimbuf+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12481,7 +17252,7 @@ $as_echo "#define HAVE_STRUCT_UTIMBUF 1" >>confdefs.h
 
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
 $as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
-if test "${gl_cv_header_wchar_h_correct_inline+set}" = set; then :
+if ${gl_cv_header_wchar_h_correct_inline+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   gl_cv_header_wchar_h_correct_inline=yes
@@ -12489,6 +17260,13 @@ else
 /* end confdefs.h.  */
 
        #define wcstod renamed_wcstod
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 extern int zero (void);
 int main () { return zero(); }
@@ -12504,6 +17282,13 @@ _ACEOF
 /* end confdefs.h.  */
 
          #define wcstod renamed_wcstod
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int zero (void) { return 0; }
 
@@ -12527,7 +17312,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
 $as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
   if test $gl_cv_header_wchar_h_correct_inline = no; then
-    as_fn_error "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
+    as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
 This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
 C99 mode. You have four options:
   - Add the flag -fgnu89-inline to CC and reconfigure, or
@@ -12539,6 +17324,17 @@ Configuration aborted." "$LINENO" 5
   fi
 
 
+  GNULIB_ISWBLANK=0;
+  GNULIB_WCTYPE=0;
+  GNULIB_ISWCTYPE=0;
+  GNULIB_WCTRANS=0;
+  GNULIB_TOWCTRANS=0;
+    HAVE_ISWBLANK=1;
+  HAVE_WCTYPE_T=1;
+  HAVE_WCTRANS_T=1;
+  REPLACE_ISWBLANK=0;
+
+
 
 
 
@@ -12554,6 +17350,7 @@ fi
   gl_cond_libtool=false
   gl_libdeps=
   gl_ltlibdeps=
+  gl_m4_base='m4'
 
 
 
@@ -12566,9 +17363,6 @@ fi
   gl_source_base='lib'
 
 
-
-
-
   if test $ac_cv_func_alloca_works = no; then
     :
   fi
@@ -12577,7 +17371,7 @@ fi
   if test $ac_cv_working_alloca_h = yes; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
 $as_echo_n "checking for alloca as a compiler built-in... " >&6; }
-if test "${gl_cv_rpl_alloca+set}" = set; then :
+if ${gl_cv_rpl_alloca+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -12613,14 +17407,41 @@ $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
     ALLOCA_H=alloca.h
   fi
 
+   if test -n "$ALLOCA_H"; then
+  GL_GENERATE_ALLOCA_H_TRUE=
+  GL_GENERATE_ALLOCA_H_FALSE='#'
+else
+  GL_GENERATE_ALLOCA_H_TRUE='#'
+  GL_GENERATE_ALLOCA_H_FALSE=
+fi
+
+
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible calloc" >&5
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS openat-proc.$ac_objext"
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible calloc" >&5
 $as_echo_n "checking for GNU libc compatible calloc... " >&6; }
-if test "${ac_cv_func_calloc_0_nonnull+set}" = set; then :
+if ${ac_cv_func_calloc_0_nonnull+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
-  ac_cv_func_calloc_0_nonnull=no
+  case "$host_os" in
+                  # Guess yes on glibc systems.
+          *-gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+                  # If we don't know, assume the worst.
+          *)      ac_cv_func_calloc_0_nonnull="guessing no" ;;
+        esac
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -12628,7 +17449,13 @@ $ac_includes_default
 int
 main ()
 {
-exit (!calloc (0, 0) || calloc ((size_t) -1 / 8 + 1, 8));
+int result = 0;
+            if (!calloc (0, 0))
+              result |= 1;
+            if (calloc ((size_t) -1 / 8 + 1, 8))
+              result |= 2;
+            return result;
+
   ;
   return 0;
 }
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_calloc_0_nonnull" >&5
 $as_echo "$ac_cv_func_calloc_0_nonnull" >&6; }
-if test $ac_cv_func_calloc_0_nonnull = yes; then :
+  case "$ac_cv_func_calloc_0_nonnull" in
+    *yes)
 
-$as_echo "#define HAVE_CALLOC 1" >>confdefs.h
+$as_echo "#define HAVE_CALLOC_GNU 1" >>confdefs.h
 
-else
-  $as_echo "#define HAVE_CALLOC 0" >>confdefs.h
+      ;;
+    *)
+      $as_echo "#define HAVE_CALLOC_GNU 0" >>confdefs.h
 
+     REPLACE_CALLOC=1
 
+      ;;
+  esac
 
 
+if test $REPLACE_CALLOC = 1; then
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext"
 
 
-$as_echo "#define calloc rpl_calloc" >>confdefs.h
+
+  gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext"
 
 fi
 
 
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_CALLOC_GNU 1
+_ACEOF
+
+
+
 
 
   if test $gl_cv_func_malloc_posix = yes; then
-    HAVE_CALLOC_POSIX=1
 
 $as_echo "#define HAVE_CALLOC_POSIX 1" >>confdefs.h
 
   else
+    REPLACE_CALLOC=1
+  fi
+
+if test $REPLACE_CALLOC = 1; then
 
 
 
@@ -12686,25 +17528,68 @@ $as_echo "#define HAVE_CALLOC_POSIX 1" >>confdefs.h
 
   gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext"
 
-    HAVE_CALLOC_POSIX=0
-  fi
+fi
+
+
+
+
+
+          GNULIB_CALLOC_POSIX=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_CALLOC_POSIX 1" >>confdefs.h
+
+
+
 
 
 
 
-  GNULIB_CALLOC_POSIX=1
+
+          GNULIB_CHDIR=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h
+
+
+
 
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this system has an arbitrary file name length limit" >&5
 $as_echo_n "checking whether this system has an arbitrary file name length limit... " >&6; }
-if test "${gl_cv_have_arbitrary_file_name_length_limit+set}" = set; then :
+if ${gl_cv_have_arbitrary_file_name_length_limit+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
+
+/* Arrange to define PATH_MAX, like "pathmax.h" does. */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 #include <limits.h>
-#if defined PATH_MAX || defined MAXPATHLEN
+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+#endif
+#if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+#endif
+#ifdef __hpux
+# undef PATH_MAX
+# define PATH_MAX 1024
+#endif
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# undef PATH_MAX
+# define PATH_MAX 260
+#endif
+
+#ifdef PATH_MAX
 have_arbitrary_file_name_length_limit
 #endif
 _ACEOF
@@ -12720,7 +17605,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_arbitrary_file_name_length_limit" >&5
 $as_echo "$gl_cv_have_arbitrary_file_name_length_limit" >&6; }
 
-  if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then
+if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then
 
 
 
@@ -12735,13 +17620,7 @@ $as_echo "$gl_cv_have_arbitrary_file_name_length_limit" >&6; }
 
   :
 
-  fi
-
-
-
-
-  GNULIB_CHOWN=1
-
+fi
 
 
 
@@ -12756,7 +17635,7 @@ $as_echo "$gl_cv_have_arbitrary_file_name_length_limit" >&6; }
   gl_saved_libs=$LIBS
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
 $as_echo_n "checking for library containing clock_gettime... " >&6; }
-if test "${ac_cv_search_clock_gettime+set}" = set; then :
+if ${ac_cv_search_clock_gettime+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -12790,11 +17669,11 @@ for ac_lib in '' rt posix4; do
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if test "${ac_cv_search_clock_gettime+set}" = set; then :
+  if ${ac_cv_search_clock_gettime+:} false; then :
   break
 fi
 done
-if test "${ac_cv_search_clock_gettime+set}" = set; then :
+if ${ac_cv_search_clock_gettime+:} false; then :
 
 else
   ac_cv_search_clock_gettime=no
@@ -12815,8 +17694,7 @@ fi
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 
 
+$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
+
+
+
+
+
+  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+    REPLACE_CLOSE=1
+  fi
+
+
+
+
+
+  if test $ac_cv_header_sys_socket_h != yes; then
+                    for ac_header in winsock2.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
+
+done
+
+  fi
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    HAVE_WINSOCK2_H=1
+    UNISTD_H_HAVE_WINSOCK2_H=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+  else
+    HAVE_WINSOCK2_H=0
+  fi
+
+
+    if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
+                        REPLACE_CLOSE=1
+    fi
+
+
+    if test $REPLACE_CLOSE = 0; then
+
+
+
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
+
+      if test $HAVE_FCHDIR = 0; then
+        REPLACE_CLOSE=1
+      fi
+    fi
+
+
+if test $REPLACE_CLOSE = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext"
+
+fi
+
+
+
+
+
+          GNULIB_CLOSE=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
+
+
+
+
+  :
+
+
 
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_CLOSE_STREAM 1
+_ACEOF
+
+
+
+
+
+  for ac_func in closedir
+do :
+  ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir"
+if test "x$ac_cv_func_closedir" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_CLOSEDIR 1
+_ACEOF
+
+fi
+done
 
+  if test $ac_cv_func_closedir = no; then
+    HAVE_CLOSEDIR=0
+  fi
 
-  GNULIB_CLOSE=1
 
 
 
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
 
+    if test $HAVE_FCHDIR = 0; then
+      if test $HAVE_CLOSEDIR = 1; then
+        REPLACE_CLOSEDIR=1
+      fi
+    fi
 
 
+if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS close-stream.$ac_objext"
 
 
-    :
 
 
+  gl_LIBOBJS="$gl_LIBOBJS closedir.$ac_objext"
 
-$as_echo "#define GNULIB_CLOSE_STREAM 1" >>confdefs.h
+fi
 
 
 
 
 
+          GNULIB_CLOSEDIR=1
 
 
 
 
 
+$as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h
 
-  gl_LIBOBJS="$gl_LIBOBJS closein.$ac_objext"
 
 
-    :
 
+  :
 
 
+  :
 
 
+          if test "x$datarootdir" = x; then
+    datarootdir='${datadir}'
 
+  fi
+    if test "x$docdir" = x; then
+    docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
 
+  fi
+    if test "x$htmldir" = x; then
+    htmldir='${docdir}'
 
+  fi
+  if test "x$dvidir" = x; then
+    dvidir='${docdir}'
 
+  fi
+  if test "x$pdfdir" = x; then
+    pdfdir='${docdir}'
 
-  gl_LIBOBJS="$gl_LIBOBJS closeout.$ac_objext"
+  fi
+  if test "x$psdir" = x; then
+    psdir='${docdir}'
 
+  fi
+  if test "x$lispdir" = x; then
+    lispdir='${datarootdir}/emacs/site-lisp'
 
-    :
+  fi
+  if test "x$localedir" = x; then
+    localedir='${datarootdir}/locale'
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5
-$as_echo_n "checking for d_ino member in directory struct... " >&6; }
-if test "${gl_cv_struct_dirent_d_ino+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  gl_cv_struct_dirent_d_ino=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-             #include <sys/stat.h>
-             #include <dirent.h>
+  fi
 
-int
-main ()
-{
-DIR *dp = opendir (".");
-             struct dirent *e;
-             struct stat st;
-             if (! dp)
-               return 1;
-             e = readdir (dp);
-             return ! (e
-                       && stat (e->d_name, &st) == 0
-                       && e->d_ino == st.st_ino);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_struct_dirent_d_ino=yes
-else
-  gl_cv_struct_dirent_d_ino=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+      pkglibexecdir='${libexecdir}/${PACKAGE}'
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5
-$as_echo "$gl_cv_struct_dirent_d_ino" >&6; }
-   if test $gl_cv_struct_dirent_d_ino = yes; then
 
-$as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h
 
-   fi
 
 
 
@@ -12943,30 +17918,47 @@ $as_echo "#define D_INO_IN_DIRENT 1" >>confdefs.h
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
 $as_echo_n "checking absolute name of <dirent.h>... " >&6; }
-if test "${gl_cv_next_dirent_h+set}" = set; then :
+if ${gl_cv_next_dirent_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_dirent_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+             if test $ac_cv_header_dirent_h = yes; then
+
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <dirent.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_dirent_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/dirent.h#{
-                 s#.*"\(.*/dirent.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'dirent.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_dirent_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
-            gl_cv_next_dirent_h='<'dirent.h'>'
-          fi
+               gl_cv_next_dirent_h='<'dirent.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
@@ -12986,10 +17978,62 @@ $as_echo "$gl_cv_next_dirent_h" >&6; }
 
 
 
+  if test $ac_cv_header_dirent_h = yes; then
+    HAVE_DIRENT_H=1
+  else
+    HAVE_DIRENT_H=0
+  fi
 
 
 
-    :
+    for gl_func in alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <dirent.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
+else
+  eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+      done
+
+
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_DIRENT_SAFER 1
+_ACEOF
 
 
 
@@ -13000,7 +18044,7 @@ $as_echo "$gl_cv_next_dirent_h" >&6; }
   for ac_func in dirfd
 do :
   ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
-if test "x$ac_cv_func_dirfd" = x""yes; then :
+if test "x$ac_cv_func_dirfd" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_DIRFD 1
 _ACEOF
@@ -13009,9 +18053,9 @@ fi
 done
 
   ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
-     #include <dirent.h>
+      #include <dirent.h>
 "
-if test "x$ac_cv_have_decl_dirfd" = x""yes; then :
+if test "x$ac_cv_have_decl_dirfd" = xyes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
@@ -13027,7 +18071,7 @@ _ACEOF
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5
 $as_echo_n "checking whether dirfd is a macro... " >&6; }
-if test "${gl_cv_func_dirfd_macro+set}" = set; then :
+if ${gl_cv_func_dirfd_macro+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5
 $as_echo "$gl_cv_func_dirfd_macro" >&6; }
 
-  # Use the replacement only if we have no function, macro,
-  # or declaration with that name.
-  if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$gl_cv_func_dirfd_macro \
-      = no,no,no; then
-
-
+  # Use the replacement only if we have no function or macro with that name.
+  if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no; then
+    if test $ac_cv_have_decl_dirfd = yes; then
+      # If the system declares dirfd already, let's declare rpl_dirfd instead.
+      REPLACE_DIRFD=1
+    fi
+  fi
 
+if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no; then
 
 
 
 
 
-  for ac_func in dirfd
-do :
-  ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
-if test "x$ac_cv_func_dirfd" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DIRFD 1
-_ACEOF
 
-else
 
-    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
 
-fi
-done
+  gl_LIBOBJS="$gl_LIBOBJS dirfd.$ac_objext"
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
 $as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; }
-if test "${gl_cv_sys_dir_fd_member_name+set}" = set; then :
+if ${gl_cv_sys_dir_fd_member_name+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-        dirfd_save_CFLAGS=$CFLAGS
-        for ac_expr in d_fd dd_fd; do
+      dirfd_save_CFLAGS=$CFLAGS
+      for ac_expr in d_fd dd_fd; do
 
-          CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-             #include <sys/types.h>
-             #include <dirent.h>
+           #include <sys/types.h>
+           #include <dirent.h>
 int
 main ()
 {
@@ -13107,61 +18143,40 @@ if ac_fn_c_try_compile "$LINENO"; then :
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-          CFLAGS=$dirfd_save_CFLAGS
-          test "$dir_fd_found" = yes && break
-        done
-        test "$dir_fd_found" = yes || ac_expr=no_such_member
+        CFLAGS=$dirfd_save_CFLAGS
+        test "$dir_fd_found" = yes && break
+      done
+      test "$dir_fd_found" = yes || ac_expr=no_such_member
 
-        gl_cv_sys_dir_fd_member_name=$ac_expr
+      gl_cv_sys_dir_fd_member_name=$ac_expr
 
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5
 $as_echo "$gl_cv_sys_dir_fd_member_name" >&6; }
-    if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
+  if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
 
 cat >>confdefs.h <<_ACEOF
 #define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name
 _ACEOF
 
-    fi
-
   fi
 
 
-
-  GNULIB_DIRFD=1
-
-
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS basename-lgpl.$ac_objext"
-
-
-
-
-
-
-
+fi
 
 
-  gl_LIBOBJS="$gl_LIBOBJS dirname-lgpl.$ac_objext"
 
 
 
+          GNULIB_DIRFD=1
 
 
 
 
 
+$as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h
 
-  gl_LIBOBJS="$gl_LIBOBJS stripslash.$ac_objext"
 
 
 
@@ -13172,7 +18187,7 @@ _ACEOF
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
 $as_echo_n "checking whether // is distinct from /... " >&6; }
-if test "${gl_cv_double_slash_root+set}" = set; then :
+if ${gl_cv_double_slash_root+:} false; then :
   $as_echo_n "(cached) " >&6
 else
    if test x"$cross_compiling" = xyes ; then
@@ -13210,103 +18225,49 @@ $as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
 
 
 
-
-  if test $ac_cv_func_dup2 = no; then
-    HAVE_DUP2=0
-
-
-
-
-
+  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+    REPLACE_DUP=1
+  fi
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
 
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
-$as_echo_n "checking whether dup2 works... " >&6; }
-if test "${gl_cv_func_dup2_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-           mingw*) # on this platform, dup2 always returns 0 for success
-             gl_cv_func_dup2_works=no;;
-           cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
-             gl_cv_func_dup2_works=no;;
-           linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
-                   # closed fd may yield -EBADF instead of -1 / errno=EBADF.
-             gl_cv_func_dup2_works=no;;
-           freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
-             gl_cv_func_dup2_works=no;;
-           *) gl_cv_func_dup2_works=yes;;
-         esac
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
 
-         #include <unistd.h>
-#include <errno.h>
-int
-main ()
-{
-if (dup2 (1, 1) == 0)
-              return 1;
-            close (0);
-            if (dup2 (0, 0) != -1)
-              return 2;
-            /* Many gnulib modules require POSIX conformance of EBADF.  */
-            if (dup2 (1, 1000000) == -1 && errno != EBADF)
-              return 3;
-            return 0;
+    if test $HAVE_FCHDIR = 0; then
+      REPLACE_DUP=1
+    fi
 
-  ;
-  return 0;
-}
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_dup2_works=yes
-else
-  gl_cv_func_dup2_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+if test $REPLACE_DUP = 1; then
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
-$as_echo "$gl_cv_func_dup2_works" >&6; }
-    if test "$gl_cv_func_dup2_works" = no; then
 
 
-  if test $ac_cv_func_dup2 = yes; then
-    REPLACE_DUP2=1
-  fi
 
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS dup.$ac_objext"
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
+fi
 
 
-    fi
-  fi
 
 
 
-  GNULIB_DUP2=1
+          GNULIB_DUP=1
 
 
 
 
 
+$as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h
 
 
 
@@ -13315,263 +18276,406 @@ $as_echo "$gl_cv_func_dup2_works" >&6; }
 
 
 
+$as_echo "#define HAVE_DUP2 1" >>confdefs.h
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
-$as_echo_n "checking for error_at_line... " >&6; }
-if test "${ac_cv_lib_error_at_line+set}" = set; then :
+  if test $HAVE_DUP2 = 1; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
+$as_echo_n "checking whether dup2 works... " >&6; }
+if ${gl_cv_func_dup2_works+:} false; then :
   $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+           mingw*) # on this platform, dup2 always returns 0 for success
+             gl_cv_func_dup2_works="guessing no" ;;
+           cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
+             gl_cv_func_dup2_works="guessing no" ;;
+           linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
+                   # closed fd may yield -EBADF instead of -1 / errno=EBADF.
+             gl_cv_func_dup2_works="guessing no" ;;
+           freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
+             gl_cv_func_dup2_works="guessing no" ;;
+           haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
+             gl_cv_func_dup2_works="guessing no" ;;
+           *) gl_cv_func_dup2_works="guessing yes" ;;
+         esac
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <error.h>
+
+         #include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
 int
 main ()
 {
-error_at_line (0, 0, "", 0, "an error occurred");
+int result = 0;
+#ifdef FD_CLOEXEC
+            if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
+              result |= 1;
+#endif
+            if (dup2 (1, 1) == 0)
+              result |= 2;
+#ifdef FD_CLOEXEC
+            if (fcntl (1, F_GETFD) != FD_CLOEXEC)
+              result |= 4;
+#endif
+            close (0);
+            if (dup2 (0, 0) != -1)
+              result |= 8;
+            /* Many gnulib modules require POSIX conformance of EBADF.  */
+            if (dup2 (2, 1000000) == -1 && errno != EBADF)
+              result |= 16;
+            return result;
+
   ;
   return 0;
 }
+
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_error_at_line=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_dup2_works=yes
 else
-  ac_cv_lib_error_at_line=no
+  gl_cv_func_dup2_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
-$as_echo "$ac_cv_lib_error_at_line" >&6; }
-if test $ac_cv_lib_error_at_line = no; then
-
-
-
-
-
 
 
-
-  gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext"
-
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
+$as_echo "$gl_cv_func_dup2_works" >&6; }
+    case "$gl_cv_func_dup2_works" in
+      *yes) ;;
+      *)
+        REPLACE_DUP2=1
+        ;;
+    esac
+  fi
 
 
 
 
-  :
-
-
-
-
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format"
-
-
-
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format"
-
-
-
-
-
-
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
 
+    if test $HAVE_FCHDIR = 0; then
+      if test $HAVE_DUP2 = 1; then
+        REPLACE_DUP2=1
+      fi
+    fi
 
 
+if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
 
-  gl_LIBOBJS="$gl_LIBOBJS exitfail.$ac_objext"
 
 
-    :
 
 
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
 
-  if test $ac_cv_func_fchdir = no; then
-    REPLACE_FCHDIR=1
 
+fi
 
 
 
 
 
+          GNULIB_DUP2=1
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext"
 
-    :
 
-$as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h
 
-                REPLACE_OPENDIR=1
-    REPLACE_CLOSEDIR=1
-    REPLACE_DUP=1
+$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
 
 
-  REPLACE_OPEN=1
 
 
 
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
+$as_echo_n "checking for error_at_line... " >&6; }
+if ${ac_cv_lib_error_at_line+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <error.h>
+int
+main ()
+{
+error_at_line (0, 0, "", 0, "an error occurred");
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_error_at_line=yes
+else
+  ac_cv_lib_error_at_line=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
+$as_echo "$ac_cv_lib_error_at_line" >&6; }
 
+if test $ac_cv_lib_error_at_line = no; then
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
 
 
 
 
-  :
+  gl_LIBOBJS="$gl_LIBOBJS error.$ac_objext"
 
 
 
 
-  REPLACE_CLOSE=1
+  :
 
+fi
 
 
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format"
 
 
 
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format"
 
 
-  gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext"
 
 
 
-  REPLACE_FCLOSE=1
 
+  if test $ac_cv_have_decl_fchdir = no; then
+    HAVE_DECL_FCHDIR=0
+  fi
 
 
+  if test $HAVE_FCHDIR = 0; then
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fclose.$ac_objext"
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS fchdir.$ac_objext"
 
+    :
 
-  if test $ac_cv_func_dup2 = yes; then
-    REPLACE_DUP2=1
-  fi
+$as_echo "#define REPLACE_FCHDIR 1" >>confdefs.h
 
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5
+$as_echo_n "checking whether open can visit directories... " >&6; }
+if ${gl_cv_func_open_directory_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_open_directory_works="guessing no" ;;
+         esac
 
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <fcntl.h>
 
+int
+main ()
+{
+return open(".", O_RDONLY) < 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_open_directory_works=yes
+else
+  gl_cv_func_open_directory_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5
+$as_echo "$gl_cv_func_open_directory_works" >&6; }
+    case "$gl_cv_func_open_directory_works" in
+      *yes) ;;
+      *)
 
+$as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h
 
+        ;;
+    esac
+  fi
 
 
-  gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext"
 
 
 
 
+          GNULIB_FCHDIR=1
 
-  if test $ac_cv_func_fcntl = no; then
-    HAVE_FCNTL=0
-  else
-    REPLACE_FCNTL=1
-  fi
 
 
 
 
+$as_echo "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
 
 
 
-    :
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5
-$as_echo_n "checking whether open can visit directories... " >&6; }
-if test "${gl_cv_func_open_directory_works+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
+$as_echo_n "checking whether fflush works on input streams... " >&6; }
+if ${gl_cv_func_fflush_stdin+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  gl_cv_func_open_directory_works="guessing no"
+  echo hello world > conftest.txt
+     if test "$cross_compiling" = yes; then :
+        gl_cv_func_fflush_stdin=no
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <fcntl.h>
+
+#include <stdio.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
 
 int
 main ()
 {
-return open(".", O_RDONLY) < 0;
+FILE *f = fopen ("conftest.txt", "r");
+         char buffer[10];
+         int fd;
+         int c;
+         if (f == NULL)
+           return 1;
+         fd = fileno (f);
+         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
+           return 2;
+         /* For deterministic results, ensure f read a bigger buffer.  */
+         if (lseek (fd, 0, SEEK_CUR) == 5)
+           return 3;
+         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
+            on BSD systems and on mingw.  */
+         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
+           return 4;
+         if (lseek (fd, 0, SEEK_CUR) != 5)
+           return 5;
+         /* Verify behaviour of fflush after ungetc. See
+            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
+         /* Verify behaviour of fflush after a backup ungetc.  This fails on
+            mingw.  */
+         c = fgetc (f);
+         ungetc (c, f);
+         fflush (f);
+         if (fgetc (f) != c)
+           return 6;
+         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
+            on glibc 2.8 and on BSD systems.  */
+         c = fgetc (f);
+         ungetc ('@', f);
+         fflush (f);
+         if (fgetc (f) != c)
+           return 7;
+         return 0;
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_open_directory_works=yes
+  gl_cv_func_fflush_stdin=yes
 else
-  gl_cv_func_open_directory_works=no
+  gl_cv_func_fflush_stdin=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+     rm conftest.txt
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5
-$as_echo "$gl_cv_func_open_directory_works" >&6; }
-    if test "$gl_cv_func_open_directory_works" != yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
+$as_echo "$gl_cv_func_fflush_stdin" >&6; }
 
-$as_echo "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h
+  if test $gl_cv_func_fflush_stdin = no; then
+    REPLACE_FCLOSE=1
+  fi
 
-      REPLACE_FSTAT=1
-    fi
+
+  if test $REPLACE_CLOSE = 1; then
+    REPLACE_FCLOSE=1
   fi
 
+if test $REPLACE_FCLOSE = 1; then
 
 
-  GNULIB_FCHDIR=1
 
 
 
 
 
-  GNULIB_FCLOSE=1
 
+  gl_LIBOBJS="$gl_LIBOBJS fclose.$ac_objext"
 
+fi
 
 
 
 
-  if test $ac_cv_func_fcntl = no; then
 
+          GNULIB_FCLOSE=1
 
 
-  if test $ac_cv_func_fcntl = no; then
-    HAVE_FCNTL=0
-  else
-    REPLACE_FCNTL=1
-  fi
 
 
 
+$as_echo "#define GNULIB_TEST_FCLOSE 1" >>confdefs.h
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
 
 
+
+  if test $ac_cv_func_fcntl = no; then
+
+
+
+  if test $ac_cv_func_fcntl = no; then
+    HAVE_FCNTL=0
+  else
+    REPLACE_FCNTL=1
+  fi
+
   else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
 $as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
-if test "${gl_cv_func_fcntl_f_dupfd_works+set}" = set; then :
+if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -13585,11 +18689,15 @@ else
 /* end confdefs.h.  */
 
 #include <fcntl.h>
+#include <errno.h>
 
 int
 main ()
 {
-return fcntl (0, F_DUPFD, -1) != -1;
+int result = 0;
+      if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
+      if (errno != EINVAL) result |= 2;
+      return result;
 
   ;
   return 0;
@@ -13619,23 +18727,13 @@ $as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
   fi
 
 
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
-
-
-
 $as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
  ;;
     esac
 
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
 $as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
-if test "${gl_cv_func_fcntl_f_dupfd_cloexec+set}" = set; then :
+if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -13695,22 +18793,30 @@ $as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
     REPLACE_FCNTL=1
   fi
 
+          fi
+  fi
 
 
 
 
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
 
+    if test $HAVE_FCHDIR = 0; then
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
-
 
-          fi
+  if test $ac_cv_func_fcntl = no; then
+    HAVE_FCNTL=0
+  else
+    REPLACE_FCNTL=1
   fi
 
+    fi
 
 
-  GNULIB_FCNTL=1
+if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
 
 
 
@@ -13719,57 +18825,21 @@ $as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext"
 
+fi
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_fcntl_h='<'fcntl.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
-$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
-if test "${gl_cv_next_fcntl_h+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-          if test $ac_cv_header_fcntl_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <fcntl.h>
 
-_ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/fcntl.h#{
-                 s#.*"\(.*/fcntl.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_fcntl_h='<'fcntl.h'>'
-          fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
-$as_echo "$gl_cv_next_fcntl_h" >&6; }
-     fi
-     NEXT_FCNTL_H=$gl_cv_next_fcntl_h
 
-     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
-       gl_next_as_first_directive='<'fcntl.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_fcntl_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
+          GNULIB_FCNTL=1
 
 
 
 
 
+$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
 
 
 
@@ -13778,31 +18848,115 @@ $as_echo "$gl_cv_next_fcntl_h" >&6; }
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS open-safer.$ac_objext"
 
 
 
 
 
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_fcntl_h='<'fcntl.h'>'
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
+$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
+if ${gl_cv_next_fcntl_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <fcntl.h>
+
+_ACEOF
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'fcntl.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_fcntl_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
+$as_echo "$gl_cv_next_fcntl_h" >&6; }
+     fi
+     NEXT_FCNTL_H=$gl_cv_next_fcntl_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'fcntl.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_fcntl_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
 
-  gl_LIBOBJS="$gl_LIBOBJS creat-safer.$ac_objext"
 
-  # Prerequisites of lib/open-safer.c.
 
 
 
 
-$as_echo "#define GNULIB_FCNTL_SAFER 1" >>confdefs.h
 
 
 
 
+    for gl_func in fcntl openat; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <fcntl.h>
 
-  if test $ac_cv_func_fdopendir = no; then
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
+else
+  eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+      done
 
 
 
@@ -13810,7 +18964,9 @@ $as_echo "#define GNULIB_FCNTL_SAFER 1" >>confdefs.h
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS openat-proc.$ac_objext"
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FCNTL_SAFER 1
+_ACEOF
 
 
 
@@ -13818,35 +18974,66 @@ $as_echo "#define GNULIB_FCNTL_SAFER 1" >>confdefs.h
 
 
 
+    ac_fn_c_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" "
+#include <dirent.h>
 
+"
+if test "x$ac_cv_have_decl_fdopendir" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
 
-  gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext"
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FDOPENDIR $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
 
+else
+  HAVE_DECL_FDOPENDIR=0
+fi
 
-    :
 
+  if test $ac_cv_func_fdopendir = no; then
     HAVE_FDOPENDIR=0
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5
 $as_echo_n "checking whether fdopendir works... " >&6; }
-if test "${gl_cv_func_fdopendir_works+set}" = set; then :
+if ${gl_cv_func_fdopendir_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
-  gl_cv_func_fdopendir_works="guessing no"
+  case "$host_os" in
+                    # Guess yes on glibc systems.
+            *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
+                    # If we don't know, assume the worst.
+            *)      gl_cv_func_fdopendir_works="guessing no" ;;
+          esac
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <dirent.h>
 #include <fcntl.h>
+#include <unistd.h>
+#if !HAVE_DECL_FDOPENDIR
+extern
+# ifdef __cplusplus
+"C"
+# endif
+DIR *fdopendir (int);
+#endif
 
 int
 main ()
 {
-int fd = open ("conftest.c", O_RDONLY);
-     if (fd < 0) return 2;
-     return !!fdopendir (fd);
+int result = 0;
+     int fd = open ("conftest.c", O_RDONLY);
+     if (fd < 0) result |= 1;
+     if (fdopendir (fd)) result |= 2;
+     if (close (fd)) result |= 4;
+     return result;
   ;
   return 0;
 }
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5
 $as_echo "$gl_cv_func_fdopendir_works" >&6; }
-    if test "$gl_cv_func_fdopendir_works" != yes; then
-      REPLACE_FDOPENDIR=1
-
-    :
+    case "$gl_cv_func_fdopendir_works" in
+      *yes) ;;
+      *)
+        REPLACE_FDOPENDIR=1
+        ;;
+    esac
+  fi
 
+if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
 
 
 
@@ -13878,17 +19069,36 @@ $as_echo "$gl_cv_func_fdopendir_works" >&6; }
 
   gl_LIBOBJS="$gl_LIBOBJS fdopendir.$ac_objext"
 
-    fi
-  fi
+fi
+
+
+
+
+
+          GNULIB_FDOPENDIR=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FDOPENDIR 1
+_ACEOF
+
 
 
 
-  GNULIB_FDOPENDIR=1
 
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
 $as_echo_n "checking whether fflush works on input streams... " >&6; }
-if test "${gl_cv_func_fflush_stdin+set}" = set; then :
+if ${gl_cv_func_fflush_stdin+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   echo hello world > conftest.txt
@@ -13899,7 +19109,11 @@ else
 /* end confdefs.h.  */
 
 #include <stdio.h>
-#include <unistd.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
 
 int
 main ()
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
 $as_echo "$gl_cv_func_fflush_stdin" >&6; }
+
   if test $gl_cv_func_fflush_stdin = no; then
+    REPLACE_FFLUSH=1
+  fi
 
+if test $REPLACE_FFLUSH = 1; then
 
 
 
@@ -13972,35 +19190,149 @@ $as_echo "$gl_cv_func_fflush_stdin" >&6; }
 
 
 
+  :
 
+fi
 
 
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_FFLUSH 1
+_ACEOF
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fseeko.$ac_objext"
 
 
-  REPLACE_FFLUSH=1
-  REPLACE_FSEEKO=1
 
 
-  :
+          GNULIB_FFLUSH=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FFLUSH 1" >>confdefs.h
 
 
-  fi
 
 
 
-  GNULIB_FFLUSH=1
 
 
 
 
   FLOAT_H=
+  REPLACE_FLOAT_LDBL=0
   case "$host_os" in
-    beos* | openbsd*)
+    aix* | beos* | openbsd* | mirbsd* | irix*)
       FLOAT_H=float.h
+      ;;
+    freebsd*)
+      case "$host_cpu" in
+        i[34567]86 )
+          FLOAT_H=float.h
+          ;;
+        x86_64 )
+          # On x86_64 systems, the C compiler may still be generating
+          # 32-bit code.
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__ || defined __x86_64__ || defined __amd64__
+             yes
+             #endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+
+else
+  FLOAT_H=float.h
+fi
+rm -f conftest*
+
+          ;;
+      esac
+      ;;
+    linux*)
+      case "$host_cpu" in
+        powerpc*)
+          FLOAT_H=float.h
+          ;;
+      esac
+      ;;
+  esac
+  case "$host_os" in
+    aix* | freebsd* | linux*)
+      if test -n "$FLOAT_H"; then
+        REPLACE_FLOAT_LDBL=1
+      fi
+      ;;
+  esac
+
+    REPLACE_ITOLD=0
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
+$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; }
+if ${gl_cv_func_itold_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      if test "$cross_compiling" = yes; then :
+  case "$host" in
+           sparc*-*-linux*)
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__ || defined __arch64__
+                yes
+                #endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  gl_cv_func_itold_works="guessing no"
+else
+  gl_cv_func_itold_works="guessing yes"
+fi
+rm -f conftest*
+
+             ;;
+           *) gl_cv_func_itold_works="guessing yes" ;;
+         esac
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int i = -1;
+volatile long double ld;
+int main ()
+{
+  ld += i * 1.0L;
+  if (ld > 0)
+    return 1;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_itold_works=yes
+else
+  gl_cv_func_itold_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
+$as_echo "$gl_cv_func_itold_works" >&6; }
+  case "$gl_cv_func_itold_works" in
+    *no)
+      REPLACE_ITOLD=1
+                  FLOAT_H=float.h
+      ;;
+  esac
+
+  if test -n "$FLOAT_H"; then
+
+
 
 
 
@@ -14012,30 +19344,41 @@ $as_echo "$gl_cv_func_fflush_stdin" >&6; }
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
 $as_echo_n "checking absolute name of <float.h>... " >&6; }
-if test "${gl_cv_next_float_h+set}" = set; then :
+if ${gl_cv_next_float_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_float_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <float.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_float_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/float.h#{
-                 s#.*"\(.*/float.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_float_h='<'float.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'float.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_float_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
@@ -14054,10 +19397,43 @@ $as_echo "$gl_cv_next_float_h" >&6; }
 
 
 
-      ;;
-  esac
+
+  fi
+
+   if test -n "$FLOAT_H"; then
+  GL_GENERATE_FLOAT_H_TRUE=
+  GL_GENERATE_FLOAT_H_FALSE='#'
+else
+  GL_GENERATE_FLOAT_H_TRUE='#'
+  GL_GENERATE_FLOAT_H_FALSE=
+fi
+
 
 
+if test $REPLACE_FLOAT_LDBL = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext"
+
+fi
+if test $REPLACE_ITOLD = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext"
+
+fi
 
 
 
@@ -14069,7 +19445,7 @@ $as_echo "$gl_cv_next_float_h" >&6; }
 '
   ac_fn_c_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers
 "
-if test "x$ac_cv_have_decl___fpending" = x""yes; then :
+if test "x$ac_cv_have_decl___fpending" = xyes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
@@ -14079,50 +19455,68 @@ cat >>confdefs.h <<_ACEOF
 #define HAVE_DECL___FPENDING $ac_have_decl
 _ACEOF
 
-  if test $ac_cv_func___fpending = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to determine the number of pending output bytes on a stream" >&5
+
+if test $ac_cv_func___fpending = no; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS fpending.$ac_objext"
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to determine the number of pending output bytes on a stream" >&5
 $as_echo_n "checking how to determine the number of pending output bytes on a stream... " >&6; }
-if test "${ac_cv_sys_pending_output_n_bytes+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-        for ac_expr in                                                    \
-                                                                          \
-            '# glibc2'                                                    \
-            'fp->_IO_write_ptr - fp->_IO_write_base'                      \
-                                                                          \
-            '# traditional Unix'                                          \
-            'fp->_ptr - fp->_base'                                        \
-                                                                          \
-            '# BSD'                                                       \
-            'fp->_p - fp->_bf._base'                                      \
-                                                                          \
-            '# SCO, Unixware'                                             \
-            '(fp->__ptr ? fp->__ptr - fp->__base : 0)'                    \
-                                                                          \
-            '# QNX'                                                       \
-            '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \
-                                                                          \
-            '# old glibc?'                                                \
-            'fp->__bufp - fp->__buffer'                                   \
-                                                                          \
-            '# old glibc iostream?'                                       \
-            'fp->_pptr - fp->_pbase'                                      \
-                                                                          \
-            '# emx+gcc'                                                   \
-            'fp->_ptr - fp->_buffer'                                      \
-                                                                          \
-            '# VMS'                                                       \
-            '(*fp)->_ptr - (*fp)->_base'                                  \
-                                                                          \
-            '# e.g., DGUX R4.11; the info is not available'               \
-            1                                                             \
-            ; do
-
-          # Skip each embedded comment.
-          case "$ac_expr" in '#'*) continue;; esac
+if ${ac_cv_sys_pending_output_n_bytes+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      for ac_expr in                                                    \
+                                                                        \
+          '# glibc2'                                                    \
+          'fp->_IO_write_ptr - fp->_IO_write_base'                      \
+                                                                        \
+          '# traditional Unix'                                          \
+          'fp->_ptr - fp->_base'                                        \
+                                                                        \
+          '# BSD'                                                       \
+          'fp->_p - fp->_bf._base'                                      \
+                                                                        \
+          '# SCO, Unixware'                                             \
+          '(fp->__ptr ? fp->__ptr - fp->__base : 0)'                    \
+                                                                        \
+          '# QNX'                                                       \
+          '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \
+                                                                        \
+          '# old glibc?'                                                \
+          'fp->__bufp - fp->__buffer'                                   \
+                                                                        \
+          '# old glibc iostream?'                                       \
+          'fp->_pptr - fp->_pbase'                                      \
+                                                                        \
+          '# emx+gcc'                                                   \
+          'fp->_ptr - fp->_buffer'                                      \
+                                                                        \
+          '# Minix'                                                     \
+          'fp->_ptr - fp->_buf'                                         \
+                                                                        \
+          '# Plan9'                                                     \
+          'fp->wp - fp->buf'                                            \
+                                                                        \
+          '# VMS'                                                       \
+          '(*fp)->_ptr - (*fp)->_base'                                  \
+                                                                        \
+          '# e.g., DGUX R4.11; the info is not available'               \
+          1                                                             \
+          ; do
+
+        # Skip each embedded comment.
+        case "$ac_expr" in '#'*) continue;; esac
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
 int
@@ -14138,10 +19532,10 @@ if ac_fn_c_try_compile "$LINENO"; then :
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-          test "$fp_done" = yes && break
-        done
+        test "$fp_done" = yes && break
+      done
 
-        ac_cv_sys_pending_output_n_bytes=$ac_expr
+      ac_cv_sys_pending_output_n_bytes=$ac_expr
 
 
 fi
@@ -14153,17 +19547,7 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS fpending.$ac_objext"
-
-  fi
-
+fi
 
 
 
@@ -14282,7 +19666,7 @@ $as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h
       for ac_func in nl_langinfo
 do :
   ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo"
-if test "x$ac_cv_func_nl_langinfo" = x""yes; then :
+if test "x$ac_cv_func_nl_langinfo" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_NL_LANGINFO 1
 _ACEOF
@@ -14446,8 +19830,9 @@ $as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
 
 
 
+
   ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
 
 else
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fprintf.$ac_objext"
+  gl_LIBOBJS="$gl_LIBOBJS fprintf.$ac_objext"
+
+  REPLACE_FPRINTF=1
+
+$as_echo "#define REPLACE_FPRINTF_POSIX 1" >>confdefs.h
+
+  :
+
+  fi
+
+
+
+
+
+
+          GNULIB_FPRINTF_POSIX=1
 
-  REPLACE_FPRINTF=1
 
-$as_echo "#define REPLACE_FPRINTF_POSIX 1" >>confdefs.h
 
-  :
 
-  fi
 
+$as_echo "#define GNULIB_TEST_FPRINTF_POSIX 1" >>confdefs.h
 
 
-  GNULIB_FPRINTF_POSIX=1
 
 
 
@@ -14492,7 +19888,7 @@ $as_echo "#define REPLACE_FPRINTF_POSIX 1" >>confdefs.h
 
   ac_fn_c_check_decl "$LINENO" "fpurge" "ac_cv_have_decl_fpurge" "#include <stdio.h>
 "
-if test "x$ac_cv_have_decl_fpurge" = x""yes; then :
+if test "x$ac_cv_have_decl_fpurge" = xyes; then :
   ac_have_decl=1
 else
   ac_have_decl=0
@@ -14503,10 +19899,11 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
   if test "x$ac_cv_func_fpurge" = xyes; then
+    HAVE_FPURGE=1
     # Detect BSD bug.  Only cygwin 1.7 is known to be immune.
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fpurge works" >&5
 $as_echo_n "checking whether fpurge works... " >&6; }
-if test "${gl_cv_func_fpurge_works+set}" = set; then :
+if ${gl_cv_func_fpurge_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
 $as_echo "$gl_cv_func_fpurge_works" >&6; }
     if test "x$gl_cv_func_fpurge_works" != xyes; then
       REPLACE_FPURGE=1
+    fi
+  else
+    HAVE_FPURGE=0
+  fi
+  if test "x$ac_cv_have_decl_fpurge" = xno; then
+    HAVE_DECL_FPURGE=0
+  fi
 
+if test $HAVE_FPURGE = 0 || test $REPLACE_FPURGE = 1; then
 
 
 
@@ -14561,77 +19966,46 @@ $as_echo "$gl_cv_func_fpurge_works" >&6; }
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fpurge.$ac_objext"
 
-    fi
-  else
+  gl_LIBOBJS="$gl_LIBOBJS fpurge.$ac_objext"
 
+fi
 
 
 
 
 
+          GNULIB_FPURGE=1
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fpurge.$ac_objext"
 
-  fi
-  if test "x$ac_cv_have_decl_fpurge" = xno; then
-    HAVE_DECL_FPURGE=0
-  fi
 
 
+$as_echo "#define GNULIB_TEST_FPURGE 1" >>confdefs.h
 
-  GNULIB_FPURGE=1
 
 
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
-$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_frexp_no_libm+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-                   double x;
-int
-main ()
-{
-int e; return frexp (x, &e) > 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_frexp_no_libm=yes
-else
-  gl_cv_func_frexp_no_libm=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
-$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
   if test $gl_cv_func_frexp_no_libm = yes; then
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
 $as_echo_n "checking whether frexp works... " >&6; }
-if test "${gl_cv_func_frexp_works+set}" = set; then :
+if ${gl_cv_func_frexp_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
   case "$host_os" in
-         netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
-         *)                        gl_cv_func_frexp_works="guessing yes";;
-       esac
+           netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
+           *)                        gl_cv_func_frexp_works="guessing yes";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -14640,13 +20014,34 @@ else
 #include <float.h>
 #include <math.h>
 #include <string.h>
+#if HAVE_ALARM
+# include <unistd.h>
+#endif
+/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
+   ICC 10.0 has a bug when optimizing the expression -zero.
+   The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
+   to PowerPC on MacOS X 10.5.  */
+#if defined __hpux || defined __sgi || defined __ICC
+static double
+compute_minus_zero (void)
+{
+  return -DBL_MIN * DBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
+#else
+double minus_zero = -0.0;
+#endif
 int main()
 {
+  int result = 0;
   int i;
   volatile double x;
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
-   So we use -zero instead.  */
   double zero = 0.0;
+#if HAVE_ALARM
+  /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
+     number.  Let the test fail in this case.  */
+  alarm (5);
+#endif
   /* Test on denormalized numbers.  */
   for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
     ;
@@ -14657,25 +20052,25 @@ int main()
       /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
          On NetBSD: y = 0.75. Correct: y = 0.5.  */
       if (y != 0.5)
-        return 1;
+        result |= 1;
     }
   /* Test on infinite numbers.  */
-  x = 1.0 / 0.0;
+  x = 1.0 / zero;
   {
     int exp;
     double y = frexp (x, &exp);
     if (y != x)
-      return 1;
+      result |= 2;
   }
   /* Test on negative zero.  */
-  x = -zero;
+  x = minus_zero;
   {
     int exp;
     double y = frexp (x, &exp);
     if (memcmp (&y, &x, sizeof x))
-      return 1;
+      result |= 4;
   }
-  return 0;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -14704,7 +20099,9 @@ $as_echo "$gl_cv_func_frexp_works" >&6; }
 
 $as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h
 
-  else
+  fi
+
+if test $gl_func_frexp_no_libm != yes; then
 
 
 
@@ -14715,24 +20112,45 @@ $as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h
 
   gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext"
 
-  fi
+fi
+
+
+
+
+
+          GNULIB_FREXP=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h
 
 
 
-  GNULIB_FREXP=1
 
 
 
+      ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
+"
+if test "x$ac_cv_have_decl_frexpl" = xyes; then :
+
+else
+  HAVE_DECL_FREXPL=0
+fi
+
+  if test $HAVE_DECL_FREXPL = 1; then
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
 $as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_frexpl_no_libm+set}" = set; then :
+if ${gl_cv_func_frexpl_no_libm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <math.h>
-                   long double x;
+             long double x;
 int
 main ()
 {
@@ -14752,21 +20170,23 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
 $as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
-  if test $gl_cv_func_frexpl_no_libm = yes; then
+
+    if test $gl_cv_func_frexpl_no_libm = yes; then
 
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
 $as_echo_n "checking whether frexpl works... " >&6; }
-if test "${gl_cv_func_frexpl_works+set}" = set; then :
+if ${gl_cv_func_frexpl_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-         aix* | beos* | darwin* | irix* | mingw* | pw*)
-            gl_cv_func_frexpl_works="guessing no";;
-         *) gl_cv_func_frexpl_works="guessing yes";;
-       esac
+
+         case "$host_os" in
+           aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
+              gl_cv_func_frexpl_works="guessing no";;
+           *) gl_cv_func_frexpl_works="guessing yes";;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -14779,9 +20199,28 @@ else
 # undef LDBL_MIN_EXP
 # define LDBL_MIN_EXP    (-16381)
 #endif
-extern long double frexpl (long double, int *);
+#if defined __i386__ && defined __FreeBSD__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
+#endif
+#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+#endif
+#if defined __sgi && (LDBL_MANT_DIG >= 106)
+# if defined __GNUC__
+#  undef LDBL_MIN_EXP
+#  define LDBL_MIN_EXP DBL_MIN_EXP
+# endif
+#endif
+extern
+#ifdef __cplusplus
+"C"
+#endif
+long double frexpl (long double, int *);
 int main()
 {
+  int result = 0;
   volatile long double x;
   /* Test on finite numbers that fails on AIX 5.1.  */
   x = 16.0L;
@@ -14789,7 +20228,7 @@ int main()
     int exp = -9999;
     frexpl (x, &exp);
     if (exp != 5)
-      return 1;
+      result |= 1;
   }
   /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl
      function returns an invalid (incorrectly normalized) value: it returns
@@ -14801,7 +20240,7 @@ int main()
     int exp = -9999;
     long double y = frexpl (x, &exp);
     if (!(exp == 1 && y == 0.505L))
-      return 1;
+      result |= 2;
   }
   /* Test on large finite numbers.  This fails on BeOS at i = 16322, while
      LDBL_MAX_EXP = 16384.
@@ -14814,7 +20253,10 @@ int main()
         int exp = -9999;
         frexpl (x, &exp);
         if (exp != i)
-          return 1;
+          {
+            result |= 4;
+            break;
+          }
       }
   }
   /* Test on denormalized numbers.  */
@@ -14829,7 +20271,7 @@ int main()
         /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
            exp = -16382, y = 0.5.  On MacOS X 10.5: exp = -16384, y = 0.5.  */
         if (exp != LDBL_MIN_EXP - 1)
-          return 1;
+          result |= 8;
       }
   }
   /* Test on infinite numbers.  */
@@ -14838,9 +20280,9 @@ int main()
     int exp;
     long double y = frexpl (x, &exp);
     if (y != x)
-      return 1;
+      result |= 16;
   }
-  return 0;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
 $as_echo "$gl_cv_func_frexpl_works" >&6; }
 
-    case "$gl_cv_func_frexpl_works" in
-      *yes) gl_func_frexpl_no_libm=yes ;;
-      *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
-    esac
-  else
-    gl_func_frexpl_no_libm=no
-        REPLACE_FREXPL=1
-  fi
-  if test $gl_func_frexpl_no_libm = yes; then
+      case "$gl_cv_func_frexpl_works" in
+        *yes) gl_func_frexpl_no_libm=yes ;;
+        *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
+      esac
+    else
+      gl_func_frexpl_no_libm=no
+            REPLACE_FREXPL=1
+    fi
+    if test $gl_func_frexpl_no_libm = yes; then
 
 $as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h
 
-            ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_frexpl" = x""yes; then :
+    fi
+  fi
+
+if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext"
 
-else
-  HAVE_DECL_FREXPL=0
 fi
 
-  else
-    HAVE_DECL_FREXPL=0
 
 
 
 
+          GNULIB_FREXPL=1
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext"
 
+$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h
+
+
+
+
+
+
+    if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
+    REPLACE_FSEEK=1
   fi
 
+if test $REPLACE_FSEEK = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS fseek.$ac_objext"
+
+fi
+
+
+
+
+
+          GNULIB_FSEEK=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_FSEEK 1" >>confdefs.h
+
 
 
-  GNULIB_FREXPL=1
 
 
 
@@ -14904,7 +20385,7 @@ fi
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5
 $as_echo_n "checking for fseeko... " >&6; }
-if test "${gl_cv_func_fseeko+set}" = set; then :
+if ${gl_cv_func_fseeko+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -14931,10 +20412,109 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5
 $as_echo "$gl_cv_func_fseeko" >&6; }
-  if test $gl_cv_func_fseeko = no \
-      || test $gl_cv_var_stdin_large_offset = no; then
 
 
+  if test $ac_cv_have_decl_fseeko = no; then
+    HAVE_DECL_FSEEKO=0
+  fi
+
+  if test $gl_cv_func_fseeko = no; then
+    HAVE_FSEEKO=0
+  else
+    if test $WINDOWS_64_BIT_OFF_T = 1; then
+      REPLACE_FSEEKO=1
+    fi
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FSEEKO=1
+    fi
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
+$as_echo_n "checking whether fflush works on input streams... " >&6; }
+if ${gl_cv_func_fflush_stdin+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  echo hello world > conftest.txt
+     if test "$cross_compiling" = yes; then :
+        gl_cv_func_fflush_stdin=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
+
+int
+main ()
+{
+FILE *f = fopen ("conftest.txt", "r");
+         char buffer[10];
+         int fd;
+         int c;
+         if (f == NULL)
+           return 1;
+         fd = fileno (f);
+         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
+           return 2;
+         /* For deterministic results, ensure f read a bigger buffer.  */
+         if (lseek (fd, 0, SEEK_CUR) == 5)
+           return 3;
+         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
+            on BSD systems and on mingw.  */
+         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
+           return 4;
+         if (lseek (fd, 0, SEEK_CUR) != 5)
+           return 5;
+         /* Verify behaviour of fflush after ungetc. See
+            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
+         /* Verify behaviour of fflush after a backup ungetc.  This fails on
+            mingw.  */
+         c = fgetc (f);
+         ungetc (c, f);
+         fflush (f);
+         if (fgetc (f) != c)
+           return 6;
+         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
+            on glibc 2.8 and on BSD systems.  */
+         c = fgetc (f);
+         ungetc ('@', f);
+         fflush (f);
+         if (fgetc (f) != c)
+           return 7;
+         return 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_fflush_stdin=yes
+else
+  gl_cv_func_fflush_stdin=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+     rm conftest.txt
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
+$as_echo "$gl_cv_func_fflush_stdin" >&6; }
+
+      if test $gl_cv_func_fflush_stdin = no; then
+        REPLACE_FSEEKO=1
+      fi
+
+  fi
+
+if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
+
 
 
 
@@ -14945,396 +20525,126 @@ $as_echo "$gl_cv_func_fseeko" >&6; }
   gl_LIBOBJS="$gl_LIBOBJS fseeko.$ac_objext"
 
 
-  REPLACE_FSEEKO=1
+      for ac_func in _fseeki64
+do :
+  ac_fn_c_check_func "$LINENO" "_fseeki64" "ac_cv_func__fseeki64"
+if test "x$ac_cv_func__fseeki64" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE__FSEEKI64 1
+_ACEOF
 
+fi
+done
 
-  fi
 
+fi
 
 
-  GNULIB_FSEEKO=1
 
 
 
+          GNULIB_FSEEKO=1
 
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5
-$as_echo_n "checking for ftello... " >&6; }
-if test "${gl_cv_func_ftello+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
+$as_echo "#define GNULIB_TEST_FSEEKO 1" >>confdefs.h
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-ftello (stdin);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_ftello=yes
-else
-  gl_cv_func_ftello=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5
-$as_echo "$gl_cv_func_ftello" >&6; }
-  if test $gl_cv_func_ftello = no \
-      || test $gl_cv_var_stdin_large_offset = no; then
 
 
 
 
 
+  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+    REPLACE_FSTAT=1
+  fi
 
 
+  if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+    REPLACE_FSTAT=1
+  fi
 
 
-  gl_LIBOBJS="$gl_LIBOBJS ftello.$ac_objext"
 
 
-  REPLACE_FTELLO=1
 
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
   fi
 
+    if test $HAVE_FCHDIR = 0; then
+      case "$gl_cv_func_open_directory_works" in
+        *yes) ;;
+        *)
+          REPLACE_FSTAT=1
+          ;;
+      esac
+    fi
 
 
-  GNULIB_FTELLO=1
+if test $REPLACE_FSTAT = 1; then
 
 
 
 
 
-  gl_abort_bug=no
-  case $gl_cv_func_getcwd_null,$host_os in
-  *,mingw*)
-    gl_cv_func_getcwd_path_max=yes;;
-  yes,*)
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5
-$as_echo_n "checking whether getcwd handles long file names properly... " >&6; }
-if test "${gl_cv_func_getcwd_path_max+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  # Arrange for deletion of the temporary directory this test creates.
-     ac_clean_files="$ac_clean_files confdir3"
-     if test "$cross_compiling" = yes; then :
-  gl_cv_func_getcwd_path_max=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  gl_LIBOBJS="$gl_LIBOBJS fstat.$ac_objext"
 
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <limits.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
 
-#ifndef AT_FDCWD
-# define AT_FDCWD 0
-#endif
-#ifdef ENAMETOOLONG
-# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
-#else
-# define is_ENAMETOOLONG(x) 0
-#endif
 
-/* Don't get link errors because mkdir is redefined to rpl_mkdir.  */
-#undef mkdir
 
-#ifndef S_IRWXU
-# define S_IRWXU 0700
-#endif
+fi
 
-/* The length of this name must be 8.  */
-#define DIR_NAME "confdir3"
-#define DIR_NAME_LEN 8
-#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
 
-/* The length of "../".  */
-#define DOTDOTSLASH_LEN 3
 
-/* Leftover bytes in the buffer, to work around library or OS bugs.  */
-#define BUF_SLOP 20
 
-int
-main ()
-{
-#ifndef PATH_MAX
-  /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
-     at least not on a local file system.  And if we were to start worrying
-     about remote file systems, we'd have to enable the wrapper function
-     all of the time, just to be safe.  That's not worth the cost.  */
-  exit (0);
-#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
-        - DIR_NAME_SIZE - BUF_SLOP) \
-       <= PATH_MAX)
-  /* FIXME: Assuming there's a system for which this is true,
-     this should be done in a compile test.  */
-  exit (0);
-#else
-  char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
-           + DIR_NAME_SIZE + BUF_SLOP];
-  char *cwd = getcwd (buf, PATH_MAX);
-  size_t initial_cwd_len;
-  size_t cwd_len;
-  int fail = 0;
-  size_t n_chdirs = 0;
 
-  if (cwd == NULL)
-    exit (1);
+          GNULIB_FSTAT=1
 
-  cwd_len = initial_cwd_len = strlen (cwd);
 
-  while (1)
-    {
-      size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
-      char *c = NULL;
-
-      cwd_len += DIR_NAME_SIZE;
-      /* If mkdir or chdir fails, it could be that this system cannot create
-         any file with an absolute name longer than PATH_MAX, such as cygwin.
-         If so, leave fail as 0, because the current working directory can't
-         be too long for getcwd if it can't even be created.  For other
-         errors, be pessimistic and consider that as a failure, too.  */
-      if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
-        {
-          if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
-            fail = 2;
-          break;
-        }
 
-      if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
-        {
-          c = getcwd (buf, PATH_MAX);
-          if (!c && errno == ENOENT)
-            {
-              fail = 1;
-              break;
-            }
-          if (c || ! (errno == ERANGE || is_ENAMETOOLONG (errno)))
-            {
-              fail = 2;
-              break;
-            }
-        }
 
-      if (dotdot_max <= cwd_len - initial_cwd_len)
-        {
-          if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
-            break;
-          c = getcwd (buf, cwd_len + 1);
-          if (!c)
-            {
-              if (! (errno == ERANGE || errno == ENOENT
-                     || is_ENAMETOOLONG (errno)))
-                {
-                  fail = 2;
-                  break;
-                }
-              if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
-                {
-                  fail = 1;
-                  break;
-                }
-            }
-        }
 
-      if (c && strlen (c) != cwd_len)
-        {
-          fail = 2;
-          break;
-        }
-      ++n_chdirs;
-    }
+$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
 
-  /* Leaving behind such a deep directory is not polite.
-     So clean up here, right away, even though the driving
-     shell script would also clean up.  */
-  {
-    size_t i;
 
-    /* Try rmdir first, in case the chdir failed.  */
-    rmdir (DIR_NAME);
-    for (i = 0; i <= n_chdirs; i++)
-      {
-        if (chdir ("..") < 0)
-          break;
-        if (rmdir (DIR_NAME) != 0)
-          break;
-      }
-  }
 
-  exit (fail);
-#endif
-}
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_getcwd_path_max=yes
-else
-  case $? in
-     1) gl_cv_func_getcwd_path_max='no, but it is partly working';;
-     *) gl_cv_func_getcwd_path_max=no;;
-     esac
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5
-$as_echo "$gl_cv_func_getcwd_path_max" >&6; }
-  case $gl_cv_func_getcwd_path_max in
-  no,*)
+    if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
+    REPLACE_FTELL=1
+  fi
 
-$as_echo "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h
-;;
-  esac
+if test $REPLACE_FTELL = 1; then
 
 
 
-  for ac_func in getpagesize
-do :
-  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPAGESIZE 1
-_ACEOF
 
-fi
-done
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5
-$as_echo_n "checking whether getcwd aborts when 4k < cwd_length < 16k... " >&6; }
-if test "${gl_cv_func_getcwd_abort_bug+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  # Remove any remnants of a previous test.
-     rm -rf confdir-14B---
-     # Arrange for deletion of the temporary directory this test creates.
-     ac_clean_files="$ac_clean_files confdir-14B---"
-     if test "$cross_compiling" = yes; then :
-  gl_cv_func_getcwd_abort_bug=yes
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <stdlib.h>
-#include <unistd.h>
-#include <limits.h>
-#include <string.h>
-#include <sys/stat.h>
 
-/* Don't get link errors because mkdir is redefined to rpl_mkdir.  */
-#undef mkdir
 
-#ifndef S_IRWXU
-# define S_IRWXU 0700
-#endif
+  gl_LIBOBJS="$gl_LIBOBJS ftell.$ac_objext"
 
-/* FIXME: skip the run-test altogether on systems without getpagesize.  */
-#if ! HAVE_GETPAGESIZE
-# define getpagesize() 0
-#endif
+fi
 
-/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
-   the 16kB pagesize on ia64 linux.  Those conditions make the code below
-   trigger a bug in glibc's getcwd implementation before 2.4.90-10.  */
-#define TARGET_LEN (5 * 1024)
 
-int
-main ()
-{
-  char const *dir_name = "confdir-14B---";
-  char *cwd;
-  size_t initial_cwd_len;
-  int fail = 0;
-  size_t desired_depth;
-  size_t d;
-
-  /* The bug is triggered when PATH_MAX < getpagesize (), so skip
-     this relative expensive and invasive test if that's not true.  */
-  if (getpagesize () <= PATH_MAX)
-    return 0;
-
-  cwd = getcwd (NULL, 0);
-  if (cwd == NULL)
-    return 0;
-
-  initial_cwd_len = strlen (cwd);
-  free (cwd);
-  desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
-                   / (1 + strlen (dir_name)));
-  for (d = 0; d < desired_depth; d++)
-    {
-      if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
-        {
-          fail = 3; /* Unable to construct deep hierarchy.  */
-          break;
-        }
-    }
 
-  /* If libc has the bug in question, this invocation of getcwd
-     results in a failed assertion.  */
-  cwd = getcwd (NULL, 0);
-  if (cwd == NULL)
-    fail = 4; /* getcwd failed.  This is ok, and expected.  */
-  free (cwd);
 
-  /* Call rmdir first, in case the above chdir failed.  */
-  rmdir (dir_name);
-  while (0 < d--)
-    {
-      if (chdir ("..") < 0)
-        break;
-      rmdir (dir_name);
-    }
 
-  return 0;
-}
+          GNULIB_FTELL=1
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_getcwd_abort_bug=no
-else
-  gl_cv_func_getcwd_abort_bug=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_abort_bug" >&5
-$as_echo "$gl_cv_func_getcwd_abort_bug" >&6; }
-  if test $gl_cv_func_getcwd_abort_bug = yes; then :
-  gl_abort_bug=yes
-fi
-;;
-  esac
 
-  case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in
-  *yes,yes,no) ;;
-  *)
-    REPLACE_GETCWD=1
 
+$as_echo "#define GNULIB_TEST_FTELL 1" >>confdefs.h
 
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS getcwd.$ac_objext"
 
 
 
 
-  :
-;;
-  esac
 
+  if test $ac_cv_have_decl_ftello = no; then
+    HAVE_DECL_FTELLO=0
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5
+$as_echo_n "checking for ftello... " >&6; }
+if ${gl_cv_func_ftello+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+ftello (stdin);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func_ftello=yes
+else
+  gl_cv_func_ftello=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5
+$as_echo "$gl_cv_func_ftello" >&6; }
+  if test $gl_cv_func_ftello = no; then
+    HAVE_FTELLO=0
+  else
+    if test $WINDOWS_64_BIT_OFF_T = 1; then
+      REPLACE_FTELLO=1
+    fi
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FTELLO=1
+    fi
+    if test $REPLACE_FTELLO = 0; then
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ftello works" >&5
+$as_echo_n "checking whether ftello works... " >&6; }
+if ${gl_cv_func_ftello_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                              case "$host_os" in
+                      # Guess no on Solaris.
+            solaris*) gl_cv_func_ftello_works="guessing no" ;;
+                      # Guess yes otherwise.
+            *)        gl_cv_func_ftello_works="guessing yes" ;;
+          esac
+          if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  GNULIB_GETCWD=1
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define TESTFILE "conftest.tmp"
+int
+main (void)
+{
+  FILE *fp;
 
+  /* Create a file with some contents.  */
+  fp = fopen (TESTFILE, "w");
+  if (fp == NULL)
+    return 70;
+  if (fwrite ("foogarsh", 1, 8, fp) < 8)
+    return 71;
+  if (fclose (fp))
+    return 72;
 
+  /* The file's contents is now "foogarsh".  */
 
+  /* Try writing after reading to EOF.  */
+  fp = fopen (TESTFILE, "r+");
+  if (fp == NULL)
+    return 73;
+  if (fseek (fp, -1, SEEK_END))
+    return 74;
+  if (!(getc (fp) == 'h'))
+    return 1;
+  if (!(getc (fp) == EOF))
+    return 2;
+  if (!(ftell (fp) == 8))
+    return 3;
+  if (!(ftell (fp) == 8))
+    return 4;
+  if (!(putc ('!', fp) == '!'))
+    return 5;
+  if (!(ftell (fp) == 9))
+    return 6;
+  if (!(fclose (fp) == 0))
+    return 7;
+  fp = fopen (TESTFILE, "r");
+  if (fp == NULL)
+    return 75;
+  {
+    char buf[10];
+    if (!(fread (buf, 1, 10, fp) == 9))
+      return 10;
+    if (!(memcmp (buf, "foogarsh!", 9) == 0))
+      return 11;
+  }
+  if (!(fclose (fp) == 0))
+    return 12;
 
+  /* The file's contents is now "foogarsh!".  */
 
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_ftello_works=yes
+else
+  gl_cv_func_ftello_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello_works" >&5
+$as_echo "$gl_cv_func_ftello_works" >&6; }
+      case "$gl_cv_func_ftello_works" in
+        *yes) ;;
+        *)
+          REPLACE_FTELLO=1
 
-$as_echo "#define GNULIB_GETOPT_GNU 1" >>confdefs.h
+$as_echo "#define FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE 1" >>confdefs.h
 
+          ;;
+      esac
+    fi
+  fi
 
+if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
 
 
 
 
 
-  if test -n "$gl_replace_getopt"; then :
 
 
 
-  GETOPT_H=getopt.h
+  gl_LIBOBJS="$gl_LIBOBJS ftello.$ac_objext"
 
-$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
 
+      for ac_func in _ftelli64
+do :
+  ac_fn_c_check_func "$LINENO" "_ftelli64" "ac_cv_func__ftelli64"
+if test "x$ac_cv_func__ftelli64" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE__FTELLI64 1
+_ACEOF
 
+fi
+done
 
-    GNULIB_UNISTD_H_GETOPT=1
 
+fi
 
 
 
 
 
+          GNULIB_FTELLO=1
 
 
-  gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
 
 
 
+$as_echo "#define GNULIB_TEST_FTELLO 1" >>confdefs.h
 
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
 
 
+  case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
+  *yes,yes) ;;
+  *)
+        REPLACE_GETCWD=1
+    ;;
+  esac
 
+if test $REPLACE_GETCWD = 1; then
 
 
 
-fi
 
 
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS getcwd-lgpl.$ac_objext"
 
+fi
 
 
 
 
 
+          GNULIB_GETCWD=1
 
 
-  gl_LIBOBJS="$gl_LIBOBJS gettime.$ac_objext"
 
 
 
+$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
 
 
 
 
 
 
+  if test $ac_cv_func_getdtablesize != yes; then
+    HAVE_GETDTABLESIZE=0
+  fi
 
+if test $HAVE_GETDTABLESIZE = 0; then
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
-$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
-if test "${gl_cv_func_gettimeofday_posix_signature+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/time.h>
-            struct timeval c;
 
-int
-main ()
-{
 
-            int (*f) (struct timeval *restrict, void *restrict) = gettimeofday;
-            int x = f (&c, 0);
-            return !(x | c.tv_sec | c.tv_usec);
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_gettimeofday_posix_signature=yes
-else
-  gl_cv_func_gettimeofday_posix_signature=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
-$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
 
 
 
 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5
-$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
-if test "${gl_cv_func_gettimeofday_clobber+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-       gl_cv_func_gettimeofday_clobber=yes
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-          #include <sys/time.h>
-          #include <time.h>
-          #include <stdlib.h>
+  gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext"
 
-int
-main ()
-{
 
-          time_t t = 0;
-          struct tm *lt;
-          struct tm saved_lt;
-          struct timeval tv;
-          lt = localtime (&t);
-          saved_lt = *lt;
-          gettimeofday (&tv, NULL);
-          return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_gettimeofday_clobber=no
-else
-  gl_cv_func_gettimeofday_clobber=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5
-$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
 
- if test $gl_cv_func_gettimeofday_clobber = yes; then
-   REPLACE_GETTIMEOFDAY=1
-   SYS_TIME_H=sys/time.h
 
 
 
 
+          GNULIB_GETDTABLESIZE=1
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
+$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
 
 
-  for ac_header in sys/timeb.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_timeb_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_TIMEB_H 1
-_ACEOF
 
-fi
 
-done
 
-  for ac_func in _ftime
-do :
-  ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime"
-if test "x$ac_cv_func__ftime" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE__FTIME 1
-_ACEOF
 
-fi
-done
 
 
+if test $REPLACE_GETOPT = 1; then
 
-$as_echo "#define gmtime rpl_gmtime" >>confdefs.h
 
 
-$as_echo "#define localtime rpl_localtime" >>confdefs.h
 
 
 
-$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
 
- fi
 
+  gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
 
-  if test $gl_cv_func_gettimeofday_posix_signature != yes; then
-    REPLACE_GETTIMEOFDAY=1
-    SYS_TIME_H=sys/time.h
-    if test $gl_cv_func_gettimeofday_clobber != yes; then
 
 
 
@@ -15576,141 +20941,69 @@ $as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
+  gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
 
 
-  for ac_header in sys/timeb.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_timeb_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_TIMEB_H 1
-_ACEOF
 
+
+    GNULIB_GL_UNISTD_H_GETOPT=1
 fi
 
-done
 
-  for ac_func in _ftime
-do :
-  ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime"
-if test "x$ac_cv_func__ftime" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE__FTIME 1
-_ACEOF
+
+$as_echo "#define GNULIB_TEST_GETOPT_GNU 1" >>confdefs.h
+
+
+
+
+
+
+    REPLACE_GETOPT=0
+
+
+  if test -n "$gl_replace_getopt"; then :
+
+      REPLACE_GETOPT=1
 
 fi
-done
 
 
-    fi
+  if test $REPLACE_GETOPT = 1; then
+
+  GETOPT_H=getopt.h
+
+$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
+
+
+
   fi
 
+if test $REPLACE_GETOPT = 1; then
 
-   if ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
-  GNU_MAKE_TRUE=
-  GNU_MAKE_FALSE='#'
-else
-  GNU_MAKE_TRUE='#'
-  GNU_MAKE_FALSE=
-fi
 
 
-  # Autoconf 2.61a.99 and earlier don't support linking a file only
-  # in VPATH builds.  But since GNUmakefile is for maintainer use
-  # only, it does not matter if we skip the link with older autoconf.
-  # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
-  # builds, so use a shell variable to bypass this.
-  GNUmakefile=GNUmakefile
-  ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5
-$as_echo_n "checking whether the compiler generally respects inline... " >&6; }
-if test "${gl_cv_c_inline_effective+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test $ac_cv_c_inline = no; then
-       gl_cv_c_inline_effective=no
-     else
-                                          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-int
-main ()
-{
-#ifdef __NO_INLINE__
-               #error "inline is not effective"
-             #endif
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_c_inline_effective=yes
-else
-  gl_cv_c_inline_effective=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-     fi
+  gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext"
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5
-$as_echo "$gl_cv_c_inline_effective" >&6; }
-  if test $gl_cv_c_inline_effective = yes; then
 
-$as_echo "#define HAVE_INLINE 1" >>confdefs.h
 
-  fi
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
-$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_isnand_no_libm+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnand
-                   # define isnand(x) __builtin_isnan ((double)(x))
-                   #else
-                   # undef isnand
-                   # define isnand(x) isnan ((double)(x))
-                   #endif
-                   double x;
-int
-main ()
-{
-return isnand (x);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_isnand_no_libm=yes
-else
-  gl_cv_func_isnand_no_libm=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
-$as_echo "$gl_cv_func_isnand_no_libm" >&6; }
 
-  if test $gl_cv_func_isnand_no_libm = yes; then
+  gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext"
 
-$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
 
-  else
 
 
+    GNULIB_GL_UNISTD_H_GETOPT=1
+fi
 
 
 
@@ -15718,376 +21011,351 @@ $as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext"
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
-$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
-if test "${gl_cv_cc_double_expbit0+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
 
-                                                            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#if defined arm || defined __arm || defined __arm__
-  mixed_endianness
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "mixed_endianness" >/dev/null 2>&1; then :
-  gl_cv_cc_double_expbit0="unknown"
-else
 
-                                                         :
-if test "${ac_cv_c_bigendian+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_bigendian=unknown
-    # See if we're dealing with a universal compiler.
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __APPLE_CC__
-              not a universal capable compiler
-            #endif
-            typedef int dummy;
+  gl_gettimeofday_timezone=void
+  if test $ac_cv_func_gettimeofday != yes; then
+    HAVE_GETTIMEOFDAY=0
+  else
 
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
 
-       # Check for potential -arch flags.  It is not universal unless
-       # there are at least two -arch flags with different values.
-       ac_arch=
-       ac_prev=
-       for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
-        if test -n "$ac_prev"; then
-          case $ac_word in
-            i?86 | x86_64 | ppc | ppc64)
-              if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
-                ac_arch=$ac_word
-              else
-                ac_cv_c_bigendian=universal
-                break
-              fi
-              ;;
-          esac
-          ac_prev=
-        elif test "x$ac_word" = "x-arch"; then
-          ac_prev=arch
-        fi
-       done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if sys/param.h defines the BYTE_ORDER macro.
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-            #include <sys/param.h>
 
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
-                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
-                    && LITTLE_ENDIAN)
-             bogus endian macros
-            #endif
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5
+$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
+if ${gl_cv_func_gettimeofday_clobber+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  # When cross-compiling:
+      case "$host_os" in
+                # Guess all is fine on glibc systems.
+        *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
+                # If we don't know, assume the worst.
+        *)      gl_cv_func_gettimeofday_clobber="guessing yes" ;;
+      esac
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-               #include <sys/param.h>
+#include <string.h>
+          #include <sys/time.h>
+          #include <time.h>
+          #include <stdlib.h>
 
 int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
-                not big endian
-               #endif
+main ()
+{
+
+          time_t t = 0;
+          struct tm *lt;
+          struct tm saved_lt;
+          struct timeval tv;
+          lt = localtime (&t);
+          saved_lt = *lt;
+          gettimeofday (&tv, NULL);
+          return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_gettimeofday_clobber=no
 else
-  ac_cv_c_bigendian=no
+  gl_cv_func_gettimeofday_clobber=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5
+$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
+
+ case "$gl_cv_func_gettimeofday_clobber" in
+   *yes)
+     REPLACE_GETTIMEOFDAY=1
+
+
+$as_echo "#define gmtime rpl_gmtime" >>confdefs.h
+
+
+$as_echo "#define localtime rpl_localtime" >>confdefs.h
+
+
+
+$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
+
+     ;;
+ esac
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
+$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
+if ${gl_cv_func_gettimeofday_posix_signature+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <limits.h>
+#include <sys/time.h>
+              struct timeval c;
+              int gettimeofday (struct timeval *restrict, void *restrict);
 
 int
 main ()
 {
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
-             bogus endian macros
-            #endif
+/* glibc uses struct timezone * rather than the POSIX void *
+                 if _GNU_SOURCE is defined.  However, since the only portable
+                 use of gettimeofday uses NULL as the second parameter, and
+                 since the glibc definition is actually more typesafe, it is
+                 not worth wrapping this to get a compliant signature.  */
+              int (*f) (struct timeval *restrict, void *restrict)
+                = gettimeofday;
+              int x = f (&c, 0);
+              return !(x | c.tv_sec | c.tv_usec);
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to _BIG_ENDIAN or not.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  gl_cv_func_gettimeofday_posix_signature=yes
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <limits.h>
+#include <sys/time.h>
+int gettimeofday (struct timeval *restrict, struct timezone *restrict);
 
 int
 main ()
 {
-#ifndef _BIG_ENDIAN
-                not big endian
-               #endif
 
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
+  gl_cv_func_gettimeofday_posix_signature=almost
 else
-  ac_cv_c_bigendian=no
+  gl_cv_func_gettimeofday_posix_signature=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
+$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
+    if test $gl_cv_func_gettimeofday_posix_signature = almost; then
+      gl_gettimeofday_timezone='struct timezone'
+    elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
+      REPLACE_GETTIMEOFDAY=1
+    fi
+        if test $REPLACE_STRUCT_TIMEVAL = 1; then
+      REPLACE_GETTIMEOFDAY=1
     fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # Compile a test program.
-      if test "$cross_compiling" = yes; then :
-  # Try to guess by grepping values from an object file.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-short int ascii_mm[] =
-                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-               short int ascii_ii[] =
-                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-               int use_ascii (int i) {
-                 return ascii_mm[i] + ascii_ii[i];
-               }
-               short int ebcdic_ii[] =
-                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-               short int ebcdic_mm[] =
-                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-               int use_ebcdic (int i) {
-                 return ebcdic_mm[i] + ebcdic_ii[i];
-               }
-               extern int foo;
 
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
-  ;
-  return 0;
-}
+  fi
+
+cat >>confdefs.h <<_ACEOF
+#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
-             ac_cv_c_bigendian=yes
-           fi
-           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-             if test "$ac_cv_c_bigendian" = unknown; then
-               ac_cv_c_bigendian=no
-             else
-               # finding both strings is unlikely to happen, but who knows?
-               ac_cv_c_bigendian=unknown
-             fi
-           fi
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
 
-            /* Are we little or big endian?  From Harbison&Steele.  */
-            union
-            {
-              long int l;
-              char c[sizeof (long int)];
-            } u;
-            u.l = 1;
-            return u.c[sizeof (long int) - 1] == 1;
 
-  ;
-  return 0;
-}
+if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS gettimeofday.$ac_objext"
+
+
+  for ac_header in sys/timeb.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_timeb_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_TIMEB_H 1
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_bigendian=no
-else
-  ac_cv_c_bigendian=yes
+
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+done
+
+  for ac_func in _ftime
+do :
+  ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime"
+if test "x$ac_cv_func__ftime" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE__FTIME 1
+_ACEOF
+
 fi
+done
+
 
-    fi
 fi
-:
- case $ac_cv_c_bigendian in #(
-   yes)
-     gl_cv_cc_double_expbit0="word 0 bit 20";; #(
-   no)
-     gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
-   universal)
 
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
 
-     ;; #(
-   *)
-     gl_cv_cc_double_expbit0="unknown" ;;
- esac
 
 
-fi
-rm -f conftest*
 
+          GNULIB_GETTIMEOFDAY=1
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
-  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { double value; unsigned int word[NWORDS]; } memory_double;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (double x)
-{
-  memory_double m;
-  size_t i;
-  /* Clear it first, in case sizeof (double) < sizeof (memory_double).  */
-  memset (&m, 0, sizeof (memory_double));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
-}
-int main ()
-{
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25);
-  add_to_ored_words (0.5);
-  add_to_ored_words (1.0);
-  add_to_ored_words (2.0);
-  add_to_ored_words (4.0);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
-}
 
+
+
+$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
+
+
+
+
+   if ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
+  GNU_MAKE_TRUE=
+  GNU_MAKE_FALSE='#'
+else
+  GNU_MAKE_TRUE='#'
+  GNU_MAKE_FALSE=
+fi
+
+
+# Autoconf 2.61a.99 and earlier don't support linking a file only
+# in VPATH builds.  But since GNUmakefile is for maintainer use
+# only, it does not matter if we skip the link with older autoconf.
+# Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
+# builds, so use a shell variable to bypass this.
+GNUmakefile=GNUmakefile
+ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5
+$as_echo_n "checking whether the compiler generally respects inline... " >&6; }
+if ${gl_cv_c_inline_effective+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test $ac_cv_c_inline = no; then
+       gl_cv_c_inline_effective=no
+     else
+                                          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifdef __NO_INLINE__
+               #error "inline is not effective"
+             #endif
+  ;
+  return 0;
+}
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_double_expbit0=`cat conftest.out`
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_c_inline_effective=yes
 else
-  gl_cv_cc_double_expbit0="unknown"
+  gl_cv_c_inline_effective=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+     fi
+
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5
+$as_echo "$gl_cv_c_inline_effective" >&6; }
+  if test $gl_cv_c_inline_effective = yes; then
 
-      rm -f conftest.out
+$as_echo "#define HAVE_INLINE 1" >>confdefs.h
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
-$as_echo "$gl_cv_cc_double_expbit0" >&6; }
-  case "$gl_cv_cc_double_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
+  fi
 
-cat >>confdefs.h <<_ACEOF
-#define DBL_EXPBIT0_WORD $word
-_ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define DBL_EXPBIT0_BIT $bit
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
+$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; }
+if ${gl_cv_func_isnand_no_libm+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             #if __GNUC__ >= 4
+             # undef isnand
+             # define isnand(x) __builtin_isnan ((double)(x))
+             #else
+             # undef isnand
+             # define isnand(x) isnan ((double)(x))
+             #endif
+             double x;
+int
+main ()
+{
+return isnand (x);
+  ;
+  return 0;
+}
 _ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func_isnand_no_libm=yes
+else
+  gl_cv_func_isnand_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-      ;;
-  esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
+$as_echo "$gl_cv_func_isnand_no_libm" >&6; }
+
+  gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
+  if test $gl_cv_func_isnand_no_libm = yes; then
 
+$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
 
   fi
 
+if test $gl_func_isnand_no_libm != yes; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS isnand.$ac_objext"
+
+
+
+
+fi
 
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) can be used without linking with libm" >&5
 $as_echo_n "checking whether isnan(float) can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_isnanf_no_libm+set}" = set; then :
+if ${gl_cv_func_isnanf_no_libm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnanf
-                   # define isnanf(x) __builtin_isnanf ((float)(x))
-                   #elif defined isnan
-                   # undef isnanf
-                   # define isnanf(x) isnan ((float)(x))
-                   #endif
-                   float x;
+             #if __GNUC__ >= 4
+             # undef isnanf
+             # define isnanf(x) __builtin_isnanf ((float)(x))
+             #elif defined isnan
+             # undef isnanf
+             # define isnanf(x) isnan ((float)(x))
+             #endif
+             float x;
 int
 main ()
 {
@@ -16114,7 +21382,7 @@ $as_echo "$gl_cv_func_isnanf_no_libm" >&6; }
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) works" >&5
 $as_echo_n "checking whether isnan(float) works... " >&6; }
-if test "${gl_cv_func_isnanf_works+set}" = set; then :
+if ${gl_cv_func_isnanf_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -16152,13 +21420,13 @@ NaN ()
 typedef union { unsigned int word[NWORDS]; float value; } memory_float;
 int main()
 {
-  memory_float m;
+  int result = 0;
 
   if (isnanf (1.0f / 0.0f))
-    return 1;
+    result |= 1;
 
   if (!isnanf (NaN ()))
-    return 1;
+    result |= 2;
 
 #if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
   /* The isnanf function should be immune against changes in the sign bit and
@@ -16166,16 +21434,18 @@ int main()
      a sign bit or a mantissa bit.  */
   if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0)
     {
+      memory_float m;
+
       m.value = NaN ();
       /* Set the bits below the exponent to 01111...111.  */
       m.word[0] &= -1U << FLT_EXPBIT0_BIT;
       m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1;
       if (!isnanf (m.value))
-        return 1;
+        result |= 4;
     }
 #endif
 
-  return 0;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -16199,11 +21469,15 @@ $as_echo "$gl_cv_func_isnanf_works" >&6; }
             *) false;;
           esac
         }; then
+    gl_func_isnanf_no_libm=yes
 
 $as_echo "#define HAVE_ISNANF_IN_LIBC 1" >>confdefs.h
 
   else
+    gl_func_isnanf_no_libm=no
+  fi
 
+if test $gl_func_isnanf_no_libm != yes; then
 
 
 
@@ -16215,9 +21489,10 @@ $as_echo "#define HAVE_ISNANF_IN_LIBC 1" >>confdefs.h
   gl_LIBOBJS="$gl_LIBOBJS isnanf.$ac_objext"
 
 
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
 $as_echo_n "checking where to find the exponent in a 'float'... " >&6; }
-if test "${gl_cv_cc_float_expbit0+set}" = set; then :
+if ${gl_cv_cc_float_expbit0+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -16324,27 +21599,26 @@ _ACEOF
   esac
 
 
-  fi
-
+fi
 
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5
 $as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_isnanl_no_libm+set}" = set; then :
+if ${gl_cv_func_isnanl_no_libm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnanl
-                   # define isnanl(x) __builtin_isnanl ((long double)(x))
-                   #elif defined isnan
-                   # undef isnanl
-                   # define isnanl(x) isnan ((long double)(x))
-                   #endif
-                   long double x;
+             #if __GNUC__ >= 4
+             # undef isnanl
+             # define isnanl(x) __builtin_isnanl ((long double)(x))
+             #elif defined isnan
+             # undef isnanl
+             # define isnanl(x) isnan ((long double)(x))
+             #endif
+             long double x;
 int
 main ()
 {
@@ -16370,23 +21644,24 @@ $as_echo "$gl_cv_func_isnanl_no_libm" >&6; }
 
 
 
+
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5
 $as_echo_n "checking whether isnanl works... " >&6; }
-if test "${gl_cv_func_isnanl_works+set}" = set; then :
+if ${gl_cv_func_isnanl_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
   case "$host_cpu" in
-                               # Guess no on ia64, x86_64, i386.
-         ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";;
-         *)
-           case "$host_os" in
-             netbsd*) gl_cv_func_isnanl_works="guessing no";;
-             *)       gl_cv_func_isnanl_works="guessing yes";;
-           esac
-           ;;
-       esac
+                                 # Guess no on ia64, x86_64, i386.
+           ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";;
+           *)
+             case "$host_os" in
+               netbsd*) gl_cv_func_isnanl_works="guessing no";;
+               *)       gl_cv_func_isnanl_works="guessing yes";;
+             esac
+             ;;
+         esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -16419,24 +21694,28 @@ static long double NaNl ()
 #endif
 int main ()
 {
-  memory_long_double m;
-  unsigned int i;
+  int result = 0;
 
   if (!isnanl (NaNl ()))
-    return 1;
+    result |= 1;
 
-  /* The isnanl function should be immune against changes in the sign bit and
-     in the mantissa bits.  The xor operation twiddles a bit that can only be
-     a sign bit or a mantissa bit (since the exponent never extends to
-     bit 31).  */
-  m.value = NaNl ();
-  m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-  for (i = 0; i < NWORDS; i++)
-    m.word[i] |= 1;
-  if (!isnanl (m.value))
-    return 1;
+  {
+    memory_long_double m;
+    unsigned int i;
+
+    /* The isnanl function should be immune against changes in the sign bit and
+       in the mantissa bits.  The xor operation twiddles a bit that can only be
+       a sign bit or a mantissa bit (since the exponent never extends to
+       bit 31).  */
+    m.value = NaNl ();
+    m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
+    for (i = 0; i < NWORDS; i++)
+      m.word[i] |= 1;
+    if (!isnanl (m.value))
+      result |= 1;
+  }
 
-#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
+#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
 /* Representation of an 80-bit 'long double' as an initializer for a sequence
    of 'unsigned int' words.  */
 # ifdef WORDS_BIGENDIAN
@@ -16453,14 +21732,14 @@ int main ()
     static memory_long_double x =
       { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 2;
   }
   {
     /* Signalling NaN.  */
     static memory_long_double x =
       { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 2;
   }
   /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities,
      Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in
@@ -16473,35 +21752,35 @@ int main ()
     static memory_long_double x =
       { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 4;
   }
   { /* Pseudo-Infinity.  */
     static memory_long_double x =
       { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 8;
   }
   { /* Pseudo-Zero.  */
     static memory_long_double x =
       { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 16;
   }
   { /* Unnormalized number.  */
     static memory_long_double x =
       { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 32;
   }
   { /* Pseudo-Denormal.  */
     static memory_long_double x =
       { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 64;
   }
 #endif
 
-  return 0;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -16527,8 +21806,9 @@ $as_echo "$gl_cv_func_isnanl_works" >&6; }
 
 $as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
 
-  else
+  fi
 
+if test $gl_func_isnanl_no_libm != yes; then
 
 
 
@@ -16541,9 +21821,10 @@ $as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
 
 
 
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
 $as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
-if test "${gl_cv_cc_long_double_expbit0+set}" = set; then :
+if ${gl_cv_cc_long_double_expbit0+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -16653,123 +21934,64 @@ _ACEOF
   esac
 
 
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-  for ac_func in lchown
-do :
-  ac_fn_c_check_func "$LINENO" "lchown" "ac_cv_func_lchown"
-if test "x$ac_cv_func_lchown" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LCHOWN 1
-_ACEOF
-
-else
-
-    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
 
 fi
-done
-
-
-  if test $ac_cv_func_lchown = no; then
-    HAVE_LCHOWN=0
-  elif test "$gl_cv_func_chown_slash_works" != yes \
-      || test "$gl_cv_func_chown_ctime_works" != yes; then
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS lchown.$ac_objext"
-
-    REPLACE_LCHOWN=1
-  fi
 
 
-
-  GNULIB_LCHOWN=1
-
-
-
-
-
-
-
-
-
-  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lseek detects pipes" >&5
-$as_echo_n "checking whether lseek detects pipes... " >&6; }
-if test "${gl_cv_func_lseek_pipe+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler flag to ignore unused libraries" >&5
+$as_echo_n "checking for C compiler flag to ignore unused libraries... " >&6; }
+if ${gl_cv_prog_c_ignore_unused_libraries+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test $cross_compiling = no; then
+  gl_cv_prog_c_ignore_unused_libraries=none
+     gl_saved_ldflags=$LDFLAGS
+     gl_saved_libs=$LIBS
+     # Link with -lm to detect binutils 2.16 bug with --as-needed; see
+     # <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00131.html>.
+     LIBS="$LIBS -lm"
+     # Use long option sequences like '-z ignore' to test for the feature,
+     # to forestall problems with linkers that have -z, -i, -g, -n, etc. flags.
+     # GCC + binutils likes '-Wl,--as-needed'.
+     # GCC + Solaris ld likes '-Wl,-z,ignore'.
+     # Sun C likes '-Wl,-z,ignore'. '-z ignore' is accepted but has no effect.
+     # Don't try bare '--as-needed'; nothing likes it and the HP-UX 11.11
+     # native cc issues annoying warnings and then ignores it,
+     # which would cause us to incorrectly conclude that it worked.
+     for gl_flags in  '-Wl,--as-needed' \
+  '-Wl,-z,ignore' \
+  '-z ignore'
+
+     do
+       LDFLAGS="$gl_flags $LDFLAGS"
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <sys/types.h> /* for off_t */
-#include <stdio.h> /* for SEEK_CUR */
-#include <unistd.h>
-int main ()
+int
+main ()
 {
-  /* Exit with success only if stdin is seekable.  */
-  return lseek (0, (off_t)0, SEEK_CUR) < 0;
+
+  ;
+  return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  if test -s conftest$ac_exeext \
-             && ./conftest$ac_exeext < conftest.$ac_ext \
-             && { echo hi | ./conftest$ac_exeext; test $? = 1; }; then
-            gl_cv_func_lseek_pipe=yes
-          else
-            gl_cv_func_lseek_pipe=no
-          fi
-else
-  gl_cv_func_lseek_pipe=no
+  gl_cv_prog_c_ignore_unused_libraries=$gl_flags
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-     else
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+       LDFLAGS=$gl_saved_ldflags
+       test "$gl_cv_prog_c_ignore_unused_libraries" != none &&
+         break
+     done
+     LIBS=$gl_saved_libs
 
-#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined __BEOS__
-/* mingw and BeOS mistakenly return 0 when trying to seek on pipes.  */
-  Choke me.
-#endif
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_lseek_pipe=yes
-else
-  gl_cv_func_lseek_pipe=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-     fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lseek_pipe" >&5
-$as_echo "$gl_cv_func_lseek_pipe" >&6; }
-  if test $gl_cv_func_lseek_pipe = no; then
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_prog_c_ignore_unused_libraries" >&5
+$as_echo "$gl_cv_prog_c_ignore_unused_libraries" >&6; }
+  IGNORE_UNUSED_LIBRARIES_CFLAGS=
+  if test "$gl_cv_prog_c_ignore_unused_libraries" != none; then
+    IGNORE_UNUSED_LIBRARIES_CFLAGS="$gl_cv_prog_c_ignore_unused_libraries"
+  fi
 
 
 
@@ -16777,138 +21999,185 @@ $as_echo "$gl_cv_func_lseek_pipe" >&6; }
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS lseek.$ac_objext"
 
 
-  REPLACE_LSEEK=1
 
-$as_echo "#define LSEEK_PIPE_BROKEN 1" >>confdefs.h
+LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
 
 
-  fi
 
+  if test "$gl_threads_api" = posix; then
+    # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
+    # pthread_rwlock_* functions.
+    ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
+"
+if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
 
+$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
 
-  GNULIB_LSEEK=1
+fi
 
+    # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+      #include <pthread.h>
+int
+main ()
+{
 
+#if __FreeBSD__ == 4
+error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#else
+int x = (int)PTHREAD_MUTEX_RECURSIVE;
+return !x;
+#endif
 
-  if test $ac_cv_func_lstat = yes; then
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-    if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
-            REPLACE_LSTAT=1
-    fi
-    # Prerequisites of lib/lstat.c.
+$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
 
-  else
-    HAVE_LSTAT=0
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   fi
 
 
 
-  GNULIB_LSTAT=1
 
-  for ac_header in stdlib.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDLIB_H 1
-_ACEOF
 
-fi
 
-done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
-$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
-if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then :
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lseek detects pipes" >&5
+$as_echo_n "checking whether lseek detects pipes... " >&6; }
+if ${gl_cv_func_lseek_pipe+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_malloc_0_nonnull=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  case "$host_os" in
+       mingw*)
+                                                               gl_cv_func_lseek_pipe=no
+         ;;
+       *)
+         if test $cross_compiling = no; then
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *malloc ();
+
+#include <sys/types.h> /* for off_t */
+#include <stdio.h> /* for SEEK_CUR */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
 #endif
 
 int
 main ()
 {
-return ! malloc (0);
+
+  /* Exit with success only if stdin is seekable.  */
+  return lseek (0, (off_t)0, SEEK_CUR) < 0;
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_malloc_0_nonnull=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  if test -s conftest$ac_exeext \
+                 && ./conftest$ac_exeext < conftest.$ac_ext \
+                 && test 1 = "`echo hi \
+                   | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
+                gl_cv_func_lseek_pipe=yes
+              else
+                gl_cv_func_lseek_pipe=no
+              fi
+
 else
-  ac_cv_func_malloc_0_nonnull=no
+  gl_cv_func_lseek_pipe=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+         else
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if defined __BEOS__
+/* BeOS mistakenly return 0 when trying to seek on pipes.  */
+  Choke me.
+#endif
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_func_lseek_pipe=yes
+else
+  gl_cv_func_lseek_pipe=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+         fi
+         ;;
+     esac
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
-$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
-if test $ac_cv_func_malloc_0_nonnull = yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lseek_pipe" >&5
+$as_echo "$gl_cv_func_lseek_pipe" >&6; }
+  if test $gl_cv_func_lseek_pipe = no; then
+    REPLACE_LSEEK=1
 
-$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
+$as_echo "#define LSEEK_PIPE_BROKEN 1" >>confdefs.h
 
-else
-  $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
+  fi
 
 
+  if test $WINDOWS_64_BIT_OFF_T = 1; then
+    REPLACE_LSEEK=1
+  fi
 
+if test $REPLACE_LSEEK = 1; then
 
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
 
 
-$as_echo "#define malloc rpl_malloc" >>confdefs.h
+  gl_LIBOBJS="$gl_LIBOBJS lseek.$ac_objext"
 
 fi
 
 
 
-$as_echo "#define GNULIB_MALLOC_GNU 1" >>confdefs.h
 
 
+          GNULIB_LSEEK=1
 
-  if test $gl_cv_func_malloc_posix = yes; then
-    HAVE_MALLOC_POSIX=1
 
-$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
 
-  else
 
 
+$as_echo "#define GNULIB_TEST_LSEEK 1" >>confdefs.h
 
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
+  if test $ac_cv_func_lstat = yes; then
 
-    HAVE_MALLOC_POSIX=0
+    case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+      *no)
+        REPLACE_LSTAT=1
+        ;;
+    esac
+  else
+    HAVE_LSTAT=0
   fi
 
-
-
-
-  GNULIB_MALLOC_POSIX=1
-
+if test $REPLACE_LSTAT = 1; then
 
 
 
@@ -16917,510 +22186,342 @@ $as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_math_h='<'math.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
-$as_echo_n "checking absolute name of <math.h>... " >&6; }
-if test "${gl_cv_next_math_h+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-          if test $ac_cv_header_math_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-
-_ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_math_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/math.h#{
-                 s#.*"\(.*/math.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_math_h='<'math.h'>'
-          fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
-$as_echo "$gl_cv_next_math_h" >&6; }
-     fi
-     NEXT_MATH_H=$gl_cv_next_math_h
-
-     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
-       gl_next_as_first_directive='<'math.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_math_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
-
+  gl_LIBOBJS="$gl_LIBOBJS lstat.$ac_objext"
 
 
 
+  :
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
-$as_echo_n "checking whether NAN macro works... " >&6; }
-if test "${gl_cv_header_math_nan_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-int
-main ()
-{
-/* Solaris 10 has a broken definition of NAN.  Other platforms
-        fail to provide NAN, or provide it only in C99 mode; this
-        test only needs to fail when NAN is provided but wrong.  */
-         float f = 1.0f;
-#ifdef NAN
-         f = NAN;
-#endif
-         return f == 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_math_nan_works=yes
-else
-  gl_cv_header_math_nan_works=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
-$as_echo "$gl_cv_header_math_nan_works" >&6; }
-  if test $gl_cv_header_math_nan_works = no; then
-    REPLACE_NAN=1
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
-$as_echo_n "checking whether HUGE_VAL works... " >&6; }
-if test "${gl_cv_header_math_huge_val_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-int
-main ()
-{
-/* Solaris 10 has a broken definition of HUGE_VAL.  */
-         double d = HUGE_VAL;
-         return d == 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_math_huge_val_works=yes
-else
-  gl_cv_header_math_huge_val_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
-$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
-  if test $gl_cv_header_math_huge_val_works = no; then
-    REPLACE_HUGE_VAL=1
-  fi
 
 
 
 
 
+          GNULIB_LSTAT=1
 
 
 
 
 
+$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
 
-  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
 
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
-$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
-if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-                  case "$host_os" in
-              # Guess no on AIX and OSF/1.
-        osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
-              # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
-      esac
-      if test $LOCALE_JA != none; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
 
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
-        if (mbsinit (&state))
-          return 1;
-    }
-  return 0;
-}
+      for ac_header in stdlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_incomplete_state=yes
-else
-  gl_cv_func_mbrtowc_incomplete_state=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-      fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
-$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
-
-
 
+done
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
-$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
-if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
   $as_echo_n "(cached) " >&6
 else
+  if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+          # Guess yes on platforms where we know the result.
+          *-gnu* | freebsd* | netbsd* | openbsd* \
+          | hpux* | solaris* | cygwin* | mingw*)
+            ac_cv_func_malloc_0_nonnull=yes ;;
+          # If we don't know, assume the worst.
+          *) ac_cv_func_malloc_0_nonnull=no ;;
+        esac
 
-                  case "$host_os" in
-                    # Guess no on Solaris 8.
-        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
-                    # Guess yes otherwise.
-        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
-      esac
-      if test $LOCALE_ZH_CN != none; then
-        if test "$cross_compiling" = yes; then :
-  :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+            # include <stdlib.h>
+            #else
+            char *malloc ();
+            #endif
 
-#include <locale.h>
-#include <stdlib.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  /* This fails on Solaris 8:
-     mbrtowc returns 2, and sets wc to 0x00F0.
-     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
-  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
-    {
-      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 3, 6, &state) != 4
-          && mbtowc (&wc, input + 3, 6) == 4)
-        return 1;
-    }
+int
+main ()
+{
+return ! malloc (0);
+  ;
   return 0;
 }
+
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_sanitycheck=yes
+  ac_cv_func_malloc_0_nonnull=yes
 else
-  gl_cv_func_mbrtowc_sanitycheck=no
+  ac_cv_func_malloc_0_nonnull=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-      fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
-$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+  if test $ac_cv_func_malloc_0_nonnull = yes; then :
+
+$as_echo "#define HAVE_MALLOC_GNU 1" >>confdefs.h
+
+else
+  $as_echo "#define HAVE_MALLOC_GNU 0" >>confdefs.h
+
+     REPLACE_MALLOC=1
+
+fi
+
+
+if test $REPLACE_MALLOC = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
+
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_MALLOC_GNU 1
+_ACEOF
+
+
+
+
+
+  if test $gl_cv_func_malloc_posix = yes; then
+
+$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
 
-    REPLACE_MBSTATE_T=0
-    case "$gl_cv_func_mbrtowc_incomplete_state" in
-      *yes) ;;
-      *) REPLACE_MBSTATE_T=1 ;;
-    esac
-    case "$gl_cv_func_mbrtowc_sanitycheck" in
-      *yes) ;;
-      *) REPLACE_MBSTATE_T=1 ;;
-    esac
   else
-    REPLACE_MBSTATE_T=1
+    REPLACE_MALLOC=1
   fi
-  if test $REPLACE_MBSTATE_T = 1; then
 
-    :
+if test $REPLACE_MALLOC = 1; then
 
-  fi
 
-  if test $REPLACE_MBSTATE_T = 1; then
-    REPLACE_MBRTOWC=1
-  fi
 
-  if test $ac_cv_func_mbrtowc = no; then
-    HAVE_MBRTOWC=0
-  fi
-  if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then
 
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
-$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
-if test "${gl_cv_func_mbrtowc_null_arg+set}" = set; then :
+
+
+  gl_LIBOBJS="$gl_LIBOBJS malloc.$ac_objext"
+
+fi
+
+
+
+
+
+          GNULIB_MALLOC_POSIX=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_math_h='<'math.h'>'
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
+$as_echo_n "checking absolute name of <math.h>... " >&6; }
+if ${gl_cv_next_math_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-                  case "$host_os" in
-              # Guess no on OSF/1.
-        osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;;
-              # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_null_arg="guessing yes" ;;
-      esac
-      if test $LOCALE_FR_UTF8 != none; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+             if test $ac_cv_header_math_h = yes; then
 
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
-{
-  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
-    {
-      mbstate_t state;
-      wchar_t wc;
-      int ret;
 
-      memset (&state, '\0', sizeof (mbstate_t));
-      wc = (wchar_t) 0xBADFACE;
-      mbrtowc (&wc, NULL, 5, &state);
-      /* Check that wc was not modified.  */
-      if (wc != (wchar_t) 0xBADFACE)
-        return 1;
-    }
-  return 0;
-}
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_null_arg=yes
-else
-  gl_cv_func_mbrtowc_null_arg=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'math.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_math_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+          else
+               gl_cv_next_math_h='<'math.h'>'
+             fi
 
-      fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg" >&5
-$as_echo "$gl_cv_func_mbrtowc_null_arg" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
+$as_echo "$gl_cv_next_math_h" >&6; }
+     fi
+     NEXT_MATH_H=$gl_cv_next_math_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'math.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_math_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
 
 
 
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
-$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
-if test "${gl_cv_func_mbrtowc_retval+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-                  case "$host_os" in
-                          # Guess no on HP-UX and Solaris.
-        hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;;
-                          # Guess yes otherwise.
-        *)                gl_cv_func_mbrtowc_retval="guessing yes" ;;
-      esac
-      if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
-        if test "$cross_compiling" = yes; then :
-  :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
+$as_echo_n "checking whether NAN macro works... " >&6; }
+if ${gl_cv_header_math_nan_works+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
+#include <math.h>
+int
+main ()
 {
-  /* This fails on Solaris.  */
-  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
-    {
-      char input[] = "B\303\274\303\237er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
-        {
-          input[1] = '\0';
-          if (mbrtowc (&wc, input + 2, 5, &state) != 1)
-            return 1;
-        }
-    }
-  /* This fails on HP-UX 11.11.  */
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
-        {
-          input[1] = '\0';
-          if (mbrtowc (&wc, input + 2, 5, &state) != 2)
-            return 1;
-        }
-    }
+/* Solaris 10 has a broken definition of NAN.  Other platforms
+        fail to provide NAN, or provide it only in C99 mode; this
+        test only needs to fail when NAN is provided but wrong.  */
+         float f = 1.0f;
+#ifdef NAN
+         f = NAN;
+#endif
+         return f == 0;
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_retval=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_header_math_nan_works=yes
 else
-  gl_cv_func_mbrtowc_retval=no
+  gl_cv_header_math_nan_works=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
-      fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
+$as_echo "$gl_cv_header_math_nan_works" >&6; }
+  if test $gl_cv_header_math_nan_works = no; then
+    REPLACE_NAN=1
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
+$as_echo_n "checking whether HUGE_VAL works... " >&6; }
+if ${gl_cv_header_math_huge_val_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+int
+main ()
+{
+/* Solaris 10 has a broken definition of HUGE_VAL.  */
+         double d = HUGE_VAL;
+         return d == 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_header_math_huge_val_works=yes
+else
+  gl_cv_header_math_huge_val_works=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
-$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
+$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
+  if test $gl_cv_header_math_huge_val_works = no; then
+    REPLACE_HUGE_VAL=1
+  fi
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
-$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
-if test "${gl_cv_func_mbrtowc_nul_retval+set}" = set; then :
+    for gl_func in acosf acosl asinf asinl atanf atanl      cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf      expf expl exp2 exp2f exp2l expm1 expm1f expm1l      fabsf fabsl floorf floorl fma fmaf fmal      fmod fmodf fmodl frexpf frexpl hypotf hypotl      ilogb ilogbf ilogbl      ldexpf ldexpl      log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l      logb logbf logbl      modf modff modfl powf      remainder remainderf remainderl      rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl      tanf tanl tanhf trunc truncf truncl; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-
-                  case "$host_os" in
-                       # Guess no on Solaris 8 and 9.
-        solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
-                       # Guess yes otherwise.
-        *)             gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
-      esac
-      if test $LOCALE_ZH_CN != none; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <locale.h>
-#include <string.h>
-#include <wchar.h>
-int main ()
+#include <math.h>
+int
+main ()
 {
-  /* This fails on Solaris 8 and 9.  */
-  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
-    {
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, "", 1, &state) != 0)
-        return 1;
-    }
+#undef $gl_func
+  (void) $gl_func;
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_nul_retval=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
 else
-  gl_cv_func_mbrtowc_nul_retval=no
+  eval "$as_gl_Symbol=no"
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
-      fi
-
+                     eval ac_cv_have_decl_$gl_func=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
-$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
-
-    case "$gl_cv_func_mbrtowc_null_arg" in
-      *yes) ;;
-      *)
-$as_echo "#define MBRTOWC_NULL_ARG_BUG 1" >>confdefs.h
-
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
-    case "$gl_cv_func_mbrtowc_retval" in
-      *yes) ;;
-      *)
-$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
-
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
-    case "$gl_cv_func_mbrtowc_nul_retval" in
-      *yes) ;;
-      *)
-$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
-
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
-  fi
-  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
-
-    :
-
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext"
-
-
-  :
-
-  fi
-
-
+      done
 
-  GNULIB_MBRTOWC=1
 
 
 
@@ -17438,15 +22539,15 @@ $as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
 $as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
-if test "${gl_cv_func_mbrtowc_incomplete_state+set}" = set; then :
+if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
                   case "$host_os" in
-              # Guess no on AIX and OSF/1.
-        osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
-              # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+                     # Guess no on AIX and OSF/1.
+        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+                     # Guess yes otherwise.
+        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
       esac
       if test $LOCALE_JA != none; then
         if test "$cross_compiling" = yes; then :
@@ -17457,6 +22558,13 @@ else
 
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -17494,7 +22602,7 @@ $as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
 
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
 $as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
-if test "${gl_cv_func_mbrtowc_sanitycheck+set}" = set; then :
+if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -17514,6 +22622,13 @@ else
 #include <locale.h>
 #include <stdlib.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -17561,364 +22676,448 @@ $as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
   else
     REPLACE_MBSTATE_T=1
   fi
-  if test $REPLACE_MBSTATE_T = 1; then
-
-    :
-
-  fi
-
-  if test $REPLACE_MBSTATE_T = 1; then
-    REPLACE_MBSINIT=1
-  fi
-
-  if test $ac_cv_func_mbsinit = no; then
-    HAVE_MBSINIT=0
-  fi
-  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
-
-    :
-
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext"
-
-
-  :
-
-  fi
-
-
-
-  GNULIB_MBSINIT=1
-
-
-
-
-  GNULIB_MEMCHR=1
-
-
-
-
 
 
 
+  if test $ac_cv_func_mbrtowc = no; then
+    HAVE_MBRTOWC=0
+    ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
 
-
-
-
-
-
-
-
-  for ac_func in mempcpy
-do :
-  ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy"
-if test "x$ac_cv_func_mempcpy" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMPCPY 1
-_ACEOF
-
+"
+if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
+  ac_have_decl=1
 else
-
-    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
-
+  ac_have_decl=0
 fi
-done
-
-
-  if test $ac_cv_func_mempcpy = no; then
-    HAVE_MEMPCPY=0
-
-  :
-
-  fi
-
-
-
-  GNULIB_MEMPCPY=1
-
-
-
-
-
-
-  if test $ac_cv_have_decl_memrchr = no; then
-    HAVE_DECL_MEMRCHR=0
-  fi
-
-
-
-
-
-
 
-
-
-  for ac_func in memrchr
-do :
-  ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
-if test "x$ac_cv_func_memrchr" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMRCHR 1
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MBRTOWC $ac_have_decl
 _ACEOF
 
-else
-
-    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
-
-fi
-done
-
-
-  if test $ac_cv_func_memrchr = no; then
-    :
-  fi
+    if test $ac_cv_have_decl_mbrtowc = yes; then
+                        REPLACE_MBRTOWC=1
+    fi
+  else
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_MBRTOWC=1
+    else
 
 
 
-  GNULIB_MEMRCHR=1
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
+$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
+if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                  case "$host_os" in
+                  # Guess no on Solaris.
+        solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
+                  # Guess yes otherwise.
+        *)        gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
+      esac
+      if test $LOCALE_FR_UTF8 != none; then
+        if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int main ()
+{
+  int result = 0;
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5
-$as_echo_n "checking whether mkdir handles trailing slash... " >&6; }
-if test "${gl_cv_func_mkdir_trailing_slash_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  rm -rf conftest.dir
-      if test "$cross_compiling" = yes; then :
-  gl_cv_func_mkdir_trailing_slash_works="guessing no"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      char input[] = "\303\237er";
+      mbstate_t state;
+      wchar_t wc;
+      size_t ret;
 
-#       include <sys/types.h>
-#       include <sys/stat.h>
+      memset (&state, '\0', sizeof (mbstate_t));
+      wc = (wchar_t) 0xBADFACE;
+      ret = mbrtowc (&wc, input, 5, &state);
+      if (ret != 2)
+        result |= 1;
+      if (!mbsinit (&state))
+        result |= 2;
 
-int
-main ()
-{
-return mkdir ("conftest.dir/", 0700);
-  ;
-  return 0;
+      memset (&state, '\0', sizeof (mbstate_t));
+      ret = mbrtowc (NULL, input, 5, &state);
+      if (ret != 2) /* Solaris 7 fails here: ret is -1.  */
+        result |= 4;
+      if (!mbsinit (&state))
+        result |= 8;
+    }
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mkdir_trailing_slash_works=yes
+  gl_cv_func_mbrtowc_null_arg1=yes
 else
-  gl_cv_func_mkdir_trailing_slash_works=no
+  gl_cv_func_mbrtowc_null_arg1=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-    rm -rf conftest.dir
-
+      fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5
-$as_echo "$gl_cv_func_mkdir_trailing_slash_works" >&6; }
-  if test "$gl_cv_func_mkdir_trailing_slash_works" != yes; then
-    REPLACE_MKDIR=1
-
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
+$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
 
 
 
 
-
-  gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext"
-
-  fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5
-$as_echo_n "checking whether mkdir handles trailing dot... " >&6; }
-if test "${gl_cv_func_mkdir_trailing_dot_works+set}" = set; then :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
+$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
+if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  rm -rf conftest.dir
-      if test "$cross_compiling" = yes; then :
-  gl_cv_func_mkdir_trailing_dot_works="guessing no"
+
+                  case "$host_os" in
+              # Guess no on OSF/1.
+        osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
+              # Guess yes otherwise.
+        *)    gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
+      esac
+      if test $LOCALE_FR_UTF8 != none; then
+        if test "$cross_compiling" = yes; then :
+  :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#       include <sys/types.h>
-#       include <sys/stat.h>
-
-int
-main ()
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int main ()
 {
-return !mkdir ("conftest.dir/./", 0700);
-  ;
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      mbstate_t state;
+      wchar_t wc;
+      int ret;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      wc = (wchar_t) 0xBADFACE;
+      mbrtowc (&wc, NULL, 5, &state);
+      /* Check that wc was not modified.  */
+      if (wc != (wchar_t) 0xBADFACE)
+        return 1;
+    }
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mkdir_trailing_dot_works=yes
+  gl_cv_func_mbrtowc_null_arg2=yes
 else
-  gl_cv_func_mkdir_trailing_dot_works=no
+  gl_cv_func_mbrtowc_null_arg2=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-    rm -rf conftest.dir
-
+      fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5
-$as_echo "$gl_cv_func_mkdir_trailing_dot_works" >&6; }
-  if test "$gl_cv_func_mkdir_trailing_dot_works" != yes; then
-    REPLACE_MKDIR=1
-
-
-
-
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
+$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
 
 
-  gl_LIBOBJS="$gl_LIBOBJS mkdir.$ac_objext"
 
 
-$as_echo "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h
-
-  fi
-
-
-
-
-  case "$host_os" in
-    mingw* | pw*)
 
 
-  REPLACE_OPEN=1
-
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
+$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
+if ${gl_cv_func_mbrtowc_retval+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                  case "$host_os" in
+                                   # Guess no on HP-UX, Solaris, native Windows.
+        hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
+                                   # Guess yes otherwise.
+        *)                         gl_cv_func_mbrtowc_retval="guessing yes" ;;
+      esac
+      if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
+         || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
+        if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int main ()
+{
+  int result = 0;
+  int found_some_locale = 0;
+  /* This fails on Solaris.  */
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      char input[] = "B\303\274\303\237er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        {
+          input[1] = '\0';
+          if (mbrtowc (&wc, input + 2, 5, &state) != 1)
+            result |= 1;
+        }
+      found_some_locale = 1;
+    }
+  /* This fails on HP-UX 11.11.  */
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        {
+          input[1] = '\0';
+          if (mbrtowc (&wc, input + 2, 5, &state) != 2)
+            result |= 2;
+        }
+      found_some_locale = 1;
+    }
+  /* This fails on native Windows.  */
+  if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+    {
+      char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
+      mbstate_t state;
+      wchar_t wc;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+        {
+          input[3] = '\0';
+          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+            result |= 4;
+        }
+      found_some_locale = 1;
+    }
+  if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+    {
+      char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
+      mbstate_t state;
+      wchar_t wc;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+        {
+          input[3] = '\0';
+          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+            result |= 8;
+        }
+      found_some_locale = 1;
+    }
+  if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+    {
+      char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
+      mbstate_t state;
+      wchar_t wc;
 
-  gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+        {
+          input[3] = '\0';
+          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+            result |= 16;
+        }
+      found_some_locale = 1;
+    }
+  return (found_some_locale ? result : 77);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_mbrtowc_retval=yes
+else
+  if test $? != 77; then
+             gl_cv_func_mbrtowc_retval=no
+           fi
 
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+      fi
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
+$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
 
-  :
 
 
-      ;;
-    *)
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
-$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
-if test "${gl_cv_func_open_slash+set}" = set; then :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
+$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
+if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  # Assume that if we have lstat, we can also check symlinks.
-          if test $ac_cv_func_lstat = yes; then
-            touch conftest.tmp
-            ln -s conftest.tmp conftest.lnk
-          fi
-          if test "$cross_compiling" = yes; then :
-
-             case "$host_os" in
-               freebsd*)        gl_cv_func_open_slash="guessing no" ;;
-               solaris2.[0-9]*) gl_cv_func_open_slash="guessing no" ;;
-               hpux*)           gl_cv_func_open_slash="guessing no" ;;
-               *)               gl_cv_func_open_slash="guessing yes" ;;
-             esac
 
+                  case "$host_os" in
+                       # Guess no on Solaris 8 and 9.
+        solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
+                       # Guess yes otherwise.
+        *)             gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
+      esac
+      if test $LOCALE_ZH_CN != none; then
+        if test "$cross_compiling" = yes; then :
+  :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <fcntl.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
 int main ()
 {
-#if HAVE_LSTAT
-  if (open ("conftest.lnk/", O_RDONLY) != -1) return 2;
-#endif
-  return open ("conftest.sl/", O_CREAT, 0600) >= 0;
+  /* This fails on Solaris 8 and 9.  */
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "", 1, &state) != 0)
+        return 1;
+    }
+  return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_open_slash=yes
+  gl_cv_func_mbrtowc_nul_retval=yes
 else
-  gl_cv_func_open_slash=no
+  gl_cv_func_mbrtowc_nul_retval=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-          rm -f conftest.sl conftest.tmp conftest.lnk
+      fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
-$as_echo "$gl_cv_func_open_slash" >&6; }
-      case "$gl_cv_func_open_slash" in
-        *no)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
+$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
 
-$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
+      case "$gl_cv_func_mbrtowc_null_arg1" in
+        *yes) ;;
+        *)
+$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
 
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_null_arg2" in
+        *yes) ;;
+        *)
+$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
 
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_retval" in
+        *yes) ;;
+        *)
+$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
 
-  REPLACE_OPEN=1
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_nul_retval" in
+        *yes) ;;
+        *)
+$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
 
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+    fi
+  fi
 
+if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
 
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
 
 
+  gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext"
 
 
   :
 
+fi
 
-          ;;
-      esac
-      ;;
-  esac
 
 
 
-$as_echo "#define GNULIB_OPEN 1" >>confdefs.h
 
+          GNULIB_MBRTOWC=1
 
 
 
-  GNULIB_OPEN=1
 
 
+$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
 
-  GNULIB_OPENAT=1
 
 
-  GNULIB_FCHMODAT=1
-  GNULIB_FSTATAT=1
-  GNULIB_MKDIRAT=1
 
 
-  GNULIB_FCHOWNAT=1
-  GNULIB_UNLINKAT=1
 
 
 
@@ -17928,32 +23127,189 @@ $as_echo "#define GNULIB_OPEN 1" >>confdefs.h
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS openat-proc.$ac_objext"
+  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
 
 
 
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
+$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
+if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                  case "$host_os" in
+                     # Guess no on AIX and OSF/1.
+        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+                     # Guess yes otherwise.
+        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+      esac
+      if test $LOCALE_JA != none; then
+        if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <locale.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        if (mbsinit (&state))
+          return 1;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_mbrtowc_incomplete_state=yes
+else
+  gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+      fi
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
 
 
 
 
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
+$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+                  case "$host_os" in
+                    # Guess no on Solaris 8.
+        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
+                    # Guess yes otherwise.
+        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
+      esac
+      if test $LOCALE_ZH_CN != none; then
+        if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int main ()
+{
+  /* This fails on Solaris 8:
+     mbrtowc returns 2, and sets wc to 0x00F0.
+     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 6, &state) != 4
+          && mbtowc (&wc, input + 3, 6) == 4)
+        return 1;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_mbrtowc_sanitycheck=yes
+else
+  gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+      fi
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
+    REPLACE_MBSTATE_T=0
+    case "$gl_cv_func_mbrtowc_incomplete_state" in
+      *yes) ;;
+      *) REPLACE_MBSTATE_T=1 ;;
+    esac
+    case "$gl_cv_func_mbrtowc_sanitycheck" in
+      *yes) ;;
+      *) REPLACE_MBSTATE_T=1 ;;
+    esac
+  else
+    REPLACE_MBSTATE_T=1
+  fi
 
 
 
+  if test $ac_cv_func_mbsinit = no; then
+    HAVE_MBSINIT=0
+    ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
 
+"
+if test "x$ac_cv_have_decl_mbsinit" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_MBSINIT $ac_have_decl
+_ACEOF
 
+    if test $ac_cv_have_decl_mbsinit = yes; then
+                        REPLACE_MBSINIT=1
+    fi
+  else
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_MBSINIT=1
+    else
+                        case "$host_os" in
+        mingw*) REPLACE_MBSINIT=1 ;;
+      esac
+    fi
+  fi
 
+if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
 
 
 
@@ -17962,74 +23318,66 @@ $as_echo "#define GNULIB_OPEN 1" >>confdefs.h
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext"
 
 
+  :
 
+fi
 
 
 
-  for ac_func in fchmodat fstatat mkdirat openat unlinkat
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
-else
 
-    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
+          GNULIB_MBSINIT=1
 
-fi
-done
 
 
 
 
-  case $ac_cv_func_openat+$ac_cv_func_lstat_dereferences_slashed_symlink in
-  yes+yes)
-    # GNU/Hurd has unlinkat, but it has the same bug as unlink.
-    if test $REPLACE_UNLINK = 1; then
+$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
 
 
 
 
+if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS unlinkat.$ac_objext"
 
-      REPLACE_UNLINKAT=1
-    fi ;;
-  yes+*)
-    # Solaris 9 has *at functions, but uniformly mishandles trailing
-    # slash in all of them.
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext"
 
 
+  for ac_header in bp-sym.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
+if test "x$ac_cv_header_bp_sym_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_BP_SYM_H 1
+_ACEOF
 
+fi
 
+done
 
-  gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext"
 
-    REPLACE_OPENAT=1
+fi
 
 
 
 
 
+          GNULIB_MEMCHR=1
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fstatat.$ac_objext"
 
-    REPLACE_FSTATAT=1
 
+$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
 
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS unlinkat.$ac_objext"
 
-    REPLACE_UNLINKAT=1
-    ;;
-  *)
-    HAVE_OPENAT=0
-    HAVE_UNLINKAT=0 # No known system with unlinkat but not openat
-    HAVE_FSTATAT=0 # No known system with fstatat but not openat
 
+  for ac_func in mempcpy
+do :
+  ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy"
+if test "x$ac_cv_func_mempcpy" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MEMPCPY 1
+_ACEOF
 
+fi
+done
 
-  :
-;;
-  esac
-  if test $ac_cv_func_fchmodat != yes; then
-    HAVE_FCHMODAT=0
-  fi
-  if test $ac_cv_func_mkdirat != yes; then
-    HAVE_MKDIRAT=0
+  if test $ac_cv_func_mempcpy = no; then
+    HAVE_MEMPCPY=0
   fi
 
+if test $HAVE_MEMPCPY = 0; then
 
-  ac_fn_c_check_func "$LINENO" "fchownat" "ac_cv_func_fchownat"
-if test "x$ac_cv_func_fchownat" = x""yes; then :
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fchownat works with AT_SYMLINK_NOFOLLOW" >&5
-$as_echo_n "checking whether fchownat works with AT_SYMLINK_NOFOLLOW... " >&6; }
-if test "${gl_cv_func_fchownat_nofollow_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-     gl_dangle=conftest.dangle
-     # Remove any remnants of a previous test.
-     rm -f $gl_dangle
-     # Arrange for deletion of the temporary file this test creates.
-     ac_clean_files="$ac_clean_files $gl_dangle"
-     ln -s conftest.no-such $gl_dangle
-     if test "$cross_compiling" = yes; then :
-  gl_cv_func_fchownat_nofollow_works=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
-int
-main ()
-{
-  return (fchownat (AT_FDCWD, "$gl_dangle", -1, getgid (),
-                    AT_SYMLINK_NOFOLLOW) != 0
-          && errno == ENOENT);
-}
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_fchownat_nofollow_works=yes
-else
-  gl_cv_func_fchownat_nofollow_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fchownat_nofollow_works" >&5
-$as_echo "$gl_cv_func_fchownat_nofollow_works" >&6; }
-  if test $gl_cv_func_fchownat_nofollow_works = no; then :
-  REPLACE_FCHOWNAT=1
 
-$as_echo "#define FCHOWNAT_NOFOLLOW_BUG 1" >>confdefs.h
+  gl_LIBOBJS="$gl_LIBOBJS mempcpy.$ac_objext"
 
-fi
 
-else
-  HAVE_FCHOWNAT=0
+  :
+
 fi
 
-  if test $REPLACE_CHOWN = 1; then
-    REPLACE_FCHOWNAT=1
-  fi
-  if test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1; then
 
 
 
 
+          GNULIB_MEMPCPY=1
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS fchownat.$ac_objext"
 
-  fi
+$as_echo "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h
 
 
 
 
 
-  if test -n "$ERRNO_H"; then
-            REPLACE_PERROR=1
 
 
 
+  if test $ac_cv_have_decl_memrchr = no; then
+    HAVE_DECL_MEMRCHR=0
+  fi
+
+  for ac_func in memrchr
+do :
+  ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
+if test "x$ac_cv_func_memrchr" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MEMRCHR 1
+_ACEOF
 
+fi
+done
 
 
+if test $ac_cv_func_memrchr = no; then
 
 
-  gl_LIBOBJS="$gl_LIBOBJS perror.$ac_objext"
 
-  fi
 
 
 
-  GNULIB_PERROR=1
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp can be used without linking with libm" >&5
-$as_echo_n "checking whether frexp can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_frexp_no_libm+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
+  gl_LIBOBJS="$gl_LIBOBJS memrchr.$ac_objext"
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-                   double x;
-                   int y;
-int
-main ()
-{
-return frexp (x, &y) < 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_frexp_no_libm=yes
-else
-  gl_cv_func_frexp_no_libm=no
+  :
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
-$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
-  if test $gl_cv_func_frexp_no_libm = yes; then
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
-$as_echo_n "checking whether frexp works... " >&6; }
-if test "${gl_cv_func_frexp_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-         netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
-         *)                        gl_cv_func_frexp_works="guessing yes";;
-       esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+          GNULIB_MEMRCHR=1
+
 
-#include <float.h>
-#include <math.h>
-#include <string.h>
-int main()
-{
-  int i;
-  volatile double x;
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
-   So we use -zero instead.  */
-  double zero = 0.0;
-  /* Test on denormalized numbers.  */
-  for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
-    ;
-  if (x > 0.0)
-    {
-      int exp;
-      double y = frexp (x, &exp);
-      /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
-         On NetBSD: y = 0.75. Correct: y = 0.5.  */
-      if (y != 0.5)
-        return 1;
-    }
-  /* Test on infinite numbers.  */
-  x = 1.0 / 0.0;
-  {
-    int exp;
-    double y = frexp (x, &exp);
-    if (y != x)
-      return 1;
-  }
-  /* Test on negative zero.  */
-  x = -zero;
-  {
-    int exp;
-    double y = frexp (x, &exp);
-    if (memcmp (&y, &x, sizeof x))
-      return 1;
-  }
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_frexp_works=yes
-else
-  gl_cv_func_frexp_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
-$as_echo "$gl_cv_func_frexp_works" >&6; }
 
-    case "$gl_cv_func_frexp_works" in
-      *yes)
+$as_echo "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h
 
-$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h
 
-        ;;
-    esac
-  fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp can be used without linking with libm" >&5
-$as_echo_n "checking whether ldexp can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_ldexp_no_libm+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-                   double x;
-                   int y;
-int
-main ()
-{
-return ldexp (x, y) < 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_ldexp_no_libm=yes
-else
-  gl_cv_func_ldexp_no_libm=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5
-$as_echo "$gl_cv_func_ldexp_no_libm" >&6; }
-  if test $gl_cv_func_ldexp_no_libm = yes; then
+  if test $ac_cv_func__set_invalid_parameter_handler = yes; then
+    HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
 
-$as_echo "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h
+$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
 
+  else
+    HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
   fi
 
 
+if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl can be used without linking with libm" >&5
-$as_echo_n "checking whether frexpl can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_frexpl_no_libm+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-                   long double x;
-                   int y;
-int
-main ()
-{
-return frexpl (x, &y) < 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_frexpl_no_libm=yes
-else
-  gl_cv_func_frexpl_no_libm=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
-$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
-  if test $gl_cv_func_frexpl_no_libm = yes; then
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
-$as_echo_n "checking whether frexpl works... " >&6; }
-if test "${gl_cv_func_frexpl_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-         aix* | beos* | darwin* | irix* | mingw* | pw*)
-            gl_cv_func_frexpl_works="guessing no";;
-         *) gl_cv_func_frexpl_works="guessing yes";;
-       esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <float.h>
-#include <math.h>
-/* Override the values of <float.h>, like done in float.in.h.  */
-#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP    (-16381)
-#endif
-extern long double frexpl (long double, int *);
-int main()
-{
-  volatile long double x;
-  /* Test on finite numbers that fails on AIX 5.1.  */
-  x = 16.0L;
-  {
-    int exp = -9999;
-    frexpl (x, &exp);
-    if (exp != 5)
-      return 1;
-  }
-  /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl
-     function returns an invalid (incorrectly normalized) value: it returns
-               y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
-     but the correct result is
-          0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 }  */
-  x = 1.01L;
-  {
-    int exp = -9999;
-    long double y = frexpl (x, &exp);
-    if (!(exp == 1 && y == 0.505L))
-      return 1;
-  }
-  /* Test on large finite numbers.  This fails on BeOS at i = 16322, while
-     LDBL_MAX_EXP = 16384.
-     In the loop end test, we test x against Infinity, rather than comparing
-     i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP.  */
-  {
-    int i;
-    for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
-      {
-        int exp = -9999;
-        frexpl (x, &exp);
-        if (exp != i)
-          return 1;
-      }
-  }
-  /* Test on denormalized numbers.  */
-  {
-    int i;
-    for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
-      ;
-    if (x > 0.0L)
-      {
-        int exp;
-        long double y = frexpl (x, &exp);
-        /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
-           exp = -16382, y = 0.5.  On MacOS X 10.5: exp = -16384, y = 0.5.  */
-        if (exp != LDBL_MIN_EXP - 1)
-          return 1;
-      }
-  }
-  /* Test on infinite numbers.  */
-  x = 1.0L / 0.0L;
-  {
-    int exp;
-    long double y = frexpl (x, &exp);
-    if (y != x)
-      return 1;
-  }
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_frexpl_works=yes
-else
-  gl_cv_func_frexpl_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+  gl_LIBOBJS="$gl_LIBOBJS msvc-inval.$ac_objext"
+
 fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
-$as_echo "$gl_cv_func_frexpl_works" >&6; }
 
-    case "$gl_cv_func_frexpl_works" in
-      *yes) gl_func_frexpl_no_libm=yes ;;
-      *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
-    esac
-  else
-    gl_func_frexpl_no_libm=no
-        REPLACE_FREXPL=1
-  fi
-  if test $gl_func_frexpl_no_libm = yes; then
+if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+
 
-$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h
 
-            ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_frexpl" = x""yes; then :
 
-else
-  HAVE_DECL_FREXPL=0
-fi
 
-  fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl can be used without linking with libm" >&5
-$as_echo_n "checking whether ldexpl can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_ldexpl_no_libm+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-                   long double x;
-                   int y;
-int
-main ()
-{
-return ldexpl (x, y) < 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_ldexpl_no_libm=yes
-else
-  gl_cv_func_ldexpl_no_libm=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+
+  gl_LIBOBJS="$gl_LIBOBJS msvc-nothrow.$ac_objext"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_no_libm" >&5
-$as_echo "$gl_cv_func_ldexpl_no_libm" >&6; }
-  if test $gl_cv_func_ldexpl_no_libm = yes; then
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl works" >&5
-$as_echo_n "checking whether ldexpl works... " >&6; }
-if test "${gl_cv_func_ldexpl_works+set}" = set; then :
+
+  case "$host_os" in
+    mingw* | pw*)
+      REPLACE_OPEN=1
+      ;;
+    *)
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
+$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
+if ${gl_cv_func_open_slash+:} false; then :
   $as_echo_n "(cached) " >&6
 else
+  # Assume that if we have lstat, we can also check symlinks.
+          if test $ac_cv_func_lstat = yes; then
+            touch conftest.tmp
+            ln -s conftest.tmp conftest.lnk
+          fi
+          if test "$cross_compiling" = yes; then :
 
-      if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-         aix*) gl_cv_func_ldexpl_works="guessing no";;
-         *)    gl_cv_func_ldexpl_works="guessing yes";;
-       esac
+             case "$host_os" in
+               freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+                 gl_cv_func_open_slash="guessing no" ;;
+               *)
+                 gl_cv_func_open_slash="guessing yes" ;;
+             esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <math.h>
-extern long double ldexpl (long double, int);
-int main()
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+int main ()
 {
-  volatile long double x1 = 1.0;
-  volatile long double y1 = ldexpl (x1, -1);
-  volatile long double x2 = 1.73205L;
-  volatile long double y2 = ldexpl (x2, 0);
-  return (y1 != 0.5L) || (y2 != x2);
+  int result = 0;
+#if HAVE_LSTAT
+  if (open ("conftest.lnk/", O_RDONLY) != -1)
+    result |= 1;
+#endif
+  if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+    result |= 2;
+  return result;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_ldexpl_works=yes
+  gl_cv_func_open_slash=yes
 else
-  gl_cv_func_ldexpl_works=no
+  gl_cv_func_open_slash=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+          rm -f conftest.sl conftest.tmp conftest.lnk
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_works" >&5
-$as_echo "$gl_cv_func_ldexpl_works" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
+$as_echo "$gl_cv_func_open_slash" >&6; }
+      case "$gl_cv_func_open_slash" in
+        *no)
 
-    case "$gl_cv_func_ldexpl_works" in
-      *yes)
+$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
 
-$as_echo "#define HAVE_LDEXPL_IN_LIBC 1" >>confdefs.h
+          REPLACE_OPEN=1
+          ;;
+      esac
+      ;;
+  esac
 
-                        ac_fn_c_check_decl "$LINENO" "ldexpl" "ac_cv_have_decl_ldexpl" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_ldexpl" = x""yes; then :
+    if test $REPLACE_OPEN = 0; then
 
-else
-  HAVE_DECL_LDEXPL=0
-fi
 
-        ;;
-    esac
+
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
   fi
 
+      if test $HAVE_FCHDIR = 0; then
+        REPLACE_OPEN=1
+      fi
+    fi
 
 
-  if test $gl_cv_func_vfprintf_posix = no; then
 
+if test $REPLACE_OPEN = 1; then
 
 
 
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext"
 
-  gl_LIBOBJS="$gl_LIBOBJS printf.$ac_objext"
 
-  REPLACE_PRINTF=1
 
-$as_echo "#define REPLACE_PRINTF_POSIX 1" >>confdefs.h
 
   :
 
-  fi
+fi
+
+
+
 
 
+          GNULIB_OPEN=1
 
-  GNULIB_PRINTF_POSIX=1
 
 
 
 
+$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h
 
 
 
@@ -18593,423 +23644,623 @@ $as_echo "#define REPLACE_PRINTF_POSIX 1" >>confdefs.h
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS quotearg.$ac_objext"
+
+  case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink in
+  yes+*yes)
+    ;;
+  yes+*)
+    # Solaris 9 has *at functions, but uniformly mishandles trailing
+    # slash in all of them.
+    REPLACE_OPENAT=1
+    ;;
+  *)
+    HAVE_OPENAT=0
+    ;;
+  esac
+
+if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS openat.$ac_objext"
+
+
+
+
+  :
+
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define GNULIB_OPENAT 1
+_ACEOF
 
 
-  for ac_header in stdlib.h
+
+
+
+
+          GNULIB_OPENAT=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h
+
+
+
+
+
+
+  for ac_func in opendir
 do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = x""yes; then :
+  ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir"
+if test "x$ac_cv_func_opendir" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_STDLIB_H 1
+#define HAVE_OPENDIR 1
 _ACEOF
 
 fi
-
 done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
-$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
-if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then :
+  if test $ac_cv_func_opendir = no; then
+    HAVE_OPENDIR=0
+  fi
+
+
+
+
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
+
+    if test $HAVE_FCHDIR = 0; then
+      if test $HAVE_OPENDIR = 1; then
+        REPLACE_OPENDIR=1
+      fi
+    fi
+
+
+if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS opendir.$ac_objext"
+
+fi
+
+
+
+
+
+          GNULIB_OPENDIR=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+          if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then
+            REPLACE_PERROR=1
+  fi
+  case ${gl_cv_func_strerror_r_works-unset} in
+    unset|*yes)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether perror matches strerror" >&5
+$as_echo_n "checking whether perror matches strerror... " >&6; }
+if ${gl_cv_func_perror_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
-  ac_cv_func_realloc_0_nonnull=no
+              gl_cv_func_perror_works="guessing no"
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *realloc ();
-#endif
+#include <errno.h>
+                #include <stdio.h>
+                #include <stdlib.h>
+                #include <string.h>
 
 int
 main ()
 {
-return ! realloc (0, 0);
+char *str = strerror (-1);
+                if (!getenv("CONFTEST_OUTPUT")) return 0;
+                if (!str) str = "";
+                puts (str);
+                errno = -1;
+                perror ("");
+                return 0;
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_realloc_0_nonnull=yes
+  if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \
+               && cmp conftest.txt1 conftest.txt2 >/dev/null; then
+              gl_cv_func_perror_works=yes
+            else
+              gl_cv_func_perror_works=no
+            fi
+            rm -rf conftest.txt1 conftest.txt2
 else
-  ac_cv_func_realloc_0_nonnull=no
+  gl_cv_func_perror_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
-$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
-if test $ac_cv_func_realloc_0_nonnull = yes; then :
-
-$as_echo "#define HAVE_REALLOC 1" >>confdefs.h
-
-else
-  $as_echo "#define HAVE_REALLOC 0" >>confdefs.h
-
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
-
-
-$as_echo "#define realloc rpl_realloc" >>confdefs.h
 
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_perror_works" >&5
+$as_echo "$gl_cv_func_perror_works" >&6; }
+      if test "$gl_cv_func_perror_works" != yes; then
+        REPLACE_PERROR=1
+      fi
+      ;;
+    *)
+                  REPLACE_PERROR=1
+      ;;
+  esac
 
-
-
-$as_echo "#define GNULIB_REALLOC_GNU 1" >>confdefs.h
+if test $REPLACE_PERROR = 1; then
 
 
 
-  if test $gl_cv_func_malloc_posix = yes; then
-    HAVE_REALLOC_POSIX=1
 
-$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
 
-  else
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS perror.$ac_objext"
 
+fi
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
 
-    HAVE_REALLOC_POSIX=0
-  fi
+          GNULIB_PERROR=1
 
 
 
 
-  GNULIB_REALLOC_POSIX=1
 
+$as_echo "#define GNULIB_TEST_PERROR 1" >>confdefs.h
 
 
 
 
 
+  if test $gl_cv_func_frexp_no_libm = yes; then
 
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
+$as_echo_n "checking whether frexp works... " >&6; }
+if ${gl_cv_func_frexp_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+      if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+           netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
+           *)                        gl_cv_func_frexp_works="guessing yes";;
+         esac
 
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  for ac_func in rmdir
-do :
-  ac_fn_c_check_func "$LINENO" "rmdir" "ac_cv_func_rmdir"
-if test "x$ac_cv_func_rmdir" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_RMDIR 1
+#include <float.h>
+#include <math.h>
+#include <string.h>
+#if HAVE_ALARM
+# include <unistd.h>
+#endif
+/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
+   ICC 10.0 has a bug when optimizing the expression -zero.
+   The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
+   to PowerPC on MacOS X 10.5.  */
+#if defined __hpux || defined __sgi || defined __ICC
+static double
+compute_minus_zero (void)
+{
+  return -DBL_MIN * DBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
+#else
+double minus_zero = -0.0;
+#endif
+int main()
+{
+  int result = 0;
+  int i;
+  volatile double x;
+  double zero = 0.0;
+#if HAVE_ALARM
+  /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
+     number.  Let the test fail in this case.  */
+  alarm (5);
+#endif
+  /* Test on denormalized numbers.  */
+  for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
+    ;
+  if (x > 0.0)
+    {
+      int exp;
+      double y = frexp (x, &exp);
+      /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
+         On NetBSD: y = 0.75. Correct: y = 0.5.  */
+      if (y != 0.5)
+        result |= 1;
+    }
+  /* Test on infinite numbers.  */
+  x = 1.0 / zero;
+  {
+    int exp;
+    double y = frexp (x, &exp);
+    if (y != x)
+      result |= 2;
+  }
+  /* Test on negative zero.  */
+  x = minus_zero;
+  {
+    int exp;
+    double y = frexp (x, &exp);
+    if (memcmp (&y, &x, sizeof x))
+      result |= 4;
+  }
+  return result;
+}
 _ACEOF
-
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_frexp_works=yes
 else
+  gl_cv_func_frexp_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
 
 fi
-done
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
+$as_echo "$gl_cv_func_frexp_works" >&6; }
 
+    case "$gl_cv_func_frexp_works" in
+      *yes)
 
-  if test $ac_cv_func_rmdir = no; then
-    REPLACE_RMDIR=1
-    # If someone lacks rmdir, make configure fail, and request
-    # a bug report to inform us about it.
-    if test x"$SKIP_RMDIR_CHECK" != xyes; then
-      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "Your system lacks the rmdir function.
-              Please report this, along with the output of \"uname -a\", to the
-              bug-coreutils@gnu.org mailing list.  To continue past this point,
-              rerun configure with SKIP_RMDIR_CHECK=yes.
-              E.g., ./configure SKIP_RMDIR_CHECK=yes
-See \`config.log' for more details." "$LINENO" 5; }
-    fi
-  else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
-$as_echo_n "checking whether rmdir works... " >&6; }
-if test "${gl_cv_func_rmdir_works+set}" = set; then :
+$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h
+
+        ;;
+    esac
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp can be used without linking with libm" >&5
+$as_echo_n "checking whether ldexp can be used without linking with libm... " >&6; }
+if ${gl_cv_func_ldexp_no_libm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  mkdir conftest.dir
-       touch conftest.file
-       if test "$cross_compiling" = yes; then :
-  gl_cv_func_rmdir_works="guessing no"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-             #include <errno.h>
-             #include <unistd.h>
 
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             double x;
+             int y;
 int
 main ()
 {
-return !rmdir ("conftest.file/") || errno != ENOTDIR
-       || !rmdir ("conftest.dir/./");
+return ldexp (x, y) < 1;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_rmdir_works=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func_ldexp_no_libm=yes
 else
-  gl_cv_func_rmdir_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+  gl_cv_func_ldexp_no_libm=no
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-       rm -rf conftest.dir conftest.file
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
-$as_echo "$gl_cv_func_rmdir_works" >&6; }
-    if test x"$gl_cv_func_rmdir_works" != xyes; then
-      REPLACE_RMDIR=1
-
-
-
-
-
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5
+$as_echo "$gl_cv_func_ldexp_no_libm" >&6; }
+  if test $gl_cv_func_ldexp_no_libm = yes; then
 
-  gl_LIBOBJS="$gl_LIBOBJS rmdir.$ac_objext"
+$as_echo "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h
 
-    fi
   fi
 
 
 
-  GNULIB_RMDIR=1
 
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
+$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
+if ${gl_cv_func_frexpl_no_libm+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             long double x;
+int
+main ()
+{
+int e; return frexpl (x, &e) > 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func_frexpl_no_libm=yes
+else
+  gl_cv_func_frexpl_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
+$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
 
+  if test $gl_cv_func_frexpl_no_libm = yes; then
 
 
-
-
-  gl_LIBOBJS="$gl_LIBOBJS save-cwd.$ac_objext"
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit macro" >&5
-$as_echo_n "checking for signbit macro... " >&6; }
-if test "${gl_cv_func_signbit+set}" = set; then :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
+$as_echo_n "checking whether frexpl works... " >&6; }
+if ${gl_cv_func_frexpl_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
-  gl_cv_func_signbit="guessing no"
+
+         case "$host_os" in
+           aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
+              gl_cv_func_frexpl_works="guessing no";;
+           *) gl_cv_func_frexpl_works="guessing yes";;
+         esac
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <float.h>
 #include <math.h>
-/* If signbit is defined as a function, don't use it, since calling it for
-   'float' or 'long double' arguments would involve conversions.
-   If signbit is not declared at all but exists as a library function, don't
-   use it, since the prototype may not match.
-   If signbit is not declared at all but exists as a compiler built-in, don't
-   use it, since it's preferable to use __builtin_signbit* (no warnings,
-   no conversions).  */
-#ifndef signbit
-# error "signbit should be a macro"
+/* Override the values of <float.h>, like done in float.in.h.  */
+#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
 #endif
-#include <string.h>
-
-/* Global variables.
-   Needed because GCC 4 constant-folds __builtin_signbitl (literal)
-   but cannot constant-fold            __builtin_signbitl (variable).  */
-float vf;
-double vd;
-long double vl;
-int main ()
-{
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
-   So we use -p0f and -p0d instead.  */
-float p0f = 0.0f;
-float m0f = -p0f;
-double p0d = 0.0;
-double m0d = -p0d;
-/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
-   So we use another constant expression instead.
-   But that expression does not work on other platforms, such as when
-   cross-compiling to PowerPC on MacOS X 10.5.  */
-long double p0l = 0.0L;
-#if defined __hpux || defined __sgi
-long double m0l = -LDBL_MIN * LDBL_MIN;
-#else
-long double m0l = -p0l;
+#if defined __i386__ && defined __FreeBSD__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
 #endif
-  if (signbit (vf))
-    vf++;
+#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+#endif
+#if defined __sgi && (LDBL_MANT_DIG >= 106)
+# if defined __GNUC__
+#  undef LDBL_MIN_EXP
+#  define LDBL_MIN_EXP DBL_MIN_EXP
+# endif
+#endif
+extern
+#ifdef __cplusplus
+"C"
+#endif
+long double frexpl (long double, int *);
+int main()
+{
+  int result = 0;
+  volatile long double x;
+  /* Test on finite numbers that fails on AIX 5.1.  */
+  x = 16.0L;
   {
-    float plus_inf = 1.0f / p0f;
-    float minus_inf = -1.0f / p0f;
-    if (!(!signbit (255.0f)
-          && signbit (-255.0f)
-          && !signbit (p0f)
-          && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
-          && !signbit (plus_inf)
-          && signbit (minus_inf)))
-      return 1;
+    int exp = -9999;
+    frexpl (x, &exp);
+    if (exp != 5)
+      result |= 1;
   }
-  if (signbit (vd))
-    vd++;
+  /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl
+     function returns an invalid (incorrectly normalized) value: it returns
+               y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
+     but the correct result is
+          0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 }  */
+  x = 1.01L;
   {
-    double plus_inf = 1.0 / p0d;
-    double minus_inf = -1.0 / p0d;
-    if (!(!signbit (255.0)
-          && signbit (-255.0)
-          && !signbit (p0d)
-          && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
-          && !signbit (plus_inf)
-          && signbit (minus_inf)))
-      return 1;
+    int exp = -9999;
+    long double y = frexpl (x, &exp);
+    if (!(exp == 1 && y == 0.505L))
+      result |= 2;
   }
-  if (signbit (vl))
-    vl++;
+  /* Test on large finite numbers.  This fails on BeOS at i = 16322, while
+     LDBL_MAX_EXP = 16384.
+     In the loop end test, we test x against Infinity, rather than comparing
+     i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP.  */
   {
-    long double plus_inf = 1.0L / p0l;
-    long double minus_inf = -1.0L / p0l;
-    if (!(!signbit (255.0L)
-          && signbit (-255.0L)
-          && !signbit (p0l)
-          && (memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l))
-          && !signbit (plus_inf)
-          && signbit (minus_inf)))
-      return 1;
+    int i;
+    for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
+      {
+        int exp = -9999;
+        frexpl (x, &exp);
+        if (exp != i)
+          {
+            result |= 4;
+            break;
+          }
+      }
   }
-  return 0;
+  /* Test on denormalized numbers.  */
+  {
+    int i;
+    for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
+      ;
+    if (x > 0.0L)
+      {
+        int exp;
+        long double y = frexpl (x, &exp);
+        /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
+           exp = -16382, y = 0.5.  On MacOS X 10.5: exp = -16384, y = 0.5.  */
+        if (exp != LDBL_MIN_EXP - 1)
+          result |= 8;
+      }
+  }
+  /* Test on infinite numbers.  */
+  x = 1.0L / 0.0L;
+  {
+    int exp;
+    long double y = frexpl (x, &exp);
+    if (y != x)
+      result |= 16;
+  }
+  return result;
 }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_frexpl_works=yes
+else
+  gl_cv_func_frexpl_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
+$as_echo "$gl_cv_func_frexpl_works" >&6; }
+
+    case "$gl_cv_func_frexpl_works" in
+      *yes) gl_func_frexpl_no_libm=yes ;;
+      *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
+    esac
+  else
+    gl_func_frexpl_no_libm=no
+        REPLACE_FREXPL=1
+  fi
+  if test $gl_func_frexpl_no_libm = yes; then
+
+$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h
+
+            ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
+"
+if test "x$ac_cv_have_decl_frexpl" = xyes; then :
+
+else
+  HAVE_DECL_FREXPL=0
+fi
+
+  fi
+
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl() can be used without linking with libm" >&5
+$as_echo_n "checking whether ldexpl() can be used without linking with libm... " >&6; }
+if ${gl_cv_func_ldexpl_no_libm+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             long double x;
+int
+main ()
+{
+return ldexpl (x, -1) > 0;
+  ;
+  return 0;
+}
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_signbit=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func_ldexpl_no_libm=yes
 else
-  gl_cv_func_signbit=no
+  gl_cv_func_ldexpl_no_libm=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_no_libm" >&5
+$as_echo "$gl_cv_func_ldexpl_no_libm" >&6; }
 
+  if test $gl_cv_func_ldexpl_no_libm = yes; then
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit" >&5
-$as_echo "$gl_cv_func_signbit" >&6; }
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit compiler built-ins" >&5
-$as_echo_n "checking for signbit compiler built-ins... " >&6; }
-if test "${gl_cv_func_signbit_gcc+set}" = set; then :
+
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl works" >&5
+$as_echo_n "checking whether ldexpl works... " >&6; }
+if ${gl_cv_func_ldexpl_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
       if test "$cross_compiling" = yes; then :
-  gl_cv_func_signbit_gcc="guessing no"
+
+         case "$host_os" in
+           aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";;
+           *)               gl_cv_func_ldexpl_works="guessing yes";;
+         esac
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#if __GNUC__ >= 4
-# define signbit(x) \
-   (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
-    sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
-    __builtin_signbitf (x))
-#else
-# error "signbit should be three compiler built-ins"
+#include <math.h>
+extern
+#ifdef __cplusplus
+"C"
 #endif
-#include <string.h>
-
-/* Global variables.
-   Needed because GCC 4 constant-folds __builtin_signbitl (literal)
-   but cannot constant-fold            __builtin_signbitl (variable).  */
-float vf;
-double vd;
-long double vl;
-int main ()
+long double ldexpl (long double, int);
+int main()
 {
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
-   So we use -p0f and -p0d instead.  */
-float p0f = 0.0f;
-float m0f = -p0f;
-double p0d = 0.0;
-double m0d = -p0d;
-/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
-   So we use another constant expression instead.
-   But that expression does not work on other platforms, such as when
-   cross-compiling to PowerPC on MacOS X 10.5.  */
-long double p0l = 0.0L;
-#if defined __hpux || defined __sgi
-long double m0l = -LDBL_MIN * LDBL_MIN;
-#else
-long double m0l = -p0l;
-#endif
-  if (signbit (vf))
-    vf++;
-  {
-    float plus_inf = 1.0f / p0f;
-    float minus_inf = -1.0f / p0f;
-    if (!(!signbit (255.0f)
-          && signbit (-255.0f)
-          && !signbit (p0f)
-          && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
-          && !signbit (plus_inf)
-          && signbit (minus_inf)))
-      return 1;
-  }
-  if (signbit (vd))
-    vd++;
+  int result = 0;
   {
-    double plus_inf = 1.0 / p0d;
-    double minus_inf = -1.0 / p0d;
-    if (!(!signbit (255.0)
-          && signbit (-255.0)
-          && !signbit (p0d)
-          && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
-          && !signbit (plus_inf)
-          && signbit (minus_inf)))
-      return 1;
+    volatile long double x = 1.0;
+    volatile long double y = ldexpl (x, -1);
+    if (y != 0.5L)
+      result |= 1;
   }
-  if (signbit (vl))
-    vl++;
   {
-    long double plus_inf = 1.0L / p0l;
-    long double minus_inf = -1.0L / p0l;
-    if (!(!signbit (255.0L)
-          && signbit (-255.0L)
-          && !signbit (p0l)
-          && (memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l))
-          && !signbit (plus_inf)
-          && signbit (minus_inf)))
-      return 1;
+    volatile long double x = 1.73205L;
+    volatile long double y = ldexpl (x, 0);
+    if (y != x)
+      result |= 2;
   }
-  return 0;
+  return result;
 }
-
-
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_signbit_gcc=yes
+  gl_cv_func_ldexpl_works=yes
 else
-  gl_cv_func_signbit_gcc=no
+  gl_cv_func_ldexpl_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit_gcc" >&5
-$as_echo "$gl_cv_func_signbit_gcc" >&6; }
-      if test "$gl_cv_func_signbit_gcc" = yes; then
-    REPLACE_SIGNBIT_USING_GCC=1
-  else
-    if test "$gl_cv_func_signbit" != yes; then
-      REPLACE_SIGNBIT=1
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_works" >&5
+$as_echo "$gl_cv_func_ldexpl_works" >&6; }
 
+    case "$gl_cv_func_ldexpl_works" in
+      *yes)
 
+$as_echo "#define HAVE_LDEXPL_IN_LIBC 1" >>confdefs.h
 
+                        ac_fn_c_check_decl "$LINENO" "ldexpl" "ac_cv_have_decl_ldexpl" "#include <math.h>
+"
+if test "x$ac_cv_have_decl_ldexpl" = xyes; then :
 
+else
+  HAVE_DECL_LDEXPL=0
+fi
 
+        ;;
+    esac
+  fi
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS signbitf.$ac_objext"
+  if test $gl_cv_func_vfprintf_posix = no; then
 
 
 
@@ -19042,1193 +24300,1035 @@ $as_echo "$gl_cv_func_signbit_gcc" >&6; }
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS signbitd.$ac_objext"
 
 
+  gl_LIBOBJS="$gl_LIBOBJS printf.$ac_objext"
 
+  REPLACE_PRINTF=1
 
+$as_echo "#define REPLACE_PRINTF_POSIX 1" >>confdefs.h
 
+  :
 
+  fi
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS signbitl.$ac_objext"
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'float'" >&5
-$as_echo_n "checking where to find the sign bit in a 'float'... " >&6; }
-if test "${gl_cv_cc_float_signbit+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
+          GNULIB_PRINTF_POSIX=1
 
-      if test "$cross_compiling" = yes; then :
 
-                              gl_cv_cc_float_signbit="unknown"
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <stddef.h>
-#include <stdio.h>
-#define NWORDS \
-  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { float value; unsigned int word[NWORDS]; }
-        memory_float;
-static memory_float plus = { 1.0f };
-static memory_float minus = { -1.0f };
-int main ()
-{
-  size_t j, k, i;
-  unsigned int m;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  /* Find the different bit.  */
-  k = 0; m = 0;
-  for (j = 0; j < NWORDS; j++)
-    {
-      unsigned int x = plus.word[j] ^ minus.word[j];
-      if ((x & (x - 1)) || (x && m))
-        {
-          /* More than one bit difference.  */
-          fprintf (fp, "unknown");
-          return 1;
-        }
-      if (x)
-        {
-          k = j;
-          m = x;
-        }
-    }
-  if (m == 0)
-    {
-      /* No difference.  */
-      fprintf (fp, "unknown");
-      return 1;
-    }
-  /* Now m = plus.word[k] ^ ~minus.word[k].  */
-  if (plus.word[k] & ~minus.word[k])
-    {
-      /* Oh? The sign bit is set in the positive and cleared in the negative
-         numbers?  */
-      fprintf (fp, "unknown");
-      return 1;
-    }
-  for (i = 0; ; i++)
-    if ((m >> i) & 1)
-      break;
-  fprintf (fp, "word %d bit %d", (int) k, (int) i);
-  return (fclose (fp) != 0);
-}
 
+$as_echo "#define GNULIB_TEST_PRINTF_POSIX 1" >>confdefs.h
+
+
+
+
+
+  :
+
+
+
+
+  for ac_func in readdir
+do :
+  ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir"
+if test "x$ac_cv_func_readdir" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_READDIR 1
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_float_signbit=`cat conftest.out`
-else
-  gl_cv_cc_float_signbit="unknown"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+
 fi
+done
+
+  if test $ac_cv_func_readdir = no; then
+    HAVE_READDIR=0
+  fi
+
+if test $HAVE_READDIR = 0; then
+
+
+
 
-      rm -f conftest.out
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS readdir.$ac_objext"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_signbit" >&5
-$as_echo "$gl_cv_cc_float_signbit" >&6; }
-  case "$gl_cv_cc_float_signbit" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word.*bit //'`
 
-cat >>confdefs.h <<_ACEOF
-#define FLT_SIGNBIT_WORD $word
-_ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define FLT_SIGNBIT_BIT $bit
+
+
+          GNULIB_READDIR=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h
+
+
+
+
+
+
+      for ac_header in stdlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
 _ACEOF
 
-      ;;
-  esac
-
-
+fi
 
+done
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'double'" >&5
-$as_echo_n "checking where to find the sign bit in a 'double'... " >&6; }
-if test "${gl_cv_cc_double_signbit+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
+$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
+if ${ac_cv_func_realloc_0_nonnull+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-
-      if test "$cross_compiling" = yes; then :
-
-                              gl_cv_cc_double_signbit="unknown"
+  if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+          # Guess yes on platforms where we know the result.
+          *-gnu* | freebsd* | netbsd* | openbsd* \
+          | hpux* | solaris* | cygwin* | mingw*)
+            ac_cv_func_realloc_0_nonnull=yes ;;
+          # If we don't know, assume the worst.
+          *) ac_cv_func_realloc_0_nonnull=no ;;
+        esac
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+            # include <stdlib.h>
+            #else
+            char *realloc ();
+            #endif
 
-#include <stddef.h>
-#include <stdio.h>
-#define NWORDS \
-  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { double value; unsigned int word[NWORDS]; }
-        memory_float;
-static memory_float plus = { 1.0 };
-static memory_float minus = { -1.0 };
-int main ()
+int
+main ()
 {
-  size_t j, k, i;
-  unsigned int m;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  /* Find the different bit.  */
-  k = 0; m = 0;
-  for (j = 0; j < NWORDS; j++)
-    {
-      unsigned int x = plus.word[j] ^ minus.word[j];
-      if ((x & (x - 1)) || (x && m))
-        {
-          /* More than one bit difference.  */
-          fprintf (fp, "unknown");
-          return 1;
-        }
-      if (x)
-        {
-          k = j;
-          m = x;
-        }
-    }
-  if (m == 0)
-    {
-      /* No difference.  */
-      fprintf (fp, "unknown");
-      return 1;
-    }
-  /* Now m = plus.word[k] ^ ~minus.word[k].  */
-  if (plus.word[k] & ~minus.word[k])
-    {
-      /* Oh? The sign bit is set in the positive and cleared in the negative
-         numbers?  */
-      fprintf (fp, "unknown");
-      return 1;
-    }
-  for (i = 0; ; i++)
-    if ((m >> i) & 1)
-      break;
-  fprintf (fp, "word %d bit %d", (int) k, (int) i);
-  return (fclose (fp) != 0);
+return ! realloc (0, 0);
+  ;
+  return 0;
 }
 
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_double_signbit=`cat conftest.out`
+  ac_cv_func_realloc_0_nonnull=yes
 else
-  gl_cv_cc_double_signbit="unknown"
+  ac_cv_func_realloc_0_nonnull=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-      rm -f conftest.out
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_signbit" >&5
-$as_echo "$gl_cv_cc_double_signbit" >&6; }
-  case "$gl_cv_cc_double_signbit" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word.*bit //'`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
+  if test $ac_cv_func_realloc_0_nonnull = yes; then :
 
-cat >>confdefs.h <<_ACEOF
-#define DBL_SIGNBIT_WORD $word
-_ACEOF
+$as_echo "#define HAVE_REALLOC_GNU 1" >>confdefs.h
 
+else
+  $as_echo "#define HAVE_REALLOC_GNU 0" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define DBL_SIGNBIT_BIT $bit
-_ACEOF
+     REPLACE_REALLOC=1
 
-      ;;
-  esac
+fi
 
 
+if test $REPLACE_REALLOC = 1; then
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'long double'" >&5
-$as_echo_n "checking where to find the sign bit in a 'long double'... " >&6; }
-if test "${gl_cv_cc_long_double_signbit+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
 
-                              gl_cv_cc_long_double_signbit="unknown"
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <stddef.h>
-#include <stdio.h>
-#define NWORDS \
-  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { long double value; unsigned int word[NWORDS]; }
-        memory_float;
-static memory_float plus = { 1.0L };
-static memory_float minus = { -1.0L };
-int main ()
-{
-  size_t j, k, i;
-  unsigned int m;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  /* Find the different bit.  */
-  k = 0; m = 0;
-  for (j = 0; j < NWORDS; j++)
-    {
-      unsigned int x = plus.word[j] ^ minus.word[j];
-      if ((x & (x - 1)) || (x && m))
-        {
-          /* More than one bit difference.  */
-          fprintf (fp, "unknown");
-          return 1;
-        }
-      if (x)
-        {
-          k = j;
-          m = x;
-        }
-    }
-  if (m == 0)
-    {
-      /* No difference.  */
-      fprintf (fp, "unknown");
-      return 1;
-    }
-  /* Now m = plus.word[k] ^ ~minus.word[k].  */
-  if (plus.word[k] & ~minus.word[k])
-    {
-      /* Oh? The sign bit is set in the positive and cleared in the negative
-         numbers?  */
-      fprintf (fp, "unknown");
-      return 1;
-    }
-  for (i = 0; ; i++)
-    if ((m >> i) & 1)
-      break;
-  fprintf (fp, "word %d bit %d", (int) k, (int) i);
-  return (fclose (fp) != 0);
-}
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_long_double_signbit=`cat conftest.out`
-else
-  gl_cv_cc_long_double_signbit="unknown"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-      rm -f conftest.out
+  gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_signbit" >&5
-$as_echo "$gl_cv_cc_long_double_signbit" >&6; }
-  case "$gl_cv_cc_long_double_signbit" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word.*bit //'`
+
 
 cat >>confdefs.h <<_ACEOF
-#define LDBL_SIGNBIT_WORD $word
+#define GNULIB_REALLOC_GNU 1
 _ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define LDBL_SIGNBIT_BIT $bit
-_ACEOF
 
-      ;;
-  esac
 
 
-      if test "$gl_cv_cc_float_signbit" = unknown; then
-                ac_fn_c_check_decl "$LINENO" "copysignf" "ac_cv_have_decl_copysignf" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_copysignf" = x""yes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+  if test $gl_cv_func_malloc_posix = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_COPYSIGNF $ac_have_decl
-_ACEOF
+$as_echo "#define HAVE_REALLOC_POSIX 1" >>confdefs.h
 
-        if test "$ac_cv_have_decl_copysignf" = yes; then
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignf can be used without linking with libm" >&5
-$as_echo_n "checking whether copysignf can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_copysignf_no_libm+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
+  else
+    REPLACE_REALLOC=1
+  fi
 
-              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-                           float x, y;
-int
-main ()
-{
-return copysignf (x, y) < 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_copysignf_no_libm=yes
-else
-  gl_cv_func_copysignf_no_libm=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+if test $REPLACE_REALLOC = 1; then
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignf_no_libm" >&5
-$as_echo "$gl_cv_func_copysignf_no_libm" >&6; }
-          if test $gl_cv_func_copysignf_no_libm = yes; then
 
-$as_echo "#define HAVE_COPYSIGNF_IN_LIBC 1" >>confdefs.h
 
-          fi
-        fi
-      fi
-      if test "$gl_cv_cc_double_signbit" = unknown; then
-                ac_fn_c_check_decl "$LINENO" "copysign" "ac_cv_have_decl_copysign" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_copysign" = x""yes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_COPYSIGN $ac_have_decl
-_ACEOF
 
-        if test "$ac_cv_have_decl_copysign" = yes; then
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysign can be used without linking with libm" >&5
-$as_echo_n "checking whether copysign can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_copysign_no_libm+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-                           double x, y;
-int
-main ()
-{
-return copysign (x, y) < 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_copysign_no_libm=yes
-else
-  gl_cv_func_copysign_no_libm=no
+
+
+  gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
+
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysign_no_libm" >&5
-$as_echo "$gl_cv_func_copysign_no_libm" >&6; }
-          if test $gl_cv_func_copysign_no_libm = yes; then
 
-$as_echo "#define HAVE_COPYSIGN_IN_LIBC 1" >>confdefs.h
 
-          fi
-        fi
-      fi
-      if test "$gl_cv_cc_long_double_signbit" = unknown; then
-                ac_fn_c_check_decl "$LINENO" "copysignl" "ac_cv_have_decl_copysignl" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_copysignl" = x""yes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_COPYSIGNL $ac_have_decl
-_ACEOF
 
-        if test "$ac_cv_have_decl_copysignl" = yes; then
-                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignl can be used without linking with libm" >&5
-$as_echo_n "checking whether copysignl can be used without linking with libm... " >&6; }
-if test "${gl_cv_func_copysignl_no_libm+set}" = set; then :
+          GNULIB_REALLOC_POSIX=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
+
+
+
+
+
+
+
+  :
+
+
+
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit macro" >&5
+$as_echo_n "checking for signbit macro... " >&6; }
+if ${gl_cv_func_signbit+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_signbit="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_signbit="guessing no" ;;
+         esac
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <math.h>
-                           long double x, y;
-int
-main ()
+/* If signbit is defined as a function, don't use it, since calling it for
+   'float' or 'long double' arguments would involve conversions.
+   If signbit is not declared at all but exists as a library function, don't
+   use it, since the prototype may not match.
+   If signbit is not declared at all but exists as a compiler built-in, don't
+   use it, since it's preferable to use __builtin_signbit* (no warnings,
+   no conversions).  */
+#ifndef signbit
+# error "signbit should be a macro"
+#endif
+#include <string.h>
+
+/* Global variables.
+   Needed because GCC 4 constant-folds __builtin_signbitl (literal)
+   but cannot constant-fold            __builtin_signbitl (variable).  */
+float vf;
+double vd;
+long double vl;
+int main ()
 {
-return copysignl (x, y) < 0;
-  ;
-  return 0;
+/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
+   So we use -p0f and -p0d instead.  */
+float p0f = 0.0f;
+float m0f = -p0f;
+double p0d = 0.0;
+double m0d = -p0d;
+/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
+   So we use another constant expression instead.
+   But that expression does not work on other platforms, such as when
+   cross-compiling to PowerPC on MacOS X 10.5.  */
+long double p0l = 0.0L;
+#if defined __hpux || defined __sgi
+long double m0l = -LDBL_MIN * LDBL_MIN;
+#else
+long double m0l = -p0l;
+#endif
+  int result = 0;
+  if (signbit (vf)) /* link check */
+    vf++;
+  {
+    float plus_inf = 1.0f / p0f;
+    float minus_inf = -1.0f / p0f;
+    if (!(!signbit (255.0f)
+          && signbit (-255.0f)
+          && !signbit (p0f)
+          && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
+          && !signbit (plus_inf)
+          && signbit (minus_inf)))
+      result |= 1;
+  }
+  if (signbit (vd)) /* link check */
+    vd++;
+  {
+    double plus_inf = 1.0 / p0d;
+    double minus_inf = -1.0 / p0d;
+    if (!(!signbit (255.0)
+          && signbit (-255.0)
+          && !signbit (p0d)
+          && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
+          && !signbit (plus_inf)
+          && signbit (minus_inf)))
+      result |= 2;
+  }
+  if (signbit (vl)) /* link check */
+    vl++;
+  {
+    long double plus_inf = 1.0L / p0l;
+    long double minus_inf = -1.0L / p0l;
+    if (signbit (255.0L))
+      result |= 4;
+    if (!signbit (-255.0L))
+      result |= 4;
+    if (signbit (p0l))
+      result |= 8;
+    if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)))
+      result |= 16;
+    if (signbit (plus_inf))
+      result |= 32;
+    if (!signbit (minus_inf))
+      result |= 64;
+  }
+  return result;
 }
+
+
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_copysignl_no_libm=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_signbit=yes
 else
-  gl_cv_func_copysignl_no_libm=no
+  gl_cv_func_signbit=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignl_no_libm" >&5
-$as_echo "$gl_cv_func_copysignl_no_libm" >&6; }
-          if test $gl_cv_func_copysignl_no_libm = yes; then
-
-$as_echo "#define HAVE_COPYSIGNL_IN_LIBC 1" >>confdefs.h
-
-          fi
-        fi
-      fi
-    fi
-  fi
 
 
-
-  GNULIB_SIGNBIT=1
-
-
-  for ac_header in stdint.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdint_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H 1
-_ACEOF
-
 fi
-
-done
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5
-$as_echo_n "checking for SIZE_MAX... " >&6; }
-if test "${gl_cv_size_max+set}" = set; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit" >&5
+$as_echo "$gl_cv_func_signbit" >&6; }
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit compiler built-ins" >&5
+$as_echo_n "checking for signbit compiler built-ins... " >&6; }
+if ${gl_cv_func_signbit_gcc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-    gl_cv_size_max=
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_signbit_gcc="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_signbit_gcc="guessing no" ;;
+         esac
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <limits.h>
-#if HAVE_STDINT_H
-#include <stdint.h>
+#if __GNUC__ >= 4
+# define signbit(x) \
+   (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
+    sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
+    __builtin_signbitf (x))
+#else
+# error "signbit should be three compiler built-ins"
 #endif
-#ifdef SIZE_MAX
-Found it
+#include <string.h>
+
+/* Global variables.
+   Needed because GCC 4 constant-folds __builtin_signbitl (literal)
+   but cannot constant-fold            __builtin_signbitl (variable).  */
+float vf;
+double vd;
+long double vl;
+int main ()
+{
+/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
+   So we use -p0f and -p0d instead.  */
+float p0f = 0.0f;
+float m0f = -p0f;
+double p0d = 0.0;
+double m0d = -p0d;
+/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
+   So we use another constant expression instead.
+   But that expression does not work on other platforms, such as when
+   cross-compiling to PowerPC on MacOS X 10.5.  */
+long double p0l = 0.0L;
+#if defined __hpux || defined __sgi
+long double m0l = -LDBL_MIN * LDBL_MIN;
+#else
+long double m0l = -p0l;
 #endif
+  int result = 0;
+  if (signbit (vf)) /* link check */
+    vf++;
+  {
+    float plus_inf = 1.0f / p0f;
+    float minus_inf = -1.0f / p0f;
+    if (!(!signbit (255.0f)
+          && signbit (-255.0f)
+          && !signbit (p0f)
+          && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
+          && !signbit (plus_inf)
+          && signbit (minus_inf)))
+      result |= 1;
+  }
+  if (signbit (vd)) /* link check */
+    vd++;
+  {
+    double plus_inf = 1.0 / p0d;
+    double minus_inf = -1.0 / p0d;
+    if (!(!signbit (255.0)
+          && signbit (-255.0)
+          && !signbit (p0d)
+          && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
+          && !signbit (plus_inf)
+          && signbit (minus_inf)))
+      result |= 2;
+  }
+  if (signbit (vl)) /* link check */
+    vl++;
+  {
+    long double plus_inf = 1.0L / p0l;
+    long double minus_inf = -1.0L / p0l;
+    if (signbit (255.0L))
+      result |= 4;
+    if (!signbit (-255.0L))
+      result |= 4;
+    if (signbit (p0l))
+      result |= 8;
+    if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)))
+      result |= 16;
+    if (signbit (plus_inf))
+      result |= 32;
+    if (!signbit (minus_inf))
+      result |= 64;
+  }
+  return result;
+}
+
 
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Found it" >/dev/null 2>&1; then :
-  gl_cv_size_max=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_signbit_gcc=yes
+else
+  gl_cv_func_signbit_gcc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f conftest*
 
-    if test -z "$gl_cv_size_max"; then
-                        if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1"        "#include <stddef.h>
-#include <limits.h>"; then :
 
-else
-  size_t_bits_minus_1=
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit_gcc" >&5
+$as_echo "$gl_cv_func_signbit_gcc" >&6; }
+      case "$gl_cv_func_signbit_gcc" in
+    *yes)
+      REPLACE_SIGNBIT_USING_GCC=1
+      ;;
+    *)
+      case "$gl_cv_func_signbit" in
+        *yes) ;;
+        *)
+                    REPLACE_SIGNBIT=1
 
-      if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint"        "#include <stddef.h>"; then :
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'float'" >&5
+$as_echo_n "checking where to find the sign bit in a 'float'... " >&6; }
+if ${gl_cv_cc_float_signbit+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  fits_in_uint=
-fi
 
-      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
-        if test $fits_in_uint = 1; then
-                              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      if test "$cross_compiling" = yes; then :
+
+                              gl_cv_cc_float_signbit="unknown"
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stddef.h>
-            extern size_t foo;
-            extern unsigned long foo;
 
-int
-main ()
+#include <stddef.h>
+#include <stdio.h>
+#define NWORDS \
+  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { float value; unsigned int word[NWORDS]; }
+        memory_float;
+static memory_float plus = { 1.0f };
+static memory_float minus = { -1.0f };
+int main ()
 {
-
-  ;
+  size_t j, k, i;
+  unsigned int m;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  /* Find the different bit.  */
+  k = 0; m = 0;
+  for (j = 0; j < NWORDS; j++)
+    {
+      unsigned int x = plus.word[j] ^ minus.word[j];
+      if ((x & (x - 1)) || (x && m))
+        {
+          /* More than one bit difference.  */
+          fprintf (fp, "unknown");
+          return 2;
+        }
+      if (x)
+        {
+          k = j;
+          m = x;
+        }
+    }
+  if (m == 0)
+    {
+      /* No difference.  */
+      fprintf (fp, "unknown");
+      return 3;
+    }
+  /* Now m = plus.word[k] ^ ~minus.word[k].  */
+  if (plus.word[k] & ~minus.word[k])
+    {
+      /* Oh? The sign bit is set in the positive and cleared in the negative
+         numbers?  */
+      fprintf (fp, "unknown");
+      return 4;
+    }
+  for (i = 0; ; i++)
+    if ((m >> i) & 1)
+      break;
+  fprintf (fp, "word %d bit %d", (int) k, (int) i);
+  if (fclose (fp) != 0)
+    return 5;
   return 0;
 }
+
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  fits_in_uint=0
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_cc_float_signbit=`cat conftest.out`
+else
+  gl_cv_cc_float_signbit="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        fi
-                                if test $fits_in_uint = 1; then
-          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
-        else
-          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
-        fi
-      else
-                gl_cv_size_max='((size_t)~(size_t)0)'
-      fi
-    fi
+
+      rm -f conftest.out
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5
-$as_echo "$gl_cv_size_max" >&6; }
-  if test "$gl_cv_size_max" != yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_signbit" >&5
+$as_echo "$gl_cv_cc_float_signbit" >&6; }
+  case "$gl_cv_cc_float_signbit" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word.*bit //'`
 
 cat >>confdefs.h <<_ACEOF
-#define SIZE_MAX $gl_cv_size_max
+#define FLT_SIGNBIT_WORD $word
 _ACEOF
 
-  fi
 
+cat >>confdefs.h <<_ACEOF
+#define FLT_SIGNBIT_BIT $bit
+_ACEOF
 
+      ;;
+  esac
 
 
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on directories" >&5
-$as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; }
-if test "${gl_cv_func_stat_dir_slash+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'double'" >&5
+$as_echo_n "checking where to find the sign bit in a 'double'... " >&6; }
+if ${gl_cv_cc_double_signbit+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  case $host_os in
-            mingw*) gl_cv_func_stat_dir_slash="guessing no";;
-            *) gl_cv_func_stat_dir_slash="guessing yes";;
-          esac
+
+      if test "$cross_compiling" = yes; then :
+
+                              gl_cv_cc_double_signbit="unknown"
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/stat.h>
 
-int
-main ()
+#include <stddef.h>
+#include <stdio.h>
+#define NWORDS \
+  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { double value; unsigned int word[NWORDS]; }
+        memory_float;
+static memory_float plus = { 1.0 };
+static memory_float minus = { -1.0 };
+int main ()
 {
-struct stat st; return stat (".", &st) != stat ("./", &st);
-  ;
+  size_t j, k, i;
+  unsigned int m;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  /* Find the different bit.  */
+  k = 0; m = 0;
+  for (j = 0; j < NWORDS; j++)
+    {
+      unsigned int x = plus.word[j] ^ minus.word[j];
+      if ((x & (x - 1)) || (x && m))
+        {
+          /* More than one bit difference.  */
+          fprintf (fp, "unknown");
+          return 2;
+        }
+      if (x)
+        {
+          k = j;
+          m = x;
+        }
+    }
+  if (m == 0)
+    {
+      /* No difference.  */
+      fprintf (fp, "unknown");
+      return 3;
+    }
+  /* Now m = plus.word[k] ^ ~minus.word[k].  */
+  if (plus.word[k] & ~minus.word[k])
+    {
+      /* Oh? The sign bit is set in the positive and cleared in the negative
+         numbers?  */
+      fprintf (fp, "unknown");
+      return 4;
+    }
+  for (i = 0; ; i++)
+    if ((m >> i) & 1)
+      break;
+  fprintf (fp, "word %d bit %d", (int) k, (int) i);
+  if (fclose (fp) != 0)
+    return 5;
   return 0;
 }
+
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_stat_dir_slash=yes
+  gl_cv_cc_double_signbit=`cat conftest.out`
 else
-  gl_cv_func_stat_dir_slash=no
+  gl_cv_cc_double_signbit="unknown"
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+      rm -f conftest.out
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_dir_slash" >&5
-$as_echo "$gl_cv_func_stat_dir_slash" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
-$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
-if test "${gl_cv_func_stat_file_slash+set}" = set; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_signbit" >&5
+$as_echo "$gl_cv_cc_double_signbit" >&6; }
+  case "$gl_cv_cc_double_signbit" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word.*bit //'`
+
+cat >>confdefs.h <<_ACEOF
+#define DBL_SIGNBIT_WORD $word
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define DBL_SIGNBIT_BIT $bit
+_ACEOF
+
+      ;;
+  esac
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'long double'" >&5
+$as_echo_n "checking where to find the sign bit in a 'long double'... " >&6; }
+if ${gl_cv_cc_long_double_signbit+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  touch conftest.tmp
-       # Assume that if we have lstat, we can also check symlinks.
-       if test $ac_cv_func_lstat = yes; then
-         ln -s conftest.tmp conftest.lnk
-       fi
-       if test "$cross_compiling" = yes; then :
-  gl_cv_func_stat_file_slash="guessing no"
+
+      if test "$cross_compiling" = yes; then :
+
+                              gl_cv_cc_long_double_signbit="unknown"
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/stat.h>
 
-int
-main ()
+#include <stddef.h>
+#include <stdio.h>
+#define NWORDS \
+  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { long double value; unsigned int word[NWORDS]; }
+        memory_float;
+static memory_float plus = { 1.0L };
+static memory_float minus = { -1.0L };
+int main ()
 {
-struct stat st;
-      if (!stat ("conftest.tmp/", &st)) return 1;
-#if HAVE_LSTAT
-      if (!stat ("conftest.lnk/", &st)) return 2;
-#endif
-
-  ;
+  size_t j, k, i;
+  unsigned int m;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  /* Find the different bit.  */
+  k = 0; m = 0;
+  for (j = 0; j < NWORDS; j++)
+    {
+      unsigned int x = plus.word[j] ^ minus.word[j];
+      if ((x & (x - 1)) || (x && m))
+        {
+          /* More than one bit difference.  */
+          fprintf (fp, "unknown");
+          return 2;
+        }
+      if (x)
+        {
+          k = j;
+          m = x;
+        }
+    }
+  if (m == 0)
+    {
+      /* No difference.  */
+      fprintf (fp, "unknown");
+      return 3;
+    }
+  /* Now m = plus.word[k] ^ ~minus.word[k].  */
+  if (plus.word[k] & ~minus.word[k])
+    {
+      /* Oh? The sign bit is set in the positive and cleared in the negative
+         numbers?  */
+      fprintf (fp, "unknown");
+      return 4;
+    }
+  for (i = 0; ; i++)
+    if ((m >> i) & 1)
+      break;
+  fprintf (fp, "word %d bit %d", (int) k, (int) i);
+  if (fclose (fp) != 0)
+    return 5;
   return 0;
 }
+
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_stat_file_slash=yes
+  gl_cv_cc_long_double_signbit=`cat conftest.out`
 else
-  gl_cv_func_stat_file_slash=no
+  gl_cv_cc_long_double_signbit="unknown"
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-       rm -f conftest.tmp conftest.lnk
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
-$as_echo "$gl_cv_func_stat_file_slash" >&6; }
-  case $gl_cv_func_stat_dir_slash in
-    *no) REPLACE_STAT=1
-
-$as_echo "#define REPLACE_FUNC_STAT_DIR 1" >>confdefs.h
-;;
-  esac
-  case $gl_cv_func_stat_file_slash in
-    *no) REPLACE_STAT=1
-
-$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
-;;
-  esac
-  if test $REPLACE_STAT = 1; then
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
-
-
-  fi
-
-
+      rm -f conftest.out
 
-  GNULIB_STAT=1
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_signbit" >&5
+$as_echo "$gl_cv_cc_long_double_signbit" >&6; }
+  case "$gl_cv_cc_long_double_signbit" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word.*bit //'`
 
+cat >>confdefs.h <<_ACEOF
+#define LDBL_SIGNBIT_WORD $word
+_ACEOF
 
 
+cat >>confdefs.h <<_ACEOF
+#define LDBL_SIGNBIT_BIT $bit
+_ACEOF
 
+      ;;
+  esac
 
 
-  ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h>
-     #include <sys/stat.h>
+          if test "$gl_cv_cc_float_signbit" = unknown; then
+                        ac_fn_c_check_decl "$LINENO" "copysignf" "ac_cv_have_decl_copysignf" "#include <math.h>
 "
-if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = x""yes; then :
+if test "x$ac_cv_have_decl_copysignf" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
+#define HAVE_DECL_COPYSIGNF $ac_have_decl
 _ACEOF
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
-$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
-if test "${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+set}" = set; then :
+            if test "$ac_cv_have_decl_copysignf" = yes; then
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignf can be used without linking with libm" >&5
+$as_echo_n "checking whether copysignf can be used without linking with libm... " >&6; }
+if ${gl_cv_func_copysignf_no_libm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-            #include <sys/types.h>
-            #include <sys/stat.h>
-            #if HAVE_SYS_TIME_H
-            # include <sys/time.h>
-            #endif
-            #include <time.h>
-            struct timespec ts;
-            struct stat st;
 
+                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+                         float x, y;
 int
 main ()
 {
-
-            st.st_atim = ts;
-
+return copysignf (x, y) < 0;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func_copysignf_no_libm=yes
 else
-  ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
+  gl_cv_func_copysignf_no_libm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
-$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
-     if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignf_no_libm" >&5
+$as_echo "$gl_cv_func_copysignf_no_libm" >&6; }
+              if test $gl_cv_func_copysignf_no_libm = yes; then
 
-$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
+$as_echo "#define HAVE_COPYSIGNF_IN_LIBC 1" >>confdefs.h
 
-     fi
-else
-  ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h>
-        #include <sys/stat.h>
+              fi
+            fi
+          fi
+          if test "$gl_cv_cc_double_signbit" = unknown; then
+                        ac_fn_c_check_decl "$LINENO" "copysign" "ac_cv_have_decl_copysign" "#include <math.h>
 "
-if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = x""yes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
-_ACEOF
-
-
+if test "x$ac_cv_have_decl_copysign" = xyes; then :
+  ac_have_decl=1
 else
-  ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
-           #include <sys/stat.h>
-"
-if test "x$ac_cv_member_struct_stat_st_atimensec" = x""yes; then :
+  ac_have_decl=0
+fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
+#define HAVE_DECL_COPYSIGN $ac_have_decl
 _ACEOF
 
-
+            if test "$ac_cv_have_decl_copysign" = yes; then
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysign can be used without linking with libm" >&5
+$as_echo_n "checking whether copysign can be used without linking with libm... " >&6; }
+if ${gl_cv_func_copysign_no_libm+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h>
-              #include <sys/stat.h>
-"
-if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = x""yes; then :
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
+                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+                         double x, y;
+int
+main ()
+{
+return copysign (x, y) < 0;
+  ;
+  return 0;
+}
 _ACEOF
-
-
-fi
-
-fi
-
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func_copysign_no_libm=yes
+else
+  gl_cv_func_copysign_no_libm=no
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysign_no_libm" >&5
+$as_echo "$gl_cv_func_copysign_no_libm" >&6; }
+              if test $gl_cv_func_copysign_no_libm = yes; then
 
+$as_echo "#define HAVE_COPYSIGN_IN_LIBC 1" >>confdefs.h
 
-
-
-
-
-  ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h>
-     #include <sys/stat.h>
-"
-if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = x""yes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
-_ACEOF
-
-
-else
-  ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
-        #include <sys/stat.h>
+              fi
+            fi
+          fi
+          if test "$gl_cv_cc_long_double_signbit" = unknown; then
+                        ac_fn_c_check_decl "$LINENO" "copysignl" "ac_cv_have_decl_copysignl" "#include <math.h>
 "
-if test "x$ac_cv_member_struct_stat_st_birthtimensec" = x""yes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
-_ACEOF
-
-
+if test "x$ac_cv_have_decl_copysignl" = xyes; then :
+  ac_have_decl=1
 else
-  ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include <sys/types.h>
-          #include <sys/stat.h>
-"
-if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = x""yes; then :
+  ac_have_decl=0
+fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
+#define HAVE_DECL_COPYSIGNL $ac_have_decl
 _ACEOF
 
-
-fi
-
-fi
-
-fi
-
-
-
-
-
-  # Define two additional variables used in the Makefile substitution.
-
-  if test "$ac_cv_header_stdbool_h" = yes; then
-    STDBOOL_H=''
-  else
-    STDBOOL_H='stdbool.h'
-  fi
-
-
-  if test "$ac_cv_type__Bool" = yes; then
-    HAVE__BOOL=1
-  else
-    HAVE__BOOL=0
-  fi
-
-
-
-
-
-  if test $gt_cv_c_wchar_t = no; then
-    HAVE_WCHAR_T=0
-    STDDEF_H=stddef.h
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
-$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
-if test "${gl_cv_decl_null_works+set}" = set; then :
+            if test "$ac_cv_have_decl_copysignl" = yes; then
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignl can be used without linking with libm" >&5
+$as_echo_n "checking whether copysignl can be used without linking with libm... " >&6; }
+if ${gl_cv_func_copysignl_no_libm+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stddef.h>
-      int test[2 * (sizeof NULL == sizeof (void *)) -1];
 
+                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+                         long double x, y;
 int
 main ()
 {
-
+return copysignl (x, y) < 0;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_decl_null_works=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  gl_cv_func_copysignl_no_libm=yes
 else
-  gl_cv_decl_null_works=no
+  gl_cv_func_copysignl_no_libm=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
-$as_echo "$gl_cv_decl_null_works" >&6; }
-  if test $gl_cv_decl_null_works = no; then
-    REPLACE_NULL=1
-    STDDEF_H=stddef.h
-  fi
-  if test -n "$STDDEF_H"; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignl_no_libm" >&5
+$as_echo "$gl_cv_func_copysignl_no_libm" >&6; }
+              if test $gl_cv_func_copysignl_no_libm = yes; then
 
+$as_echo "#define HAVE_COPYSIGNL_IN_LIBC 1" >>confdefs.h
 
+              fi
+            fi
+          fi
+          ;;
+      esac
+      ;;
+  esac
 
+if test $REPLACE_SIGNBIT = 1; then
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_stddef_h='<'stddef.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
-$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
-if test "${gl_cv_next_stddef_h+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-          if test $ac_cv_header_stddef_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stddef.h>
 
-_ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/stddef.h#{
-                 s#.*"\(.*/stddef.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_stddef_h='<'stddef.h'>'
-          fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
-$as_echo "$gl_cv_next_stddef_h" >&6; }
-     fi
-     NEXT_STDDEF_H=$gl_cv_next_stddef_h
 
-     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
-       gl_next_as_first_directive='<'stddef.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_stddef_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
 
+  gl_LIBOBJS="$gl_LIBOBJS signbitf.$ac_objext"
 
 
-  fi
 
 
 
 
-  if test $ac_cv_type_long_long_int = yes; then
-    HAVE_LONG_LONG_INT=1
-  else
-    HAVE_LONG_LONG_INT=0
-  fi
 
 
-  if test $ac_cv_type_unsigned_long_long_int = yes; then
-    HAVE_UNSIGNED_LONG_LONG_INT=1
-  else
-    HAVE_UNSIGNED_LONG_LONG_INT=0
-  fi
 
+  gl_LIBOBJS="$gl_LIBOBJS signbitd.$ac_objext"
 
-      if test $ac_cv_header_inttypes_h = yes; then
-    HAVE_INTTYPES_H=1
-  else
-    HAVE_INTTYPES_H=0
-  fi
 
 
-      if test $ac_cv_header_sys_types_h = yes; then
-    HAVE_SYS_TYPES_H=1
-  else
-    HAVE_SYS_TYPES_H=0
-  fi
 
 
 
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS signbitl.$ac_objext"
 
+fi
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_stdint_h='<'stdint.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
-$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
-if test "${gl_cv_next_stdint_h+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
 
-          if test $ac_cv_header_stdint_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdint.h>
 
-_ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_stdint_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/stdint.h#{
-                 s#.*"\(.*/stdint.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_stdint_h='<'stdint.h'>'
-          fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
-$as_echo "$gl_cv_next_stdint_h" >&6; }
-     fi
-     NEXT_STDINT_H=$gl_cv_next_stdint_h
 
-     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
-       gl_next_as_first_directive='<'stdint.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_stdint_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
+          GNULIB_SIGNBIT=1
 
 
 
-  if test $ac_cv_header_stdint_h = yes; then
-    HAVE_STDINT_H=1
-  else
-    HAVE_STDINT_H=0
-  fi
 
 
-    if test $ac_cv_header_stdint_h = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
-$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
-if test "${gl_cv_header_working_stdint_h+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  gl_cv_header_working_stdint_h=no
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+$as_echo "#define GNULIB_TEST_SIGNBIT 1" >>confdefs.h
 
 
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
-#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
-#include <stdint.h>
-/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
-#if !(defined WCHAR_MIN && defined WCHAR_MAX)
-#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
-#endif
 
 
-  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-     included before <wchar.h>.  */
-  #include <stddef.h>
-  #include <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
+  for ac_header in stdint.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdint_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDINT_H 1
+_ACEOF
 
+fi
 
-#ifdef INT8_MAX
-int8_t a1 = INT8_MAX;
-int8_t a1min = INT8_MIN;
-#endif
-#ifdef INT16_MAX
-int16_t a2 = INT16_MAX;
-int16_t a2min = INT16_MIN;
-#endif
-#ifdef INT32_MAX
-int32_t a3 = INT32_MAX;
-int32_t a3min = INT32_MIN;
-#endif
-#ifdef INT64_MAX
-int64_t a4 = INT64_MAX;
-int64_t a4min = INT64_MIN;
-#endif
-#ifdef UINT8_MAX
-uint8_t b1 = UINT8_MAX;
-#else
-typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
-#endif
-#ifdef UINT16_MAX
-uint16_t b2 = UINT16_MAX;
-#endif
-#ifdef UINT32_MAX
-uint32_t b3 = UINT32_MAX;
-#endif
-#ifdef UINT64_MAX
-uint64_t b4 = UINT64_MAX;
-#endif
-int_least8_t c1 = INT8_C (0x7f);
-int_least8_t c1max = INT_LEAST8_MAX;
-int_least8_t c1min = INT_LEAST8_MIN;
-int_least16_t c2 = INT16_C (0x7fff);
-int_least16_t c2max = INT_LEAST16_MAX;
-int_least16_t c2min = INT_LEAST16_MIN;
-int_least32_t c3 = INT32_C (0x7fffffff);
-int_least32_t c3max = INT_LEAST32_MAX;
-int_least32_t c3min = INT_LEAST32_MIN;
-int_least64_t c4 = INT64_C (0x7fffffffffffffff);
-int_least64_t c4max = INT_LEAST64_MAX;
-int_least64_t c4min = INT_LEAST64_MIN;
-uint_least8_t d1 = UINT8_C (0xff);
-uint_least8_t d1max = UINT_LEAST8_MAX;
-uint_least16_t d2 = UINT16_C (0xffff);
-uint_least16_t d2max = UINT_LEAST16_MAX;
-uint_least32_t d3 = UINT32_C (0xffffffff);
-uint_least32_t d3max = UINT_LEAST32_MAX;
-uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
-uint_least64_t d4max = UINT_LEAST64_MAX;
-int_fast8_t e1 = INT_FAST8_MAX;
-int_fast8_t e1min = INT_FAST8_MIN;
-int_fast16_t e2 = INT_FAST16_MAX;
-int_fast16_t e2min = INT_FAST16_MIN;
-int_fast32_t e3 = INT_FAST32_MAX;
-int_fast32_t e3min = INT_FAST32_MIN;
-int_fast64_t e4 = INT_FAST64_MAX;
-int_fast64_t e4min = INT_FAST64_MIN;
-uint_fast8_t f1 = UINT_FAST8_MAX;
-uint_fast16_t f2 = UINT_FAST16_MAX;
-uint_fast32_t f3 = UINT_FAST32_MAX;
-uint_fast64_t f4 = UINT_FAST64_MAX;
-#ifdef INTPTR_MAX
-intptr_t g = INTPTR_MAX;
-intptr_t gmin = INTPTR_MIN;
-#endif
-#ifdef UINTPTR_MAX
-uintptr_t h = UINTPTR_MAX;
-#endif
-intmax_t i = INTMAX_MAX;
-uintmax_t j = UINTMAX_MAX;
+done
 
-#include <limits.h> /* for CHAR_BIT */
-#define TYPE_MINIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
-#define TYPE_MAXIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
-struct s {
-  int check_PTRDIFF:
-      PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
-      && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
-      ? 1 : -1;
-  /* Detect bug in FreeBSD 6.0 / ia64.  */
-  int check_SIG_ATOMIC:
-      SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
-      && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
-      ? 1 : -1;
-  int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
-  int check_WCHAR:
-      WCHAR_MIN == TYPE_MINIMUM (wchar_t)
-      && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
-      ? 1 : -1;
-  /* Detect bug in mingw.  */
-  int check_WINT:
-      WINT_MIN == TYPE_MINIMUM (wint_t)
-      && WINT_MAX == TYPE_MAXIMUM (wint_t)
-      ? 1 : -1;
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5
+$as_echo_n "checking for SIZE_MAX... " >&6; }
+if ${gl_cv_size_max+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
 
-  /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others.  */
-  int check_UINT8_C:
-        (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
-  int check_UINT16_C:
-        (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
+    gl_cv_size_max=
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  /* Detect bugs in OpenBSD 3.9 stdint.h.  */
-#ifdef UINT8_MAX
-  int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
-#endif
-#ifdef UINT16_MAX
-  int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
-#endif
-#ifdef UINT32_MAX
-  int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
+#include <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
 #endif
-#ifdef UINT64_MAX
-  int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
+#ifdef SIZE_MAX
+Found it
 #endif
-  int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
-  int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
-  int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
-  int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
-  int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
-  int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
-  int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
-  int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
-  int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
-  int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
-  int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
-};
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Found it" >/dev/null 2>&1; then :
+  gl_cv_size_max=yes
+fi
+rm -f conftest*
+
+    if test -z "$gl_cv_size_max"; then
+                        if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1"        "#include <stddef.h>
+#include <limits.h>"; then :
+
+else
+  size_t_bits_minus_1=
+fi
+
+      if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint"        "#include <stddef.h>"; then :
+
+else
+  fits_in_uint=
+fi
+
+      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+        if test $fits_in_uint = 1; then
+                              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stddef.h>
+                 extern size_t foo;
+                 extern unsigned long foo;
 
 int
 main ()
@@ -20239,398 +25339,385 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-                                                    if test "$cross_compiling" = yes; then :
-                 gl_cv_header_working_stdint_h=yes
+  fits_in_uint=0
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        fi
+                                if test $fits_in_uint = 1; then
+          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+        else
+          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+        fi
+      else
+                gl_cv_size_max='((size_t)~(size_t)0)'
+      fi
+    fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5
+$as_echo "$gl_cv_size_max" >&6; }
+  if test "$gl_cv_size_max" != yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define SIZE_MAX $gl_cv_size_max
+_ACEOF
+
+  fi
 
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
+$as_echo_n "checking for ssize_t... " >&6; }
+if ${gt_cv_ssize_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <sys/types.h>
+int
+main ()
+{
+int x = sizeof (ssize_t *) + sizeof (ssize_t);
+            return !x;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gt_cv_ssize_t=yes
+else
+  gt_cv_ssize_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
+$as_echo "$gt_cv_ssize_t" >&6; }
+  if test $gt_cv_ssize_t = no; then
 
+$as_echo "#define ssize_t int" >>confdefs.h
 
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
-#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
-#include <stdint.h>
+  fi
 
 
-  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-     included before <wchar.h>.  */
-  #include <stddef.h>
-  #include <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
 
 
-#include <stdio.h>
-#include <string.h>
-#define MVAL(macro) MVAL1(macro)
-#define MVAL1(expression) #expression
-static const char *macro_values[] =
-  {
-#ifdef INT8_MAX
-    MVAL (INT8_MAX),
-#endif
-#ifdef INT16_MAX
-    MVAL (INT16_MAX),
-#endif
-#ifdef INT32_MAX
-    MVAL (INT32_MAX),
-#endif
-#ifdef INT64_MAX
-    MVAL (INT64_MAX),
-#endif
-#ifdef UINT8_MAX
-    MVAL (UINT8_MAX),
-#endif
-#ifdef UINT16_MAX
-    MVAL (UINT16_MAX),
-#endif
-#ifdef UINT32_MAX
-    MVAL (UINT32_MAX),
-#endif
-#ifdef UINT64_MAX
-    MVAL (UINT64_MAX),
-#endif
-    NULL
-  };
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on directories" >&5
+$as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; }
+if ${gl_cv_func_stat_dir_slash+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  case $host_os in
+            mingw*) gl_cv_func_stat_dir_slash="guessing no";;
+            *) gl_cv_func_stat_dir_slash="guessing yes";;
+          esac
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/stat.h>
 
 int
 main ()
 {
-
-  const char **mv;
-  for (mv = macro_values; *mv != NULL; mv++)
-    {
-      const char *value = *mv;
-      /* Test whether it looks like a cast expression.  */
-      if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
-          || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
-          || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
-          || strncmp (value, "((int)"/*)*/, 6) == 0
-          || strncmp (value, "((signed short)"/*)*/, 15) == 0
-          || strncmp (value, "((signed char)"/*)*/, 14) == 0)
-        return 1;
-    }
-  return 0;
-
+struct stat st; return stat (".", &st) != stat ("./", &st);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_header_working_stdint_h=yes
+  gl_cv_func_stat_dir_slash=yes
+else
+  gl_cv_func_stat_dir_slash=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_dir_slash" >&5
+$as_echo "$gl_cv_func_stat_dir_slash" >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
+$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
+if ${gl_cv_func_stat_file_slash+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  touch conftest.tmp
+       # Assume that if we have lstat, we can also check symlinks.
+       if test $ac_cv_func_lstat = yes; then
+         ln -s conftest.tmp conftest.lnk
+       fi
+       if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+                    # Guess yes on glibc systems.
+            *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
+                    # If we don't know, assume the worst.
+            *)      gl_cv_func_stat_file_slash="guessing no" ;;
+          esac
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
-$as_echo "$gl_cv_header_working_stdint_h" >&6; }
-  fi
-  if test "$gl_cv_header_working_stdint_h" = yes; then
-    STDINT_H=
-  else
-            for ac_header in sys/inttypes.h sys/bitypes.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/stat.h>
+
+int
+main ()
+{
+int result = 0;
+      struct stat st;
+      if (!stat ("conftest.tmp/", &st))
+        result |= 1;
+#if HAVE_LSTAT
+      if (!stat ("conftest.lnk/", &st))
+        result |= 2;
+#endif
+      return result;
+
+  ;
+  return 0;
+}
 _ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_stat_file_slash=yes
+else
+  gl_cv_func_stat_file_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+       rm -f conftest.tmp conftest.lnk
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
+$as_echo "$gl_cv_func_stat_file_slash" >&6; }
+  case $gl_cv_func_stat_dir_slash in
+    *no) REPLACE_STAT=1
 
-done
+$as_echo "#define REPLACE_FUNC_STAT_DIR 1" >>confdefs.h
+;;
+  esac
+  case $gl_cv_func_stat_file_slash in
+    *no) REPLACE_STAT=1
 
-    if test $ac_cv_header_sys_inttypes_h = yes; then
-      HAVE_SYS_INTTYPES_H=1
-    else
-      HAVE_SYS_INTTYPES_H=0
-    fi
+$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
+;;
+  esac
 
-    if test $ac_cv_header_sys_bitypes_h = yes; then
-      HAVE_SYS_BITYPES_H=1
-    else
-      HAVE_SYS_BITYPES_H=0
-    fi
+if test $REPLACE_STAT = 1; then
 
 
 
 
 
 
-  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
 
-  for gltype in ptrdiff_t size_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
-$as_echo_n "checking for bit size of $gltype... " >&6; }
-if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result"        "
-  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-     included before <wchar.h>.  */
-  #include <stddef.h>
-  #include <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
+  gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext"
 
-#include <limits.h>"; then :
 
-else
-  result=unknown
-fi
 
-       eval gl_cv_bitsizeof_${gltype}=\$result
+  :
 
 fi
-eval ac_res=\$gl_cv_bitsizeof_${gltype}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    eval result=\$gl_cv_bitsizeof_${gltype}
-    if test $result = unknown; then
-                                                result=0
-    fi
-    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    cat >>confdefs.h <<_ACEOF
-#define BITSIZEOF_${GLTYPE} $result
-_ACEOF
 
-    eval BITSIZEOF_${GLTYPE}=\$result
-  done
 
 
-  fi
 
 
-  for gltype in sig_atomic_t wchar_t wint_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
-$as_echo_n "checking for bit size of $gltype... " >&6; }
-if { as_var=gl_cv_bitsizeof_${gltype}; eval "test \"\${$as_var+set}\" = set"; }; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result"        "
-  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-     included before <wchar.h>.  */
-  #include <stddef.h>
-  #include <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
+          GNULIB_STAT=1
+
+
+
+
 
-#include <limits.h>"; then :
+$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
 
-else
-  result=unknown
-fi
 
-       eval gl_cv_bitsizeof_${gltype}=\$result
 
-fi
-eval ac_res=\$gl_cv_bitsizeof_${gltype}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    eval result=\$gl_cv_bitsizeof_${gltype}
-    if test $result = unknown; then
-                                                result=0
-    fi
-    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    cat >>confdefs.h <<_ACEOF
-#define BITSIZEOF_${GLTYPE} $result
-_ACEOF
 
-    eval BITSIZEOF_${GLTYPE}=\$result
-  done
 
 
 
 
-  for gltype in sig_atomic_t wchar_t wint_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
-$as_echo_n "checking whether $gltype is signed... " >&6; }
-if { as_var=gl_cv_type_${gltype}_signed; eval "test \"\${$as_var+set}\" = set"; }; then :
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h>
+     #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1
+_ACEOF
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
+$as_echo_n "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
+if ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-     included before <wchar.h>.  */
-  #include <stddef.h>
-  #include <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
+            #include <sys/types.h>
+            #include <sys/stat.h>
+            #if HAVE_SYS_TIME_H
+            # include <sys/time.h>
+            #endif
+            #include <time.h>
+            struct timespec ts;
+            struct stat st;
 
-            int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
 int
 main ()
 {
 
+            st.st_atim = ts;
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  result=yes
+  ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
 else
-  result=no
+  ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-       eval gl_cv_type_${gltype}_signed=\$result
-
 fi
-eval ac_res=\$gl_cv_type_${gltype}_signed
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    eval result=\$gl_cv_type_${gltype}_signed
-    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    if test "$result" = yes; then
-      cat >>confdefs.h <<_ACEOF
-#define HAVE_SIGNED_${GLTYPE} 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
+$as_echo "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
+     if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
 
-      eval HAVE_SIGNED_${GLTYPE}=1
-    else
-      eval HAVE_SIGNED_${GLTYPE}=0
-    fi
-  done
+$as_echo "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
 
+     fi
+else
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h>
+        #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then :
 
-  gl_cv_type_ptrdiff_t_signed=yes
-  gl_cv_type_size_t_signed=no
-  if test $APPLE_UNIVERSAL_BUILD = 0; then
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1
+_ACEOF
 
 
-  for gltype in ptrdiff_t size_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
-$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
-if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then :
-  $as_echo_n "(cached) " >&6
 else
-  eval gl_cv_type_${gltype}_suffix=no
-       eval result=\$gl_cv_type_${gltype}_signed
-       if test "$result" = yes; then
-         glsufu=
-       else
-         glsufu=u
-       fi
-       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
-         case $glsuf in
-           '')  gltype1='int';;
-           l)   gltype1='long int';;
-           ll)  gltype1='long long int';;
-           i64) gltype1='__int64';;
-           u)   gltype1='unsigned int';;
-           ul)  gltype1='unsigned long int';;
-           ull) gltype1='unsigned long long int';;
-           ui64)gltype1='unsigned __int64';;
-         esac
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
+           #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then :
 
-  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-     included before <wchar.h>.  */
-  #include <stddef.h>
-  #include <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1
+_ACEOF
 
-              extern $gltype foo;
-              extern $gltype1 foo;
-int
-main ()
-{
 
-  ;
-  return 0;
-}
+else
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h>
+              #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval gl_cv_type_${gltype}_suffix=\$glsuf
+
+
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         eval result=\$gl_cv_type_${gltype}_suffix
-         test "$result" != no && break
-       done
+
 fi
-eval ac_res=\$gl_cv_type_${gltype}_suffix
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    eval result=\$gl_cv_type_${gltype}_suffix
-    test "$result" = no && result=
-    eval ${GLTYPE}_SUFFIX=\$result
-    cat >>confdefs.h <<_ACEOF
-#define ${GLTYPE}_SUFFIX $result
+
+fi
+
+fi
+
+
+
+
+
+
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h>
+     #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
 _ACEOF
 
-  done
 
+else
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
+        #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes; then :
 
-  fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1
+_ACEOF
 
 
-  for gltype in sig_atomic_t wchar_t wint_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
-$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
-if { as_var=gl_cv_type_${gltype}_suffix; eval "test \"\${$as_var+set}\" = set"; }; then :
-  $as_echo_n "(cached) " >&6
 else
-  eval gl_cv_type_${gltype}_suffix=no
-       eval result=\$gl_cv_type_${gltype}_signed
-       if test "$result" = yes; then
-         glsufu=
-       else
-         glsufu=u
-       fi
-       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
-         case $glsuf in
-           '')  gltype1='int';;
-           l)   gltype1='long int';;
-           ll)  gltype1='long long int';;
-           i64) gltype1='__int64';;
-           u)   gltype1='unsigned int';;
-           ul)  gltype1='unsigned long int';;
-           ull) gltype1='unsigned long long int';;
-           ui64)gltype1='unsigned __int64';;
-         esac
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include <sys/types.h>
+          #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1
+_ACEOF
+
+
+fi
+
+fi
+
+fi
+
+
+
+
+
+  # Define two additional variables used in the Makefile substitution.
+
+  if test "$ac_cv_header_stdbool_h" = yes; then
+    STDBOOL_H=''
+  else
+    STDBOOL_H='stdbool.h'
+  fi
+
+   if test -n "$STDBOOL_H"; then
+  GL_GENERATE_STDBOOL_H_TRUE=
+  GL_GENERATE_STDBOOL_H_FALSE='#'
+else
+  GL_GENERATE_STDBOOL_H_TRUE='#'
+  GL_GENERATE_STDBOOL_H_FALSE=
+fi
+
 
-  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
-     included before <wchar.h>.  */
-  #include <stddef.h>
-  #include <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
+  if test "$ac_cv_type__Bool" = yes; then
+    HAVE__BOOL=1
+  else
+    HAVE__BOOL=0
+  fi
+
+
+
+
+
+  STDDEF_H=
+  if test $gt_cv_c_wchar_t = no; then
+    HAVE_WCHAR_T=0
+    STDDEF_H=stddef.h
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
+$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
+if ${gl_cv_decl_null_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stddef.h>
+      int test[2 * (sizeof NULL == sizeof (void *)) -1];
 
-              extern $gltype foo;
-              extern $gltype1 foo;
 int
 main ()
 {
@@ -20640,29 +25727,95 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  eval gl_cv_type_${gltype}_suffix=\$glsuf
+  gl_cv_decl_null_works=yes
+else
+  gl_cv_decl_null_works=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         eval result=\$gl_cv_type_${gltype}_suffix
-         test "$result" != no && break
-       done
 fi
-eval ac_res=\$gl_cv_type_${gltype}_suffix
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    eval result=\$gl_cv_type_${gltype}_suffix
-    test "$result" = no && result=
-    eval ${GLTYPE}_SUFFIX=\$result
-    cat >>confdefs.h <<_ACEOF
-#define ${GLTYPE}_SUFFIX $result
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
+$as_echo "$gl_cv_decl_null_works" >&6; }
+  if test $gl_cv_decl_null_works = no; then
+    REPLACE_NULL=1
+    STDDEF_H=stddef.h
+  fi
+
+   if test -n "$STDDEF_H"; then
+  GL_GENERATE_STDDEF_H_TRUE=
+  GL_GENERATE_STDDEF_H_FALSE='#'
+else
+  GL_GENERATE_STDDEF_H_TRUE='#'
+  GL_GENERATE_STDDEF_H_FALSE=
+fi
+
+  if test -n "$STDDEF_H"; then
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_stddef_h='<'stddef.h'>'
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
+$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
+if ${gl_cv_next_stddef_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stddef.h>
+
 _ACEOF
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'stddef.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_stddef_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
+$as_echo "$gl_cv_next_stddef_h" >&6; }
+     fi
+     NEXT_STDDEF_H=$gl_cv_next_stddef_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'stddef.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_stddef_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
 
-  done
 
 
 
-    STDINT_H=stdint.h
   fi
 
 
@@ -20675,35 +25828,48 @@ _ACEOF
 
 
 
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_stdio_h='<'stdio.h'>'
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
 $as_echo_n "checking absolute name of <stdio.h>... " >&6; }
-if test "${gl_cv_next_stdio_h+set}" = set; then :
+if ${gl_cv_next_stdio_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_stdio_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/stdio.h#{
-                 s#.*"\(.*/stdio.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_stdio_h='<'stdio.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'stdio.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_stdio_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
@@ -20722,6 +25888,17 @@ $as_echo "$gl_cv_next_stdio_h" >&6; }
 
 
 
+
+
+      GNULIB_FSCANF=1
+  GNULIB_SCANF=1
+  GNULIB_FGETC=1
+  GNULIB_GETC=1
+  GNULIB_GETCHAR=1
+  GNULIB_FGETS=1
+  GNULIB_FREAD=1
+
+
       GNULIB_FPRINTF=1
   GNULIB_PRINTF=1
   GNULIB_VFPRINTF=1
@@ -20735,11 +25912,12 @@ $as_echo "$gl_cv_next_stdio_h" >&6; }
 
 
 
-    for gl_func in fseeko ftello; do
+
+    for gl_func in dprintf fpurge fseeko ftello getdelim getline gets pclose popen     renameat snprintf tmpfile vdprintf vsnprintf; do
     as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
-if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$as_gl_Symbol+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -20765,8 +25943,7 @@ fi
 eval ac_res=\$$as_gl_Symbol
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-     eval as_val=\$$as_gl_Symbol
-   if test "x$as_val" = x""yes; then :
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
 _ACEOF
 
 
 
+
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_stdlib_h='<'stdlib.h'>'
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
 $as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
-if test "${gl_cv_next_stdlib_h+set}" = set; then :
+if ${gl_cv_next_stdlib_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_stdlib_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/stdlib.h#{
-                 s#.*"\(.*/stdlib.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_stdlib_h='<'stdlib.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'stdlib.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_stdlib_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
@@ -20831,59 +26021,197 @@ $as_echo "$gl_cv_next_stdlib_h" >&6; }
 
 
 
-  for ac_header in random.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "random.h" "ac_cv_header_random_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_random_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_RANDOM_H 1
-_ACEOF
 
-fi
 
-done
 
-  if test $ac_cv_header_random_h = yes; then
-    HAVE_RANDOM_H=1
-  else
-    HAVE_RANDOM_H=0
-  fi
+    for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt     initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps     posix_openpt ptsname ptsname_r random random_r realpath rpmatch     setenv setstate setstate_r srandom srandom_r     strtod strtoll strtoull unlockpt unsetenv; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#if HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+#endif
+#if HAVE_RANDOM_H
+# include <random.h>
+#endif
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
+else
+  eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+      done
+
+
+
+
+
+
+  if test $ac_cv_func_strdup = yes; then
+    if test $gl_cv_func_malloc_posix != yes; then
+      REPLACE_STRDUP=1
+    fi
+  fi
+
+  if test $ac_cv_have_decl_strdup = no; then
+    HAVE_DECL_STRDUP=0
+  fi
+
+if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext"
+
+  :
+fi
+
+
+
+
+
+          GNULIB_STRDUP=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+  if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
+$as_echo_n "checking for working strerror function... " >&6; }
+if ${gl_cv_func_working_strerror+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_working_strerror="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_working_strerror="guessing no" ;;
+         esac
+
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+int
+main ()
+{
+if (!*strerror (-2)) return 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  gl_cv_func_working_strerror=yes
+else
+  gl_cv_func_working_strerror=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
+$as_echo "$gl_cv_func_working_strerror" >&6; }
+    case "$gl_cv_func_working_strerror" in
+      *yes) ;;
+      *)
+                        REPLACE_STRERROR=1
+        ;;
+    esac
+
+                  case "$gl_cv_func_strerror_r_works" in
+        *no) REPLACE_STRERROR=1 ;;
+      esac
+
+  else
+            REPLACE_STRERROR=1
+  fi
+
+if test $REPLACE_STRERROR = 1; then
+
+
+
+
 
-  ac_fn_c_check_type "$LINENO" "struct random_data" "ac_cv_type_struct_random_data" "#include <stdlib.h>
-      #if HAVE_RANDOM_H
-      # include <random.h>
-      #endif
 
-"
-if test "x$ac_cv_type_struct_random_data" = x""yes; then :
+
+
+  gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext"
+
+fi
+
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_RANDOM_DATA 1
+#define GNULIB_STRERROR 1
 _ACEOF
 
 
-else
-  HAVE_STRUCT_RANDOM_DATA=0
-fi
 
 
 
 
 
-  if test $gl_cv_func_malloc_posix != yes; then
-    REPLACE_STRDUP=1
+          GNULIB_STRERROR=1
 
 
 
 
 
+$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext"
 
-  else
+
+if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
+
 
 
 
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS strerror-override.$ac_objext"
 
-  for ac_func in strdup
+
+
+
+
+  if test $ac_cv_header_sys_socket_h != yes; then
+                    for ac_header in winsock2.h
 do :
-  ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup"
-if test "x$ac_cv_func_strdup" = x""yes; then :
+  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_STRDUP 1
+#define HAVE_WINSOCK2_H 1
 _ACEOF
 
-else
+fi
+
+done
+
+  fi
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    HAVE_WINSOCK2_H=1
+    UNISTD_H_HAVE_WINSOCK2_H=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+  else
+    HAVE_WINSOCK2_H=0
+  fi
 
-    gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
 
 fi
-done
 
 
+
+
+
+
+
+  if test $ac_cv_have_decl_strerror_r = no; then
+    HAVE_DECL_STRERROR_R=0
   fi
 
-  if test $ac_cv_have_decl_strdup = no; then
-    HAVE_DECL_STRDUP=0
+  if test $ac_cv_func_strerror_r = yes; then
+    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+      if test $gl_cv_func_strerror_r_posix_signature = yes; then
+        case "$gl_cv_func_strerror_r_works" in
+                    *no) REPLACE_STRERROR_R=1 ;;
+        esac
+      else
+                REPLACE_STRERROR_R=1
+      fi
+    else
+                  REPLACE_STRERROR_R=1
+    fi
   fi
-  :
 
+if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
 
 
-  GNULIB_STRDUP=1
 
 
 
-  if test $REPLACE_STRERROR = 1; then
 
 
 
+  gl_LIBOBJS="$gl_LIBOBJS strerror_r.$ac_objext"
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS strerror.$ac_objext"
+
+fi
 
 
-cat >>confdefs.h <<_ACEOF
-#define REPLACE_STRERROR $REPLACE_STRERROR
-_ACEOF
 
-  fi
+
+
+          GNULIB_STRERROR_R=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h
+
+
 
 
 
-  GNULIB_STRERROR=1
 
 
 
@@ -20964,30 +26330,47 @@ _ACEOF
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
 $as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
-if test "${gl_cv_next_sys_stat_h+set}" = set; then :
+if ${gl_cv_next_sys_stat_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_sys_stat_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+             if test $ac_cv_header_sys_stat_h = yes; then
+
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/stat.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/sys/stat.h#{
-                 s#.*"\(.*/sys/stat.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'sys/stat.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_sys_stat_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
-            gl_cv_next_sys_stat_h='<'sys/stat.h'>'
-          fi
+               gl_cv_next_sys_stat_h='<'sys/stat.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
@@ -21007,10 +26390,23 @@ $as_echo "$gl_cv_next_sys_stat_h" >&6; }
 
 
 
+
+
+
+
+
+
+
+  if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+
+$as_echo "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h
+
+  fi
+
       ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
      #include <sys/stat.h>
 "
-if test "x$ac_cv_type_nlink_t" = x""yes; then :
+if test "x$ac_cv_type_nlink_t" = xyes; then :
 
 else
 
 
 
 
+    for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat     mknod mknodat stat utimensat; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/stat.h>
 
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
+else
+  eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
-
-
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+      done
 
 
 
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_unistd_h='<'unistd.h'>'
+       gl_cv_next_sys_types_h='<'sys/types.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
-$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
-if test "${gl_cv_next_unistd_h+set}" = set; then :
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
+$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
+if ${gl_cv_next_sys_types_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_unistd_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
+#include <sys/types.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/unistd.h#{
-                 s#.*"\(.*/unistd.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_unistd_h='<'unistd.h'>'
-          fi
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'sys/types.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_sys_types_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
-$as_echo "$gl_cv_next_unistd_h" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
+$as_echo "$gl_cv_next_sys_types_h" >&6; }
      fi
-     NEXT_UNISTD_H=$gl_cv_next_unistd_h
+     NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
 
      if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
-       gl_next_as_first_directive='<'unistd.h'>'
+       gl_next_as_first_directive='<'sys/types.h'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_unistd_h
+       gl_next_as_first_directive=$gl_cv_next_sys_types_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
+     NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
 
 
 
 
 
-  if test $ac_cv_header_unistd_h = yes; then
-    HAVE_UNISTD_H=1
-  else
-    HAVE_UNISTD_H=0
-  fi
 
 
 
-    for gl_func in environ; do
-    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
-$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
-if { as_var=$as_gl_Symbol; eval "test \"\${$as_var+set}\" = set"; }; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <unistd.h>
-/* Some systems declare environ in the wrong header.  */
-#ifndef __GLIBC__
-# include <stdlib.h>
-#endif
 
-int
-main ()
-{
-#undef $gl_func
-  (void) $gl_func;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$as_gl_Symbol=yes"
-else
-  eval "$as_gl_Symbol=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$as_gl_Symbol
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-     eval as_val=\$$as_gl_Symbol
-   if test "x$as_val" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
-_ACEOF
 
-                     eval ac_cv_have_decl_$gl_func=yes
-fi
-      done
 
 
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS dup-safer.$ac_objext"
 
 
 
 
 
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_unistd_h='<'unistd.h'>'
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
+$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
+if ${gl_cv_next_unistd_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+             if test $ac_cv_header_unistd_h = yes; then
 
 
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+
+_ACEOF
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
 
-  gl_LIBOBJS="$gl_LIBOBJS fd-safer.$ac_objext"
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'unistd.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_unistd_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+          else
+               gl_cv_next_unistd_h='<'unistd.h'>'
+             fi
 
 
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
+$as_echo "$gl_cv_next_unistd_h" >&6; }
+     fi
+     NEXT_UNISTD_H=$gl_cv_next_unistd_h
 
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'unistd.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_unistd_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
 
 
 
 
+  if test $ac_cv_header_unistd_h = yes; then
+    HAVE_UNISTD_H=1
+  else
+    HAVE_UNISTD_H=0
+  fi
 
 
-  gl_LIBOBJS="$gl_LIBOBJS pipe-safer.$ac_objext"
 
 
 
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unlink honors trailing slashes" >&5
-$as_echo_n "checking whether unlink honors trailing slashes... " >&6; }
-if test "${gl_cv_func_unlink_works+set}" = set; then :
+    for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat     fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups     gethostname getlogin getlogin_r getpagesize     getusershell setusershell endusershell     group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite     readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r     unlink unlinkat usleep; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
   $as_echo_n "(cached) " >&6
-else
-  touch conftest.file
-     # Assume that if we have lstat, we can also check symlinks.
-     if test $ac_cv_func_lstat = yes; then
-       ln -s conftest.file conftest.lnk
-     fi
-     if test "$cross_compiling" = yes; then :
-  gl_cv_func_unlink_works="guessing no"
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
-           #include <errno.h>
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+/* Some systems declare various items in the wrong headers.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <fcntl.h>
+# include <stdio.h>
+# include <stdlib.h>
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#  include <io.h>
+# endif
+#endif
 
 int
 main ()
 {
-if (!unlink ("conftest.file/") || errno != ENOTDIR) return 1;
-#if HAVE_LSTAT
-      if (!unlink ("conftest.lnk/") || errno != ENOTDIR) return 2;
-#endif
-
+#undef $gl_func
+  (void) $gl_func;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_unlink_works=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
 else
-  gl_cv_func_unlink_works=no
+  eval "$as_gl_Symbol=no"
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
-     rm -f conftest.file conftest.lnk
+                     eval ac_cv_have_decl_$gl_func=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unlink_works" >&5
-$as_echo "$gl_cv_func_unlink_works" >&6; }
-  if test x"$gl_cv_func_unlink_works" != xyes; then
-    REPLACE_UNLINK=1
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS unlink.$ac_objext"
-
-  fi
-
-
-
-  GNULIB_UNLINK=1
-
-
-
-
-
-
+      done
 
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS utimens.$ac_objext"
 
 
 
@@ -21260,18 +26702,25 @@ $as_echo "$gl_cv_func_unlink_works" >&6; }
   if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether futimesat handles NULL file" >&5
 $as_echo_n "checking whether futimesat handles NULL file... " >&6; }
-if test "${gl_cv_func_futimesat_works+set}" = set; then :
+if ${gl_cv_func_futimesat_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   touch conftest.file
        if test "$cross_compiling" = yes; then :
-  gl_cv_func_futimesat_works="guessing no"
+  case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_futimesat_works="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_futimesat_works="guessing no" ;;
+         esac
+
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <stddef.h>
 #include <sys/times.h>
+#include <fcntl.h>
 
 int
 main ()
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_futimesat_works" >&5
 $as_echo "$gl_cv_func_futimesat_works" >&6; }
-    if test "$gl_cv_func_futimesat_works" != yes; then
+    case "$gl_cv_func_futimesat_works" in
+      *yes) ;;
+      *)
 
 $as_echo "#define FUTIMESAT_NULL_BUG 1" >>confdefs.h
 
-    fi
+        ;;
+    esac
   fi
 
 
@@ -21364,8 +26816,9 @@ $as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
 
 
 
+
   ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
 
 else
 
@@ -21500,7 +26953,7 @@ $as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h
       for ac_func in nl_langinfo
 do :
   ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo"
-if test "x$ac_cv_func_nl_langinfo" = x""yes; then :
+if test "x$ac_cv_func_nl_langinfo" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_NL_LANGINFO 1
 _ACEOF
@@ -21664,8 +27117,9 @@ $as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
 
 
 
+
   ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
 
 else
 
@@ -21702,7 +27156,19 @@ $as_echo "#define REPLACE_VFPRINTF_POSIX 1" >>confdefs.h
 
 
 
-  GNULIB_VFPRINTF_POSIX=1
+
+
+
+          GNULIB_VFPRINTF_POSIX=1
+
+
+
+
+
+$as_echo "#define GNULIB_TEST_VFPRINTF_POSIX 1" >>confdefs.h
+
+
+
 
 
 
@@ -21720,30 +27186,47 @@ $as_echo "#define REPLACE_VFPRINTF_POSIX 1" >>confdefs.h
      else
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
 $as_echo_n "checking absolute name of <wchar.h>... " >&6; }
-if test "${gl_cv_next_wchar_h+set}" = set; then :
+if ${gl_cv_next_wchar_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-          if test $ac_cv_header_wchar_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+             if test $ac_cv_header_wchar_h = yes; then
+
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <wchar.h>
 
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/wchar.h#{
-                 s#.*"\(.*/wchar.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'wchar.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_wchar_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
           else
-            gl_cv_next_wchar_h='<'wchar.h'>'
-          fi
+               gl_cv_next_wchar_h='<'wchar.h'>'
+             fi
+
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
@@ -21762,6 +27245,7 @@ $as_echo "$gl_cv_next_wchar_h" >&6; }
 
 
 
+
   if test $ac_cv_header_wchar_h = yes; then
     HAVE_WCHAR_H=1
   else
@@ -21770,6 +27254,8 @@ $as_echo "$gl_cv_next_wchar_h" >&6; }
 
 
 
+
+
   if test $gt_cv_c_wint_t = yes; then
     HAVE_WINT_T=1
   else
@@ -21778,6 +27264,58 @@ $as_echo "$gl_cv_next_wchar_h" >&6; }
 
 
 
+    for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb      wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset      wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp      wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr      wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth     ; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
+#include <wchar.h>
+
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
+else
+  eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
+
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+      done
+
+
+
+
 
 
 
@@ -21798,12 +27336,85 @@ $as_echo "$gl_cv_next_wchar_h" >&6; }
   fi
 
 
-  WCTYPE_H=wctype.h
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_wctype_h='<'wctype.h'>'
+     else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
+$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
+if ${gl_cv_next_wctype_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+             if test $ac_cv_header_wctype_h = yes; then
+
+
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <wctype.h>
+
+_ACEOF
+                                                                                                                        case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+
+               case "$host_os" in
+                 mingw*)
+                                                                                                                                     gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+                                             gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+
+               gl_header_literal_regex=`echo 'wctype.h' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+                   s|^/[^/]|//&|
+                   p
+                   q
+                 }'
+                                                            gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+                      sed -n "$gl_absolute_header_sed"`'"'
+          else
+               gl_cv_next_wctype_h='<'wctype.h'>'
+             fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
+$as_echo "$gl_cv_next_wctype_h" >&6; }
+     fi
+     NEXT_WCTYPE_H=$gl_cv_next_wctype_h
+
+     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+       gl_next_as_first_directive='<'wctype.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_wctype_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
+
+
+
+
   if test $ac_cv_header_wctype_h = yes; then
     if test $ac_cv_func_iswcntrl = yes; then
                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
 $as_echo_n "checking whether iswcntrl works... " >&6; }
-if test "${gl_cv_func_iswcntrl_works+set}" = set; then :
+if ${gl_cv_func_iswcntrl_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -21823,9 +27434,9 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_iswcntrl_works=yes
+  gl_cv_func_iswcntrl_works="guessing yes"
 else
-  gl_cv_func_iswcntrl_works=no
+  gl_cv_func_iswcntrl_works="guessing no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
@@ -21833,12 +27444,17 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-                            #include <stddef.h>
-                            #include <stdio.h>
-                            #include <time.h>
-                            #include <wchar.h>
-                            #include <wctype.h>
-                            int main () { return iswprint ('x') == 0; }
+               /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+                  included before <wchar.h>.
+                  BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+                  must be included before <wchar.h>.  */
+               #include <stddef.h>
+               #include <stdio.h>
+               #include <time.h>
+               #include <wchar.h>
+               #include <wctype.h>
+               int main () { return iswprint ('x') == 0; }
+
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   gl_cv_func_iswcntrl_works=yes
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
 $as_echo "$gl_cv_func_iswcntrl_works" >&6; }
-      if test $gl_cv_func_iswcntrl_works = yes; then
-        case "$host_os" in
-          mingw*)
-                        ;;
-          *)
-                        WCTYPE_H=
-            ;;
-        esac
-      fi
     fi
+    HAVE_WCTYPE_H=1
+  else
+    HAVE_WCTYPE_H=0
+  fi
 
 
+  case "$gl_cv_func_iswcntrl_works" in
+    *yes) REPLACE_ISWCNTRL=0 ;;
+    *)    REPLACE_ISWCNTRL=1 ;;
+  esac
 
 
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+        :
+  fi
 
+  if test $REPLACE_ISWCNTRL = 1; then
+    REPLACE_TOWLOWER=1
+  else
+    for ac_func in towlower
+do :
+  ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
+if test "x$ac_cv_func_towlower" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_TOWLOWER 1
+_ACEOF
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_wctype_h='<'wctype.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
-$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
-if test "${gl_cv_next_wctype_h+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
+fi
+done
 
-          if test $ac_cv_header_wctype_h = yes; then
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <wctype.h>
+    if test $ac_cv_func_towlower = yes; then
+      REPLACE_TOWLOWER=0
+    else
+      ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+             included before <wchar.h>.
+             BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+             must be included before <wchar.h>.  */
+          #include <stddef.h>
+          #include <stdio.h>
+          #include <time.h>
+          #include <wchar.h>
+          #if HAVE_WCTYPE_H
+          # include <wctype.h>
+          #endif
+
+"
+if test "x$ac_cv_have_decl_towlower" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_TOWLOWER $ac_have_decl
 _ACEOF
-                                                                                                case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-                                                gl_cv_next_wctype_h='"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-               sed -n '\#/wctype.h#{
-                 s#.*"\(.*/wctype.h\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'
-          else
-            gl_cv_next_wctype_h='<'wctype.h'>'
-          fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
-$as_echo "$gl_cv_next_wctype_h" >&6; }
-     fi
-     NEXT_WCTYPE_H=$gl_cv_next_wctype_h
+      if test $ac_cv_have_decl_towlower = yes; then
+                                REPLACE_TOWLOWER=1
+      else
+        REPLACE_TOWLOWER=0
+      fi
+    fi
+  fi
 
-     if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
-       gl_next_as_first_directive='<'wctype.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_wctype_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
 
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
+        :
+  fi
 
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
+$as_echo_n "checking for wctype_t... " >&6; }
+if ${gl_cv_type_wctype_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+               included before <wchar.h>.
+               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+               must be included before <wchar.h>.  */
+            #include <stddef.h>
+            #include <stdio.h>
+            #include <time.h>
+            #include <wchar.h>
+            #if HAVE_WCTYPE_H
+            # include <wctype.h>
+            #endif
+            wctype_t a;
 
-    HAVE_WCTYPE_H=1
-  else
-    HAVE_WCTYPE_H=0
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_type_wctype_t=yes
+else
+  gl_cv_type_wctype_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
+$as_echo "$gl_cv_type_wctype_t" >&6; }
+  if test $gl_cv_type_wctype_t = no; then
+    HAVE_WCTYPE_T=0
   fi
 
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
+$as_echo_n "checking for wctrans_t... " >&6; }
+if ${gl_cv_type_wctrans_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+               included before <wchar.h>.
+               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+               must be included before <wchar.h>.  */
+            #include <stddef.h>
+            #include <stdio.h>
+            #include <time.h>
+            #include <wchar.h>
+            #include <wctype.h>
+            wctrans_t a;
+
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_type_wctrans_t=yes
+else
+  gl_cv_type_wctrans_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-  if test "$gl_cv_func_iswcntrl_works" = no; then
-    REPLACE_ISWCNTRL=1
-  else
-    REPLACE_ISWCNTRL=0
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
+$as_echo "$gl_cv_type_wctrans_t" >&6; }
+  if test $gl_cv_type_wctrans_t = no; then
+    HAVE_WCTRANS_T=0
   fi
 
 
+    for gl_func in wctype iswctype wctrans towctrans     ; do
+    as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
+$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
+if eval \${$as_gl_Symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+#endif
+#include <wctype.h>
 
+int
+main ()
+{
+#undef $gl_func
+  (void) $gl_func;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_gl_Symbol=yes"
+else
+  eval "$as_gl_Symbol=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$as_gl_Symbol
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+    if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1
+_ACEOF
 
+                     eval ac_cv_have_decl_$gl_func=yes
+fi
+      done
 
 
 
 
 
-
-  gl_LIBOBJS="$gl_LIBOBJS xmalloc.$ac_objext"
-
-
-
-
   :
 
 
@@ -21953,24 +27685,10 @@ $as_echo "$gl_cv_next_wctype_h" >&6; }
 
 
 
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS xgetcwd.$ac_objext"
-
-
-
-
-
-
-
   for ac_header in stdint.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdint_h" = x""yes; then :
+if test "x$ac_cv_header_stdint_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STDINT_H 1
 _ACEOF
@@ -21981,19 +27699,9 @@ done
 
 
 
-
-
-
-
-
-
-
-
-  gl_LIBOBJS="$gl_LIBOBJS yesno.$ac_objext"
-
-
     :
 
+  # End of code from modules
 
 
 
@@ -22015,6 +27723,11 @@ done
 
 
   gl_source_base='tests'
+  gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
+
+  gl_module_indicator_condition=$gltests_WITNESS
+
+
 
 
 
@@ -22032,7 +27745,7 @@ done
 if test "${enable_gcc_warnings+set}" = set; then :
   enableval=$enable_gcc_warnings; case $enableval in
      yes|no) ;;
-     *)      as_fn_error "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;;
+     *)      as_fn_error $? "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;;
    esac
    gl_gcc_warnings=$enableval
 else
 
 
 if test "$gl_gcc_warnings" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Werror" >&5
-$as_echo_n "checking whether compiler handles -Werror... " >&6; }
-if test "${gl_cv_warn__Werror+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Werror" >&5
+$as_echo_n "checking whether compiler handles -Werror... " >&6; }
+if ${gl_cv_warn_c__Werror+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} -Werror"
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -Werror"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22061,23 +27774,24 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  gl_cv_warn__Werror=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__Werror=yes
 else
-  gl_cv_warn__Werror=no
+  gl_cv_warn_c__Werror=no
 fi
-rm -f conftest.err conftest.$ac_ext
-  CPPFLAGS="$save_CPPFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Werror" >&5
-$as_echo "$gl_cv_warn__Werror" >&6; }
-if test "x$gl_cv_warn__Werror" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5
+$as_echo "$gl_cv_warn_c__Werror" >&6; }
+if test "x$gl_cv_warn_c__Werror" = xyes; then :
   as_fn_append WERROR_CFLAGS " -Werror"
 fi
 
 
 
+
   nw=
   # This, $nw, is the list of warnings we disable.
   nw="$nw -Wdeclaration-after-statement" # too useful to forbid
   # ?? -Wstrict-overflow
 
 
- gl_manywarn_set=
- for gl_manywarn_item in \
-   -Wall \
-   -W \
-   -Wformat-y2k \
-   -Wformat-nonliteral \
-   -Wformat-security \
-   -Winit-self \
-   -Wmissing-include-dirs \
-   -Wswitch-default \
-   -Wswitch-enum \
-   -Wunused \
-   -Wunknown-pragmas \
-   -Wstrict-aliasing \
-   -Wstrict-overflow \
-   -Wsystem-headers \
-   -Wfloat-equal \
-   -Wtraditional \
-   -Wtraditional-conversion \
-   -Wdeclaration-after-statement \
-   -Wundef \
-   -Wshadow \
-   -Wunsafe-loop-optimizations \
-   -Wpointer-arith \
-   -Wbad-function-cast \
-   -Wc++-compat \
-   -Wcast-qual \
-   -Wcast-align \
-   -Wwrite-strings \
-   -Wconversion \
-   -Wsign-conversion \
-   -Wlogical-op \
-   -Waggregate-return \
-   -Wstrict-prototypes \
-   -Wold-style-definition \
-   -Wmissing-prototypes \
-   -Wmissing-declarations \
-   -Wmissing-noreturn \
-   -Wmissing-format-attribute \
-   -Wpacked \
-   -Wpadded \
-   -Wredundant-decls \
-   -Wnested-externs \
-   -Wunreachable-code \
-   -Winline \
-   -Winvalid-pch \
-   -Wlong-long \
-   -Wvla \
-   -Wvolatile-register-var \
-   -Wdisabled-optimization \
-   -Wstack-protector \
-   -Woverlength-strings \
-   -Wbuiltin-macro-redefined \
-   -Wmudflap \
-   -Wpacked-bitfield-compat \
-   -Wsync-nand \
-  ; do
+
+  if test -n "$GCC"; then
+
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5
+$as_echo_n "checking whether -Wno-missing-field-initializers is supported... " >&6; }
+    if ${gl_cv_cc_nomfi_supported+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_cc_nomfi_supported=yes
+else
+  gl_cv_cc_nomfi_supported=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+      CFLAGS="$gl_save_CFLAGS"
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5
+$as_echo "$gl_cv_cc_nomfi_supported" >&6; }
+
+    if test "$gl_cv_cc_nomfi_supported" = yes; then
+                  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5
+$as_echo_n "checking whether -Wno-missing-field-initializers is needed... " >&6; }
+      if ${gl_cv_cc_nomfi_needed+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+        gl_save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS -W -Werror"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+void f (void)
+               {
+                 typedef struct { int a; int b; } s_t;
+                 s_t s1 = { 0, };
+               }
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_cc_nomfi_needed=no
+else
+  gl_cv_cc_nomfi_needed=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        CFLAGS="$gl_save_CFLAGS"
+
+fi
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5
+$as_echo "$gl_cv_cc_nomfi_needed" >&6; }
+    fi
+  fi
+
+  gl_manywarn_set=
+  for gl_manywarn_item in \
+    -Wall \
+    -W \
+    -Wformat-y2k \
+    -Wformat-nonliteral \
+    -Wformat-security \
+    -Winit-self \
+    -Wmissing-include-dirs \
+    -Wswitch-default \
+    -Wswitch-enum \
+    -Wunused \
+    -Wunknown-pragmas \
+    -Wstrict-aliasing \
+    -Wstrict-overflow \
+    -Wsystem-headers \
+    -Wfloat-equal \
+    -Wtraditional \
+    -Wtraditional-conversion \
+    -Wdeclaration-after-statement \
+    -Wundef \
+    -Wshadow \
+    -Wunsafe-loop-optimizations \
+    -Wpointer-arith \
+    -Wbad-function-cast \
+    -Wc++-compat \
+    -Wcast-qual \
+    -Wcast-align \
+    -Wwrite-strings \
+    -Wconversion \
+    -Wsign-conversion \
+    -Wlogical-op \
+    -Waggregate-return \
+    -Wstrict-prototypes \
+    -Wold-style-definition \
+    -Wmissing-prototypes \
+    -Wmissing-declarations \
+    -Wmissing-noreturn \
+    -Wmissing-format-attribute \
+    -Wpacked \
+    -Wpadded \
+    -Wredundant-decls \
+    -Wnested-externs \
+    -Wunreachable-code \
+    -Winline \
+    -Winvalid-pch \
+    -Wlong-long \
+    -Wvla \
+    -Wvolatile-register-var \
+    -Wdisabled-optimization \
+    -Wstack-protector \
+    -Woverlength-strings \
+    -Wbuiltin-macro-redefined \
+    -Wmudflap \
+    -Wpacked-bitfield-compat \
+    -Wsync-nand \
+    ; do
+    gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
+  done
+  # The following are not documented in the manual but are included in
+  # output from gcc --help=warnings.
+  for gl_manywarn_item in \
+    -Wattributes \
+    -Wcoverage-mismatch \
+    -Wunused-macros \
+    ; do
     gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
   done
- # The following are not documented in the manual but are included in
- # output from gcc --help=warnings.
- for gl_manywarn_item in \
-   -Wattributes \
-   -Wcoverage-mismatch \
-   -Wmultichar \
-   -Wunused-macros \
-  ; do
+  # More warnings from gcc 4.6.2 --help=warnings.
+  for gl_manywarn_item in \
+    -Wabi \
+    -Wcpp \
+    -Wdeprecated \
+    -Wdeprecated-declarations \
+    -Wdiv-by-zero \
+    -Wdouble-promotion \
+    -Wendif-labels \
+    -Wextra \
+    -Wformat-contains-nul \
+    -Wformat-extra-args \
+    -Wformat-zero-length \
+    -Wformat=2 \
+    -Wmultichar \
+    -Wnormalized=nfc \
+    -Woverflow \
+    -Wpointer-to-int-cast \
+    -Wpragmas \
+    -Wsuggest-attribute=const \
+    -Wsuggest-attribute=noreturn \
+    -Wsuggest-attribute=pure \
+    -Wtrampolines \
+    ; do
     gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
   done
+
+  # Disable the missing-field-initializers warning if needed
+  if test "$gl_cv_cc_nomfi_needed" = yes; then
+    gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
+  fi
+
   ws=$gl_manywarn_set
 
 
   ws=$gl_warn_set
 
   for w in $ws; do
-    as_gl_Warn=`$as_echo "gl_cv_warn_$w" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles $w" >&5
-$as_echo_n "checking whether compiler handles $w... " >&6; }
-if { as_var=$as_gl_Warn; eval "test \"\${$as_var+set}\" = set"; }; then :
+    as_gl_Warn=`$as_echo "gl_cv_warn_c_$w" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles $w" >&5
+$as_echo_n "checking whether compiler handles $w... " >&6; }
+if eval \${$as_gl_Warn+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} $w"
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " $w"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22221,32 +28040,32 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"; then :
   eval "$as_gl_Warn=yes"
 else
   eval "$as_gl_Warn=no"
 fi
-rm -f conftest.err conftest.$ac_ext
-  CPPFLAGS="$save_CPPFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
 eval ac_res=\$$as_gl_Warn
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-eval as_val=\$$as_gl_Warn
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_gl_Warn"\" = x"yes"; then :
   as_fn_append WARN_CFLAGS " $w"
 fi
 
+
   done
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-missing-field-initializers" >&5
-$as_echo_n "checking whether compiler handles -Wno-missing-field-initializers... " >&6; }
-if test "${gl_cv_warn__Wno_missing_field_initializers+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-missing-field-initializers" >&5
+$as_echo_n "checking whether compiler handles -Wno-missing-field-initializers... " >&6; }
+if ${gl_cv_warn_c__Wno_missing_field_initializers+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} -Wno-missing-field-initializers"
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -Wno-missing-field-initializers"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22258,29 +28077,30 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  gl_cv_warn__Wno_missing_field_initializers=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__Wno_missing_field_initializers=yes
 else
-  gl_cv_warn__Wno_missing_field_initializers=no
+  gl_cv_warn_c__Wno_missing_field_initializers=no
 fi
-rm -f conftest.err conftest.$ac_ext
-  CPPFLAGS="$save_CPPFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wno_missing_field_initializers" >&5
-$as_echo "$gl_cv_warn__Wno_missing_field_initializers" >&6; }
-if test "x$gl_cv_warn__Wno_missing_field_initializers" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_missing_field_initializers" >&5
+$as_echo "$gl_cv_warn_c__Wno_missing_field_initializers" >&6; }
+if test "x$gl_cv_warn_c__Wno_missing_field_initializers" = xyes; then :
   as_fn_append WARN_CFLAGS " -Wno-missing-field-initializers"
 fi
+
  # We need this one
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-sign-compare" >&5
-$as_echo_n "checking whether compiler handles -Wno-sign-compare... " >&6; }
-if test "${gl_cv_warn__Wno_sign_compare+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-sign-compare" >&5
+$as_echo_n "checking whether compiler handles -Wno-sign-compare... " >&6; }
+if ${gl_cv_warn_c__Wno_sign_compare+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} -Wno-sign-compare"
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -Wno-sign-compare"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22292,29 +28112,30 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  gl_cv_warn__Wno_sign_compare=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__Wno_sign_compare=yes
 else
-  gl_cv_warn__Wno_sign_compare=no
+  gl_cv_warn_c__Wno_sign_compare=no
 fi
-rm -f conftest.err conftest.$ac_ext
-  CPPFLAGS="$save_CPPFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wno_sign_compare" >&5
-$as_echo "$gl_cv_warn__Wno_sign_compare" >&6; }
-if test "x$gl_cv_warn__Wno_sign_compare" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_sign_compare" >&5
+$as_echo "$gl_cv_warn_c__Wno_sign_compare" >&6; }
+if test "x$gl_cv_warn_c__Wno_sign_compare" = xyes; then :
   as_fn_append WARN_CFLAGS " -Wno-sign-compare"
 fi
+
      # Too many warnings for now
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-pointer-sign" >&5
-$as_echo_n "checking whether compiler handles -Wno-pointer-sign... " >&6; }
-if test "${gl_cv_warn__Wno_pointer_sign+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-pointer-sign" >&5
+$as_echo_n "checking whether compiler handles -Wno-pointer-sign... " >&6; }
+if ${gl_cv_warn_c__Wno_pointer_sign+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} -Wno-pointer-sign"
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -Wno-pointer-sign"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22326,29 +28147,30 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  gl_cv_warn__Wno_pointer_sign=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__Wno_pointer_sign=yes
 else
-  gl_cv_warn__Wno_pointer_sign=no
+  gl_cv_warn_c__Wno_pointer_sign=no
 fi
-rm -f conftest.err conftest.$ac_ext
-  CPPFLAGS="$save_CPPFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wno_pointer_sign" >&5
-$as_echo "$gl_cv_warn__Wno_pointer_sign" >&6; }
-if test "x$gl_cv_warn__Wno_pointer_sign" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_pointer_sign" >&5
+$as_echo "$gl_cv_warn_c__Wno_pointer_sign" >&6; }
+if test "x$gl_cv_warn_c__Wno_pointer_sign" = xyes; then :
   as_fn_append WARN_CFLAGS " -Wno-pointer-sign"
 fi
+
      # Too many warnings for now
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-unused-parameter" >&5
-$as_echo_n "checking whether compiler handles -Wno-unused-parameter... " >&6; }
-if test "${gl_cv_warn__Wno_unused_parameter+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-unused-parameter" >&5
+$as_echo_n "checking whether compiler handles -Wno-unused-parameter... " >&6; }
+if ${gl_cv_warn_c__Wno_unused_parameter+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} -Wno-unused-parameter"
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -Wno-unused-parameter"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22360,29 +28182,30 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  gl_cv_warn__Wno_unused_parameter=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__Wno_unused_parameter=yes
 else
-  gl_cv_warn__Wno_unused_parameter=no
+  gl_cv_warn_c__Wno_unused_parameter=no
 fi
-rm -f conftest.err conftest.$ac_ext
-  CPPFLAGS="$save_CPPFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wno_unused_parameter" >&5
-$as_echo "$gl_cv_warn__Wno_unused_parameter" >&6; }
-if test "x$gl_cv_warn__Wno_unused_parameter" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unused_parameter" >&5
+$as_echo "$gl_cv_warn_c__Wno_unused_parameter" >&6; }
+if test "x$gl_cv_warn_c__Wno_unused_parameter" = xyes; then :
   as_fn_append WARN_CFLAGS " -Wno-unused-parameter"
 fi
+
  # Too many warnings for now
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-overflow" >&5
-$as_echo_n "checking whether compiler handles -Wno-overflow... " >&6; }
-if test "${gl_cv_warn__Wno_overflow+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-overflow" >&5
+$as_echo_n "checking whether compiler handles -Wno-overflow... " >&6; }
+if ${gl_cv_warn_c__Wno_overflow+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} -Wno-overflow"
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -Wno-overflow"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22394,29 +28217,30 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  gl_cv_warn__Wno_overflow=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__Wno_overflow=yes
 else
-  gl_cv_warn__Wno_overflow=no
+  gl_cv_warn_c__Wno_overflow=no
 fi
-rm -f conftest.err conftest.$ac_ext
-  CPPFLAGS="$save_CPPFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wno_overflow" >&5
-$as_echo "$gl_cv_warn__Wno_overflow" >&6; }
-if test "x$gl_cv_warn__Wno_overflow" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_overflow" >&5
+$as_echo "$gl_cv_warn_c__Wno_overflow" >&6; }
+if test "x$gl_cv_warn_c__Wno_overflow" = xyes; then :
   as_fn_append WARN_CFLAGS " -Wno-overflow"
 fi
+
          # util.c
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-type-limits" >&5
-$as_echo_n "checking whether compiler handles -Wno-type-limits... " >&6; }
-if test "${gl_cv_warn__Wno_type_limits+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-type-limits" >&5
+$as_echo_n "checking whether compiler handles -Wno-type-limits... " >&6; }
+if ${gl_cv_warn_c__Wno_type_limits+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} -Wno-type-limits"
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -Wno-type-limits"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22428,32 +28252,103 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  gl_cv_warn__Wno_type_limits=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__Wno_type_limits=yes
 else
-  gl_cv_warn__Wno_type_limits=no
+  gl_cv_warn_c__Wno_type_limits=no
 fi
-rm -f conftest.err conftest.$ac_ext
-  CPPFLAGS="$save_CPPFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wno_type_limits" >&5
-$as_echo "$gl_cv_warn__Wno_type_limits" >&6; }
-if test "x$gl_cv_warn__Wno_type_limits" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_type_limits" >&5
+$as_echo "$gl_cv_warn_c__Wno_type_limits" >&6; }
+if test "x$gl_cv_warn_c__Wno_type_limits" = xyes; then :
   as_fn_append WARN_CFLAGS " -Wno-type-limits"
 fi
+
       # util.c
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5
+$as_echo_n "checking whether C compiler handles -Wno-format-nonliteral... " >&6; }
+if ${gl_cv_warn_c__Wno_format_nonliteral+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -Wno-format-nonliteral"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__Wno_format_nonliteral=yes
+else
+  gl_cv_warn_c__Wno_format_nonliteral=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_nonliteral" >&5
+$as_echo "$gl_cv_warn_c__Wno_format_nonliteral" >&6; }
+if test "x$gl_cv_warn_c__Wno_format_nonliteral" = xyes; then :
+  as_fn_append WARN_CFLAGS " -Wno-format-nonliteral"
+fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-unsuffixed-float-constants" >&5
+$as_echo_n "checking whether C compiler handles -Wno-unsuffixed-float-constants... " >&6; }
+if ${gl_cv_warn_c__Wno_unsuffixed_float_constants+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -Wno-unsuffixed-float-constants"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__Wno_unsuffixed_float_constants=yes
+else
+  gl_cv_warn_c__Wno_unsuffixed_float_constants=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_unsuffixed_float_constants" >&5
+$as_echo "$gl_cv_warn_c__Wno_unsuffixed_float_constants" >&6; }
+if test "x$gl_cv_warn_c__Wno_unsuffixed_float_constants" = xyes; then :
+  as_fn_append WARN_CFLAGS " -Wno-unsuffixed-float-constants"
+fi
+
+
 
   # In spite of excluding -Wlogical-op above, it is enabled, as of
   # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-logical-op" >&5
-$as_echo_n "checking whether compiler handles -Wno-logical-op... " >&6; }
-if test "${gl_cv_warn__Wno_logical_op+set}" = set; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -Wno-logical-op" >&5
+$as_echo_n "checking whether compiler handles -Wno-logical-op... " >&6; }
+if ${gl_cv_warn_c__Wno_logical_op+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} -Wno-logical-op"
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -Wno-logical-op"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22465,30 +28360,31 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  gl_cv_warn__Wno_logical_op=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__Wno_logical_op=yes
 else
-  gl_cv_warn__Wno_logical_op=no
+  gl_cv_warn_c__Wno_logical_op=no
 fi
-rm -f conftest.err conftest.$ac_ext
-  CPPFLAGS="$save_CPPFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__Wno_logical_op" >&5
-$as_echo "$gl_cv_warn__Wno_logical_op" >&6; }
-if test "x$gl_cv_warn__Wno_logical_op" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_logical_op" >&5
+$as_echo "$gl_cv_warn_c__Wno_logical_op" >&6; }
+if test "x$gl_cv_warn_c__Wno_logical_op" = xyes; then :
   as_fn_append WARN_CFLAGS " -Wno-logical-op"
 fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -fdiagnostics-show-option" >&5
-$as_echo_n "checking whether compiler handles -fdiagnostics-show-option... " >&6; }
-if test "${gl_cv_warn__fdiagnostics_show_option+set}" = set; then :
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -fdiagnostics-show-option" >&5
+$as_echo_n "checking whether C compiler handles -fdiagnostics-show-option... " >&6; }
+if ${gl_cv_warn_c__fdiagnostics_show_option+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} -fdiagnostics-show-option"
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -fdiagnostics-show-option"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22500,29 +28396,30 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  gl_cv_warn__fdiagnostics_show_option=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__fdiagnostics_show_option=yes
 else
-  gl_cv_warn__fdiagnostics_show_option=no
+  gl_cv_warn_c__fdiagnostics_show_option=no
 fi
-rm -f conftest.err conftest.$ac_ext
-  CPPFLAGS="$save_CPPFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__fdiagnostics_show_option" >&5
-$as_echo "$gl_cv_warn__fdiagnostics_show_option" >&6; }
-if test "x$gl_cv_warn__fdiagnostics_show_option" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__fdiagnostics_show_option" >&5
+$as_echo "$gl_cv_warn_c__fdiagnostics_show_option" >&6; }
+if test "x$gl_cv_warn_c__fdiagnostics_show_option" = xyes; then :
   as_fn_append WARN_CFLAGS " -fdiagnostics-show-option"
 fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler handles -funit-at-a-time" >&5
-$as_echo_n "checking whether compiler handles -funit-at-a-time... " >&6; }
-if test "${gl_cv_warn__funit_at_a_time+set}" = set; then :
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -funit-at-a-time" >&5
+$as_echo_n "checking whether C compiler handles -funit-at-a-time... " >&6; }
+if ${gl_cv_warn_c__funit_at_a_time+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} -funit-at-a-time"
+  gl_save_compiler_FLAGS="$CFLAGS"
+  as_fn_append CFLAGS " -funit-at-a-time"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22534,18 +28431,18 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  gl_cv_warn__funit_at_a_time=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_warn_c__funit_at_a_time=yes
 else
-  gl_cv_warn__funit_at_a_time=no
+  gl_cv_warn_c__funit_at_a_time=no
 fi
-rm -f conftest.err conftest.$ac_ext
-  CPPFLAGS="$save_CPPFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn__funit_at_a_time" >&5
-$as_echo "$gl_cv_warn__funit_at_a_time" >&6; }
-if test "x$gl_cv_warn__funit_at_a_time" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__funit_at_a_time" >&5
+$as_echo "$gl_cv_warn_c__funit_at_a_time" >&6; }
+if test "x$gl_cv_warn_c__funit_at_a_time" = xyes; then :
   as_fn_append WARN_CFLAGS " -funit-at-a-time"
 fi
 
@@ -22553,6 +28450,7 @@ fi
 
 
 
+
 $as_echo "#define lint 1" >>confdefs.h
 
 
@@ -22587,12 +28485,12 @@ $as_echo "#define GNULIB_PORTCHECK 1" >>confdefs.h
 fi
 
 # cc -E produces incorrect asm files on SVR4, so postprocess it.
-ASCPPPOST="sed '/^ *#/d; s,//.*,,; s/% /%/g; s/\\. /./g'"
+ASCPPPOST="sed '/^ *\\#/d; s,//.*,,; s/% /%/g; s/\\. /./g'"
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for underline in external names" >&5
 $as_echo_n "checking for underline in external names... " >&6; }
-if test "${gzip_cv_underline+set}" = set; then :
+if ${gzip_cv_underline+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   gzip_cv_underline=yes
@@ -22609,7 +28507,7 @@ main ()
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   $NM conftest.$OBJEXT | grep _foo >/dev/null 2>&1 ||
-       gzip_cv_underline=no
+        gzip_cv_underline=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
@@ -22626,7 +28524,7 @@ fi
 # "gcc -E match.s" ignores -E, so we must use _match.S.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an assembler syntax supported by this package" >&5
 $as_echo_n "checking for an assembler syntax supported by this package... " >&6; }
-if test "${gzip_cv_assembler+set}" = set; then :
+if ${gzip_cv_assembler+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   gzip_cv_assembler=no
@@ -22634,21 +28532,21 @@ else
    *' NO_ASM '*) ;;
    *)
      if cp $srcdir/lib/match.c _match.S &&
-       eval "$CPP $CPPFLAGS $ASCPPFLAGS _match.S > _match.i" 2>/dev/null &&
-       eval "$ASCPPPOST < _match.i > match_.s" 2>/dev/null; then
+        eval "$CPP $CPPFLAGS $ASCPPFLAGS _match.S > _match.i" &&
+        eval "$ASCPPPOST < _match.i > match_.s"; then
        if test ! -s match_.s || grep error < match_.s > /dev/null; then
-        :
-       elif eval "$CC $CPPFLAGS $CFLAGS -c match_.s >/dev/null 2>&1" &&
-           test -f match_.$OBJEXT; then
-        rm -f match_.$OBJEXT
-        gzip_cv_assembler=yes
-        if echo 'void foo (void) {}' > conftest.c &&
-           eval "$CC $CPPFLAGS $CFLAGS -S conftest.c >/dev/null 2>&1" &&
-           grep '\.note\.GNU-stack' conftest.s >/dev/null 2>&1 &&
-           eval "$CC $CPPFLAGS $CFLAGS -c -Wa,--noexecstack match_.s >/dev/null 2>&1" &&
-           test -f match_.$OBJEXT; then
-          gzip_cv_assembler='yes, with -Wa,--noexecstack'
-        fi
+         :
+       elif eval "$CC $CPPFLAGS $CFLAGS -c match_.s >/dev/null" &&
+            test -f match_.$OBJEXT; then
+         rm -f match_.$OBJEXT
+         gzip_cv_assembler=yes
+         if echo 'void foo (void) {}' > conftest.c &&
+            eval "$CC $CPPFLAGS $CFLAGS -S conftest.c >/dev/null" &&
+            grep '\.note\.GNU-stack' conftest.s >/dev/null &&
+            eval "$CC $CPPFLAGS $CFLAGS -c -Wa,--noexecstack match_.s >/dev/null" &&
+            test -f match_.$OBJEXT; then
+           gzip_cv_assembler='yes, with -Wa,--noexecstack'
+         fi
        fi
      fi
      rm -f conftest* _match.i _match.S match_.s match_.$OBJEXT;;
@@ -22676,7 +28574,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
 $as_echo_n "checking for library containing strerror... " >&6; }
-if test "${ac_cv_search_strerror+set}" = set; then :
+if ${ac_cv_search_strerror+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -22710,11 +28608,11 @@ for ac_lib in '' cposix; do
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if test "${ac_cv_search_strerror+set}" = set; then :
+  if ${ac_cv_search_strerror+:} false; then :
   break
 fi
 done
-if test "${ac_cv_search_strerror+set}" = set; then :
+if ${ac_cv_search_strerror+:} false; then :
 
 else
   ac_cv_search_strerror=no
@@ -22732,7 +28630,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
 $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if test "${ac_cv_c_const+set}" = set; then :
+if ${ac_cv_c_const+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -22741,11 +28639,11 @@ else
 int
 main ()
 {
-/* FIXME: Include the comments suggested by Paul. */
+
 #ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
+  /* Ultrix mips cc rejects this sort of thing.  */
   typedef int charset[2];
-  const charset cs;
+  const charset cs = { 0, 0 };
   /* SunOS 4.1.1 cc rejects this.  */
   char const *const *pcpcc;
   char **ppc;
@@ -22762,8 +28660,9 @@ main ()
   ++pcpcc;
   ppc = (char**) pcpcc;
   pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
+    char tx;
+    char *t = &tx;
     char const *s = 0 ? (char *) 0 : (char const *) 0;
 
     *t++ = 0;
@@ -22779,10 +28678,10 @@ main ()
     iptr p = 0;
     ++p;
   }
-  { /* AIX XL C 1.02.0.0 rejects this saying
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, 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;
+    struct s { int j; const int *ap[3]; } bx;
+    struct s *b = &bx; b->j = 5;
   }
   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
     const int foo = 10;
@@ -22812,7 +28711,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 
 
 
+
+
+
+
+
+
+
+
 ac_header_dirent=no
 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
   as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$as_ac_Header+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -22964,8 +28871,7 @@ fi
 eval ac_res=\$$as_ac_Header
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
 _ACEOF
@@ -22978,7 +28884,7 @@ done
 if test $ac_header_dirent = dirent.h; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
 $as_echo_n "checking for library containing opendir... " >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then :
+if ${ac_cv_search_opendir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -23012,11 +28918,11 @@ for ac_lib in '' dir; do
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if test "${ac_cv_search_opendir+set}" = set; then :
+  if ${ac_cv_search_opendir+:} false; then :
   break
 fi
 done
-if test "${ac_cv_search_opendir+set}" = set; then :
+if ${ac_cv_search_opendir+:} false; then :
 
 else
   ac_cv_search_opendir=no
@@ -23035,7 +28941,7 @@ fi
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
 $as_echo_n "checking for library containing opendir... " >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then :
+if ${ac_cv_search_opendir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -23069,11 +28975,11 @@ for ac_lib in '' x; do
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if test "${ac_cv_search_opendir+set}" = set; then :
+  if ${ac_cv_search_opendir+:} false; then :
   break
 fi
 done
-if test "${ac_cv_search_opendir+set}" = set; then :
+if ${ac_cv_search_opendir+:} false; then :
 
 else
   ac_cv_search_opendir=no
@@ -23093,7 +28999,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
 $as_echo_n "checking return type of signal handlers... " >&6; }
-if test "${ac_cv_type_signal+set}" = set; then :
+if ${ac_cv_type_signal+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -23125,7 +29031,7 @@ _ACEOF
 
 
 ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = x""yes; then :
+if test "x$ac_cv_type_size_t" = xyes; then :
 
 else
 
@@ -23136,7 +29042,7 @@ _ACEOF
 fi
 
 ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = x""yes; then :
+if test "x$ac_cv_type_off_t" = xyes; then :
 
 else
 
@@ -23147,7 +29053,7 @@ _ACEOF
 fi
 
 
-ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile"
+ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile tests/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -23213,10 +29119,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -23232,6 +29149,7 @@ DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -23246,6 +29164,14 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
  if test -n "$EXEEXT"; then
   am__EXEEXT_TRUE=
   am__EXEEXT_FALSE='#'
@@ -23255,23 +29181,49 @@ else
 fi
 
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  as_fn_error "conditional \"AMDEP\" was never defined.
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  as_fn_error "conditional \"am__fastdepCC\" was never defined.
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
-  as_fn_error "conditional \"GL_COND_LIBTOOL\" was never defined.
+  as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_ALLOCA_H_TRUE}" && test -z "${GL_GENERATE_ALLOCA_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_ALLOCA_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_ERRNO_H_TRUE}" && test -z "${GL_GENERATE_ERRNO_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_ERRNO_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
+
 if test -z "${GNU_MAKE_TRUE}" && test -z "${GNU_MAKE_FALSE}"; then
-  as_fn_error "conditional \"GNU_MAKE\" was never defined.
+  as_fn_error $? "conditional \"GNU_MAKE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+CONFIG_INCLUDE=lib/config.h
 
+if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 
     gl_libobjs=
     gl_ltlibobjs=
@@ -23305,7 +29257,7 @@ fi
 
 
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -23406,6 +29358,7 @@ fi
 IFS=" ""       $as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -23451,19 +29404,19 @@ export LANGUAGE
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$?; test $as_status -eq 0 && as_status=1
-  if test "$3"; then
-    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-  $as_echo "$as_me: error: $1" >&2
+  $as_echo "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
@@ -23601,16 +29554,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -23659,7 +29612,7 @@ $as_echo X"$as_dir" |
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
@@ -23670,28 +29623,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -23712,8 +29653,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by gzip $as_me 1.4, which was
-generated by GNU Autoconf 2.65.23-13e35.  Invocation command line was
+This file was extended by gzip $as_me 1.5, which was
+generated by GNU Autoconf 2.69.4-560f.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -23782,11 +29723,11 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-gzip config.status 1.4
-configured by $0, generated by GNU Autoconf 2.65.23-13e35,
+gzip config.status 1.5
+configured by $0, generated by GNU Autoconf 2.69.4-560f,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -23804,11 +29745,16 @@ ac_need_defaults=:
 while test $# != 0
 do
   case $1 in
-  --*=*)
+  --*=?*)
     ac_option=`expr "X$1" : 'X\([^=]*\)='`
     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
   *)
     ac_option=$1
     ac_optarg=$2
@@ -23830,6 +29776,7 @@ do
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
     esac
     as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
@@ -23842,7 +29789,7 @@ do
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    as_fn_error "ambiguous option: \`$1'
+    as_fn_error $? "ambiguous option: \`$1'
 Try \`$0 --help' for more information.";;
   --help | --hel | -h )
     $as_echo "$ac_cs_usage"; exit ;;
@@ -23851,7 +29798,7 @@ Try \`$0 --help' for more information.";;
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) as_fn_error "unrecognized option: \`$1'
+  -*) as_fn_error $? "unrecognized option: \`$1'
 Try \`$0 --help' for more information." ;;
 
   *) as_fn_append ac_config_targets " $1"
@@ -23871,7 +29818,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -23912,8 +29859,9 @@ do
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
     "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
+    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
 
-  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -23947,12 +29896,13 @@ $debug ||
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -23969,12 +29919,12 @@ if test "x$ac_cr" = x; then
 fi
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\r'
+  ac_cs_awk_cr='\\r'
 else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -23983,18 +29933,18 @@ _ACEOF
   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
   echo "_ACEOF"
 } >conf$$subs.sh ||
-  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   . ./conf$$subs.sh ||
-    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
 
   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
   if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -24002,7 +29952,7 @@ done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -24050,7 +30000,7 @@ t delim
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = "\a"
 
@@ -24082,21 +30032,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[         ]*VPATH[        ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[    ]*\):*/\1/
+  ac_vpsub='/^[         ]*VPATH[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
 s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
 s/^[^=]*=[      ]*$//
 }'
 fi
@@ -24108,7 +30066,7 @@ fi # test -n "$CONFIG_FILES"
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -24120,11 +30078,11 @@ _ACEOF
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
-    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -24209,7 +30167,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
 fi # test -n "$CONFIG_HEADERS"
 
 
@@ -24222,7 +30180,7 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -24241,7 +30199,7 @@ do
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
         # (if the path is not absolute).  The absolute path cannot be DOS-style,
         # because $ac_f cannot contain `:'.
@@ -24250,8 +30208,7 @@ do
           [\\/$]*) false;;
           *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
           esac ||
-          { as_fn_set_status 1
-as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5; };;
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -24277,8 +30234,8 @@ $as_echo "$as_me: creating $ac_file" >&6;}
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -24414,23 +30371,24 @@ s&@INSTALL@&$ac_INSTALL&;t t
 s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&5
+which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&2;}
+which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
-  || as_fn_error "could not create $ac_file" "$LINENO" 5
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
   :H)
   #
@@ -24439,21 +30397,21 @@ which seems to be undefined.  Please make sure it is defined." >&2;}
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
-      || as_fn_error "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
-       || as_fn_error "could not create $ac_file" "$LINENO" 5
+      mv "$ac_tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error "could not create -" "$LINENO" 5
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
 # Compute "$ac_file"'s index in $config_headers.
 _am_arg="$ac_file"
@@ -24507,7 +30465,7 @@ $as_echo X"$_am_arg" |
 $as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
 
     if test ! -r "$ac_source"; then
-      as_fn_error "$ac_source: file not found" "$LINENO" 5
+      as_fn_error $? "$ac_source: file not found" "$LINENO" 5
     fi
     rm -f "$ac_file"
 
@@ -24519,7 +30477,7 @@ $as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
     ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
       ln "$ac_source" "$ac_file" 2>/dev/null ||
       cp -p "$ac_source" "$ac_file" ||
-      as_fn_error "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
+      as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
   fi
  ;;
   :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
@@ -24530,7 +30488,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
   case $ac_file$ac_mode in
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -24543,7 +30501,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
     # Strip MF so we end up with the name of the file.
     mf=`echo "$mf" | sed -e 's/:.*$//'`
     # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
+    # We used to match only the files named 'Makefile.in', but
     # some people rename them; so instead we look at the file content.
     # Grep'ing the first line is not enough: some people post-process
     # each Makefile.in and add a new line on top of each file to say so.
@@ -24577,21 +30535,19 @@ $as_echo X"$mf" |
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # from the Makefile without running 'make'.
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
     test -z "am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  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 "
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`$as_dirname -- "$file" ||
@@ -24634,7 +30590,7 @@ _ACEOF
 ac_clean_files=$ac_clean_files_save
 
 test $ac_write_fail = 0 ||
-  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
 
 
 # configure is writing to config.log, and then calls config.status.
index 818dbd9a724c387b4edd7005202b6f57a1c04093..4705ce4b386a68bfc2d730fc3ab0c77791a39905 100644 (file)
@@ -1,6 +1,6 @@
 # Configure template for gzip.
 
-# Copyright (C) 1999-2002, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 1999-2002, 2006-2007, 2009-2012 Free Software Foundation, Inc.
 
 # Copyright (C) 1992-1993 Jean-loup Gailly
 
@@ -21,8 +21,8 @@
 
 AC_PREREQ([2.60])
 AC_INIT([gzip],
-       m4_esyscmd([build-aux/git-version-gen .tarball-version]),
-       [bug-gzip@gnu.org])
+        m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+        [bug-gzip@gnu.org])
 
 AC_CONFIG_SRCDIR(gzip.c)
 AC_CONFIG_AUX_DIR(build-aux)
@@ -39,7 +39,6 @@ AC_PROG_RANLIB
 AC_PROG_SHELL
 
 gl_EARLY
-AC_SYS_LARGEFILE
 
 gl_INIT
 
@@ -104,6 +103,8 @@ if test "$gl_gcc_warnings" = yes; then
   gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
   gl_WARN_ADD([-Wno-overflow])         # util.c
   gl_WARN_ADD([-Wno-type-limits])      # util.c
+  gl_WARN_ADD([-Wno-format-nonliteral])
+  gl_WARN_ADD([-Wno-unsuffixed-float-constants])
 
   # In spite of excluding -Wlogical-op above, it is enabled, as of
   # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
@@ -130,14 +131,14 @@ if test "$gl_gcc_warnings" = yes; then
 fi
 
 # cc -E produces incorrect asm files on SVR4, so postprocess it.
-ASCPPPOST="sed '/^ *#/d; s,//.*,,; s/% /%/g; s/\\. /./g'"
+ASCPPPOST="sed '/^ *\\#/d; s,//.*,,; s/% /%/g; s/\\. /./g'"
 AC_SUBST([ASCPPPOST])
 
 AC_CACHE_CHECK([for underline in external names], [gzip_cv_underline],
   [gzip_cv_underline=yes
    AC_TRY_COMPILE([int foo() {return 0;}], [],
      [$NM conftest.$OBJEXT | grep _foo >/dev/null 2>&1 ||
-       gzip_cv_underline=no])])
+        gzip_cv_underline=no])])
 ASCPPFLAGS=
 if test $gzip_cv_underline = no; then
   ASCPPFLAGS='-DNO_UNDERLINE'
@@ -154,21 +155,21 @@ AC_CACHE_CHECK([for an assembler syntax supported by this package],
    *' NO_ASM '*) ;;
    *)
      if cp $srcdir/lib/match.c _match.S &&
-       eval "$CPP $CPPFLAGS $ASCPPFLAGS _match.S > _match.i" 2>/dev/null &&
-       eval "$ASCPPPOST < _match.i > match_.s" 2>/dev/null; then
+        eval "$CPP $CPPFLAGS $ASCPPFLAGS _match.S > _match.i" &&
+        eval "$ASCPPPOST < _match.i > match_.s"; then
        if test ! -s match_.s || grep error < match_.s > /dev/null; then
-        :
-       elif eval "$CC $CPPFLAGS $CFLAGS -c match_.s >/dev/null 2>&1" &&
-           test -f match_.$OBJEXT; then
-        rm -f match_.$OBJEXT
-        gzip_cv_assembler=yes
-        if echo 'void foo (void) {}' > conftest.c &&
-           eval "$CC $CPPFLAGS $CFLAGS -S conftest.c >/dev/null 2>&1" &&
-           grep '\.note\.GNU-stack' conftest.s >/dev/null 2>&1 &&
-           eval "$CC $CPPFLAGS $CFLAGS -c -Wa,--noexecstack match_.s >/dev/null 2>&1" &&
-           test -f match_.$OBJEXT; then
-          gzip_cv_assembler='yes, with -Wa,--noexecstack'
-        fi
+         :
+       elif eval "$CC $CPPFLAGS $CFLAGS -c match_.s >/dev/null" &&
+            test -f match_.$OBJEXT; then
+         rm -f match_.$OBJEXT
+         gzip_cv_assembler=yes
+         if echo 'void foo (void) {}' > conftest.c &&
+            eval "$CC $CPPFLAGS $CFLAGS -S conftest.c >/dev/null" &&
+            grep '\.note\.GNU-stack' conftest.s >/dev/null &&
+            eval "$CC $CPPFLAGS $CFLAGS -c -Wa,--noexecstack match_.s >/dev/null" &&
+            test -f match_.$OBJEXT; then
+           gzip_cv_assembler='yes, with -Wa,--noexecstack'
+         fi
        fi
      fi
      rm -f conftest* _match.i _match.S match_.s match_.$OBJEXT;;
@@ -195,5 +196,5 @@ AC_TYPE_SIGNAL
 AC_TYPE_SIZE_T
 AC_TYPE_OFF_T
 
-AC_CONFIG_FILES([Makefile doc/Makefile lib/Makefile])
+AC_CONFIG_FILES([Makefile doc/Makefile lib/Makefile tests/Makefile])
 AC_OUTPUT
diff --git a/crypt.c b/crypt.c
deleted file mode 100644 (file)
index ff14a7b..0000000
--- a/crypt.c
+++ /dev/null
@@ -1,5 +0,0 @@
-/* crypt.c (dummy version) -- do not perform encryption
- * Hardly worth copyrighting :-)
- */
-#include <config.h>
-typedef int dummy;
diff --git a/crypt.h b/crypt.h
deleted file mode 100644 (file)
index 2a4c203..0000000
--- a/crypt.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* crypt.h (dummy version) -- do not perform encryption
- * Hardly worth copyrighting :-)
- */
-
-#ifdef CRYPT
-#  undef CRYPT      /* dummy version */
-#endif
-
-#define RAND_HEAD_LEN  12  /* length of encryption random header */
-
-#define zencode
-#define zdecode
index 0950391ee88ba44a67a36ce4f1b14c87f79ebaa3..5405f10eff3f1ec546d00dfe4a57aeb9e4f04243 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -1,6 +1,6 @@
 /* deflate.c -- compress data using the deflation algorithm
 
-   Copyright (C) 1999, 2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2006, 2009-2012 Free Software Foundation, Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly
 
    This program is free software; you can redistribute it and/or modify
@@ -161,7 +161,7 @@ typedef unsigned IPos;
 /* DECLARE(Pos, head, 1<<HASH_BITS); */
 /* Heads of the hash chains or NIL. */
 
-ulg window_size = (ulg)2*WSIZE;
+static ulg window_size = (ulg)2*WSIZE;
 /* window size, 2*WSIZE except for MMAP or BIG_MEM, where it is the
  * input file length plus MIN_LOOKAHEAD.
  */
@@ -180,7 +180,7 @@ local unsigned ins_h;  /* hash index of string to be inserted */
  *   H_SHIFT * MIN_MATCH >= HASH_BITS
  */
 
-unsigned int near prev_length;
+       unsigned int near prev_length;
 /* Length of the best match at previous step. Matches not greater than this
  * are discarded. This is used in the lazy match evaluation.
  */
@@ -190,7 +190,7 @@ unsigned int near prev_length;
 local int           eofile;        /* flag set at end of input file */
 local unsigned      lookahead;     /* number of valid bytes ahead in window */
 
-unsigned near max_chain_length;
+       unsigned max_chain_length;
 /* To speed up deflation, hash chains are never searched beyond this length.
  * A higher limit improves compression ratio but degrades the speed.
  */
@@ -209,7 +209,7 @@ local unsigned int max_lazy_match;
 local int compr_level;
 /* compression level (1..9) */
 
-unsigned near good_match;
+unsigned good_match;
 /* Use a faster search when the previous match is longer than this */
 
 
@@ -226,10 +226,17 @@ typedef struct config {
    ush max_chain;
 } config;
 
+#ifdef ASMV
+# define static_unless_ASMV
+#else
+# define static_unless_ASMV static
+#endif
+
 #ifdef  FULL_SEARCH
 # define nice_match MAX_MATCH
 #else
-  int near nice_match; /* Stop searching when current match exceeds this */
+  /* Stop searching when current match exceeds this */
+  static_unless_ASMV int nice_match;
 #endif
 
 local config configuration_table[10] = {
@@ -254,21 +261,21 @@ local config configuration_table[10] = {
 /* ===========================================================================
  *  Prototypes for local functions.
  */
-local void fill_window   OF((void));
-local off_t deflate_fast OF((void));
+local void fill_window   (void);
+local off_t deflate_fast (void);
 
-      int  longest_match OF((IPos cur_match));
 #ifdef ASMV
-      void match_init OF((void)); /* asm code initialization */
+      int  longest_match (IPos cur_match);
+      void match_init (void); /* asm code initialization */
 #endif
 
 #ifdef DEBUG
-local  void check_match OF((IPos start, IPos match, int length));
+local  void check_match (IPos start, IPos match, int length);
 #endif
 
 /* ===========================================================================
  * Update a hash value with the given input byte
- * IN  assertion: all calls to to UPDATE_HASH are made with consecutive
+ * IN  assertion: all calls to UPDATE_HASH are made with consecutive
  *    input characters, so that a running hash key can be computed from the
  *    previous key instead of complete recalculation each time.
  */
@@ -278,7 +285,7 @@ local  void check_match OF((IPos start, IPos match, int length));
  * Insert string s in the dictionary and set match_head to the previous head
  * of the hash chain (the most recent string with same hash key). Return
  * the previous length of the hash chain.
- * IN  assertion: all calls to to INSERT_STRING are made with consecutive
+ * IN  assertion: all calls to INSERT_STRING are made with consecutive
  *    input characters and the first MIN_MATCH bytes of s are valid
  *    (except for the last MIN_MATCH-1 bytes of the input file).
  */
@@ -329,7 +336,7 @@ void lm_init (pack_level, flags)
 #endif
 
     lookahead = read_buf((char*)window,
-                        sizeof(int) <= 2 ? (unsigned)WSIZE : 2*WSIZE);
+                         sizeof(int) <= 2 ? (unsigned)WSIZE : 2*WSIZE);
 
     if (lookahead == 0 || lookahead == (unsigned)EOF) {
        eofile = 1, lookahead = 0;
@@ -361,8 +368,8 @@ void lm_init (pack_level, flags)
  * match.s. The code is functionally equivalent, so you can use the C version
  * if desired.
  */
-int longest_match(cur_match)
-    IPos cur_match;                             /* current match */
+static int
+longest_match(IPos cur_match)
 {
     unsigned chain_length = max_chain_length;   /* max hash chain length */
     register uch *scan = window + strstart;     /* current string */
@@ -481,7 +488,7 @@ int longest_match(cur_match)
 #endif
         }
     } while ((cur_match = prev[cur_match & WMASK]) > limit
-            && --chain_length != 0);
+             && --chain_length != 0);
 
     return best_len;
 }
@@ -564,6 +571,8 @@ local void fill_window()
         n = read_buf((char*)window+strstart+lookahead, more);
         if (n == 0 || n == (unsigned)EOF) {
             eofile = 1;
+            /* Don't let garbage pollute the dictionary.  */
+            memzero (window + strstart + lookahead, MIN_MATCH - 1);
         } else {
             lookahead += n;
         }
@@ -601,7 +610,7 @@ local off_t deflate_fast()
          * At this point we have always match_length < MIN_MATCH
          */
         if (hash_head != NIL && strstart - hash_head <= MAX_DIST
-           && strstart <= window_size - MIN_LOOKAHEAD) {
+            && strstart <= window_size - MIN_LOOKAHEAD) {
             /* To simplify the code, we prevent matches with the string
              * of window index 0 (in particular we have to avoid a match
              * of the string with itself at the start of the input file).
@@ -617,7 +626,7 @@ local off_t deflate_fast()
 
             lookahead -= match_length;
 
-           /* Insert new strings in the hash table only if the match length
+            /* Insert new strings in the hash table only if the match length
              * is not too large. This saves time but degrades compression.
              */
             if (match_length <= max_insert_length) {
@@ -631,12 +640,12 @@ local off_t deflate_fast()
                      * the next lookahead bytes will be emitted as literals.
                      */
                 } while (--match_length != 0);
-               strstart++;
+                strstart++;
             } else {
-               strstart += match_length;
-               match_length = 0;
-               ins_h = window[strstart];
-               UPDATE_HASH(ins_h, window[strstart+1]);
+                strstart += match_length;
+                match_length = 0;
+                ins_h = window[strstart];
+                UPDATE_HASH(ins_h, window[strstart+1]);
 #if MIN_MATCH != 3
                 Call UPDATE_HASH() MIN_MATCH-3 more times
 #endif
@@ -646,7 +655,7 @@ local off_t deflate_fast()
             Tracevv((stderr,"%c",window[strstart]));
             flush = ct_tally (0, window[strstart]);
             lookahead--;
-           strstart++;
+            strstart++;
         }
         if (flush) FLUSH_BLOCK(0), block_start = strstart;
 
diff --git a/dist-check.mk b/dist-check.mk
new file mode 100644 (file)
index 0000000..6287dfe
--- /dev/null
@@ -0,0 +1,197 @@
+# Most of this is probably too coreutils-centric to be useful to other packages.
+
+bin=bin-$$$$
+
+write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)'
+
+tmpdir = $(abs_top_builddir)/tests/torture
+
+t=$(tmpdir)/$(PACKAGE)/test
+pfx=$(t)/i
+
+built_programs =                                               \
+  $$(echo 'spy:;@echo $$(bin_PROGRAMS)'                                \
+    | MAKEFLAGS= $(MAKE) -s -f Makefile -f - spy               \
+    | fmt -1 | sed 's,$(EXEEXT)$$,,' | sort -u)
+
+# More than once, tainted build and source directory names would
+# have caused at least one "make check" test to apply "chmod 700"
+# to all directories under $HOME.  Make sure it doesn't happen again.
+tp = $(tmpdir)/taint
+t_prefix = $(tp)/a
+t_taint = '$(t_prefix) b'
+fake_home = $(tp)/home
+
+# When extracting from a distribution tarball, extract using the fastest
+# method possible.  With dist-xz, that means using the *.xz file.
+ifneq ('', $(filter *.xz, $(DIST_ARCHIVES)))
+  tar_decompress_opt_ = J
+  suffix_ = xz
+else
+  ifneq ('', $(filter *.gz, $(DIST_ARCHIVES)))
+    tar_decompress_opt_ = z
+    suffix_ = gz
+  else
+    tar_decompress_opt_ = j
+    suffix_ = bz2
+  endif
+endif
+amtar_extract_ = $(AMTAR) -$(tar_decompress_opt_)xf
+preferred_tarball_ = $(distdir).tar.$(suffix_)
+
+# Ensure that tests run from tainted build and src dir names work,
+# and don't affect anything in $HOME.  Create witness files in $HOME,
+# record their attributes, and build/test.  Then ensure that the
+# witnesses were not affected.
+# Skip this test when using libtool, since libtool-generated scripts
+# cannot deal with a space-tainted srcdir.
+ALL_RECURSIVE_TARGETS += taint-distcheck
+taint-distcheck: $(DIST_ARCHIVES)
+       grep '^[         ]*LT_INIT' configure.ac >/dev/null && exit 0 || :
+       test -d $(t_taint) && chmod -R 700 $(t_taint) || :
+       -rm -rf $(t_taint) $(fake_home)
+       mkdir -p $(t_prefix) $(t_taint) $(fake_home)
+       $(amtar_extract_) $(preferred_tarball_) -C $(t_taint)
+       mkfifo $(fake_home)/fifo
+       touch $(fake_home)/f
+       mkdir -p $(fake_home)/d/e
+       ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-before
+       HOME=$(fake_home); export HOME;                 \
+       cd $(t_taint)/$(distdir)                        \
+         && ./configure                                \
+         && $(MAKE)                                    \
+         && $(MAKE) check                              \
+         && ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-after \
+         && diff $(tp)/.ls-before $(tp)/.ls-after      \
+         && test -d $(t_prefix)
+       rm -rf $(tp)
+
+# Verify that a twisted use of --program-transform-name=PROGRAM works.
+define install-transform-check
+  echo running install-transform-check                 \
+    && rm -rf $(pfx)                                   \
+    && $(MAKE) program_transform_name='s/.*/zyx/'      \
+      prefix=$(pfx) install                            \
+    && test "$$(echo $(pfx)/bin/*)" = "$(pfx)/bin/zyx" \
+    && test "$$(find $(pfx)/share/man -type f|sed 's,.*/,,;s,\..*,,')" = "zyx"
+endef
+
+# Install, then verify that all binaries and man pages are in place.
+# Note that neither the binary, ginstall, nor the [.1 man page is installed.
+define my-instcheck
+  echo running my-instcheck;                           \
+  $(MAKE) prefix=$(pfx) install                                \
+    && test ! -f $(pfx)/bin/ginstall                   \
+    && { fail=0;                                       \
+      for i in $(built_programs); do                   \
+        test "$$i" = ginstall && i=install;            \
+        for j in "$(pfx)/bin/$$i"                      \
+                 "$(pfx)/share/man/man1/$$i.1"; do     \
+          case $$j in *'[.1') continue;; esac;         \
+          test -f "$$j" && :                           \
+            || { echo "$$j not installed"; fail=1; };  \
+        done;                                          \
+      done;                                            \
+      test $$fail = 1 && exit 1 || :;                  \
+    }
+endef
+
+# The hard-linking for-loop below ensures that there is a bin/ directory
+# full of all of the programs under test (except the ones that are required
+# for basic Makefile rules), all symlinked to the just-built "false" program.
+# This is to ensure that if ever a test neglects to make PATH include
+# the build srcdir, these always-failing programs will run.
+# Otherwise, it is too easy to test the wrong programs.
+# Note that "false" itself is a symlink to true, so it too will malfunction.
+define coreutils-path-check
+  {                                                    \
+    echo running coreutils-path-check;                 \
+    if test -f $(srcdir)/src/true.c; then              \
+      fail=1;                                          \
+      mkdir $(bin)                                     \
+       && ($(write_loser)) > $(bin)/loser              \
+       && chmod a+x $(bin)/loser                       \
+       && for i in $(built_programs); do               \
+              case $$i in                              \
+                rm|expr|basename|echo|sort|ls|tr);;    \
+                cat|dirname|mv|wc);;                   \
+                *) ln $(bin)/loser $(bin)/$$i;;        \
+              esac;                                    \
+            done                                       \
+         && ln -sf ../src/true $(bin)/false            \
+         && PATH=`pwd`/$(bin)$(PATH_SEPARATOR)$$PATH   \
+               $(MAKE) -C tests check                  \
+         && { test -d gnulib-tests                     \
+                && $(MAKE) -C gnulib-tests check       \
+                || :; }                                \
+         && rm -rf $(bin)                              \
+         && fail=0;                                    \
+    else                                               \
+      fail=0;                                          \
+    fi;                                                        \
+    test $$fail = 1 && exit 1 || :;                    \
+  }
+endef
+
+# More generic version of the rule above.
+define generic-path-check
+  {                                                    \
+    echo running generic-path-check;                   \
+    if test -f /bin/false; then                                \
+      fail=1;                                          \
+      mkdir $(bin)                                     \
+       && ($(write_loser)) > $(bin)/loser              \
+       && chmod a+x $(bin)/loser                       \
+       && for i in $(built_programs); do               \
+            ln $(bin)/loser $(bin)/$$i;                \
+          done                                         \
+       && PATH=`pwd`/$(bin)$(PATH_SEPARATOR)$$PATH     \
+            $(MAKE) check                              \
+       && { test -d gnulib-tests                       \
+              && $(MAKE) -C gnulib-tests check         \
+              || :; }                                  \
+       && rm -rf $(bin)                                \
+       && fail=0;                                      \
+    else                                               \
+      fail=0;                                          \
+    fi;                                                        \
+    test $$fail = 1 && exit 1 || :;                    \
+  }
+endef
+
+# Use this to make sure we don't run these programs when building
+# from a virgin compressed tarball file, below.
+null_AM_MAKEFLAGS ?= \
+  ACLOCAL=false \
+  AUTOCONF=false \
+  AUTOMAKE=false \
+  AUTOHEADER=false \
+  GPERF=false \
+  MAKEINFO=false
+
+ALL_RECURSIVE_TARGETS += my-distcheck
+my-distcheck: $(DIST_ARCHIVES) $(local-check)
+       $(MAKE) syntax-check
+       $(MAKE) check
+       -rm -rf $(t)
+       mkdir -p $(t)
+       $(amtar_extract_) $(preferred_tarball_) -C $(t)
+       (set -e; cd $(t)/$(distdir);                    \
+         ./configure --quiet --enable-gcc-warnings --disable-nls; \
+         $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)';  \
+         $(MAKE) dvi;                                  \
+         $(install-transform-check);                   \
+         $(my-instcheck);                              \
+         $(coreutils-path-check);                      \
+         $(generic-path-check);                        \
+         $(MAKE) distclean                             \
+       )
+       (cd $(t) && mv $(distdir) $(distdir).old        \
+         && $(amtar_extract_) - ) < $(preferred_tarball_)
+       diff -ur $(t)/$(distdir).old $(t)/$(distdir)
+       -rm -rf $(t)
+       rmdir $(tmpdir)/$(PACKAGE) $(tmpdir)
+       @echo "========================"; \
+       echo "ready for distribution:"; \
+       for i in $(DIST_ARCHIVES); do echo "  $$i"; done; \
+       echo "========================"
index aa8bec01b4bb449fb416398aa71fa4ddf016fcbf..777320f4c754213ecde492ca52ca76efc270f2fa 100644 (file)
@@ -1,6 +1,6 @@
 # Make gzip documentation.                             -*-Makefile-*-
 
-# Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009-2012 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
index dc67cbcdc86084ae3f1dab2ae251040cb97577da..55300091551d4ffa910014d8a4a2220d33497bf4 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11a from Makefile.am.
+# Makefile.in generated by automake 1.12a from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2012 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.
@@ -17,7 +16,7 @@
 
 # Make gzip documentation.                             -*-Makefile-*-
 
-# Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009-2012 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
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -53,115 +68,138 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = doc
-DIST_COMMON = $(gzip_TEXINFOS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(srcdir)/stamp-vti \
-       $(srcdir)/version.texi
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+       $(gzip_TEXINFOS) $(top_srcdir)/build-aux/mdate-sh \
+       $(srcdir)/version.texi $(srcdir)/stamp-vti \
+       $(top_srcdir)/build-aux/texinfo.tex
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
-       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/calloc.m4 \
-       $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/chown.m4 \
+       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \
+       $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/chdir-long.m4 \
        $(top_srcdir)/m4/clock_time.m4 \
        $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \
-       $(top_srcdir)/m4/closein.m4 $(top_srcdir)/m4/closeout.m4 \
-       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/d-ino.m4 \
-       $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
-       $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \
-       $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
-       $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
-       $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/exponentd.m4 \
+       $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closein.m4 \
+       $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
+       $(top_srcdir)/m4/configmake.m4 \
+       $(top_srcdir)/m4/dirent-safer.m4 $(top_srcdir)/m4/dirent_h.m4 \
+       $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
+       $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
+       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/errno_h.m4 \
+       $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exponentd.m4 \
        $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \
        $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \
        $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-o.m4 \
        $(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fcntl.m4 \
        $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopendir.m4 \
-       $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/float_h.m4 \
-       $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \
-       $(top_srcdir)/m4/fprintf-posix.m4 $(top_srcdir)/m4/fpurge.m4 \
-       $(top_srcdir)/m4/freading.m4 $(top_srcdir)/m4/frexp.m4 \
-       $(top_srcdir)/m4/frexpl.m4 $(top_srcdir)/m4/fseeko.m4 \
-       $(top_srcdir)/m4/ftello.m4 \
-       $(top_srcdir)/m4/getcwd-abort-bug.m4 \
-       $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
-       $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettime.m4 \
-       $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \
-       $(top_srcdir)/m4/gnu-make.m4 $(top_srcdir)/m4/gnulib-common.m4 \
+       $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/filenamecat.m4 \
+       $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fpending.m4 \
+       $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \
+       $(top_srcdir)/m4/fpurge.m4 $(top_srcdir)/m4/freading.m4 \
+       $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
+       $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
+       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/ftell.m4 \
+       $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/getcwd.m4 \
+       $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
+       $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+       $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \
+       $(top_srcdir)/m4/gnulib-common.m4 \
        $(top_srcdir)/m4/gnulib-comp.m4 \
        $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \
        $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \
        $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \
-       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/lchown.m4 \
-       $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/localcharset.m4 \
-       $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \
-       $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/longlong.m4 \
+       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/largefile.m4 \
+       $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/lib-ignore.m4 \
+       $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+       $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
+       $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \
+       $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \
        $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
        $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/manywarnings.m4 \
        $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbrtowc.m4 \
        $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \
        $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mempcpy.m4 \
-       $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mkdir.m4 \
-       $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
-       $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nocrash.m4 \
+       $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+       $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
+       $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+       $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
        $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \
+       $(top_srcdir)/m4/opendir.m4 $(top_srcdir)/m4/pathmax.m4 \
        $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/printf-frexp.m4 \
        $(top_srcdir)/m4/printf-frexpl.m4 \
        $(top_srcdir)/m4/printf-posix-rpl.m4 \
        $(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/quotearg.m4 \
-       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/rmdir.m4 \
-       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/shell.m4 \
-       $(top_srcdir)/m4/signbit.m4 $(top_srcdir)/m4/size_max.m4 \
+       $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/realloc.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \
+       $(top_srcdir)/m4/shell.m4 $(top_srcdir)/m4/signbit.m4 \
+       $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/ssize_t.m4 \
        $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
        $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
        $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
        $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
        $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
-       $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/sys_stat_h.m4 \
-       $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/time_h.m4 \
-       $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/unistd-safer.m4 \
-       $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlink.m4 \
+       $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \
+       $(top_srcdir)/m4/sys_socket_h.m4 \
+       $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
+       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/threadlib.m4 \
+       $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/timespec.m4 \
+       $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
        $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/m4/utimens.m4 \
        $(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \
        $(top_srcdir)/m4/vfprintf-posix.m4 \
        $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \
-       $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \
-       $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \
-       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \
-       $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/yesno.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
+       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
+       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+       $(top_srcdir)/m4/yesno.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/lib/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
 am__v_GEN_0 = @echo "  GEN     " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
 am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-AM_V_DVIPS = $(am__v_DVIPS_$(V))
-am__v_DVIPS_ = $(am__v_DVIPS_$(AM_DEFAULT_VERBOSITY))
+AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
+am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
 am__v_DVIPS_0 = @echo "  DVIPS   " $@;
-AM_V_MAKEINFO = $(am__v_MAKEINFO_$(V))
-am__v_MAKEINFO_ = $(am__v_MAKEINFO_$(AM_DEFAULT_VERBOSITY))
+am__v_DVIPS_1 = 
+AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
+am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
 am__v_MAKEINFO_0 = @echo "  MAKEINFO" $@;
-AM_V_INFOHTML = $(am__v_INFOHTML_$(V))
-am__v_INFOHTML_ = $(am__v_INFOHTML_$(AM_DEFAULT_VERBOSITY))
+am__v_MAKEINFO_1 = 
+AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
+am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
 am__v_INFOHTML_0 = @echo "  INFOHTML" $@;
-AM_V_TEXI2DVI = $(am__v_TEXI2DVI_$(V))
-am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_$(AM_DEFAULT_VERBOSITY))
+am__v_INFOHTML_1 = 
+AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
+am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
 am__v_TEXI2DVI_0 = @echo "  TEXI2DVI" $@;
-AM_V_TEXI2PDF = $(am__v_TEXI2PDF_$(V))
-am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_$(AM_DEFAULT_VERBOSITY))
+am__v_TEXI2DVI_1 = 
+AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
+am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
 am__v_TEXI2PDF_0 = @echo "  TEXI2PDF" $@;
-AM_V_texinfo = $(am__v_texinfo_$(V))
-am__v_texinfo_ = $(am__v_texinfo_$(AM_DEFAULT_VERBOSITY))
+am__v_TEXI2PDF_1 = 
+AM_V_texinfo = $(am__v_texinfo_@AM_V@)
+am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
 am__v_texinfo_0 = -q
-AM_V_texidevnull = $(am__v_texidevnull_$(V))
-am__v_texidevnull_ = $(am__v_texidevnull_$(AM_DEFAULT_VERBOSITY))
+am__v_texinfo_1 = 
+AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
+am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
 am__v_texidevnull_0 = > /dev/null
+am__v_texidevnull_1 = 
 INFO_DEPS = $(srcdir)/gzip.info
 TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex
 am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux
@@ -175,6 +213,11 @@ TEXI2PDF = $(TEXI2DVI) --pdf --batch
 MAKEINFOHTML = $(MAKEINFO) --html
 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
 DVIPS = dvips
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__installdirs = "$(DESTDIR)$(infodir)"
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
@@ -197,16 +240,27 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+pkglibexecdir = @pkglibexecdir@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
 ASCPPFLAGS = @ASCPPFLAGS@
 ASCPPPOST = @ASCPPPOST@
 ASFLAGS_config = @ASFLAGS_config@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -219,6 +273,7 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CONFIG_INCLUDE = @CONFIG_INCLUDE@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CYGPATH_W = @CYGPATH_W@
@@ -239,47 +294,89 @@ EXEEXT = @EXEEXT@
 FLOAT_H = @FLOAT_H@
 GETOPT_H = @GETOPT_H@
 GLIBC21 = @GLIBC21@
+GNULIB_ACOSF = @GNULIB_ACOSF@
 GNULIB_ACOSL = @GNULIB_ACOSL@
 GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
+GNULIB_ASINF = @GNULIB_ASINF@
 GNULIB_ASINL = @GNULIB_ASINL@
+GNULIB_ATAN2F = @GNULIB_ATAN2F@
+GNULIB_ATANF = @GNULIB_ATANF@
 GNULIB_ATANL = @GNULIB_ATANL@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CBRT = @GNULIB_CBRT@
+GNULIB_CBRTF = @GNULIB_CBRTF@
+GNULIB_CBRTL = @GNULIB_CBRTL@
+GNULIB_CEIL = @GNULIB_CEIL@
 GNULIB_CEILF = @GNULIB_CEILF@
 GNULIB_CEILL = @GNULIB_CEILL@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
+GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
+GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
+GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
+GNULIB_COSF = @GNULIB_COSF@
+GNULIB_COSHF = @GNULIB_COSHF@
 GNULIB_COSL = @GNULIB_COSL@
 GNULIB_DIRFD = @GNULIB_DIRFD@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_EXP2 = @GNULIB_EXP2@
+GNULIB_EXP2F = @GNULIB_EXP2F@
+GNULIB_EXP2L = @GNULIB_EXP2L@
+GNULIB_EXPF = @GNULIB_EXPF@
 GNULIB_EXPL = @GNULIB_EXPL@
+GNULIB_EXPM1 = @GNULIB_EXPM1@
+GNULIB_EXPM1F = @GNULIB_EXPM1F@
+GNULIB_EXPM1L = @GNULIB_EXPM1L@
+GNULIB_FABSF = @GNULIB_FABSF@
+GNULIB_FABSL = @GNULIB_FABSL@
 GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
 GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
 GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
 GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
+GNULIB_FLOOR = @GNULIB_FLOOR@
 GNULIB_FLOORF = @GNULIB_FLOORF@
 GNULIB_FLOORL = @GNULIB_FLOORL@
+GNULIB_FMA = @GNULIB_FMA@
+GNULIB_FMAF = @GNULIB_FMAF@
+GNULIB_FMAL = @GNULIB_FMAL@
+GNULIB_FMOD = @GNULIB_FMOD@
+GNULIB_FMODF = @GNULIB_FMODF@
+GNULIB_FMODL = @GNULIB_FMODL@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
 GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FREXP = @GNULIB_FREXP@
+GNULIB_FREXPF = @GNULIB_FREXPF@
 GNULIB_FREXPL = @GNULIB_FREXPL@
+GNULIB_FSCANF = @GNULIB_FSCANF@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
 GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
@@ -287,6 +384,8 @@ GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
 GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
@@ -299,18 +398,46 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_HYPOT = @GNULIB_HYPOT@
+GNULIB_HYPOTF = @GNULIB_HYPOTF@
+GNULIB_HYPOTL = @GNULIB_HYPOTL@
+GNULIB_ILOGB = @GNULIB_ILOGB@
+GNULIB_ILOGBF = @GNULIB_ILOGBF@
+GNULIB_ILOGBL = @GNULIB_ILOGBL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISFINITE = @GNULIB_ISFINITE@
 GNULIB_ISINF = @GNULIB_ISINF@
 GNULIB_ISNAN = @GNULIB_ISNAN@
 GNULIB_ISNAND = @GNULIB_ISNAND@
 GNULIB_ISNANF = @GNULIB_ISNANF@
 GNULIB_ISNANL = @GNULIB_ISNANL@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LDEXPF = @GNULIB_LDEXPF@
 GNULIB_LDEXPL = @GNULIB_LDEXPL@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOG = @GNULIB_LOG@
+GNULIB_LOG10 = @GNULIB_LOG10@
+GNULIB_LOG10F = @GNULIB_LOG10F@
+GNULIB_LOG10L = @GNULIB_LOG10L@
+GNULIB_LOG1P = @GNULIB_LOG1P@
+GNULIB_LOG1PF = @GNULIB_LOG1PF@
+GNULIB_LOG1PL = @GNULIB_LOG1PL@
+GNULIB_LOG2 = @GNULIB_LOG2@
+GNULIB_LOG2F = @GNULIB_LOG2F@
+GNULIB_LOG2L = @GNULIB_LOG2L@
+GNULIB_LOGB = @GNULIB_LOGB@
+GNULIB_LOGBF = @GNULIB_LOGBF@
+GNULIB_LOGBL = @GNULIB_LOGBL@
+GNULIB_LOGF = @GNULIB_LOGF@
 GNULIB_LOGL = @GNULIB_LOGL@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
@@ -334,6 +461,7 @@ GNULIB_MBSSEP = @GNULIB_MBSSEP@
 GNULIB_MBSSPN = @GNULIB_MBSSPN@
 GNULIB_MBSSTR = @GNULIB_MBSSTR@
 GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
 GNULIB_MEMCHR = @GNULIB_MEMCHR@
 GNULIB_MEMMEM = @GNULIB_MEMMEM@
 GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
@@ -348,43 +476,73 @@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
 GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
 GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_MODF = @GNULIB_MODF@
+GNULIB_MODFF = @GNULIB_MODFF@
+GNULIB_MODFL = @GNULIB_MODFL@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_OPEN = @GNULIB_OPEN@
 GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_OPENDIR = @GNULIB_OPENDIR@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
 GNULIB_PIPE2 = @GNULIB_PIPE2@
 GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_POWF = @GNULIB_POWF@
 GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
+GNULIB_READDIR = @GNULIB_READDIR@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
 GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_REMAINDER = @GNULIB_REMAINDER@
+GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
+GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
 GNULIB_REMOVE = @GNULIB_REMOVE@
 GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
+GNULIB_RINT = @GNULIB_RINT@
+GNULIB_RINTF = @GNULIB_RINTF@
+GNULIB_RINTL = @GNULIB_RINTL@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_ROUND = @GNULIB_ROUND@
 GNULIB_ROUNDF = @GNULIB_ROUNDF@
 GNULIB_ROUNDL = @GNULIB_ROUNDL@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SCANDIR = @GNULIB_SCANDIR@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
+GNULIB_SINF = @GNULIB_SINF@
+GNULIB_SINHF = @GNULIB_SINHF@
 GNULIB_SINL = @GNULIB_SINL@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_SQRTF = @GNULIB_SQRTF@
 GNULIB_SQRTL = @GNULIB_SQRTL@
 GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
 GNULIB_STPCPY = @GNULIB_STPCPY@
 GNULIB_STPNCPY = @GNULIB_STPNCPY@
@@ -392,9 +550,12 @@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
 GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
 GNULIB_STRDUP = @GNULIB_STRDUP@
 GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
 GNULIB_STRNDUP = @GNULIB_STRNDUP@
 GNULIB_STRNLEN = @GNULIB_STRNLEN@
 GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
 GNULIB_STRSEP = @GNULIB_STRSEP@
 GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
 GNULIB_STRSTR = @GNULIB_STRSTR@
@@ -405,14 +566,23 @@ GNULIB_STRTOULL = @GNULIB_STRTOULL@
 GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
 GNULIB_SYMLINK = @GNULIB_SYMLINK@
 GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TANF = @GNULIB_TANF@
+GNULIB_TANHF = @GNULIB_TANHF@
 GNULIB_TANL = @GNULIB_TANL@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TRUNC = @GNULIB_TRUNC@
 GNULIB_TRUNCF = @GNULIB_TRUNCF@
 GNULIB_TRUNCL = @GNULIB_TRUNCL@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
 GNULIB_USLEEP = @GNULIB_USLEEP@
 GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
@@ -420,51 +590,129 @@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
 GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
 GNULIB_VPRINTF = @GNULIB_VPRINTF@
 GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
 GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
 GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
 GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
 GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
 GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
 GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
 GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GREP = @GREP@
+HAVE_ACOSF = @HAVE_ACOSF@
 HAVE_ACOSL = @HAVE_ACOSL@
 HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ASINF = @HAVE_ASINF@
 HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
 HAVE_ATANL = @HAVE_ATANL@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
 HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
 HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
 HAVE_COSL = @HAVE_COSL@
 HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
 HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
 HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
 HAVE_DECL_COSL = @HAVE_DECL_COSL@
 HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
 HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
 HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
 HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
 HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SINL = @HAVE_DECL_SINL@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
-HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
@@ -472,24 +720,45 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_TANL = @HAVE_DECL_TANL@
 HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DIRENT_H = @HAVE_DIRENT_H@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
 HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXPF = @HAVE_EXPF@
 HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
 HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FDOPENDIR = @HAVE_FDOPENDIR@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
 HAVE_FUTIMENS = @HAVE_FUTIMENS@
-HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
 HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
@@ -497,26 +766,43 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISNAND = @HAVE_ISNAND@
 HAVE_ISNANF = @HAVE_ISNANF@
 HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
 HAVE_LCHMOD = @HAVE_LCHMOD@
 HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
 HAVE_LINK = @HAVE_LINK@
 HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
 HAVE_LOGL = @HAVE_LOGL@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
 HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
 HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
@@ -526,27 +812,52 @@ HAVE_MKNOD = @HAVE_MKNOD@
 HAVE_MKNODAT = @HAVE_MKNODAT@
 HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OPENDIR = @HAVE_OPENDIR@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READDIR = @HAVE_READDIR@
 HAVE_READLINK = @HAVE_READLINK@
 HAVE_READLINKAT = @HAVE_READLINKAT@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
 HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_REWINDDIR = @HAVE_REWINDDIR@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
 HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
 HAVE_SINL = @HAVE_SINL@
 HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
 HAVE_SQRTL = @HAVE_SQRTL@
 HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
@@ -554,6 +865,7 @@ HAVE_STPNCPY = @HAVE_STPNCPY@
 HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
 HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
@@ -569,10 +881,13 @@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
-HAVE_UNSETENV = @HAVE_UNSETENV@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
 HAVE_USLEEP = @HAVE_USLEEP@
 HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
@@ -580,12 +895,45 @@ HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
 HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMSET = @HAVE_WMEMSET@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+IGNORE_UNUSED_LIBRARIES_CFLAGS = @IGNORE_UNUSED_LIBRARIES_CFLAGS@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
 INSTALL = @INSTALL@
@@ -597,8 +945,12 @@ LDFLAGS = @LDFLAGS@
 LIBGZIP_LIBDEPS = @LIBGZIP_LIBDEPS@
 LIBGZIP_LTLIBDEPS = @LIBGZIP_LTLIBDEPS@
 LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
 LN_S = @LN_S@
 LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
@@ -606,7 +958,10 @@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
 LOCALE_JA = @LOCALE_JA@
 LOCALE_ZH_CN = @LOCALE_ZH_CN@
 LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
@@ -622,6 +977,7 @@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
 NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
@@ -639,6 +995,7 @@ NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
@@ -653,32 +1010,52 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
 PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
 REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
 REPLACE_CEILF = @REPLACE_CEILF@
 REPLACE_CEILL = @REPLACE_CEILL@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
+REPLACE_DIRFD = @REPLACE_DIRFD@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
 REPLACE_DUP = @REPLACE_DUP@
 REPLACE_DUP2 = @REPLACE_DUP2@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_FABSL = @REPLACE_FABSL@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FLOOR = @REPLACE_FLOOR@
 REPLACE_FLOORF = @REPLACE_FLOORF@
 REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
 REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
 REPLACE_FREXPL = @REPLACE_FREXPL@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
@@ -686,30 +1063,59 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
 REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISFINITE = @REPLACE_ISFINITE@
 REPLACE_ISINF = @REPLACE_ISINF@
 REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LDEXPL = @REPLACE_LDEXPL@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
 REPLACE_MEMCHR = @REPLACE_MEMCHR@
 REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
@@ -717,6 +1123,9 @@ REPLACE_MKFIFO = @REPLACE_MKFIFO@
 REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
 REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
 REPLACE_NAN = @REPLACE_NAN@
 REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
 REPLACE_NULL = @REPLACE_NULL@
@@ -728,9 +1137,17 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
 REPLACE_REMOVE = @REPLACE_REMOVE@
 REPLACE_RENAME = @REPLACE_RENAME@
 REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
@@ -744,20 +1161,32 @@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
 REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
 REPLACE_STRNDUP = @REPLACE_STRNDUP@
-REPLACE_STRPTIME = @REPLACE_STRPTIME@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
 REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
 REPLACE_UNSETENV = @REPLACE_UNSETENV@
@@ -772,7 +1201,9 @@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
 REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
 REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 REPLACE_WRITE = @REPLACE_WRITE@
 SET_MAKE = @SET_MAKE@
@@ -783,7 +1214,6 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
-SYS_TIME_H = @SYS_TIME_H@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -792,8 +1222,9 @@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOC
 VERSION = @VERSION@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WERROR_CFLAGS = @WERROR_CFLAGS@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -821,6 +1252,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -832,10 +1264,10 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+lispdir = @lispdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
-mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -912,12 +1344,12 @@ $(am__aclocal_m4_deps):
 .texi.dvi:
        $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
        MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-       $(TEXI2DVI) $(AM_V_texinfo) $< $(AM_V_texidevnull)
+       $(TEXI2DVI) $(AM_V_texinfo) --clean $< $(AM_V_texidevnull)
 
 .texi.pdf:
        $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
        MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-       $(TEXI2PDF) $(AM_V_texinfo) $< $(AM_V_texidevnull)
+       $(TEXI2PDF) $(AM_V_texinfo) --clean $< $(AM_V_texidevnull)
 
 .texi.html:
        $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
@@ -979,9 +1411,7 @@ uninstall-html-am:
 
 uninstall-info-am:
        @$(PRE_UNINSTALL)
-       @if test -d '$(DESTDIR)$(infodir)' && \
-           (install-info --version && \
-            install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+       @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
          list='$(INFO_DEPS)'; \
          for file in $$list; do \
            relfile=`echo "$$file" | sed 's|^.*/||'`; \
@@ -1111,10 +1541,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
 
 clean-generic:
@@ -1152,8 +1587,11 @@ install-dvi: install-dvi-am
 
 install-dvi-am: $(DVIS)
        @$(NORMAL_INSTALL)
-       test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)"
        @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -1168,18 +1606,22 @@ install-html: install-html-am
 
 install-html-am: $(HTMLS)
        @$(NORMAL_INSTALL)
-       test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
        @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
          $(am__strip_dir) \
-         if test -d "$$d$$p"; then \
+         d2=$$d$$p; \
+         if test -d "$$d2"; then \
            echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
            $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
-           echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
-           $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
+           echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+           $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
          else \
-           list2="$$list2 $$d$$p"; \
+           list2="$$list2 $$d2"; \
          fi; \
        done; \
        test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
@@ -1191,9 +1633,12 @@ install-info: install-info-am
 
 install-info-am: $(INFO_DEPS)
        @$(NORMAL_INSTALL)
-       test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)"
        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
        list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
+       fi; \
        for file in $$list; do \
          case $$file in \
            $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
@@ -1211,8 +1656,7 @@ install-info-am: $(INFO_DEPS)
          echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
          $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
        @$(POST_INSTALL)
-       @if (install-info --version && \
-            install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+       @if $(am__can_run_installinfo); then \
          list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
          for file in $$list; do \
            relfile=`echo "$$file" | sed 's|^.*/||'`; \
@@ -1226,8 +1670,11 @@ install-pdf: install-pdf-am
 
 install-pdf-am: $(PDFS)
        @$(NORMAL_INSTALL)
-       test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
        @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
@@ -1239,8 +1686,11 @@ install-ps: install-ps-am
 
 install-ps-am: $(PSS)
        @$(NORMAL_INSTALL)
-       test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)"
        @list='$(PSS)'; test -n "$(psdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
+       fi; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
index 8805f1a47d95e35dd768a735ccf9ec951ba29f06..cb71f05a175f841e91d37d73f2ac911100e40e7b 100644 (file)
@@ -92,16 +92,16 @@ An image format is not Transparent if used for any substantial amount
 of text.  A copy that is not ``Transparent'' is called ``Opaque''.
 
 Examples of suitable formats for Transparent copies include plain
-@sc{ascii} without markup, Texinfo input format, La@TeX{} input
-format, @acronym{SGML} or @acronym{XML} using a publicly available
-@acronym{DTD}, and standard-conforming simple @acronym{HTML},
-PostScript or @acronym{PDF} designed for human modification.  Examples
-of transparent image formats include @acronym{PNG}, @acronym{XCF} and
-@acronym{JPG}.  Opaque formats include proprietary formats that can be
-read and edited only by proprietary word processors, @acronym{SGML} or
-@acronym{XML} for which the @acronym{DTD} and/or processing tools are
-not generally available, and the machine-generated @acronym{HTML},
-PostScript or @acronym{PDF} produced by some word processors for
+ASCII without markup, Texinfo input format, La@TeX{} input
+format, SGML or XML using a publicly available
+DTD, and standard-conforming simple HTML,
+PostScript or PDF designed for human modification.  Examples
+of transparent image formats include PNG, XCF and
+JPG.  Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, SGML or
+XML for which the DTD and/or processing tools are
+not generally available, and the machine-generated HTML,
+PostScript or PDF produced by some word processors for
 output purposes only.
 
 The ``Title Page'' means, for a printed book, the title page itself,
@@ -481,7 +481,7 @@ license notices just after the title page:
 @end smallexample
 
 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with@dots{}Texts.'' line with this:
+replace the ``with@dots{}Texts.''@: line with this:
 
 @smallexample
 @group
@@ -503,4 +503,3 @@ to permit their use in free software.
 @c Local Variables:
 @c ispell-local-pdict: "ispell-dict"
 @c End:
-
index 383a3ddcb084ef38522efe32ec482ea8c2e076dd..4c633b142dcd914fe122e3c42c238896864cd2b3 100644 (file)
@@ -1,9 +1,9 @@
 This is gzip.info, produced by makeinfo version 4.13 from gzip.texi.
 
-This manual is for GNU Gzip (version 1.4, 3 January 2010), and
+This manual is for GNU Gzip (version 1.5, 1 January 2012), and
 documents commands for compressing and decompressing data.
 
-   Copyright (C) 1998-1999, 2001-2002, 2006-2007, 2009-2010 Free
+   Copyright (C) 1998-1999, 2001-2002, 2006-2007, 2009-2012 Free
 Software Foundation, Inc.
 
    Copyright (C) 1992, 1993 Jean-loup Gailly
@@ -37,10 +37,10 @@ File: gzip.info,  Node: Top,  Next: Overview,  Up: (dir)
 GNU Gzip: General file (de)compression
 **************************************
 
-This manual is for GNU Gzip (version 1.4, 3 January 2010), and
+This manual is for GNU Gzip (version 1.5, 1 January 2012), and
 documents commands for compressing and decompressing data.
 
-   Copyright (C) 1998-1999, 2001-2002, 2006-2007, 2009-2010 Free
+   Copyright (C) 1998-1999, 2001-2002, 2006-2007, 2009-2012 Free
 Software Foundation, Inc.
 
    Copyright (C) 1992, 1993 Jean-loup Gailly
@@ -208,7 +208,7 @@ stopping on the first failure:
      find . -name '*
      *' -prune -o -name '*.gz' -type f -print |
        sed "
-         s/'/'\\''/g
+         s/'/'\\\\''/g
          s/^\\(.*\\)\\.gz$/gunzip <'\\1.gz' >'\\1'/
        " |
        sh -e
@@ -972,12 +972,12 @@ Tag Table:
 Node: Top\7f1472
 Node: Overview\7f2683
 Node: Sample\7f7891
-Node: Invoking gzip\7f9827
-Node: Advanced usage\7f14819
-Node: Environment\7f16406
-Node: Tapes\7f16971
-Node: Problems\7f17988
-Node: GNU Free Documentation License\7f18458
-Node: Concept index\7f43626
+Node: Invoking gzip\7f9829
+Node: Advanced usage\7f14821
+Node: Environment\7f16408
+Node: Tapes\7f16973
+Node: Problems\7f17990
+Node: GNU Free Documentation License\7f18460
+Node: Concept index\7f43628
 \1f
 End Tag Table
index a6009d2ada14c9882b84317a6a41d716d5256f48..8220960326b622a4f76a232a1ea61654f96459a0 100644 (file)
@@ -11,7 +11,7 @@ This manual is for GNU Gzip
 (version @value{VERSION}, @value{UPDATED}),
 and documents commands for compressing and decompressing data.
 
-Copyright @copyright{} 1998-1999, 2001-2002, 2006-2007, 2009-2010 Free Software
+Copyright @copyright{} 1998-1999, 2001-2002, 2006-2007, 2009-2012 Free Software
 Foundation, Inc.
 
 Copyright @copyright{} 1992, 1993 Jean-loup Gailly
@@ -228,7 +228,7 @@ stopping on the first failure:
 find . -name '*
 *' -prune -o -name '*.gz' -type f -print |
   sed "
-    s/'/'\\''/g
+    s/'/'\\\\''/g
     s/^\\(.*\\)\\.gz$/gunzip <'\\1.gz' >'\\1'/
   " |
   sh -e
index b13841ae2222916ecd3b3a2e1613e6a0fac75919..cc5a4fa6f325e9fb5b993630b4e9a20cdaf74eda 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 3 January 2010
-@set UPDATED-MONTH January 2010
-@set EDITION 1.4
-@set VERSION 1.4
+@set UPDATED 1 January 2012
+@set UPDATED-MONTH January 2012
+@set EDITION 1.5
+@set VERSION 1.5
index b13841ae2222916ecd3b3a2e1613e6a0fac75919..cc5a4fa6f325e9fb5b993630b4e9a20cdaf74eda 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 3 January 2010
-@set UPDATED-MONTH January 2010
-@set EDITION 1.4
-@set VERSION 1.4
+@set UPDATED 1 January 2012
+@set UPDATED-MONTH January 2012
+@set EDITION 1.5
+@set VERSION 1.5
index 64e9764f28a36ed70e41e81653833dd9b6937db5..2668d80246e005f2aeda5b5e59a7d8f3a0d8e770 100644 (file)
--- a/gunzip.in
+++ b/gunzip.in
@@ -24,7 +24,7 @@ esac
 PATH=$bindir:$PATH
 
 version="gunzip (gzip) @VERSION@
-Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+Copyright (C) 2007, 2011-2012 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
index e59b5fc38c9a4a53f93f8be65e5eb097b077e965..de5ffb25f2b45772e51e0c00f61cb5d244999426 100644 (file)
--- a/gzexe.in
+++ b/gzexe.in
@@ -36,7 +36,7 @@ nl='
 IFS=" $tab$nl"
 
 version='gzexe (gzip) @VERSION@
-Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+Copyright (C) 2007, 2011-2012 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
diff --git a/gzip.1 b/gzip.1
index bdf69435c8c9ade9141b038a81e1445a82e898c0..8db327d58c82924694ba4cf0a19a501bcc89ceb7 100644 (file)
--- a/gzip.1
+++ b/gzip.1
@@ -291,15 +291,14 @@ will descend into the directory and compress all the files it finds there
 ).
 .TP
 .B \-S .suf   --suffix .suf
-Use suffix .suf instead of .gz. Any suffix can be given, but suffixes
+When compressing, use suffix .suf instead of .gz.
+Any non-empty suffix can be given, but suffixes
 other than .z and .gz should be avoided to avoid confusion when files
-are transferred to other systems.  A null suffix forces gunzip to  try
-decompression on all given files regardless of suffix, as in:
+are transferred to other systems.
 
-    gunzip -S "" *       (*.* for MSDOS)
+When decompressing, add .suf to the beginning of the list of
+suffixes to try, when deriving an output file name from an input file name.
 
-Previous versions of gzip used
-the .z suffix. This was changed to avoid a conflict with
 .IR pack "(1)".
 .TP
 .B \-t --test
diff --git a/gzip.c b/gzip.c
index 9e2a890fc12040575a848a90f965ffe48d1ef1db..35b36031f4f3f9739c442578f7e308e7894eed53 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -1,6 +1,6 @@
 /* gzip (GNU zip) -- compress files with zip algorithm and 'compress' interface
 
-   Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2010 Free Software
+   Copyright (C) 1999, 2001-2002, 2006-2007, 2009-2012 Free Software
    Foundation, Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly
 
@@ -29,7 +29,7 @@
  */
 
 static char const *const license_msg[] = {
-"Copyright (C) 2007 Free Software Foundation, Inc.",
+"Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.",
 "Copyright (C) 1993 Jean-loup Gailly.",
 "This is free software.  You may redistribute copies of it under the terms of",
 "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.",
@@ -58,6 +58,7 @@ static char const *const license_msg[] = {
 #include <ctype.h>
 #include <sys/types.h>
 #include <signal.h>
+#include <stdbool.h>
 #include <sys/stat.h>
 #include <errno.h>
 
@@ -66,13 +67,15 @@ static char const *const license_msg[] = {
 #include "gzip.h"
 #include "lzw.h"
 #include "revision.h"
+#include "timespec.h"
 
 #include "fcntl-safer.h"
 #include "getopt.h"
 #include "ignore-value.h"
 #include "stat-time.h"
+#include "version.h"
 
-               /* configuration */
+                /* configuration */
 
 #include <fcntl.h>
 #include <limits.h>
@@ -85,15 +88,7 @@ static char const *const license_msg[] = {
 #endif
 #if !NO_DIR
 # include <dirent.h>
-# ifndef _D_EXACT_NAMLEN
-#  define _D_EXACT_NAMLEN(dp) strlen ((dp)->d_name)
-# endif
-#endif
-
-#ifdef CLOSEDIR_VOID
-# define CLOSEDIR(d) (closedir(d), 0)
-#else
-# define CLOSEDIR(d) closedir(d)
+# include <savedir.h>
 #endif
 
 #ifndef NO_UTIME
@@ -115,7 +110,7 @@ static char const *const license_msg[] = {
 #endif
 
 #ifdef off_t
-  off_t lseek OF((int fd, off_t offset, int whence));
+  off_t lseek (int fd, off_t offset, int whence);
 #endif
 
 #ifndef OFF_T_MIN
@@ -141,10 +136,6 @@ static char const *const license_msg[] = {
 # define HAVE_WORKING_O_NOFOLLOW 0
 #endif
 
-#ifndef ELOOP
-# define ELOOP EINVAL
-#endif
-
 /* Separator for file name parts (see shorten_name()) */
 #ifdef NO_MULTIPLE_DOTS
 #  define PART_SEP "-"
@@ -152,7 +143,7 @@ static char const *const license_msg[] = {
 #  define PART_SEP "."
 #endif
 
-               /* global buffers */
+                /* global buffers */
 
 DECLARE(uch, inbuf,  INBUFSIZ +INBUF_EXTRA);
 DECLARE(uch, outbuf, OUTBUFSIZ+OUTBUF_EXTRA);
@@ -165,35 +156,39 @@ DECLARE(uch, window, 2L*WSIZE);
     DECLARE(ush, tab_prefix1, 1L<<(BITS-1));
 #endif
 
-               /* local variables */
-
-int ascii = 0;        /* convert end-of-lines to local OS conventions */
-int to_stdout = 0;    /* output to stdout (-c) */
-int decompress = 0;   /* decompress (-d) */
-int force = 0;        /* don't ask questions, compress links (-f) */
-int no_name = -1;     /* don't save or restore the original file name */
-int no_time = -1;     /* don't save or restore the original file time */
-int recursive = 0;    /* recurse through directories (-r) */
-int list = 0;         /* list the file contents (-l) */
-int verbose = 0;      /* be verbose (-v) */
-int quiet = 0;        /* be very quiet (-q) */
-int do_lzw = 0;       /* generate output compatible with old compress (-Z) */
-int test = 0;         /* test .gz file integrity */
-int foreground = 0;   /* set if program run in foreground */
-char *program_name;   /* program name */
-int maxbits = BITS;   /* max bits per code for LZW */
-int method = DEFLATED;/* compression method */
-int level = 6;        /* compression level */
-int exit_code = OK;   /* program exit code */
-int save_orig_name;   /* set if original name must be saved */
-int last_member;      /* set for .zip and .Z files */
-int part_nb;          /* number of parts in .gz file */
-struct timespec time_stamp; /* original time stamp (modification time) */
-off_t ifile_size;      /* input file size, -1 for devices (debug only) */
-char *env;            /* contents of GZIP env variable */
-char **args = NULL;   /* argv pointer if GZIP env variable defined */
-char const *z_suffix; /* default suffix (can be set with --suffix) */
-size_t z_len;         /* strlen(z_suffix) */
+                /* local variables */
+
+/* If true, pretend that standard input is a tty.  This option
+   is deliberately not documented, and only for testing.  */
+static bool presume_input_tty;
+
+static int ascii = 0;        /* convert end-of-lines to local OS conventions */
+       int to_stdout = 0;    /* output to stdout (-c) */
+static int decompress = 0;   /* decompress (-d) */
+static int force = 0;        /* don't ask questions, compress links (-f) */
+static int no_name = -1;     /* don't save or restore the original file name */
+static int no_time = -1;     /* don't save or restore the original file time */
+static int recursive = 0;    /* recurse through directories (-r) */
+static int list = 0;         /* list the file contents (-l) */
+       int verbose = 0;      /* be verbose (-v) */
+       int quiet = 0;        /* be very quiet (-q) */
+static int do_lzw = 0;       /* generate output compatible with old compress (-Z) */
+       int test = 0;         /* test .gz file integrity */
+static int foreground = 0;   /* set if program run in foreground */
+       char *program_name;   /* program name */
+       int maxbits = BITS;   /* max bits per code for LZW */
+       int method = DEFLATED;/* compression method */
+       int level = 6;        /* compression level */
+       int exit_code = OK;   /* program exit code */
+       int save_orig_name;   /* set if original name must be saved */
+static int last_member;      /* set for .zip and .Z files */
+static int part_nb;          /* number of parts in .gz file */
+       struct timespec time_stamp; /* original time stamp (modification time) */
+       off_t ifile_size;      /* input file size, -1 for devices (debug only) */
+static char *env;            /* contents of GZIP env variable */
+static char **args = NULL;   /* argv pointer if GZIP env variable defined */
+static char const *z_suffix; /* default suffix (can be set with --suffix) */
+static size_t z_len;         /* strlen(z_suffix) */
 
 /* The set of signals that are caught.  */
 static sigset_t caught_signals;
@@ -208,11 +203,11 @@ static int volatile remove_ofname_fd = -1;
 
 off_t bytes_in;             /* number of input bytes */
 off_t bytes_out;            /* number of output bytes */
-off_t total_in;                    /* input bytes for all files */
-off_t total_out;           /* output bytes for all files */
+static off_t total_in;      /* input bytes for all files */
+static off_t total_out;            /* output bytes for all files */
 char ifname[MAX_PATH_LEN]; /* input file name */
 char ofname[MAX_PATH_LEN]; /* output file name */
-struct stat istat;         /* status for input file */
+static struct stat istat;         /* status for input file */
 int  ifd;                  /* input file descriptor */
 int  ofd;                  /* output file descriptor */
 unsigned insize;           /* valid bytes in inbuf */
@@ -227,11 +222,7 @@ static int handled_sig[] =
 #ifdef SIGHUP
     , SIGHUP
 #endif
-#ifdef SIGPIPE
     , SIGPIPE
-#else
-# define SIGPIPE 0
-#endif
 #ifdef SIGTERM
     , SIGTERM
 #endif
@@ -243,7 +234,14 @@ static int handled_sig[] =
 #endif
   };
 
-struct option longopts[] =
+/* For long options that have no equivalent short option, use a
+   non-character as a pseudo short option, starting with CHAR_MAX + 1.  */
+enum
+{
+  PRESUME_INPUT_TTY_OPTION = CHAR_MAX + 1
+};
+
+static const struct option longopts[] =
 {
  /* { name  has_arg  *flag  val } */
     {"ascii",      0, 0, 'a'}, /* ascii text mode */
@@ -259,6 +257,7 @@ struct option longopts[] =
     {"license",    0, 0, 'L'}, /* display software license */
     {"no-name",    0, 0, 'n'}, /* don't save or restore original name & time */
     {"name",       0, 0, 'N'}, /* save or restore original name & time */
+    {"-presume-input-tty", no_argument, NULL, PRESUME_INPUT_TTY_OPTION},
     {"quiet",      0, 0, 'q'}, /* quiet mode */
     {"silent",     0, 0, 'q'}, /* quiet mode */
     {"recursive",  0, 0, 'r'}, /* recurse through directories */
@@ -271,36 +270,38 @@ struct option longopts[] =
     {"best",       0, 0, '9'}, /* compress better */
     {"lzw",        0, 0, 'Z'}, /* make output compatible with old compress */
     {"bits",       1, 0, 'b'}, /* max number of bits per code (implies -Z) */
+
     { 0, 0, 0, 0 }
 };
 
 /* local functions */
 
-local void try_help     OF((void)) ATTRIBUTE_NORETURN;
-local void help         OF((void));
-local void license      OF((void));
-local void version      OF((void));
-local int input_eof    OF((void));
-local void treat_stdin  OF((void));
-local void treat_file   OF((char *iname));
-local int create_outfile OF((void));
-local char *get_suffix  OF((char *name));
-local int  open_input_file OF((char *iname, struct stat *sbuf));
-local int  make_ofname  OF((void));
-local void shorten_name  OF((char *name));
-local int  get_method   OF((int in));
-local void do_list      OF((int ifd, int method));
-local int  check_ofname OF((void));
-local void copy_stat    OF((struct stat *ifstat));
-local void install_signal_handlers OF((void));
-local void remove_output_file OF((void));
-local RETSIGTYPE abort_gzip_signal OF((int));
-local void do_exit      OF((int exitcode)) ATTRIBUTE_NORETURN;
-      int main          OF((int argc, char **argv));
-int (*work) OF((int infile, int outfile)) = zip; /* function to call */
+local void try_help     (void) ATTRIBUTE_NORETURN;
+local void help         (void);
+local void license      (void);
+local void version      (void);
+local int input_eof    (void);
+local void treat_stdin  (void);
+local void treat_file   (char *iname);
+local int create_outfile (void);
+local char *get_suffix  (char *name);
+local int  open_input_file (char *iname, struct stat *sbuf);
+local void discard_input_bytes (size_t nbytes, unsigned int flags);
+local int  make_ofname  (void);
+local void shorten_name  (char *name);
+local int  get_method   (int in);
+local void do_list      (int ifd, int method);
+local int  check_ofname (void);
+local void copy_stat    (struct stat *ifstat);
+local void install_signal_handlers (void);
+local void remove_output_file (void);
+local RETSIGTYPE abort_gzip_signal (int);
+local void do_exit      (int exitcode) ATTRIBUTE_NORETURN;
+      int main          (int argc, char **argv);
+static int (*work) (int infile, int outfile) = zip; /* function to call */
 
 #if ! NO_DIR
-local void treat_dir    OF((int fd, char *dir));
+local void treat_dir    (int fd, char *dir);
 #endif
 
 #define strequ(s1, s2) (strcmp((s1),(s2)) == 0)
@@ -309,7 +310,7 @@ static void
 try_help ()
 {
   fprintf (stderr, "Try `%s --help' for more information.\n",
-          program_name);
+           program_name);
   do_exit (ERROR);
 }
 
@@ -368,7 +369,7 @@ local void license()
 {
     char const *const *p = license_msg;
 
-    printf ("%s %s\n", program_name, VERSION);
+    printf ("%s %s\n", program_name, Version);
     while (*p) printf ("%s\n", *p++);
 }
 
@@ -423,93 +424,95 @@ int main (int argc, char **argv)
      * Ignore an .exe extension for MSDOS, OS/2 and VMS.
      */
     if (strncmp (program_name, "un",  2) == 0     /* ungzip, uncompress */
-       || strncmp (program_name, "gun", 3) == 0) /* gunzip */
-       decompress = 1;
+        || strncmp (program_name, "gun", 3) == 0) /* gunzip */
+        decompress = 1;
     else if (strequ (program_name + 1, "cat")     /* zcat, pcat, gcat */
-            || strequ (program_name, "gzcat"))   /* gzcat */
-       decompress = to_stdout = 1;
+             || strequ (program_name, "gzcat"))   /* gzcat */
+        decompress = to_stdout = 1;
 #endif
 
     z_suffix = Z_SUFFIX;
     z_len = strlen(z_suffix);
 
     while ((optc = getopt_long (argc, argv, "ab:cdfhH?lLmMnNqrS:tvVZ123456789",
-                               longopts, (int *)0)) != -1) {
-       switch (optc) {
+                                longopts, (int *)0)) != -1) {
+        switch (optc) {
         case 'a':
             ascii = 1; break;
-       case 'b':
-           maxbits = atoi(optarg);
-           for (; *optarg; optarg++)
-             if (! ('0' <= *optarg && *optarg <= '9'))
-               {
-                 fprintf (stderr, "%s: -b operand is not an integer\n",
-                          program_name);
-                 try_help ();
-               }
-           break;
-       case 'c':
-           to_stdout = 1; break;
-       case 'd':
-           decompress = 1; break;
-       case 'f':
-           force++; break;
-       case 'h': case 'H':
-           help(); do_exit(OK); break;
-       case 'l':
-           list = decompress = to_stdout = 1; break;
-       case 'L':
-           license(); do_exit(OK); break;
-       case 'm': /* undocumented, may change later */
-           no_time = 1; break;
-       case 'M': /* undocumented, may change later */
-           no_time = 0; break;
-       case 'n':
-           no_name = no_time = 1; break;
-       case 'N':
-           no_name = no_time = 0; break;
-       case 'q':
-           quiet = 1; verbose = 0; break;
-       case 'r':
+        case 'b':
+            maxbits = atoi(optarg);
+            for (; *optarg; optarg++)
+              if (! ('0' <= *optarg && *optarg <= '9'))
+                {
+                  fprintf (stderr, "%s: -b operand is not an integer\n",
+                           program_name);
+                  try_help ();
+                }
+            break;
+        case 'c':
+            to_stdout = 1; break;
+        case 'd':
+            decompress = 1; break;
+        case 'f':
+            force++; break;
+        case 'h': case 'H':
+            help(); do_exit(OK); break;
+        case 'l':
+            list = decompress = to_stdout = 1; break;
+        case 'L':
+            license(); do_exit(OK); break;
+        case 'm': /* undocumented, may change later */
+            no_time = 1; break;
+        case 'M': /* undocumented, may change later */
+            no_time = 0; break;
+        case 'n':
+            no_name = no_time = 1; break;
+        case 'N':
+            no_name = no_time = 0; break;
+        case PRESUME_INPUT_TTY_OPTION:
+            presume_input_tty = true; break;
+        case 'q':
+            quiet = 1; verbose = 0; break;
+        case 'r':
 #if NO_DIR
-           fprintf (stderr, "%s: -r not supported on this system\n",
-                    program_name);
-           try_help ();
+            fprintf (stderr, "%s: -r not supported on this system\n",
+                     program_name);
+            try_help ();
 #else
-           recursive = 1;
+            recursive = 1;
 #endif
-           break;
-       case 'S':
+            break;
+        case 'S':
 #ifdef NO_MULTIPLE_DOTS
             if (*optarg == '.') optarg++;
 #endif
             z_len = strlen(optarg);
-           z_suffix = optarg;
+            z_suffix = optarg;
+            break;
+        case 't':
+            test = decompress = to_stdout = 1;
             break;
-       case 't':
-           test = decompress = to_stdout = 1;
-           break;
-       case 'v':
-           verbose++; quiet = 0; break;
-       case 'V':
-           version(); do_exit(OK); break;
-       case 'Z':
+        case 'v':
+            verbose++; quiet = 0; break;
+        case 'V':
+            version(); do_exit(OK); break;
+        case 'Z':
 #ifdef LZW
-           do_lzw = 1; break;
+            do_lzw = 1; break;
 #else
-           fprintf(stderr, "%s: -Z not supported in this version\n",
-                   program_name);
-           try_help ();
-           break;
+            fprintf(stderr, "%s: -Z not supported in this version\n",
+                    program_name);
+            try_help ();
+            break;
 #endif
-       case '1':  case '2':  case '3':  case '4':
-       case '5':  case '6':  case '7':  case '8':  case '9':
-           level = optc - '0';
-           break;
-       default:
-           /* Error message already emitted by getopt_long. */
-           try_help ();
-       }
+        case '1':  case '2':  case '3':  case '4':
+        case '5':  case '6':  case '7':  case '8':  case '9':
+            level = optc - '0';
+            break;
+        default:
+            /* Error message already emitted by getopt_long. */
+            try_help ();
+        }
     } /* loop on all arguments */
 
     /* By default, save name and timestamp on compression but do not
@@ -523,15 +526,15 @@ int main (int argc, char **argv)
 #if O_BINARY
 #else
     if (ascii && !quiet) {
-       fprintf(stderr, "%s: option --ascii ignored on this system\n",
-               program_name);
+        fprintf(stderr, "%s: option --ascii ignored on this system\n",
+                program_name);
     }
 #endif
-    if ((z_len == 0 && !decompress) || z_len > MAX_SUFFIX) {
-        fprintf(stderr, "%s: incorrect suffix '%s'\n",
-                program_name, z_suffix);
+    if (z_len == 0 || z_len > MAX_SUFFIX) {
+        fprintf(stderr, "%s: invalid suffix '%s'\n", program_name, z_suffix);
         do_exit(ERROR);
     }
+
     if (do_lzw && !decompress) work = lzw;
 
     /* Allocate all global buffers (for DYN_ALLOC option) */
@@ -551,17 +554,17 @@ int main (int argc, char **argv)
 
     /* And get to work */
     if (file_count != 0) {
-       if (to_stdout && !test && !list && (!decompress || !ascii)) {
-           SET_BINARY_MODE(fileno(stdout));
-       }
+        if (to_stdout && !test && !list && (!decompress || !ascii)) {
+            SET_BINARY_MODE(fileno(stdout));
+        }
         while (optind < argc) {
-           treat_file(argv[optind++]);
-       }
+            treat_file(argv[optind++]);
+        }
     } else {  /* Standard input */
-       treat_stdin();
+        treat_stdin();
     }
     if (list && !quiet && file_count > 1) {
-       do_list(-1, -1); /* print totals */
+        do_list(-1, -1); /* print totals */
     }
     do_exit(exit_code);
     return exit_code; /* just to avoid lint warning */
@@ -577,7 +580,7 @@ input_eof ()
   if (inptr == insize)
     {
       if (insize != INBUFSIZ || fill_inbuf (1) == EOF)
-       return 1;
+        return 1;
 
       /* Unget the char that fill_inbuf got.  */
       inptr = 0;
@@ -591,33 +594,38 @@ input_eof ()
  */
 local void treat_stdin()
 {
-    if (!force && !list &&
-       isatty(fileno((FILE *)(decompress ? stdin : stdout)))) {
-       /* Do not send compressed data to the terminal or read it from
-        * the terminal. We get here when user invoked the program
-        * without parameters, so be helpful. According to the GNU standards:
-        *
-        *   If there is one behavior you think is most useful when the output
-        *   is to a terminal, and another that you think is most useful when
-        *   the output is a file or a pipe, then it is usually best to make
-        *   the default behavior the one that is useful with output to a
-        *   terminal, and have an option for the other behavior.
-        *
-        * Here we use the --force option to get the other behavior.
-        */
-       fprintf(stderr,
-    "%s: compressed data not %s a terminal. Use -f to force %scompression.\n",
-               program_name, decompress ? "read from" : "written to",
-               decompress ? "de" : "");
-       fprintf (stderr, "For help, type: %s -h\n", program_name);
-       do_exit(ERROR);
+    if (!force && !list
+        && (presume_input_tty
+            || isatty(fileno((FILE *)(decompress ? stdin : stdout))))) {
+        /* Do not send compressed data to the terminal or read it from
+         * the terminal. We get here when user invoked the program
+         * without parameters, so be helpful. According to the GNU standards:
+         *
+         *   If there is one behavior you think is most useful when the output
+         *   is to a terminal, and another that you think is most useful when
+         *   the output is a file or a pipe, then it is usually best to make
+         *   the default behavior the one that is useful with output to a
+         *   terminal, and have an option for the other behavior.
+         *
+         * Here we use the --force option to get the other behavior.
+         */
+        if (! quiet)
+          fprintf (stderr,
+                   ("%s: compressed data not %s a terminal."
+                    " Use -f to force %scompression.\n"
+                    "For help, type: %s -h\n"),
+                   program_name,
+                   decompress ? "read from" : "written to",
+                   decompress ? "de" : "",
+                   program_name);
+        do_exit(ERROR);
     }
 
     if (decompress || !ascii) {
-       SET_BINARY_MODE(fileno(stdin));
+        SET_BINARY_MODE(fileno(stdin));
     }
     if (!test && !list && (!decompress || !ascii)) {
-       SET_BINARY_MODE(fileno(stdout));
+        SET_BINARY_MODE(fileno(stdout));
     }
     strcpy(ifname, "stdin");
     strcpy(ofname, "stdout");
@@ -625,13 +633,18 @@ local void treat_stdin()
     /* Get the file's time stamp and size.  */
     if (fstat (fileno (stdin), &istat) != 0)
       {
-       progerror ("standard input");
-       do_exit (ERROR);
+        progerror ("standard input");
+        do_exit (ERROR);
       }
     ifile_size = S_ISREG (istat.st_mode) ? istat.st_size : -1;
     time_stamp.tv_nsec = -1;
     if (!no_time || list)
-      time_stamp = get_stat_mtime (&istat);
+      {
+        if (S_ISREG (istat.st_mode))
+          time_stamp = get_stat_mtime (&istat);
+        else
+          gettime (&time_stamp);
+      }
 
     clear_bufs(); /* clear input and output buffers */
     to_stdout = 1;
@@ -639,10 +652,10 @@ local void treat_stdin()
     ifd = fileno(stdin);
 
     if (decompress) {
-       method = get_method(ifd);
-       if (method < 0) {
-           do_exit(exit_code); /* error message already emitted */
-       }
+        method = get_method(ifd);
+        if (method < 0) {
+            do_exit(exit_code); /* error message already emitted */
+        }
     }
     if (list) {
         do_list(ifd, method);
@@ -652,29 +665,29 @@ local void treat_stdin()
     /* Actually do the compression/decompression. Loop over zipped members.
      */
     for (;;) {
-       if ((*work)(fileno(stdin), fileno(stdout)) != OK) return;
+        if ((*work)(fileno(stdin), fileno(stdout)) != OK) return;
 
-       if (input_eof ())
-         break;
+        if (input_eof ())
+          break;
 
-       method = get_method(ifd);
-       if (method < 0) return; /* error message already emitted */
-       bytes_out = 0;            /* required for length check */
+        method = get_method(ifd);
+        if (method < 0) return; /* error message already emitted */
+        bytes_out = 0;            /* required for length check */
     }
 
     if (verbose) {
-       if (test) {
-           fprintf(stderr, " OK\n");
+        if (test) {
+            fprintf(stderr, " OK\n");
 
-       } else if (!decompress) {
-           display_ratio(bytes_in-(bytes_out-header_bytes), bytes_in, stderr);
-           fprintf(stderr, "\n");
+        } else if (!decompress) {
+            display_ratio(bytes_in-(bytes_out-header_bytes), bytes_in, stderr);
+            fprintf(stderr, "\n");
 #ifdef DISPLAY_STDIN_RATIO
-       } else {
-           display_ratio(bytes_out-(bytes_in-header_bytes), bytes_out,stderr);
-           fprintf(stderr, "\n");
+        } else {
+            display_ratio(bytes_out-(bytes_in-header_bytes), bytes_out,stderr);
+            fprintf(stderr, "\n");
 #endif
-       }
+        }
     }
 }
 
@@ -686,10 +699,10 @@ local void treat_file(iname)
 {
     /* Accept "-" as synonym for stdin */
     if (strequ(iname, "-")) {
-       int cflag = to_stdout;
-       treat_stdin();
-       to_stdout = cflag;
-       return;
+        int cflag = to_stdout;
+        treat_stdin();
+        to_stdout = cflag;
+        return;
     }
 
     /* Check if the input file is present, set ifname and istat: */
@@ -700,63 +713,63 @@ local void treat_file(iname)
     /* If the input name is that of a directory, recurse or ignore: */
     if (S_ISDIR(istat.st_mode)) {
 #if ! NO_DIR
-       if (recursive) {
-           treat_dir (ifd, iname);
-           /* Warning: ifname is now garbage */
-           return;
-       }
+        if (recursive) {
+            treat_dir (ifd, iname);
+            /* Warning: ifname is now garbage */
+            return;
+        }
 #endif
-       close (ifd);
-       WARN ((stderr, "%s: %s is a directory -- ignored\n",
-              program_name, ifname));
-       return;
+        close (ifd);
+        WARN ((stderr, "%s: %s is a directory -- ignored\n",
+               program_name, ifname));
+        return;
     }
 
     if (! to_stdout)
       {
-       if (! S_ISREG (istat.st_mode))
-         {
-           WARN ((stderr,
-                  "%s: %s is not a directory or a regular file - ignored\n",
-                  program_name, ifname));
-           close (ifd);
-           return;
-         }
-       if (istat.st_mode & S_ISUID)
-         {
-           WARN ((stderr, "%s: %s is set-user-ID on execution - ignored\n",
-                  program_name, ifname));
-           close (ifd);
-           return;
-         }
-       if (istat.st_mode & S_ISGID)
-         {
-           WARN ((stderr, "%s: %s is set-group-ID on execution - ignored\n",
-                  program_name, ifname));
-           close (ifd);
-           return;
-         }
-
-       if (! force)
-         {
-           if (istat.st_mode & S_ISVTX)
-             {
-               WARN ((stderr,
-                      "%s: %s has the sticky bit set - file ignored\n",
-                      program_name, ifname));
-               close (ifd);
-               return;
-             }
-           if (2 <= istat.st_nlink)
-             {
-               WARN ((stderr, "%s: %s has %lu other link%c -- unchanged\n",
-                      program_name, ifname,
-                      (unsigned long int) istat.st_nlink - 1,
-                      istat.st_nlink == 2 ? ' ' : 's'));
-               close (ifd);
-               return;
-             }
-         }
+        if (! S_ISREG (istat.st_mode))
+          {
+            WARN ((stderr,
+                   "%s: %s is not a directory or a regular file - ignored\n",
+                   program_name, ifname));
+            close (ifd);
+            return;
+          }
+        if (istat.st_mode & S_ISUID)
+          {
+            WARN ((stderr, "%s: %s is set-user-ID on execution - ignored\n",
+                   program_name, ifname));
+            close (ifd);
+            return;
+          }
+        if (istat.st_mode & S_ISGID)
+          {
+            WARN ((stderr, "%s: %s is set-group-ID on execution - ignored\n",
+                   program_name, ifname));
+            close (ifd);
+            return;
+          }
+
+        if (! force)
+          {
+            if (istat.st_mode & S_ISVTX)
+              {
+                WARN ((stderr,
+                       "%s: %s has the sticky bit set - file ignored\n",
+                       program_name, ifname));
+                close (ifd);
+                return;
+              }
+            if (2 <= istat.st_nlink)
+              {
+                WARN ((stderr, "%s: %s has %lu other link%c -- unchanged\n",
+                       program_name, ifname,
+                       (unsigned long int) istat.st_nlink - 1,
+                       istat.st_nlink == 2 ? ' ' : 's'));
+                close (ifd);
+                return;
+              }
+          }
       }
 
     ifile_size = S_ISREG (istat.st_mode) ? istat.st_size : -1;
@@ -768,27 +781,27 @@ local void treat_file(iname)
      * without a valid gzip suffix (check done in make_ofname).
      */
     if (to_stdout && !list && !test) {
-       strcpy(ofname, "stdout");
+        strcpy(ofname, "stdout");
 
     } else if (make_ofname() != OK) {
-       close (ifd);
-       return;
+        close (ifd);
+        return;
     }
 
     clear_bufs(); /* clear input and output buffers */
     part_nb = 0;
 
     if (decompress) {
-       method = get_method(ifd); /* updates ofname if original given */
-       if (method < 0) {
-           close(ifd);
-           return;               /* error message already emitted */
-       }
+        method = get_method(ifd); /* updates ofname if original given */
+        if (method < 0) {
+            close(ifd);
+            return;               /* error message already emitted */
+        }
     }
     if (list) {
         do_list(ifd, method);
         if (close (ifd) != 0)
-         read_error ();
+          read_error ();
         return;
     }
 
@@ -797,37 +810,37 @@ local void treat_file(iname)
      * a new ofname and save the original name in the compressed file.
      */
     if (to_stdout) {
-       ofd = fileno(stdout);
-       /* Keep remove_ofname_fd negative.  */
+        ofd = fileno(stdout);
+        /* Keep remove_ofname_fd negative.  */
     } else {
-       if (create_outfile() != OK) return;
+        if (create_outfile() != OK) return;
 
-       if (!decompress && save_orig_name && !verbose && !quiet) {
-           fprintf(stderr, "%s: %s compressed to %s\n",
-                   program_name, ifname, ofname);
-       }
+        if (!decompress && save_orig_name && !verbose && !quiet) {
+            fprintf(stderr, "%s: %s compressed to %s\n",
+                    program_name, ifname, ofname);
+        }
     }
     /* Keep the name even if not truncated except with --no-name: */
     if (!save_orig_name) save_orig_name = !no_name;
 
     if (verbose) {
-       fprintf(stderr, "%s:\t", ifname);
+        fprintf(stderr, "%s:\t", ifname);
     }
 
     /* Actually do the compression/decompression. Loop over zipped members.
      */
     for (;;) {
-       if ((*work)(ifd, ofd) != OK) {
-           method = -1; /* force cleanup */
-           break;
-       }
+        if ((*work)(ifd, ofd) != OK) {
+            method = -1; /* force cleanup */
+            break;
+        }
 
-       if (input_eof ())
-         break;
+        if (input_eof ())
+          break;
 
-       method = get_method(ifd);
-       if (method < 0) break;    /* error message already emitted */
-       bytes_out = 0;            /* required for length check */
+        method = get_method(ifd);
+        if (method < 0) break;    /* error message already emitted */
+        bytes_out = 0;            /* required for length check */
     }
 
     if (close (ifd) != 0)
@@ -835,48 +848,48 @@ local void treat_file(iname)
 
     if (!to_stdout)
       {
-       sigset_t oldset;
-       int unlink_errno;
-
-       copy_stat (&istat);
-       if (close (ofd) != 0)
-         write_error ();
-
-       sigprocmask (SIG_BLOCK, &caught_signals, &oldset);
-       remove_ofname_fd = -1;
-       unlink_errno = xunlink (ifname) == 0 ? 0 : errno;
-       sigprocmask (SIG_SETMASK, &oldset, NULL);
-
-       if (unlink_errno)
-         {
-           WARN ((stderr, "%s: ", program_name));
-           if (!quiet)
-             {
-               errno = unlink_errno;
-               perror (ifname);
-             }
-         }
+        sigset_t oldset;
+        int unlink_errno;
+
+        copy_stat (&istat);
+        if (close (ofd) != 0)
+          write_error ();
+
+        sigprocmask (SIG_BLOCK, &caught_signals, &oldset);
+        remove_ofname_fd = -1;
+        unlink_errno = xunlink (ifname) == 0 ? 0 : errno;
+        sigprocmask (SIG_SETMASK, &oldset, NULL);
+
+        if (unlink_errno)
+          {
+            WARN ((stderr, "%s: ", program_name));
+            if (!quiet)
+              {
+                errno = unlink_errno;
+                perror (ifname);
+              }
+          }
       }
 
     if (method == -1) {
-       if (!to_stdout)
-         remove_output_file ();
-       return;
+        if (!to_stdout)
+          remove_output_file ();
+        return;
     }
 
     /* Display statistics */
     if(verbose) {
-       if (test) {
-           fprintf(stderr, " OK");
-       } else if (decompress) {
-           display_ratio(bytes_out-(bytes_in-header_bytes), bytes_out,stderr);
-       } else {
-           display_ratio(bytes_in-(bytes_out-header_bytes), bytes_in, stderr);
-       }
-       if (!test && !to_stdout) {
-           fprintf(stderr, " -- replaced with %s", ofname);
-       }
-       fprintf(stderr, "\n");
+        if (test) {
+            fprintf(stderr, " OK");
+        } else if (decompress) {
+            display_ratio(bytes_out-(bytes_in-header_bytes), bytes_out,stderr);
+        } else {
+            display_ratio(bytes_in-(bytes_out-header_bytes), bytes_in, stderr);
+        }
+        if (!test && !to_stdout) {
+            fprintf(stderr, " -- replaced with %s", ofname);
+        }
+        fprintf(stderr, "\n");
     }
 }
 
@@ -893,7 +906,7 @@ local int create_outfile()
 {
   int name_shortened = 0;
   int flags = (O_WRONLY | O_CREAT | O_EXCL
-              | (ascii && decompress ? 0 : O_BINARY));
+               | (ascii && decompress ? 0 : O_BINARY));
 
   for (;;)
     {
@@ -906,37 +919,37 @@ local int create_outfile()
       sigprocmask (SIG_SETMASK, &oldset, NULL);
 
       if (0 <= ofd)
-       break;
+        break;
 
       switch (open_errno)
-       {
+        {
 #ifdef ENAMETOOLONG
-       case ENAMETOOLONG:
-         shorten_name (ofname);
-         name_shortened = 1;
-         break;
+        case ENAMETOOLONG:
+          shorten_name (ofname);
+          name_shortened = 1;
+          break;
 #endif
 
-       case EEXIST:
-         if (check_ofname () != OK)
-           {
-             close (ifd);
-             return ERROR;
-           }
-         break;
-
-       default:
-         progerror (ofname);
-         close (ifd);
-         return ERROR;
-       }
+        case EEXIST:
+          if (check_ofname () != OK)
+            {
+              close (ifd);
+              return ERROR;
+            }
+          break;
+
+        default:
+          progerror (ofname);
+          close (ifd);
+          return ERROR;
+        }
     }
 
   if (name_shortened && decompress)
     {
       /* name might be too long if an original name was saved */
       WARN ((stderr, "%s: %s: warning, name truncated\n",
-            program_name, ofname));
+             program_name, ofname));
     }
 
   return OK;
@@ -973,8 +986,8 @@ local char *get_suffix(name)
 #ifdef SUFFIX_SEP
     /* strip a version number from the file name */
     {
-       char *v = strrchr(name, SUFFIX_SEP);
-       if (v != NULL) *v = '\0';
+        char *v = strrchr(name, SUFFIX_SEP);
+        if (v != NULL) *v = '\0';
     }
 #endif
     nlen = strlen(name);
@@ -1009,19 +1022,19 @@ open_and_stat (char *name, int flags, mode_t mode, struct stat *st)
   if (!to_stdout && !force)
     {
       if (HAVE_WORKING_O_NOFOLLOW)
-       flags |= O_NOFOLLOW;
+        flags |= O_NOFOLLOW;
       else
-       {
+        {
 #if HAVE_LSTAT || defined lstat
-         if (lstat (name, st) != 0)
-           return -1;
-         else if (S_ISLNK (st->st_mode))
-           {
-             errno = ELOOP;
-             return -1;
-           }
+          if (lstat (name, st) != 0)
+            return -1;
+          else if (S_ISLNK (st->st_mode))
+            {
+              errno = ELOOP;
+              return -1;
+            }
 #endif
-       }
+        }
     }
 
   fd = OPEN (name, flags, mode);
@@ -1058,12 +1071,12 @@ open_input_file (iname, sbuf)
 #endif
     int fd;
     int open_flags = (O_RDONLY | O_NONBLOCK | O_NOCTTY
-                     | (ascii && !decompress ? 0 : O_BINARY));
+                      | (ascii && !decompress ? 0 : O_BINARY));
 
     *suf = z_suffix;
 
     if (sizeof ifname - 1 <= strlen (iname))
-       goto name_too_long;
+        goto name_too_long;
 
     strcpy(ifname, iname);
 
@@ -1073,16 +1086,16 @@ open_input_file (iname, sbuf)
       return fd;
 
     if (!decompress || errno != ENOENT) {
-       progerror(ifname);
-       return -1;
+        progerror(ifname);
+        return -1;
     }
     /* file.ext doesn't exist, try adding a suffix (after removing any
      * version number for VMS).
      */
     s = get_suffix(ifname);
     if (s != NULL) {
-       progerror(ifname); /* ifname already has z suffix and does not exist */
-       return -1;
+        progerror(ifname); /* ifname already has z suffix and does not exist */
+        return -1;
     }
 #ifdef NO_MULTIPLE_DOTS
     dot = strrchr(ifname, '.');
@@ -1103,22 +1116,22 @@ open_input_file (iname, sbuf)
         if (*dot == '\0') strcpy (dot, ".");
 #endif
 #ifdef MAX_EXT_CHARS
-       if (MAX_EXT_CHARS < strlen (s) + strlen (dot + 1))
-         dot[MAX_EXT_CHARS + 1 - strlen (s)] = '\0';
+        if (MAX_EXT_CHARS < strlen (s) + strlen (dot + 1))
+          dot[MAX_EXT_CHARS + 1 - strlen (s)] = '\0';
 #endif
-       if (sizeof ifname <= ilen + strlen (s))
-         goto name_too_long;
+        if (sizeof ifname <= ilen + strlen (s))
+          goto name_too_long;
         strcat(ifname, s);
-       fd = open_and_stat (ifname, open_flags, RW_USER, sbuf);
-       if (0 <= fd)
-         return fd;
-       if (errno != ENOENT)
-         {
-           progerror (ifname);
-           return -1;
-         }
-       if (strequ (s0, z_suffix))
-         z_suffix_errno = errno;
+        fd = open_and_stat (ifname, open_flags, RW_USER, sbuf);
+        if (0 <= fd)
+          return fd;
+        if (errno != ENOENT)
+          {
+            progerror (ifname);
+            return -1;
+          }
+        if (strequ (s0, z_suffix))
+          z_suffix_errno = errno;
     } while (*++suf != NULL);
 
     /* No suffix found, complain using z_suffix: */
@@ -1154,52 +1167,52 @@ local int make_ofname()
     suff = get_suffix(ofname);
 
     if (decompress) {
-       if (suff == NULL) {
-           /* With -t or -l, try all files (even without .gz suffix)
-            * except with -r (behave as with just -dr).
+        if (suff == NULL) {
+            /* With -t or -l, try all files (even without .gz suffix)
+             * except with -r (behave as with just -dr).
              */
             if (!recursive && (list || test)) return OK;
 
-           /* Avoid annoying messages with -r */
-           if (verbose || (!recursive && !quiet)) {
-               WARN((stderr,"%s: %s: unknown suffix -- ignored\n",
-                     program_name, ifname));
-           }
-           return WARNING;
-       }
-       /* Make a special case for .tgz and .taz: */
-       strlwr(suff);
-       if (strequ(suff, ".tgz") || strequ(suff, ".taz")) {
-           strcpy(suff, ".tar");
-       } else {
-           *suff = '\0'; /* strip the z suffix */
-       }
+            /* Avoid annoying messages with -r */
+            if (verbose || (!recursive && !quiet)) {
+                WARN((stderr,"%s: %s: unknown suffix -- ignored\n",
+                      program_name, ifname));
+            }
+            return WARNING;
+        }
+        /* Make a special case for .tgz and .taz: */
+        strlwr(suff);
+        if (strequ(suff, ".tgz") || strequ(suff, ".taz")) {
+            strcpy(suff, ".tar");
+        } else {
+            *suff = '\0'; /* strip the z suffix */
+        }
         /* ofname might be changed later if infile contains an original name */
 
     } else if (suff && ! force) {
-       /* Avoid annoying messages with -r (see treat_dir()) */
-       if (verbose || (!recursive && !quiet)) {
-           /* Don't use WARN, as it affects exit status.  */
-           fprintf (stderr, "%s: %s already has %s suffix -- unchanged\n",
-                    program_name, ifname, suff);
-       }
-       return WARNING;
+        /* Avoid annoying messages with -r (see treat_dir()) */
+        if (verbose || (!recursive && !quiet)) {
+            /* Don't use WARN, as it affects exit status.  */
+            fprintf (stderr, "%s: %s already has %s suffix -- unchanged\n",
+                     program_name, ifname, suff);
+        }
+        return WARNING;
     } else {
         save_orig_name = 0;
 
 #ifdef NO_MULTIPLE_DOTS
-       suff = strrchr(ofname, '.');
-       if (suff == NULL) {
-           if (sizeof ofname <= strlen (ofname) + 1)
-               goto name_too_long;
+        suff = strrchr(ofname, '.');
+        if (suff == NULL) {
+            if (sizeof ofname <= strlen (ofname) + 1)
+                goto name_too_long;
             strcat(ofname, ".");
 #  ifdef MAX_EXT_CHARS
-           if (strequ(z_suffix, "z")) {
-               if (sizeof ofname <= strlen (ofname) + 2)
-                   goto name_too_long;
-               strcat(ofname, "gz"); /* enough room */
-               return OK;
-           }
+            if (strequ(z_suffix, "z")) {
+                if (sizeof ofname <= strlen (ofname) + 2)
+                    goto name_too_long;
+                strcat(ofname, "gz"); /* enough room */
+                return OK;
+            }
         /* On the Atari and some versions of MSDOS,
          * ENAMETOOLONG does not work correctly.  So we
          * must truncate here.
@@ -1210,9 +1223,9 @@ local int make_ofname()
 #  endif
         }
 #endif /* NO_MULTIPLE_DOTS */
-       if (sizeof ofname <= strlen (ofname) + z_len)
-           goto name_too_long;
-       strcat(ofname, z_suffix);
+        if (sizeof ofname <= strlen (ofname) + z_len)
+            goto name_too_long;
+        strcat(ofname, z_suffix);
 
     } /* decompress ? */
     return OK;
@@ -1222,6 +1235,25 @@ local int make_ofname()
     return WARNING;
 }
 
+/* Discard NBYTES input bytes from the input, or up through the next
+   zero byte if NBYTES == (size_t) -1.  If FLAGS say that the header
+   CRC should be computed, update the CRC accordingly.  */
+static void
+discard_input_bytes (nbytes, flags)
+    size_t nbytes;
+    unsigned int flags;
+{
+  while (nbytes != 0)
+    {
+      uch c = get_byte ();
+      if (flags & HEADER_CRC)
+        updcrc (&c, 1);
+      if (nbytes != (size_t) -1)
+        nbytes--;
+      else if (! c)
+        break;
+    }
+}
 
 /* ========================================================================
  * Check the magic number of the input file and update ofname if an
@@ -1238,7 +1270,8 @@ local int get_method(in)
     int in;        /* input file descriptor */
 {
     uch flags;     /* compression flags */
-    char magic[2]; /* magic header */
+    uch magic[10]; /* magic header */
+    int imagic0;   /* first magic byte or EOF */
     int imagic1;   /* like magic[1], but can represent EOF */
     ulg stamp;     /* time stamp */
 
@@ -1246,19 +1279,21 @@ local int get_method(in)
      * premature end of file: use try_byte instead of get_byte.
      */
     if (force && to_stdout) {
-       magic[0] = (char)try_byte();
-       imagic1 = try_byte ();
-       magic[1] = (char) imagic1;
-       /* If try_byte returned EOF, magic[1] == (char) EOF.  */
+        imagic0 = try_byte();
+        magic[0] = imagic0;
+        imagic1 = try_byte ();
+        magic[1] = imagic1;
+        /* If try_byte returned EOF, magic[1] == (char) EOF.  */
     } else {
-       magic[0] = (char)get_byte();
-       if (magic[0]) {
-           magic[1] = (char)get_byte();
-           imagic1 = 0; /* avoid lint warning */
-       } else {
-           imagic1 = try_byte ();
-           magic[1] = (char) imagic1;
-       }
+        magic[0] = get_byte ();
+        imagic0 = 0;
+        if (magic[0]) {
+            magic[1] = get_byte ();
+            imagic1 = 0; /* avoid lint warning */
+        } else {
+            imagic1 = try_byte ();
+            magic[1] = imagic1;
+        }
     }
     method = -1;                 /* unknown yet */
     part_nb++;                   /* number of parts in gzip file */
@@ -1269,160 +1304,183 @@ local int get_method(in)
     if (memcmp(magic, GZIP_MAGIC, 2) == 0
         || memcmp(magic, OLD_GZIP_MAGIC, 2) == 0) {
 
-       method = (int)get_byte();
-       if (method != DEFLATED) {
-           fprintf(stderr,
-                   "%s: %s: unknown method %d -- not supported\n",
-                   program_name, ifname, method);
-           exit_code = ERROR;
-           return -1;
-       }
-       work = unzip;
-       flags  = (uch)get_byte();
-
-       if ((flags & ENCRYPTED) != 0) {
-           fprintf(stderr,
-                   "%s: %s is encrypted -- not supported\n",
-                   program_name, ifname);
-           exit_code = ERROR;
-           return -1;
-       }
-       if ((flags & CONTINUATION) != 0) {
-           fprintf(stderr,
-                   "%s: %s is a multi-part gzip file -- not supported\n",
-                   program_name, ifname);
-           exit_code = ERROR;
-           if (force <= 1) return -1;
-       }
-       if ((flags & RESERVED) != 0) {
-           fprintf(stderr,
-                   "%s: %s has flags 0x%x -- not supported\n",
-                   program_name, ifname, flags);
-           exit_code = ERROR;
-           if (force <= 1) return -1;
-       }
-       stamp  = (ulg)get_byte();
-       stamp |= ((ulg)get_byte()) << 8;
-       stamp |= ((ulg)get_byte()) << 16;
-       stamp |= ((ulg)get_byte()) << 24;
-       if (stamp != 0 && !no_time)
-         {
-           time_stamp.tv_sec = stamp;
-           time_stamp.tv_nsec = 0;
-         }
-
-       (void)get_byte();  /* Ignore extra flags for the moment */
-       (void)get_byte();  /* Ignore OS type for the moment */
-
-       if ((flags & CONTINUATION) != 0) {
-           unsigned part = (unsigned)get_byte();
-           part |= ((unsigned)get_byte())<<8;
-           if (verbose) {
-               fprintf(stderr,"%s: %s: part number %u\n",
-                       program_name, ifname, part);
-           }
-       }
-       if ((flags & EXTRA_FIELD) != 0) {
-           unsigned len = (unsigned)get_byte();
-           len |= ((unsigned)get_byte())<<8;
-           if (verbose) {
-               fprintf(stderr,"%s: %s: extra field of %u bytes ignored\n",
-                       program_name, ifname, len);
-           }
-           while (len--) (void)get_byte();
-       }
-
-       /* Get original file name if it was truncated */
-       if ((flags & ORIG_NAME) != 0) {
-           if (no_name || (to_stdout && !list) || part_nb > 1) {
-               /* Discard the old name */
-               char c; /* dummy used for NeXTstep 3.0 cc optimizer bug */
-               do {c=get_byte();} while (c != 0);
-           } else {
-               /* Copy the base name. Keep a directory prefix intact. */
+        method = (int)get_byte();
+        if (method != DEFLATED) {
+            fprintf(stderr,
+                    "%s: %s: unknown method %d -- not supported\n",
+                    program_name, ifname, method);
+            exit_code = ERROR;
+            return -1;
+        }
+        work = unzip;
+        flags  = (uch)get_byte();
+
+        if ((flags & ENCRYPTED) != 0) {
+            fprintf(stderr,
+                    "%s: %s is encrypted -- not supported\n",
+                    program_name, ifname);
+            exit_code = ERROR;
+            return -1;
+        }
+        if ((flags & RESERVED) != 0) {
+            fprintf(stderr,
+                    "%s: %s has flags 0x%x -- not supported\n",
+                    program_name, ifname, flags);
+            exit_code = ERROR;
+            if (force <= 1) return -1;
+        }
+        stamp  = (ulg)get_byte();
+        stamp |= ((ulg)get_byte()) << 8;
+        stamp |= ((ulg)get_byte()) << 16;
+        stamp |= ((ulg)get_byte()) << 24;
+        if (stamp != 0 && !no_time)
+          {
+            time_stamp.tv_sec = stamp;
+            time_stamp.tv_nsec = 0;
+          }
+
+        magic[8] = get_byte ();  /* Ignore extra flags.  */
+        magic[9] = get_byte ();  /* Ignore OS type.  */
+
+        if (flags & HEADER_CRC)
+          {
+            magic[2] = DEFLATED;
+            magic[3] = flags;
+            magic[4] = stamp & 0xff;
+            magic[5] = (stamp >> 8) & 0xff;
+            magic[6] = (stamp >> 16) & 0xff;
+            magic[7] = stamp >> 24;
+            updcrc (NULL, 0);
+            updcrc (magic, 10);
+          }
+
+        if ((flags & EXTRA_FIELD) != 0) {
+            uch lenbuf[2];
+            unsigned int len = lenbuf[0] = get_byte ();
+            len |= (lenbuf[1] = get_byte ()) << 8;
+            if (verbose) {
+                fprintf(stderr,"%s: %s: extra field of %u bytes ignored\n",
+                        program_name, ifname, len);
+            }
+            if (flags & HEADER_CRC)
+              updcrc (lenbuf, 2);
+            discard_input_bytes (len, flags);
+        }
+
+        /* Get original file name if it was truncated */
+        if ((flags & ORIG_NAME) != 0) {
+            if (no_name || (to_stdout && !list) || part_nb > 1) {
+                /* Discard the old name */
+                discard_input_bytes (-1, flags);
+            } else {
+                /* Copy the base name. Keep a directory prefix intact. */
                 char *p = gzip_base_name (ofname);
                 char *base = p;
-               for (;;) {
-                   *p = (char)get_char();
-                   if (*p++ == '\0') break;
-                   if (p >= ofname+sizeof(ofname)) {
-                       gzip_error ("corrupted input -- file name too large");
-                   }
-               }
-               p = gzip_base_name (base);
-               memmove (base, p, strlen (p) + 1);
+                for (;;) {
+                    *p = (char) get_byte ();
+                    if (*p++ == '\0') break;
+                    if (p >= ofname+sizeof(ofname)) {
+                        gzip_error ("corrupted input -- file name too large");
+                    }
+                }
+                if (flags & HEADER_CRC)
+                  updcrc ((uch *) base, p - base);
+                p = gzip_base_name (base);
+                memmove (base, p, strlen (p) + 1);
                 /* If necessary, adapt the name to local OS conventions: */
                 if (!list) {
                    MAKE_LEGAL_NAME(base);
-                  if (base) list=0; /* avoid warning about unused variable */
+                   if (base) list=0; /* avoid warning about unused variable */
                 }
-           } /* no_name || to_stdout */
-       } /* ORIG_NAME */
+            } /* no_name || to_stdout */
+        } /* ORIG_NAME */
 
-       /* Discard file comment if any */
-       if ((flags & COMMENT) != 0) {
-           while (get_char() != 0) /* null */ ;
-       }
-       if (part_nb == 1) {
-           header_bytes = inptr + 2*sizeof(long); /* include crc and size */
-       }
+        /* Discard file comment if any */
+        if ((flags & COMMENT) != 0) {
+            discard_input_bytes (-1, flags);
+        }
+
+        if (flags & HEADER_CRC)
+          {
+            unsigned int crc16 = updcrc (magic, 0) & 0xffff;
+            unsigned int header16 = get_byte ();
+            header16 |= ((unsigned int) get_byte ()) << 8;
+            if (header16 != crc16)
+              {
+                fprintf (stderr,
+                         "%s: %s: header checksum 0x%04x != computed checksum 0x%04x\n",
+                         program_name, ifname, header16, crc16);
+                exit_code = ERROR;
+                if (force <= 1)
+                  return -1;
+              }
+          }
+
+        if (part_nb == 1) {
+            header_bytes = inptr + 2*4; /* include crc and size */
+        }
 
     } else if (memcmp(magic, PKZIP_MAGIC, 2) == 0 && inptr == 2
-           && memcmp((char*)inbuf, PKZIP_MAGIC, 4) == 0) {
-       /* To simplify the code, we support a zip file when alone only.
+            && memcmp((char*)inbuf, PKZIP_MAGIC, 4) == 0) {
+        /* To simplify the code, we support a zip file when alone only.
          * We are thus guaranteed that the entire local header fits in inbuf.
          */
         inptr = 0;
-       work = unzip;
-       if (check_zipfile(in) != OK) return -1;
-       /* check_zipfile may get ofname from the local header */
-       last_member = 1;
+        work = unzip;
+        if (check_zipfile(in) != OK) return -1;
+        /* check_zipfile may get ofname from the local header */
+        last_member = 1;
 
     } else if (memcmp(magic, PACK_MAGIC, 2) == 0) {
-       work = unpack;
-       method = PACKED;
+        work = unpack;
+        method = PACKED;
 
     } else if (memcmp(magic, LZW_MAGIC, 2) == 0) {
-       work = unlzw;
-       method = COMPRESSED;
-       last_member = 1;
+        work = unlzw;
+        method = COMPRESSED;
+        last_member = 1;
 
     } else if (memcmp(magic, LZH_MAGIC, 2) == 0) {
-       work = unlzh;
-       method = LZHED;
-       last_member = 1;
+        work = unlzh;
+        method = LZHED;
+        last_member = 1;
 
     } else if (force && to_stdout && !list) { /* pass input unchanged */
-       method = STORED;
-       work = copy;
-        inptr = 0;
-       last_member = 1;
+        method = STORED;
+        work = copy;
+        if (imagic1 != EOF)
+            inptr--;
+        last_member = 1;
+        if (imagic0 != EOF) {
+            write_buf(fileno(stdout), magic, 1);
+            bytes_out++;
+        }
     }
     if (method >= 0) return method;
 
     if (part_nb == 1) {
-       fprintf (stderr, "\n%s: %s: not in gzip format\n",
-                program_name, ifname);
-       exit_code = ERROR;
-       return -1;
+        fprintf (stderr, "\n%s: %s: not in gzip format\n",
+                 program_name, ifname);
+        exit_code = ERROR;
+        return -1;
     } else {
-       if (magic[0] == 0)
-         {
-           int inbyte;
-           for (inbyte = imagic1;  inbyte == 0;  inbyte = try_byte ())
-             continue;
-           if (inbyte == EOF)
-             {
-               if (verbose)
-                 WARN ((stderr, "\n%s: %s: decompression OK, trailing zero bytes ignored\n",
-                        program_name, ifname));
-               return -3;
-             }
-         }
-
-       WARN((stderr, "\n%s: %s: decompression OK, trailing garbage ignored\n",
-             program_name, ifname));
-       return -2;
+        if (magic[0] == 0)
+          {
+            int inbyte;
+            for (inbyte = imagic1;  inbyte == 0;  inbyte = try_byte ())
+              continue;
+            if (inbyte == EOF)
+              {
+                if (verbose)
+                  WARN ((stderr, "\n%s: %s: decompression OK, trailing zero bytes ignored\n",
+                         program_name, ifname));
+                return -3;
+              }
+          }
+
+        WARN((stderr, "\n%s: %s: decompression OK, trailing garbage ignored\n",
+              program_name, ifname));
+        return -2;
     }
 }
 
@@ -1448,43 +1506,42 @@ local void do_list(ifd, method)
     off_t o;
 
     for (o = OFF_T_MAX;  9 < o;  o /= 10) {
-       positive_off_t_width++;
+        positive_off_t_width++;
     }
 
     if (first_time && method >= 0) {
-       first_time = 0;
-       if (verbose)  {
-           printf("method  crc     date  time  ");
-       }
-       if (!quiet) {
-           printf("%*.*s %*.*s  ratio uncompressed_name\n",
-                  positive_off_t_width, positive_off_t_width, "compressed",
-                  positive_off_t_width, positive_off_t_width, "uncompressed");
-       }
+        first_time = 0;
+        if (verbose)  {
+            printf("method  crc     date  time  ");
+        }
+        if (!quiet) {
+            printf("%*.*s %*.*s  ratio uncompressed_name\n",
+                   positive_off_t_width, positive_off_t_width, "compressed",
+                   positive_off_t_width, positive_off_t_width, "uncompressed");
+        }
     } else if (method < 0) {
-       if (total_in <= 0 || total_out <= 0) return;
-       if (verbose) {
-           printf("                            ");
-       }
-       if (verbose || !quiet) {
-           fprint_off(stdout, total_in, positive_off_t_width);
-           printf(" ");
-           fprint_off(stdout, total_out, positive_off_t_width);
-           printf(" ");
-       }
-       display_ratio(total_out-(total_in-header_bytes), total_out, stdout);
-       /* header_bytes is not meaningful but used to ensure the same
-        * ratio if there is a single file.
-        */
-       printf(" (totals)\n");
-       return;
+        if (total_in <= 0 || total_out <= 0) return;
+        if (verbose) {
+            printf("                            ");
+        }
+        if (verbose || !quiet) {
+            fprint_off(stdout, total_in, positive_off_t_width);
+            printf(" ");
+            fprint_off(stdout, total_out, positive_off_t_width);
+            printf(" ");
+        }
+        display_ratio(total_out-(total_in-header_bytes), total_out, stdout);
+        /* header_bytes is not meaningful but used to ensure the same
+         * ratio if there is a single file.
+         */
+        printf(" (totals)\n");
+        return;
     }
     crc = (ulg)~0; /* unknown */
     bytes_out = -1L;
     bytes_in = ifile_size;
 
-#if RECORD_IO == 0
-    if (method == DEFLATED && !last_member) {
+    if (!RECORD_IO && method == DEFLATED && !last_member) {
         /* Get the crc and uncompressed size for gzip'ed (not zip'ed) files.
          * If the lseek fails, we could use read() to get to the end, but
          * --list is used to get quick results.
@@ -1499,37 +1556,37 @@ local void do_list(ifd, method)
                 read_error();
             }
             crc       = LG(buf);
-           bytes_out = LG(buf+4);
-       }
+            bytes_out = LG(buf+4);
+        }
     }
-#endif /* RECORD_IO */
+
     if (verbose)
       {
-       struct tm *tm = localtime (&time_stamp.tv_sec);
-       printf ("%5s %08lx ", methods[method], crc);
-       if (tm)
-         printf ("%s%3d %02d:%02d ",
-                 ("Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\0Dec"
-                  + 4 * tm->tm_mon),
-                 tm->tm_mday, tm->tm_hour, tm->tm_min);
-       else
-         printf ("??? ?? ??:?? ");
+        struct tm *tm = localtime (&time_stamp.tv_sec);
+        printf ("%5s %08lx ", methods[method], crc);
+        if (tm)
+          printf ("%s%3d %02d:%02d ",
+                  ("Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\0Dec"
+                   + 4 * tm->tm_mon),
+                  tm->tm_mday, tm->tm_hour, tm->tm_min);
+        else
+          printf ("??? ?? ??:?? ");
       }
     fprint_off(stdout, bytes_in, positive_off_t_width);
     printf(" ");
     fprint_off(stdout, bytes_out, positive_off_t_width);
     printf(" ");
     if (bytes_in  == -1L) {
-       total_in = -1L;
-       bytes_in = bytes_out = header_bytes = 0;
+        total_in = -1L;
+        bytes_in = bytes_out = header_bytes = 0;
     } else if (total_in >= 0) {
-       total_in  += bytes_in;
+        total_in  += bytes_in;
     }
     if (bytes_out == -1L) {
-       total_out = -1L;
-       bytes_in = bytes_out = header_bytes = 0;
+        total_out = -1L;
+        bytes_in = bytes_out = header_bytes = 0;
     } else if (total_out >= 0) {
-       total_out += bytes_out;
+        total_out += bytes_out;
     }
     display_ratio(bytes_out-(bytes_in-header_bytes), bytes_out, stdout);
     printf(" %s\n", ofname);
@@ -1555,10 +1612,10 @@ local void shorten_name(name)
 
     len = strlen(name);
     if (decompress) {
-       if (len <= 1)
-         gzip_error ("name too short");
-       name[len-1] = '\0';
-       return;
+        if (len <= 1)
+          gzip_error ("name too short");
+        name[len-1] = '\0';
+        return;
     }
     p = get_suffix(name);
     if (! p)
@@ -1568,33 +1625,33 @@ local void shorten_name(name)
 
     /* compress 1234567890.tar to 1234567890.tgz */
     if (len > 4 && strequ(p-4, ".tar")) {
-       strcpy(p-4, ".tgz");
-       return;
+        strcpy(p-4, ".tgz");
+        return;
     }
     /* Try keeping short extensions intact:
      * 1234.678.012.gz -> 123.678.012.gz
      */
     do {
-       p = strrchr(name, PATH_SEP);
-       p = p ? p+1 : name;
-       while (*p) {
-           plen = strcspn(p, PART_SEP);
-           p += plen;
-           if (plen > min_part) trunc = p-1;
-           if (*p) p++;
-       }
+        p = strrchr(name, PATH_SEP);
+        p = p ? p+1 : name;
+        while (*p) {
+            plen = strcspn(p, PART_SEP);
+            p += plen;
+            if (plen > min_part) trunc = p-1;
+            if (*p) p++;
+        }
     } while (trunc == NULL && --min_part != 0);
 
     if (trunc != NULL) {
-       do {
-           trunc[0] = trunc[1];
-       } while (*trunc++);
-       trunc--;
+        do {
+            trunc[0] = trunc[1];
+        } while (*trunc++);
+        trunc--;
     } else {
-       trunc = strrchr(name, PART_SEP[0]);
-       if (!trunc)
-         gzip_error ("internal error in shorten_name");
-       if (trunc[1] == '\0') trunc--; /* force truncation */
+        trunc = strrchr(name, PART_SEP[0]);
+        if (!trunc)
+          gzip_error ("internal error in shorten_name");
+        if (trunc[1] == '\0') trunc--; /* force truncation */
     }
     strcpy(trunc, z_suffix);
 }
@@ -1607,22 +1664,22 @@ local int check_ofname()
 {
     /* Ask permission to overwrite the existing file */
     if (!force) {
-       int ok = 0;
-       fprintf (stderr, "%s: %s already exists;", program_name, ofname);
-       if (foreground && isatty(fileno(stdin))) {
-           fprintf(stderr, " do you wish to overwrite (y or n)? ");
-           fflush(stderr);
-           ok = yesno();
-       }
-       if (!ok) {
-           fprintf(stderr, "\tnot overwritten\n");
-           if (exit_code == OK) exit_code = WARNING;
-           return ERROR;
-       }
+        int ok = 0;
+        fprintf (stderr, "%s: %s already exists;", program_name, ofname);
+        if (foreground && (presume_input_tty || isatty(fileno(stdin)))) {
+            fprintf(stderr, " do you wish to overwrite (y or n)? ");
+            fflush(stderr);
+            ok = yesno();
+        }
+        if (!ok) {
+            fprintf(stderr, "\tnot overwritten\n");
+            if (exit_code == OK) exit_code = WARNING;
+            return ERROR;
+        }
     }
     if (xunlink (ofname)) {
-       progerror(ofname);
-       return ERROR;
+        progerror(ofname);
+        return ERROR;
     }
     return OK;
 }
@@ -1644,24 +1701,24 @@ local void copy_stat(ifstat)
     timespec[1] = get_stat_mtime (ifstat);
 
     if (decompress && 0 <= time_stamp.tv_nsec
-       && ! (timespec[1].tv_sec == time_stamp.tv_sec
-             && timespec[1].tv_nsec == time_stamp.tv_nsec))
+        && ! (timespec[1].tv_sec == time_stamp.tv_sec
+              && timespec[1].tv_nsec == time_stamp.tv_nsec))
       {
-       timespec[1] = time_stamp;
-       if (verbose > 1) {
-           fprintf(stderr, "%s: time stamp restored\n", ofname);
-       }
+        timespec[1] = time_stamp;
+        if (verbose > 1) {
+            fprintf(stderr, "%s: time stamp restored\n", ofname);
+        }
       }
 
-    if (gl_futimens (ofd, ofname, timespec) != 0)
+    if (fdutimens (ofd, ofname, timespec) != 0)
       {
-       int e = errno;
-       WARN ((stderr, "%s: ", program_name));
-       if (!quiet)
-         {
-           errno = e;
-           perror (ofname);
-         }
+        int e = errno;
+        WARN ((stderr, "%s: ", program_name));
+        if (!quiet)
+          {
+            errno = e;
+            perror (ofname);
+          }
       }
 #endif
 
@@ -1681,82 +1738,72 @@ local void copy_stat(ifstat)
     r = chmod (ofname, mode);
 #endif
     if (r != 0) {
-       int e = errno;
-       WARN ((stderr, "%s: ", program_name));
-       if (!quiet) {
-           errno = e;
-           perror(ofname);
-       }
+        int e = errno;
+        WARN ((stderr, "%s: ", program_name));
+        if (!quiet) {
+            errno = e;
+            perror(ofname);
+        }
     }
 }
 
 #if ! NO_DIR
 
 /* ========================================================================
- * Recurse through the given directory. This code is taken from ncompress.
+ * Recurse through the given directory.
  */
 local void treat_dir (fd, dir)
     int fd;
     char *dir;
 {
-    struct dirent *dp;
     DIR      *dirp;
     char     nbuf[MAX_PATH_LEN];
-    int      len;
+    char *entries;
+    char const *entry;
+    size_t entrylen;
 
     dirp = fdopendir (fd);
 
     if (dirp == NULL) {
-       progerror(dir);
-       close (fd);
-       return ;
+        progerror(dir);
+        close (fd);
+        return ;
     }
-    /*
-     ** WARNING: the following algorithm could occasionally cause
-     ** compress to produce error warnings of the form "<filename>.gz
-     ** already has .gz suffix - ignored". This occurs when the
-     ** .gz output file is inserted into the directory below
-     ** readdir's current pointer.
-     ** These warnings are harmless but annoying, so they are suppressed
-     ** with option -r (except when -v is on). An alternative
-     ** to allowing this would be to store the entire directory
-     ** list in memory, then compress the entries in the stored
-     ** list. Given the depth-first recursive algorithm used here,
-     ** this could use up a tremendous amount of memory. I don't
-     ** think it's worth it. -- Dave Mack
-     ** (An other alternative might be two passes to avoid depth-first.)
-     */
 
-    while ((errno = 0, dp = readdir(dirp)) != NULL) {
+    entries = streamsavedir (dirp);
+    if (! entries)
+      progerror (dir);
+    if (closedir (dirp) != 0)
+      progerror (dir);
+    if (! entries)
+      return;
 
-       if (strequ(dp->d_name,".") || strequ(dp->d_name,"..")) {
-           continue;
-       }
-       len = strlen(dir);
-       if (len + _D_EXACT_NAMLEN (dp) + 1 < MAX_PATH_LEN - 1) {
-           strcpy(nbuf,dir);
-           if (len != 0 /* dir = "" means current dir on Amiga */
+    for (entry = entries; *entry; entry += entrylen + 1) {
+        size_t len = strlen (dir);
+        entrylen = strlen (entry);
+        if (strequ (entry, ".") || strequ (entry, ".."))
+          continue;
+        if (len + entrylen < MAX_PATH_LEN - 2) {
+            strcpy(nbuf,dir);
+            if (len != 0 /* dir = "" means current dir on Amiga */
 #ifdef PATH_SEP2
-               && dir[len-1] != PATH_SEP2
+                && dir[len-1] != PATH_SEP2
 #endif
 #ifdef PATH_SEP3
-               && dir[len-1] != PATH_SEP3
+                && dir[len-1] != PATH_SEP3
 #endif
-           ) {
-               nbuf[len++] = PATH_SEP;
-           }
-           strcpy(nbuf+len, dp->d_name);
-           treat_file(nbuf);
-       } else {
-           fprintf(stderr,"%s: %s/%s: pathname too long\n",
-                   program_name, dir, dp->d_name);
-           exit_code = ERROR;
-       }
+            ) {
+                nbuf[len++] = PATH_SEP;
+            }
+            strcpy (nbuf + len, entry);
+            treat_file(nbuf);
+        } else {
+            fprintf(stderr,"%s: %s/%s: pathname too long\n",
+                    program_name, dir, entry);
+            exit_code = ERROR;
+        }
     }
-    if (errno != 0)
-       progerror(dir);
-    if (CLOSEDIR(dirp) != 0)
-       progerror(dir);
+    free (entries);
 }
 #endif /* ! NO_DIR */
 
@@ -1776,7 +1823,7 @@ install_signal_handlers ()
     {
       sigaction (handled_sig[i], NULL, &act);
       if (act.sa_handler != SIG_IGN)
-       sigaddset (&caught_signals, handled_sig[i]);
+        sigaddset (&caught_signals, handled_sig[i]);
     }
 
   act.sa_handler = abort_gzip_signal;
@@ -1786,18 +1833,18 @@ install_signal_handlers ()
   for (i = 0; i < nsigs; i++)
     if (sigismember (&caught_signals, handled_sig[i]))
       {
-       if (i == 0)
-         foreground = 1;
-       sigaction (handled_sig[i], &act, NULL);
+        if (i == 0)
+          foreground = 1;
+        sigaction (handled_sig[i], &act, NULL);
       }
 #else
   for (i = 0; i < nsigs; i++)
     if (signal (handled_sig[i], SIG_IGN) != SIG_IGN)
       {
-       if (i == 0)
-         foreground = 1;
-       signal (handled_sig[i], abort_gzip_signal);
-       siginterrupt (handled_sig[i], 1);
+        if (i == 0)
+          foreground = 1;
+        signal (handled_sig[i], abort_gzip_signal);
+        siginterrupt (handled_sig[i], 1);
       }
 #endif
 }
index e730a1cd8b20a617a4062b5e04ad5cbb07569444..da8dad1ad6b06b4beeeee0a30b2c559f69077ebd 100644 (file)
--- a/gzip.doc
+++ b/gzip.doc
 GZIP(1)                                                                       GZIP(1)
 
-NAME
+1mNAME0m
        gzip, gunzip, zcat - compress or expand files
 
-SYNOPSIS
-       gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ...         ]
-       gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ]
-       zcat [ -fhLV ] [ name ...  ]
+1mSYNOPSIS0m
+       1mgzip 22m[ 1m-acdfhlLnNrtvV19 22m] [1m-S suffix22m] [ 4mname24m 4m...24m  ]
+       1mgunzip 22m[ 1m-acfhlLnNrtvV 22m] [1m-S suffix22m] [ 4mname24m 4m...24m         ]
+       1mzcat 22m[ 1m-fhLV 22m] [ 4mname24m 4m...24m  ]
 
-DESCRIPTION
-       Gzip  reduces  the  size         of  the  named  files using Lempel-Ziv coding
+1mDESCRIPTION0m
+       4mGzip24m  reduces  the size  of  the  named  files using Lempel-Ziv coding
        (LZ77). Whenever possible, each file  is  replaced  by  one  with  the
-       extension .gz, while keeping the same ownership modes, access and modi-
-       fication times. (The default extension is -gz for VMS,  z  for  MSDOS,
+       extension 1m.gz, 22mwhile keeping the same ownership modes, access and modi-
+       fication times. (The default extension is 1m-gz 22mfor VMS,  1mz  22mfor  MSDOS,
        OS/2  FAT, Windows NT FAT and Atari.)  If no files are specified, or if
        a file name is "-", the standard input is compressed  to         the  standard
-       output. Gzip will only attempt to compress regular files.  In particu-
+       output. 4mGzip24m will only attempt to compress regular files.  In particu-
        lar, it will ignore symbolic links.
 
-       If the compressed file name is too long for its file system, gzip trun-
-       cates  it.   Gzip  attempts to truncate only the parts of the file name
+       If the compressed file name is too long for its file system, 4mgzip24m trun-
+       cates  it.   4mGzip24m  attempts to truncate only the parts of the file name
        longer than 3 characters.  (A part is delimited by dots.) If  the  name
        consists         of  small  parts  only,  the longest parts are truncated. For
        example, if file names are limited to 14 characters, gzip.msdos.exe  is
        compressed to gzi.msd.exe.gz.  Names are not truncated on systems which
        do not have a limit on file name length.
 
-       By default, gzip keeps the original file name and timestamp in the com-
-       pressed file.  These  are used when decompressing the file with the -N
+       By default, 4mgzip24m keeps the original file name and timestamp in the com-
+       pressed file.  These  are used when decompressing the file with the 1m-N0m
        option. This is useful when the compressed file name was         truncated  or
        when the time stamp was not preserved after a file transfer.
 
-       Compressed  files  can be restored to their original form using gzip -d
-       or gunzip or zcat.  If the original name saved in the  compressed  file
+       Compressed  files  can be restored to their original form using 4mgzip24m 4m-d0m
+       or 4mgunzip24m or 4mzcat.24m  If the original name saved in the compressed  file
        is not suitable for its file system, a new name is constructed from the
        original one to make it legal.
 
-       gunzip takes a list of files on its command line and replaces each file
+       4mgunzip24m takes a list of files on its command line and replaces each file
        whose  name ends with .gz, -gz, .z, -z, or _z (ignoring case) and which
        begins with the correct magic number with an uncompressed file  without
-       the  original extension.         gunzip also recognizes the special extensions
-       .tgz and .taz as shorthands for .tar.gz and .tar.Z respectively.          When
-       compressing, gzip uses the .tgz extension if necessary instead of trun-
-       cating a file with a .tar extension.
-
-       gunzip can currently decompress files created by gzip,  zip,  compress,
-       compress         -H  or pack.  The detection of the input format is automatic.
-       When using the first two formats, gunzip checks a 32 bit CRC. For pack,
-       gunzip checks the uncompressed length. The standard compress format was
-       not designed to allow consistency checks. However gunzip         is  sometimes
+       the  original extension.         4mgunzip24m also recognizes the special extensions
+       1m.tgz 22mand 1m.taz 22mas shorthands for 1m.tar.gz 22mand 1m.tar.Z 22mrespectively.   When
+       compressing, 4mgzip24m uses the 1m.tgz 22mextension if necessary instead of trun-
+       cating a file with a 1m.tar 22mextension.
+
+       4mgunzip24m can currently decompress files created by 4mgzip,24m         4mzip,24m  4mcompress,0m
+       4mcompress24m  4m-H24m  or 4mpack.24m  The detection of the input format is automatic.
+       When using the first two formats, 4mgunzip24m checks a 32 bit CRC. For 4mpack,0m
+       4mgunzip24m checks the uncompressed length. The standard 4mcompress24m format was
+       not designed to allow consistency checks. However 4mgunzip24m  is  sometimes
        able  to detect a bad .Z file. If you get an error when uncompressing a
        .Z file, do not assume that the .Z file is correct simply  because  the
-       standard         uncompress  does  not complain. This generally means that the
-       standard uncompress does not check its  input,  and  happily  generates
+       standard         4muncompress24m  does  not complain. This generally means that the
+       standard 4muncompress24m does not check its  input,  and         happily  generates
        garbage output.   The  SCO compress -H format (lzh compression method)
        does not include a CRC but also allows some consistency checks.
 
-       Files created by zip can be uncompressed by gzip only if         they  have  a
+       Files created by 4mzip24m can be uncompressed by gzip only if  they  have  a
        single  member  compressed with the 'deflation' method. This feature is
        only intended to help conversion of tar.zip files to the tar.gz format.
-       To  extract  a zip file with a single member, use a command like gunzip
-       <foo.zip or gunzip -S .zip foo.zip.  To extract zip files with  several
-       members, use unzip instead of gunzip.
+       To  extract  a 4mzip24m file with a single member, use a command like 4mgunzip0m
+       4m<foo.zip24m or 4mgunzip24m 4m-S24m 4m.zip24m 4mfoo.zip24m.  To extract zip files with several
+       members, use 4munzip24m instead of 4mgunzip.0m
 
-       zcat  is         identical  to  gunzip  -c.   (On  some  systems,  zcat may be
-       installed as gzcat to preserve the original link         to  compress.)   zcat
+       4mzcat24m  is  identical         to  4mgunzip24m  1m-c.   22m(On  some  systems,  4mzcat24m may be
+       installed as 4mgzcat24m to preserve the original link  to  4mcompress.)24m   4mzcat0m
        uncompresses either a list of files on the command line or its standard
-       input and writes the uncompressed data on standard output.   zcat  will
+       input and writes the uncompressed data on standard output.   4mzcat24m  will
        uncompress files that have the correct magic number whether they have a
-       .gz suffix or not.
+       1m.gz 22msuffix or not.
 
-       Gzip uses the Lempel-Ziv algorithm used in zip and PKZIP.   The amount
+       4mGzip24m uses the Lempel-Ziv algorithm used in 4mzip24m and PKZIP.   The  amount
        of  compression obtained depends on the size of the input and the dis-
        tribution of common substrings. Typically, text such as source code or
        English is  reduced  by  60-70%.  Compression is generally much better
-       than that achieved by LZW (as used in  compress),  Huffman  coding  (as
-       used in pack), or adaptive Huffman coding (compact).
+       than that achieved by LZW (as used in  4mcompress24m),  Huffman coding  (as
+       used in 4mpack24m), or adaptive Huffman coding (4mcompact24m).
 
        Compression  is always  performed,  even  if  the  compressed  file is
        slightly larger than the original. The worst case expansion  is a  few
        bytes  for  the gzip  file header, plus 5 bytes every 32K block, or an
        expansion ratio of 0.015% for large files. Note that the actual number
-       of  used         disk blocks almost never increases.  gzip preserves the mode,
+       of  used         disk blocks almost never increases.  4mgzip24m preserves the mode,
        ownership and timestamps of files when compressing or decompressing.
 
-       The gzip file format is specified in P. Deutsch, GZIP file format spec-
+       The 4mgzip24m file format is specified in P. Deutsch, GZIP file format spec-
        ification version 4.3, <ftp://ftp.isi.edu/in-notes/rfc1952.txt>, Inter-
-       net RFC 1952 (May 1996).         The zip deflation format is specified  in  P.
+       net RFC 1952 (May 1996).         The 4mzip24m deflation format is specified  in  P.
        Deutsch,         DEFLATE  Compressed  Data  Format  Specification version 1.3,
        <ftp://ftp.isi.edu/in-notes/rfc1951.txt>, Internet RFC 1951 (May 1996).
 
-OPTIONS
-       -a --ascii
-             Ascii  text  mode: convert end-of-lines using local conventions.
-             This option is supported only  on  some  non-Unix  systems.  For
+1mOPTIONS0m
+       1m-a --ascii0m
+             Ascii text mode: convert end-of-lines using  local  conventions.
+             This  option  is  supported  only  on some non-Unix systems. For
              MSDOS, CR LF is converted to LF when compressing, and LF is con-
              verted to CR LF when decompressing.
 
-       -c --stdout --to-stdout
-             Write output on standard output; keep original files  unchanged.
-             If  there  are  several  input  files,  the output consists of a
-             sequence of independently compressed members. To  obtain  better
-             compression,  concatenate  all  input  files  before compressing
+       1m-c --stdout --to-stdout0m
+             Write  output on standard output; keep original files unchanged.
+             If there are several input  files,  the  output  consists  of  a
+             sequence  of  independently compressed members. To obtain better
+             compression, concatenate  all  input  files  before  compressing
              them.
 
-       -d --decompress --uncompress
+       1m-d --decompress --uncompress0m
              Decompress.
 
-       -f --force
+       1m-f --force0m
              Force compression or decompression even if the file has multiple
-             links  or  the corresponding file already exists, or if the com-
+             links or the corresponding file already exists, or if  the  com-
              pressed data is read from or written to a terminal. If the input
-             data  is  not  in a format recognized by gzip, and if the option
-             --stdout is also given, copy the input data  without  change  to
-             the  standard  output:  let  zcat  behave  as cat.  If -f is not
-             given, and when not running in the background, gzip  prompts  to
+             data is not in a format recognized by 4mgzip,24m and  if  the  option
+             --stdout  is  also  given, copy the input data without change to
+             the standard output: let 4mzcat24m behave  as  4mcat.24m   If  1m-f  22mis  not
+             given,  and  when not running in the background, 4mgzip24m prompts to
              verify whether an existing file should be overwritten.
 
-       -h --help
+       1m-h --help0m
              Display a help screen and quit.
 
-       -l --list
+       1m-l --list0m
              For each compressed file, list the following fields:
 
                  compressed size: size of the compressed file
@@ -128,91 +128,91 @@ OPTIONS
                  ratio: compression ratio (0.0% if unknown)
                  uncompressed_name: name of the uncompressed file
 
-             The  uncompressed size is given as -1 for files not in gzip for-
-             mat, such as compressed .Z files. To get the  uncompressed  size
+             The uncompressed size is given as -1 for files not in gzip  for-
+             mat,  such  as compressed .Z files. To get the uncompressed size
              for such a file, you can use:
 
                  zcat file.Z | wc -c
 
-             In  combination  with the --verbose option, the following fields
+             In combination with the --verbose option, the  following  fields
              are also displayed:
 
                  method: compression method
                  crc: the 32-bit CRC of the uncompressed data
                  date & time: time stamp for the uncompressed file
 
-             The compression methods currently supported  are  deflate,  com-
-             press,  lzh  (SCO  compress  -H)  and pack.  The crc is given as
+             The  compression  methods  currently supported are deflate, com-
+             press, lzh (SCO compress -H) and pack.   The  crc  is  given  as
              ffffffff for a file not in gzip format.
 
-             With --name, the uncompressed name,  date and  time   are  those
+             With  --name,  the  uncompressed name,  date and time  are those
              stored within the compress file if present.
 
-             With  --verbose,  the  size totals and compression ratio for all
-             files is also displayed, unless some  sizes  are  unknown.  With
+             With --verbose, the size totals and compression  ratio  for  all
+             files  is  also  displayed,  unless some sizes are unknown. With
              --quiet, the title and totals lines are not displayed.
 
-       -L --license
-             Display the gzip license and quit.
+       1m-L --license0m
+             Display the 4mgzip24m license and quit.
 
-       -n --no-name
-             When  compressing,  do  not save the original file name and time
+       1m-n --no-name0m
+             When compressing, do not save the original file  name  and  time
              stamp by default. (The original name is always saved if the name
-             had  to  be  truncated.)  When decompressing, do not restore the
-             original file name if present (remove only the gzip suffix  from
-             the  compressed  file name) and do not restore the original time
+             had to be truncated.) When decompressing,  do  not  restore  the
+             original  file name if present (remove only the 4mgzip24m suffix from
+             the compressed file name) and do not restore the  original  time
              stamp if present (copy it from the compressed file). This option
              is the default when decompressing.
 
-       -N --name
-             When  compressing,  always  save the original file name and time
-             stamp; this is the  default.  When  decompressing,  restore  the
-             original  file  name  and  time stamp if present. This option is
+       1m-N --name0m
+             When compressing, always save the original file  name  and  time
+             stamp;  this  is  the  default.  When decompressing, restore the
+             original file name and time stamp if  present.  This  option  is
              useful on systems which have a limit on file name length or when
              the time stamp has been lost after a file transfer.
 
-       -q --quiet
+       1m-q --quiet0m
              Suppress all warnings.
 
-       -r --recursive
-             Travel  the  directory structure recursively. If any of the file
-             names specified on the command line are directories,  gzip  will
-             descend  into  the directory and compress all the files it finds
-             there (or decompress them in the case of gunzip ).
+       1m-r --recursive0m
+             Travel the directory structure recursively. If any of  the  file
+             names  specified  on the command line are directories, 4mgzip24m will
+             descend into the directory and compress all the files  it  finds
+             there (or decompress them in the case of 4mgunzip24m ).
 
-       -S .suf --suffix .suf
-             Use suffix .suf instead of .gz. Any suffix  can  be  given,  but
-             suffixes other than .z and .gz should be avoided to avoid confu-
-             sion when files are transferred to other systems.  A null suffix
-             forces  gunzip  to  try decompression on all given files regard-
-             less of suffix, as in:
+       1m-S .suf --suffix .suf0m
+             When compressing, use suffix .suf instead of .gz.  Any non-empty
+             suffix can be given, but suffixes other than .z and  .gz  should
+             be  avoided  to  avoid  confusion  when files are transferred to
+             other systems.
 
-                 gunzip -S "" *       (*.* for MSDOS)
+             When decompressing, add .suf to the beginning  of  the  list  of
+             suffixes to try, when deriving an output file name from an input
+             file name.
 
-             Previous versions of gzip used the .z suffix. This  was  changed
-             to avoid a conflict with pack(1).
+             4mpack24m(1)4m.0m
 
-       -t --test
+       1m-t --test0m
              Test. Check the compressed file integrity.
 
-       -v --verbose
+       1m-v --verbose0m
              Verbose. Display the name and percentage reduction for each file
              compressed or decompressed.
 
-       -V --version
+       1m-V --version0m
              Version. Display the version number and compilation options then
              quit.
 
-       -# --fast --best
-             Regulate  the  speed of compression using the specified digit #,
-             where -1 or --fast  indicates  the  fastest  compression  method
-             (less  compression)  and -9 or --best indicates the slowest com-
-             pression method (best  compression).   The  default  compression
-             level is -6 (that is, biased towards high compression at expense
+       1m-# --fast --best0m
+             Regulate the speed of compression using the specified  digit  4m#24m,
+             where  1m-1  22mor  1m--fast  22mindicates  the fastest compression method
+             (less compression) and 1m-9 22mor 1m--best 22mindicates the  slowest  com-
+             pression  method  (best  compression).   The default compression
+             level is 1m-6 22m(that is, biased towards high compression at expense
              of speed).
 
-ADVANCED USAGE
-       Multiple compressed files can be concatenated.  In  this         case,  gunzip
+1mADVANCED USAGE0m
+       Multiple         compressed  files  can  be concatenated. In this case, 4mgunzip0m
        will extract all members at once. For example:
 
             gzip -c file1  > foo.gz
@@ -226,8 +226,8 @@ ADVANCED USAGE
 
             cat file1 file2
 
-       In  case of damage to one member of a .gz file, other members can still
-       be recovered (if the damaged member is removed). However, you  can  get
+       In case of damage to one member of a .gz file, other members can         still
+       be  recovered  (if the damaged member is removed). However, you can get
        better compression by compressing all members at once:
 
             cat file1 file2 | gzip > foo.gz
@@ -242,64 +242,64 @@ ADVANCED USAGE
             gzip -cd old.gz | gzip > new.gz
 
        If a compressed file consists of several members, the uncompressed size
-       and  CRC reported by the --list option applies to the last member only.
+       and CRC reported by the --list option applies to the last member         only.
        If you need the uncompressed size for all members, you can use:
 
             gzip -cd file.gz | wc -c
 
-       If you wish to create a single archive file with         multiple  members  so
+       If  you wish  to create a single archive file with multiple members so
        that members can later be extracted independently, use an archiver such
-       as tar or zip. GNU tar supports the -z option to invoke gzip  transpar-
+       as  tar or zip. GNU tar supports the -z option to invoke gzip transpar-
        ently. gzip is designed as a complement to tar, not as a replacement.
 
-ENVIRONMENT
-       The  environment         variable  GZIP  can hold a set of default options for
-       gzip.  These options are interpreted first and can  be  overwritten  by
+1mENVIRONMENT0m
+       The environment variable 1mGZIP 22mcan hold a set  of  default  options for
+       4mgzip.24m   These  options  are interpreted first and can be overwritten by
        explicit command line parameters. For example:
             for sh:    GZIP="-8v --name"; export GZIP
             for csh:   setenv GZIP "-8v --name"
             for MSDOS: set GZIP=-8v --name
 
-       On  Vax/VMS, the name of the environment variable is GZIP_OPT, to avoid
+       On Vax/VMS, the name of the environment variable is GZIP_OPT, to         avoid
        a conflict with the symbol set for invocation of the program.
 
-SEE ALSO
+1mSEE ALSO0m
        znew(1), zcmp(1), zmore(1), zforce(1), gzexe(1), zip(1), unzip(1), com-
        press(1), pack(1), compact(1)
 
-       The gzip file format is specified in P. Deutsch, GZIP file format spec-
-       ification version 4.3, <ftp://ftp.isi.edu/in-notes/rfc1952.txt>, Inter-
-       net  RFC         1952 (May 1996).  The zip deflation format is specified in P.
-       Deutsch, DEFLATE Compressed  Data  Format  Specification         version  1.3,
-       <ftp://ftp.isi.edu/in-notes/rfc1951.txt>, Internet RFC 1951 (May 1996).
+       The 4mgzip24m file format is specified in P. Deutsch, GZIP file format spec-
+       ification version 4.3, 1m<ftp://ftp.isi.edu/in-notes/rfc1952.txt>22m, Inter-
+       net RFC 1952 (May 1996).         The 4mzip24m deflation format is specified  in  P.
+       Deutsch,         DEFLATE  Compressed  Data  Format  Specification version 1.3,
+       1m<ftp://ftp.isi.edu/in-notes/rfc1951.txt>22m, Internet RFC 1951 (May 1996).
 
-DIAGNOSTICS
+1mDIAGNOSTICS0m
        Exit status is normally 0; if an error occurs, exit status is 1.         If  a
        warning occurs, exit status is 2.
 
        Usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...]
              Invalid options were specified on the command line.
 
-       file: not in gzip format
-             The file specified to gunzip has not been compressed.
+       4mfile24m: not in gzip format
+             The file specified to 4mgunzip24m has not been compressed.
 
-       file: Corrupt input. Use zcat to recover some data.
+       4mfile24m: Corrupt input. Use zcat to recover some data.
              The  compressed  file has been damaged. The data up to the point
              of failure can be recovered using
 
-                   zcat file > recover
+                   zcat 4mfile24m > recover
 
-       file: compressed with xx bits, can only handle yy bits
-             File was compressed (using LZW) by a  program  that  could  deal
-             with more bits than the decompress code on this machine.  Recom-
+       4mfile24m: compressed with 4mxx24m bits, can only handle 4myy24m bits
+             4mFile24m was compressed (using LZW) by a  program  that  could  deal
+             with more 4mbits24m than the decompress code on this machine.  Recom-
              press the file with gzip, which compresses better and uses  less
              memory.
 
-       file: already has .gz suffix -- no change
+       4mfile24m: already has .gz suffix -- no change
              The  file  is assumed to be already compressed.  Rename the file
              and try again.
 
-       file already exists; do you wish to overwrite (y or n)?
+       4mfile24m already exists; do you wish to overwrite (y or n)?
              Respond "y" if you want the output file to be replaced;  "n"  if
              not.
 
@@ -307,66 +307,66 @@ DIAGNOSTICS
              A  SIGSEGV  violation  was detected which usually means that the
              input file has been corrupted.
 
-       xx.x% Percentage of the input saved by compression.
-             (Relevant only for -v and -l.)
+       4mxx.x%24m Percentage of the input saved by compression.
+             (Relevant only for 1m-v 22mand 1m-l22m.)
 
        -- not a regular file or directory: ignored
              When the input file is not a regular file or directory, (e.g.  a
              symbolic link, socket, FIFO, device file), it is left unaltered.
 
-       -- has xx other links: unchanged
-             The input file has links; it is left unchanged.  See  ln(1)  for
-             more information. Use the -f flag to force compression of multi-
+       -- has 4mxx24m other links: unchanged
+             The  input  file has links; it is left unchanged.  See 4mln24m(1) for
+             more information. Use the 1m-f 22mflag to force compression of multi-
              ply-linked files.
 
-CAVEATS
-       When writing compressed data to a tape, it is  generally         necessary  to
-       pad  the         output  with  zeroes up to a block boundary. When the data is
-       read and the whole block is passed to gunzip for decompression, gunzip
-       detects that there is extra trailing garbage after the compressed data
-       and emits a warning by default. You have to use the --quiet  option  to
-       suppress         the  warning.  This option can be set in the GZIP environment
+1mCAVEATS0m
+       When  writing  compressed  data to a tape, it is generally necessary to
+       pad the output with zeroes up to a block boundary.  When         the  data  is
+       read  and the whole block is passed to 4mgunzip24m for decompression, 4mgunzip0m
+       detects that there is extra trailing garbage after the compressed  data
+       and  emits  a warning by default. You have to use the --quiet option to
+       suppress the warning. This option can be set in the  1mGZIP  22menvironment
        variable as in:
         for sh:  GZIP="-q"  tar -xfz --block-compress /dev/rst0
         for csh: (setenv GZIP -q; tar -xfz --block-compr /dev/rst0
 
-       In the above example, gzip is invoked implicitly by the -z  option  of
-       GNU  tar. Make sure that the same block size (-b option of tar) is used
-       for reading and writing  compressed  data  on  tapes.   (This  example
+       In  the above  example, gzip is invoked implicitly by the -z option of
+       GNU tar. Make sure that the same block size (-b option of tar) is  used
+       for  reading  and  writing  compressed  data  on         tapes.  (This example
        assumes you are using the GNU version of tar.)
 
-BUGS
-       The  gzip  format  represents the input size modulo 2^32, so the --list
-       option reports incorrect uncompressed sizes and compression ratios  for
-       uncompressed  files  4 GB and larger.  To work around this problem, you
-       can use the following command to discover a large  uncompressed file's
+1mBUGS0m
+       The gzip format represents the input size modulo 2^32,  so  the --list
+       option  reports incorrect uncompressed sizes and compression ratios for
+       uncompressed files 4 GB and larger.  To work around this         problem,  you
+       can  use         the following command to discover a large uncompressed file's
        true size:
 
             zcat file.gz | wc -c
 
-       The  --list  option reports sizes as -1 and crc as ffffffff if the com-
+       The --list option reports sizes as -1 and crc as ffffffff if  the  com-
        pressed file is on a non seekable media.
 
-       In some rare cases, the --best option gives worse compression than  the
-       default compression  level  (-6). On some highly redundant files, com-
-       press compresses better than gzip.
+       In  some rare cases, the --best option gives worse compression than the
+       default compression level (-6). On some highly  redundant  files,  4mcom-0m
+       4mpress24m compresses better than 4mgzip.0m
 
-COPYRIGHT NOTICE
+1mCOPYRIGHT NOTICE0m
        Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
        Copyright (C) 1992, 1993 Jean-loup Gailly
 
-       Permission is granted to make and distribute verbatim  copies  of  this
-       manual  provided         the  copyright  notice and this permission notice are
+       Permission  is  granted to make and distribute verbatim copies of this
+       manual provided the copyright notice and         this  permission  notice  are
        preserved on all copies.
 
-       Permission is granted to copy and distribute modified versions of  this
-       manual  under  the  conditions  for verbatim copying, provided that the
-       entire resulting derived work is distributed under the terms of a  per-
+       Permission  is granted to copy and distribute modified versions of this
+       manual under the conditions for verbatim         copying,  provided  that  the
+       entire  resulting derived work is distributed under the terms of a per-
        mission notice identical to this one.
 
-       Permission  is granted to copy and distribute translations of this man-
+       Permission is granted to copy and distribute translations of this  man-
        ual into another language, under the above conditions for modified ver-
-       sions,  except  that this permission notice may be stated in a transla-
+       sions, except that this permission notice may be stated in  a  transla-
        tion approved by the Foundation.
 
                                     local                             GZIP(1)
diff --git a/gzip.h b/gzip.h
index 0c3dd6846eb90495b018414a60a242ceb7ba62db..e6fac710c1216c113a167ada1fc2695bb6354b11 100644 (file)
--- a/gzip.h
+++ b/gzip.h
@@ -1,6 +1,6 @@
 /* gzip.h -- common declarations for all gzip modules
 
-   Copyright (C) 1997-1999, 2001, 2006-2007, 2009-2010 Free Software
+   Copyright (C) 1997-1999, 2001, 2006-2007, 2009-2012 Free Software
    Foundation, Inc.
 
    Copyright (C) 1992-1993 Jean-loup Gailly.
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#if defined(__STDC__) || defined(PROTO)
-#  define OF(args)  args
-#else
-#  define OF(args)  ()
-#endif
-
 #ifdef __STDC__
    typedef void *voidp;
 #else
@@ -172,7 +166,7 @@ typedef int file_t;     /* Do not use stdio */
 
 /* gzip flag byte */
 #define ASCII_FLAG   0x01 /* bit 0 set: file probably ascii text */
-#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */
+#define HEADER_CRC   0x02 /* bit 1 set: CRC16 for the gzip header */
 #define EXTRA_FIELD  0x04 /* bit 2 set: extra field present */
 #define ORIG_NAME    0x08 /* bit 3 set: original file name present */
 #define COMMENT      0x10 /* bit 4 set: file comment present */
@@ -202,7 +196,6 @@ typedef int file_t;     /* Do not use stdio */
  * distances are limited to MAX_DIST instead of WSIZE.
  */
 
-extern int decrypt;        /* flag to turn on decryption */
 extern int exit_code;      /* program exit code */
 extern int verbose;        /* be verbose (-v) */
 extern int quiet;          /* be quiet (-q) */
@@ -268,66 +261,66 @@ extern int save_orig_name; /* set if original name must be saved */
 #endif
 
 #define WARN(msg) {if (!quiet) fprintf msg ; \
-                  if (exit_code == OK) exit_code = WARNING;}
+                   if (exit_code == OK) exit_code = WARNING;}
 
-       /* in zip.c: */
-extern int zip        OF((int in, int out));
-extern int file_read  OF((char *buf,  unsigned size));
+        /* in zip.c: */
+extern int zip        (int in, int out);
+extern int file_read  (char *buf,  unsigned size);
 
-       /* in unzip.c */
-extern int unzip      OF((int in, int out));
-extern int check_zipfile OF((int in));
+        /* in unzip.c */
+extern int unzip      (int in, int out);
+extern int check_zipfile (int in);
 
-       /* in unpack.c */
-extern int unpack     OF((int in, int out));
+        /* in unpack.c */
+extern int unpack     (int in, int out);
 
-       /* in unlzh.c */
-extern int unlzh      OF((int in, int out));
+        /* in unlzh.c */
+extern int unlzh      (int in, int out);
 
-       /* in gzip.c */
-void abort_gzip OF((void)) ATTRIBUTE_NORETURN;
+        /* in gzip.c */
+extern void abort_gzip (void) ATTRIBUTE_NORETURN;
 
         /* in deflate.c */
-void lm_init OF((int pack_level, ush *flags));
-off_t deflate OF((void));
+extern void lm_init (int pack_level, ush *flags);
+extern off_t deflate (void);
 
         /* in trees.c */
-void ct_init     OF((ush *attr, int *method));
-int  ct_tally    OF((int dist, int lc));
-off_t flush_block OF((char *buf, ulg stored_len, int eof));
+extern void ct_init     (ush *attr, int *method);
+extern int  ct_tally    (int dist, int lc);
+extern off_t flush_block (char *buf, ulg stored_len, int eof);
 
         /* in bits.c */
-void     bi_init    OF((file_t zipfile));
-void     send_bits  OF((int value, int length));
-unsigned bi_reverse OF((unsigned value, int length));
-void     bi_windup  OF((void));
-void     copy_block OF((char *buf, unsigned len, int header));
-extern   int (*read_buf) OF((char *buf, unsigned size));
-
-       /* in util.c: */
-extern int copy           OF((int in, int out));
-extern ulg  updcrc        OF((uch *s, unsigned n));
-extern void clear_bufs    OF((void));
-extern int  fill_inbuf    OF((int eof_ok));
-extern void flush_outbuf  OF((void));
-extern void flush_window  OF((void));
-extern void write_buf     OF((int fd, voidp buf, unsigned cnt));
-extern int read_buffer    OF((int fd, voidp buf, unsigned int cnt));
-extern char *strlwr       OF((char *s));
-extern char *gzip_base_name OF((char *fname));
-extern int xunlink        OF((char *fname));
-extern void make_simple_name OF((char *name));
-extern char *add_envopt   OF((int *argcp, char ***argvp, char const *env));
-extern void gzip_error    OF((char const *m)) ATTRIBUTE_NORETURN;
-extern void xalloc_die    OF((void)) ATTRIBUTE_NORETURN;
-extern void warning       OF((char const *m));
-extern void read_error    OF((void)) ATTRIBUTE_NORETURN;
-extern void write_error   OF((void)) ATTRIBUTE_NORETURN;
-extern void display_ratio OF((off_t num, off_t den, FILE *file));
-extern void fprint_off    OF((FILE *, off_t, int));
-
-       /* in inflate.c */
-extern int inflate OF((void));
-
-       /* in yesno.c */
-extern int yesno OF((void));
+extern void     bi_init    (file_t zipfile);
+extern void     send_bits  (int value, int length);
+extern unsigned bi_reverse (unsigned value, int length) _GL_ATTRIBUTE_CONST;
+extern void     bi_windup  (void);
+extern void     copy_block (char *buf, unsigned len, int header);
+extern int     (*read_buf) (char *buf, unsigned size);
+
+        /* in util.c: */
+extern int copy           (int in, int out);
+extern ulg  updcrc        (uch *s, unsigned n);
+extern void clear_bufs    (void);
+extern int  fill_inbuf    (int eof_ok);
+extern void flush_outbuf  (void);
+extern void flush_window  (void);
+extern void write_buf     (int fd, voidp buf, unsigned cnt);
+extern int read_buffer    (int fd, voidp buf, unsigned int cnt);
+extern char *strlwr       (char *s);
+extern char *gzip_base_name (char *fname) _GL_ATTRIBUTE_PURE;
+extern int xunlink        (char *fname);
+extern void make_simple_name (char *name);
+extern char *add_envopt   (int *argcp, char ***argvp, char const *env);
+extern void gzip_error    (char const *m) ATTRIBUTE_NORETURN;
+extern void xalloc_die    (void) ATTRIBUTE_NORETURN;
+extern void warning       (char const *m);
+extern void read_error    (void) ATTRIBUTE_NORETURN;
+extern void write_error   (void) ATTRIBUTE_NORETURN;
+extern void display_ratio (off_t num, off_t den, FILE *file);
+extern void fprint_off    (FILE *, off_t, int);
+
+        /* in inflate.c */
+extern int inflate (void);
+
+        /* in yesno.c */
+extern int yesno (void);
index 75353e2d72b50f0fb48d51a5ef6498d324dbf901..d5a8dfff5c54596ffcc58795ff25b8ec995844eb 100644 (file)
--- a/inflate.c
+++ b/inflate.c
@@ -1,6 +1,6 @@
 /* Inflate deflated data
 
-   Copyright (C) 1997-1999, 2002, 2006, 2009-2010 Free Software Foundation,
+   Copyright (C) 1997-1999, 2002, 2006, 2009-2012 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -141,15 +141,7 @@ struct huft {
 
 
 /* Function prototypes */
-int huft_build OF((unsigned *, unsigned, unsigned, ush *, ush *,
-                   struct huft **, int *));
-int huft_free OF((struct huft *));
-int inflate_codes OF((struct huft *, struct huft *, int, int));
-int inflate_stored OF((void));
-int inflate_fixed OF((void));
-int inflate_dynamic OF((void));
-int inflate_block OF((int *));
-int inflate OF((void));
+static int huft_free (struct huft *);
 
 
 /* The inflate algorithm uses a sliding 32K byte window on the uncompressed
@@ -216,10 +208,10 @@ static ush cpdext[] = {         /* Extra bits for distance codes */
    the stream.
  */
 
-ulg bb;                         /* bit buffer */
-unsigned bk;                    /* bits in bit buffer */
+static ulg bb;                         /* bit buffer */
+static unsigned bk;                    /* bits in bit buffer */
 
-ush mask_bits[] = {
+static ush mask_bits[] = {
     0x0000,
     0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
     0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
@@ -271,8 +263,8 @@ ush mask_bits[] = {
  */
 
 
-int lbits = 9;          /* bits in base literal/length lookup table */
-int dbits = 6;          /* bits in base distance lookup table */
+static int lbits = 9;   /* bits in base literal/length lookup table */
+static int dbits = 6;   /* bits in base distance lookup table */
 
 
 /* If BMAX needs to be larger than 16, then h and x[] should be ulg. */
@@ -280,17 +272,19 @@ int dbits = 6;          /* bits in base distance lookup table */
 #define N_MAX 288       /* maximum number of codes in any set */
 
 
-unsigned hufts;         /* track memory usage */
+static unsigned hufts;  /* track memory usage */
 
 
-int huft_build(b, n, s, d, e, t, m)
-unsigned *b;            /* code lengths in bits (all assumed <= BMAX) */
-unsigned n;             /* number of codes (assumed <= N_MAX) */
-unsigned s;             /* number of simple-valued codes (0..s-1) */
-ush *d;                 /* list of base values for non-simple codes */
-ush *e;                 /* list of extra bits for non-simple codes */
-struct huft **t;        /* result: starting table */
-int *m;                 /* maximum lookup bits, returns actual */
+static int
+huft_build(
+unsigned *b,            /* code lengths in bits (all assumed <= BMAX) */
+unsigned n,             /* number of codes (assumed <= N_MAX) */
+unsigned s,             /* number of simple-valued codes (0..s-1) */
+ush *d,                 /* list of base values for non-simple codes */
+ush *e,                 /* list of extra bits for non-simple codes */
+struct huft **t,        /* result: starting table */
+int *m                  /* maximum lookup bits, returns actual */
+           )
 /* Given a list of code lengths and a maximum table size, make a set of
    tables to decode that set of codes.  Return zero on success, one if
    the given code set is incomplete (the tables are still built in this
@@ -323,7 +317,7 @@ int *m;                 /* maximum lookup bits, returns actual */
   p = b;  i = n;
   do {
     Tracecv(*p, (stderr, (n-i >= ' ' && n-i <= '~' ? "%c %d\n" : "0x%x %d\n"),
-           n-i, *p));
+            n-i, *p));
     c[*p]++;                    /* assume all entries <= BMAX */
     p++;                      /* Can't combine with above line (Solaris bug) */
   } while (--i);
@@ -415,13 +409,13 @@ int *m;                 /* maximum lookup bits, returns actual */
         {                       /* too few codes for k-w bit table */
           f -= a + 1;           /* deduct codes from patterns left */
           xp = c + k;
-         if (j < z)
-           while (++j < z)       /* try smaller tables up to z bits */
-           {
-             if ((f <<= 1) <= *++xp)
-               break;            /* enough codes to use up j bits */
-             f -= *xp;           /* else deduct codes from patterns */
-           }
+          if (j < z)
+            while (++j < z)       /* try smaller tables up to z bits */
+            {
+              if ((f <<= 1) <= *++xp)
+                break;            /* enough codes to use up j bits */
+              f -= *xp;           /* else deduct codes from patterns */
+            }
         }
         z = 1 << j;             /* table entries for j-bit table */
 
@@ -458,7 +452,7 @@ int *m;                 /* maximum lookup bits, returns actual */
       {
         r.e = (uch)(*p < 256 ? 16 : 15);    /* 256 is end-of-block code */
         r.v.n = (ush)(*p);             /* simple code is just the value */
-       p++;                           /* one compiler does not like *p++ */
+        p++;                           /* one compiler does not like *p++ */
       }
       else
       {
@@ -492,11 +486,11 @@ int *m;                 /* maximum lookup bits, returns actual */
 
 
 
-int huft_free(t)
-struct huft *t;         /* table to free */
-/* Free the malloc'ed tables built by huft_build(), which makes a linked
+/* Free the malloc'ed tables T built by huft_build(), which makes a linked
    list of the tables it made, with the links in a dummy first entry of
    each table. */
+static int
+huft_free(struct huft *t)
 {
   register struct huft *p, *q;
 
@@ -513,11 +507,12 @@ struct huft *t;         /* table to free */
 }
 
 
-int inflate_codes(tl, td, bl, bd)
-struct huft *tl, *td;   /* literal/length and distance decoder tables */
-int bl, bd;             /* number of bits decoded by tl[] and td[] */
+/* tl, td:   literal/length and distance decoder tables */
+/* bl, bd:   number of bits decoded by tl[] and td[] */
 /* inflate (decompress) the codes in a deflated (compressed) block.
    Return an error code or zero if it all goes ok. */
+static int
+inflate_codes(struct huft *tl, struct huft *td, int bl, int bd)
 {
   register unsigned e;  /* table entry flag/number of extra bits */
   unsigned n, d;        /* length and index for copy */
@@ -588,19 +583,18 @@ int bl, bd;             /* number of bits decoded by tl[] and td[] */
       /* do the copy */
       do {
         n -= (e = (e = WSIZE - ((d &= WSIZE-1) > w ? d : w)) > n ? n : e);
-#if !defined(NOMEMCPY) && !defined(DEBUG)
-        unsigned int delta = w > d ? w - d : d - w;
-        if (delta >= e)
+#ifndef DEBUG
+        if (e <= (d < w ? w - d : d - w))
         {
           memcpy(slide + w, slide + d, e);
           w += e;
           d += e;
         }
         else                      /* do it slow to avoid memcpy() overlap */
-#endif /* !NOMEMCPY */
+#endif
           do {
             slide[w++] = slide[d++];
-           Tracevv((stderr, "%c", slide[w-1]));
+            Tracevv((stderr, "%c", slide[w-1]));
           } while (--e);
         if (w == WSIZE)
         {
@@ -623,8 +617,9 @@ int bl, bd;             /* number of bits decoded by tl[] and td[] */
 
 
 
-int inflate_stored()
 /* "decompress" an inflated type 0 (stored) block. */
+static int
+inflate_stored(void)
 {
   unsigned n;           /* number of bytes in block */
   unsigned w;           /* current window position */
@@ -676,10 +671,11 @@ int inflate_stored()
 
 
 
-int inflate_fixed()
 /* decompress an inflated type 1 (fixed Huffman codes) block.  We should
    either replace this with a custom decoder, or at least precompute the
    Huffman tables. */
+static int
+inflate_fixed(void)
 {
   int i;                /* temporary variable */
   struct huft *tl;      /* literal/length code table */
@@ -727,8 +723,9 @@ int inflate_fixed()
 
 
 
-int inflate_dynamic()
 /* decompress an inflated type 2 (dynamic Huffman codes) block. */
+static int
+inflate_dynamic(void)
 {
   int i;                /* temporary variables */
   unsigned j;
@@ -797,7 +794,7 @@ int inflate_dynamic()
   }
 
   if (tl == NULL)              /* Grrrhhh */
-       return 2;
+        return 2;
 
   /* read in literal and distance code lengths */
   n = nl + nd;
@@ -896,9 +893,9 @@ int inflate_dynamic()
 
 
 
-int inflate_block(e)
-int *e;                 /* last block flag */
 /* decompress an inflated block */
+/* E is the last block flag */
+static int inflate_block(int *e)
 {
   unsigned t;           /* block type */
   unsigned w;           /* current window position */
@@ -944,7 +941,8 @@ int *e;                 /* last block flag */
 
 
 
-int inflate()
+int
+inflate(void)
 /* decompress an inflated entry */
 {
   int e;                /* last block flag */
index 6f4f55e183f2fe984c70715d68e4a6a7227544b4..f31fd9a7bd0f705d2151590958131d67838d5ac0 100644 (file)
@@ -1,6 +1,6 @@
 # Make gzip/lib                                -*-Makefile-*-
 
-# Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009-2012 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
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
+AM_CFLAGS =
+BUILT_SOURCES =
+CLEANFILES =
+EXTRA_DIST =
+MOSTLYCLEANDIRS =
+MOSTLYCLEANFILES =
+SUFFIXES =
+noinst_LIBRARIES =
 
 include gnulib.mk
 
@@ -24,11 +32,11 @@ libgzip_a_DEPENDENCIES += $(LIBOBJS)
 AM_CFLAGS += $(WARN_CFLAGS) $(WERROR_CFLAGS)
 
 match.$(OBJEXT): match.c
-       cp $(srcdir)/match.c _match.S
-       $(CPP) $(CPPFLAGS) $(ASCPPFLAGS) _match.S > _match.i
-       $(ASCPPPOST) < _match.i > match_.s
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(ASFLAGS_config) -c match_.s
-       mv match_.$(OBJEXT) $@
-       rm -f _match.S _match.i match_.s
+       $(AM_V_GEN)cp $(srcdir)/match.c _match.S
+       $(AM_V_at)$(CPP) $(CPPFLAGS) $(ASCPPFLAGS) _match.S > _match.i
+       $(AM_V_at)$(ASCPPPOST) < _match.i > match_.s
+       $(AM_V_at)$(CC) $(CPPFLAGS) $(CFLAGS) $(ASFLAGS_config) -c match_.s
+       $(AM_V_at)mv match_.$(OBJEXT) $@
+       $(AM_V_at)rm -f _match.S _match.i match_.s
 
 MOSTLYCLEANFILES += _match.S _match.i match_.s
index 1b42ddb89e7a6917eadc5c295a4915e1520f79b3..4c96b6a35a08d8a0521cdee1e0463aac4938eadc 100644 (file)
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11a from Makefile.am.
+# Makefile.in generated by automake 1.12a from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software
-# Foundation, Inc.
+# Copyright (C) 1994-2012 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.
@@ -17,7 +16,7 @@
 
 # Make gzip/lib                                -*-Makefile-*-
 
-# Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009-2012 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
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+#
+# This file 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 3 of the License, or
+# (at your option) any later version.
+#
+# This file 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 file is free software, distributed under the terms of the GNU
-# General Public License.  As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
+# You should have received a copy of the GNU General Public License
+# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libgzip --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=getline --avoid=rpmatch --no-libtool --macro-prefix=gl announce-gen calloc close closein fclose fcntl fcntl-safer fdl fdopendir fprintf-posix getopt-gnu git-version-gen gitlog-to-changelog gnu-make gnu-web-doc-update gnumakefile gnupload ignore-value lstat maintainer-makefile malloc manywarnings perror printf-posix realloc stat-time sys_stat time update-copyright utimens xalloc yesno
-
-
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libgzip --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=getline --avoid=rpmatch --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen calloc close closein fclose fcntl fcntl-safer fdl fdopendir fprintf-posix getopt-gnu git-version-gen gitlog-to-changelog gnu-make gnu-web-doc-update gnumakefile gnupload ignore-value largefile lib-ignore lstat maintainer-makefile malloc-gnu manywarnings perror printf-posix readme-release realloc-gnu savedir stat-time sys_stat time update-copyright utimens xalloc yesno
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -65,81 +90,90 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(srcdir)/config.hin $(srcdir)/gnulib.mk \
-       match.c
+DIST_COMMON = $(srcdir)/gnulib.mk $(srcdir)/Makefile.in \
+       $(srcdir)/Makefile.am $(srcdir)/config.hin match.c \
+       $(top_srcdir)/build-aux/depcomp
 subdir = lib
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
-       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/calloc.m4 \
-       $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/chown.m4 \
+       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \
+       $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/chdir-long.m4 \
        $(top_srcdir)/m4/clock_time.m4 \
        $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \
-       $(top_srcdir)/m4/closein.m4 $(top_srcdir)/m4/closeout.m4 \
-       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/d-ino.m4 \
-       $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
-       $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \
-       $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \
-       $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
-       $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/exponentd.m4 \
+       $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closein.m4 \
+       $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
+       $(top_srcdir)/m4/configmake.m4 \
+       $(top_srcdir)/m4/dirent-safer.m4 $(top_srcdir)/m4/dirent_h.m4 \
+       $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
+       $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
+       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/errno_h.m4 \
+       $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exponentd.m4 \
        $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \
        $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \
        $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-o.m4 \
        $(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fcntl.m4 \
        $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopendir.m4 \
-       $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/float_h.m4 \
-       $(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/fpieee.m4 \
-       $(top_srcdir)/m4/fprintf-posix.m4 $(top_srcdir)/m4/fpurge.m4 \
-       $(top_srcdir)/m4/freading.m4 $(top_srcdir)/m4/frexp.m4 \
-       $(top_srcdir)/m4/frexpl.m4 $(top_srcdir)/m4/fseeko.m4 \
-       $(top_srcdir)/m4/ftello.m4 \
-       $(top_srcdir)/m4/getcwd-abort-bug.m4 \
-       $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
-       $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettime.m4 \
-       $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \
-       $(top_srcdir)/m4/gnu-make.m4 $(top_srcdir)/m4/gnulib-common.m4 \
+       $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/filenamecat.m4 \
+       $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fpending.m4 \
+       $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \
+       $(top_srcdir)/m4/fpurge.m4 $(top_srcdir)/m4/freading.m4 \
+       $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
+       $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
+       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/ftell.m4 \
+       $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/getcwd.m4 \
+       $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
+       $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+       $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \
+       $(top_srcdir)/m4/gnulib-common.m4 \
        $(top_srcdir)/m4/gnulib-comp.m4 \
        $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \
        $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \
        $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \
-       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/lchown.m4 \
-       $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/localcharset.m4 \
-       $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \
-       $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/longlong.m4 \
+       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/largefile.m4 \
+       $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/lib-ignore.m4 \
+       $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+       $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
+       $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \
+       $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \
        $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
        $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/manywarnings.m4 \
        $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbrtowc.m4 \
        $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \
        $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mempcpy.m4 \
-       $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mkdir.m4 \
-       $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
-       $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nocrash.m4 \
+       $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+       $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
+       $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+       $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
        $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \
+       $(top_srcdir)/m4/opendir.m4 $(top_srcdir)/m4/pathmax.m4 \
        $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/printf-frexp.m4 \
        $(top_srcdir)/m4/printf-frexpl.m4 \
        $(top_srcdir)/m4/printf-posix-rpl.m4 \
        $(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/quotearg.m4 \
-       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/rmdir.m4 \
-       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/shell.m4 \
-       $(top_srcdir)/m4/signbit.m4 $(top_srcdir)/m4/size_max.m4 \
+       $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/realloc.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \
+       $(top_srcdir)/m4/shell.m4 $(top_srcdir)/m4/signbit.m4 \
+       $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/ssize_t.m4 \
        $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
        $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
        $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
        $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
        $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
-       $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/sys_stat_h.m4 \
-       $(top_srcdir)/m4/sys_time_h.m4 $(top_srcdir)/m4/time_h.m4 \
-       $(top_srcdir)/m4/timespec.m4 $(top_srcdir)/m4/unistd-safer.m4 \
-       $(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlink.m4 \
+       $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \
+       $(top_srcdir)/m4/sys_socket_h.m4 \
+       $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
+       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/threadlib.m4 \
+       $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/timespec.m4 \
+       $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
        $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/m4/utimens.m4 \
        $(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \
        $(top_srcdir)/m4/vfprintf-posix.m4 \
        $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \
-       $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wchar_t.m4 \
-       $(top_srcdir)/m4/wctype.m4 $(top_srcdir)/m4/wint_t.m4 \
-       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xgetcwd.m4 \
-       $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/yesno.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
+       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
+       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+       $(top_srcdir)/m4/yesno.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
@@ -147,92 +181,84 @@ CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
-AR = ar
-ARFLAGS = cru
-AM_V_AR = $(am__v_AR_$(V))
-am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
 am__v_AR_0 = @echo "  AR      " $@;
-AM_V_at = $(am__v_at_$(V))
-am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
-am__v_at_0 = @
+am__v_AR_1 = 
 libgzip_a_AR = $(AR) $(ARFLAGS)
 am__DEPENDENCIES_1 =
-am_libgzip_a_OBJECTS = close-hook.$(OBJEXT) freadahead.$(OBJEXT) \
-       freading.$(OBJEXT) fseterr.$(OBJEXT) localcharset.$(OBJEXT) \
+am_libgzip_a_OBJECTS = c-ctype.$(OBJEXT) c-strcasecmp.$(OBJEXT) \
+       c-strncasecmp.$(OBJEXT) cloexec.$(OBJEXT) \
+       close-stream.$(OBJEXT) closein.$(OBJEXT) closeout.$(OBJEXT) \
+       opendir-safer.$(OBJEXT) dirname-lgpl.$(OBJEXT) \
+       basename-lgpl.$(OBJEXT) stripslash.$(OBJEXT) \
+       exitfail.$(OBJEXT) creat-safer.$(OBJEXT) open-safer.$(OBJEXT) \
+       fd-hook.$(OBJEXT) filenamecat-lgpl.$(OBJEXT) \
+       freadahead.$(OBJEXT) freading.$(OBJEXT) fseterr.$(OBJEXT) \
+       gettime.$(OBJEXT) localcharset.$(OBJEXT) lock.$(OBJEXT) \
        openat-die.$(OBJEXT) printf-frexp.$(OBJEXT) \
-       printf-frexpl.$(OBJEXT) xalloc-die.$(OBJEXT)
+       printf-frexpl.$(OBJEXT) quotearg.$(OBJEXT) save-cwd.$(OBJEXT) \
+       savedir.$(OBJEXT) threadlib.$(OBJEXT) dup-safer.$(OBJEXT) \
+       fd-safer.$(OBJEXT) pipe-safer.$(OBJEXT) utimens.$(OBJEXT) \
+       xmalloc.$(OBJEXT) xalloc-die.$(OBJEXT) yesno.$(OBJEXT)
 libgzip_a_OBJECTS = $(am_libgzip_a_OBJECTS)
-LTLIBRARIES = $(noinst_LTLIBRARIES)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_$(V))
-am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
 am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_$(V))
-am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
-AM_V_GEN = $(am__v_GEN_$(V))
-am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
-am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_CCLD_1 = 
 SOURCES = $(libgzip_a_SOURCES) $(EXTRA_libgzip_a_SOURCES)
 DIST_SOURCES = $(libgzip_a_SOURCES) $(EXTRA_libgzip_a_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-       html-recursive info-recursive install-data-recursive \
-       install-dvi-recursive install-exec-recursive \
-       install-html-recursive install-info-recursive \
-       install-pdf-recursive install-ps-recursive install-recursive \
-       installcheck-recursive installdirs-recursive pdf-recursive \
-       ps-recursive uninstall-recursive
-HEADERS = $(noinst_HEADERS)
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-       $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-       distdir
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+       $(LISP)config.hin
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
+pkglibexecdir = @pkglibexecdir@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 ALLOCA_H = @ALLOCA_H@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
 ASCPPFLAGS = @ASCPPFLAGS@
 ASCPPPOST = @ASCPPPOST@
 ASFLAGS_config = @ASFLAGS_config@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -245,6 +271,7 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CONFIG_INCLUDE = @CONFIG_INCLUDE@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CYGPATH_W = @CYGPATH_W@
@@ -265,47 +292,89 @@ EXEEXT = @EXEEXT@
 FLOAT_H = @FLOAT_H@
 GETOPT_H = @GETOPT_H@
 GLIBC21 = @GLIBC21@
+GNULIB_ACOSF = @GNULIB_ACOSF@
 GNULIB_ACOSL = @GNULIB_ACOSL@
 GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
+GNULIB_ASINF = @GNULIB_ASINF@
 GNULIB_ASINL = @GNULIB_ASINL@
+GNULIB_ATAN2F = @GNULIB_ATAN2F@
+GNULIB_ATANF = @GNULIB_ATANF@
 GNULIB_ATANL = @GNULIB_ATANL@
 GNULIB_ATOLL = @GNULIB_ATOLL@
 GNULIB_BTOWC = @GNULIB_BTOWC@
 GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
 GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CBRT = @GNULIB_CBRT@
+GNULIB_CBRTF = @GNULIB_CBRTF@
+GNULIB_CBRTL = @GNULIB_CBRTL@
+GNULIB_CEIL = @GNULIB_CEIL@
 GNULIB_CEILF = @GNULIB_CEILF@
 GNULIB_CEILL = @GNULIB_CEILL@
+GNULIB_CHDIR = @GNULIB_CHDIR@
 GNULIB_CHOWN = @GNULIB_CHOWN@
 GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
+GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
+GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
+GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
+GNULIB_COSF = @GNULIB_COSF@
+GNULIB_COSHF = @GNULIB_COSHF@
 GNULIB_COSL = @GNULIB_COSL@
 GNULIB_DIRFD = @GNULIB_DIRFD@
 GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
 GNULIB_DUP2 = @GNULIB_DUP2@
 GNULIB_DUP3 = @GNULIB_DUP3@
 GNULIB_ENVIRON = @GNULIB_ENVIRON@
 GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_EXP2 = @GNULIB_EXP2@
+GNULIB_EXP2F = @GNULIB_EXP2F@
+GNULIB_EXP2L = @GNULIB_EXP2L@
+GNULIB_EXPF = @GNULIB_EXPF@
 GNULIB_EXPL = @GNULIB_EXPL@
+GNULIB_EXPM1 = @GNULIB_EXPM1@
+GNULIB_EXPM1F = @GNULIB_EXPM1F@
+GNULIB_EXPM1L = @GNULIB_EXPM1L@
+GNULIB_FABSF = @GNULIB_FABSF@
+GNULIB_FABSL = @GNULIB_FABSL@
 GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
 GNULIB_FCHDIR = @GNULIB_FCHDIR@
 GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
 GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
 GNULIB_FCLOSE = @GNULIB_FCLOSE@
 GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
 GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
 GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
+GNULIB_FLOOR = @GNULIB_FLOOR@
 GNULIB_FLOORF = @GNULIB_FLOORF@
 GNULIB_FLOORL = @GNULIB_FLOORL@
+GNULIB_FMA = @GNULIB_FMA@
+GNULIB_FMAF = @GNULIB_FMAF@
+GNULIB_FMAL = @GNULIB_FMAL@
+GNULIB_FMOD = @GNULIB_FMOD@
+GNULIB_FMODF = @GNULIB_FMODF@
+GNULIB_FMODL = @GNULIB_FMODL@
 GNULIB_FOPEN = @GNULIB_FOPEN@
 GNULIB_FPRINTF = @GNULIB_FPRINTF@
 GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
 GNULIB_FPURGE = @GNULIB_FPURGE@
 GNULIB_FPUTC = @GNULIB_FPUTC@
 GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
 GNULIB_FREOPEN = @GNULIB_FREOPEN@
 GNULIB_FREXP = @GNULIB_FREXP@
+GNULIB_FREXPF = @GNULIB_FREXPF@
 GNULIB_FREXPL = @GNULIB_FREXPL@
+GNULIB_FSCANF = @GNULIB_FSCANF@
 GNULIB_FSEEK = @GNULIB_FSEEK@
 GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
 GNULIB_FSTATAT = @GNULIB_FSTATAT@
 GNULIB_FSYNC = @GNULIB_FSYNC@
 GNULIB_FTELL = @GNULIB_FTELL@
@@ -313,6 +382,8 @@ GNULIB_FTELLO = @GNULIB_FTELLO@
 GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
 GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
 GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
 GNULIB_GETCWD = @GNULIB_GETCWD@
 GNULIB_GETDELIM = @GNULIB_GETDELIM@
 GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
@@ -325,18 +396,46 @@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_HYPOT = @GNULIB_HYPOT@
+GNULIB_HYPOTF = @GNULIB_HYPOTF@
+GNULIB_HYPOTL = @GNULIB_HYPOTL@
+GNULIB_ILOGB = @GNULIB_ILOGB@
+GNULIB_ILOGBF = @GNULIB_ILOGBF@
+GNULIB_ILOGBL = @GNULIB_ILOGBL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
 GNULIB_ISFINITE = @GNULIB_ISFINITE@
 GNULIB_ISINF = @GNULIB_ISINF@
 GNULIB_ISNAN = @GNULIB_ISNAN@
 GNULIB_ISNAND = @GNULIB_ISNAND@
 GNULIB_ISNANF = @GNULIB_ISNANF@
 GNULIB_ISNANL = @GNULIB_ISNANL@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
 GNULIB_LCHMOD = @GNULIB_LCHMOD@
 GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LDEXPF = @GNULIB_LDEXPF@
 GNULIB_LDEXPL = @GNULIB_LDEXPL@
 GNULIB_LINK = @GNULIB_LINK@
 GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOG = @GNULIB_LOG@
+GNULIB_LOG10 = @GNULIB_LOG10@
+GNULIB_LOG10F = @GNULIB_LOG10F@
+GNULIB_LOG10L = @GNULIB_LOG10L@
+GNULIB_LOG1P = @GNULIB_LOG1P@
+GNULIB_LOG1PF = @GNULIB_LOG1PF@
+GNULIB_LOG1PL = @GNULIB_LOG1PL@
+GNULIB_LOG2 = @GNULIB_LOG2@
+GNULIB_LOG2F = @GNULIB_LOG2F@
+GNULIB_LOG2L = @GNULIB_LOG2L@
+GNULIB_LOGB = @GNULIB_LOGB@
+GNULIB_LOGBF = @GNULIB_LOGBF@
+GNULIB_LOGBL = @GNULIB_LOGBL@
+GNULIB_LOGF = @GNULIB_LOGF@
 GNULIB_LOGL = @GNULIB_LOGL@
 GNULIB_LSEEK = @GNULIB_LSEEK@
 GNULIB_LSTAT = @GNULIB_LSTAT@
@@ -360,6 +459,7 @@ GNULIB_MBSSEP = @GNULIB_MBSSEP@
 GNULIB_MBSSPN = @GNULIB_MBSSPN@
 GNULIB_MBSSTR = @GNULIB_MBSSTR@
 GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
 GNULIB_MEMCHR = @GNULIB_MEMCHR@
 GNULIB_MEMMEM = @GNULIB_MEMMEM@
 GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
@@ -374,43 +474,73 @@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
 GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
 GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
 GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_MODF = @GNULIB_MODF@
+GNULIB_MODFF = @GNULIB_MODFF@
+GNULIB_MODFL = @GNULIB_MODFL@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
 GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
 GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
 GNULIB_OPEN = @GNULIB_OPEN@
 GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_OPENDIR = @GNULIB_OPENDIR@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
 GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
 GNULIB_PIPE2 = @GNULIB_PIPE2@
 GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_POWF = @GNULIB_POWF@
 GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
 GNULIB_PUTC = @GNULIB_PUTC@
 GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
 GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
+GNULIB_READDIR = @GNULIB_READDIR@
 GNULIB_READLINK = @GNULIB_READLINK@
 GNULIB_READLINKAT = @GNULIB_READLINKAT@
 GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
 GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_REMAINDER = @GNULIB_REMAINDER@
+GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
+GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
 GNULIB_REMOVE = @GNULIB_REMOVE@
 GNULIB_RENAME = @GNULIB_RENAME@
 GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
+GNULIB_RINT = @GNULIB_RINT@
+GNULIB_RINTF = @GNULIB_RINTF@
+GNULIB_RINTL = @GNULIB_RINTL@
 GNULIB_RMDIR = @GNULIB_RMDIR@
 GNULIB_ROUND = @GNULIB_ROUND@
 GNULIB_ROUNDF = @GNULIB_ROUNDF@
 GNULIB_ROUNDL = @GNULIB_ROUNDL@
 GNULIB_RPMATCH = @GNULIB_RPMATCH@
 GNULIB_SCANDIR = @GNULIB_SCANDIR@
+GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
 GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
+GNULIB_SINF = @GNULIB_SINF@
+GNULIB_SINHF = @GNULIB_SINHF@
 GNULIB_SINL = @GNULIB_SINL@
 GNULIB_SLEEP = @GNULIB_SLEEP@
 GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
 GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_SQRTF = @GNULIB_SQRTF@
 GNULIB_SQRTL = @GNULIB_SQRTL@
 GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
 GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
 GNULIB_STPCPY = @GNULIB_STPCPY@
 GNULIB_STPNCPY = @GNULIB_STPNCPY@
@@ -418,9 +548,12 @@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
 GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
 GNULIB_STRDUP = @GNULIB_STRDUP@
 GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
 GNULIB_STRNDUP = @GNULIB_STRNDUP@
 GNULIB_STRNLEN = @GNULIB_STRNLEN@
 GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
 GNULIB_STRSEP = @GNULIB_STRSEP@
 GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
 GNULIB_STRSTR = @GNULIB_STRSTR@
@@ -431,14 +564,23 @@ GNULIB_STRTOULL = @GNULIB_STRTOULL@
 GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
 GNULIB_SYMLINK = @GNULIB_SYMLINK@
 GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TANF = @GNULIB_TANF@
+GNULIB_TANHF = @GNULIB_TANHF@
 GNULIB_TANL = @GNULIB_TANL@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
 GNULIB_TRUNC = @GNULIB_TRUNC@
 GNULIB_TRUNCF = @GNULIB_TRUNCF@
 GNULIB_TRUNCL = @GNULIB_TRUNCL@
-GNULIB_UNISTD_H_GETOPT = @GNULIB_UNISTD_H_GETOPT@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
 GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
 GNULIB_UNLINK = @GNULIB_UNLINK@
 GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
 GNULIB_UNSETENV = @GNULIB_UNSETENV@
 GNULIB_USLEEP = @GNULIB_USLEEP@
 GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
@@ -446,51 +588,129 @@ GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
 GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
 GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
 GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
 GNULIB_VPRINTF = @GNULIB_VPRINTF@
 GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
 GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
 GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
 GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
 GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
 GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
 GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
 GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
 GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
 GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
 GREP = @GREP@
+HAVE_ACOSF = @HAVE_ACOSF@
 HAVE_ACOSL = @HAVE_ACOSL@
 HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ASINF = @HAVE_ASINF@
 HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
 HAVE_ATANL = @HAVE_ATANL@
 HAVE_ATOLL = @HAVE_ATOLL@
 HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
 HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
 HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
 HAVE_COSL = @HAVE_COSL@
 HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
 HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
 HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
 HAVE_DECL_COSL = @HAVE_DECL_COSL@
 HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
 HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
 HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
 HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
 HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
 HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
 HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
 HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
 HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
 HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
 HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
 HAVE_DECL_SINL = @HAVE_DECL_SINL@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
 HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
-HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
 HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
 HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
 HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
@@ -498,24 +718,45 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_TANL = @HAVE_DECL_TANL@
 HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DIRENT_H = @HAVE_DIRENT_H@
 HAVE_DPRINTF = @HAVE_DPRINTF@
 HAVE_DUP2 = @HAVE_DUP2@
 HAVE_DUP3 = @HAVE_DUP3@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXPF = @HAVE_EXPF@
 HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
 HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
 HAVE_FCHMODAT = @HAVE_FCHMODAT@
 HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
 HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
 HAVE_FDOPENDIR = @HAVE_FDOPENDIR@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
 HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
 HAVE_FUTIMENS = @HAVE_FUTIMENS@
-HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
 HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
@@ -523,26 +764,43 @@ HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISNAND = @HAVE_ISNAND@
 HAVE_ISNANF = @HAVE_ISNANF@
 HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
 HAVE_LCHMOD = @HAVE_LCHMOD@
 HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
 HAVE_LINK = @HAVE_LINK@
 HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
 HAVE_LOGL = @HAVE_LOGL@
 HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
 HAVE_MBRLEN = @HAVE_MBRLEN@
 HAVE_MBRTOWC = @HAVE_MBRTOWC@
 HAVE_MBSINIT = @HAVE_MBSINIT@
 HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
 HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
@@ -552,27 +810,52 @@ HAVE_MKNOD = @HAVE_MKNOD@
 HAVE_MKNODAT = @HAVE_MKNODAT@
 HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
 HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
 HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
 HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OPENDIR = @HAVE_OPENDIR@
 HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
 HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READDIR = @HAVE_READDIR@
 HAVE_READLINK = @HAVE_READLINK@
 HAVE_READLINKAT = @HAVE_READLINKAT@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
 HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
 HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_REWINDDIR = @HAVE_REWINDDIR@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
 HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
 HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
 HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
 HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
 HAVE_SINL = @HAVE_SINL@
 HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
 HAVE_SQRTL = @HAVE_SQRTL@
 HAVE_STDINT_H = @HAVE_STDINT_H@
 HAVE_STPCPY = @HAVE_STPCPY@
@@ -580,6 +863,7 @@ HAVE_STPNCPY = @HAVE_STPNCPY@
 HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
 HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
 HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
@@ -595,10 +879,13 @@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
-HAVE_UNSETENV = @HAVE_UNSETENV@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
 HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
 HAVE_USLEEP = @HAVE_USLEEP@
 HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
@@ -606,12 +893,45 @@ HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
 HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
 HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
 HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
 HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
 HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
 HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMSET = @HAVE_WMEMSET@
 HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+IGNORE_UNUSED_LIBRARIES_CFLAGS = @IGNORE_UNUSED_LIBRARIES_CFLAGS@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
 INSTALL = @INSTALL@
@@ -623,8 +943,12 @@ LDFLAGS = @LDFLAGS@
 LIBGZIP_LIBDEPS = @LIBGZIP_LIBDEPS@
 LIBGZIP_LTLIBDEPS = @LIBGZIP_LTLIBDEPS@
 LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
 LN_S = @LN_S@
 LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
@@ -632,7 +956,10 @@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
 LOCALE_JA = @LOCALE_JA@
 LOCALE_ZH_CN = @LOCALE_ZH_CN@
 LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
@@ -648,6 +975,7 @@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
 NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
 NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
@@ -665,6 +993,7 @@ NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
 NEXT_WCHAR_H = @NEXT_WCHAR_H@
@@ -679,32 +1008,52 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
 PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
 REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
 REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
 REPLACE_CEILF = @REPLACE_CEILF@
 REPLACE_CEILL = @REPLACE_CEILL@
 REPLACE_CHOWN = @REPLACE_CHOWN@
 REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
+REPLACE_DIRFD = @REPLACE_DIRFD@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
 REPLACE_DUP = @REPLACE_DUP@
 REPLACE_DUP2 = @REPLACE_DUP2@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_FABSL = @REPLACE_FABSL@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FLOOR = @REPLACE_FLOOR@
 REPLACE_FLOORF = @REPLACE_FLOORF@
 REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
 REPLACE_FPURGE = @REPLACE_FPURGE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
 REPLACE_FREXPL = @REPLACE_FREXPL@
 REPLACE_FSEEK = @REPLACE_FSEEK@
 REPLACE_FSEEKO = @REPLACE_FSEEKO@
@@ -712,30 +1061,59 @@ REPLACE_FSTAT = @REPLACE_FSTAT@
 REPLACE_FSTATAT = @REPLACE_FSTATAT@
 REPLACE_FTELL = @REPLACE_FTELL@
 REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
 REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
 REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
 REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISFINITE = @REPLACE_ISFINITE@
 REPLACE_ISINF = @REPLACE_ISINF@
 REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LDEXPL = @REPLACE_LDEXPL@
 REPLACE_LINK = @REPLACE_LINK@
 REPLACE_LINKAT = @REPLACE_LINKAT@
 REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
 REPLACE_LSEEK = @REPLACE_LSEEK@
 REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
 REPLACE_MBRLEN = @REPLACE_MBRLEN@
 REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
 REPLACE_MBSINIT = @REPLACE_MBSINIT@
 REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
 REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
 REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
 REPLACE_MEMCHR = @REPLACE_MEMCHR@
 REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
@@ -743,6 +1121,9 @@ REPLACE_MKFIFO = @REPLACE_MKFIFO@
 REPLACE_MKNOD = @REPLACE_MKNOD@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
 REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
 REPLACE_NAN = @REPLACE_NAN@
 REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
 REPLACE_NULL = @REPLACE_NULL@
@@ -754,9 +1135,17 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
 REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
 REPLACE_REMOVE = @REPLACE_REMOVE@
 REPLACE_RENAME = @REPLACE_RENAME@
 REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
@@ -770,20 +1159,32 @@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
 REPLACE_SLEEP = @REPLACE_SLEEP@
 REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
 REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
 REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
 REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
 REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
 REPLACE_STRNDUP = @REPLACE_STRNDUP@
-REPLACE_STRPTIME = @REPLACE_STRPTIME@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
 REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
 REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
 REPLACE_SYMLINK = @REPLACE_SYMLINK@
 REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
 REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
 REPLACE_UNSETENV = @REPLACE_UNSETENV@
@@ -798,7 +1199,9 @@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
 REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
 REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 REPLACE_WRITE = @REPLACE_WRITE@
 SET_MAKE = @SET_MAKE@
@@ -809,7 +1212,6 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
-SYS_TIME_H = @SYS_TIME_H@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -818,8 +1220,9 @@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOC
 VERSION = @VERSION@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
 WERROR_CFLAGS = @WERROR_CFLAGS@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -847,6 +1250,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
 gl_LTLIBOBJS = @gl_LTLIBOBJS@
 gltests_LIBOBJS = @gltests_LIBOBJS@
 gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -858,10 +1262,10 @@ infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+lispdir = @lispdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
-mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
 pdfdir = @pdfdir@
 prefix = @prefix@
@@ -875,11 +1279,29 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = 1.5 gnits
-SUBDIRS = 
-noinst_HEADERS = 
-noinst_LIBRARIES = libgzip.a
-noinst_LTLIBRARIES = 
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+BUILT_SOURCES = $(ALLOCA_H) configmake.h dirent.h $(ERRNO_H) fcntl.h \
+       $(FLOAT_H) $(GETOPT_H) math.h arg-nonnull.h c++defs.h \
+       unused-parameter.h warn-on-use.h $(STDBOOL_H) $(STDDEF_H) \
+       $(STDINT_H) stdio.h stdlib.h string.h sys/stat.h sys/time.h \
+       sys/types.h time.h unistd.h wchar.h wctype.h
+CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \
+       ref-del.sed
 
 #if GNU_MAKE
 #      [nicer features that work only with GNU Make]
@@ -889,110 +1311,106 @@ noinst_LTLIBRARIES =
 #      for the 2004 POSIX specification]
 #endif
 EXTRA_DIST = alloca.in.h $(top_srcdir)/build-aux/announce-gen \
-       $(top_srcdir)/build-aux/arg-nonnull.h calloc.c calloc.c \
-       chdir-long.c chdir-long.h chown.c fchown-stub.c close.c \
-       close-hook.h close-stream.c close-stream.h closein.c closein.h \
-       closeout.c closeout.h dirent.in.h dirfd.c basename-lgpl.c \
-       dirname-lgpl.c dirname.h stripslash.c dup2.c errno.in.h \
-       error.c error.h exitfail.c exitfail.h fchdir.c fclose.c \
-       fcntl.c fcntl.in.h creat-safer.c fcntl--.h fcntl-safer.h \
-       open-safer.c fdopendir.c openat-priv.h openat-proc.c fflush.c \
-       stdio-impl.h float.in.h fpending.c fpending.h fprintf.c \
+       openat-priv.h openat-proc.c c-strcaseeq.h calloc.c calloc.c \
+       chdir-long.c chdir-long.h cloexec.h close.c close-stream.h \
+       closedir.c dirent-private.h closein.h closeout.h dirent.in.h \
+       dirent--.h dirent-safer.h dirfd.c dirname.h \
+       $(top_srcdir)/build-aux/do-release-commit-and-tag dosname.h \
+       dup.c dup2.c errno.in.h error.c error.h exitfail.h fchdir.c \
+       fclose.c fcntl.c fcntl.in.h fcntl--.h fcntl-safer.h fd-hook.h \
+       fdopendir.c fflush.c stdio-impl.h filename.h filenamecat.h \
+       float.c float.in.h itold.c fpending.c fpending.h fprintf.c \
        fpucw.h fpurge.c stdio-impl.h freadahead.h stdio-impl.h \
-       freading.h stdio-impl.h frexp.c frexp.c frexpl.c fseeko.c \
-       stdio-impl.h fseterr.h stdio-impl.h ftello.c \
-       $(top_srcdir)/build-aux/gendocs.sh getcwd.c getopt.c \
-       getopt.in.h getopt1.c getopt_int.h gettime.c gettimeofday.c \
+       freading.h stdio-impl.h frexp.c frexp.c frexpl.c fseek.c \
+       fseeko.c stdio-impl.h fseterr.h stdio-impl.h fstat.c ftell.c \
+       ftello.c stdio-impl.h $(top_srcdir)/build-aux/gendocs.sh \
+       getcwd-lgpl.c getdtablesize.c getopt.c getopt.in.h getopt1.c \
+       getopt_int.h gettimeofday.c \
        $(top_srcdir)/build-aux/git-version-gen \
        $(top_srcdir)/build-aux/gitlog-to-changelog \
        $(top_srcdir)/build-aux/gnu-web-doc-update \
        $(top_srcdir)/GNUmakefile $(top_srcdir)/build-aux/gnupload \
-       intprops.h float+.h isnan.c isnand-nolibm.h isnand.c float+.h \
-       isnan.c isnanf-nolibm.h isnanf.c float+.h isnan.c \
-       isnanl-nolibm.h isnanl.c lchown.c \
-       $(top_srcdir)/build-aux/link-warning.h config.charset \
-       ref-add.sin ref-del.sin lseek.c lstat.c $(top_srcdir)/maint.mk \
-       malloc.c malloc.c math.in.h mbrtowc.c mbsinit.c memchr.c \
-       memchr.valgrind mempcpy.c memrchr.c mkdir.c open.c at-func.c \
-       fchmodat.c fchownat.c fstatat.c mkdirat.c openat-priv.h \
-       openat-proc.c openat.c openat.h unlinkat.c perror.c \
-       printf-frexp.h printf-frexp.c printf-frexpl.h printf.c \
-       quotearg.c quotearg.h realloc.c realloc.c rmdir.c same-inode.h \
-       save-cwd.c save-cwd.h float+.h signbitd.c signbitf.c \
-       signbitl.c stat.c stat-time.h stdbool.in.h stddef.in.h \
-       stdint.in.h stdio-write.c stdio.in.h stdlib.in.h strdup.c \
-       streq.h strerror.c string.in.h sys_stat.in.h sys_time.in.h \
-       time.in.h timespec.h unistd.in.h dup-safer.c fd-safer.c \
-       pipe-safer.c unistd--.h unistd-safer.h unlink.c \
+       $(top_srcdir)/build-aux/config.rpath ignore-value.h intprops.h \
+       float+.h isnan.c isnand-nolibm.h isnand.c float+.h isnan.c \
+       isnanf-nolibm.h isnanf.c float+.h isnan.c isnanl-nolibm.h \
+       isnanl.c config.charset ref-add.sin ref-del.sin lseek.c \
+       lstat.c $(top_srcdir)/maint.mk malloc.c malloc.c math.in.h \
+       mbrtowc.c mbsinit.c memchr.c memchr.valgrind mempcpy.c \
+       memrchr.c msvc-inval.c msvc-inval.h msvc-nothrow.c \
+       msvc-nothrow.h open.c openat-priv.h openat.c openat.h \
+       dirent-private.h opendir.c pathmax.h perror.c printf-frexp.h \
+       printf-frexp.c printf-frexpl.h printf.c quote.h quotearg.h \
+       dirent-private.h readdir.c $(top_srcdir)/README-release \
+       realloc.c realloc.c save-cwd.h savedir.h float+.h signbitd.c \
+       signbitf.c signbitl.c \
+       $(top_srcdir)/build-aux/snippet/_Noreturn.h \
+       $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+       $(top_srcdir)/build-aux/snippet/c++defs.h \
+       $(top_srcdir)/build-aux/snippet/unused-parameter.h \
+       $(top_srcdir)/build-aux/snippet/warn-on-use.h stat.c \
+       stat-time.h stdbool.in.h stddef.in.h stdint.in.h stdio.in.h \
+       stdlib.in.h strdup.c streq.h strerror.c strerror-override.c \
+       strerror-override.h strerror_r.c string.in.h sys_stat.in.h \
+       sys_time.in.h sys_types.in.h \
+       $(top_srcdir)/build-aux/config.rpath time.in.h timespec.h \
+       unistd.in.h unistd--.h unistd-safer.h \
        $(top_srcdir)/build-aux/update-copyright \
-       $(top_srcdir)/build-aux/useless-if-before-free utimens.c \
-       utimens.h asnprintf.c float+.h printf-args.c printf-args.h \
+       $(top_srcdir)/build-aux/useless-if-before-free utimens.h \
+       asnprintf.c float+.h printf-args.c printf-args.h \
        printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h \
-       $(top_srcdir)/build-aux/vc-list-files vfprintf.c \
-       $(top_srcdir)/build-aux/warn-on-use.h wchar.in.h wctype.in.h \
-       xalloc.h xmalloc.c xgetcwd.c xgetcwd.h yesno.c yesno.h
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-BUILT_SOURCES = $(ALLOCA_H) arg-nonnull.h configmake.h dirent.h \
-       $(ERRNO_H) fcntl.h $(FLOAT_H) $(GETOPT_H) link-warning.h \
-       math.h $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h stdlib.h \
-       string.h sys/stat.h $(SYS_TIME_H) time.h unistd.h \
-       warn-on-use.h wchar.h $(WCTYPE_H)
-SUFFIXES = .sed .sin
-MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arg-nonnull.h \
-       arg-nonnull.h-t dirent.h dirent.h-t errno.h errno.h-t fcntl.h \
-       fcntl.h-t float.h float.h-t getopt.h getopt.h-t link-warning.h \
-       link-warning.h-t math.h math.h-t stdbool.h stdbool.h-t \
-       stddef.h stddef.h-t stdint.h stdint.h-t stdio.h stdio.h-t \
-       stdlib.h stdlib.h-t string.h string.h-t sys/stat.h \
-       sys/stat.h-t sys/time.h sys/time.h-t time.h time.h-t unistd.h \
-       unistd.h-t warn-on-use.h warn-on-use.h-t wchar.h wchar.h-t \
-       wctype.h wctype.h-t _match.S _match.i match_.s
+       $(top_srcdir)/build-aux/vc-list-files verify.h vfprintf.c \
+       wchar.in.h wctype.in.h xalloc.h xalloc-oversized.h yesno.h
 MOSTLYCLEANDIRS = sys
-CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \
-       ref-del.sed
-DISTCLEANFILES = 
-MAINTAINERCLEANFILES = 
-AM_CPPFLAGS = 
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-libgzip_a_SOURCES = close-hook.c freadahead.c freading.c fseterr.c \
-       gettext.h ignore-value.h localcharset.h localcharset.c \
-       openat-die.c printf-frexp.c printf-frexpl.c size_max.h \
-       verify.h xalloc-die.c xsize.h
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \
+       dirent.h-t errno.h errno.h-t fcntl.h fcntl.h-t float.h \
+       float.h-t getopt.h getopt.h-t math.h math.h-t arg-nonnull.h \
+       arg-nonnull.h-t c++defs.h c++defs.h-t unused-parameter.h \
+       unused-parameter.h-t warn-on-use.h warn-on-use.h-t stdbool.h \
+       stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t stdio.h \
+       stdio.h-t stdlib.h stdlib.h-t string.h string.h-t sys/stat.h \
+       sys/stat.h-t sys/time.h sys/time.h-t sys/types.h sys/types.h-t \
+       time.h time.h-t unistd.h unistd.h-t wchar.h wchar.h-t wctype.h \
+       wctype.h-t _match.S _match.i match_.s
+SUFFIXES = .sed .sin
+noinst_LIBRARIES = libgzip.a
+libgzip_a_SOURCES = c-ctype.h c-ctype.c c-strcase.h c-strcasecmp.c \
+       c-strncasecmp.c cloexec.c close-stream.c closein.c closeout.c \
+       opendir-safer.c dirname-lgpl.c basename-lgpl.c stripslash.c \
+       exitfail.c creat-safer.c open-safer.c fd-hook.c \
+       filenamecat-lgpl.c freadahead.c freading.c fseterr.c gettext.h \
+       gettime.c localcharset.h localcharset.c glthread/lock.h \
+       glthread/lock.c openat-die.c printf-frexp.c printf-frexpl.c \
+       quotearg.c save-cwd.c savedir.c size_max.h \
+       glthread/threadlib.c dup-safer.c fd-safer.c pipe-safer.c \
+       utimens.c xmalloc.c xalloc-die.c xsize.h yesno.c
 libgzip_a_LIBADD = $(gl_LIBOBJS) $(LIBOBJS)
 libgzip_a_DEPENDENCIES = $(gl_LIBOBJS) $(LIBOBJS)
-EXTRA_libgzip_a_SOURCES = calloc.c calloc.c chdir-long.c chown.c \
-       fchown-stub.c close.c close-stream.c closein.c closeout.c \
-       dirfd.c basename-lgpl.c dirname-lgpl.c stripslash.c dup2.c \
-       error.c exitfail.c fchdir.c fclose.c fcntl.c creat-safer.c \
-       open-safer.c fdopendir.c openat-proc.c fflush.c fpending.c \
-       fprintf.c fpurge.c frexp.c frexp.c frexpl.c fseeko.c ftello.c \
-       getcwd.c getopt.c getopt1.c gettime.c gettimeofday.c isnan.c \
-       isnand.c isnan.c isnanf.c isnan.c isnanl.c lchown.c lseek.c \
-       lstat.c malloc.c malloc.c mbrtowc.c mbsinit.c memchr.c \
-       mempcpy.c memrchr.c mkdir.c open.c at-func.c fchmodat.c \
-       fchownat.c fstatat.c mkdirat.c openat-proc.c openat.c \
-       unlinkat.c perror.c printf-frexp.c printf.c quotearg.c \
-       realloc.c realloc.c rmdir.c save-cwd.c signbitd.c signbitf.c \
-       signbitl.c stat.c stdio-write.c strdup.c strerror.c \
-       dup-safer.c fd-safer.c pipe-safer.c unlink.c utimens.c \
-       asnprintf.c printf-args.c printf-parse.c vasnprintf.c \
-       vfprintf.c xmalloc.c xgetcwd.c yesno.c
-ARG_NONNULL_H = arg-nonnull.h
-LINK_WARNING_H = link-warning.h
+EXTRA_libgzip_a_SOURCES = openat-proc.c calloc.c calloc.c chdir-long.c \
+       close.c closedir.c dirfd.c dup.c dup2.c error.c fchdir.c \
+       fclose.c fcntl.c fdopendir.c fflush.c float.c itold.c \
+       fpending.c fprintf.c fpurge.c frexp.c frexp.c frexpl.c fseek.c \
+       fseeko.c fstat.c ftell.c ftello.c getcwd-lgpl.c \
+       getdtablesize.c getopt.c getopt1.c gettimeofday.c isnan.c \
+       isnand.c isnan.c isnanf.c isnan.c isnanl.c lseek.c lstat.c \
+       malloc.c malloc.c mbrtowc.c mbsinit.c memchr.c mempcpy.c \
+       memrchr.c msvc-inval.c msvc-nothrow.c open.c openat.c \
+       opendir.c perror.c printf-frexp.c printf.c readdir.c realloc.c \
+       realloc.c signbitd.c signbitf.c signbitl.c stat.c strdup.c \
+       strerror.c strerror-override.c strerror_r.c asnprintf.c \
+       printf-args.c printf-parse.c vasnprintf.c vfprintf.c
 charset_alias = $(DESTDIR)$(libdir)/charset.alias
 charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all Makefile.am that
+# need it. This is ensured by the applicability 'all' defined above.
+_NORETURN_H = $(top_srcdir)/build-aux/snippet/_Noreturn.h
+ARG_NONNULL_H = arg-nonnull.h
+CXXDEFS_H = c++defs.h
+UNUSED_PARAMETER_H = unused-parameter.h
 WARN_ON_USE_H = warn-on-use.h
 all: $(BUILT_SOURCES) config.h
-       $(MAKE) $(AM_MAKEFLAGS) all-recursive
+       $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
 .SUFFIXES: .sed .sin .c .o .obj
@@ -1005,9 +1423,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/gnulib.mk $(am__configur
              exit 1;; \
          esac; \
        done; \
-       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile'; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \
        $(am__cd) $(top_srcdir) && \
-         $(AUTOMAKE) --gnits lib/Makefile
+         $(AUTOMAKE) --gnu lib/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
@@ -1017,6 +1435,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
            echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
        esac;
+$(srcdir)/gnulib.mk:
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -1028,10 +1447,8 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-       @if test ! -f $@; then \
-         rm -f stamp-h1; \
-         $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
-       else :; fi
+       @if test ! -f $@; then rm -f stamp-h1; else :; fi
+       @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
 
 stamp-h1: $(srcdir)/config.hin $(top_builddir)/config.status
        @rm -f stamp-h1
@@ -1046,20 +1463,11 @@ distclean-hdr:
 
 clean-noinstLIBRARIES:
        -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libgzip.a: $(libgzip_a_OBJECTS) $(libgzip_a_DEPENDENCIES) 
+libgzip.a: $(libgzip_a_OBJECTS) $(libgzip_a_DEPENDENCIES) $(EXTRA_libgzip_a_DEPENDENCIES) 
        $(AM_V_at)-rm -f libgzip.a
        $(AM_V_AR)$(libgzip_a_AR) libgzip.a $(libgzip_a_OBJECTS) $(libgzip_a_LIBADD)
        $(AM_V_at)$(RANLIB) libgzip.a
 
-clean-noinstLTLIBRARIES:
-       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
-         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" != "$$p" || dir=.; \
-         echo "rm -f \"$${dir}/so_locations\""; \
-         rm -f "$${dir}/so_locations"; \
-       done
-
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
 
@@ -1068,32 +1476,35 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/match.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/at-func.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename-lgpl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-ctype.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strcasecmp.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strncasecmp.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calloc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chdir-long.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close-hook.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cloexec.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close-stream.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closedir.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closein.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closeout.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat-safer.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirfd.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname-lgpl.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup-safer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exitfail.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown-stub.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fclose.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-hook.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-safer.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdopendir.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fflush.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat-lgpl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/float.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpending.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fprintf.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpurge.Po@am__quote@
@@ -1101,11 +1512,14 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freading.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frexp.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frexpl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fseek.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fseeko.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fseterr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftell.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftello.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd-lgpl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdtablesize.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettime.Po@am__quote@
@@ -1114,8 +1528,9 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnand.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnanf.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnanl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/itold.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lock.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@
@@ -1124,13 +1539,15 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mempcpy.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memrchr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdirat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-inval.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-nothrow.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open-safer.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-die.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-proc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendir-safer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendir.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perror.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe-safer.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Po@am__quote@
@@ -1139,119 +1556,71 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotearg.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/realloc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/save-cwd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/savedir.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitd.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitf.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitl.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio-write.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror-override.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror_r.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlinkat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadlib.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimens.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfprintf.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xgetcwd.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yesno.Po@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@am__fastdepCC_FALSE@  $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-# 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.
-$(RECURSIVE_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
-       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; \
-         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-         || eval $$failcom; \
-       done; \
-       if test "$$dot_seen" = "no"; then \
-         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-       fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-       @fail= failcom='exit 1'; \
-       for f in x $$MAKEFLAGS; do \
-         case $$f in \
-           *=* | --[!k]*);; \
-           *k*) failcom='fail=yes';; \
-         esac; \
-       done; \
-       dot_seen=no; \
-       case "$@" in \
-         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-         *) list='$(SUBDIRS)' ;; \
-       esac; \
-       rev=''; for subdir in $$list; do \
-         if test "$$subdir" = "."; then :; else \
-           rev="$$subdir $$rev"; \
-         fi; \
-       done; \
-       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; \
-         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-         || eval $$failcom; \
-       done && test -z "$$fail"
-tags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-       done
-ctags-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-       done
-cscopelist-recursive:
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
-       done
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+lock.o: glthread/lock.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lock.o -MD -MP -MF $(DEPDIR)/lock.Tpo -c -o lock.o `test -f 'glthread/lock.c' || echo '$(srcdir)/'`glthread/lock.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/lock.Tpo $(DEPDIR)/lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='glthread/lock.c' object='lock.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lock.o `test -f 'glthread/lock.c' || echo '$(srcdir)/'`glthread/lock.c
+
+lock.obj: glthread/lock.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lock.obj -MD -MP -MF $(DEPDIR)/lock.Tpo -c -o lock.obj `if test -f 'glthread/lock.c'; then $(CYGPATH_W) 'glthread/lock.c'; else $(CYGPATH_W) '$(srcdir)/glthread/lock.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/lock.Tpo $(DEPDIR)/lock.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='glthread/lock.c' object='lock.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lock.obj `if test -f 'glthread/lock.c'; then $(CYGPATH_W) 'glthread/lock.c'; else $(CYGPATH_W) '$(srcdir)/glthread/lock.c'; fi`
+
+threadlib.o: glthread/threadlib.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT threadlib.o -MD -MP -MF $(DEPDIR)/threadlib.Tpo -c -o threadlib.o `test -f 'glthread/threadlib.c' || echo '$(srcdir)/'`glthread/threadlib.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/threadlib.Tpo $(DEPDIR)/threadlib.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='glthread/threadlib.c' object='threadlib.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o threadlib.o `test -f 'glthread/threadlib.c' || echo '$(srcdir)/'`glthread/threadlib.c
+
+threadlib.obj: glthread/threadlib.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT threadlib.obj -MD -MP -MF $(DEPDIR)/threadlib.Tpo -c -o threadlib.obj `if test -f 'glthread/threadlib.c'; then $(CYGPATH_W) 'glthread/threadlib.c'; else $(CYGPATH_W) '$(srcdir)/glthread/threadlib.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/threadlib.Tpo $(DEPDIR)/threadlib.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='glthread/threadlib.c' object='threadlib.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o threadlib.obj `if test -f 'glthread/threadlib.c'; then $(CYGPATH_W) 'glthread/threadlib.c'; else $(CYGPATH_W) '$(srcdir)/glthread/threadlib.c'; fi`
+
+ID: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        unique=`for i in $$list; do \
            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          done | \
@@ -1260,24 +1629,10 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
        mkid -fID $$unique
 tags: TAGS
 
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
+TAGS:  $(TAGS_DEPENDENCIES) $(am__tagged_files)
        set x; \
        here=`pwd`; \
-       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-         include_option=--etags-include; \
-         empty_fix=.; \
-       else \
-         include_option=--include; \
-         empty_fix=; \
-       fi; \
-       list='$(SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
-           test ! -f $$subdir/TAGS || \
-             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-         fi; \
-       done; \
-       list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \
+       list='$(am__tagged_files)'; \
        unique=`for i in $$list; do \
            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          done | \
@@ -1295,9 +1650,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
          fi; \
        fi
 ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.hin $(TAGS_DEPENDENCIES) \
-               $(TAGS_FILES) $(LISP)
-       list='$(SOURCES) $(HEADERS) config.hin $(LISP) $(TAGS_FILES)'; \
+CTAGS:  $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        unique=`for i in $$list; do \
            if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
          done | \
@@ -1312,8 +1666,8 @@ GTAGS:
          && $(am__cd) $(top_srcdir) \
          && gtags -i $(GTAGS_ARGS) "$$here"
 
-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
-       list='$(SOURCES) $(HEADERS) $(LISP)'; \
+cscopelist:  $(am__tagged_files)
+       list='$(am__tagged_files)'; \
        case "$(srcdir)" in \
          [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
          *) sdir=$(subdir)/$(srcdir) ;; \
@@ -1359,56 +1713,31 @@ distdir: $(DISTFILES)
            || exit 1; \
          fi; \
        done
-       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
-           test -d "$(distdir)/$$subdir" \
-           || $(MKDIR_P) "$(distdir)/$$subdir" \
-           || exit 1; \
-         fi; \
-       done
-       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-         if test "$$subdir" = .; then :; else \
-           dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-           $(am__relativize); \
-           new_distdir=$$reldir; \
-           dir1=$$subdir; dir2="$(top_distdir)"; \
-           $(am__relativize); \
-           new_top_distdir=$$reldir; \
-           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-           ($(am__cd) $$subdir && \
-             $(MAKE) $(AM_MAKEFLAGS) \
-               top_distdir="$$new_top_distdir" \
-               distdir="$$new_distdir" \
-               am__remove_distdir=: \
-               am__skip_length_check=: \
-               am__skip_mode_fix=: \
-               distdir) \
-             || exit 1; \
-         fi; \
-       done
 check-am: all-am
 check: $(BUILT_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) check-recursive
-all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) config.h \
-               all-local
-installdirs: installdirs-recursive
-installdirs-am:
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LIBRARIES) config.h all-local
+installdirs:
 install: $(BUILT_SOURCES)
-       $(MAKE) $(AM_MAKEFLAGS) install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
+       $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
 
 install-am: all-am
        @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
-installcheck: installcheck-recursive
+installcheck: installcheck-am
 install-strip:
-       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-         `test -z '$(STRIP)' || \
-           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
 mostlyclean-generic:
        -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
 
@@ -1418,92 +1747,85 @@ clean-generic:
 distclean-generic:
        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
        -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
        -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-clean: clean-recursive
+clean: clean-am
 
-clean-am: clean-generic clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
-       mostlyclean-am
+clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
 
-distclean: distclean-recursive
+distclean: distclean-am
        -rm -rf $(DEPDIR) ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-hdr distclean-local distclean-tags
 
-dvi: dvi-recursive
+dvi: dvi-am
 
 dvi-am:
 
-html: html-recursive
+html: html-am
 
 html-am:
 
-info: info-recursive
+info: info-am
 
 info-am:
 
 install-data-am:
 
-install-dvi: install-dvi-recursive
+install-dvi: install-dvi-am
 
 install-dvi-am:
 
 install-exec-am: install-exec-local
 
-install-html: install-html-recursive
+install-html: install-html-am
 
 install-html-am:
 
-install-info: install-info-recursive
+install-info: install-info-am
 
 install-info-am:
 
 install-man:
 
-install-pdf: install-pdf-recursive
+install-pdf: install-pdf-am
 
 install-pdf-am:
 
-install-ps: install-ps-recursive
+install-ps: install-ps-am
 
 install-ps-am:
 
 installcheck-am:
 
-maintainer-clean: maintainer-clean-recursive
+maintainer-clean: maintainer-clean-am
        -rm -rf $(DEPDIR) ./$(DEPDIR)
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
-mostlyclean: mostlyclean-recursive
+mostlyclean: mostlyclean-am
 
 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
        mostlyclean-local
 
-pdf: pdf-recursive
+pdf: pdf-am
 
 pdf-am:
 
-ps: ps-recursive
+ps: ps-am
 
 ps-am:
 
 uninstall-am: uninstall-local
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
-       cscopelist-recursive ctags-recursive install install-am \
-       install-strip tags-recursive
+.MAKE: all check install install-am install-strip
 
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-       all all-am all-local check check-am clean clean-generic \
-       clean-noinstLIBRARIES clean-noinstLTLIBRARIES cscopelist \
-       cscopelist-recursive ctags ctags-recursive distclean \
+.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \
+       clean-generic clean-noinstLIBRARIES cscopelist ctags distclean \
        distclean-compile distclean-generic distclean-hdr \
        distclean-local distclean-tags distdir dvi dvi-am html html-am \
        info info-am install install-am install-data install-data-am \
@@ -1511,44 +1833,25 @@ uninstall-am: uninstall-local
        install-exec-local install-html install-html-am install-info \
        install-info-am install-man install-pdf install-pdf-am \
        install-ps install-ps-am install-strip installcheck \
-       installcheck-am installdirs installdirs-am maintainer-clean \
+       installcheck-am installdirs maintainer-clean \
        maintainer-clean-generic mostlyclean mostlyclean-compile \
        mostlyclean-generic mostlyclean-local pdf pdf-am ps ps-am tags \
-       tags-recursive uninstall uninstall-am uninstall-local
+       uninstall uninstall-am uninstall-local
 
 
 # We need the following in order to create <alloca.h> when the system
 # doesn't have one that works with the given compiler.
-alloca.h: alloca.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         cat $(srcdir)/alloca.in.h; \
-       } > $@-t && \
-       mv -f $@-t $@
-# The arg-nonnull.h that gets inserted into generated .h files is the same as
-# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
-arg-nonnull.h: $(top_srcdir)/build-aux/arg-nonnull.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/build-aux/arg-nonnull.h \
-         > $@-t && \
-       mv $@-t $@
-
-# Retrieve values of the variables through 'configure' followed by
-# 'make', not directly through 'configure', so that a user who
-# sets some of these variables consistently on the 'make' command
-# line gets correct results.
-#
-# One advantage of this approach, compared to the classical
-# approach of adding -DLIBDIR=\"$(libdir)\" etc. to AM_CPPFLAGS,
-# is that it protects against the use of undefined variables.
-# If, say, $(libdir) is not set in the Makefile, LIBDIR is not
-# defined by this module, and code using LIBDIR gives a
-# compilation error.
-#
-# Another advantage is that 'make' output is shorter.
-#
-# Listed in the same order as the GNU makefile conventions.
+@GL_GENERATE_ALLOCA_H_TRUE@alloca.h: alloca.in.h $(top_builddir)/config.status
+@GL_GENERATE_ALLOCA_H_TRUE@    $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_ALLOCA_H_TRUE@    { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_ALLOCA_H_TRUE@      cat $(srcdir)/alloca.in.h; \
+@GL_GENERATE_ALLOCA_H_TRUE@    } > $@-t && \
+@GL_GENERATE_ALLOCA_H_TRUE@    mv -f $@-t $@
+@GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status
+@GL_GENERATE_ALLOCA_H_FALSE@   rm -f $@
+
+# Listed in the same order as the GNU makefile conventions, and
+# provided by autoconf 2.59c+.
 # The Automake-defined pkg* macros are appended, in the order
 # listed in the Automake 1.10a+ documentation.
 configmake.h: Makefile
@@ -1582,97 +1885,122 @@ configmake.h: Makefile
          echo '#define PKGLIBDIR "$(pkglibdir)"'; \
          echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
        } | sed '/""/d' > $@-t && \
-       if test -f $@ && cmp $@-t $@ > /dev/null; then \
-         rm -f $@-t; \
-       else \
-         rm -f $@; mv $@-t $@; \
-       fi
+       mv -f $@-t $@
 
 # We need the following in order to create <dirent.h> when the system
 # doesn't have one that works with the given compiler.
-dirent.h: dirent.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
-             -e 's|@''GNULIB_DIRFD''@|$(GNULIB_DIRFD)|g' \
-             -e 's|@''GNULIB_FDOPENDIR''@|$(GNULIB_FDOPENDIR)|g' \
-             -e 's|@''GNULIB_SCANDIR''@|$(GNULIB_SCANDIR)|g' \
-             -e 's|@''GNULIB_ALPHASORT''@|$(GNULIB_ALPHASORT)|g' \
+             -e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \
+             -e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \
+             -e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \
+             -e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \
+             -e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \
+             -e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \
+             -e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \
+             -e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \
+             -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
+             -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
+             -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
+             -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
              -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
+             -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
              -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
              -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
              -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
+             -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
              -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
+             -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
              -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
-             -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/dirent.in.h; \
        } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <errno.h> when the system
 # doesn't have one that is POSIX compliant.
-errno.h: errno.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
-             -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
-             -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
-             -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
-             -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
-             -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
-             -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
-             < $(srcdir)/errno.in.h; \
-       } > $@-t && \
-       mv $@-t $@
+@GL_GENERATE_ERRNO_H_TRUE@errno.h: errno.in.h $(top_builddir)/config.status
+@GL_GENERATE_ERRNO_H_TRUE@     $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_ERRNO_H_TRUE@     { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_ERRNO_H_TRUE@       sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
+@GL_GENERATE_ERRNO_H_TRUE@           < $(srcdir)/errno.in.h; \
+@GL_GENERATE_ERRNO_H_TRUE@     } > $@-t && \
+@GL_GENERATE_ERRNO_H_TRUE@     mv $@-t $@
+@GL_GENERATE_ERRNO_H_FALSE@errno.h: $(top_builddir)/config.status
+@GL_GENERATE_ERRNO_H_FALSE@    rm -f $@
 
 # We need the following in order to create <fcntl.h> when the system
 # doesn't have one that works with the given compiler.
-fcntl.h: fcntl.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
-             -e 's|@''GNULIB_FCNTL''@|$(GNULIB_FCNTL)|g' \
-             -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \
-             -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \
+             -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
+             -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
+             -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
              -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
              -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
              -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
              -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
              -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/fcntl.in.h; \
        } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <float.h> when the system
 # doesn't have one that works with the given compiler.
-float.h: float.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
-             < $(srcdir)/float.in.h; \
-       } > $@-t && \
-       mv $@-t $@
+@GL_GENERATE_FLOAT_H_TRUE@float.h: float.in.h $(top_builddir)/config.status
+@GL_GENERATE_FLOAT_H_TRUE@     $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_FLOAT_H_TRUE@     { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_FLOAT_H_TRUE@       sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
+@GL_GENERATE_FLOAT_H_TRUE@           < $(srcdir)/float.in.h; \
+@GL_GENERATE_FLOAT_H_TRUE@     } > $@-t && \
+@GL_GENERATE_FLOAT_H_TRUE@     mv $@-t $@
+@GL_GENERATE_FLOAT_H_FALSE@float.h: $(top_builddir)/config.status
+@GL_GENERATE_FLOAT_H_FALSE@    rm -f $@
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
-getopt.h: getopt.in.h $(ARG_NONNULL_H)
+getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              < $(srcdir)/getopt.in.h; \
@@ -1682,14 +2010,6 @@ getopt.h: getopt.in.h $(ARG_NONNULL_H)
 distclean-local: clean-GNUmakefile
 clean-GNUmakefile:
        test x'$(VPATH)' != x && rm -f $(top_builddir)/GNUmakefile || :
-# The link-warning.h that gets inserted into generated .h files is the same as
-# build-aux/link-warning.h, except that it has the copyright header cut off.
-link-warning.h: $(top_srcdir)/build-aux/link-warning.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_LINK_WARNING/,$$p' \
-         < $(top_srcdir)/build-aux/link-warning.h \
-         > $@-t && \
-       mv $@-t $@
 
 # We need the following in order to install a simple file in $(libdir)
 # which is shared with other installed packages. We use a list of referencing
@@ -1752,208 +2072,463 @@ charset.alias: config.charset
 
 # We need the following in order to create <math.h> when the system
 # doesn't have one that works with the given compiler.
-math.h: math.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \
-             -e 's|@''GNULIB_ACOSL''@|$(GNULIB_ACOSL)|g' \
-             -e 's|@''GNULIB_ASINL''@|$(GNULIB_ASINL)|g' \
-             -e 's|@''GNULIB_ATANL''@|$(GNULIB_ATANL)|g' \
-             -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \
-             -e 's|@''GNULIB_CEILL''@|$(GNULIB_CEILL)|g' \
-             -e 's|@''GNULIB_COSL''@|$(GNULIB_COSL)|g' \
-             -e 's|@''GNULIB_EXPL''@|$(GNULIB_EXPL)|g' \
-             -e 's|@''GNULIB_FLOORF''@|$(GNULIB_FLOORF)|g' \
-             -e 's|@''GNULIB_FLOORL''@|$(GNULIB_FLOORL)|g' \
-             -e 's|@''GNULIB_FREXP''@|$(GNULIB_FREXP)|g' \
-             -e 's|@''GNULIB_FREXPL''@|$(GNULIB_FREXPL)|g' \
-             -e 's|@''GNULIB_ISFINITE''@|$(GNULIB_ISFINITE)|g' \
-             -e 's|@''GNULIB_ISINF''@|$(GNULIB_ISINF)|g' \
-             -e 's|@''GNULIB_ISNAN''@|$(GNULIB_ISNAN)|g' \
-             -e 's|@''GNULIB_ISNANF''@|$(GNULIB_ISNANF)|g' \
-             -e 's|@''GNULIB_ISNAND''@|$(GNULIB_ISNAND)|g' \
-             -e 's|@''GNULIB_ISNANL''@|$(GNULIB_ISNANL)|g' \
-             -e 's|@''GNULIB_LDEXPL''@|$(GNULIB_LDEXPL)|g' \
-             -e 's|@''GNULIB_LOGL''@|$(GNULIB_LOGL)|g' \
-             -e 's|@''GNULIB_ROUND''@|$(GNULIB_ROUND)|g' \
-             -e 's|@''GNULIB_ROUNDF''@|$(GNULIB_ROUNDF)|g' \
-             -e 's|@''GNULIB_ROUNDL''@|$(GNULIB_ROUNDL)|g' \
-             -e 's|@''GNULIB_SIGNBIT''@|$(GNULIB_SIGNBIT)|g' \
-             -e 's|@''GNULIB_SINL''@|$(GNULIB_SINL)|g' \
-             -e 's|@''GNULIB_SQRTL''@|$(GNULIB_SQRTL)|g' \
-             -e 's|@''GNULIB_TANL''@|$(GNULIB_TANL)|g' \
-             -e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \
-             -e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \
-             -e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|g' \
+             -e 's/@''GNULIB_ACOSF''@/$(GNULIB_ACOSF)/g' \
+             -e 's/@''GNULIB_ACOSL''@/$(GNULIB_ACOSL)/g' \
+             -e 's/@''GNULIB_ASINF''@/$(GNULIB_ASINF)/g' \
+             -e 's/@''GNULIB_ASINL''@/$(GNULIB_ASINL)/g' \
+             -e 's/@''GNULIB_ATANF''@/$(GNULIB_ATANF)/g' \
+             -e 's/@''GNULIB_ATANL''@/$(GNULIB_ATANL)/g' \
+             -e 's/@''GNULIB_ATAN2F''@/$(GNULIB_ATAN2F)/g' \
+             -e 's/@''GNULIB_CBRT''@/$(GNULIB_CBRT)/g' \
+             -e 's/@''GNULIB_CBRTF''@/$(GNULIB_CBRTF)/g' \
+             -e 's/@''GNULIB_CBRTL''@/$(GNULIB_CBRTL)/g' \
+             -e 's/@''GNULIB_CEIL''@/$(GNULIB_CEIL)/g' \
+             -e 's/@''GNULIB_CEILF''@/$(GNULIB_CEILF)/g' \
+             -e 's/@''GNULIB_CEILL''@/$(GNULIB_CEILL)/g' \
+             -e 's/@''GNULIB_COPYSIGN''@/$(GNULIB_COPYSIGN)/g' \
+             -e 's/@''GNULIB_COPYSIGNF''@/$(GNULIB_COPYSIGNF)/g' \
+             -e 's/@''GNULIB_COPYSIGNL''@/$(GNULIB_COPYSIGNL)/g' \
+             -e 's/@''GNULIB_COSF''@/$(GNULIB_COSF)/g' \
+             -e 's/@''GNULIB_COSL''@/$(GNULIB_COSL)/g' \
+             -e 's/@''GNULIB_COSHF''@/$(GNULIB_COSHF)/g' \
+             -e 's/@''GNULIB_EXPF''@/$(GNULIB_EXPF)/g' \
+             -e 's/@''GNULIB_EXPL''@/$(GNULIB_EXPL)/g' \
+             -e 's/@''GNULIB_EXP2''@/$(GNULIB_EXP2)/g' \
+             -e 's/@''GNULIB_EXP2F''@/$(GNULIB_EXP2F)/g' \
+             -e 's/@''GNULIB_EXP2L''@/$(GNULIB_EXP2L)/g' \
+             -e 's/@''GNULIB_EXPM1''@/$(GNULIB_EXPM1)/g' \
+             -e 's/@''GNULIB_EXPM1F''@/$(GNULIB_EXPM1F)/g' \
+             -e 's/@''GNULIB_EXPM1L''@/$(GNULIB_EXPM1L)/g' \
+             -e 's/@''GNULIB_FABSF''@/$(GNULIB_FABSF)/g' \
+             -e 's/@''GNULIB_FABSL''@/$(GNULIB_FABSL)/g' \
+             -e 's/@''GNULIB_FLOOR''@/$(GNULIB_FLOOR)/g' \
+             -e 's/@''GNULIB_FLOORF''@/$(GNULIB_FLOORF)/g' \
+             -e 's/@''GNULIB_FLOORL''@/$(GNULIB_FLOORL)/g' \
+             -e 's/@''GNULIB_FMA''@/$(GNULIB_FMA)/g' \
+             -e 's/@''GNULIB_FMAF''@/$(GNULIB_FMAF)/g' \
+             -e 's/@''GNULIB_FMAL''@/$(GNULIB_FMAL)/g' \
+             -e 's/@''GNULIB_FMOD''@/$(GNULIB_FMOD)/g' \
+             -e 's/@''GNULIB_FMODF''@/$(GNULIB_FMODF)/g' \
+             -e 's/@''GNULIB_FMODL''@/$(GNULIB_FMODL)/g' \
+             -e 's/@''GNULIB_FREXPF''@/$(GNULIB_FREXPF)/g' \
+             -e 's/@''GNULIB_FREXP''@/$(GNULIB_FREXP)/g' \
+             -e 's/@''GNULIB_FREXPL''@/$(GNULIB_FREXPL)/g' \
+             -e 's/@''GNULIB_HYPOT''@/$(GNULIB_HYPOT)/g' \
+             -e 's/@''GNULIB_HYPOTF''@/$(GNULIB_HYPOTF)/g' \
+             -e 's/@''GNULIB_HYPOTL''@/$(GNULIB_HYPOTL)/g' \
+             < $(srcdir)/math.in.h | \
+         sed -e 's/@''GNULIB_ILOGB''@/$(GNULIB_ILOGB)/g' \
+             -e 's/@''GNULIB_ILOGBF''@/$(GNULIB_ILOGBF)/g' \
+             -e 's/@''GNULIB_ILOGBL''@/$(GNULIB_ILOGBL)/g' \
+             -e 's/@''GNULIB_ISFINITE''@/$(GNULIB_ISFINITE)/g' \
+             -e 's/@''GNULIB_ISINF''@/$(GNULIB_ISINF)/g' \
+             -e 's/@''GNULIB_ISNAN''@/$(GNULIB_ISNAN)/g' \
+             -e 's/@''GNULIB_ISNANF''@/$(GNULIB_ISNANF)/g' \
+             -e 's/@''GNULIB_ISNAND''@/$(GNULIB_ISNAND)/g' \
+             -e 's/@''GNULIB_ISNANL''@/$(GNULIB_ISNANL)/g' \
+             -e 's/@''GNULIB_LDEXPF''@/$(GNULIB_LDEXPF)/g' \
+             -e 's/@''GNULIB_LDEXPL''@/$(GNULIB_LDEXPL)/g' \
+             -e 's/@''GNULIB_LOG''@/$(GNULIB_LOG)/g' \
+             -e 's/@''GNULIB_LOGF''@/$(GNULIB_LOGF)/g' \
+             -e 's/@''GNULIB_LOGL''@/$(GNULIB_LOGL)/g' \
+             -e 's/@''GNULIB_LOG10''@/$(GNULIB_LOG10)/g' \
+             -e 's/@''GNULIB_LOG10F''@/$(GNULIB_LOG10F)/g' \
+             -e 's/@''GNULIB_LOG10L''@/$(GNULIB_LOG10L)/g' \
+             -e 's/@''GNULIB_LOG1P''@/$(GNULIB_LOG1P)/g' \
+             -e 's/@''GNULIB_LOG1PF''@/$(GNULIB_LOG1PF)/g' \
+             -e 's/@''GNULIB_LOG1PL''@/$(GNULIB_LOG1PL)/g' \
+             -e 's/@''GNULIB_LOG2''@/$(GNULIB_LOG2)/g' \
+             -e 's/@''GNULIB_LOG2F''@/$(GNULIB_LOG2F)/g' \
+             -e 's/@''GNULIB_LOG2L''@/$(GNULIB_LOG2L)/g' \
+             -e 's/@''GNULIB_LOGB''@/$(GNULIB_LOGB)/g' \
+             -e 's/@''GNULIB_LOGBF''@/$(GNULIB_LOGBF)/g' \
+             -e 's/@''GNULIB_LOGBL''@/$(GNULIB_LOGBL)/g' \
+             -e 's/@''GNULIB_MODF''@/$(GNULIB_MODF)/g' \
+             -e 's/@''GNULIB_MODFF''@/$(GNULIB_MODFF)/g' \
+             -e 's/@''GNULIB_MODFL''@/$(GNULIB_MODFL)/g' \
+             -e 's/@''GNULIB_POWF''@/$(GNULIB_POWF)/g' \
+             -e 's/@''GNULIB_REMAINDER''@/$(GNULIB_REMAINDER)/g' \
+             -e 's/@''GNULIB_REMAINDERF''@/$(GNULIB_REMAINDERF)/g' \
+             -e 's/@''GNULIB_REMAINDERL''@/$(GNULIB_REMAINDERL)/g' \
+             -e 's/@''GNULIB_RINT''@/$(GNULIB_RINT)/g' \
+             -e 's/@''GNULIB_RINTF''@/$(GNULIB_RINTF)/g' \
+             -e 's/@''GNULIB_RINTL''@/$(GNULIB_RINTL)/g' \
+             -e 's/@''GNULIB_ROUND''@/$(GNULIB_ROUND)/g' \
+             -e 's/@''GNULIB_ROUNDF''@/$(GNULIB_ROUNDF)/g' \
+             -e 's/@''GNULIB_ROUNDL''@/$(GNULIB_ROUNDL)/g' \
+             -e 's/@''GNULIB_SIGNBIT''@/$(GNULIB_SIGNBIT)/g' \
+             -e 's/@''GNULIB_SINF''@/$(GNULIB_SINF)/g' \
+             -e 's/@''GNULIB_SINL''@/$(GNULIB_SINL)/g' \
+             -e 's/@''GNULIB_SINHF''@/$(GNULIB_SINHF)/g' \
+             -e 's/@''GNULIB_SQRTF''@/$(GNULIB_SQRTF)/g' \
+             -e 's/@''GNULIB_SQRTL''@/$(GNULIB_SQRTL)/g' \
+             -e 's/@''GNULIB_TANF''@/$(GNULIB_TANF)/g' \
+             -e 's/@''GNULIB_TANL''@/$(GNULIB_TANL)/g' \
+             -e 's/@''GNULIB_TANHF''@/$(GNULIB_TANHF)/g' \
+             -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \
+             -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \
+             -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \
+         | \
+         sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \
              -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
+             -e 's|@''HAVE_ASINF''@|$(HAVE_ASINF)|g' \
              -e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \
+             -e 's|@''HAVE_ATANF''@|$(HAVE_ATANF)|g' \
              -e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \
+             -e 's|@''HAVE_ATAN2F''@|$(HAVE_ATAN2F)|g' \
+             -e 's|@''HAVE_CBRT''@|$(HAVE_CBRT)|g' \
+             -e 's|@''HAVE_CBRTF''@|$(HAVE_CBRTF)|g' \
+             -e 's|@''HAVE_CBRTL''@|$(HAVE_CBRTL)|g' \
+             -e 's|@''HAVE_COPYSIGN''@|$(HAVE_COPYSIGN)|g' \
+             -e 's|@''HAVE_COPYSIGNL''@|$(HAVE_COPYSIGNL)|g' \
+             -e 's|@''HAVE_COSF''@|$(HAVE_COSF)|g' \
              -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \
+             -e 's|@''HAVE_COSHF''@|$(HAVE_COSHF)|g' \
+             -e 's|@''HAVE_EXPF''@|$(HAVE_EXPF)|g' \
              -e 's|@''HAVE_EXPL''@|$(HAVE_EXPL)|g' \
+             -e 's|@''HAVE_EXPM1''@|$(HAVE_EXPM1)|g' \
+             -e 's|@''HAVE_EXPM1F''@|$(HAVE_EXPM1F)|g' \
+             -e 's|@''HAVE_FABSF''@|$(HAVE_FABSF)|g' \
+             -e 's|@''HAVE_FABSL''@|$(HAVE_FABSL)|g' \
+             -e 's|@''HAVE_FMA''@|$(HAVE_FMA)|g' \
+             -e 's|@''HAVE_FMAF''@|$(HAVE_FMAF)|g' \
+             -e 's|@''HAVE_FMAL''@|$(HAVE_FMAL)|g' \
+             -e 's|@''HAVE_FMODF''@|$(HAVE_FMODF)|g' \
+             -e 's|@''HAVE_FMODL''@|$(HAVE_FMODL)|g' \
+             -e 's|@''HAVE_FREXPF''@|$(HAVE_FREXPF)|g' \
+             -e 's|@''HAVE_HYPOTF''@|$(HAVE_HYPOTF)|g' \
+             -e 's|@''HAVE_HYPOTL''@|$(HAVE_HYPOTL)|g' \
+             -e 's|@''HAVE_ILOGB''@|$(HAVE_ILOGB)|g' \
+             -e 's|@''HAVE_ILOGBF''@|$(HAVE_ILOGBF)|g' \
+             -e 's|@''HAVE_ILOGBL''@|$(HAVE_ILOGBL)|g' \
              -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \
              -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \
              -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \
+             -e 's|@''HAVE_LDEXPF''@|$(HAVE_LDEXPF)|g' \
+             -e 's|@''HAVE_LOGF''@|$(HAVE_LOGF)|g' \
              -e 's|@''HAVE_LOGL''@|$(HAVE_LOGL)|g' \
+             -e 's|@''HAVE_LOG10F''@|$(HAVE_LOG10F)|g' \
+             -e 's|@''HAVE_LOG10L''@|$(HAVE_LOG10L)|g' \
+             -e 's|@''HAVE_LOG1P''@|$(HAVE_LOG1P)|g' \
+             -e 's|@''HAVE_LOG1PF''@|$(HAVE_LOG1PF)|g' \
+             -e 's|@''HAVE_LOG1PL''@|$(HAVE_LOG1PL)|g' \
+             -e 's|@''HAVE_LOGBF''@|$(HAVE_LOGBF)|g' \
+             -e 's|@''HAVE_LOGBL''@|$(HAVE_LOGBL)|g' \
+             -e 's|@''HAVE_MODFF''@|$(HAVE_MODFF)|g' \
+             -e 's|@''HAVE_MODFL''@|$(HAVE_MODFL)|g' \
+             -e 's|@''HAVE_POWF''@|$(HAVE_POWF)|g' \
+             -e 's|@''HAVE_REMAINDER''@|$(HAVE_REMAINDER)|g' \
+             -e 's|@''HAVE_REMAINDERF''@|$(HAVE_REMAINDERF)|g' \
+             -e 's|@''HAVE_RINT''@|$(HAVE_RINT)|g' \
+             -e 's|@''HAVE_RINTL''@|$(HAVE_RINTL)|g' \
+             -e 's|@''HAVE_SINF''@|$(HAVE_SINF)|g' \
              -e 's|@''HAVE_SINL''@|$(HAVE_SINL)|g' \
+             -e 's|@''HAVE_SINHF''@|$(HAVE_SINHF)|g' \
+             -e 's|@''HAVE_SQRTF''@|$(HAVE_SQRTF)|g' \
              -e 's|@''HAVE_SQRTL''@|$(HAVE_SQRTL)|g' \
+             -e 's|@''HAVE_TANF''@|$(HAVE_TANF)|g' \
              -e 's|@''HAVE_TANL''@|$(HAVE_TANL)|g' \
+             -e 's|@''HAVE_TANHF''@|$(HAVE_TANHF)|g' \
              -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \
              -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \
              -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \
+             -e 's|@''HAVE_DECL_CBRTF''@|$(HAVE_DECL_CBRTF)|g' \
+             -e 's|@''HAVE_DECL_CBRTL''@|$(HAVE_DECL_CBRTL)|g' \
+             -e 's|@''HAVE_DECL_CEILF''@|$(HAVE_DECL_CEILF)|g' \
+             -e 's|@''HAVE_DECL_CEILL''@|$(HAVE_DECL_CEILL)|g' \
+             -e 's|@''HAVE_DECL_COPYSIGNF''@|$(HAVE_DECL_COPYSIGNF)|g' \
              -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \
              -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \
+             -e 's|@''HAVE_DECL_EXP2''@|$(HAVE_DECL_EXP2)|g' \
+             -e 's|@''HAVE_DECL_EXP2F''@|$(HAVE_DECL_EXP2F)|g' \
+             -e 's|@''HAVE_DECL_EXP2L''@|$(HAVE_DECL_EXP2L)|g' \
+             -e 's|@''HAVE_DECL_EXPM1L''@|$(HAVE_DECL_EXPM1L)|g' \
+             -e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \
+             -e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \
              -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \
              -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \
              -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \
+             -e 's|@''HAVE_DECL_LOG10L''@|$(HAVE_DECL_LOG10L)|g' \
+             -e 's|@''HAVE_DECL_LOG2''@|$(HAVE_DECL_LOG2)|g' \
+             -e 's|@''HAVE_DECL_LOG2F''@|$(HAVE_DECL_LOG2F)|g' \
+             -e 's|@''HAVE_DECL_LOG2L''@|$(HAVE_DECL_LOG2L)|g' \
+             -e 's|@''HAVE_DECL_LOGB''@|$(HAVE_DECL_LOGB)|g' \
+             -e 's|@''HAVE_DECL_REMAINDER''@|$(HAVE_DECL_REMAINDER)|g' \
+             -e 's|@''HAVE_DECL_REMAINDERL''@|$(HAVE_DECL_REMAINDERL)|g' \
+             -e 's|@''HAVE_DECL_RINTF''@|$(HAVE_DECL_RINTF)|g' \
+             -e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \
+             -e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \
+             -e 's|@''HAVE_DECL_ROUNDL''@|$(HAVE_DECL_ROUNDL)|g' \
              -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \
              -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \
              -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \
              -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \
              -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \
+             -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \
+         | \
+         sed -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \
+             -e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \
+             -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \
              -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
              -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
+             -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \
+             -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \
+             -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \
+             -e 's|@''REPLACE_EXP2L''@|$(REPLACE_EXP2L)|g' \
+             -e 's|@''REPLACE_FABSL''@|$(REPLACE_FABSL)|g' \
+             -e 's|@''REPLACE_FLOOR''@|$(REPLACE_FLOOR)|g' \
              -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \
              -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \
+             -e 's|@''REPLACE_FMA''@|$(REPLACE_FMA)|g' \
+             -e 's|@''REPLACE_FMAF''@|$(REPLACE_FMAF)|g' \
+             -e 's|@''REPLACE_FMAL''@|$(REPLACE_FMAL)|g' \
+             -e 's|@''REPLACE_FMOD''@|$(REPLACE_FMOD)|g' \
+             -e 's|@''REPLACE_FMODF''@|$(REPLACE_FMODF)|g' \
+             -e 's|@''REPLACE_FMODL''@|$(REPLACE_FMODL)|g' \
+             -e 's|@''REPLACE_FREXPF''@|$(REPLACE_FREXPF)|g' \
              -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \
              -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \
              -e 's|@''REPLACE_HUGE_VAL''@|$(REPLACE_HUGE_VAL)|g' \
+             -e 's|@''REPLACE_HYPOT''@|$(REPLACE_HYPOT)|g' \
+             -e 's|@''REPLACE_HYPOTF''@|$(REPLACE_HYPOTF)|g' \
+             -e 's|@''REPLACE_HYPOTL''@|$(REPLACE_HYPOTL)|g' \
+             -e 's|@''REPLACE_ILOGB''@|$(REPLACE_ILOGB)|g' \
+             -e 's|@''REPLACE_ILOGBF''@|$(REPLACE_ILOGBF)|g' \
              -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \
              -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \
              -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \
+             -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
              -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \
+             -e 's|@''REPLACE_LOG''@|$(REPLACE_LOG)|g' \
+             -e 's|@''REPLACE_LOGF''@|$(REPLACE_LOGF)|g' \
+             -e 's|@''REPLACE_LOGL''@|$(REPLACE_LOGL)|g' \
+             -e 's|@''REPLACE_LOG10''@|$(REPLACE_LOG10)|g' \
+             -e 's|@''REPLACE_LOG10F''@|$(REPLACE_LOG10F)|g' \
+             -e 's|@''REPLACE_LOG10L''@|$(REPLACE_LOG10L)|g' \
+             -e 's|@''REPLACE_LOG1P''@|$(REPLACE_LOG1P)|g' \
+             -e 's|@''REPLACE_LOG1PF''@|$(REPLACE_LOG1PF)|g' \
+             -e 's|@''REPLACE_LOG1PL''@|$(REPLACE_LOG1PL)|g' \
+             -e 's|@''REPLACE_LOG2''@|$(REPLACE_LOG2)|g' \
+             -e 's|@''REPLACE_LOG2F''@|$(REPLACE_LOG2F)|g' \
+             -e 's|@''REPLACE_LOG2L''@|$(REPLACE_LOG2L)|g' \
+             -e 's|@''REPLACE_LOGB''@|$(REPLACE_LOGB)|g' \
+             -e 's|@''REPLACE_LOGBF''@|$(REPLACE_LOGBF)|g' \
+             -e 's|@''REPLACE_LOGBL''@|$(REPLACE_LOGBL)|g' \
+             -e 's|@''REPLACE_MODF''@|$(REPLACE_MODF)|g' \
+             -e 's|@''REPLACE_MODFF''@|$(REPLACE_MODFF)|g' \
+             -e 's|@''REPLACE_MODFL''@|$(REPLACE_MODFL)|g' \
              -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|g' \
+             -e 's|@''REPLACE_REMAINDER''@|$(REPLACE_REMAINDER)|g' \
+             -e 's|@''REPLACE_REMAINDERF''@|$(REPLACE_REMAINDERF)|g' \
+             -e 's|@''REPLACE_REMAINDERL''@|$(REPLACE_REMAINDERL)|g' \
              -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \
              -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \
              -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
              -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
              -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \
+             -e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \
+             -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \
+             -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \
              -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/math.in.h; \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
+# off.
+arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_ARG_NONNULL/,$$p' \
+         < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+         > $@-t && \
+       mv $@-t $@
+# The c++defs.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
+c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/_GL_CXXDEFS/,$$p' \
+         < $(top_srcdir)/build-aux/snippet/c++defs.h \
+         > $@-t && \
+       mv $@-t $@
+# The unused-parameter.h that gets inserted into generated .h files is the same
+# as build-aux/snippet/unused-parameter.h, except that it has the copyright
+# header cut off.
+unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
+         < $(top_srcdir)/build-aux/snippet/unused-parameter.h \
+         > $@-t && \
+       mv $@-t $@
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
+# off.
+warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/^.ifndef/,$$p' \
+         < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
+         > $@-t && \
+       mv $@-t $@
 
 # We need the following in order to create <stdbool.h> when the system
 # doesn't have one that works.
-stdbool.h: stdbool.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
-       } > $@-t && \
-       mv $@-t $@
+@GL_GENERATE_STDBOOL_H_TRUE@stdbool.h: stdbool.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDBOOL_H_TRUE@   $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDBOOL_H_TRUE@   { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_STDBOOL_H_TRUE@     sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
+@GL_GENERATE_STDBOOL_H_TRUE@   } > $@-t && \
+@GL_GENERATE_STDBOOL_H_TRUE@   mv $@-t $@
+@GL_GENERATE_STDBOOL_H_FALSE@stdbool.h: $(top_builddir)/config.status
+@GL_GENERATE_STDBOOL_H_FALSE@  rm -f $@
 
 # We need the following in order to create <stddef.h> when the system
 # doesn't have one that works with the given compiler.
-stddef.h: stddef.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
-             -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
-             -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
-             < $(srcdir)/stddef.in.h; \
-       } > $@-t && \
-       mv $@-t $@
+@GL_GENERATE_STDDEF_H_TRUE@stddef.h: stddef.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDDEF_H_TRUE@    $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDDEF_H_TRUE@    { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_STDDEF_H_TRUE@      sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
+@GL_GENERATE_STDDEF_H_TRUE@          < $(srcdir)/stddef.in.h; \
+@GL_GENERATE_STDDEF_H_TRUE@    } > $@-t && \
+@GL_GENERATE_STDDEF_H_TRUE@    mv $@-t $@
+@GL_GENERATE_STDDEF_H_FALSE@stddef.h: $(top_builddir)/config.status
+@GL_GENERATE_STDDEF_H_FALSE@   rm -f $@
 
 # We need the following in order to create <stdint.h> when the system
 # doesn't have one that works with the given compiler.
-stdint.h: stdint.in.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
-             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
-             -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
-             -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
-             -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
-             -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
-             -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
-             -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
-             -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
-             -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
-             -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
-             -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
-             -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
-             -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
-             -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
-             -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
-             -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
-             -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
-             -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
-             -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
-             -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
-             -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
-             < $(srcdir)/stdint.in.h; \
-       } > $@-t && \
-       mv $@-t $@
+@GL_GENERATE_STDINT_H_TRUE@stdint.h: stdint.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDINT_H_TRUE@    $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDINT_H_TRUE@    { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_STDINT_H_TRUE@      sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          < $(srcdir)/stdint.in.h; \
+@GL_GENERATE_STDINT_H_TRUE@    } > $@-t && \
+@GL_GENERATE_STDINT_H_TRUE@    mv $@-t $@
+@GL_GENERATE_STDINT_H_FALSE@stdint.h: $(top_builddir)/config.status
+@GL_GENERATE_STDINT_H_FALSE@   rm -f $@
 
 # We need the following in order to create <stdio.h> when the system
 # doesn't have one that works with the given compiler.
-stdio.h: stdio.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-             -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
-             -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
-             -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-             -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
-             -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
-             -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
-             -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
-             -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
-             -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
-             -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
-             -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
-             -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
-             -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
-             -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
-             -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
-             -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
-             -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
-             -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
-             -e 's|@''GNULIB_POPEN''@|$(GNULIB_POPEN)|g' \
-             -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
-             -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
-             -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
-             -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
-             -e 's|@''GNULIB_REMOVE''@|$(GNULIB_REMOVE)|g' \
-             -e 's|@''GNULIB_RENAME''@|$(GNULIB_RENAME)|g' \
-             -e 's|@''GNULIB_RENAMEAT''@|$(GNULIB_RENAMEAT)|g' \
-             -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
-             -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
-             -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
-             -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
-             -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
-             -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
-             -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
-             -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
+             -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
+             -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
+             -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
+             -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
+             -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
+             -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
+             -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
+             -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
+             -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
+             -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
+             -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
+             -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
+             -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
+             -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
+             -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
+             -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
+             -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
+             -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
+             -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
+             -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
+             -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
+             -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
+             -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
+             -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
+             -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
+             -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
+             -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
+             -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
+             -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
+             -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
+             -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
+             -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
+             -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
+             -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
+             -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
+             -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
+             -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
+             -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
+             -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
+             -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
+             -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
+             -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
+             -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
+             -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
+             -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
              < $(srcdir)/stdio.in.h | \
          sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+             -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+             -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
              -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
              -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
              -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
              -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
              -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
              -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
+             -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
+             -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
+             -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
+             -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
              -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
              -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
              -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
              -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
              -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+             -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
              -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
              -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
              -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
@@ -1963,6 +2538,7 @@ stdio.h: stdio.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
              -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
              -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
              -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+             -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
              -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
              -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
              -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
@@ -1973,14 +2549,17 @@ stdio.h: stdio.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
              -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
              -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
              -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+             -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
              -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
+             -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
              -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
              -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
              -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
              -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
              -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
              -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
@@ -1988,111 +2567,147 @@ stdio.h: stdio.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
 
 # We need the following in order to create <stdlib.h> when the system
 # doesn't have one that works with the given compiler.
-stdlib.h: stdlib.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
+  $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
-             -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \
-             -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
-             -e 's|@''GNULIB_CANONICALIZE_FILE_NAME''@|$(GNULIB_CANONICALIZE_FILE_NAME)|g' \
-             -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \
-             -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
-             -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
-             -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
-             -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \
-             -e 's|@''GNULIB_MKOSTEMPS''@|$(GNULIB_MKOSTEMPS)|g' \
-             -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
-             -e 's|@''GNULIB_MKSTEMPS''@|$(GNULIB_MKSTEMPS)|g' \
-             -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
-             -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
-             -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
-             -e 's|@''GNULIB_REALPATH''@|$(GNULIB_REALPATH)|g' \
-             -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
-             -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
-             -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
-             -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \
-             -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \
-             -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
+             -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
+             -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
+             -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
+             -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \
+             -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \
+             -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \
+             -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \
+             -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \
+             -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \
+             -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
+             -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
+             -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
+             -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \
+             -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
+             -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
+             -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
+             -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
+             -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
+             -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
+             -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
+             -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
+             -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
+             -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
+             -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
+             -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
+             -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
+             -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
+             -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
+             < $(srcdir)/stdlib.in.h | \
+         sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
-             -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
              -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
              -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
              -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-             -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
+             -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
              -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
              -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
              -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
+             -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
              -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
+             -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
+             -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+             -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
+             -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
              -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
              -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-             -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
              -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
              -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
-             -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
+             -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
              -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
              -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
              -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
              -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
              -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-             -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
+             -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
+             -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+             -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
              -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
+             -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+             -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+             -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
+             -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
              -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
              -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
              -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
              -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _Noreturn/r $(_NORETURN_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             < $(srcdir)/stdlib.in.h; \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <string.h> when the system
 # doesn't have one that works with the given compiler.
-string.h: string.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
-             -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \
-             -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \
-             -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \
-             -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \
-             -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \
-             -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \
-             -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \
-             -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \
-             -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \
-             -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \
-             -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \
-             -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
-             -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
-             -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
-             -e 's|@''GNULIB_MEMCHR''@|$(GNULIB_MEMCHR)|g' \
-             -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
-             -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
-             -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
-             -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \
-             -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
-             -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
-             -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
-             -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
-             -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \
-             -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
-             -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
-             -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
-             -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \
-             -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
-             -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
-             -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
-             -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \
-             -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \
+             -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
+             -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
+             -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
+             -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
+             -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
+             -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
+             -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
+             -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
+             -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
+             -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
+             -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
+             -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
+             -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
+             -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
+             -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
+             -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
+             -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
+             -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
+             -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
+             -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
+             -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
+             -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
+             -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
+             -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
+             -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
+             -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
+             -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
+             -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
+             -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
+             -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
+             -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
+             -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
+             -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
+             -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
+             -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
+             -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
+             -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
              < $(srcdir)/string.in.h | \
-         sed -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+         sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+             -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+             -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+             -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
              -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
              -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
              -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
@@ -2107,45 +2722,56 @@ string.h: string.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
              -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
              -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
-             -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \
+             -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
              -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
              -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+             -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
              -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
              -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
              -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+             -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
              -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
              -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
              -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+             -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
+             -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
              -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+             -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
              -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
              -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
              -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)'; \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+             < $(srcdir)/string.in.h; \
        } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <sys/stat.h> when the system
 # has one that is incomplete.
-sys/stat.h: sys_stat.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_at)$(MKDIR_P) sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
-             -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
-             -e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
-             -e 's|@''GNULIB_FUTIMENS''@|$(GNULIB_FUTIMENS)|g' \
-             -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
-             -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
-             -e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
-             -e 's|@''GNULIB_MKFIFO''@|$(GNULIB_MKFIFO)|g' \
-             -e 's|@''GNULIB_MKFIFOAT''@|$(GNULIB_MKFIFOAT)|g' \
-             -e 's|@''GNULIB_MKNOD''@|$(GNULIB_MKNOD)|g' \
-             -e 's|@''GNULIB_MKNODAT''@|$(GNULIB_MKNODAT)|g' \
-             -e 's|@''GNULIB_STAT''@|$(GNULIB_STAT)|g' \
-             -e 's|@''GNULIB_UTIMENSAT''@|$(GNULIB_UTIMENSAT)|g' \
+             -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
+             -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
+             -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \
+             -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
+             -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \
+             -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \
+             -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \
+             -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \
+             -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \
+             -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \
+             -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \
+             -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \
+             -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
+             -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \
              -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
              -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
              -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
@@ -2166,187 +2792,281 @@ sys/stat.h: sys_stat.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
              -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
              -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
              -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_stat.in.h; \
        } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <sys/time.h> when the system
 # doesn't have one that works with the given compiler.
-sys/time.h: sys_time.in.h $(ARG_NONNULL_H)
+sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_at)$(MKDIR_P) sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
-             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
+             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+             -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
              -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_time.in.h; \
        } > $@-t && \
        mv $@-t $@
 
+# We need the following in order to create <sys/types.h> when the system
+# doesn't have one that works with the given compiler.
+sys/types.h: sys_types.in.h $(top_builddir)/config.status
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
+             -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+             < $(srcdir)/sys_types.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+
 # We need the following in order to create <time.h> when the system
 # doesn't have one that works with the given compiler.
-time.h: time.in.h $(ARG_NONNULL_H)
+time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
-             -e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
-             -e 's|@REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-             -e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-             -e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \
-             -e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
-             -e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-             -e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+             -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
+             -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
+             -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
+             -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
+             -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
+             -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
+             -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
+             -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
+             -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+             -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
+             -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
+             -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
+             -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+             -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/time.in.h; \
        } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
-unistd.h: unistd.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
-             -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
-             -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
-             -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
-             -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \
-             -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
-             -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \
-             -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \
-             -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
-             -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \
-             -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
-             -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
-             -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
-             -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \
-             -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \
-             -e 's|@''GNULIB_GETGROUPS''@|$(GNULIB_GETGROUPS)|g' \
-             -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \
-             -e 's|@''GNULIB_GETLOGIN''@|$(GNULIB_GETLOGIN)|g' \
-             -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
-             -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
-             -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \
-             -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
-             -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
-             -e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \
-             -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
-             -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
-             -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
-             -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
-             -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
-             -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
-             -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
-             -e 's|@''GNULIB_SYMLINK''@|$(GNULIB_SYMLINK)|g' \
-             -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \
-             -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \
-             -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
-             -e 's|@''GNULIB_UNLINK''@|$(GNULIB_UNLINK)|g' \
-             -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \
-             -e 's|@''GNULIB_USLEEP''@|$(GNULIB_USLEEP)|g' \
-             -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
+             -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+             -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \
+             -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
+             -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
+             -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \
+             -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \
+             -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
+             -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \
+             -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \
+             -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \
+             -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \
+             -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \
+             -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \
+             -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \
+             -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \
+             -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
+             -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
+             -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
+             -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
+             -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
+             -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
+             -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
+             -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
+             -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
+             -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
+             -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
+             -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
+             -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
+             -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
+             -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \
+             -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \
+             -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \
+             -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \
+             -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \
+             -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \
+             -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \
+             -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \
+             -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \
+             -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \
+             -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
+             -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
+             -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
+             -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
+             -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \
+             -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
+             -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
+             -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
+             -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
              < $(srcdir)/unistd.in.h | \
          sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
              -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
              -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
              -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
              -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
+             -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
              -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
+             -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \
              -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
              -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
-             -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
              -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
              -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
-             -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \
+             -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
              -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
              -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
              -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
+             -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \
              -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
              -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+             -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
              -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
              -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
+             -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
              -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
              -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
              -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
              -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+             -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
+             -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
+             -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
              -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
+             -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
+             -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
+             -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
+             -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
              -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
              -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
-             -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+         | \
+         sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
              -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
              -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
-             -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
+             -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+             -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
+             -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
              -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
              -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
+             -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
              -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
              -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
              -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
              -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+             -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
+             -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
              -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
              -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
              -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+             -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
              -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
              -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
              -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
              -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
              -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
              -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
-# The warn-on-use.h that gets inserted into generated .h files is the same as
-# build-aux/warn-on-use.h, except that it has the copyright header cut off.
-warn-on-use.h: $(top_srcdir)/build-aux/warn-on-use.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/build-aux/warn-on-use.h \
-         > $@-t && \
-       mv $@-t $@
 
 # We need the following in order to create <wchar.h> when the system
 # version does not work standalone.
-wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
              -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
              -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
-             -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \
-             -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \
-             -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \
-             -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \
-             -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \
-             -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \
-             -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \
-             -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \
-             -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
-             -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
-             -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
-             -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+             -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
+             -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
+             -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \
+             -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \
+             -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \
+             -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \
+             -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \
+             -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \
+             -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \
+             -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \
+             -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \
+             -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \
+             -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \
+             -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \
+             -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \
+             -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \
+             -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \
+             -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \
+             -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \
+             -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \
+             -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \
+             -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \
+             -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \
+             -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \
+             -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \
+             -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \
+             -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \
+             -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \
+             -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \
+             -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \
+             -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \
+             -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \
+             -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \
+             -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \
+             -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \
+             -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \
+             -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \
+             -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \
+             -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \
+             < $(srcdir)/wchar.in.h | \
+         sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
              -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
              -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
              -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
@@ -2356,9 +3076,38 @@ wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
              -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
              -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
+             -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \
+             -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
+             -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
+             -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+             -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
+             -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
+             -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
+             -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \
+             -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \
+             -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \
+             -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \
+             -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \
+             -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \
+             -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \
+             -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \
+             -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \
+             -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \
+             -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \
+             -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \
+             -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \
+             -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \
+             -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \
+             -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \
+             -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \
+             -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \
+             -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \
+             -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
+             -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
              -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
              -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
-             -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+         | \
+         sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
              -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
              -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
              -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
@@ -2370,24 +3119,39 @@ wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
              -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
              -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
              -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-           < $(srcdir)/wchar.in.h; \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
 
 # We need the following in order to create <wctype.h> when the system
 # doesn't have one that works with the given compiler.
-wctype.h: wctype.in.h
+wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+             -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
+             -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
+             -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \
+             -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \
+             -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \
+             -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
              -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
+             -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \
+             -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \
              -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+             -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
              -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
+             -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/wctype.in.h; \
        } > $@-t && \
        mv $@-t $@
@@ -2401,12 +3165,12 @@ mostlyclean-local: mostlyclean-generic
        :
 
 match.$(OBJEXT): match.c
-       cp $(srcdir)/match.c _match.S
-       $(CPP) $(CPPFLAGS) $(ASCPPFLAGS) _match.S > _match.i
-       $(ASCPPPOST) < _match.i > match_.s
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(ASFLAGS_config) -c match_.s
-       mv match_.$(OBJEXT) $@
-       rm -f _match.S _match.i match_.s
+       $(AM_V_GEN)cp $(srcdir)/match.c _match.S
+       $(AM_V_at)$(CPP) $(CPPFLAGS) $(ASCPPFLAGS) _match.S > _match.i
+       $(AM_V_at)$(ASCPPPOST) < _match.i > match_.s
+       $(AM_V_at)$(CC) $(CPPFLAGS) $(CFLAGS) $(ASFLAGS_config) -c match_.s
+       $(AM_V_at)mv match_.$(OBJEXT) $@
+       $(AM_V_at)rm -f _match.S _match.i match_.s
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
index 34f8fe5ef221e31e13e43eedd8029905f919c624..e94eb68c3c82c991afb1f339366ee186da8a7979 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2010 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2012 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -16,9 +14,9 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-   USA.  */
+   License along with this program; if not, see
+   <http://www.gnu.org/licenses/>.
+  */
 
 /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
    means there is a real alloca function.  */
index dc3dc1d447ea727ca3b27eb549703c9ab072678f..f6f70c92885b13c88626d08a107e691c4b6337df 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006, 2009-2012 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
@@ -14,8 +12,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/lib/at-func.c b/lib/at-func.c
deleted file mode 100644 (file)
index ea456ed..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Define an at-style functions like fstatat, unlinkat, fchownat, etc.
-   Copyright (C) 2006, 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* written by Jim Meyering */
-
-#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
-#include "openat.h"
-#include "openat-priv.h"
-#include "save-cwd.h"
-
-#ifdef AT_FUNC_USE_F1_COND
-# define CALL_FUNC(F)                           \
-  (flag == AT_FUNC_USE_F1_COND                  \
-    ? AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS)     \
-    : AT_FUNC_F2 (F AT_FUNC_POST_FILE_ARGS))
-# define VALIDATE_FLAG(F)                       \
-  if (flag & ~AT_FUNC_USE_F1_COND)              \
-    {                                           \
-      errno = EINVAL;                           \
-      return FUNC_FAIL;                         \
-    }
-#else
-# define CALL_FUNC(F) (AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS))
-# define VALIDATE_FLAG(F) /* empty */
-#endif
-
-#ifdef AT_FUNC_RESULT
-# define FUNC_RESULT AT_FUNC_RESULT
-#else
-# define FUNC_RESULT int
-#endif
-
-#ifdef AT_FUNC_FAIL
-# define FUNC_FAIL AT_FUNC_FAIL
-#else
-# define FUNC_FAIL -1
-#endif
-
-/* Call AT_FUNC_F1 to operate on FILE, which is in the directory
-   open on descriptor FD.  If AT_FUNC_USE_F1_COND is defined to a value,
-   AT_FUNC_POST_FILE_PARAM_DECLS must inlude a parameter named flag;
-   call AT_FUNC_F2 if FLAG is 0 or fail if FLAG contains more bits than
-   AT_FUNC_USE_F1_COND.  Return int and fail with -1 unless AT_FUNC_RESULT
-   or AT_FUNC_FAIL are defined.  If possible, do it without changing the
-   working directory.  Otherwise, resort to using save_cwd/fchdir,
-   then AT_FUNC_F?/restore_cwd.  If either the save_cwd or the restore_cwd
-   fails, then give a diagnostic and exit nonzero.  */
-FUNC_RESULT
-AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS)
-{
-  /* Be careful to choose names unlikely to conflict with
-     AT_FUNC_POST_FILE_PARAM_DECLS.  */
-  struct saved_cwd saved_cwd;
-  int saved_errno;
-  FUNC_RESULT err;
-
-  VALIDATE_FLAG (flag);
-
-  if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
-    return CALL_FUNC (file);
-
-  {
-    char proc_buf[OPENAT_BUFFER_SIZE];
-    char *proc_file = openat_proc_name (proc_buf, fd, file);
-    if (proc_file)
-      {
-        FUNC_RESULT proc_result = CALL_FUNC (proc_file);
-        int proc_errno = errno;
-        if (proc_file != proc_buf)
-          free (proc_file);
-        /* If the syscall succeeds, or if it fails with an unexpected
-           errno value, then return right away.  Otherwise, fall through
-           and resort to using save_cwd/restore_cwd.  */
-        if (FUNC_FAIL != proc_result)
-          return proc_result;
-        if (! EXPECTED_ERRNO (proc_errno))
-          {
-            errno = proc_errno;
-            return proc_result;
-          }
-      }
-  }
-
-  if (save_cwd (&saved_cwd) != 0)
-    openat_save_fail (errno);
-  if (0 <= fd && fd == saved_cwd.desc)
-    {
-      /* If saving the working directory collides with the user's
-         requested fd, then the user's fd must have been closed to
-         begin with.  */
-      free_cwd (&saved_cwd);
-      errno = EBADF;
-      return FUNC_FAIL;
-    }
-
-  if (fchdir (fd) != 0)
-    {
-      saved_errno = errno;
-      free_cwd (&saved_cwd);
-      errno = saved_errno;
-      return FUNC_FAIL;
-    }
-
-  err = CALL_FUNC (file);
-  saved_errno = (err == FUNC_FAIL ? errno : 0);
-
-  if (restore_cwd (&saved_cwd) != 0)
-    openat_restore_fail (errno);
-
-  free_cwd (&saved_cwd);
-
-  if (saved_errno)
-    errno = saved_errno;
-  return err;
-}
-#undef CALL_FUNC
-#undef FUNC_RESULT
-#undef FUNC_FAIL
index a35ff01c2cab0ca44b6a04cae7463fa82e2505fd..43ef8c211b80cccdd4662f15d50feadaea0e7898 100644 (file)
@@ -1,6 +1,6 @@
 /* basename.c -- return the last element in a file name
 
-   Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2010 Free Software
+   Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/c-ctype.c b/lib/c-ctype.c
new file mode 100644 (file)
index 0000000..952d7a8
--- /dev/null
@@ -0,0 +1,395 @@
+/* Character handling in C locale.
+
+   Copyright 2000-2003, 2006, 2009-2012 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
+the Free Software Foundation; either version 3 of the License, 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.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#define NO_C_CTYPE_MACROS
+#include "c-ctype.h"
+
+/* The function isascii is not locale dependent. Its use in EBCDIC is
+   questionable. */
+bool
+c_isascii (int c)
+{
+  return (c >= 0x00 && c <= 0x7f);
+}
+
+bool
+c_isalnum (int c)
+{
+#if C_CTYPE_CONSECUTIVE_DIGITS \
+    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+  return ((c >= '0' && c <= '9')
+          || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z'));
+#else
+  return ((c >= '0' && c <= '9')
+          || (c >= 'A' && c <= 'Z')
+          || (c >= 'a' && c <= 'z'));
+#endif
+#else
+  switch (c)
+    {
+    case '0': case '1': case '2': case '3': case '4': case '5':
+    case '6': case '7': case '8': case '9':
+    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 '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':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isalpha (int c)
+{
+#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+  return ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z');
+#else
+  return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
+#endif
+#else
+  switch (c)
+    {
+    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 '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':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isblank (int c)
+{
+  return (c == ' ' || c == '\t');
+}
+
+bool
+c_iscntrl (int c)
+{
+#if C_CTYPE_ASCII
+  return ((c & ~0x1f) == 0 || c == 0x7f);
+#else
+  switch (c)
+    {
+    case ' ': case '!': 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 '@':
+    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 '`':
+    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 '~':
+      return 0;
+    default:
+      return 1;
+    }
+#endif
+}
+
+bool
+c_isdigit (int c)
+{
+#if C_CTYPE_CONSECUTIVE_DIGITS
+  return (c >= '0' && c <= '9');
+#else
+  switch (c)
+    {
+    case '0': case '1': case '2': case '3': case '4': case '5':
+    case '6': case '7': case '8': case '9':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_islower (int c)
+{
+#if C_CTYPE_CONSECUTIVE_LOWERCASE
+  return (c >= 'a' && c <= 'z');
+#else
+  switch (c)
+    {
+    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':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isgraph (int c)
+{
+#if C_CTYPE_ASCII
+  return (c >= '!' && c <= '~');
+#else
+  switch (c)
+    {
+    case '!': 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 '@':
+    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 '`':
+    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 '~':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isprint (int c)
+{
+#if C_CTYPE_ASCII
+  return (c >= ' ' && c <= '~');
+#else
+  switch (c)
+    {
+    case ' ': case '!': 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 '@':
+    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 '`':
+    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 '~':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_ispunct (int c)
+{
+#if C_CTYPE_ASCII
+  return ((c >= '!' && c <= '~')
+          && !((c >= '0' && c <= '9')
+               || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z')));
+#else
+  switch (c)
+    {
+    case '!': case '"': case '#': case '$': case '%': case '&':
+    case '\'': case '(': case ')': case '*': case '+': case ',':
+    case '-': case '.': case '/':
+    case ':': case ';': case '<': case '=': case '>': case '?':
+    case '@':
+    case '[': case '\\': case ']': case '^': case '_': case '`':
+    case '{': case '|': case '}': case '~':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isspace (int c)
+{
+  return (c == ' ' || c == '\t'
+          || c == '\n' || c == '\v' || c == '\f' || c == '\r');
+}
+
+bool
+c_isupper (int c)
+{
+#if C_CTYPE_CONSECUTIVE_UPPERCASE
+  return (c >= 'A' && c <= 'Z');
+#else
+  switch (c)
+    {
+    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':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+bool
+c_isxdigit (int c)
+{
+#if C_CTYPE_CONSECUTIVE_DIGITS \
+    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+  return ((c >= '0' && c <= '9')
+          || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'F'));
+#else
+  return ((c >= '0' && c <= '9')
+          || (c >= 'A' && c <= 'F')
+          || (c >= 'a' && c <= 'f'));
+#endif
+#else
+  switch (c)
+    {
+    case '0': case '1': case '2': case '3': case '4': case '5':
+    case '6': case '7': case '8': case '9':
+    case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+    case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+      return 1;
+    default:
+      return 0;
+    }
+#endif
+}
+
+int
+c_tolower (int c)
+{
+#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+  return (c >= 'A' && c <= 'Z' ? c - 'A' + 'a' : c);
+#else
+  switch (c)
+    {
+    case 'A': return 'a';
+    case 'B': return 'b';
+    case 'C': return 'c';
+    case 'D': return 'd';
+    case 'E': return 'e';
+    case 'F': return 'f';
+    case 'G': return 'g';
+    case 'H': return 'h';
+    case 'I': return 'i';
+    case 'J': return 'j';
+    case 'K': return 'k';
+    case 'L': return 'l';
+    case 'M': return 'm';
+    case 'N': return 'n';
+    case 'O': return 'o';
+    case 'P': return 'p';
+    case 'Q': return 'q';
+    case 'R': return 'r';
+    case 'S': return 's';
+    case 'T': return 't';
+    case 'U': return 'u';
+    case 'V': return 'v';
+    case 'W': return 'w';
+    case 'X': return 'x';
+    case 'Y': return 'y';
+    case 'Z': return 'z';
+    default: return c;
+    }
+#endif
+}
+
+int
+c_toupper (int c)
+{
+#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+  return (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c);
+#else
+  switch (c)
+    {
+    case 'a': return 'A';
+    case 'b': return 'B';
+    case 'c': return 'C';
+    case 'd': return 'D';
+    case 'e': return 'E';
+    case 'f': return 'F';
+    case 'g': return 'G';
+    case 'h': return 'H';
+    case 'i': return 'I';
+    case 'j': return 'J';
+    case 'k': return 'K';
+    case 'l': return 'L';
+    case 'm': return 'M';
+    case 'n': return 'N';
+    case 'o': return 'O';
+    case 'p': return 'P';
+    case 'q': return 'Q';
+    case 'r': return 'R';
+    case 's': return 'S';
+    case 't': return 'T';
+    case 'u': return 'U';
+    case 'v': return 'V';
+    case 'w': return 'W';
+    case 'x': return 'X';
+    case 'y': return 'Y';
+    case 'z': return 'Z';
+    default: return c;
+    }
+#endif
+}
diff --git a/lib/c-ctype.h b/lib/c-ctype.h
new file mode 100644 (file)
index 0000000..0b31309
--- /dev/null
@@ -0,0 +1,294 @@
+/* Character handling in C locale.
+
+   These functions work like the corresponding functions in <ctype.h>,
+   except that they have the C (POSIX) locale hardwired, whereas the
+   <ctype.h> functions' behaviour depends on the current locale set via
+   setlocale.
+
+   Copyright (C) 2000-2003, 2006, 2008-2012 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
+the Free Software Foundation; either version 3 of the License, 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.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef C_CTYPE_H
+#define C_CTYPE_H
+
+#include <stdbool.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* The functions defined in this file assume the "C" locale and a character
+   set without diacritics (ASCII-US or EBCDIC-US or something like that).
+   Even if the "C" locale on a particular system is an extension of the ASCII
+   character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it
+   is ISO-8859-1), the functions in this file recognize only the ASCII
+   characters.  */
+
+
+/* Check whether the ASCII optimizations apply. */
+
+/* ANSI C89 (and ISO C99 5.2.1.3 too) already guarantees that
+   '0', '1', ..., '9' have consecutive integer values.  */
+#define C_CTYPE_CONSECUTIVE_DIGITS 1
+
+#if ('A' <= 'Z') \
+    && ('A' + 1 == 'B') && ('B' + 1 == 'C') && ('C' + 1 == 'D') \
+    && ('D' + 1 == 'E') && ('E' + 1 == 'F') && ('F' + 1 == 'G') \
+    && ('G' + 1 == 'H') && ('H' + 1 == 'I') && ('I' + 1 == 'J') \
+    && ('J' + 1 == 'K') && ('K' + 1 == 'L') && ('L' + 1 == 'M') \
+    && ('M' + 1 == 'N') && ('N' + 1 == 'O') && ('O' + 1 == 'P') \
+    && ('P' + 1 == 'Q') && ('Q' + 1 == 'R') && ('R' + 1 == 'S') \
+    && ('S' + 1 == 'T') && ('T' + 1 == 'U') && ('U' + 1 == 'V') \
+    && ('V' + 1 == 'W') && ('W' + 1 == 'X') && ('X' + 1 == 'Y') \
+    && ('Y' + 1 == 'Z')
+#define C_CTYPE_CONSECUTIVE_UPPERCASE 1
+#endif
+
+#if ('a' <= 'z') \
+    && ('a' + 1 == 'b') && ('b' + 1 == 'c') && ('c' + 1 == 'd') \
+    && ('d' + 1 == 'e') && ('e' + 1 == 'f') && ('f' + 1 == 'g') \
+    && ('g' + 1 == 'h') && ('h' + 1 == 'i') && ('i' + 1 == 'j') \
+    && ('j' + 1 == 'k') && ('k' + 1 == 'l') && ('l' + 1 == 'm') \
+    && ('m' + 1 == 'n') && ('n' + 1 == 'o') && ('o' + 1 == 'p') \
+    && ('p' + 1 == 'q') && ('q' + 1 == 'r') && ('r' + 1 == 's') \
+    && ('s' + 1 == 't') && ('t' + 1 == 'u') && ('u' + 1 == 'v') \
+    && ('v' + 1 == 'w') && ('w' + 1 == 'x') && ('x' + 1 == 'y') \
+    && ('y' + 1 == 'z')
+#define C_CTYPE_CONSECUTIVE_LOWERCASE 1
+#endif
+
+#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+    && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+    && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+    && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+    && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+    && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+    && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+    && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+    && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+    && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+    && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+    && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+    && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+    && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+    && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+    && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+    && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+    && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+    && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+    && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+    && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+    && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+    && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
+/* The character set is ASCII or one of its variants or extensions, not EBCDIC.
+   Testing the value of '\n' and '\r' is not relevant.  */
+#define C_CTYPE_ASCII 1
+#endif
+
+
+/* Function declarations. */
+
+/* Unlike the functions in <ctype.h>, which require an argument in the range
+   of the 'unsigned char' type, the functions here operate on values that are
+   in the 'unsigned char' range or in the 'char' range.  In other words,
+   when you have a 'char' value, you need to cast it before using it as
+   argument to a <ctype.h> function:
+
+         const char *s = ...;
+         if (isalpha ((unsigned char) *s)) ...
+
+   but you don't need to cast it for the functions defined in this file:
+
+         const char *s = ...;
+         if (c_isalpha (*s)) ...
+ */
+
+extern bool c_isascii (int c) _GL_ATTRIBUTE_CONST; /* not locale dependent */
+
+extern bool c_isalnum (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isalpha (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isblank (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_iscntrl (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isdigit (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_islower (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isgraph (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isprint (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_ispunct (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isspace (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isupper (int c) _GL_ATTRIBUTE_CONST;
+extern bool c_isxdigit (int c) _GL_ATTRIBUTE_CONST;
+
+extern int c_tolower (int c) _GL_ATTRIBUTE_CONST;
+extern int c_toupper (int c) _GL_ATTRIBUTE_CONST;
+
+
+#if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS
+
+/* ASCII optimizations. */
+
+#undef c_isascii
+#define c_isascii(c) \
+  ({ int __c = (c); \
+     (__c >= 0x00 && __c <= 0x7f); \
+   })
+
+#if C_CTYPE_CONSECUTIVE_DIGITS \
+    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+#undef c_isalnum
+#define c_isalnum(c) \
+  ({ int __c = (c); \
+     ((__c >= '0' && __c <= '9') \
+      || ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z')); \
+   })
+#else
+#undef c_isalnum
+#define c_isalnum(c) \
+  ({ int __c = (c); \
+     ((__c >= '0' && __c <= '9') \
+      || (__c >= 'A' && __c <= 'Z') \
+      || (__c >= 'a' && __c <= 'z')); \
+   })
+#endif
+#endif
+
+#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+#undef c_isalpha
+#define c_isalpha(c) \
+  ({ int __c = (c); \
+     ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z'); \
+   })
+#else
+#undef c_isalpha
+#define c_isalpha(c) \
+  ({ int __c = (c); \
+     ((__c >= 'A' && __c <= 'Z') || (__c >= 'a' && __c <= 'z')); \
+   })
+#endif
+#endif
+
+#undef c_isblank
+#define c_isblank(c) \
+  ({ int __c = (c); \
+     (__c == ' ' || __c == '\t'); \
+   })
+
+#if C_CTYPE_ASCII
+#undef c_iscntrl
+#define c_iscntrl(c) \
+  ({ int __c = (c); \
+     ((__c & ~0x1f) == 0 || __c == 0x7f); \
+   })
+#endif
+
+#if C_CTYPE_CONSECUTIVE_DIGITS
+#undef c_isdigit
+#define c_isdigit(c) \
+  ({ int __c = (c); \
+     (__c >= '0' && __c <= '9'); \
+   })
+#endif
+
+#if C_CTYPE_CONSECUTIVE_LOWERCASE
+#undef c_islower
+#define c_islower(c) \
+  ({ int __c = (c); \
+     (__c >= 'a' && __c <= 'z'); \
+   })
+#endif
+
+#if C_CTYPE_ASCII
+#undef c_isgraph
+#define c_isgraph(c) \
+  ({ int __c = (c); \
+     (__c >= '!' && __c <= '~'); \
+   })
+#endif
+
+#if C_CTYPE_ASCII
+#undef c_isprint
+#define c_isprint(c) \
+  ({ int __c = (c); \
+     (__c >= ' ' && __c <= '~'); \
+   })
+#endif
+
+#if C_CTYPE_ASCII
+#undef c_ispunct
+#define c_ispunct(c) \
+  ({ int _c = (c); \
+     (c_isgraph (_c) && ! c_isalnum (_c)); \
+   })
+#endif
+
+#undef c_isspace
+#define c_isspace(c) \
+  ({ int __c = (c); \
+     (__c == ' ' || __c == '\t' \
+      || __c == '\n' || __c == '\v' || __c == '\f' || __c == '\r'); \
+   })
+
+#if C_CTYPE_CONSECUTIVE_UPPERCASE
+#undef c_isupper
+#define c_isupper(c) \
+  ({ int __c = (c); \
+     (__c >= 'A' && __c <= 'Z'); \
+   })
+#endif
+
+#if C_CTYPE_CONSECUTIVE_DIGITS \
+    && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#if C_CTYPE_ASCII
+#undef c_isxdigit
+#define c_isxdigit(c) \
+  ({ int __c = (c); \
+     ((__c >= '0' && __c <= '9') \
+      || ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'F')); \
+   })
+#else
+#undef c_isxdigit
+#define c_isxdigit(c) \
+  ({ int __c = (c); \
+     ((__c >= '0' && __c <= '9') \
+      || (__c >= 'A' && __c <= 'F') \
+      || (__c >= 'a' && __c <= 'f')); \
+   })
+#endif
+#endif
+
+#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#undef c_tolower
+#define c_tolower(c) \
+  ({ int __c = (c); \
+     (__c >= 'A' && __c <= 'Z' ? __c - 'A' + 'a' : __c); \
+   })
+#undef c_toupper
+#define c_toupper(c) \
+  ({ int __c = (c); \
+     (__c >= 'a' && __c <= 'z' ? __c - 'a' + 'A' : __c); \
+   })
+#endif
+
+#endif /* optimizing for speed */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* C_CTYPE_H */
diff --git a/lib/c-strcase.h b/lib/c-strcase.h
new file mode 100644 (file)
index 0000000..fdef238
--- /dev/null
@@ -0,0 +1,56 @@
+/* Case-insensitive string comparison functions in C locale.
+   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef C_STRCASE_H
+#define C_STRCASE_H
+
+#include <stddef.h>
+
+
+/* The functions defined in this file assume the "C" locale and a character
+   set without diacritics (ASCII-US or EBCDIC-US or something like that).
+   Even if the "C" locale on a particular system is an extension of the ASCII
+   character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it
+   is ISO-8859-1), the functions in this file recognize only the ASCII
+   characters.  More precisely, one of the string arguments must be an ASCII
+   string; the other one can also contain non-ASCII characters (but then
+   the comparison result will be nonzero).  */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
+   greater than zero if S1 is lexicographically less than, equal to or greater
+   than S2.  */
+extern int c_strcasecmp (const char *s1, const char *s2) _GL_ATTRIBUTE_PURE;
+
+/* Compare no more than N characters of strings S1 and S2, ignoring case,
+   returning less than, equal to or greater than zero if S1 is
+   lexicographically less than, equal to or greater than S2.  */
+extern int c_strncasecmp (const char *s1, const char *s2, size_t n)
+  _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* C_STRCASE_H */
diff --git a/lib/c-strcasecmp.c b/lib/c-strcasecmp.c
new file mode 100644 (file)
index 0000000..d8332ca
--- /dev/null
@@ -0,0 +1,56 @@
+/* c-strcasecmp.c -- case insensitive string comparator in C locale
+   Copyright (C) 1998-1999, 2005-2006, 2009-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "c-strcase.h"
+
+#include <limits.h>
+
+#include "c-ctype.h"
+
+int
+c_strcasecmp (const char *s1, const char *s2)
+{
+  register const unsigned char *p1 = (const unsigned char *) s1;
+  register const unsigned char *p2 = (const unsigned char *) s2;
+  unsigned char c1, c2;
+
+  if (p1 == p2)
+    return 0;
+
+  do
+    {
+      c1 = c_tolower (*p1);
+      c2 = c_tolower (*p2);
+
+      if (c1 == '\0')
+        break;
+
+      ++p1;
+      ++p2;
+    }
+  while (c1 == c2);
+
+  if (UCHAR_MAX <= INT_MAX)
+    return c1 - c2;
+  else
+    /* On machines where 'char' and 'int' are types of the same size, the
+       difference of two 'unsigned char' values - including the sign bit -
+       doesn't fit in an 'int'.  */
+    return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
+}
diff --git a/lib/c-strcaseeq.h b/lib/c-strcaseeq.h
new file mode 100644 (file)
index 0000000..5c4bdff
--- /dev/null
@@ -0,0 +1,184 @@
+/* Optimized case-insensitive string comparison in C locale.
+   Copyright (C) 2001-2002, 2007, 2009-2012 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 the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>.  */
+
+#include "c-strcase.h"
+#include "c-ctype.h"
+
+/* STRCASEEQ allows to optimize string comparison with a small literal string.
+     STRCASEEQ (s, "UTF-8", 'U','T','F','-','8',0,0,0,0)
+   is semantically equivalent to
+     c_strcasecmp (s, "UTF-8") == 0
+   just faster.  */
+
+/* Help GCC to generate good code for string comparisons with
+   immediate strings. */
+#if defined (__GNUC__) && defined (__OPTIMIZE__)
+
+/* Case insensitive comparison of ASCII characters.  */
+# if C_CTYPE_ASCII
+#  define CASEEQ(other,upper) \
+     (c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper))
+# elif C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
+#  define CASEEQ(other,upper) \
+     (c_isupper (upper) ? (other) == (upper) || (other) == (upper) - 'A' + 'a' : (other) == (upper))
+# else
+#  define CASEEQ(other,upper) \
+     (c_toupper (other) == (upper))
+# endif
+
+static inline int
+strcaseeq9 (const char *s1, const char *s2)
+{
+  return c_strcasecmp (s1 + 9, s2 + 9) == 0;
+}
+
+static inline int
+strcaseeq8 (const char *s1, const char *s2, char s28)
+{
+  if (CASEEQ (s1[8], s28))
+    {
+      if (s28 == 0)
+        return 1;
+      else
+        return strcaseeq9 (s1, s2);
+    }
+  else
+    return 0;
+}
+
+static inline int
+strcaseeq7 (const char *s1, const char *s2, char s27, char s28)
+{
+  if (CASEEQ (s1[7], s27))
+    {
+      if (s27 == 0)
+        return 1;
+      else
+        return strcaseeq8 (s1, s2, s28);
+    }
+  else
+    return 0;
+}
+
+static inline int
+strcaseeq6 (const char *s1, const char *s2, char s26, char s27, char s28)
+{
+  if (CASEEQ (s1[6], s26))
+    {
+      if (s26 == 0)
+        return 1;
+      else
+        return strcaseeq7 (s1, s2, s27, s28);
+    }
+  else
+    return 0;
+}
+
+static inline int
+strcaseeq5 (const char *s1, const char *s2, char s25, char s26, char s27, char s28)
+{
+  if (CASEEQ (s1[5], s25))
+    {
+      if (s25 == 0)
+        return 1;
+      else
+        return strcaseeq6 (s1, s2, s26, s27, s28);
+    }
+  else
+    return 0;
+}
+
+static inline int
+strcaseeq4 (const char *s1, const char *s2, char s24, char s25, char s26, char s27, char s28)
+{
+  if (CASEEQ (s1[4], s24))
+    {
+      if (s24 == 0)
+        return 1;
+      else
+        return strcaseeq5 (s1, s2, s25, s26, s27, s28);
+    }
+  else
+    return 0;
+}
+
+static inline int
+strcaseeq3 (const char *s1, const char *s2, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+  if (CASEEQ (s1[3], s23))
+    {
+      if (s23 == 0)
+        return 1;
+      else
+        return strcaseeq4 (s1, s2, s24, s25, s26, s27, s28);
+    }
+  else
+    return 0;
+}
+
+static inline int
+strcaseeq2 (const char *s1, const char *s2, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+  if (CASEEQ (s1[2], s22))
+    {
+      if (s22 == 0)
+        return 1;
+      else
+        return strcaseeq3 (s1, s2, s23, s24, s25, s26, s27, s28);
+    }
+  else
+    return 0;
+}
+
+static inline int
+strcaseeq1 (const char *s1, const char *s2, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+  if (CASEEQ (s1[1], s21))
+    {
+      if (s21 == 0)
+        return 1;
+      else
+        return strcaseeq2 (s1, s2, s22, s23, s24, s25, s26, s27, s28);
+    }
+  else
+    return 0;
+}
+
+static inline int
+strcaseeq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23, char s24, char s25, char s26, char s27, char s28)
+{
+  if (CASEEQ (s1[0], s20))
+    {
+      if (s20 == 0)
+        return 1;
+      else
+        return strcaseeq1 (s1, s2, s21, s22, s23, s24, s25, s26, s27, s28);
+    }
+  else
+    return 0;
+}
+
+#define STRCASEEQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+  strcaseeq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28)
+
+#else
+
+#define STRCASEEQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+  (c_strcasecmp (s1, s2) == 0)
+
+#endif
diff --git a/lib/c-strncasecmp.c b/lib/c-strncasecmp.c
new file mode 100644 (file)
index 0000000..47fb5fd
--- /dev/null
@@ -0,0 +1,56 @@
+/* c-strncasecmp.c -- case insensitive string comparator in C locale
+   Copyright (C) 1998-1999, 2005-2006, 2009-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "c-strcase.h"
+
+#include <limits.h>
+
+#include "c-ctype.h"
+
+int
+c_strncasecmp (const char *s1, const char *s2, size_t n)
+{
+  register const unsigned char *p1 = (const unsigned char *) s1;
+  register const unsigned char *p2 = (const unsigned char *) s2;
+  unsigned char c1, c2;
+
+  if (p1 == p2 || n == 0)
+    return 0;
+
+  do
+    {
+      c1 = c_tolower (*p1);
+      c2 = c_tolower (*p2);
+
+      if (--n == 0 || c1 == '\0')
+        break;
+
+      ++p1;
+      ++p2;
+    }
+  while (c1 == c2);
+
+  if (UCHAR_MAX <= INT_MAX)
+    return c1 - c2;
+  else
+    /* On machines where 'char' and 'int' are types of the same size, the
+       difference of two 'unsigned char' values - including the sign bit -
+       doesn't fit in an 'int'.  */
+    return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
+}
index d28e1583c86856d19eb50517c17f562c1f2525d2..93da14dd7f80a793a565fde55b69aad6773a0975 100644 (file)
@@ -1,6 +1,6 @@
 /* calloc() function that is glibc compatible.
    This wrapper function is required at least on Tru64 UNIX 5.1 and mingw.
-   Copyright (C) 2004-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004-2007, 2009-2012 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
 #include <config.h>
 /* Only the AC_FUNC_CALLOC macro defines 'calloc' already in config.h.  */
 #ifdef calloc
-# define NEED_CALLOC_GNU
+# define NEED_CALLOC_GNU 1
 # undef calloc
+/* Whereas the gnulib module 'calloc-gnu' defines HAVE_CALLOC_GNU.  */
+#elif GNULIB_CALLOC_GNU && !HAVE_CALLOC_GNU
+# define NEED_CALLOC_GNU 1
 #endif
 
 /* Specification.  */
@@ -40,7 +43,7 @@ rpl_calloc (size_t n, size_t s)
 {
   void *result;
 
-#ifdef NEED_CALLOC_GNU
+#if NEED_CALLOC_GNU
   if (n == 0 || s == 0)
     {
       n = 1;
index 28e24070e9bfef285c3435a01166dcd71cf4b31f..599d14157a9138823f17267f031c504547ad65a9 100644 (file)
@@ -1,5 +1,5 @@
 /* provide a chdir function that tries not to fail due to ENAMETOOLONG
-   Copyright (C) 2004-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 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
@@ -72,7 +72,7 @@ static int
 cdb_advance_fd (struct cd_buf *cdb, char const *dir)
 {
   int new_fd = openat (cdb->fd, dir,
-                       O_RDONLY | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
+                       O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
   if (new_fd < 0)
     return -1;
 
@@ -83,7 +83,7 @@ cdb_advance_fd (struct cd_buf *cdb, char const *dir)
 }
 
 /* Return a pointer to the first non-slash in S.  */
-static inline char *
+static inline char * _GL_ATTRIBUTE_PURE
 find_non_slash (char const *s)
 {
   size_t n_slash = strspn (s, "/");
@@ -96,7 +96,7 @@ find_non_slash (char const *s)
    name.  It handles an arbitrarily long directory name by operating
    on manageable portions of the name.  On systems without the openat
    syscall, this means changing the working directory to more and more
-   `distant' points along the long directory name and then restoring
+   "distant" points along the long directory name and then restoring
    the working directory.  If any of those attempts to save or restore
    the working directory fails, this function exits nonzero.
 
@@ -245,7 +245,7 @@ main (int argc, char *argv[])
 
   if (argc <= 1)
     {
-      /* Using `pwd' here makes sense only if it is a robust implementation,
+      /* Using 'pwd' here makes sense only if it is a robust implementation,
          like the one in coreutils after the 2004-04-19 changes.  */
       char const *cmd = "pwd";
       execlp (cmd, (char *) NULL);
index a0a44321342c729c378ae8c0f97959ddb5e4fea9..51db5a8041e1a7997fe9da158f7a21145aa1dcef 100644 (file)
@@ -1,5 +1,5 @@
 /* provide a chdir function that tries not to fail due to ENAMETOOLONG
-   Copyright (C) 2004-2005, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004-2005, 2009-2012 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
 #include <unistd.h>
 #include <limits.h>
 
-#ifndef PATH_MAX
-# ifdef MAXPATHLEN
-#  define PATH_MAX MAXPATHLEN
-# endif
-#endif
+#include "pathmax.h"
 
 /* On systems without PATH_MAX, presume that chdir accepts
    arbitrarily long directory names.  */
diff --git a/lib/chown.c b/lib/chown.c
deleted file mode 100644 (file)
index d8f6bfe..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/* provide consistent interface to chown for systems that don't interpret
-   an ID of -1 as meaning `don't change the corresponding ID'.
-
-   Copyright (C) 1997, 2004-2007, 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* written by Jim Meyering */
-
-#include <config.h>
-
-/* Specification.  */
-#include <unistd.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdbool.h>
-#include <string.h>
-#include <sys/stat.h>
-
-#if !HAVE_CHOWN
-
-/* Simple stub that always fails with ENOSYS, for mingw.  */
-int
-chown (const char *file _GL_UNUSED, uid_t uid _GL_UNUSED,
-       gid_t gid _GL_UNUSED)
-{
-  errno = ENOSYS;
-  return -1;
-}
-
-#else /* HAVE_CHOWN */
-
-/* Below we refer to the system's chown().  */
-# undef chown
-
-/* The results of open() in this file are not used with fchdir,
-   therefore save some unnecessary work in fchdir.c.  */
-# undef open
-# undef close
-
-/* Provide a more-closely POSIX-conforming version of chown on
-   systems with one or both of the following problems:
-   - chown doesn't treat an ID of -1 as meaning
-   `don't change the corresponding ID'.
-   - chown doesn't dereference symlinks.  */
-
-int
-rpl_chown (const char *file, uid_t uid, gid_t gid)
-{
-  struct stat st;
-  bool stat_valid = false;
-  int result;
-
-# if CHOWN_CHANGE_TIME_BUG
-  if (gid != (gid_t) -1 || uid != (uid_t) -1)
-    {
-      if (stat (file, &st))
-        return -1;
-      stat_valid = true;
-    }
-# endif
-
-# if CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE
-  if (gid == (gid_t) -1 || uid == (uid_t) -1)
-    {
-      /* Stat file to get id(s) that should remain unchanged.  */
-      if (!stat_valid && stat (file, &st))
-        return -1;
-      if (gid == (gid_t) -1)
-        gid = st.st_gid;
-      if (uid == (uid_t) -1)
-        uid = st.st_uid;
-    }
-# endif
-
-# if CHOWN_MODIFIES_SYMLINK
-  {
-    /* Handle the case in which the system-supplied chown function
-       does *not* follow symlinks.  Instead, it changes permissions
-       on the symlink itself.  To work around that, we open the
-       file (but this can fail due to lack of read or write permission) and
-       use fchown on the resulting descriptor.  */
-    int open_flags = O_NONBLOCK | O_NOCTTY;
-    int fd = open (file, O_RDONLY | open_flags);
-    if (0 <= fd
-        || (errno == EACCES
-            && 0 <= (fd = open (file, O_WRONLY | open_flags))))
-      {
-        int saved_errno;
-        bool fchown_socket_failure;
-
-        result = fchown (fd, uid, gid);
-        saved_errno = errno;
-
-        /* POSIX says fchown can fail with errno == EINVAL on sockets
-           and pipes, so fall back on chown in that case.  */
-        fchown_socket_failure =
-          (result != 0 && saved_errno == EINVAL
-           && fstat (fd, &st) == 0
-           && (S_ISFIFO (st.st_mode) || S_ISSOCK (st.st_mode)));
-
-        close (fd);
-
-        if (! fchown_socket_failure)
-          {
-            errno = saved_errno;
-            return result;
-          }
-      }
-    else if (errno != EACCES)
-      return -1;
-  }
-# endif
-
-# if CHOWN_TRAILING_SLASH_BUG
-  if (!stat_valid)
-    {
-      size_t len = strlen (file);
-      if (len && file[len - 1] == '/' && stat (file, &st))
-        return -1;
-    }
-# endif
-
-  result = chown (file, uid, gid);
-
-# if CHOWN_CHANGE_TIME_BUG
-  if (result == 0 && stat_valid
-      && (uid == st.st_uid || uid == (uid_t) -1)
-      && (gid == st.st_gid || gid == (gid_t) -1))
-    {
-      /* No change in ownership, but at least one argument was not -1,
-         so we are required to update ctime.  Since chown succeeded,
-         we assume that chmod will do likewise.  Fortunately, on all
-         known systems where a 'no-op' chown skips the ctime update, a
-         'no-op' chmod still does the trick.  */
-      result = chmod (file, st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO
-                                          | S_ISUID | S_ISGID | S_ISVTX));
-    }
-# endif
-
-  return result;
-}
-
-#endif /* HAVE_CHOWN */
diff --git a/lib/cloexec.c b/lib/cloexec.c
new file mode 100644 (file)
index 0000000..7919e86
--- /dev/null
@@ -0,0 +1,83 @@
+/* closexec.c - set or clear the close-on-exec descriptor flag
+
+   Copyright (C) 1991, 2004-2006, 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+   The code is taken from glibc/manual/llio.texi  */
+
+#include <config.h>
+
+#include "cloexec.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
+   or clear the flag if VALUE is false.
+   Return 0 on success, or -1 on error with 'errno' set.
+
+   Note that on MingW, this function does NOT protect DESC from being
+   inherited into spawned children.  Instead, either use dup_cloexec
+   followed by closing the original DESC, or use interfaces such as
+   open or pipe2 that accept flags like O_CLOEXEC to create DESC
+   non-inheritable in the first place.  */
+
+int
+set_cloexec_flag (int desc, bool value)
+{
+#ifdef F_SETFD
+
+  int flags = fcntl (desc, F_GETFD, 0);
+
+  if (0 <= flags)
+    {
+      int newflags = (value ? flags | FD_CLOEXEC : flags & ~FD_CLOEXEC);
+
+      if (flags == newflags
+          || fcntl (desc, F_SETFD, newflags) != -1)
+        return 0;
+    }
+
+  return -1;
+
+#else /* !F_SETFD */
+
+  /* Use dup2 to reject invalid file descriptors; the cloexec flag
+     will be unaffected.  */
+  if (desc < 0)
+    {
+      errno = EBADF;
+      return -1;
+    }
+  if (dup2 (desc, desc) < 0)
+    /* errno is EBADF here.  */
+    return -1;
+
+  /* There is nothing we can do on this kind of platform.  Punt.  */
+  return 0;
+#endif /* !F_SETFD */
+}
+
+
+/* Duplicates a file handle FD, while marking the copy to be closed
+   prior to exec or spawn.  Returns -1 and sets errno if FD could not
+   be duplicated.  */
+
+int
+dup_cloexec (int fd)
+{
+  return fcntl (fd, F_DUPFD_CLOEXEC, 0);
+}
diff --git a/lib/cloexec.h b/lib/cloexec.h
new file mode 100644 (file)
index 0000000..92e9f81
--- /dev/null
@@ -0,0 +1,38 @@
+/* closexec.c - set or clear the close-on-exec descriptor flag
+
+   Copyright (C) 2004, 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include <stdbool.h>
+
+/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
+   or clear the flag if VALUE is false.
+   Return 0 on success, or -1 on error with 'errno' set.
+
+   Note that on MingW, this function does NOT protect DESC from being
+   inherited into spawned children.  Instead, either use dup_cloexec
+   followed by closing the original DESC, or use interfaces such as
+   open or pipe2 that accept flags like O_CLOEXEC to create DESC
+   non-inheritable in the first place.  */
+
+int set_cloexec_flag (int desc, bool value);
+
+/* Duplicates a file handle FD, while marking the copy to be closed
+   prior to exec or spawn.  Returns -1 and sets errno if FD could not
+   be duplicated.  */
+
+int dup_cloexec (int fd);
diff --git a/lib/close-hook.c b/lib/close-hook.c
deleted file mode 100644 (file)
index 1d569c0..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-/* Hook for making the close() function extensible.
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2009.
-
-   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 3 of the License, 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include "close-hook.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-
-#undef close
-
-
-/* Currently, this entire code is only needed for the handling of sockets
-   on native Windows platforms.  */
-#if WINDOWS_SOCKETS
-
-/* The first and last link in the doubly linked list.
-   Initially the list is empty.  */
-static struct close_hook anchor = { &anchor, &anchor, NULL };
-
-int
-execute_close_hooks (int fd, const struct close_hook *remaining_list)
-{
-  if (remaining_list == &anchor)
-    /* End of list reached.  */
-    return close (fd);
-  else
-    return remaining_list->private_fn (fd, remaining_list->private_next);
-}
-
-int
-execute_all_close_hooks (int fd)
-{
-  return execute_close_hooks (fd, anchor.private_next);
-}
-
-void
-register_close_hook (close_hook_fn hook, struct close_hook *link)
-{
-  if (link->private_next == NULL && link->private_prev == NULL)
-    {
-      /* Add the link to the doubly linked list.  */
-      link->private_next = anchor.private_next;
-      link->private_prev = &anchor;
-      link->private_fn = hook;
-      anchor.private_next->private_prev = link;
-      anchor.private_next = link;
-    }
-  else
-    {
-      /* The link is already in use.  */
-      if (link->private_fn != hook)
-        abort ();
-    }
-}
-
-void
-unregister_close_hook (struct close_hook *link)
-{
-  struct close_hook *next = link->private_next;
-  struct close_hook *prev = link->private_prev;
-
-  if (next != NULL && prev != NULL)
-    {
-      /* The link is in use.  Remove it from the doubly linked list.  */
-      prev->private_next = next;
-      next->private_prev = prev;
-      /* Clear the link, to mark it unused.  */
-      link->private_next = NULL;
-      link->private_prev = NULL;
-      link->private_fn = NULL;
-    }
-}
-
-#endif
diff --git a/lib/close-hook.h b/lib/close-hook.h
deleted file mode 100644 (file)
index acc4c6a..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-/* Hook for making the close() function extensible.
-   Copyright (C) 2009, 2010 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 the Free Software Foundation; either version 3 of the License, 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-
-#ifndef CLOSE_HOOK_H
-#define CLOSE_HOOK_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Currently, this entire code is only needed for the handling of sockets
-   on native Windows platforms.  */
-#if WINDOWS_SOCKETS
-
-
-/* An element of the list of close hooks.
-   The fields of this structure are considered private.  */
-struct close_hook
-{
-  /* Doubly linked list.  */
-  struct close_hook *private_next;
-  struct close_hook *private_prev;
-  /* Function that treats the types of FD that it knows about and calls
-     execute_close_hooks (FD, REMAINING_LIST) as a fallback.  */
-  int (*private_fn) (int fd, const struct close_hook *remaining_list);
-};
-
-/* This type of function closes FD, applying special knowledge for the FD
-   types it knows about, and calls execute_close_hooks (FD, REMAINING_LIST)
-   for the other FD types.  */
-typedef int (*close_hook_fn) (int fd, const struct close_hook *remaining_list);
-
-/* Execute the close hooks in REMAINING_LIST.
-   Return 0 or -1, like close() would do.  */
-extern int execute_close_hooks (int fd, const struct close_hook *remaining_list);
-
-/* Execute all close hooks.
-   Return 0 or -1, like close() would do.  */
-extern int execute_all_close_hooks (int fd);
-
-/* Add a function to the list of close hooks.
-   The LINK variable points to a piece of memory which is guaranteed to be
-   accessible until the corresponding call to unregister_close_hook.  */
-extern void register_close_hook (close_hook_fn hook, struct close_hook *link);
-
-/* Removes a function from the list of close hooks.  */
-extern void unregister_close_hook (struct close_hook *link);
-
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* CLOSE_HOOK_H */
index cf0422f3d80835561cf37cbe793726c7067a765b..04fa5ece09d77267af8afb8bcc85c7a9edd246dd 100644 (file)
@@ -1,6 +1,6 @@
 /* Close a stream, with nicer error checking than fclose's.
 
-   Copyright (C) 1998-2002, 2004, 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 1998-2002, 2004, 2006-2012 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
 int
 close_stream (FILE *stream)
 {
-  bool some_pending = (__fpending (stream) != 0);
-  bool prev_fail = (ferror (stream) != 0);
-  bool fclose_fail = (fclose (stream) != 0);
+  const bool some_pending = (__fpending (stream) != 0);
+  const bool prev_fail = (ferror (stream) != 0);
+  const bool fclose_fail = (fclose (stream) != 0);
 
   /* Return an error indication if there was a previous failure or if
      fclose failed, with one exception: ignore an fclose failure if
      there was no previous error, no data remains to be flushed, and
      fclose failed with EBADF.  That can happen when a program like cp
-     is invoked like this `cp a b >&-' (i.e., with standard output
+     is invoked like this 'cp a b >&-' (i.e., with standard output
      closed) and doesn't generate any output (hence no previous error
      and nothing to be flushed).  */
 
index afa8f64058cb9dd16f1135bcf06131993c2c221a..4b7accbc966ded91c5919240578f71ee1a2293a7 100644 (file)
@@ -1,5 +1,5 @@
 /* close replacement.
-   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 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
 /* Specification.  */
 #include <unistd.h>
 
-#include "close-hook.h"
+#include <errno.h>
+
+#include "fd-hook.h"
+#include "msvc-inval.h"
+
+#undef close
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+close_nothrow (int fd)
+{
+  int result;
+
+  TRY_MSVC_INVAL
+    {
+      result = close (fd);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = -1;
+      errno = EBADF;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+#else
+# define close_nothrow close
+#endif
 
 /* Override close() to call into other gnulib modules.  */
 
 int
 rpl_close (int fd)
-#undef close
 {
 #if WINDOWS_SOCKETS
-  int retval = execute_all_close_hooks (fd);
+  int retval = execute_all_close_hooks (close_nothrow, fd);
 #else
-  int retval = close (fd);
+  int retval = close_nothrow (fd);
 #endif
 
 #if REPLACE_FCHDIR
diff --git a/lib/closedir.c b/lib/closedir.c
new file mode 100644 (file)
index 0000000..df31e86
--- /dev/null
@@ -0,0 +1,67 @@
+/* Stop reading the entries of a directory.
+   Copyright (C) 2006-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <dirent.h>
+
+#if REPLACE_FCHDIR
+# include <unistd.h>
+#endif
+
+#if HAVE_CLOSEDIR
+
+/* Override closedir(), to keep track of the open file descriptors.
+   Needed because there is a function dirfd().  */
+
+#else
+
+# include <stdlib.h>
+
+# include "dirent-private.h"
+
+#endif
+
+int
+closedir (DIR *dirp)
+{
+# if REPLACE_FCHDIR
+  int fd = dirfd (dirp);
+# endif
+  int retval;
+
+#if HAVE_CLOSEDIR
+# undef closedir
+
+  retval = closedir (dirp);
+
+#else
+
+  if (dirp->current != INVALID_HANDLE_VALUE)
+    FindClose (dirp->current);
+  free (dirp);
+
+  retval = 0;
+
+#endif
+
+#if REPLACE_FCHDIR
+  if (retval >= 0)
+    _gl_unregister_fd (fd);
+#endif
+  return retval;
+}
index 077a3247d60ffa39e896dab2d718015919371d07..65f2cb9e98bc06faa49d69572d6952aa2b496fa1 100644 (file)
@@ -1,6 +1,6 @@
 /* Close standard input, rewinding seekable stdin if necessary.
 
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
@@ -55,7 +55,7 @@ close_stdin_set_file_name (const char *file)
    For example, POSIX requires that these two commands behave alike:
 
      (sed -ne 1q; cat) < file
-     tail -n 1 file
+     tail -n +2 file
 
    Since close_stdin is commonly registered via 'atexit', POSIX
    and the C standard both say that it should not call 'exit',
@@ -72,7 +72,7 @@ close_stdin_set_file_name (const char *file)
    the removal of these files.
 
    It's important to detect such failures and exit nonzero because many
-   tools (most notably `make' and other build-management systems) depend
+   tools (most notably 'make' and other build-management systems) depend
    on being able to detect failure in other tools via their exit status.  */
 
 void
@@ -82,7 +82,8 @@ close_stdin (void)
 
   /* There is no need to flush stdin if we can determine quickly that stdin's
      input buffer is empty; in this case we know that if stdin is seekable,
-     fseeko (stdin, 0, SEEK_CUR) == lseek (0, 0, SEEK_CUR).  */
+     (fseeko (stdin, 0, SEEK_CUR), ftello (stdin))
+     == lseek (0, 0, SEEK_CUR).  */
   if (freadahead (stdin) > 0)
     {
       /* Only attempt flush if stdin is seekable, as fflush is entitled to
index 20e97521b9eb4f89914956edc2c409592cbb4aa0..d838af9df043a7fe5ec9af2859bbc56cee1c0ddb 100644 (file)
@@ -1,6 +1,6 @@
 /* Close standard input, rewinding seekable stdin if necessary.
 
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
index 18a8912dfdbfd16b06e19a5f2ab40bf0a9a8440c..eea402473cb4718814b979b1db5c9c5ed12a28eb 100644 (file)
@@ -1,6 +1,6 @@
 /* Close standard output and standard error, exiting with a diagnostic on error.
 
-   Copyright (C) 1998-2002, 2004, 2006, 2008-2010 Free Software Foundation,
+   Copyright (C) 1998-2002, 2004, 2006, 2008-2012 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -100,7 +100,7 @@ close_stdout_set_ignore_EPIPE (bool ignore)
    can bypass the removal of these files.
 
    It's important to detect such failures and exit nonzero because many
-   tools (most notably `make' and other build-management systems) depend
+   tools (most notably 'make' and other build-management systems) depend
    on being able to detect failure in other tools via their exit status.  */
 
 void
index 475f95e652179736cd3fa7921856ec399774f24f..5310b28627173f0c54c92e6819c214613fb7ac39 100644 (file)
@@ -1,6 +1,6 @@
 /* Close standard output and standard error.
 
-   Copyright (C) 1998, 2000, 2003-2004, 2006, 2008-2010 Free Software
+   Copyright (C) 1998, 2000, 2003-2004, 2006, 2008-2012 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
index 2959df89bfce5019fb343199ac630d7695886a3e..89b3017b4ec53a5bf574875b2e7a701fe8fcbdb7 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Output a system dependent table of character encoding aliases.
 #
-#   Copyright (C) 2000-2004, 2006-2010 Free Software Foundation, Inc.
+#   Copyright (C) 2000-2004, 2006-2012 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
@@ -14,8 +14,7 @@
 #   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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#   with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # The table consists of lines of the form
 #    ALIAS  CANONICAL
 # The current list of GNU canonical charset names is as follows.
 #
 #       name              MIME?             used by which systems
-#   ASCII, ANSI_X3.4-1968       glibc solaris freebsd netbsd darwin
-#   ISO-8859-1              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
-#   ISO-8859-2              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
-#   ISO-8859-3              Y   glibc solaris
+#                                    (darwin = MacOS X, woe32 = native Windows)
+#
+#   ASCII, ANSI_X3.4-1968       glibc solaris freebsd netbsd darwin cygwin
+#   ISO-8859-1              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+#   ISO-8859-2              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+#   ISO-8859-3              Y   glibc solaris cygwin
 #   ISO-8859-4              Y   osf solaris freebsd netbsd openbsd darwin
-#   ISO-8859-5              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
-#   ISO-8859-6              Y   glibc aix hpux solaris
-#   ISO-8859-7              Y   glibc aix hpux irix osf solaris netbsd openbsd darwin
-#   ISO-8859-8              Y   glibc aix hpux osf solaris
-#   ISO-8859-9              Y   glibc aix hpux irix osf solaris darwin
-#   ISO-8859-13                 glibc netbsd openbsd darwin
-#   ISO-8859-14                 glibc
-#   ISO-8859-15                 glibc aix osf solaris freebsd netbsd openbsd darwin
+#   ISO-8859-5              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+#   ISO-8859-6              Y   glibc aix hpux solaris cygwin
+#   ISO-8859-7              Y   glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin
+#   ISO-8859-8              Y   glibc aix hpux osf solaris cygwin
+#   ISO-8859-9              Y   glibc aix hpux irix osf solaris darwin cygwin
+#   ISO-8859-13                 glibc netbsd openbsd darwin cygwin
+#   ISO-8859-14                 glibc cygwin
+#   ISO-8859-15                 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin
 #   KOI8-R                  Y   glibc solaris freebsd netbsd openbsd darwin
-#   KOI8-U                  Y   glibc freebsd netbsd openbsd darwin
+#   KOI8-U                  Y   glibc freebsd netbsd openbsd darwin cygwin
 #   KOI8-T                      glibc
 #   CP437                       dos
 #   CP775                       dos
@@ -61,7 +62,7 @@
 #   CP869                       dos
 #   CP874                       woe32 dos
 #   CP922                       aix
-#   CP932                       aix woe32 dos
+#   CP932                       aix cygwin woe32 dos
 #   CP943                       aix
 #   CP949                       osf darwin woe32 dos
 #   CP950                       woe32 dos
@@ -71,7 +72,7 @@
 #   CP1129                      aix
 #   CP1131                      darwin
 #   CP1250                      woe32
-#   CP1251                      glibc solaris netbsd openbsd darwin woe32
+#   CP1251                      glibc solaris netbsd openbsd darwin cygwin woe32
 #   CP1252                      aix woe32
 #   CP1253                      woe32
 #   CP1254                      woe32
 #   CP1257                      woe32
 #   GB2312                  Y   glibc aix hpux irix solaris freebsd netbsd darwin
 #   EUC-JP                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin
-#   EUC-KR                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin
+#   EUC-KR                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
 #   EUC-TW                      glibc aix hpux irix osf solaris netbsd
-#   BIG5                    Y   glibc aix hpux osf solaris freebsd netbsd darwin
+#   BIG5                    Y   glibc aix hpux osf solaris freebsd netbsd darwin cygwin
 #   BIG5-HKSCS                  glibc solaris darwin
-#   GBK                         glibc aix osf solaris darwin woe32 dos
+#   GBK                         glibc aix osf solaris darwin cygwin woe32 dos
 #   GB18030                     glibc solaris netbsd darwin
 #   SHIFT_JIS               Y   hpux osf solaris freebsd netbsd darwin
 #   JOHAB                       glibc solaris woe32
-#   TIS-620                     glibc aix hpux osf solaris
+#   TIS-620                     glibc aix hpux osf solaris cygwin
 #   VISCII                  Y   glibc
 #   TCVN5712-1                  glibc
 #   ARMSCII-8                   glibc darwin
-#   GEORGIAN-PS                 glibc
+#   GEORGIAN-PS                 glibc cygwin
 #   PT154                       glibc
 #   HP-ROMAN8                   hpux
 #   HP-ARABIC8                  hpux
 #   HP-KANA8                    hpux
 #   DEC-KANJI                   osf
 #   DEC-HANYU                   osf
-#   UTF-8                   Y   glibc aix hpux osf solaris netbsd darwin
+#   UTF-8                   Y   glibc aix hpux osf solaris netbsd darwin cygwin
 #
 # Note: Names which are not marked as being a MIME name should not be used in
 # Internet protocols for information interchange (mail, news, etc.).
index 6ada50e92dd53c01770d0419dea0f761528be0fc..55339bf60ace262b3980fe1dec0ee66bdcf191c0 100644 (file)
@@ -1,9 +1,5 @@
 /* lib/config.hin.  Generated from configure.ac by autoheader.  */
 
-/* Define if the compiler is building for multiple architectures of Apple
-   platforms at once. */
-#undef AA_APPLE_UNIVERSAL_BUILD
-
 /* Define if building universal (internal helper macro) */
 #undef AC_APPLE_UNIVERSAL_BUILD
 
    non-IEEE-754 'long double' values. */
 #undef CHECK_PRINTF_SAFE
 
-/* Define to 1 if chown fails to change ctime when at least one argument was
-   not -1. */
-#undef CHOWN_CHANGE_TIME_BUG
-
-/* Define if chown is not POSIX compliant regarding IDs of -1. */
-#undef CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE
-
-/* Define if chown modifies symlinks. */
-#undef CHOWN_MODIFIES_SYMLINK
-
-/* Define to 1 if chown mishandles trailing slash. */
-#undef CHOWN_TRAILING_SLASH_BUG
-
 /* 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.
    */
 /* Define to 1 if // is a file system root distinct from /. */
 #undef DOUBLE_SLASH_IS_DISTINCT_ROOT
 
-/* Define if struct dirent has a member d_ino that actually works. */
-#undef D_INO_IN_DIRENT
-
-/* Define to 1 if your platform has fchownat, but it cannot perform lchown
-   tasks. */
-#undef FCHOWNAT_NOFOLLOW_BUG
-
 /* Define this to 1 if F_DUPFD behavior does not match POSIX */
 #undef FCNTL_DUPFD_BUGGY
 
-/* Define on systems for which file names may have a so-called `drive letter'
-   prefix, define this to compute the length of that prefix, including the
-   colon. */
-#undef FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
-
-/* Define if the backslash character may also serve as a file name component
-   separator. */
-#undef FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
-
-/* Define if a drive letter prefix denotes a relative path if it is not
-   followed by a file name component separator. */
-#undef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
-
 /* Define as the bit index in the word where to find bit 0 of the exponent of
    'float'. */
 #undef FLT_EXPBIT0_BIT
 /* Define as the word index where to find the sign of 'float'. */
 #undef FLT_SIGNBIT_WORD
 
-/* Define to 1 if mkdir mistakenly creates a directory given with a trailing
-   dot component. */
-#undef FUNC_MKDIR_DOT_BUG
+/* Define to 1 if the system's ftello function has the Solaris bug. */
+#undef FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE
 
 /* Define to 1 if futimesat mishandles a NULL file name. */
 #undef FUTIMESAT_NULL_BUG
 /* Define if gettimeofday clobbers the localtime buffer. */
 #undef GETTIMEOFDAY_CLOBBERS_LOCALTIME
 
-/* Define to 1 when using the gnulib module close-stream. */
+/* Define this to 'void' or 'struct timezone' to match the system's
+   declaration of the second argument to gettimeofday. */
+#undef GETTIMEOFDAY_TIMEZONE
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module calloc-gnu shall be considered present. */
+#undef GNULIB_CALLOC_GNU
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module close-stream shall be considered present. */
 #undef GNULIB_CLOSE_STREAM
 
-/* Define to 1 when using the gnulib module fcntl-safer. */
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module dirent-safer shall be considered present. */
+#undef GNULIB_DIRENT_SAFER
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module fcntl-safer shall be considered present. */
 #undef GNULIB_FCNTL_SAFER
 
-/* Define to 1 when using the gnulib module getopt-gnu. */
-#undef GNULIB_GETOPT_GNU
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module fdopendir shall be considered present. */
+#undef GNULIB_FDOPENDIR
 
-/* Define to indicate the 'malloc' module. */
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module fflush shall be considered present. */
+#undef GNULIB_FFLUSH
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module malloc-gnu shall be considered present. */
 #undef GNULIB_MALLOC_GNU
 
-/* Define to 1 when using the gnulib module open. */
-#undef GNULIB_OPEN
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module openat shall be considered present. */
+#undef GNULIB_OPENAT
 
 /* enable some gnulib portability checks */
 #undef GNULIB_PORTCHECK
 
-/* Define to indicate the 'realloc' module. */
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module realloc-gnu shall be considered present. */
 #undef GNULIB_REALLOC_GNU
 
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module strerror shall be considered present. */
+#undef GNULIB_STRERROR
+
+/* Define to 1 when the gnulib module calloc-posix should be tested. */
+#undef GNULIB_TEST_CALLOC_POSIX
+
+/* Define to 1 when the gnulib module chdir should be tested. */
+#undef GNULIB_TEST_CHDIR
+
+/* Define to 1 when the gnulib module cloexec should be tested. */
+#undef GNULIB_TEST_CLOEXEC
+
+/* Define to 1 when the gnulib module close should be tested. */
+#undef GNULIB_TEST_CLOSE
+
+/* Define to 1 when the gnulib module closedir should be tested. */
+#undef GNULIB_TEST_CLOSEDIR
+
+/* Define to 1 when the gnulib module dirfd should be tested. */
+#undef GNULIB_TEST_DIRFD
+
+/* Define to 1 when the gnulib module dup should be tested. */
+#undef GNULIB_TEST_DUP
+
+/* Define to 1 when the gnulib module dup2 should be tested. */
+#undef GNULIB_TEST_DUP2
+
+/* Define to 1 when the gnulib module fchdir should be tested. */
+#undef GNULIB_TEST_FCHDIR
+
+/* Define to 1 when the gnulib module fclose should be tested. */
+#undef GNULIB_TEST_FCLOSE
+
+/* Define to 1 when the gnulib module fcntl should be tested. */
+#undef GNULIB_TEST_FCNTL
+
+/* Define to 1 when the gnulib module fdopendir should be tested. */
+#undef GNULIB_TEST_FDOPENDIR
+
+/* Define to 1 when the gnulib module fflush should be tested. */
+#undef GNULIB_TEST_FFLUSH
+
+/* Define to 1 when the gnulib module fprintf-posix should be tested. */
+#undef GNULIB_TEST_FPRINTF_POSIX
+
+/* Define to 1 when the gnulib module fpurge should be tested. */
+#undef GNULIB_TEST_FPURGE
+
+/* Define to 1 when the gnulib module frexp should be tested. */
+#undef GNULIB_TEST_FREXP
+
+/* Define to 1 when the gnulib module frexpl should be tested. */
+#undef GNULIB_TEST_FREXPL
+
+/* Define to 1 when the gnulib module fseek should be tested. */
+#undef GNULIB_TEST_FSEEK
+
+/* Define to 1 when the gnulib module fseeko should be tested. */
+#undef GNULIB_TEST_FSEEKO
+
+/* Define to 1 when the gnulib module fstat should be tested. */
+#undef GNULIB_TEST_FSTAT
+
+/* Define to 1 when the gnulib module ftell should be tested. */
+#undef GNULIB_TEST_FTELL
+
+/* Define to 1 when the gnulib module ftello should be tested. */
+#undef GNULIB_TEST_FTELLO
+
+/* Define to 1 when the gnulib module getcwd should be tested. */
+#undef GNULIB_TEST_GETCWD
+
+/* Define to 1 when the gnulib module getdtablesize should be tested. */
+#undef GNULIB_TEST_GETDTABLESIZE
+
+/* Define to 1 when the gnulib module getopt-gnu should be tested. */
+#undef GNULIB_TEST_GETOPT_GNU
+
+/* Define to 1 when the gnulib module gettimeofday should be tested. */
+#undef GNULIB_TEST_GETTIMEOFDAY
+
+/* Define to 1 when the gnulib module lseek should be tested. */
+#undef GNULIB_TEST_LSEEK
+
+/* Define to 1 when the gnulib module lstat should be tested. */
+#undef GNULIB_TEST_LSTAT
+
+/* Define to 1 when the gnulib module malloc-posix should be tested. */
+#undef GNULIB_TEST_MALLOC_POSIX
+
+/* Define to 1 when the gnulib module mbrtowc should be tested. */
+#undef GNULIB_TEST_MBRTOWC
+
+/* Define to 1 when the gnulib module mbsinit should be tested. */
+#undef GNULIB_TEST_MBSINIT
+
+/* Define to 1 when the gnulib module memchr should be tested. */
+#undef GNULIB_TEST_MEMCHR
+
+/* Define to 1 when the gnulib module mempcpy should be tested. */
+#undef GNULIB_TEST_MEMPCPY
+
+/* Define to 1 when the gnulib module memrchr should be tested. */
+#undef GNULIB_TEST_MEMRCHR
+
+/* Define to 1 when the gnulib module open should be tested. */
+#undef GNULIB_TEST_OPEN
+
+/* Define to 1 when the gnulib module openat should be tested. */
+#undef GNULIB_TEST_OPENAT
+
+/* Define to 1 when the gnulib module opendir should be tested. */
+#undef GNULIB_TEST_OPENDIR
+
+/* Define to 1 when the gnulib module perror should be tested. */
+#undef GNULIB_TEST_PERROR
+
+/* Define to 1 when the gnulib module printf-posix should be tested. */
+#undef GNULIB_TEST_PRINTF_POSIX
+
+/* Define to 1 when the gnulib module readdir should be tested. */
+#undef GNULIB_TEST_READDIR
+
+/* Define to 1 when the gnulib module realloc-posix should be tested. */
+#undef GNULIB_TEST_REALLOC_POSIX
+
+/* Define to 1 when the gnulib module signbit should be tested. */
+#undef GNULIB_TEST_SIGNBIT
+
+/* Define to 1 when the gnulib module stat should be tested. */
+#undef GNULIB_TEST_STAT
+
+/* Define to 1 when the gnulib module strdup should be tested. */
+#undef GNULIB_TEST_STRDUP
+
+/* Define to 1 when the gnulib module strerror should be tested. */
+#undef GNULIB_TEST_STRERROR
+
+/* Define to 1 when the gnulib module strerror_r should be tested. */
+#undef GNULIB_TEST_STRERROR_R
+
+/* Define to 1 when the gnulib module vfprintf-posix should be tested. */
+#undef GNULIB_TEST_VFPRINTF_POSIX
+
+/* Define to 1 if you have the `alarm' function. */
+#undef HAVE_ALARM
+
 /* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
    may be supplied by this distribution. */
 #undef HAVE_ALLOCA
 /* Define to 1 if you have the <bp-sym.h> header file. */
 #undef HAVE_BP_SYM_H
 
-/* Define to 1 if your system has a GNU libc compatible `calloc' function, and
+/* Define to 1 if your system has a GNU libc compatible 'calloc' function, and
    to 0 otherwise. */
-#undef HAVE_CALLOC
+#undef HAVE_CALLOC_GNU
 
 /* Define if the 'calloc' function is POSIX compliant. */
 #undef HAVE_CALLOC_POSIX
 
+/* Define to 1 if you have the `catgets' function. */
+#undef HAVE_CATGETS
+
 /* Define to 1 if you have the `chown' function. */
 #undef HAVE_CHOWN
 
 /* Define to 1 if you have the `clock_settime' function. */
 #undef HAVE_CLOCK_SETTIME
 
+/* Define to 1 if you have the `closedir' function. */
+#undef HAVE_CLOSEDIR
+
 /* Define if the copysignf function is declared in <math.h> and available in
    libc. */
 #undef HAVE_COPYSIGNF_IN_LIBC
    */
 #undef HAVE_DECL_DIRFD
 
+/* Define to 1 if you have the declaration of `fchdir', and to 0 if you don't.
+   */
+#undef HAVE_DECL_FCHDIR
+
+/* Define to 1 if you have the declaration of `fdopendir', and to 0 if you
+   don't. */
+#undef HAVE_DECL_FDOPENDIR
+
 /* Define to 1 if you have the declaration of `fpurge', and to 0 if you don't.
    */
 #undef HAVE_DECL_FPURGE
 
-/* Define to 1 if you have the declaration of `getcwd', and to 0 if you don't.
+/* Define to 1 if you have the declaration of `fseeko', and to 0 if you don't.
+   */
+#undef HAVE_DECL_FSEEKO
+
+/* Define to 1 if you have the declaration of `ftello', and to 0 if you don't.
    */
-#undef HAVE_DECL_GETCWD
+#undef HAVE_DECL_FTELLO
 
 /* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
    don't. */
    */
 #undef HAVE_DECL_GETENV
 
-/* Define to 1 if you have the declaration of `memrchr', and to 0 if you
+/* Define to 1 if you have the declaration of `mbrtowc', and to 0 if you
    don't. */
-#undef HAVE_DECL_MEMRCHR
+#undef HAVE_DECL_MBRTOWC
 
-/* Define to 1 if you have the declaration of `optreset', and to 0 if you
+/* Define to 1 if you have the declaration of `mbsinit', and to 0 if you
    don't. */
-#undef HAVE_DECL_OPTRESET
+#undef HAVE_DECL_MBSINIT
+
+/* Define to 1 if you have the declaration of `memrchr', and to 0 if you
+   don't. */
+#undef HAVE_DECL_MEMRCHR
 
 /* Define to 1 if you have the declaration of `strdup', and to 0 if you don't.
    */
 #undef HAVE_DECL_STRDUP
 
-/* Define to 1 if you have the declaration of `strerror', and to 0 if you
-   don't. */
-#undef HAVE_DECL_STRERROR
-
 /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
    don't. */
 #undef HAVE_DECL_STRERROR_R
 
+/* Define to 1 if you have the declaration of `towlower', and to 0 if you
+   don't. */
+#undef HAVE_DECL_TOWLOWER
+
 /* Define to 1 if you have the declaration of `_snprintf', and to 0 if you
    don't. */
 #undef HAVE_DECL__SNPRINTF
 /* Define to 1 if you have the `dirfd' function. */
 #undef HAVE_DIRFD
 
-/* Define to 1 if you have the `dup2' function. */
+/* Define to 1 if you have the 'dup2' function. */
 #undef HAVE_DUP2
 
-/* Define to 1 if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
-
 /* Define to 1 if you have the `fchdir' function. */
 #undef HAVE_FCHDIR
 
 /* Define to 1 if you have the `fchmod' function. */
 #undef HAVE_FCHMOD
 
-/* Define to 1 if you have the `fchmodat' function. */
-#undef HAVE_FCHMODAT
-
 /* Define to 1 if you have the `fchown' function. */
 #undef HAVE_FCHOWN
 
 /* Define to 1 if you have the `fdopendir' function. */
 #undef HAVE_FDOPENDIR
 
-/* Define to 1 if you have the <float.h> header file. */
-#undef HAVE_FLOAT_H
+/* Define to 1 if you have the <features.h> header file. */
+#undef HAVE_FEATURES_H
 
 /* Define to 1 if you have the `fpurge' function. */
 #undef HAVE_FPURGE
 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
 #undef HAVE_FSEEKO
 
-/* Define to 1 if you have the `fstatat' function. */
-#undef HAVE_FSTATAT
-
 /* Define to 1 if you have the `futimens' function. */
 #undef HAVE_FUTIMENS
 
 /* Define to 1 if you have the `futimesat' function. */
 #undef HAVE_FUTIMESAT
 
+/* Define to 1 if you have the `getdtablesize' function. */
+#undef HAVE_GETDTABLESIZE
+
 /* Define to 1 if you have the <getopt.h> header file. */
 #undef HAVE_GETOPT_H
 
 /* Define to 1 if you have the `getopt_long_only' function. */
 #undef HAVE_GETOPT_LONG_ONLY
 
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
 /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
 #undef HAVE_LANGINFO_CODESET
 
-/* Define to 1 if you have the `lchmod' function. */
-#undef HAVE_LCHMOD
-
-/* Define to 1 if you have the `lchown' function. */
-#undef HAVE_LCHOWN
-
 /* Define if the ldexpl function is available in libc. */
 #undef HAVE_LDEXPL_IN_LIBC
 
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
-/* Define to 1 if the system has the type `long long int'. */
+/* Define to 1 if the system has the type 'long long int'. */
 #undef HAVE_LONG_LONG_INT
 
 /* Define to 1 if you have the `lstat' function. */
 /* Define to 1 if you have the `lutimes' function. */
 #undef HAVE_LUTIMES
 
-/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+/* Define to 1 if your system has a GNU libc compatible 'malloc' function, and
    to 0 otherwise. */
-#undef HAVE_MALLOC
+#undef HAVE_MALLOC_GNU
 
 /* Define if the 'malloc' function is POSIX compliant. */
 #undef HAVE_MALLOC_POSIX
 /* Define to 1 if <wchar.h> declares mbstate_t. */
 #undef HAVE_MBSTATE_T
 
-/* Define to 1 if you have the `memchr' function. */
-#undef HAVE_MEMCHR
-
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
 /* Define to 1 if you have the `memrchr' function. */
 #undef HAVE_MEMRCHR
 
-/* Define to 1 if you have the `mkdirat' function. */
-#undef HAVE_MKDIRAT
-
 /* Define to 1 if you have the `mprotect' function. */
 #undef HAVE_MPROTECT
 
+/* Define to 1 on MSVC platforms that have the "invalid parameter handler"
+   concept. */
+#undef HAVE_MSVC_INVALID_PARAMETER_HANDLER
+
 /* Define to 1 if you have the `nanotime' function. */
 #undef HAVE_NANOTIME
 
 /* Define to 1 if you have the `openat' function. */
 #undef HAVE_OPENAT
 
-/* Define to 1 if getcwd works, except it sometimes fails when it shouldn't,
-   setting errno to ERANGE, ENAMETOOLONG, or ENOENT. If __GETCWD_PREFIX is not
-   defined, it doesn't matter whether HAVE_PARTLY_WORKING_GETCWD is defined.
-   */
-#undef HAVE_PARTLY_WORKING_GETCWD
+/* Define to 1 if you have the `opendir' function. */
+#undef HAVE_OPENDIR
 
 /* Define to 1 if you have the `pipe' function. */
 #undef HAVE_PIPE
 
-/* Define to 1 if you have the <random.h> header file. */
-#undef HAVE_RANDOM_H
+/* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */
+#undef HAVE_PTHREAD_MUTEX_RECURSIVE
+
+/* Define if the POSIX multithreading library has read/write locks. */
+#undef HAVE_PTHREAD_RWLOCK
+
+/* Define to 1 if acosf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ACOSF
+
+/* Define to 1 if acosl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ACOSL
+
+/* Define to 1 if alphasort is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ALPHASORT
+
+/* Define to 1 if asinf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ASINF
+
+/* Define to 1 if asinl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ASINL
+
+/* Define to 1 if atanf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ATANF
+
+/* Define to 1 if atanl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ATANL
+
+/* Define to 1 if atoll is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ATOLL
+
+/* Define to 1 if btowc is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_BTOWC
+
+/* Define to 1 if canonicalize_file_name is declared even after undefining
+   macros. */
+#undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
+
+/* Define to 1 if cbrt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CBRT
+
+/* Define to 1 if cbrtf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CBRTF
+
+/* Define to 1 if cbrtl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CBRTL
+
+/* Define to 1 if ceilf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CEILF
+
+/* Define to 1 if ceill is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CEILL
+
+/* Define to 1 if chdir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CHDIR
+
+/* Define to 1 if chown is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CHOWN
+
+/* Define to 1 if closedir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_CLOSEDIR
+
+/* Define to 1 if copysign is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_COPYSIGN
+
+/* Define to 1 if copysignf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_COPYSIGNF
+
+/* Define to 1 if copysignl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_COPYSIGNL
+
+/* Define to 1 if cosf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_COSF
+
+/* Define to 1 if coshf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_COSHF
+
+/* Define to 1 if cosl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_COSL
+
+/* Define to 1 if dirfd is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DIRFD
+
+/* Define to 1 if dprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DPRINTF
+
+/* Define to 1 if dup is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DUP
+
+/* Define to 1 if dup2 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DUP2
+
+/* Define to 1 if dup3 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_DUP3
+
+/* Define to 1 if endusershell is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ENDUSERSHELL
 
 /* Define to 1 if environ is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_ENVIRON
 
+/* Define to 1 if euidaccess is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_EUIDACCESS
+
+/* Define to 1 if exp2 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_EXP2
+
+/* Define to 1 if exp2f is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_EXP2F
+
+/* Define to 1 if exp2l is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_EXP2L
+
+/* Define to 1 if expf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_EXPF
+
+/* Define to 1 if expl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_EXPL
+
+/* Define to 1 if expm1 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_EXPM1
+
+/* Define to 1 if expm1f is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_EXPM1F
+
+/* Define to 1 if expm1l is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_EXPM1L
+
+/* Define to 1 if fabsf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FABSF
+
+/* Define to 1 if fabsl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FABSL
+
+/* Define to 1 if faccessat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FACCESSAT
+
+/* Define to 1 if fchdir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FCHDIR
+
+/* Define to 1 if fchmodat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FCHMODAT
+
+/* Define to 1 if fchownat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FCHOWNAT
+
+/* Define to 1 if fcntl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FCNTL
+
+/* Define to 1 if fdatasync is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FDATASYNC
+
+/* Define to 1 if fdopendir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FDOPENDIR
+
+/* Define to 1 if ffsl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FFSL
+
+/* Define to 1 if ffsll is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FFSLL
+
+/* Define to 1 if floorf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FLOORF
+
+/* Define to 1 if floorl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FLOORL
+
+/* Define to 1 if fma is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FMA
+
+/* Define to 1 if fmaf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FMAF
+
+/* Define to 1 if fmal is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FMAL
+
+/* Define to 1 if fmod is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FMOD
+
+/* Define to 1 if fmodf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FMODF
+
+/* Define to 1 if fmodl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FMODL
+
+/* Define to 1 if fpurge is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FPURGE
+
+/* Define to 1 if frexpf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FREXPF
+
+/* Define to 1 if frexpl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FREXPL
+
 /* Define to 1 if fseeko is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_FSEEKO
 
+/* Define to 1 if fstat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FSTAT
+
+/* Define to 1 if fstatat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FSTATAT
+
+/* Define to 1 if fsync is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FSYNC
+
 /* Define to 1 if ftello is declared even after undefining macros. */
 #undef HAVE_RAW_DECL_FTELLO
 
-/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+/* Define to 1 if ftruncate is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FTRUNCATE
+
+/* Define to 1 if futimens is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_FUTIMENS
+
+/* Define to 1 if getcwd is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETCWD
+
+/* Define to 1 if getdelim is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETDELIM
+
+/* Define to 1 if getdomainname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETDOMAINNAME
+
+/* Define to 1 if getdtablesize is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETDTABLESIZE
+
+/* Define to 1 if getgroups is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETGROUPS
+
+/* Define to 1 if gethostname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETHOSTNAME
+
+/* Define to 1 if getline is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLINE
+
+/* Define to 1 if getloadavg is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLOADAVG
+
+/* Define to 1 if getlogin is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLOGIN
+
+/* Define to 1 if getlogin_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETLOGIN_R
+
+/* Define to 1 if getpagesize is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETPAGESIZE
+
+/* Define to 1 if gets is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETS
+
+/* Define to 1 if getsubopt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETSUBOPT
+
+/* Define to 1 if gettimeofday is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETTIMEOFDAY
+
+/* Define to 1 if getusershell is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GETUSERSHELL
+
+/* Define to 1 if grantpt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GRANTPT
+
+/* Define to 1 if group_member is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_GROUP_MEMBER
+
+/* Define to 1 if hypotf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_HYPOTF
+
+/* Define to 1 if hypotl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_HYPOTL
+
+/* Define to 1 if ilogb is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ILOGB
+
+/* Define to 1 if ilogbf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ILOGBF
+
+/* Define to 1 if ilogbl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ILOGBL
+
+/* Define to 1 if initstate is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_INITSTATE
+
+/* Define to 1 if initstate_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_INITSTATE_R
+
+/* Define to 1 if isatty is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ISATTY
+
+/* Define to 1 if iswctype is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ISWCTYPE
+
+/* Define to 1 if lchmod is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LCHMOD
+
+/* Define to 1 if lchown is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LCHOWN
+
+/* Define to 1 if ldexpf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LDEXPF
+
+/* Define to 1 if ldexpl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LDEXPL
+
+/* Define to 1 if link is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LINK
+
+/* Define to 1 if linkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LINKAT
+
+/* Define to 1 if log is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOG
+
+/* Define to 1 if log10 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOG10
+
+/* Define to 1 if log10f is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOG10F
+
+/* Define to 1 if log10l is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOG10L
+
+/* Define to 1 if log1p is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOG1P
+
+/* Define to 1 if log1pf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOG1PF
+
+/* Define to 1 if log1pl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOG1PL
+
+/* Define to 1 if log2 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOG2
+
+/* Define to 1 if log2f is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOG2F
+
+/* Define to 1 if log2l is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOG2L
+
+/* Define to 1 if logb is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOGB
+
+/* Define to 1 if logbf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOGBF
+
+/* Define to 1 if logbl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOGBL
+
+/* Define to 1 if logf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOGF
+
+/* Define to 1 if logl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LOGL
+
+/* Define to 1 if lseek is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LSEEK
+
+/* Define to 1 if lstat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_LSTAT
+
+/* Define to 1 if mbrlen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBRLEN
+
+/* Define to 1 if mbrtowc is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBRTOWC
+
+/* Define to 1 if mbsinit is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBSINIT
+
+/* Define to 1 if mbsnrtowcs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBSNRTOWCS
+
+/* Define to 1 if mbsrtowcs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MBSRTOWCS
+
+/* Define to 1 if memmem is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MEMMEM
+
+/* Define to 1 if mempcpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MEMPCPY
+
+/* Define to 1 if memrchr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MEMRCHR
+
+/* Define to 1 if mkdirat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKDIRAT
+
+/* Define to 1 if mkdtemp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKDTEMP
+
+/* Define to 1 if mkfifo is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKFIFO
+
+/* Define to 1 if mkfifoat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKFIFOAT
+
+/* Define to 1 if mknod is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKNOD
+
+/* Define to 1 if mknodat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKNODAT
+
+/* Define to 1 if mkostemp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKOSTEMP
+
+/* Define to 1 if mkostemps is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKOSTEMPS
+
+/* Define to 1 if mkstemp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKSTEMP
+
+/* Define to 1 if mkstemps is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MKSTEMPS
+
+/* Define to 1 if modf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MODF
+
+/* Define to 1 if modff is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MODFF
+
+/* Define to 1 if modfl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_MODFL
+
+/* Define to 1 if openat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_OPENAT
+
+/* Define to 1 if opendir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_OPENDIR
+
+/* Define to 1 if pclose is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PCLOSE
+
+/* Define to 1 if pipe is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PIPE
+
+/* Define to 1 if pipe2 is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PIPE2
+
+/* Define to 1 if popen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_POPEN
+
+/* Define to 1 if posix_openpt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_POSIX_OPENPT
+
+/* Define to 1 if powf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_POWF
+
+/* Define to 1 if pread is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PREAD
+
+/* Define to 1 if ptsname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PTSNAME
+
+/* Define to 1 if ptsname_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PTSNAME_R
+
+/* Define to 1 if pwrite is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PWRITE
+
+/* Define to 1 if random is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RANDOM
+
+/* Define to 1 if random_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RANDOM_R
+
+/* Define to 1 if rawmemchr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RAWMEMCHR
+
+/* Define to 1 if readdir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_READDIR
+
+/* Define to 1 if readlink is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_READLINK
+
+/* Define to 1 if readlinkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_READLINKAT
+
+/* Define to 1 if realpath is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_REALPATH
+
+/* Define to 1 if remainder is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_REMAINDER
+
+/* Define to 1 if remainderf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_REMAINDERF
+
+/* Define to 1 if remainderl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_REMAINDERL
+
+/* Define to 1 if renameat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RENAMEAT
+
+/* Define to 1 if rewinddir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_REWINDDIR
+
+/* Define to 1 if rint is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RINT
+
+/* Define to 1 if rintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RINTF
+
+/* Define to 1 if rintl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RINTL
+
+/* Define to 1 if rmdir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RMDIR
+
+/* Define to 1 if round is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ROUND
+
+/* Define to 1 if roundf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ROUNDF
+
+/* Define to 1 if roundl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_ROUNDL
+
+/* Define to 1 if rpmatch is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_RPMATCH
+
+/* Define to 1 if scandir is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SCANDIR
+
+/* Define to 1 if setenv is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETENV
+
+/* Define to 1 if sethostname is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETHOSTNAME
+
+/* Define to 1 if setstate is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETSTATE
+
+/* Define to 1 if setstate_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETSTATE_R
+
+/* Define to 1 if setusershell is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SETUSERSHELL
+
+/* Define to 1 if sinf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SINF
+
+/* Define to 1 if sinhf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SINHF
+
+/* Define to 1 if sinl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SINL
+
+/* Define to 1 if sleep is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SLEEP
+
+/* Define to 1 if snprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SNPRINTF
+
+/* Define to 1 if sqrtf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SQRTF
+
+/* Define to 1 if sqrtl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SQRTL
+
+/* Define to 1 if srandom is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SRANDOM
+
+/* Define to 1 if srandom_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SRANDOM_R
+
+/* Define to 1 if stat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STAT
+
+/* Define to 1 if stpcpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STPCPY
+
+/* Define to 1 if stpncpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STPNCPY
+
+/* Define to 1 if strcasestr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRCASESTR
+
+/* Define to 1 if strchrnul is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRCHRNUL
+
+/* Define to 1 if strdup is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRDUP
+
+/* Define to 1 if strerror_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRERROR_R
+
+/* Define to 1 if strncat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRNCAT
+
+/* Define to 1 if strndup is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRNDUP
+
+/* Define to 1 if strnlen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRNLEN
+
+/* Define to 1 if strpbrk is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRPBRK
+
+/* Define to 1 if strsep is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRSEP
+
+/* Define to 1 if strsignal is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRSIGNAL
+
+/* Define to 1 if strtod is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOD
+
+/* Define to 1 if strtok_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOK_R
+
+/* Define to 1 if strtoll is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOLL
+
+/* Define to 1 if strtoull is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRTOULL
+
+/* Define to 1 if strverscmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_STRVERSCMP
+
+/* Define to 1 if symlink is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SYMLINK
+
+/* Define to 1 if symlinkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_SYMLINKAT
+
+/* Define to 1 if tanf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TANF
+
+/* Define to 1 if tanhf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TANHF
+
+/* Define to 1 if tanl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TANL
+
+/* Define to 1 if tmpfile is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TMPFILE
+
+/* Define to 1 if towctrans is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TOWCTRANS
+
+/* Define to 1 if trunc is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TRUNC
+
+/* Define to 1 if truncf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TRUNCF
+
+/* Define to 1 if truncl is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TRUNCL
+
+/* Define to 1 if ttyname_r is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_TTYNAME_R
+
+/* Define to 1 if unlink is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNLINK
+
+/* Define to 1 if unlinkat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNLINKAT
+
+/* Define to 1 if unlockpt is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNLOCKPT
+
+/* Define to 1 if unsetenv is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UNSETENV
+
+/* Define to 1 if usleep is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_USLEEP
+
+/* Define to 1 if utimensat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_UTIMENSAT
+
+/* Define to 1 if vdprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_VDPRINTF
+
+/* Define to 1 if vsnprintf is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_VSNPRINTF
+
+/* Define to 1 if wcpcpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCPCPY
+
+/* Define to 1 if wcpncpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCPNCPY
+
+/* Define to 1 if wcrtomb is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCRTOMB
+
+/* Define to 1 if wcscasecmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCASECMP
+
+/* Define to 1 if wcscat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCAT
+
+/* Define to 1 if wcschr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCHR
+
+/* Define to 1 if wcscmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCMP
+
+/* Define to 1 if wcscoll is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCOLL
+
+/* Define to 1 if wcscpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCPY
+
+/* Define to 1 if wcscspn is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSCSPN
+
+/* Define to 1 if wcsdup is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSDUP
+
+/* Define to 1 if wcslen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSLEN
+
+/* Define to 1 if wcsncasecmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNCASECMP
+
+/* Define to 1 if wcsncat is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNCAT
+
+/* Define to 1 if wcsncmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNCMP
+
+/* Define to 1 if wcsncpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNCPY
+
+/* Define to 1 if wcsnlen is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNLEN
+
+/* Define to 1 if wcsnrtombs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSNRTOMBS
+
+/* Define to 1 if wcspbrk is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSPBRK
+
+/* Define to 1 if wcsrchr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSRCHR
+
+/* Define to 1 if wcsrtombs is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSRTOMBS
+
+/* Define to 1 if wcsspn is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSSPN
+
+/* Define to 1 if wcsstr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSSTR
+
+/* Define to 1 if wcstok is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSTOK
+
+/* Define to 1 if wcswidth is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSWIDTH
+
+/* Define to 1 if wcsxfrm is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCSXFRM
+
+/* Define to 1 if wctob is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCTOB
+
+/* Define to 1 if wctrans is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCTRANS
+
+/* Define to 1 if wctype is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCTYPE
+
+/* Define to 1 if wcwidth is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WCWIDTH
+
+/* Define to 1 if wmemchr is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WMEMCHR
+
+/* Define to 1 if wmemcmp is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WMEMCMP
+
+/* Define to 1 if wmemcpy is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WMEMCPY
+
+/* Define to 1 if wmemmove is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WMEMMOVE
+
+/* Define to 1 if wmemset is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_WMEMSET
+
+/* Define to 1 if _Exit is declared even after undefining macros. */
+#undef HAVE_RAW_DECL__EXIT
+
+/* Define to 1 if you have the `readdir' function. */
+#undef HAVE_READDIR
+
+/* Define to 1 if your system has a GNU libc compatible 'realloc' function,
    and to 0 otherwise. */
-#undef HAVE_REALLOC
+#undef HAVE_REALLOC_GNU
 
 /* Define if the 'realloc' function is POSIX compliant. */
 #undef HAVE_REALLOC_POSIX
 
-/* Define to 1 if you have the `rmdir' function. */
-#undef HAVE_RMDIR
+/* Define to 1 if 'long double' and 'double' have the same representation. */
+#undef HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
 
 /* Define to 1 if you have the `siginterrupt' function. */
 #undef HAVE_SIGINTERRUPT
 /* Define to 1 if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
-/* Define to 1 if stdbool.h conforms to C99. */
-#undef HAVE_STDBOOL_H
-
-/* Define to 1 if you have the <stddef.h> header file. */
-#undef HAVE_STDDEF_H
+/* Define if the return value of the snprintf function is the number of of
+   bytes (excluding the terminating NUL) that would have been produced if the
+   buffer had been large enough. */
+#undef HAVE_SNPRINTF_RETVAL_C99
 
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 /* Define to 1 if you have the <stdio_ext.h> header file. */
 #undef HAVE_STDIO_EXT_H
 
-/* Define to 1 if you have the <stdio.h> header file. */
-#undef HAVE_STDIO_H
-
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
 /* Define to 1 if you have the `strnlen' function. */
 #undef HAVE_STRNLEN
 
-/* Define to 1 if the system has the type `struct random_data'. */
-#undef HAVE_STRUCT_RANDOM_DATA
-
 /* Define to 1 if `st_atimensec' is a member of `struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_ATIMENSEC
 
    have utime.h but don't declare the struct anywhere. */
 #undef HAVE_STRUCT_UTIMBUF
 
+/* Define to 1 if you have the `symlink' function. */
+#undef HAVE_SYMLINK
+
 /* Define to 1 if you have the <sys/bitypes.h> header file. */
 #undef HAVE_SYS_BITYPES_H
 
    */
 #undef HAVE_SYS_NDIR_H
 
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
 /* Define to 1 if you have the <sys/socket.h> header file. */
 #undef HAVE_SYS_SOCKET_H
 
 /* Define to 1 if you have the <time.h> header file. */
 #undef HAVE_TIME_H
 
+/* Define to 1 if you have the `towlower' function. */
+#undef HAVE_TOWLOWER
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
-/* Define to 1 if you have the `unlinkat' function. */
-#undef HAVE_UNLINKAT
-
-/* Define to 1 if the system has the type `unsigned long long int'. */
+/* Define to 1 if the system has the type 'unsigned long long int'. */
 #undef HAVE_UNSIGNED_LONG_LONG_INT
 
 /* Define to 1 if you have the `utimensat' function. */
 /* Define to 1 if the system has the type `_Bool'. */
 #undef HAVE__BOOL
 
+/* Define to 1 if you have the `_fseeki64' function. */
+#undef HAVE__FSEEKI64
+
+/* Define to 1 if you have the `_ftelli64' function. */
+#undef HAVE__FTELLI64
+
 /* Define to 1 if you have the `_ftime' function. */
 #undef HAVE__FTIME
 
+/* Define to 1 if you have the `_set_invalid_parameter_handler' function. */
+#undef HAVE__SET_INVALID_PARAMETER_HANDLER
+
 /* Define to 1 if you have the `__fpending' function. */
 #undef HAVE___FPENDING
 
 /* Define to 1 if you have the `__freading' function. */
 #undef HAVE___FREADING
 
-#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-#else
-# define ISSLASH(C) ((C) == '/')
-#endif
+/* Define to 1 if you have the `__xpg_strerror_r' function. */
+#undef HAVE___XPG_STRERROR_R
 
 /* Define as the bit index in the word where to find bit 0 of the exponent of
    'long double'. */
 /* Define to 1 if lseek does not detect pipes. */
 #undef LSEEK_PIPE_BROKEN
 
-/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+/* Define to 1 if 'lstat' dereferences a symlink specified with a trailing
    slash. */
 #undef LSTAT_FOLLOWS_SLASHED_SYMLINK
 
 /* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */
 #undef MAP_ANONYMOUS
 
+/* Define if the mbrtowc function has the NULL pwc argument bug. */
+#undef MBRTOWC_NULL_ARG1_BUG
+
 /* Define if the mbrtowc function has the NULL string argument bug. */
-#undef MBRTOWC_NULL_ARG_BUG
+#undef MBRTOWC_NULL_ARG2_BUG
 
 /* Define if the mbrtowc function does not return 0 for a NUL character. */
 #undef MBRTOWC_NUL_RETVAL_BUG
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* the number of pending output bytes on stream `fp' */
+/* the number of pending output bytes on stream 'fp' */
 #undef PENDING_OUTPUT_N_BYTES
 
 /* Define to the type that is the result of default argument promotions of
    type mode_t. */
 #undef PROMOTED_MODE_T
 
+/* Define if the pthread_in_use() detection is hard. */
+#undef PTHREAD_IN_USE_DETECTION_HARD
+
 /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
    'ptrdiff_t'. */
 #undef PTRDIFF_T_SUFFIX
    */
 #undef REPLACE_PRINTF_POSIX
 
-/* Define this to 1 if strerror is broken. */
-#undef REPLACE_STRERROR
+/* Define to 1 if strerror(0) does not return a message implying success. */
+#undef REPLACE_STRERROR_0
 
 /* Define if vasnprintf exists but is overridden by gnulib. */
 #undef REPLACE_VASNPRINTF
    timespec. */
 #undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
 
+/* Define to the prefix of C symbols at the assembler and linker level, either
+   an underscore or empty. */
+#undef USER_LABEL_PREFIX
+
+/* Define if the POSIX multithreading library can be used. */
+#undef USE_POSIX_THREADS
+
+/* Define if references to the POSIX multithreading library should be made
+   weak. */
+#undef USE_POSIX_THREADS_WEAK
+
+/* Define if the GNU Pth multithreading library can be used. */
+#undef USE_PTH_THREADS
+
+/* Define if references to the GNU Pth multithreading library should be made
+   weak. */
+#undef USE_PTH_THREADS_WEAK
+
+/* Define if the old Solaris multithreading library can be used. */
+#undef USE_SOLARIS_THREADS
+
+/* Define if references to the old Solaris multithreading library should be
+   made weak. */
+#undef USE_SOLARIS_THREADS_WEAK
+
+/* Define if the native Windows multithreading API can be used. */
+#undef USE_WINDOWS_THREADS
+
 /* Version number of package */
 #undef VERSION
 
 # endif
 #endif
 
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
 /* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS
 
 /* enable compile-time and run-time bounds-checking, and some warnings */
 #undef _FORTIFY_SOURCE
 
+/* Define to 1 if Gnulib overrides 'struct stat' on Windows so that struct
+   stat.st_size becomes 64-bit. */
+#undef _GL_WINDOWS_64_BIT_ST_SIZE
+
 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
 #undef _LARGEFILE_SOURCE
 
 /* Define to 1 if on MINIX. */
 #undef _MINIX
 
+/* The _Noreturn keyword of C11.  */
+#if ! (defined _Noreturn \
+       || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+      || 0x5110 <= __SUNPRO_C)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# elif defined _MSC_VER && 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn
+# endif
+#endif
+
+
 /* Define to 2 if the system does not provide POSIX.1 features except with
    this defined. */
 #undef _POSIX_1_SOURCE
 
-/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* Define to 1 if you need to in order for 'stat' and other things to work. */
 #undef _POSIX_SOURCE
 
 /* Define to 500 only on HP-UX. */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
+/* Enable general extensions on MacOS X.  */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
    used. */
 #undef __GETOPT_PREFIX
 
-/* Define to rpl_calloc if the replacement function should be used. */
-#undef calloc
-
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
 
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef gid_t
-
 /* Define to rpl_gmtime if the replacement function should be used. */
 #undef gmtime
 
 /* Define to rpl_localtime if the replacement function should be used. */
 #undef localtime
 
-/* Define to rpl_malloc if the replacement function should be used. */
-#undef malloc
-
 /* Define to a type if <wchar.h> does not define. */
 #undef mbstate_t
 
 /* Define to `long int' if <sys/types.h> does not define. */
 #undef off_t
 
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
 /* Define as the type of the result of subtracting two pointers, if the system
    doesn't define it. */
 #undef ptrdiff_t
 
-/* Define to rpl_realloc if the replacement function should be used. */
-#undef realloc
-
 /* Define to the equivalent of the C99 'restrict' keyword, or to
    nothing if this is not supported.  Do not define if restrict is
    supported directly.  */
 #undef restrict
-/* Work around a bug in Sun C++: it does not support _Restrict, even
-   though the corresponding Sun C compiler does, which causes
-   "#define restrict _Restrict" in the previous line.  Perhaps some future
-   version of Sun C++ will work with _Restrict; if so, it'll probably
-   define __RESTRICT, just as Sun C does.  */
+/* Work around a bug in Sun C++: it does not support _Restrict or
+   __restrict__, even though the corresponding Sun C compiler ends up with
+   "#define restrict _Restrict" or "#define restrict __restrict__" in the
+   previous line.  Perhaps some future version of Sun C++ will work with
+   restrict; if so, hopefully it defines __RESTRICT like Sun C does.  */
 #if defined __SUNPRO_CC && !defined __RESTRICT
 # define _Restrict
+# define __restrict__
 #endif
 
 /* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
 
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef uid_t
+/* Define as a signed type of the same size as size_t. */
+#undef ssize_t
 
 /* Define as a marker that can be attached to declarations that might not
     be used.  This helps to reduce warnings, such as from
    is a misnomer outside of parameter lists.  */
 #define _UNUSED_PARAMETER_ _GL_UNUSED
 
+/* The __pure__ attribute was added in gcc 2.96.  */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The __const__ attribute was added in gcc 2.95.  */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+#else
+# define _GL_ATTRIBUTE_CONST /* empty */
+#endif
+
index da0418dfb9279573d3b092850896d8d7fdf58847..f0f9a22c27303e948d1f331d096824f1c37ae40d 100644 (file)
@@ -1,6 +1,6 @@
 /* Invoke creat, but avoid some glitches.
 
-   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2012 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
diff --git a/lib/dirent--.h b/lib/dirent--.h
new file mode 100644 (file)
index 0000000..1b75793
--- /dev/null
@@ -0,0 +1,23 @@
+/* Like dirent.h, but redefine some names to avoid glitches.
+
+   Copyright (C) 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake.  */
+
+#include "dirent-safer.h"
+
+#undef opendir
+#define opendir opendir_safer
diff --git a/lib/dirent-private.h b/lib/dirent-private.h
new file mode 100644 (file)
index 0000000..b60203c
--- /dev/null
@@ -0,0 +1,40 @@
+/* Private details of the DIR type.
+   Copyright (C) 2011-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _DIRENT_PRIVATE_H
+#define _DIRENT_PRIVATE_H 1
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+struct gl_directory
+{
+  /* Status, or error code to produce in next readdir() call.
+     -2 means the end of the directory is already reached,
+     -1 means the entry was already filled by FindFirstFile,
+     0 means the entry needs to be filled using FindNextFile.
+     A positive value is an error code.  */
+  int status;
+  /* Handle, reading the directory, at current position.  */
+  HANDLE current;
+  /* Found directory entry.  */
+  WIN32_FIND_DATA entry;
+  /* Argument to pass to FindFirstFile.  It consists of the absolutized
+     directory name, followed by a directory separator and the wildcards.  */
+  char dir_name_mask[1];
+};
+
+#endif /* _DIRENT_PRIVATE_H */
diff --git a/lib/dirent-safer.h b/lib/dirent-safer.h
new file mode 100644 (file)
index 0000000..861ea93
--- /dev/null
@@ -0,0 +1,22 @@
+/* Invoke dirent-like functions, but avoid some glitches.
+
+   Copyright (C) 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake.  */
+
+#include <dirent.h>
+
+DIR *opendir_safer (const char *name);
index 4b02cfbcf6a1c88eab37eae9a41e714ff29ae111..cdbc5fd4fd043258028427712468923a1b5ed92e 100644 (file)
@@ -1,5 +1,5 @@
 /* A GNU-like <dirent.h>.
-   Copyright (C) 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 2006-2012 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
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_DIRENT_H
+#ifndef _@GUARD_PREFIX@_DIRENT_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 /* The include_next requires a split double-inclusion guard.  */
-#@INCLUDE_NEXT@ @NEXT_DIRENT_H@
+#if @HAVE_DIRENT_H@
+# @INCLUDE_NEXT@ @NEXT_DIRENT_H@
+#endif
 
-#ifndef _GL_DIRENT_H
-#define _GL_DIRENT_H
+#ifndef _@GUARD_PREFIX@_DIRENT_H
+#define _@GUARD_PREFIX@_DIRENT_H
 
 /* Get ino_t.  Needed on some systems, including glibc 2.8.  */
 #include <sys/types.h>
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+#if !@HAVE_DIRENT_H@
+/* Define types DIR and 'struct dirent'.  */
+# if !GNULIB_defined_struct_dirent
+struct dirent
+{
+  char d_type;
+  char d_name[1];
+};
+/* Possible values for 'd_type'.  */
+#  define DT_UNKNOWN 0
+#  define DT_FIFO    1          /* FIFO */
+#  define DT_CHR     2          /* character device */
+#  define DT_DIR     4          /* directory */
+#  define DT_BLK     6          /* block device */
+#  define DT_REG     8          /* regular file */
+#  define DT_LNK    10          /* symbolic link */
+#  define DT_SOCK   12          /* socket */
+#  define DT_WHT    14          /* whiteout */
+typedef struct gl_directory DIR;
+#  define GNULIB_defined_struct_dirent 1
+# endif
+#endif
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+   The attribute __pure__ was added in gcc 2.96.  */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 
 /* Declare overridden functions.  */
 
-#if @REPLACE_CLOSEDIR@
-# define closedir rpl_closedir
-extern int closedir (DIR *) _GL_ARG_NONNULL ((1));
+#if @GNULIB_OPENDIR@
+# if @REPLACE_OPENDIR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef opendir
+#   define opendir rpl_opendir
+#  endif
+_GL_FUNCDECL_RPL (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
+# else
+#  if !@HAVE_OPENDIR@
+_GL_FUNCDECL_SYS (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (opendir, DIR *, (const char *dir_name));
+# endif
+_GL_CXXALIASWARN (opendir);
+#elif defined GNULIB_POSIXCHECK
+# undef opendir
+# if HAVE_RAW_DECL_OPENDIR
+_GL_WARN_ON_USE (opendir, "opendir is not portable - "
+                 "use gnulib module opendir for portability");
+# endif
+#endif
+
+#if @GNULIB_READDIR@
+# if !@HAVE_READDIR@
+_GL_FUNCDECL_SYS (readdir, struct dirent *, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (readdir, struct dirent *, (DIR *dirp));
+_GL_CXXALIASWARN (readdir);
+#elif defined GNULIB_POSIXCHECK
+# undef readdir
+# if HAVE_RAW_DECL_READDIR
+_GL_WARN_ON_USE (readdir, "readdir is not portable - "
+                 "use gnulib module readdir for portability");
+# endif
+#endif
+
+#if @GNULIB_REWINDDIR@
+# if !@HAVE_REWINDDIR@
+_GL_FUNCDECL_SYS (rewinddir, void, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (rewinddir, void, (DIR *dirp));
+_GL_CXXALIASWARN (rewinddir);
+#elif defined GNULIB_POSIXCHECK
+# undef rewinddir
+# if HAVE_RAW_DECL_REWINDDIR
+_GL_WARN_ON_USE (rewinddir, "rewinddir is not portable - "
+                 "use gnulib module rewinddir for portability");
+# endif
+#endif
+
+#if @GNULIB_CLOSEDIR@
+# if @REPLACE_CLOSEDIR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef closedir
+#   define closedir rpl_closedir
+#  endif
+_GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (closedir, int, (DIR *dirp));
+# else
+#  if !@HAVE_CLOSEDIR@
+_GL_FUNCDECL_SYS (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (closedir, int, (DIR *dirp));
+# endif
+_GL_CXXALIASWARN (closedir);
+#elif defined GNULIB_POSIXCHECK
+# undef closedir
+# if HAVE_RAW_DECL_CLOSEDIR
+_GL_WARN_ON_USE (closedir, "closedir is not portable - "
+                 "use gnulib module closedir for portability");
+# endif
 #endif
 
 #if @GNULIB_DIRFD@
-# if !@HAVE_DECL_DIRFD@ && !defined dirfd
 /* Return the file descriptor associated with the given directory stream,
    or -1 if none exists.  */
-extern int dirfd (DIR *dir) _GL_ARG_NONNULL ((1));
+# if @REPLACE_DIRFD@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef dirfd
+#   define dirfd rpl_dirfd
+#  endif
+_GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (dirfd, int, (DIR *));
+# else
+#  if defined __cplusplus && defined GNULIB_NAMESPACE && defined dirfd
+    /* dirfd is defined as a macro and not as a function.
+       Turn it into a function and get rid of the macro.  */
+static inline int (dirfd) (DIR *dp) { return dirfd (dp); }
+#   undef dirfd
+#  endif
+#  if !(@HAVE_DECL_DIRFD@ || defined dirfd)
+_GL_FUNCDECL_SYS (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (dirfd, int, (DIR *));
 # endif
+_GL_CXXALIASWARN (dirfd);
 #elif defined GNULIB_POSIXCHECK
 # undef dirfd
-# define dirfd(d) \
-    (GL_LINK_WARNING ("dirfd is unportable - " \
-                      "use gnulib module dirfd for portability"), \
-     dirfd (d))
+# if HAVE_RAW_DECL_DIRFD
+_GL_WARN_ON_USE (dirfd, "dirfd is unportable - "
+                 "use gnulib module dirfd for portability");
+# endif
 #endif
 
 #if @GNULIB_FDOPENDIR@
-# if @REPLACE_FDOPENDIR@
-#  undef fdopendir
-#  define fdopendir rpl_fdopendir
-# endif
-# if !@HAVE_FDOPENDIR@ || @REPLACE_FDOPENDIR@
 /* Open a directory stream visiting the given directory file
    descriptor.  Return NULL and set errno if fd is not visiting a
    directory.  On success, this function consumes fd (it will be
    implicitly closed either by this function or by a subsequent
    closedir).  */
-extern DIR *fdopendir (int fd);
+# if @REPLACE_FDOPENDIR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fdopendir
+#   define fdopendir rpl_fdopendir
+#  endif
+_GL_FUNCDECL_RPL (fdopendir, DIR *, (int fd));
+_GL_CXXALIAS_RPL (fdopendir, DIR *, (int fd));
+# else
+#  if !@HAVE_FDOPENDIR@ || !@HAVE_DECL_FDOPENDIR@
+_GL_FUNCDECL_SYS (fdopendir, DIR *, (int fd));
+#  endif
+_GL_CXXALIAS_SYS (fdopendir, DIR *, (int fd));
 # endif
+_GL_CXXALIASWARN (fdopendir);
 #elif defined GNULIB_POSIXCHECK
 # undef fdopendir
-# define fdopendir(f) \
-    (GL_LINK_WARNING ("fdopendir is unportable - " \
-                      "use gnulib module fdopendir for portability"), \
-     fdopendir (f))
-#endif
-
-#if @REPLACE_OPENDIR@
-# define opendir rpl_opendir
-extern DIR * opendir (const char *) _GL_ARG_NONNULL ((1));
+# if HAVE_RAW_DECL_FDOPENDIR
+_GL_WARN_ON_USE (fdopendir, "fdopendir is unportable - "
+                 "use gnulib module fdopendir for portability");
+# endif
 #endif
 
 #if @GNULIB_SCANDIR@
@@ -91,37 +211,48 @@ extern DIR * opendir (const char *) _GL_ARG_NONNULL ((1));
    sorted using qsort with CMP, and collected in a malloc'd array in
    *NAMELIST.  Returns the number of entries selected, or -1 on error.  */
 # if !@HAVE_SCANDIR@
-extern int scandir (const char *dir, struct dirent ***namelist,
-                    int (*filter) (const struct dirent *),
-                    int (*cmp) (const struct dirent **, const struct dirent **))
-     _GL_ARG_NONNULL ((1, 2, 4));
+_GL_FUNCDECL_SYS (scandir, int,
+                  (const char *dir, struct dirent ***namelist,
+                   int (*filter) (const struct dirent *),
+                   int (*cmp) (const struct dirent **, const struct dirent **))
+                  _GL_ARG_NONNULL ((1, 2, 4)));
 # endif
+/* Need to cast, because on glibc systems, the fourth parameter is
+                        int (*cmp) (const void *, const void *).  */
+_GL_CXXALIAS_SYS_CAST (scandir, int,
+                       (const char *dir, struct dirent ***namelist,
+                        int (*filter) (const struct dirent *),
+                        int (*cmp) (const struct dirent **, const struct dirent **)));
+_GL_CXXALIASWARN (scandir);
 #elif defined GNULIB_POSIXCHECK
 # undef scandir
-# define scandir(d,n,f,c) \
-    (GL_LINK_WARNING ("scandir is unportable - " \
-                      "use gnulib module scandir for portability"), \
-     scandir (d, n, f, c))
+# if HAVE_RAW_DECL_SCANDIR
+_GL_WARN_ON_USE (scandir, "scandir is unportable - "
+                 "use gnulib module scandir for portability");
+# endif
 #endif
 
 #if @GNULIB_ALPHASORT@
 /* Compare two 'struct dirent' entries alphabetically.  */
 # if !@HAVE_ALPHASORT@
-extern int alphasort (const struct dirent **, const struct dirent **)
-     _GL_ARG_NONNULL ((1, 2));
+_GL_FUNCDECL_SYS (alphasort, int,
+                  (const struct dirent **, const struct dirent **)
+                  _GL_ATTRIBUTE_PURE
+                  _GL_ARG_NONNULL ((1, 2)));
 # endif
+/* Need to cast, because on glibc systems, the parameters are
+                       (const void *, const void *).  */
+_GL_CXXALIAS_SYS_CAST (alphasort, int,
+                       (const struct dirent **, const struct dirent **));
+_GL_CXXALIASWARN (alphasort);
 #elif defined GNULIB_POSIXCHECK
 # undef alphasort
-# define alphasort(a,b) \
-    (GL_LINK_WARNING ("alphasort is unportable - " \
-                      "use gnulib module alphasort for portability"), \
-     alphasort (a, b))
-#endif
-
-#ifdef __cplusplus
-}
+# if HAVE_RAW_DECL_ALPHASORT
+_GL_WARN_ON_USE (alphasort, "alphasort is unportable - "
+                 "use gnulib module alphasort for portability");
+# endif
 #endif
 
 
-#endif /* _GL_DIRENT_H */
-#endif /* _GL_DIRENT_H */
+#endif /* _@GUARD_PREFIX@_DIRENT_H */
+#endif /* _@GUARD_PREFIX@_DIRENT_H */
index c285370d366ba8782c96126ad5bd42be915ef429..2f4d424f48a4dcf8d3ee740685f1d38da118c757 100644 (file)
@@ -1,6 +1,6 @@
 /* dirfd.c -- return the file descriptor associated with an open DIR*
 
-   Copyright (C) 2001, 2006, 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2006, 2008-2012 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
index d4506e060d4bfd7e8a26517bc24b9c90c308c9ad..2895cbcb280d55d95e734ad5615ac96ef4bd908b 100644 (file)
@@ -1,6 +1,6 @@
 /* dirname.c -- return all but the last element in a file name
 
-   Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2010 Free Software
+   Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -25,7 +25,7 @@
 
 /* Return the length of the prefix of FILE that will be used by
    dir_name.  If FILE is in the working directory, this returns zero
-   even though `dir_name (FILE)' will return ".".  Works properly even
+   even though 'dir_name (FILE)' will return ".".  Works properly even
    if there are trailing slashes (by effectively ignoring them).  */
 
 size_t
@@ -53,9 +53,9 @@ dir_len (char const *file)
 }
 
 
-/* In general, we can't use the builtin `dirname' function if available,
+/* In general, we can't use the builtin 'dirname' function if available,
    since it has different meanings in different environments.
-   In some environments the builtin `dirname' modifies its argument.
+   In some environments the builtin 'dirname' modifies its argument.
 
    Return the leading directories part of FILE, allocated with malloc.
    Works properly even if there are trailing slashes (by effectively
index fb19508f751f384dc5fe9365e0f69b17042d7a48..51a685c3a415af110371023a4ed8bb549c2c2681 100644 (file)
@@ -1,6 +1,6 @@
 /*  Take file names apart into directory and base names.
 
-    Copyright (C) 1998, 2001, 2003-2006, 2009-2010 Free Software Foundation,
+    Copyright (C) 1998, 2001, 2003-2006, 2009-2012 Free Software Foundation,
     Inc.
 
     This program is free software: you can redistribute it and/or modify
 
 # include <stdbool.h>
 # include <stddef.h>
+# include "dosname.h"
 
 # ifndef DIRECTORY_SEPARATOR
 #  define DIRECTORY_SEPARATOR '/'
 # endif
 
-# ifndef ISSLASH
-#  define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
-# endif
-
-# ifndef FILE_SYSTEM_PREFIX_LEN
-#  if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
-    /* This internal macro assumes ASCII, but all hosts that support drive
-       letters use ASCII.  */
-#   define _IS_DRIVE_LETTER(c) (((unsigned int) (c) | ('a' - 'A')) - 'a' \
-                                <= 'z' - 'a')
-#   define FILE_SYSTEM_PREFIX_LEN(Filename) \
-           (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
-#  else
-#   define FILE_SYSTEM_PREFIX_LEN(Filename) 0
-#  endif
-# endif
-
-# ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
-#  define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
-# endif
-
 # ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
 #  define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
 # endif
 
-# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
-#  define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
-# else
-#  define IS_ABSOLUTE_FILE_NAME(F) \
-          (ISSLASH ((F)[0]) || 0 < FILE_SYSTEM_PREFIX_LEN (F))
-# endif
-# define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
-
 # if GNULIB_DIRNAME
 char *base_name (char const *file);
 char *dir_name (char const *file);
 # endif
 
 char *mdir_name (char const *file);
-size_t base_len (char const *file);
-size_t dir_len (char const *file);
-char *last_component (char const *file);
+size_t base_len (char const *file) _GL_ATTRIBUTE_PURE;
+size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE;
+char *last_component (char const *file) _GL_ATTRIBUTE_PURE;
 
 bool strip_trailing_slashes (char *file);
 
diff --git a/lib/dosname.h b/lib/dosname.h
new file mode 100644 (file)
index 0000000..0468ce4
--- /dev/null
@@ -0,0 +1,53 @@
+/* File names on MS-DOS/Windows systems.
+
+   Copyright (C) 2000-2001, 2004-2006, 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+   From Paul Eggert and Jim Meyering.  */
+
+#ifndef _DOSNAME_H
+#define _DOSNAME_H
+
+#if (defined _WIN32 || defined __WIN32__ ||     \
+     defined __MSDOS__ || defined __CYGWIN__ || \
+     defined __EMX__ || defined __DJGPP__)
+   /* This internal macro assumes ASCII, but all hosts that support drive
+      letters use ASCII.  */
+# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a'  \
+                              <= 'z' - 'a')
+# define FILE_SYSTEM_PREFIX_LEN(Filename) \
+          (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
+# ifndef __CYGWIN__
+#  define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
+# endif
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+#else
+# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
+# define ISSLASH(C) ((C) == '/')
+#endif
+
+#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+#endif
+
+#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+#  define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
+# else
+#  define IS_ABSOLUTE_FILE_NAME(F)                              \
+     (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0)
+#endif
+#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
+
+#endif /* DOSNAME_H_ */
index 33f599beefd03f9ef99f1b5ed5f466c102f4b907..0f5d3be3f7310e4ea3352a5e268185c08f0ac9d7 100644 (file)
@@ -1,6 +1,6 @@
 /* Invoke dup, but avoid some glitches.
 
-   Copyright (C) 2001, 2004-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2004-2006, 2009-2012 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
diff --git a/lib/dup.c b/lib/dup.c
new file mode 100644 (file)
index 0000000..0a0b69e
--- /dev/null
+++ b/lib/dup.c
@@ -0,0 +1,61 @@
+/* Duplicate an open file descriptor.
+
+   Copyright (C) 2011-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <unistd.h>
+
+#include <errno.h>
+
+#include "msvc-inval.h"
+
+#undef dup
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static inline int
+dup_nothrow (int fd)
+{
+  int result;
+
+  TRY_MSVC_INVAL
+    {
+      result = dup (fd);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = -1;
+      errno = EBADF;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+#else
+# define dup_nothrow dup
+#endif
+
+int
+rpl_dup (int fd)
+{
+  int result = dup_nothrow (fd);
+#if REPLACE_FCHDIR
+  if (result >= 0)
+    result = _gl_register_dup (fd, result);
+#endif
+  return result;
+}
index a4422bf3b8c3aed35e4f5bdf2cf734e0a1ce6056..f6d0f1c73c5aa3c1fe4d7b66c933d553885df7f6 100644 (file)
@@ -1,6 +1,6 @@
 /* Duplicate an open file descriptor to a specified file descriptor.
 
-   Copyright (C) 1999, 2004-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2004-2007, 2009-2012 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
 #include <errno.h>
 #include <fcntl.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Get declarations of the Win32 API functions.  */
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-#endif
-
 #if HAVE_DUP2
 
 # undef dup2
 
-int
-rpl_dup2 (int fd, int desired_fd)
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* Get declarations of the native Windows API functions.  */
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+
+#  include "msvc-inval.h"
+
+/* Get _get_osfhandle.  */
+#  include "msvc-nothrow.h"
+
+static int
+ms_windows_dup2 (int fd, int desired_fd)
 {
   int result;
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
   /* If fd is closed, mingw hangs on dup2 (fd, fd).  If fd is open,
      dup2 (fd, fd) returns 0, but all further attempts to use fd in
      future dup2 calls will hang.  */
@@ -52,6 +57,7 @@ rpl_dup2 (int fd, int desired_fd)
         }
       return fd;
     }
+
   /* Wine 1.0.1 return 0 when desired_fd is negative but not -1:
      http://bugs.winehq.org/show_bug.cgi?id=21289 */
   if (desired_fd < 0)
@@ -59,22 +65,45 @@ rpl_dup2 (int fd, int desired_fd)
       errno = EBADF;
       return -1;
     }
-# endif
-  result = dup2 (fd, desired_fd);
-# ifdef __linux__
-  /* Correct a Linux return value.
-     <http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.30.y.git;a=commitdiff;h=2b79bc4f7ebbd5af3c8b867968f9f15602d5f802>
-   */
-  if (fd == desired_fd && result == (unsigned int) -EBADF)
+
+  TRY_MSVC_INVAL
+    {
+      result = dup2 (fd, desired_fd);
+    }
+  CATCH_MSVC_INVAL
     {
       errno = EBADF;
       result = -1;
     }
-# endif
+  DONE_MSVC_INVAL;
+
   if (result == 0)
     result = desired_fd;
-  /* Correct a cygwin 1.5.x errno value.  */
-  else if (result == -1 && errno == EMFILE)
+
+  return result;
+}
+
+#  define dup2 ms_windows_dup2
+
+# endif
+
+int
+rpl_dup2 (int fd, int desired_fd)
+{
+  int result;
+
+# ifdef F_GETFL
+  /* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF.
+     On Cygwin 1.5.x, dup2 (1, 1) returns 0.
+     On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC.  */
+  if (fd == desired_fd)
+    return fcntl (fd, F_GETFL) == -1 ? -1 : fd;
+# endif
+
+  result = dup2 (fd, desired_fd);
+
+  /* Correct an errno value on FreeBSD 6.1 and Cygwin 1.5.x.  */
+  if (result == -1 && errno == EMFILE)
     errno = EBADF;
 # if REPLACE_FCHDIR
   if (fd != desired_fd && result != -1)
index f613d26a373fbea0211668b46dc1c74f0e44acc7..5e5af9276edb20cb8d04e44d25579c9bbb2138b9 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 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
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_ERRNO_H
+#ifndef _@GUARD_PREFIX@_ERRNO_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_ERRNO_H@
 
-#ifndef _GL_ERRNO_H
-#define _GL_ERRNO_H
+#ifndef _@GUARD_PREFIX@_ERRNO_H
+#define _@GUARD_PREFIX@_ERRNO_H
 
 
 /* On native Windows platforms, many macros are not defined.  */
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
-/* POSIX says that EAGAIN and EWOULDBLOCK may have the same value.  */
-#  define EWOULDBLOCK     EAGAIN
+/* These are the same values as defined by MSVC 10, for interoperability.  */
 
-/* Values >= 100 seem safe to use.  */
-#  define ETXTBSY   100
-#  define GNULIB_defined_ETXTBSY 1
+#  ifndef ENOMSG
+#   define ENOMSG    122
+#   define GNULIB_defined_ENOMSG 1
+#  endif
+
+#  ifndef EIDRM
+#   define EIDRM     111
+#   define GNULIB_defined_EIDRM 1
+#  endif
+
+#  ifndef ENOLINK
+#   define ENOLINK   121
+#   define GNULIB_defined_ENOLINK 1
+#  endif
+
+#  ifndef EPROTO
+#   define EPROTO    134
+#   define GNULIB_defined_EPROTO 1
+#  endif
+
+#  ifndef EBADMSG
+#   define EBADMSG   104
+#   define GNULIB_defined_EBADMSG 1
+#  endif
+
+#  ifndef EOVERFLOW
+#   define EOVERFLOW 132
+#   define GNULIB_defined_EOVERFLOW 1
+#  endif
+
+#  ifndef ENOTSUP
+#   define ENOTSUP   129
+#   define GNULIB_defined_ENOTSUP 1
+#  endif
+
+#  ifndef ENETRESET
+#   define ENETRESET 117
+#   define GNULIB_defined_ENETRESET 1
+#  endif
+
+#  ifndef ECONNABORTED
+#   define ECONNABORTED 106
+#   define GNULIB_defined_ECONNABORTED 1
+#  endif
+
+#  ifndef ECANCELED
+#   define ECANCELED 105
+#   define GNULIB_defined_ECANCELED 1
+#  endif
+
+#  ifndef EOWNERDEAD
+#   define EOWNERDEAD 133
+#   define GNULIB_defined_EOWNERDEAD 1
+#  endif
+
+#  ifndef ENOTRECOVERABLE
+#   define ENOTRECOVERABLE 127
+#   define GNULIB_defined_ENOTRECOVERABLE 1
+#  endif
+
+#  ifndef EINPROGRESS
+#   define EINPROGRESS     112
+#   define EALREADY        103
+#   define ENOTSOCK        128
+#   define EDESTADDRREQ    109
+#   define EMSGSIZE        115
+#   define EPROTOTYPE      136
+#   define ENOPROTOOPT     123
+#   define EPROTONOSUPPORT 135
+#   define EOPNOTSUPP      130
+#   define EAFNOSUPPORT    102
+#   define EADDRINUSE      100
+#   define EADDRNOTAVAIL   101
+#   define ENETDOWN        116
+#   define ENETUNREACH     118
+#   define ECONNRESET      108
+#   define ENOBUFS         119
+#   define EISCONN         113
+#   define ENOTCONN        126
+#   define ETIMEDOUT       138
+#   define ECONNREFUSED    107
+#   define ELOOP           114
+#   define EHOSTUNREACH    110
+#   define EWOULDBLOCK     140
+#   define GNULIB_defined_ESOCK 1
+#  endif
+
+#  ifndef ETXTBSY
+#   define ETXTBSY         139
+#   define ENODATA         120  /* not required by POSIX */
+#   define ENOSR           124  /* not required by POSIX */
+#   define ENOSTR          125  /* not required by POSIX */
+#   define ETIME           137  /* not required by POSIX */
+#   define EOTHER          131  /* not required by POSIX */
+#   define GNULIB_defined_ESTREAMS 1
+#  endif
 
 /* These are intentionally the same values as the WSA* error numbers, defined
    in <winsock2.h>.  */
-#  define EINPROGRESS     10036
-#  define EALREADY        10037
-#  define ENOTSOCK        10038
-#  define EDESTADDRREQ    10039
-#  define EMSGSIZE        10040
-#  define EPROTOTYPE      10041
-#  define ENOPROTOOPT     10042
-#  define EPROTONOSUPPORT 10043
 #  define ESOCKTNOSUPPORT 10044  /* not required by POSIX */
-#  define EOPNOTSUPP      10045
 #  define EPFNOSUPPORT    10046  /* not required by POSIX */
-#  define EAFNOSUPPORT    10047
-#  define EADDRINUSE      10048
-#  define EADDRNOTAVAIL   10049
-#  define ENETDOWN        10050
-#  define ENETUNREACH     10051
-#  define ENETRESET       10052
-#  define ECONNABORTED    10053
-#  define ECONNRESET      10054
-#  define ENOBUFS         10055
-#  define EISCONN         10056
-#  define ENOTCONN        10057
 #  define ESHUTDOWN       10058  /* not required by POSIX */
 #  define ETOOMANYREFS    10059  /* not required by POSIX */
-#  define ETIMEDOUT       10060
-#  define ECONNREFUSED    10061
-#  define ELOOP           10062
 #  define EHOSTDOWN       10064  /* not required by POSIX */
-#  define EHOSTUNREACH    10065
 #  define EPROCLIM        10067  /* not required by POSIX */
 #  define EUSERS          10068  /* not required by POSIX */
 #  define EDQUOT          10069
 #  define ESTALE          10070
 #  define EREMOTE         10071  /* not required by POSIX */
-#  define GNULIB_defined_ESOCK 1
+#  define GNULIB_defined_EWINSOCK 1
 
 # endif
 
 
 /* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
    EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
+   Likewise, on NonStop Kernel, EDQUOT is not defined.
    Define them here.  Values >= 2000 seem safe to use: Solaris ESTALE = 151,
    HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
 
 #  define GNULIB_defined_ENOTSUP 1
 # endif
 
+# ifndef ENETRESET
+#  define ENETRESET 2011
+#  define GNULIB_defined_ENETRESET 1
+# endif
+
+# ifndef ECONNABORTED
+#  define ECONNABORTED 2012
+#  define GNULIB_defined_ECONNABORTED 1
+# endif
+
 # ifndef ESTALE
 #  define ESTALE    2009
 #  define GNULIB_defined_ESTALE 1
 # endif
 
+# ifndef EDQUOT
+#  define EDQUOT 2010
+#  define GNULIB_defined_EDQUOT 1
+# endif
+
 # ifndef ECANCELED
 #  define ECANCELED 2008
 #  define GNULIB_defined_ECANCELED 1
 # endif
 
+/* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not
+   defined.  */
+
+# ifndef EOWNERDEAD
+#  if defined __sun
+    /* Use the same values as defined for Solaris >= 8, for
+       interoperability.  */
+#   define EOWNERDEAD      58
+#   define ENOTRECOVERABLE 59
+#  elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+    /* We have a conflict here: pthreads-win32 defines these values
+       differently than MSVC 10.  It's hairy to decide which one to use.  */
+#   if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
+     /* Use the same values as defined by pthreads-win32, for
+        interoperability.  */
+#    define EOWNERDEAD      43
+#    define ENOTRECOVERABLE 44
+#   else
+     /* Use the same values as defined by MSVC 10, for
+        interoperability.  */
+#    define EOWNERDEAD      133
+#    define ENOTRECOVERABLE 127
+#   endif
+#  else
+#   define EOWNERDEAD      2013
+#   define ENOTRECOVERABLE 2014
+#  endif
+#  define GNULIB_defined_EOWNERDEAD 1
+#  define GNULIB_defined_ENOTRECOVERABLE 1
+# endif
 
-#endif /* _GL_ERRNO_H */
-#endif /* _GL_ERRNO_H */
+#endif /* _@GUARD_PREFIX@_ERRNO_H */
+#endif /* _@GUARD_PREFIX@_ERRNO_H */
index c79e8d42cb30f51c5284529dc2713065e9736a3c..dc8c65fa7f9899551519d08615ec373a34a8cbe2 100644 (file)
@@ -1,5 +1,5 @@
 /* Error handler for noninteractive utilities
-   Copyright (C) 1990-1998, 2000-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1990-1998, 2000-2007, 2009-2012 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
@@ -54,7 +54,7 @@
    function without parameters instead.  */
 void (*error_print_progname) (void);
 
-/* This variable is incremented each time `error' is called.  */
+/* This variable is incremented each time 'error' is called.  */
 unsigned int error_message_count;
 
 #ifdef _LIBC
@@ -65,7 +65,7 @@ unsigned int error_message_count;
 # include <limits.h>
 # include <libio/libioP.h>
 
-/* In GNU libc we want do not want to use the common name `error' directly.
+/* In GNU libc we want do not want to use the common name 'error' directly.
    Instead make it a weak alias.  */
 extern void __error (int status, int errnum, const char *message, ...)
      __attribute__ ((__format__ (__printf__, 3, 4)));
@@ -88,11 +88,26 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
 # include <fcntl.h>
 # include <unistd.h>
 
-# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions.  */
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+/* Get _get_osfhandle.  */
+#  include "msvc-nothrow.h"
+# endif
+
+/* The gnulib override of fcntl is not needed in this file.  */
+# undef fcntl
+
+# if !HAVE_DECL_STRERROR_R
 #  ifndef HAVE_DECL_STRERROR_R
 "this configure-time declaration test was not run"
 #  endif
+#  if STRERROR_R_CHAR_P
 char *strerror_r ();
+#  else
+int strerror_r ();
+#  endif
 # endif
 
 /* The calling program should define program_name and set it to the
@@ -104,10 +119,30 @@ extern char *program_name;
 # endif /* HAVE_STRERROR_R || defined strerror_r */
 #endif  /* not _LIBC */
 
+#if !_LIBC
+/* Return non-zero if FD is open.  */
+static inline int
+is_open (int fd)
+{
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+  /* On native Windows: The initial state of unassigned standard file
+     descriptors is that they are open but point to an INVALID_HANDLE_VALUE.
+     There is no fcntl, and the gnulib replacement fcntl does not support
+     F_GETFL.  */
+  return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
+# else
+#  ifndef F_GETFL
+#   error Please port fcntl to your platform
+#  endif
+  return 0 <= fcntl (fd, F_GETFL);
+# endif
+}
+#endif
+
 static inline void
 flush_stdout (void)
 {
-#if !_LIBC && defined F_GETFL
+#if !_LIBC
   int stdout_fd;
 
 # if GNULIB_FREOPEN_SAFER
@@ -124,7 +159,7 @@ flush_stdout (void)
   /* POSIX states that fflush (stdout) after fclose is unspecified; it
      is safe in glibc, but not on all other platforms.  fflush (NULL)
      is always defined, but too draconian.  */
-  if (0 <= stdout_fd && 0 <= fcntl (stdout_fd, F_GETFL))
+  if (0 <= stdout_fd && is_open (stdout_fd))
 #endif
     fflush (stdout);
 }
index 9deef02d2f3d5f048fce0357aedf224f8afefa6c..9c2cb8bc6ae19fc4ce0a84fbf08f614792e424cb 100644 (file)
@@ -1,6 +1,6 @@
 /* Declaration for error-reporting function
-   Copyright (C) 1995, 1996, 1997, 2003, 2006, 2008, 2009, 2010 Free Software
-   Foundation, Inc.
+   Copyright (C) 1995-1997, 2003, 2006, 2008-2012 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
 #ifndef _ERROR_H
 #define _ERROR_H 1
 
-#ifndef __attribute__
 /* The __attribute__ feature is available in gcc versions 2.5 and later.
    The __-protected variants of the attributes 'format' and 'printf' are
    accepted by gcc versions 2.6.4 (effectively 2.7) and later.
-   We enable __attribute__ only if these are supported too, because
+   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
    gnulib and libintl do '#define printf __printf__' when they override
    the 'printf' function.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-#  define __attribute__(Spec)   /* empty */
-# endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
 #endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/* Print a message with `fprintf (stderr, FORMAT, ...)';
+/* Print a message with 'fprintf (stderr, FORMAT, ...)';
    if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
-   If STATUS is nonzero, terminate the program with `exit (STATUS)'.  */
+   If STATUS is nonzero, terminate the program with 'exit (STATUS)'.  */
 
 extern void error (int __status, int __errnum, const char *__format, ...)
-     __attribute__ ((__format__ (__printf__, 3, 4)));
+     _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
 
 extern void error_at_line (int __status, int __errnum, const char *__fname,
                            unsigned int __lineno, const char *__format, ...)
-     __attribute__ ((__format__ (__printf__, 5, 6)));
+     _GL_ATTRIBUTE_FORMAT ((__printf__, 5, 6));
 
 /* If NULL, error will flush stdout, then print on stderr the program
    name, a colon and a space.  Otherwise, error will call this
    function without parameters instead.  */
 extern void (*error_print_progname) (void);
 
-/* This variable is incremented each time `error' is called.  */
+/* This variable is incremented each time 'error' is called.  */
 extern unsigned int error_message_count;
 
 /* Sometimes we want to have at most one error per line.  This
index 3b63f8a123b19cf7a0d1f030ce8f985ac06d9a65..fdd674c11b6096adf3b9456243b56c2a89662295 100644 (file)
@@ -1,7 +1,6 @@
 /* Failure exit status
 
-   Copyright (C) 2002, 2003, 2005, 2006, 2007, 2009, 2010 Free Software
-   Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2007, 2009-2012 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
index 7ffffe5c99a80e8127d92e5f512a437981f15d06..074f212192994f7719e2eaf007ffaaab81c48624 100644 (file)
@@ -1,6 +1,6 @@
 /* Failure exit status
 
-   Copyright (C) 2002, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2012 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
index 015e5f382f35222c93c4733692e21c1ee96cee33..2e07553e6b31c6ac48d4329dc24964f4db5075fa 100644 (file)
@@ -1,5 +1,5 @@
 /* fchdir replacement.
-   Copyright (C) 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 2006-2012 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
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#include "dosname.h"
+#include "filenamecat.h"
+
 #ifndef REPLACE_OPEN_DIRECTORY
 # define REPLACE_OPEN_DIRECTORY 0
 #endif
 
-#ifndef HAVE_CANONICALIZE_FILE_NAME
-# if GNULIB_CANONICALIZE || GNULIB_CANONICALIZE_LGPL
-#  define HAVE_CANONICALIZE_FILE_NAME 1
-# else
-#  define HAVE_CANONICALIZE_FILE_NAME 0
-#  define canonicalize_file_name(name) NULL
-# endif
-#endif
-
 /* This replacement assumes that a directory is not renamed while opened
    through a file descriptor.
 
@@ -90,36 +84,26 @@ ensure_dirs_slot (size_t fd)
   return true;
 }
 
-/* Return the canonical name of DIR in malloc'd storage.  */
+/* Return an absolute name of DIR in malloc'd storage.  */
 static char *
 get_name (char const *dir)
 {
+  char *cwd;
   char *result;
-  if (REPLACE_OPEN_DIRECTORY || !HAVE_CANONICALIZE_FILE_NAME)
-    {
-      /* The function canonicalize_file_name has not yet been ported
-         to mingw, with all its drive letter and backslash quirks.
-         Fortunately, getcwd is reliable in this case, but we ensure
-         we can get back to where we started before using it.  Treat
-         "." as a special case, as it is frequently encountered.  */
-      char *cwd = getcwd (NULL, 0);
-      int saved_errno;
-      if (dir[0] == '.' && dir[1] == '\0')
-        return cwd;
-      if (chdir (cwd))
-        return NULL;
-      result = chdir (dir) ? NULL : getcwd (NULL, 0);
-      saved_errno = errno;
-      if (chdir (cwd))
-        abort ();
-      free (cwd);
-      errno = saved_errno;
-    }
-  else
-    {
-      /* Avoid changing the directory.  */
-      result = canonicalize_file_name (dir);
-    }
+  int saved_errno;
+
+  if (IS_ABSOLUTE_FILE_NAME (dir))
+    return strdup (dir);
+
+  /* We often encounter "."; treat it as a special case.  */
+  cwd = getcwd (NULL, 0);
+  if (!cwd || (dir[0] == '.' && dir[1] == '\0'))
+    return cwd;
+
+  result = mfile_name_concat (cwd, dir, NULL);
+  saved_errno = errno;
+  free (cwd);
+  errno = saved_errno;
   return result;
 }
 
@@ -213,69 +197,6 @@ _gl_directory_name (int fd)
   return NULL;
 }
 
-#if REPLACE_OPEN_DIRECTORY
-/* Return stat information about FD in STATBUF.  Needed when
-   rpl_open() used a dummy file to work around an open() that can't
-   normally visit directories.  */
-# undef fstat
-int
-rpl_fstat (int fd, struct stat *statbuf)
-{
-  if (0 <= fd && fd < dirs_allocated && dirs[fd].name != NULL)
-    return stat (dirs[fd].name, statbuf);
-  return fstat (fd, statbuf);
-}
-#endif
-
-/* Override opendir() and closedir(), to keep track of the open file
-   descriptors.  Needed because there is a function dirfd().  */
-
-int
-rpl_closedir (DIR *dp)
-#undef closedir
-{
-  int fd = dirfd (dp);
-  int retval = closedir (dp);
-
-  if (retval >= 0)
-    _gl_unregister_fd (fd);
-  return retval;
-}
-
-DIR *
-rpl_opendir (const char *filename)
-#undef opendir
-{
-  DIR *dp;
-
-  dp = opendir (filename);
-  if (dp != NULL)
-    {
-      int fd = dirfd (dp);
-      if (0 <= fd && _gl_register_fd (fd, filename) != fd)
-        {
-          int saved_errno = errno;
-          closedir (dp);
-          errno = saved_errno;
-          return NULL;
-        }
-    }
-  return dp;
-}
-
-/* Override dup(), to keep track of open file descriptors.  */
-
-int
-rpl_dup (int oldfd)
-#undef dup
-{
-  int newfd = dup (oldfd);
-
-  if (0 <= newfd)
-    newfd = _gl_register_dup (oldfd, newfd);
-  return newfd;
-}
-
 
 /* Implement fchdir() in terms of chdir().  */
 
diff --git a/lib/fchmodat.c b/lib/fchmodat.c
deleted file mode 100644 (file)
index 0a76543..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Change the protections of file relative to an open directory.
-   Copyright (C) 2006, 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* written by Jim Meyering */
-
-#include <config.h>
-
-#include <sys/stat.h>
-
-#include <errno.h>
-
-#ifndef HAVE_LCHMOD
-/* Use a different name, to avoid conflicting with any
-   system-supplied declaration.  */
-# undef lchmod
-# define lchmod lchmod_rpl
-static int
-lchmod (char const *f _GL_UNUSED, mode_t m _GL_UNUSED)
-{
-  errno = ENOSYS;
-  return -1;
-}
-#endif
-
-/* Solaris 10 has no function like this.
-   Invoke chmod or lchmod on file, FILE, using mode MODE, in the directory
-   open on descriptor FD.  If possible, do it without changing the
-   working directory.  Otherwise, resort to using save_cwd/fchdir,
-   then (chmod|lchmod)/restore_cwd.  If either the save_cwd or the
-   restore_cwd fails, then give a diagnostic and exit nonzero.
-   Note that an attempt to use a FLAG value of AT_SYMLINK_NOFOLLOW
-   on a system without lchmod support causes this function to fail.  */
-
-#define AT_FUNC_NAME fchmodat
-#define AT_FUNC_F1 lchmod
-#define AT_FUNC_F2 chmod
-#define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
-#define AT_FUNC_POST_FILE_PARAM_DECLS , mode_t mode, int flag
-#define AT_FUNC_POST_FILE_ARGS        , mode
-#include "at-func.c"
diff --git a/lib/fchown-stub.c b/lib/fchown-stub.c
deleted file mode 100644 (file)
index 6be750b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <config.h>
-
-#include <sys/types.h>
-#include <errno.h>
-
-/* A trivial substitute for `fchown'.
-
-   DJGPP 2.03 and earlier (and perhaps later) don't have `fchown',
-   so we pretend no-one has permission for this operation. */
-
-int
-fchown (int fd, uid_t uid, gid_t gid)
-{
-  errno = EPERM;
-  return -1;
-}
diff --git a/lib/fchownat.c b/lib/fchownat.c
deleted file mode 100644 (file)
index 00126ac..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/* This function serves as replacement for a missing fchownat function,
-   as well as a work around for the fchownat bug in glibc-2.4:
-    <http://lists.ubuntu.com/archives/ubuntu-users/2006-September/093218.html>
-   when the buggy fchownat-with-AT_SYMLINK_NOFOLLOW operates on a symlink, it
-   mistakenly affects the symlink referent, rather than the symlink itself.
-
-   Copyright (C) 2006-2007, 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* written by Jim Meyering */
-
-#include <config.h>
-
-#include <unistd.h>
-
-#include <errno.h>
-#include <string.h>
-
-#include "openat.h"
-
-#if !HAVE_FCHOWNAT
-
-/* Replacement for Solaris' function by the same name.
-   Invoke chown or lchown on file, FILE, using OWNER and GROUP, in the
-   directory open on descriptor FD.  If FLAG is AT_SYMLINK_NOFOLLOW, then
-   use lchown, otherwise, use chown.  If possible, do it without changing
-   the working directory.  Otherwise, resort to using save_cwd/fchdir,
-   then (chown|lchown)/restore_cwd.  If either the save_cwd or the
-   restore_cwd fails, then give a diagnostic and exit nonzero.  */
-
-# define AT_FUNC_NAME fchownat
-# define AT_FUNC_F1 lchown
-# define AT_FUNC_F2 chown
-# define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
-# define AT_FUNC_POST_FILE_PARAM_DECLS , uid_t owner, gid_t group, int flag
-# define AT_FUNC_POST_FILE_ARGS        , owner, group
-# include "at-func.c"
-# undef AT_FUNC_NAME
-# undef AT_FUNC_F1
-# undef AT_FUNC_F2
-# undef AT_FUNC_USE_F1_COND
-# undef AT_FUNC_POST_FILE_PARAM_DECLS
-# undef AT_FUNC_POST_FILE_ARGS
-
-#else /* HAVE_FCHOWNAT */
-
-# undef fchownat
-
-# if FCHOWNAT_NOFOLLOW_BUG
-
-/* Failure to handle AT_SYMLINK_NOFOLLOW requires the /proc/self/fd or
-   fchdir workaround to call lchown for lchownat, but there is no need
-   to penalize chownat.  */
-static int
-local_lchownat (int fd, char const *file, uid_t owner, gid_t group);
-
-# define AT_FUNC_NAME local_lchownat
-# define AT_FUNC_F1 lchown
-# define AT_FUNC_POST_FILE_PARAM_DECLS , uid_t owner, gid_t group
-# define AT_FUNC_POST_FILE_ARGS        , owner, group
-# include "at-func.c"
-# undef AT_FUNC_NAME
-# undef AT_FUNC_F1
-# undef AT_FUNC_POST_FILE_PARAM_DECLS
-# undef AT_FUNC_POST_FILE_ARGS
-
-# endif
-
-/* Work around bugs with trailing slash, using the same workarounds as
-   chown and lchown.  */
-
-int
-rpl_fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag)
-{
-# if FCHOWNAT_NOFOLLOW_BUG
-  if (flag == AT_SYMLINK_NOFOLLOW)
-    return local_lchownat (fd, file, owner, group);
-# endif
-# if CHOWN_TRAILING_SLASH_BUG
-  {
-    size_t len = strlen (file);
-    struct stat st;
-    if (len && file[len - 1] == '/')
-      {
-        if (statat (fd, file, &st))
-          return -1;
-        if (flag == AT_SYMLINK_NOFOLLOW)
-          return fchownat (fd, file, owner, group, 0);
-      }
-  }
-# endif
-  return fchownat (fd, file, owner, group, flag);
-}
-
-#endif /* HAVE_FCHOWNAT */
index 9f4388912aa093acca36473478594668159bd381..e9986ca53f18f76ac2d62e4ef8dcd37a39f08518 100644 (file)
@@ -1,5 +1,5 @@
 /* fclose replacement.
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 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
 #include <errno.h>
 #include <unistd.h>
 
-/* Override fclose() to call the overridden close().  */
+#include "freading.h"
+#include "msvc-inval.h"
+
+#undef fclose
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+fclose_nothrow (FILE *fp)
+{
+  int result;
+
+  TRY_MSVC_INVAL
+    {
+      result = fclose (fp);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = EOF;
+      errno = EBADF;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+#else
+# define fclose_nothrow fclose
+#endif
+
+/* Override fclose() to call the overridden fflush() or close().  */
 
 int
 rpl_fclose (FILE *fp)
-#undef fclose
 {
   int saved_errno = 0;
+  int fd;
+  int result = 0;
+
+  /* Don't change behavior on memstreams.  */
+  fd = fileno (fp);
+  if (fd < 0)
+    return fclose_nothrow (fp);
 
-  if (fflush (fp))
+  /* We only need to flush the file if it is not reading or if it is
+     seekable.  This only guarantees the file position of input files
+     if the fflush module is also in use.  */
+  if ((!freading (fp) || lseek (fileno (fp), 0, SEEK_CUR) != -1)
+      && fflush (fp))
     saved_errno = errno;
 
-  if (close (fileno (fp)) < 0 && saved_errno == 0)
+  /* fclose() calls close(), but we need to also invoke all hooks that our
+     overridden close() function invokes.  See lib/close.c.  */
+#if WINDOWS_SOCKETS
+  /* Call the overridden close(), then the original fclose().
+     Note about multithread-safety: There is a race condition where some
+     other thread could open fd between our close and fclose.  */
+  if (close (fd) < 0 && saved_errno == 0)
     saved_errno = errno;
 
-  fclose (fp); /* will fail with errno = EBADF */
+  fclose_nothrow (fp); /* will fail with errno = EBADF,
+                          if we did not lose a race */
+
+#else /* !WINDOWS_SOCKETS */
+  /* Call fclose() and invoke all hooks of the overridden close().  */
+
+# if REPLACE_FCHDIR
+  /* Note about multithread-safety: There is a race condition here as well.
+     Some other thread could open fd between our calls to fclose and
+     _gl_unregister_fd.  */
+  result = fclose_nothrow (fp);
+  if (result == 0)
+    _gl_unregister_fd (fd);
+# else
+  /* No race condition here.  */
+  result = fclose_nothrow (fp);
+# endif
+
+#endif /* !WINDOWS_SOCKETS */
 
   if (saved_errno != 0)
     {
       errno = saved_errno;
-      return EOF;
+      result = EOF;
     }
-  return 0;
+
+  return result;
 }
index 7baa2cbca681c3906a9d68ca5ff9069b353f0525..8fde6c112087789eaca654747fce0238ce7f4491 100644 (file)
@@ -1,6 +1,6 @@
 /* Like fcntl.h, but redefine some names to avoid glitches.
 
-   Copyright (C) 2005, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009-2012 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
index 5c76b4bce7dfce80cb639a20215412d642db4e4a..440a2ffde81e02a4ceecefbc10efcf89652729e4 100644 (file)
@@ -1,6 +1,6 @@
 /* Invoke fcntl-like functions, but avoid some glitches.
 
-   Copyright (C) 2005, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009-2012 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
index c51e8ded56c13d102fcd9c9996a0f1a2a8e2438c..3dfb6b73a87ee7cfba937ab746d4923fb4818205 100644 (file)
@@ -1,6 +1,6 @@
 /* Provide file descriptor control.
 
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 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
 #undef fcntl
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Get declarations of the Win32 API functions.  */
+/* Get declarations of the native Windows API functions.  */
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 
+/* Get _get_osfhandle.  */
+# include "msvc-nothrow.h"
+
 /* Upper bound on getdtablesize().  See lib/getdtablesize.c.  */
 # define OPEN_MAX_MAX 0x10000
 
@@ -91,7 +94,7 @@ dupfd (int oldfd, int newfd, int flags)
           result = -1;
           break;
         }
-      duplicated_fd = _open_osfhandle ((long) new_handle, flags);
+      duplicated_fd = _open_osfhandle ((intptr_t) new_handle, flags);
       if (duplicated_fd < 0)
         {
           CloseHandle (new_handle);
@@ -187,7 +190,21 @@ rpl_fcntl (int fd, int action, /* arg */...)
           errno = EINVAL;
         else
           {
+            /* Haiku alpha 2 loses fd flags on original.  */
+            int flags = fcntl (fd, F_GETFD);
+            if (flags < 0)
+              {
+                result = -1;
+                break;
+              }
             result = fcntl (fd, action, target);
+            if (0 <= result && fcntl (fd, F_SETFD, flags) == -1)
+              {
+                int saved_errno = errno;
+                close (result);
+                result = -1;
+                errno = saved_errno;
+              }
 # if REPLACE_FCHDIR
             if (0 <= result)
               result = _gl_register_dup (fd, result);
index b0a90fc74678bac5acac8113670b61cac700e732..76e12f78a62bf8546269bd75bc61b2aea35d5e19 100644 (file)
@@ -1,6 +1,6 @@
 /* Like <fcntl.h>, but with non-working flags defined to 0.
 
-   Copyright (C) 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 2006-2012 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
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 #if defined __need_system_fcntl_h
 /* Special invocation convention.  */
 
+/* Needed before <sys/stat.h>.
+   May also define off_t to a 64-bit type on native Windows.  */
 #include <sys/types.h>
-#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems.  */
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+   <fcntl.h>.  On glibc systems, we would like to avoid namespace pollution.
+   But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+   extern "C" { ... } block, which leads to errors in C++ mode with the
+   overridden <sys/stat.h> from gnulib.  These errors are known to be gone
+   with g++ version >= 4.3.  */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
 # include <sys/stat.h>
 #endif
 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
 #else
 /* Normal invocation convention.  */
 
-#ifndef _GL_FCNTL_H
+#ifndef _@GUARD_PREFIX@_FCNTL_H
 
+/* Needed before <sys/stat.h>.
+   May also define off_t to a 64-bit type on native Windows.  */
 #include <sys/types.h>
-#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems.  */
+/* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+   <fcntl.h>.  On glibc systems, we would like to avoid namespace pollution.
+   But on glibc systems, <fcntl.h> includes <sys/stat.h> inside an
+   extern "C" { ... } block, which leads to errors in C++ mode with the
+   overridden <sys/stat.h> from gnulib.  These errors are known to be gone
+   with g++ version >= 4.3.  */
+#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
 # include <sys/stat.h>
 #endif
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
 
-#ifndef _GL_FCNTL_H
-#define _GL_FCNTL_H
+#ifndef _@GUARD_PREFIX@_FCNTL_H
+#define _@GUARD_PREFIX@_FCNTL_H
 
 #ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems.  */
 # include <unistd.h>
 #endif
 
+/* Native Windows platforms declare open(), creat() in <io.h>.  */
+#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
-/* Declare overridden functions.  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+/* Declare overridden functions.  */
 
 #if @GNULIB_FCNTL@
 # if @REPLACE_FCNTL@
-#  undef fcntl
-#  define fcntl rpl_fcntl
-# endif
-# if !@HAVE_FCNTL@ || @REPLACE_FCNTL@
-extern int fcntl (int fd, int action, ...);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fcntl
+#   define fcntl rpl_fcntl
+#  endif
+_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
+_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
+# else
+#  if !@HAVE_FCNTL@
+_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
+#  endif
+_GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...));
 # endif
+_GL_CXXALIASWARN (fcntl);
 #elif defined GNULIB_POSIXCHECK
 # undef fcntl
-# define fcntl \
-    (GL_LINK_WARNING ("fcntl is not always POSIX compliant - " \
-                      "use gnulib module fcntl for portability"), \
-     fcntl)
+# if HAVE_RAW_DECL_FCNTL
+_GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
+                 "use gnulib module fcntl for portability");
+# endif
 #endif
 
 #if @GNULIB_OPEN@
 # if @REPLACE_OPEN@
-#  undef open
-#  define open rpl_open
-extern int open (const char *filename, int flags, ...) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef open
+#   define open rpl_open
+#  endif
+_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+                             _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+# else
+_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+# endif
+/* On HP-UX 11, in C++ mode, open() is defined as an inline function with a
+   default argument.  _GL_CXXALIASWARN does not work in this case.  */
+# if !defined __hpux
+_GL_CXXALIASWARN (open);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef open
-# define open \
-    (GL_LINK_WARNING ("open is not always POSIX compliant - " \
-                      "use gnulib module open for portability"), \
-     open)
+/* Assume open is always declared.  */
+_GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
+                 "use gnulib module open for portability");
 #endif
 
 #if @GNULIB_OPENAT@
 # if @REPLACE_OPENAT@
-#  undef openat
-#  define openat rpl_openat
-# endif
-# if !@HAVE_OPENAT@ || @REPLACE_OPENAT@
-extern int openat (int fd, char const *file, int flags, /* mode_t mode */ ...)
-     _GL_ARG_NONNULL ((2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef openat
+#   define openat rpl_openat
+#  endif
+_GL_FUNCDECL_RPL (openat, int,
+                  (int fd, char const *file, int flags, /* mode_t mode */ ...)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (openat, int,
+                  (int fd, char const *file, int flags, /* mode_t mode */ ...));
+# else
+#  if !@HAVE_OPENAT@
+_GL_FUNCDECL_SYS (openat, int,
+                  (int fd, char const *file, int flags, /* mode_t mode */ ...)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (openat, int,
+                  (int fd, char const *file, int flags, /* mode_t mode */ ...));
 # endif
+_GL_CXXALIASWARN (openat);
 #elif defined GNULIB_POSIXCHECK
 # undef openat
-# define openat \
-    (GL_LINK_WARNING ("openat is not portable - " \
-                      "use gnulib module openat for portability"), \
-     openat)
+# if HAVE_RAW_DECL_OPENAT
+_GL_WARN_ON_USE (openat, "openat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
-#ifdef __cplusplus
-}
-#endif
 
 /* Fix up the FD_* macros, only known to be missing on mingw.  */
 
@@ -140,16 +187,19 @@ extern int openat (int fd, char const *file, int flags, /* mode_t mode */ ...)
 /* Fix up the O_* macros.  */
 
 #if !defined O_DIRECT && defined O_DIRECTIO
-/* Tru64 spells it `O_DIRECTIO'.  */
+/* Tru64 spells it 'O_DIRECTIO'.  */
 # define O_DIRECT O_DIRECTIO
 #endif
 
 #if !defined O_CLOEXEC && defined O_NOINHERIT
-/* Mingw spells it `O_NOINHERIT'.  Intentionally leave it
-   undefined if not available.  */
+/* Mingw spells it 'O_NOINHERIT'.  */
 # define O_CLOEXEC O_NOINHERIT
 #endif
 
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
+
 #ifndef O_DIRECT
 # define O_DIRECT 0
 #endif
@@ -162,6 +212,10 @@ extern int openat (int fd, char const *file, int flags, /* mode_t mode */ ...)
 # define O_DSYNC 0
 #endif
 
+#ifndef O_EXEC
+# define O_EXEC O_RDONLY /* This is often close enough in older systems.  */
+#endif
+
 #ifndef O_NDELAY
 # define O_NDELAY 0
 #endif
@@ -174,6 +228,19 @@ extern int openat (int fd, char const *file, int flags, /* mode_t mode */ ...)
 # define O_NONBLOCK O_NDELAY
 #endif
 
+/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero
+   value of O_NONBLOCK.  Otherwise, O_NONBLOCK is defined (above) to O_NDELAY
+   or to 0 as fallback.  */
+#if @GNULIB_NONBLOCKING@
+# if O_NONBLOCK
+#  define GNULIB_defined_O_NONBLOCK 0
+# else
+#  define GNULIB_defined_O_NONBLOCK 1
+#  undef O_NONBLOCK
+#  define O_NONBLOCK 0x40000000
+# endif
+#endif
+
 #ifndef O_NOCTTY
 # define O_NOCTTY 0
 #endif
@@ -190,6 +257,10 @@ extern int openat (int fd, char const *file, int flags, /* mode_t mode */ ...)
 # define O_RSYNC 0
 #endif
 
+#ifndef O_SEARCH
+# define O_SEARCH O_RDONLY /* This is often close enough in older systems.  */
+#endif
+
 #ifndef O_SYNC
 # define O_SYNC 0
 #endif
@@ -198,6 +269,11 @@ extern int openat (int fd, char const *file, int flags, /* mode_t mode */ ...)
 # define O_TTY_INIT 0
 #endif
 
+#if O_ACCMODE != (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+# undef O_ACCMODE
+# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH)
+#endif
+
 /* For systems that distinguish between text and binary I/O.
    O_BINARY is usually declared in fcntl.h  */
 #if !defined O_BINARY && defined _O_BINARY
@@ -254,6 +330,6 @@ extern int openat (int fd, char const *file, int flags, /* mode_t mode */ ...)
 #endif
 
 
-#endif /* _GL_FCNTL_H */
-#endif /* _GL_FCNTL_H */
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
+#endif /* _@GUARD_PREFIX@_FCNTL_H */
 #endif
diff --git a/lib/fd-hook.c b/lib/fd-hook.c
new file mode 100644 (file)
index 0000000..8f4ffe2
--- /dev/null
@@ -0,0 +1,116 @@
+/* Hook for making making file descriptor functions close(), ioctl() extensible.
+   Copyright (C) 2009-2012 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2009.
+
+   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 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "fd-hook.h"
+
+#include <stdlib.h>
+
+/* Currently, this entire code is only needed for the handling of sockets
+   on native Windows platforms.  */
+#if WINDOWS_SOCKETS
+
+/* The first and last link in the doubly linked list.
+   Initially the list is empty.  */
+static struct fd_hook anchor = { &anchor, &anchor, NULL, NULL };
+
+int
+execute_close_hooks (const struct fd_hook *remaining_list, gl_close_fn primary,
+                     int fd)
+{
+  if (remaining_list == &anchor)
+    /* End of list reached.  */
+    return primary (fd);
+  else
+    return remaining_list->private_close_fn (remaining_list->private_next,
+                                             primary, fd);
+}
+
+int
+execute_all_close_hooks (gl_close_fn primary, int fd)
+{
+  return execute_close_hooks (anchor.private_next, primary, fd);
+}
+
+int
+execute_ioctl_hooks (const struct fd_hook *remaining_list, gl_ioctl_fn primary,
+                     int fd, int request, void *arg)
+{
+  if (remaining_list == &anchor)
+    /* End of list reached.  */
+    return primary (fd, request, arg);
+  else
+    return remaining_list->private_ioctl_fn (remaining_list->private_next,
+                                             primary, fd, request, arg);
+}
+
+int
+execute_all_ioctl_hooks (gl_ioctl_fn primary,
+                         int fd, int request, void *arg)
+{
+  return execute_ioctl_hooks (anchor.private_next, primary, fd, request, arg);
+}
+
+void
+register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook, struct fd_hook *link)
+{
+  if (close_hook == NULL)
+    close_hook = execute_close_hooks;
+  if (ioctl_hook == NULL)
+    ioctl_hook = execute_ioctl_hooks;
+
+  if (link->private_next == NULL && link->private_prev == NULL)
+    {
+      /* Add the link to the doubly linked list.  */
+      link->private_next = anchor.private_next;
+      link->private_prev = &anchor;
+      link->private_close_fn = close_hook;
+      link->private_ioctl_fn = ioctl_hook;
+      anchor.private_next->private_prev = link;
+      anchor.private_next = link;
+    }
+  else
+    {
+      /* The link is already in use.  */
+      if (link->private_close_fn != close_hook
+          || link->private_ioctl_fn != ioctl_hook)
+        abort ();
+    }
+}
+
+void
+unregister_fd_hook (struct fd_hook *link)
+{
+  struct fd_hook *next = link->private_next;
+  struct fd_hook *prev = link->private_prev;
+
+  if (next != NULL && prev != NULL)
+    {
+      /* The link is in use.  Remove it from the doubly linked list.  */
+      prev->private_next = next;
+      next->private_prev = prev;
+      /* Clear the link, to mark it unused.  */
+      link->private_next = NULL;
+      link->private_prev = NULL;
+      link->private_close_fn = NULL;
+      link->private_ioctl_fn = NULL;
+    }
+}
+
+#endif
diff --git a/lib/fd-hook.h b/lib/fd-hook.h
new file mode 100644 (file)
index 0000000..721e9ad
--- /dev/null
@@ -0,0 +1,119 @@
+/* Hook for making making file descriptor functions close(), ioctl() extensible.
+   Copyright (C) 2009-2012 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 the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+
+#ifndef FD_HOOK_H
+#define FD_HOOK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Currently, this entire code is only needed for the handling of sockets
+   on native Windows platforms.  */
+#if WINDOWS_SOCKETS
+
+
+/* Type of function that closes FD.  */
+typedef int (*gl_close_fn) (int fd);
+
+/* Type of function that applies a control request to FD.  */
+typedef int (*gl_ioctl_fn) (int fd, int request, void *arg);
+
+/* An element of the list of file descriptor hooks.
+   In CLOS (Common Lisp Object System) speak, it consists of an "around"
+   method for the close() function and an "around" method for the ioctl()
+   function.
+   The fields of this structure are considered private.  */
+struct fd_hook
+{
+  /* Doubly linked list.  */
+  struct fd_hook *private_next;
+  struct fd_hook *private_prev;
+  /* Function that treats the types of FD that it knows about and calls
+     execute_close_hooks (REMAINING_LIST, PRIMARY, FD) as a fallback.  */
+  int (*private_close_fn) (const struct fd_hook *remaining_list,
+                           gl_close_fn primary,
+                           int fd);
+  /* Function that treats the types of FD that it knows about and calls
+     execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG) as a
+     fallback.  */
+  int (*private_ioctl_fn) (const struct fd_hook *remaining_list,
+                           gl_ioctl_fn primary,
+                           int fd, int request, void *arg);
+};
+
+/* This type of function closes FD, applying special knowledge for the FD
+   types it knows about, and calls
+   execute_close_hooks (REMAINING_LIST, PRIMARY, FD)
+   for the other FD types.
+   In CLOS speak, REMAINING_LIST is the remaining list of "around" methods,
+   and PRIMARY is the "primary" method for close().  */
+typedef int (*close_hook_fn) (const struct fd_hook *remaining_list,
+                              gl_close_fn primary,
+                              int fd);
+
+/* Execute the close hooks in REMAINING_LIST, with PRIMARY as "primary" method.
+   Return 0 or -1, like close() would do.  */
+extern int execute_close_hooks (const struct fd_hook *remaining_list,
+                                gl_close_fn primary,
+                                int fd);
+
+/* Execute all close hooks, with PRIMARY as "primary" method.
+   Return 0 or -1, like close() would do.  */
+extern int execute_all_close_hooks (gl_close_fn primary, int fd);
+
+/* This type of function applies a control request to FD, applying special
+   knowledge for the FD types it knows about, and calls
+   execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG)
+   for the other FD types.
+   In CLOS speak, REMAINING_LIST is the remaining list of "around" methods,
+   and PRIMARY is the "primary" method for ioctl().  */
+typedef int (*ioctl_hook_fn) (const struct fd_hook *remaining_list,
+                              gl_ioctl_fn primary,
+                              int fd, int request, void *arg);
+
+/* Execute the ioctl hooks in REMAINING_LIST, with PRIMARY as "primary" method.
+   Return 0 or -1, like ioctl() would do.  */
+extern int execute_ioctl_hooks (const struct fd_hook *remaining_list,
+                                gl_ioctl_fn primary,
+                                int fd, int request, void *arg);
+
+/* Execute all ioctl hooks, with PRIMARY as "primary" method.
+   Return 0 or -1, like ioctl() would do.  */
+extern int execute_all_ioctl_hooks (gl_ioctl_fn primary,
+                                    int fd, int request, void *arg);
+
+/* Add a function pair to the list of file descriptor hooks.
+   CLOSE_HOOK and IOCTL_HOOK may be NULL, indicating no change.
+   The LINK variable points to a piece of memory which is guaranteed to be
+   accessible until the corresponding call to unregister_fd_hook.  */
+extern void register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook,
+                              struct fd_hook *link);
+
+/* Removes a hook from the list of file descriptor hooks.  */
+extern void unregister_fd_hook (struct fd_hook *link);
+
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FD_HOOK_H */
index c1c600051227b95b8c33118fd0500978a31308bf..052837bdd1cb67b0f6f1234b35f28602668bbd07 100644 (file)
@@ -1,6 +1,6 @@
 /* Return a safer copy of a file descriptor.
 
-   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2012 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
index f7b29af30c62539f9836c3971bc990911b6701d2..4ae7d0539534475fd79a5a7a8b4f6d5ad71c0a2d 100644 (file)
@@ -1,5 +1,5 @@
 /* provide a replacement fdopendir function
-   Copyright (C) 2004-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 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
 #  include "dirent--.h"
 # endif
 
-/* Replacement for Solaris' function by the same name.
-   <http://www.google.com/search?q=fdopendir+site:docs.sun.com>
-   First, try to simulate it via opendir ("/proc/self/fd/FD").  Failing
+# ifndef REPLACE_FCHDIR
+#  define REPLACE_FCHDIR 0
+# endif
+
+static DIR *fdopendir_with_dup (int, int, struct saved_cwd const *);
+static DIR *fd_clone_opendir (int, struct saved_cwd const *);
+
+/* Replacement for POSIX fdopendir.
+
+   First, try to simulate it via opendir ("/proc/self/fd/...").  Failing
    that, simulate it by using fchdir metadata, or by doing
    save_cwd/fchdir/opendir(".")/restore_cwd.
    If either the save_cwd or the restore_cwd fails (relatively unlikely),
    then give a diagnostic and exit nonzero.
-   Otherwise, this function works just like Solaris' fdopendir.
+
+   If successful, the resulting stream is based on FD in
+   implementations where streams are based on file descriptors and in
+   applications where no other thread or signal handler allocates or
+   frees file descriptors.  In other cases, consult dirfd on the result
+   to find out whether FD is still being used.
+
+   Otherwise, this function works just like POSIX fdopendir.
 
    W A R N I N G:
-   Unlike other fd-related functions, this one effectively consumes
-   its FD parameter.  The caller should not close or otherwise
-   manipulate FD if this function returns successfully.  Also, this
-   implementation does not guarantee that dirfd(fdopendir(n))==n;
-   the open directory stream may use a clone of FD, or have no
-   associated fd at all.  */
+
+   Unlike other fd-related functions, this one places constraints on FD.
+   If this function returns successfully, FD is under control of the
+   dirent.h system, and the caller should not close or modify the state of
+   FD other than by the dirent.h functions.  */
 DIR *
 fdopendir (int fd)
 {
-  int saved_errno;
-  DIR *dir;
+  DIR *dir = fdopendir_with_dup (fd, -1, NULL);
 
-  char buf[OPENAT_BUFFER_SIZE];
-  char *proc_file = openat_proc_name (buf, fd, ".");
-  if (proc_file)
+  if (! REPLACE_FCHDIR && ! dir)
     {
-      dir = opendir (proc_file);
-      saved_errno = errno;
+      int saved_errno = errno;
+      if (EXPECTED_ERRNO (saved_errno))
+        {
+          struct saved_cwd cwd;
+          if (save_cwd (&cwd) != 0)
+            openat_save_fail (errno);
+          dir = fdopendir_with_dup (fd, -1, &cwd);
+          saved_errno = errno;
+          free_cwd (&cwd);
+          errno = saved_errno;
+        }
     }
+
+  return dir;
+}
+
+/* Like fdopendir, except that if OLDER_DUPFD is not -1, it is known
+   to be a dup of FD which is less than FD - 1 and which will be
+   closed by the caller and not otherwise used by the caller.  This
+   function makes sure that FD is closed and all file descriptors less
+   than FD are open, and then calls fd_clone_opendir on a dup of FD.
+   That way, barring race conditions, fd_clone_opendir returns a
+   stream whose file descriptor is FD.
+
+   If REPLACE_CHDIR or CWD is null, use opendir ("/proc/self/fd/...",
+   falling back on fchdir metadata.  Otherwise, CWD is a saved version
+   of the working directory; use fchdir/opendir(".")/restore_cwd(CWD).  */
+static DIR *
+fdopendir_with_dup (int fd, int older_dupfd, struct saved_cwd const *cwd)
+{
+  int dupfd = dup (fd);
+  if (dupfd < 0 && errno == EMFILE)
+    dupfd = older_dupfd;
+  if (dupfd < 0)
+    return NULL;
   else
     {
-      dir = NULL;
-      saved_errno = EOPNOTSUPP;
+      DIR *dir;
+      int saved_errno;
+      if (dupfd < fd - 1 && dupfd != older_dupfd)
+        {
+          dir = fdopendir_with_dup (fd, dupfd, cwd);
+          saved_errno = errno;
+        }
+      else
+        {
+          close (fd);
+          dir = fd_clone_opendir (dupfd, cwd);
+          saved_errno = errno;
+          if (! dir)
+            {
+              int fd1 = dup (dupfd);
+              if (fd1 != fd)
+                openat_save_fail (fd1 < 0 ? errno : EBADF);
+            }
+        }
+
+      if (dupfd != older_dupfd)
+        close (dupfd);
+      errno = saved_errno;
+      return dir;
     }
+}
 
-  /* If the syscall fails with an expected errno value, resort to
-     save_cwd/restore_cwd.  */
-  if (! dir && EXPECTED_ERRNO (saved_errno))
+/* Like fdopendir, except the result controls a clone of FD.  It is
+   the caller's responsibility both to close FD and (if the result is
+   not null) to closedir the result.  */
+static DIR *
+fd_clone_opendir (int fd, struct saved_cwd const *cwd)
+{
+  if (REPLACE_FCHDIR || ! cwd)
     {
-# if REPLACE_FCHDIR
-      const char *name = _gl_directory_name (fd);
-      if (name)
-        dir = opendir (name);
-      saved_errno = errno;
-# else /* !REPLACE_FCHDIR */
-      struct saved_cwd saved_cwd;
-      if (save_cwd (&saved_cwd) != 0)
-        openat_save_fail (errno);
-
-      if (fchdir (fd) != 0)
+      DIR *dir = NULL;
+      int saved_errno = EOPNOTSUPP;
+      char buf[OPENAT_BUFFER_SIZE];
+      char *proc_file = openat_proc_name (buf, fd, ".");
+      if (proc_file)
         {
-          dir = NULL;
+          dir = opendir (proc_file);
           saved_errno = errno;
+          if (proc_file != buf)
+            free (proc_file);
+        }
+# if REPLACE_FCHDIR
+      if (! dir && EXPECTED_ERRNO (saved_errno))
+        {
+          char const *name = _gl_directory_name (fd);
+          return (name ? opendir (name) : NULL);
         }
+# endif
+      errno = saved_errno;
+      return dir;
+    }
+  else
+    {
+      if (fchdir (fd) != 0)
+        return NULL;
       else
         {
-          dir = opendir (".");
-          saved_errno = errno;
-
-          if (restore_cwd (&saved_cwd) != 0)
+          DIR *dir = opendir (".");
+          int saved_errno = errno;
+          if (restore_cwd (cwd) != 0)
             openat_restore_fail (errno);
+          errno = saved_errno;
+          return dir;
         }
-
-      free_cwd (&saved_cwd);
-# endif /* !REPLACE_FCHDIR */
     }
-
-  if (dir)
-    close (fd);
-  if (proc_file != buf)
-    free (proc_file);
-  errno = saved_errno;
-  return dir;
 }
 
 #else /* HAVE_FDOPENDIR */
index ead4875498e760bc572310d49d02131a1d902573..fa6f389fb94cb7cb5acc5c76f5a59c88e9a2000b 100644 (file)
@@ -1,5 +1,5 @@
 /* fflush.c -- allow flushing input streams
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
@@ -28,6 +28,8 @@
 
 #include "stdio-impl.h"
 
+#include "unused-parameter.h"
+
 #undef fflush
 
 
@@ -60,7 +62,7 @@ clear_ungetc_buffer (FILE *fp)
       fp->_ungetc_count = 0;
       fp->_rcount = - fp->_rcount;
     }
-# elif defined _IOERR               /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+# elif defined _IOERR               /* Minix, AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
   /* Nothing to do.  */
 # else                              /* other implementations */
   fseeko (fp, 0, SEEK_CUR);
@@ -88,7 +90,8 @@ restore_seek_optimization (FILE *fp, int saved_flags)
 #endif
 
 static inline void
-update_fpos_cache (FILE *fp, off_t pos)
+update_fpos_cache (FILE *fp _GL_UNUSED_PARAMETER,
+                   off_t pos _GL_UNUSED_PARAMETER)
 {
 #if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
 # if defined __CYGWIN__
diff --git a/lib/filename.h b/lib/filename.h
new file mode 100644 (file)
index 0000000..7b89d0d
--- /dev/null
@@ -0,0 +1,54 @@
+/* Basic filename support macros.
+   Copyright (C) 2001-2004, 2007-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _FILENAME_H
+#define _FILENAME_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Pathname support.
+   ISSLASH(C)           tests whether C is a directory separator character.
+   IS_ABSOLUTE_PATH(P)  tests whether P is an absolute path.  If it is not,
+                        it may be concatenated to a directory pathname.
+   IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
+ */
+#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+  /* Native Windows, Cygwin, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+# define HAS_DEVICE(P) \
+    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
+     && (P)[1] == ':')
+# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
+# define IS_PATH_WITH_DIR(P) \
+    (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
+# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
+#else
+  /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
+# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
+# define FILE_SYSTEM_PREFIX_LEN(P) 0
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FILENAME_H */
diff --git a/lib/filenamecat-lgpl.c b/lib/filenamecat-lgpl.c
new file mode 100644 (file)
index 0000000..c7c4617
--- /dev/null
@@ -0,0 +1,88 @@
+/* Concatenate two arbitrary file names.
+
+   Copyright (C) 1996-2007, 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Jim Meyering.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "filenamecat.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "dirname.h"
+
+#if ! HAVE_MEMPCPY && ! defined mempcpy
+# define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
+#endif
+
+/* Return the longest suffix of F that is a relative file name.
+   If it has no such suffix, return the empty string.  */
+
+static char const * _GL_ATTRIBUTE_PURE
+longest_relative_suffix (char const *f)
+{
+  for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++)
+    continue;
+  return f;
+}
+
+/* Concatenate two file name components, DIR and ABASE, in
+   newly-allocated storage and return the result.
+   The resulting file name F is such that the commands "ls F" and "(cd
+   DIR; ls BASE)" refer to the same file, where BASE is ABASE with any
+   file system prefixes and leading separators removed.
+   Arrange for a directory separator if necessary between DIR and BASE
+   in the result, removing any redundant separators.
+   In any case, if BASE_IN_RESULT is non-NULL, set
+   *BASE_IN_RESULT to point to the copy of ABASE in the returned
+   concatenation.  However, if ABASE begins with more than one slash,
+   set *BASE_IN_RESULT to point to the sole corresponding slash that
+   is copied into the result buffer.
+
+   Return NULL if malloc fails.  */
+
+char *
+mfile_name_concat (char const *dir, char const *abase, char **base_in_result)
+{
+  char const *dirbase = last_component (dir);
+  size_t dirbaselen = base_len (dirbase);
+  size_t dirlen = dirbase - dir + dirbaselen;
+  size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1]));
+
+  char const *base = longest_relative_suffix (abase);
+  size_t baselen = strlen (base);
+
+  char *p_concat = malloc (dirlen + needs_separator + baselen + 1);
+  char *p;
+
+  if (p_concat == NULL)
+    return NULL;
+
+  p = mempcpy (p_concat, dir, dirlen);
+  *p = DIRECTORY_SEPARATOR;
+  p += needs_separator;
+
+  if (base_in_result)
+    *base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase);
+
+  p = mempcpy (p, base, baselen);
+  *p = '\0';
+
+  return p_concat;
+}
diff --git a/lib/filenamecat.h b/lib/filenamecat.h
new file mode 100644 (file)
index 0000000..e7b2e30
--- /dev/null
@@ -0,0 +1,27 @@
+/* Concatenate two arbitrary file names.
+
+   Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Jim Meyering.  */
+
+#if GNULIB_FILENAMECAT
+char *file_name_concat (char const *dir, char const *base,
+                        char **base_in_result);
+#endif
+
+char *mfile_name_concat (char const *dir, char const *base,
+                         char **base_in_result);
index 4a120b77b401a1d9f56d2fc4a6afc4a0d51bd977..75e56a12192ff6059c7801ef66a1eba96f89c68a 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Supplemental information about the floating-point formats.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software; you can redistribute it and/or modify
@@ -15,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _FLOATPLUS_H
 #define _FLOATPLUS_H
 #define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
 
 /* Verify that SIZEOF_FLT <= sizeof (float) etc.  */
-typedef int verify_sizeof_flt[2 * (SIZEOF_FLT <= sizeof (float)) - 1];
-typedef int verify_sizeof_dbl[2 * (SIZEOF_DBL <= sizeof (double)) - 1];
-typedef int verify_sizeof_ldbl[2 * (SIZEOF_LDBL <= sizeof (long double)) - 1];
+typedef int verify_sizeof_flt[SIZEOF_FLT <= sizeof (float) ? 1 : -1];
+typedef int verify_sizeof_dbl[SIZEOF_DBL <= sizeof (double) ? 1 : - 1];
+typedef int verify_sizeof_ldbl[SIZEOF_LDBL <= sizeof (long double) ? 1 : - 1];
 
 #endif /* _FLOATPLUS_H */
diff --git a/lib/float.c b/lib/float.c
new file mode 100644 (file)
index 0000000..ea31866
--- /dev/null
@@ -0,0 +1,33 @@
+/* Auxiliary definitions for <float.h>.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+   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 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <float.h>
+
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+const union gl_long_double_union gl_LDBL_MAX =
+  { { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
+#elif defined __i386__
+const union gl_long_double_union gl_LDBL_MAX =
+  { { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
+#else
+/* This declaration is solely to ensure that after preprocessing
+   this file is never empty.  */
+typedef int dummy;
+#endif
index caf822f1d0a98a043977c2e1283acb57c2aeffeb..b4205103be74fddcbddb7d8a6dcab8874fb2ad46 100644 (file)
@@ -1,6 +1,6 @@
 /* A correct <float.h>.
 
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_FLOAT_H
+#ifndef _@GUARD_PREFIX@_FLOAT_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_FLOAT_H@
 
-#ifndef _GL_FLOAT_H
-#define _GL_FLOAT_H
+#ifndef _@GUARD_PREFIX@_FLOAT_H
+#define _@GUARD_PREFIX@_FLOAT_H
 
 /* 'long double' properties.  */
+
 #if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
 /* Number of mantissa units, in base FLT_RADIX.  */
 # undef LDBL_MANT_DIG
 # define LDBL_MAX_10_EXP 4932
 #endif
 
-#endif /* _GL_FLOAT_H */
-#endif /* _GL_FLOAT_H */
+/* On FreeBSD/x86 6.4, the 'long double' type really has only 53 bits of
+   precision in the compiler but 64 bits of precision at runtime.  See
+   <http://lists.gnu.org/archive/html/bug-gnulib/2008-07/msg00063.html>.  */
+#if defined __i386__ && defined __FreeBSD__
+/* Number of mantissa units, in base FLT_RADIX.  */
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG   64
+/* Number of decimal digits that is sufficient for representing a number.  */
+# undef LDBL_DIG
+# define LDBL_DIG        18
+/* x-1 where x is the smallest representable number > 1.  */
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 1.084202172485504434007452800869941711426e-19L /* 2^-63 */
+/* Minimum e such that FLT_RADIX^(e-1) is a normalized number.  */
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
+/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number.  */
+# undef LDBL_MAX_EXP
+# define LDBL_MAX_EXP    16384
+/* Minimum positive normalized number.  */
+# undef LDBL_MIN
+# define LDBL_MIN        3.3621031431120935E-4932L /* = 0x1p-16382L */
+/* Maximum representable finite number.  */
+# undef LDBL_MAX
+/* LDBL_MAX is represented as { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }.
+   But the largest literal that GCC allows us to write is
+   0x0.fffffffffffff8p16384L = { 0xFFFFF800, 0xFFFFFFFF, 32766 }.
+   So, define it like this through a reference to an external variable
+
+     const unsigned int LDBL_MAX[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 32766 };
+     extern const long double LDBL_MAX;
+
+   Unfortunately, this is not a constant expression.  */
+union gl_long_double_union
+  {
+    struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd;
+    long double ld;
+  };
+extern const union gl_long_double_union gl_LDBL_MAX;
+# define LDBL_MAX (gl_LDBL_MAX.ld)
+/* Minimum e such that 10^e is in the range of normalized numbers.  */
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP (-4931)
+/* Maximum e such that 10^e is in the range of representable finite numbers.  */
+# undef LDBL_MAX_10_EXP
+# define LDBL_MAX_10_EXP 4932
+#endif
+
+/* On AIX 7.1 with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_MAX are
+   wrong.
+   On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong.  */
+#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+# undef LDBL_MIN_10_EXP
+# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
+# undef LDBL_MIN
+# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
+#endif
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MAX
+/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
+   It is not easy to define:
+     #define LDBL_MAX 1.79769313486231580793728971405302307166e308L
+   is too small, whereas
+     #define LDBL_MAX 1.79769313486231580793728971405302307167e308L
+   is too large.  Apparently a bug in GCC decimal-to-binary conversion.
+   Also, I can't get values larger than
+     #define LDBL63 ((long double) (1ULL << 63))
+     #define LDBL882 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+     #define LDBL945 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+     #define LDBL1008 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)
+     #define LDBL_MAX (LDBL1008 * 65535.0L + LDBL945 * (long double) 9223372036821221375ULL + LDBL882 * (long double) 4611686018427387904ULL)
+   which is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xF8000000 }.
+   So, define it like this through a reference to an external variable
+
+     const double LDBL_MAX[2] = { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL };
+     extern const long double LDBL_MAX;
+
+   or through a pointer cast
+
+     #define LDBL_MAX \
+       (*(const long double *) (double[]) { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL })
+
+   Unfortunately, this is not a constant expression, and the latter expression
+   does not work well when GCC is optimizing..  */
+union gl_long_double_union
+  {
+    struct { double hi; double lo; } dd;
+    long double ld;
+  };
+extern const union gl_long_double_union gl_LDBL_MAX;
+# define LDBL_MAX (gl_LDBL_MAX.ld)
+#endif
+
+/* On IRIX 6.5, with cc, the value of LDBL_MANT_DIG is wrong.
+   On IRIX 6.5, with gcc 4.2, the values of LDBL_MIN_EXP, LDBL_MIN, LDBL_EPSILON
+   are wrong.  */
+#if defined __sgi && (LDBL_MANT_DIG >= 106)
+# undef LDBL_MANT_DIG
+# define LDBL_MANT_DIG 106
+# if defined __GNUC__
+#  undef LDBL_MIN_EXP
+#  define LDBL_MIN_EXP DBL_MIN_EXP
+#  undef LDBL_MIN_10_EXP
+#  define LDBL_MIN_10_EXP DBL_MIN_10_EXP
+#  undef LDBL_MIN
+#  define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
+#  undef LDBL_EPSILON
+#  define LDBL_EPSILON 2.46519032881566189191165176650870696773e-32L /* 2^-105 */
+# endif
+#endif
+
+#if @REPLACE_ITOLD@
+/* Pull in a function that fixes the 'int' to 'long double' conversion
+   of glibc 2.7.  */
+extern
+# ifdef __cplusplus
+"C"
+# endif
+void _Qp_itoq (long double *, int);
+static void (*_gl_float_fix_itold) (long double *, int) = _Qp_itoq;
+#endif
+
+#endif /* _@GUARD_PREFIX@_FLOAT_H */
+#endif /* _@GUARD_PREFIX@_FLOAT_H */
index 774b396e65ffc723982e6bf3738083a1cfddc489..2591d53437748c4387ee45a391a8f271c2c3bc00 100644 (file)
@@ -1,5 +1,5 @@
 /* fpending.c -- return the number of pending output bytes on a stream
-   Copyright (C) 2000, 2004, 2006-2007, 2009-2010 Free Software Foundation,
+   Copyright (C) 2000, 2004, 2006-2007, 2009-2012 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
index fff34f1ed4b88afe840d79b6bbbe7522945c4d1f..5b5d71c0240f0a683ad0963e972b883783df6657 100644 (file)
@@ -1,6 +1,6 @@
 /* Declare __fpending.
 
-   Copyright (C) 2000, 2003, 2005-2006, 2009-2010 Free Software Foundation,
+   Copyright (C) 2000, 2003, 2005-2006, 2009-2012 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
index fda2a49c188ed67da3a1bde94a6a0cd6892e68dd..f1bf59ffe4cd76d98249c675b41707f3f1f4509f 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to a stream.
-   Copyright (C) 2004, 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2012 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
index c855faea5d3bd8fdf7d508f68dab7ee100e01c6c..23e4c81411805b52a65a40a9de4c932f0727e06e 100644 (file)
@@ -1,5 +1,5 @@
 /* Manipulating the FPU control word.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software: you can redistribute it and/or modify
@@ -30,7 +30,8 @@
 
    On some platforms, such as NetBSD, the default precision is set to
    "double precision".  This means that 'long double' instructions will operate
-   only as 'double', i.e. lead wrong results.
+   only as 'double', i.e. lead to wrong results.  Similarly on FreeBSD 6.4, at
+   least for the division of 'long double' numbers.
 
    The FPU control word is under control of the application, i.e. it is
    not required to be set either way by the ABI.  (In fact, the i386 ABI
index 079a2995acd57b2a30895c0b51730836a0574728..24c28d843c054d98a0976d71341594e4d8cadb28 100644 (file)
@@ -1,5 +1,5 @@
 /* Flushing buffers of a FILE stream.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
@@ -91,7 +91,12 @@ fpurge (FILE *fp)
   fp->_wcount = 0;
   fp->_ungetc_count = 0;
   return 0;
-# elif defined _IOERR               /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+# elif defined __minix              /* Minix */
+  fp->_ptr = fp->_buf;
+  if (fp->_ptr != NULL)
+    fp->_count = 0;
+  return 0;
+# elif defined _IOERR               /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
   fp->_ptr = fp->_base;
   if (fp->_ptr != NULL)
     fp->_cnt = 0;
@@ -129,8 +134,11 @@ fpurge (FILE *fp)
   /* Nothing in the buffer, next putc is nontrivial.  */
   fp->__put_limit = fp->__buffer;
   return 0;
+# elif defined EPLAN9               /* Plan9 */
+  fp->rp = fp->wp = fp->lp = fp->buf;
+  return 0;
 # else
- #error "Please port gnulib fpurge.c to your platform! Look at the definitions of fflush, setvbuf and ungetc on your system, then report this to bug-gnulib."
+#  error "Please port gnulib fpurge.c to your platform! Look at the definitions of fflush, setvbuf and ungetc on your system, then report this to bug-gnulib."
 # endif
 
 #endif
index 50ff27ee20a012c8d13c1a43cceaeb3c5098f77c..2ba8b344884e312e9a5c841a0a291ececc69c524 100644 (file)
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
@@ -48,7 +48,11 @@ freadahead (FILE *fp)
   /* equivalent to
      (fp->_ungetc_count == 0 ? fp->_rcount : fp->_ungetc_count - fp->_rcount) */
   return (fp->_rcount > 0 ? fp->_rcount : fp->_ungetc_count - fp->_rcount);
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+#elif defined __minix               /* Minix */
+  if ((fp_->_flags & _IOWRITING) != 0)
+    return 0;
+  return fp_->_count;
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
   if ((fp_->_flag & _IOWRT) != 0)
     return 0;
   return fp_->_cnt;
@@ -76,6 +80,10 @@ freadahead (FILE *fp)
   return (fp->__pushed_back
           ? fp->__get_limit - fp->__pushback_bufp + 1
           : fp->__get_limit - fp->__bufp);
+#elif defined EPLAN9                /* Plan9 */
+  if (fp->state == 4 /* WR */ || fp->rp >= fp->wp)
+    return 0;
+  return fp->wp - fp->rp;
 #elif defined SLOW_BUT_NO_HACKS     /* users can define this */
   abort ();
   return 0;
index 54466b4075ef23ddf58802f771ca9038c7a7b7c0..d87460243d828423aa7cea5808a74638b2f19005 100644 (file)
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
@@ -31,7 +31,7 @@ extern "C" {
 
    STREAM must not be wide-character oriented.  */
 
-extern size_t freadahead (FILE *stream);
+extern size_t freadahead (FILE *stream) _GL_ATTRIBUTE_PURE;
 
 #ifdef __cplusplus
 }
index faca60e1048ba0b8189906f80d253ade236329b5..e235e949f42997fd34d1eee058b96cf3b5abcbdc 100644 (file)
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
@@ -23,7 +23,7 @@
 
 /* Don't use glibc's __freading function in glibc < 2.7, see
    <http://sourceware.org/bugzilla/show_bug.cgi?id=4359>  */
-#if !(HAVE___FREADING && (!defined __GLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)))
+#if !(HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)))
 
 bool
 freading (FILE *fp)
@@ -31,34 +31,44 @@ freading (FILE *fp)
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
   return ((fp->_flags & _IO_NO_WRITES) != 0
           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
               && fp->_IO_read_base != NULL));
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
+# elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
   return (fp_->_flags & __SRD) != 0;
-#elif defined __EMX__               /* emx+gcc */
+# elif defined __EMX__               /* emx+gcc */
   return (fp->_flags & _IOREAD) != 0;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+# elif defined __minix               /* Minix */
+  return (fp->_flags & _IOREADING) != 0;
+# elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
+#  if defined __sun                  /* Solaris */
+  return (fp->_flag & _IOREAD) != 0 && (fp->_flag & _IOWRT) == 0;
+#  else
   return (fp->_flag & _IOREAD) != 0;
-#elif defined __UCLIBC__            /* uClibc */
+#  endif
+# elif defined __UCLIBC__            /* uClibc */
   return (fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) != 0;
-#elif defined __QNX__               /* QNX */
+# elif defined __QNX__               /* QNX */
   return ((fp->_Mode & 0x2 /* _MOPENW */) == 0
           || (fp->_Mode & 0x1000 /* _MREAD */) != 0);
-#elif defined __MINT__              /* Atari FreeMiNT */
+# elif defined __MINT__              /* Atari FreeMiNT */
   if (!fp->__mode.__write)
     return 1;
   if (!fp->__mode.__read)
     return 0;
-# ifdef _IO_CURRENTLY_GETTING /* Flag added on 2009-02-28 */
+#  ifdef _IO_CURRENTLY_GETTING /* Flag added on 2009-02-28 */
   return (fp->__flags & _IO_CURRENTLY_GETTING) != 0;
-# else
+#  else
   return (fp->__buffer < fp->__get_limit /*|| fp->__bufp == fp->__put_limit ??*/);
+#  endif
+# elif defined EPLAN9                /* Plan9 */
+  if (fp->state == 0 /* CLOSED */ || fp->state == 4 /* WR */)
+    return 0;
+  return (fp->state == 3 /* RD */ && (fp->bufl == 0 || fp->rp < fp->wp));
+# else
+#  error "Please port gnulib freading.c to your platform!"
 # endif
-#else
- #error "Please port gnulib freading.c to your platform!"
-#endif
 }
 
 #endif
index 9b3b6c6a8d1097680d0865b981189f6929080b48..9668d20232dd6492ecbdce9fc90518d284f2322f 100644 (file)
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
@@ -32,7 +32,7 @@
 
    STREAM must not be wide-character oriented.  */
 
-#if HAVE___FREADING && (!defined __GLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
+#if HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
 /* Solaris >= 7, not glibc >= 2.2, but glibc >= 2.7  */
 
 # include <stdio_ext.h>
index e139885c338fe34aec03ce8b78f5a31eaa7498f3..4f5d0c03e8cdde6ae5db5391fc2966359f41934d 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a double into fraction and mantissa.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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,7 +17,9 @@
 /* Written by Paolo Bonzini <bonzini@gnu.org>, 2003, and
    Bruno Haible <bruno@clisp.org>, 2007.  */
 
-#include <config.h>
+#if ! defined USE_LONG_DOUBLE
+# include <config.h>
+#endif
 
 /* Specification.  */
 #include <math.h>
index c80599953947bb54a80c2ccfb7842a1a026b415b..b74ceeb56f815890e3515790dce9f33bd614a4c9 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a 'long double' into fraction and mantissa.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#define USE_LONG_DOUBLE
-#include "frexp.c"
+#include <config.h>
+
+#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+
+/* Specification.  */
+# include <math.h>
+
+long double
+frexpl (long double x, int *expptr)
+{
+  return frexp (x, expptr);
+}
+
+#else
+
+# define USE_LONG_DOUBLE
+# include "frexp.c"
+
+#endif
diff --git a/lib/fseek.c b/lib/fseek.c
new file mode 100644 (file)
index 0000000..20f5e2c
--- /dev/null
@@ -0,0 +1,30 @@
+/* An fseek() function that, together with fflush(), is POSIX compliant.
+   Copyright (C) 2007, 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdio.h>
+
+/* Get off_t.  */
+#include <unistd.h>
+
+int
+fseek (FILE *fp, long offset, int whence)
+{
+  /* Use the replacement fseeko function with all its workarounds.  */
+  return fseeko (fp, (off_t)offset, whence);
+}
index 03a4d996b34327ecd4d1108dd39108f8dbd9e5c7..c372a5c142bff33d647c34dc08ef5820936a48fc 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* An fseeko() function that, together with fflush(), is POSIX compliant.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
@@ -14,8 +12,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 
 #include "stdio-impl.h"
 
+int
+fseeko (FILE *fp, off_t offset, int whence)
 #undef fseeko
 #if !HAVE_FSEEKO
 # undef fseek
 # define fseeko fseek
 #endif
-
-int
-rpl_fseeko (FILE *fp, off_t offset, int whence)
+#if _GL_WINDOWS_64_BIT_OFF_T
+# undef fseeko
+# if HAVE__FSEEKI64 /* msvc, mingw64 */
+#  define fseeko _fseeki64
+# else /* mingw */
+#  define fseeko fseeko64
+# endif
+#endif
 {
 #if LSEEK_PIPE_BROKEN
   /* mingw gives bogus answers rather than failure on non-seekable files.  */
@@ -72,7 +76,10 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
       && fp->_rcount == 0
       && fp->_wcount == 0
       && fp->_ungetc_count == 0)
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+#elif defined __minix               /* Minix */
+  if (fp_->_ptr == fp_->_buf
+      && (fp_->_ptr == NULL || fp_->_count == 0))
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
   if (fp_->_ptr == fp_->_base
       && (fp_->_ptr == NULL || fp_->_cnt == 0))
 #elif defined __UCLIBC__            /* uClibc */
@@ -89,18 +96,17 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
       && fp->__get_limit == fp->__bufp
       && fp->__put_limit == fp->__bufp
       && !fp->__pushed_back)
+#elif defined EPLAN9                /* Plan9 */
+  if (fp->rp == fp->buf
+      && fp->wp == fp->buf)
 #else
   #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib."
 #endif
     {
-      /* We get here when an fflush() call immediately preceded this one.  We
-         know there are no buffers.
-         POSIX requires us to modify the file descriptor's position.
-         But we cannot position beyond end of file here.  */
-      off_t pos =
-        lseek (fileno (fp),
-               whence == SEEK_END && offset > 0 ? 0 : offset,
-               whence);
+      /* We get here when an fflush() call immediately preceded this one (or
+         if ftell() has created buffers but no I/O has occurred on a
+         newly-opened stream).  We know there are no buffers.  */
+      off_t pos = lseek (fileno (fp), offset, whence);
       if (pos == -1)
         {
 #if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
@@ -111,6 +117,7 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
 
 #if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
       fp->_flags &= ~_IO_EOF_SEEN;
+      fp->_offset = pos;
 #elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
 # if defined __CYGWIN__
       /* fp_->_offset is typed as an integer.  */
@@ -134,16 +141,13 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
       fp_->_flags &= ~__SEOF;
 #elif defined __EMX__               /* emx+gcc */
       fp->_flags &= ~_IOEOF;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
       fp->_flag &= ~_IOEOF;
 #elif defined __MINT__              /* Atari FreeMiNT */
       fp->__offset = pos;
       fp->__eof = 0;
 #endif
-      /* If we were not requested to position beyond end of file, we're
-         done.  */
-      if (!(whence == SEEK_END && offset > 0))
-        return 0;
+      return 0;
     }
   return fseeko (fp, offset, whence);
 }
index b1a379ebba8de04a1adfac20f946d12deefbb655..78791af3dca25a141092e297ec40394866d4c78a 100644 (file)
@@ -1,5 +1,5 @@
 /* Set the error indicator of a stream.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
@@ -35,7 +35,9 @@ fseterr (FILE *fp)
   fp_->_flags |= __SERR;
 #elif defined __EMX__               /* emx+gcc */
   fp->_flags |= _IOERR;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+#elif defined __minix               /* Minix */
+  fp->_flags |= _IOERR;
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
   fp_->_flag |= _IOERR;
 #elif defined __UCLIBC__            /* uClibc */
   fp->__modeflags |= __FLAG_ERROR;
@@ -43,6 +45,9 @@ fseterr (FILE *fp)
   fp->_Mode |= 0x200 /* _MERR */;
 #elif defined __MINT__              /* Atari FreeMiNT */
   fp->__error = 1;
+#elif defined EPLAN9                /* Plan9 */
+  if (fp->state != 0 /* CLOSED */)
+    fp->state = 5 /* ERR */;
 #elif 0                             /* unknown  */
   /* Portable fallback, based on an idea by Rich Felker.
      Wow! 6 system calls for something that is just a bit operation!
index 178f0bc72b2a3c7e33958a60d043e39061b65a73..b3930c5a88dbaa5f564696849eebb702183657c8 100644 (file)
@@ -1,5 +1,5 @@
 /* Set the error indicator of a stream.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
diff --git a/lib/fstat.c b/lib/fstat.c
new file mode 100644 (file)
index 0000000..ac2b1ef
--- /dev/null
@@ -0,0 +1,86 @@
+/* fstat() replacement.
+   Copyright (C) 2011-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+   the system's <sys/stat.h> here, so that orig_fstat doesn't recurse to
+   rpl_fstat.  */
+#define __need_system_sys_stat_h
+#include <config.h>
+
+/* Get the original definition of fstat.  It might be defined as a macro.  */
+#include <sys/types.h>
+#include <sys/stat.h>
+#if _GL_WINDOWS_64_BIT_ST_SIZE
+# define stat _stati64
+# define fstat _fstati64
+#endif
+#undef __need_system_sys_stat_h
+
+static inline int
+orig_fstat (int fd, struct stat *buf)
+{
+  return fstat (fd, buf);
+}
+
+/* Specification.  */
+/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
+   eliminates this include because of the preliminary #include <sys/stat.h>
+   above.  */
+#include "sys/stat.h"
+
+#include <errno.h>
+#include <unistd.h>
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static inline int
+fstat_nothrow (int fd, struct stat *buf)
+{
+  int result;
+
+  TRY_MSVC_INVAL
+    {
+      result = orig_fstat (fd, buf);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = -1;
+      errno = EBADF;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+#else
+# define fstat_nothrow orig_fstat
+#endif
+
+int
+rpl_fstat (int fd, struct stat *buf)
+{
+#if REPLACE_FCHDIR && REPLACE_OPEN_DIRECTORY
+  /* Handle the case when rpl_open() used a dummy file descriptor to work
+     around an open() that can't normally visit directories.  */
+  const char *name = _gl_directory_name (fd);
+  if (name != NULL)
+    return stat (name, buf);
+#endif
+
+  return fstat_nothrow (fd, buf);
+}
diff --git a/lib/fstatat.c b/lib/fstatat.c
deleted file mode 100644 (file)
index bd295b0..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Work around an fstatat bug on Solaris 9.
-
-   Copyright (C) 2006, 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Written by Paul Eggert and Jim Meyering.  */
-
-#include <config.h>
-
-#include <sys/stat.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-
-#if HAVE_FSTATAT
-
-# undef fstatat
-
-/* fstatat should always follow symbolic links that end in /, but on
-   Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified.
-   Likewise, trailing slash on a non-directory should be an error.
-   These are the same problems that lstat.c and stat.c address, so
-   solve it in a similar way.  */
-
-int
-rpl_fstatat (int fd, char const *file, struct stat *st, int flag)
-{
-  int result = fstatat (fd, file, st, flag);
-  size_t len;
-
-  if (result != 0)
-    return result;
-  len = strlen (file);
-  if (flag & AT_SYMLINK_NOFOLLOW)
-    {
-      /* Fix lstat behavior.  */
-      if (file[len - 1] != '/' || S_ISDIR (st->st_mode))
-        return 0;
-      if (!S_ISLNK (st->st_mode))
-        {
-          errno = ENOTDIR;
-          return -1;
-        }
-      result = fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW);
-    }
-  /* Fix stat behavior.  */
-  if (result == 0 && !S_ISDIR (st->st_mode) && file[len - 1] == '/')
-    {
-      errno = ENOTDIR;
-      return -1;
-    }
-  return result;
-}
-
-#else /* !HAVE_FSTATAT */
-
-/* On mingw, the gnulib <sys/stat.h> defines `stat' as a function-like
-   macro; but using it in AT_FUNC_F2 causes compilation failure
-   because the preprocessor sees a use of a macro that requires two
-   arguments but is only given one.  Hence, we need an inline
-   forwarder to get past the preprocessor.  */
-static inline int
-stat_func (char const *name, struct stat *st)
-{
-  return stat (name, st);
-}
-
-/* Likewise, if there is no native `lstat', then the gnulib
-   <sys/stat.h> defined it as stat, which also needs adjustment.  */
-# if !HAVE_LSTAT
-#  undef lstat
-#  define lstat stat_func
-# endif
-
-/* Replacement for Solaris' function by the same name.
-   <http://www.google.com/search?q=fstatat+site:docs.sun.com>
-   First, try to simulate it via l?stat ("/proc/self/fd/FD/FILE").
-   Failing that, simulate it via save_cwd/fchdir/(stat|lstat)/restore_cwd.
-   If either the save_cwd or the restore_cwd fails (relatively unlikely),
-   then give a diagnostic and exit nonzero.
-   Otherwise, this function works just like Solaris' fstatat.  */
-
-# define AT_FUNC_NAME fstatat
-# define AT_FUNC_F1 lstat
-# define AT_FUNC_F2 stat_func
-# define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
-# define AT_FUNC_POST_FILE_PARAM_DECLS , struct stat *st, int flag
-# define AT_FUNC_POST_FILE_ARGS        , st
-# include "at-func.c"
-# undef AT_FUNC_NAME
-# undef AT_FUNC_F1
-# undef AT_FUNC_F2
-# undef AT_FUNC_USE_F1_COND
-# undef AT_FUNC_POST_FILE_PARAM_DECLS
-# undef AT_FUNC_POST_FILE_ARGS
-
-#endif /* !HAVE_FSTATAT */
diff --git a/lib/ftell.c b/lib/ftell.c
new file mode 100644 (file)
index 0000000..817e9ff
--- /dev/null
@@ -0,0 +1,37 @@
+/* An ftell() function that works around platform bugs.
+   Copyright (C) 2007-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdio.h>
+
+#include <errno.h>
+#include <limits.h>
+
+long
+ftell (FILE *fp)
+{
+  /* Use the replacement ftello function with all its workarounds.  */
+  off_t offset = ftello (fp);
+  if (LONG_MIN <= offset && offset <= LONG_MAX)
+    return /* (long) */ offset;
+  else
+    {
+      errno = EOVERFLOW;
+      return -1;
+    }
+}
index 70cd3592e352b0f3d15561fac7299155d2714b86..1f581c5a4c8e2163b3937ad31e6ebb4ec374c676 100644 (file)
@@ -1,5 +1,5 @@
 /* An ftello() function that works around platform bugs.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
 /* Get lseek.  */
 #include <unistd.h>
 
+#include "stdio-impl.h"
+
+off_t
+ftello (FILE *fp)
 #undef ftello
 #if !HAVE_FTELLO
 # undef ftell
 # define ftello ftell
 #endif
-
-off_t
-rpl_ftello (FILE *fp)
+#if _GL_WINDOWS_64_BIT_OFF_T
+# undef ftello
+# if HAVE__FTELLI64 /* msvc, mingw64 */
+#  define ftello _ftelli64
+# else /* mingw */
+#  define ftello ftello64
+# endif
+#endif
 {
 #if LSEEK_PIPE_BROKEN
   /* mingw gives bogus answers rather than failure on non-seekable files.  */
@@ -37,6 +46,28 @@ rpl_ftello (FILE *fp)
     return -1;
 #endif
 
+#if FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE /* Solaris */
+  /* The Solaris stdio leaves the _IOREAD flag set after reading from a file
+     reaches EOF and the program then starts writing to the file.  ftello
+     gets confused by this.  */
+  if (fp_->_flag & _IOWRT)
+    {
+      off_t pos;
+
+      /* Call ftello nevertheless, for the side effects that it does on fp.  */
+      ftello (fp);
+
+      /* Compute the file position ourselves.  */
+      pos = lseek (fileno (fp), (off_t) 0, SEEK_CUR);
+      if (pos >= 0)
+        {
+          if ((fp_->_flag & _IONBF) == 0 && fp_->_base != NULL)
+            pos += fp_->_ptr - fp_->_base;
+        }
+      return pos;
+    }
+#endif
+
 #if defined __SL64 && defined __SCLE /* Cygwin */
   if ((fp->_flags & __SL64) == 0)
     {
diff --git a/lib/getcwd-lgpl.c b/lib/getcwd-lgpl.c
new file mode 100644 (file)
index 0000000..f1e821b
--- /dev/null
@@ -0,0 +1,125 @@
+/* Copyright (C) 2011-2012 Free Software Foundation, Inc.
+   This file is part of gnulib.
+
+   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 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification */
+#include <unistd.h>
+
+#include <errno.h>
+#include <string.h>
+
+#if GNULIB_GETCWD
+/* Favor GPL getcwd.c if both getcwd and getcwd-lgpl modules are in use.  */
+typedef int dummy;
+#else
+
+/* Get the name of the current working directory, and put it in SIZE
+   bytes of BUF.  Returns NULL if the directory couldn't be determined
+   (perhaps because the absolute name was longer than PATH_MAX, or
+   because of missing read/search permissions on parent directories)
+   or SIZE was too small.  If successful, returns BUF.  If BUF is
+   NULL, an array is allocated with 'malloc'; the array is SIZE bytes
+   long, unless SIZE == 0, in which case it is as big as
+   necessary.  */
+
+# undef getcwd
+char *
+rpl_getcwd (char *buf, size_t size)
+{
+  char *ptr;
+  char *result;
+
+  /* Handle single size operations.  */
+  if (buf)
+    {
+      if (!size)
+        {
+          errno = EINVAL;
+          return NULL;
+        }
+      return getcwd (buf, size);
+    }
+
+  if (size)
+    {
+      buf = malloc (size);
+      if (!buf)
+        {
+          errno = ENOMEM;
+          return NULL;
+        }
+      result = getcwd (buf, size);
+      if (!result)
+        {
+          int saved_errno = errno;
+          free (buf);
+          errno = saved_errno;
+        }
+      return result;
+    }
+
+  /* Flexible sizing requested.  Avoid over-allocation for the common
+     case of a name that fits within a 4k page, minus some space for
+     local variables, to be sure we don't skip over a guard page.  */
+  {
+    char tmp[4032];
+    size = sizeof tmp;
+    ptr = getcwd (tmp, size);
+    if (ptr)
+      {
+        result = strdup (ptr);
+        if (!result)
+          errno = ENOMEM;
+        return result;
+      }
+    if (errno != ERANGE)
+      return NULL;
+  }
+
+  /* My what a large directory name we have.  */
+  do
+    {
+      size <<= 1;
+      ptr = realloc (buf, size);
+      if (ptr == NULL)
+        {
+          free (buf);
+          errno = ENOMEM;
+          return NULL;
+        }
+      buf = ptr;
+      result = getcwd (buf, size);
+    }
+  while (!result && errno == ERANGE);
+
+  if (!result)
+    {
+      int saved_errno = errno;
+      free (buf);
+      errno = saved_errno;
+    }
+  else
+    {
+      /* Trim to fit, if possible.  */
+      result = realloc (buf, strlen (buf) + 1);
+      if (!result)
+        result = buf;
+    }
+  return result;
+}
+
+#endif
diff --git a/lib/getcwd.c b/lib/getcwd.c
deleted file mode 100644 (file)
index 1ba705c..0000000
+++ /dev/null
@@ -1,423 +0,0 @@
-/* Copyright (C) 1991-1999, 2004-2010 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
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#if !_LIBC
-# include <config.h>
-# include <unistd.h>
-#endif
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdbool.h>
-#include <stddef.h>
-
-#include <fcntl.h> /* For AT_FDCWD on Solaris 9.  */
-
-/* If this host provides the openat function, then enable
-   code below to make getcwd more efficient and robust.  */
-#ifdef HAVE_OPENAT
-# define HAVE_OPENAT_SUPPORT 1
-#else
-# define HAVE_OPENAT_SUPPORT 0
-#endif
-
-#ifndef __set_errno
-# define __set_errno(val) (errno = (val))
-#endif
-
-#include <dirent.h>
-#ifndef _D_EXACT_NAMLEN
-# define _D_EXACT_NAMLEN(d) strlen ((d)->d_name)
-#endif
-#ifndef _D_ALLOC_NAMLEN
-# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
-#endif
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
-#if _LIBC
-# ifndef mempcpy
-#  define mempcpy __mempcpy
-# endif
-#endif
-
-#include <limits.h>
-
-#ifndef MAX
-# define MAX(a, b) ((a) < (b) ? (b) : (a))
-#endif
-#ifndef MIN
-# define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
-#ifndef PATH_MAX
-# ifdef MAXPATHLEN
-#  define PATH_MAX MAXPATHLEN
-# else
-#  define PATH_MAX 1024
-# endif
-#endif
-
-#if D_INO_IN_DIRENT
-# define MATCHING_INO(dp, ino) ((dp)->d_ino == (ino))
-#else
-# define MATCHING_INO(dp, ino) true
-#endif
-
-#if !_LIBC
-# define __getcwd rpl_getcwd
-# define __lstat lstat
-# define __closedir closedir
-# define __opendir opendir
-# define __readdir readdir
-#endif
-
-/* The results of opendir() in this file are not used with dirfd and fchdir,
-   and we do not leak fds to any single-threaded code that could use stdio,
-   therefore save some unnecessary recursion in fchdir.c.
-   FIXME - if the kernel ever adds support for multi-thread safety for
-   avoiding standard fds, then we should use opendir_safer and
-   openat_safer.  */
-#undef opendir
-#undef closedir
-\f
-/* Get the name of the current working directory, and put it in SIZE
-   bytes of BUF.  Returns NULL if the directory couldn't be determined or
-   SIZE was too small.  If successful, returns BUF.  In GNU, if BUF is
-   NULL, an array is allocated with `malloc'; the array is SIZE bytes long,
-   unless SIZE == 0, in which case it is as big as necessary.  */
-
-char *
-__getcwd (char *buf, size_t size)
-{
-  /* Lengths of big file name components and entire file names, and a
-     deep level of file name nesting.  These numbers are not upper
-     bounds; they are merely large values suitable for initial
-     allocations, designed to be large enough for most real-world
-     uses.  */
-  enum
-    {
-      BIG_FILE_NAME_COMPONENT_LENGTH = 255,
-      BIG_FILE_NAME_LENGTH = MIN (4095, PATH_MAX - 1),
-      DEEP_NESTING = 100
-    };
-
-#if HAVE_OPENAT_SUPPORT
-  int fd = AT_FDCWD;
-  bool fd_needs_closing = false;
-#else
-  char dots[DEEP_NESTING * sizeof ".." + BIG_FILE_NAME_COMPONENT_LENGTH + 1];
-  char *dotlist = dots;
-  size_t dotsize = sizeof dots;
-  size_t dotlen = 0;
-#endif
-  DIR *dirstream = NULL;
-  dev_t rootdev, thisdev;
-  ino_t rootino, thisino;
-  char *dir;
-  register char *dirp;
-  struct stat st;
-  size_t allocated = size;
-  size_t used;
-
-#if HAVE_PARTLY_WORKING_GETCWD
-  /* The system getcwd works, except it sometimes fails when it
-     shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT.  If
-     AT_FDCWD is not defined, the algorithm below is O(N**2) and this
-     is much slower than the system getcwd (at least on GNU/Linux).
-     So trust the system getcwd's results unless they look
-     suspicious.
-
-     Use the system getcwd even if we have openat support, since the
-     system getcwd works even when a parent is unreadable, while the
-     openat-based approach does not.  */
-
-# undef getcwd
-  dir = getcwd (buf, size);
-  if (dir || (errno != ERANGE && errno != ENAMETOOLONG && errno != ENOENT))
-    return dir;
-#endif
-
-  if (size == 0)
-    {
-      if (buf != NULL)
-        {
-          __set_errno (EINVAL);
-          return NULL;
-        }
-
-      allocated = BIG_FILE_NAME_LENGTH + 1;
-    }
-
-  if (buf == NULL)
-    {
-      dir = malloc (allocated);
-      if (dir == NULL)
-        return NULL;
-    }
-  else
-    dir = buf;
-
-  dirp = dir + allocated;
-  *--dirp = '\0';
-
-  if (__lstat (".", &st) < 0)
-    goto lose;
-  thisdev = st.st_dev;
-  thisino = st.st_ino;
-
-  if (__lstat ("/", &st) < 0)
-    goto lose;
-  rootdev = st.st_dev;
-  rootino = st.st_ino;
-
-  while (!(thisdev == rootdev && thisino == rootino))
-    {
-      struct dirent *d;
-      dev_t dotdev;
-      ino_t dotino;
-      bool mount_point;
-      int parent_status;
-      size_t dirroom;
-      size_t namlen;
-      bool use_d_ino = true;
-
-      /* Look at the parent directory.  */
-#if HAVE_OPENAT_SUPPORT
-      fd = openat (fd, "..", O_RDONLY);
-      if (fd < 0)
-        goto lose;
-      fd_needs_closing = true;
-      parent_status = fstat (fd, &st);
-#else
-      dotlist[dotlen++] = '.';
-      dotlist[dotlen++] = '.';
-      dotlist[dotlen] = '\0';
-      parent_status = __lstat (dotlist, &st);
-#endif
-      if (parent_status != 0)
-        goto lose;
-
-      if (dirstream && __closedir (dirstream) != 0)
-        {
-          dirstream = NULL;
-          goto lose;
-        }
-
-      /* Figure out if this directory is a mount point.  */
-      dotdev = st.st_dev;
-      dotino = st.st_ino;
-      mount_point = dotdev != thisdev;
-
-      /* Search for the last directory.  */
-#if HAVE_OPENAT_SUPPORT
-      dirstream = fdopendir (fd);
-      if (dirstream == NULL)
-        goto lose;
-      /* Reset fd.  It may have been closed by fdopendir.  */
-      fd = dirfd (dirstream);
-      fd_needs_closing = false;
-#else
-      dirstream = __opendir (dotlist);
-      if (dirstream == NULL)
-        goto lose;
-      dotlist[dotlen++] = '/';
-#endif
-      for (;;)
-        {
-          /* Clear errno to distinguish EOF from error if readdir returns
-             NULL.  */
-          __set_errno (0);
-          d = __readdir (dirstream);
-
-          /* When we've iterated through all directory entries without finding
-             one with a matching d_ino, rewind the stream and consider each
-             name again, but this time, using lstat.  This is necessary in a
-             chroot on at least one system (glibc-2.3.6 + linux 2.6.12), where
-             .., ../.., ../../.., etc. all had the same device number, yet the
-             d_ino values for entries in / did not match those obtained
-             via lstat.  */
-          if (d == NULL && errno == 0 && use_d_ino)
-            {
-              use_d_ino = false;
-              rewinddir (dirstream);
-              d = __readdir (dirstream);
-            }
-
-          if (d == NULL)
-            {
-              if (errno == 0)
-                /* EOF on dirstream, which can mean e.g., that the current
-                   directory has been removed.  */
-                __set_errno (ENOENT);
-              goto lose;
-            }
-          if (d->d_name[0] == '.' &&
-              (d->d_name[1] == '\0' ||
-               (d->d_name[1] == '.' && d->d_name[2] == '\0')))
-            continue;
-
-          if (use_d_ino)
-            {
-              bool match = (MATCHING_INO (d, thisino) || mount_point);
-              if (! match)
-                continue;
-            }
-
-          {
-            int entry_status;
-#if HAVE_OPENAT_SUPPORT
-            entry_status = fstatat (fd, d->d_name, &st, AT_SYMLINK_NOFOLLOW);
-#else
-            /* Compute size needed for this file name, or for the file
-               name ".." in the same directory, whichever is larger.
-               Room for ".." might be needed the next time through
-               the outer loop.  */
-            size_t name_alloc = _D_ALLOC_NAMLEN (d);
-            size_t filesize = dotlen + MAX (sizeof "..", name_alloc);
-
-            if (filesize < dotlen)
-              goto memory_exhausted;
-
-            if (dotsize < filesize)
-              {
-                /* My, what a deep directory tree you have, Grandma.  */
-                size_t newsize = MAX (filesize, dotsize * 2);
-                size_t i;
-                if (newsize < dotsize)
-                  goto memory_exhausted;
-                if (dotlist != dots)
-                  free (dotlist);
-                dotlist = malloc (newsize);
-                if (dotlist == NULL)
-                  goto lose;
-                dotsize = newsize;
-
-                i = 0;
-                do
-                  {
-                    dotlist[i++] = '.';
-                    dotlist[i++] = '.';
-                    dotlist[i++] = '/';
-                  }
-                while (i < dotlen);
-              }
-
-            memcpy (dotlist + dotlen, d->d_name, _D_ALLOC_NAMLEN (d));
-            entry_status = __lstat (dotlist, &st);
-#endif
-            /* We don't fail here if we cannot stat() a directory entry.
-               This can happen when (network) file systems fail.  If this
-               entry is in fact the one we are looking for we will find
-               out soon as we reach the end of the directory without
-               having found anything.  */
-            if (entry_status == 0 && S_ISDIR (st.st_mode)
-                && st.st_dev == thisdev && st.st_ino == thisino)
-              break;
-          }
-        }
-
-      dirroom = dirp - dir;
-      namlen = _D_EXACT_NAMLEN (d);
-
-      if (dirroom <= namlen)
-        {
-          if (size != 0)
-            {
-              __set_errno (ERANGE);
-              goto lose;
-            }
-          else
-            {
-              char *tmp;
-              size_t oldsize = allocated;
-
-              allocated += MAX (allocated, namlen);
-              if (allocated < oldsize
-                  || ! (tmp = realloc (dir, allocated)))
-                goto memory_exhausted;
-
-              /* Move current contents up to the end of the buffer.
-                 This is guaranteed to be non-overlapping.  */
-              dirp = memcpy (tmp + allocated - (oldsize - dirroom),
-                             tmp + dirroom,
-                             oldsize - dirroom);
-              dir = tmp;
-            }
-        }
-      dirp -= namlen;
-      memcpy (dirp, d->d_name, namlen);
-      *--dirp = '/';
-
-      thisdev = dotdev;
-      thisino = dotino;
-    }
-
-  if (dirstream && __closedir (dirstream) != 0)
-    {
-      dirstream = NULL;
-      goto lose;
-    }
-
-  if (dirp == &dir[allocated - 1])
-    *--dirp = '/';
-
-#if ! HAVE_OPENAT_SUPPORT
-  if (dotlist != dots)
-    free (dotlist);
-#endif
-
-  used = dir + allocated - dirp;
-  memmove (dir, dirp, used);
-
-  if (size == 0)
-    /* Ensure that the buffer is only as large as necessary.  */
-    buf = realloc (dir, used);
-
-  if (buf == NULL)
-    /* Either buf was NULL all along, or `realloc' failed but
-       we still have the original string.  */
-    buf = dir;
-
-  return buf;
-
- memory_exhausted:
-  __set_errno (ENOMEM);
- lose:
-  {
-    int save = errno;
-    if (dirstream)
-      __closedir (dirstream);
-#if HAVE_OPENAT_SUPPORT
-    if (fd_needs_closing)
-      close (fd);
-#else
-    if (dotlist != dots)
-      free (dotlist);
-#endif
-    if (buf == NULL)
-      free (dir);
-    __set_errno (save);
-  }
-  return NULL;
-}
-
-#ifdef weak_alias
-weak_alias (__getcwd, getcwd)
-#endif
diff --git a/lib/getdtablesize.c b/lib/getdtablesize.c
new file mode 100644 (file)
index 0000000..70ba075
--- /dev/null
@@ -0,0 +1,86 @@
+/* getdtablesize() function for platforms that don't have it.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2008.
+
+   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 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <unistd.h>
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+#include <stdio.h>
+
+#include "msvc-inval.h"
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static inline int
+_setmaxstdio_nothrow (int newmax)
+{
+  int result;
+
+  TRY_MSVC_INVAL
+    {
+      result = _setmaxstdio (newmax);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = -1;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+# define _setmaxstdio _setmaxstdio_nothrow
+#endif
+
+/* Cache for the previous getdtablesize () result.  */
+static int dtablesize;
+
+int
+getdtablesize (void)
+{
+  if (dtablesize == 0)
+    {
+      /* We are looking for the number N such that the valid file descriptors
+         are 0..N-1.  It can be obtained through a loop as follows:
+           {
+             int fd;
+             for (fd = 3; fd < 65536; fd++)
+               if (dup2 (0, fd) == -1)
+                 break;
+             return fd;
+           }
+         On Windows XP, the result is 2048.
+         The drawback of this loop is that it allocates memory for a libc
+         internal array that is never freed.
+
+         The number N can also be obtained as the upper bound for
+         _getmaxstdio ().  _getmaxstdio () returns the maximum number of open
+         FILE objects.  The sanity check in _setmaxstdio reveals the maximum
+         number of file descriptors.  This too allocates memory, but it is
+         freed when we call _setmaxstdio with the original value.  */
+      int orig_max_stdio = _getmaxstdio ();
+      unsigned int bound;
+      for (bound = 0x10000; _setmaxstdio (bound) < 0; bound = bound / 2)
+        ;
+      _setmaxstdio (orig_max_stdio);
+      dtablesize = bound;
+    }
+  return dtablesize;
+}
+
+#endif
index 406d5b71a3d18b9ea3213c1693bc7454ef59eeee..4342a34104c392c253d80fab6af534e3640e0855 100644 (file)
@@ -2,7 +2,7 @@
    NOTE: getopt is part of the C library, so if you don't know what
    "Keep this file name-space clean" means, talk to drepper@gnu.org
    before changing it!
-   Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2010 Free Software
+   Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2012 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
 # include <wchar.h>
 #endif
 
-#ifndef attribute_hidden
-# define attribute_hidden
-#endif
-
-/* This version of `getopt' appears to the caller like standard Unix `getopt'
+/* This version of 'getopt' appears to the caller like standard Unix 'getopt'
    but it behaves differently for the user, since it allows the user
    to intersperse the options with the other arguments.
 
-   As `getopt_long' works, it permutes the elements of ARGV so that,
+   As 'getopt_long' works, it permutes the elements of ARGV so that,
    when it is done, all the options precede everything else.  Thus
    all application programs are extended to handle flexible argument order.
 
-   Using `getopt' or setting the environment variable POSIXLY_CORRECT
+   Using 'getopt' or setting the environment variable POSIXLY_CORRECT
    disables permutation.
    Then the behavior is completely standard.
 
 
 #include "getopt_int.h"
 
-/* For communication from `getopt' to the caller.
-   When `getopt' finds an option that takes an argument,
+/* For communication from 'getopt' to the caller.
+   When 'getopt' finds an option that takes an argument,
    the argument value is returned here.
-   Also, when `ordering' is RETURN_IN_ORDER,
+   Also, when 'ordering' is RETURN_IN_ORDER,
    each non-option ARGV-element is returned here.  */
 
 char *optarg;
 
 /* Index in ARGV of the next element to be scanned.
    This is used for communication to and from the caller
-   and for communication between successive calls to `getopt'.
+   and for communication between successive calls to 'getopt'.
 
-   On entry to `getopt', zero means this is the first call; initialize.
+   On entry to 'getopt', zero means this is the first call; initialize.
 
-   When `getopt' returns -1, this is the index of the first of the
+   When 'getopt' returns -1, this is the index of the first of the
    non-option elements that the caller should itself scan.
 
-   Otherwise, `optind' communicates from one call to the next
+   Otherwise, 'optind' communicates from one call to the next
    how much of ARGV has been scanned so far.  */
 
 /* 1003.2 says this must be 1 before any call.  */
@@ -141,7 +137,7 @@ extern char *__getopt_nonoption_flags;
    The other is elements [last_nonopt,optind), which contains all
    the options processed since those non-options were skipped.
 
-   `first_nonopt' and `last_nonopt' are relocated so that they describe
+   'first_nonopt' and 'last_nonopt' are relocated so that they describe
    the new indices of the non-options in ARGV after they are moved.  */
 
 static void
@@ -158,7 +154,7 @@ exchange (char **argv, struct _getopt_data *d)
      but it consists of two parts that need to be swapped next.  */
 
 #if defined _LIBC && defined USE_NONOPTION_FLAGS
-  /* First make sure the handling of the `__getopt_nonoption_flags'
+  /* First make sure the handling of the '__getopt_nonoption_flags'
      string can work normally.  Our top argument must be in the range
      of the string.  */
   if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len)
@@ -295,48 +291,48 @@ _getopt_initialize (int argc _GL_UNUSED,
 
    If an element of ARGV starts with '-', and is not exactly "-" or "--",
    then it is an option element.  The characters of this element
-   (aside from the initial '-') are option characters.  If `getopt'
+   (aside from the initial '-') are option characters.  If 'getopt'
    is called repeatedly, it returns successively each of the option characters
    from each of the option elements.
 
-   If `getopt' finds another option character, it returns that character,
-   updating `optind' and `nextchar' so that the next call to `getopt' can
+   If 'getopt' finds another option character, it returns that character,
+   updating 'optind' and 'nextchar' so that the next call to 'getopt' can
    resume the scan with the following option character or ARGV-element.
 
-   If there are no more option characters, `getopt' returns -1.
-   Then `optind' is the index in ARGV of the first ARGV-element
+   If there are no more option characters, 'getopt' returns -1.
+   Then 'optind' is the index in ARGV of the first ARGV-element
    that is not an option.  (The ARGV-elements have been permuted
    so that those that are not options now come last.)
 
    OPTSTRING is a string containing the legitimate option characters.
    If an option character is seen that is not listed in OPTSTRING,
-   return '?' after printing an error message.  If you set `opterr' to
+   return '?' after printing an error message.  If you set 'opterr' to
    zero, the error message is suppressed but we still return '?'.
 
    If a char in OPTSTRING is followed by a colon, that means it wants an arg,
    so the following text in the same ARGV-element, or the text of the following
-   ARGV-element, is returned in `optarg'.  Two colons mean an option that
+   ARGV-element, is returned in 'optarg'.  Two colons mean an option that
    wants an optional arg; if there is text in the current ARGV-element,
-   it is returned in `optarg', otherwise `optarg' is set to zero.
+   it is returned in 'optarg', otherwise 'optarg' is set to zero.
 
-   If OPTSTRING starts with `-' or `+', it requests different methods of
+   If OPTSTRING starts with '-' or '+', it requests different methods of
    handling the non-option ARGV-elements.
    See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
 
-   Long-named options begin with `--' instead of `-'.
+   Long-named options begin with '--' instead of '-'.
    Their names may be abbreviated as long as the abbreviation is unique
    or is an exact match for some defined option.  If they have an
    argument, it follows the option name in the same ARGV-element, separated
-   from the option name by a `=', or else the in next ARGV-element.
-   When `getopt' finds a long-named option, it returns 0 if that option's
-   `flag' field is nonzero, the value of the option's `val' field
-   if the `flag' field is zero.
+   from the option name by a '=', or else the in next ARGV-element.
+   When 'getopt' finds a long-named option, it returns 0 if that option's
+   'flag' field is nonzero, the value of the option's 'val' field
+   if the 'flag' field is zero.
 
    The elements of ARGV aren't really const, because we permute them.
    But we pretend they're const in the prototype to be compatible
    with other systems.
 
-   LONGOPTS is a vector of `struct option' terminated by an
+   LONGOPTS is a vector of 'struct option' terminated by an
    element containing a name which is zero.
 
    LONGIND returns the index in LONGOPT of the long-named option found.
@@ -352,8 +348,6 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                     int long_only, struct _getopt_data *d, int posixly_correct)
 {
   int print_errors = d->opterr;
-  if (optstring[0] == ':')
-    print_errors = 0;
 
   if (argc < 1)
     return -1;
@@ -368,6 +362,10 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                                       posixly_correct);
       d->__initialized = 1;
     }
+  else if (optstring[0] == '-' || optstring[0] == '+')
+    optstring++;
+  if (optstring[0] == ':')
+    print_errors = 0;
 
   /* Test whether ARGV[optind] points to a non-option argument.
      Either it does not have option syntax, or there is an environment flag
@@ -411,7 +409,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
           d->__last_nonopt = d->optind;
         }
 
-      /* The special ARGV-element `--' means premature end of options.
+      /* The special ARGV-element '--' means premature end of options.
          Skip it like a null option,
          then exchange with previous non-options as if it were an option,
          then skip everything else like a non-option.  */
@@ -481,23 +479,28 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                             || !strchr (optstring, argv[d->optind][1])))))
     {
       char *nameend;
+      unsigned int namelen;
       const struct option *p;
       const struct option *pfound = NULL;
+      struct option_list
+      {
+        const struct option *p;
+        struct option_list *next;
+      } *ambig_list = NULL;
       int exact = 0;
-      int ambig = 0;
       int indfound = -1;
       int option_index;
 
       for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
         /* Do nothing.  */ ;
+      namelen = nameend - d->__nextchar;
 
       /* Test all long options for either exact match
          or abbreviated matches.  */
       for (p = longopts, option_index = 0; p->name; p++, option_index++)
-        if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
+        if (!strncmp (p->name, d->__nextchar, namelen))
           {
-            if ((unsigned int) (nameend - d->__nextchar)
-                == (unsigned int) strlen (p->name))
+            if (namelen == (unsigned int) strlen (p->name))
               {
                 /* Exact match found.  */
                 pfound = p;
@@ -515,35 +518,71 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                      || pfound->has_arg != p->has_arg
                      || pfound->flag != p->flag
                      || pfound->val != p->val)
-              /* Second or later nonexact match found.  */
-              ambig = 1;
+              {
+                /* Second or later nonexact match found.  */
+                struct option_list *newp = malloc (sizeof (*newp));
+                newp->p = p;
+                newp->next = ambig_list;
+                ambig_list = newp;
+              }
           }
 
-      if (ambig && !exact)
+      if (ambig_list != NULL && !exact)
         {
           if (print_errors)
             {
+              struct option_list first;
+              first.p = pfound;
+              first.next = ambig_list;
+              ambig_list = &first;
+
 #if defined _LIBC && defined USE_IN_LIBIO
-              char *buf;
+              char *buf = NULL;
+              size_t buflen = 0;
 
-              if (__asprintf (&buf, _("%s: option '%s' is ambiguous\n"),
-                              argv[0], argv[d->optind]) >= 0)
+              FILE *fp = open_memstream (&buf, &buflen);
+              if (fp != NULL)
                 {
-                  _IO_flockfile (stderr);
+                  fprintf (fp,
+                           _("%s: option '%s' is ambiguous; possibilities:"),
+                           argv[0], argv[d->optind]);
 
-                  int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                  ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+                  do
+                    {
+                      fprintf (fp, " '--%s'", ambig_list->p->name);
+                      ambig_list = ambig_list->next;
+                    }
+                  while (ambig_list != NULL);
 
-                  __fxprintf (NULL, "%s", buf);
+                  fputc_unlocked ('\n', fp);
 
-                  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                  _IO_funlockfile (stderr);
+                  if (__builtin_expect (fclose (fp) != EOF, 1))
+                    {
+                      _IO_flockfile (stderr);
 
-                  free (buf);
+                      int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
+                      ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
+
+                      __fxprintf (NULL, "%s", buf);
+
+                      ((_IO_FILE *) stderr)->_flags2 = old_flags2;
+                      _IO_funlockfile (stderr);
+
+                      free (buf);
+                    }
                 }
 #else
-              fprintf (stderr, _("%s: option '%s' is ambiguous\n"),
+              fprintf (stderr,
+                       _("%s: option '%s' is ambiguous; possibilities:"),
                        argv[0], argv[d->optind]);
+              do
+                {
+                  fprintf (stderr, " '--%s'", ambig_list->p->name);
+                  ambig_list = ambig_list->next;
+                }
+              while (ambig_list != NULL);
+
+              fputc ('\n', stderr);
 #endif
             }
           d->__nextchar += strlen (d->__nextchar);
@@ -552,6 +591,13 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
           return '?';
         }
 
+      while (ambig_list != NULL)
+        {
+          struct option_list *pn = ambig_list->next;
+          free (ambig_list);
+          ambig_list = pn;
+        }
+
       if (pfound != NULL)
         {
           option_index = indfound;
@@ -637,8 +683,8 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                       char *buf;
 
                       if (__asprintf (&buf, _("\
-%s: option '%s' requires an argument\n"),
-                                      argv[0], argv[d->optind - 1]) >= 0)
+%s: option '--%s' requires an argument\n"),
+                                      argv[0], pfound->name) >= 0)
                         {
                           _IO_flockfile (stderr);
 
@@ -655,8 +701,8 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                         }
 #else
                       fprintf (stderr,
-                               _("%s: option '%s' requires an argument\n"),
-                               argv[0], argv[d->optind - 1]);
+                               _("%s: option '--%s' requires an argument\n"),
+                               argv[0], pfound->name);
 #endif
                     }
                   d->__nextchar += strlen (d->__nextchar);
@@ -740,13 +786,13 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
 
   {
     char c = *d->__nextchar++;
-    char *temp = strchr (optstring, c);
+    const char *temp = strchr (optstring, c);
 
-    /* Increment `optind' when we start to process its last character.  */
+    /* Increment 'optind' when we start to process its last character.  */
     if (*d->__nextchar == '\0')
       ++d->optind;
 
-    if (temp == NULL || c == ':')
+    if (temp == NULL || c == ':' || c == ';')
       {
         if (print_errors)
           {
@@ -793,6 +839,9 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
         int indfound = 0;
         int option_index;
 
+        if (longopts == NULL)
+          goto no_longs;
+
         /* This is an option that requires an argument.  */
         if (*d->__nextchar != '\0')
           {
@@ -838,7 +887,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
             return c;
           }
         else
-          /* We already incremented `d->optind' once;
+          /* We already incremented 'd->optind' once;
              increment it again when taking next ARGV-elt as argument.  */
           d->optarg = argv[d->optind++];
 
@@ -868,7 +917,10 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                   pfound = p;
                   indfound = option_index;
                 }
-              else
+              else if (long_only
+                       || pfound->has_arg != p->has_arg
+                       || pfound->flag != p->flag
+                       || pfound->val != p->val)
                 /* Second or later nonexact match found.  */
                 ambig = 1;
             }
@@ -880,7 +932,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                 char *buf;
 
                 if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"),
-                                argv[0], argv[d->optind]) >= 0)
+                                argv[0], d->optarg) >= 0)
                   {
                     _IO_flockfile (stderr);
 
@@ -896,7 +948,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                   }
 #else
                 fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"),
-                         argv[0], argv[d->optind]);
+                         argv[0], d->optarg);
 #endif
               }
             d->__nextchar += strlen (d->__nextchar);
@@ -959,8 +1011,8 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                         char *buf;
 
                         if (__asprintf (&buf, _("\
-%s: option '%s' requires an argument\n"),
-                                        argv[0], argv[d->optind - 1]) >= 0)
+%s: option '-W %s' requires an argument\n"),
+                                        argv[0], pfound->name) >= 0)
                           {
                             _IO_flockfile (stderr);
 
@@ -976,15 +1028,17 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                             free (buf);
                           }
 #else
-                        fprintf (stderr,
-                                 _("%s: option '%s' requires an argument\n"),
-                                 argv[0], argv[d->optind - 1]);
+                        fprintf (stderr, _("\
+%s: option '-W %s' requires an argument\n"),
+                                 argv[0], pfound->name);
 #endif
                       }
                     d->__nextchar += strlen (d->__nextchar);
                     return optstring[0] == ':' ? ':' : '?';
                   }
               }
+            else
+              d->optarg = NULL;
             d->__nextchar += strlen (d->__nextchar);
             if (longind != NULL)
               *longind = option_index;
@@ -995,8 +1049,10 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
               }
             return pfound->val;
           }
-          d->__nextchar = NULL;
-          return 'W';   /* Let the application handle it.   */
+
+      no_longs:
+        d->__nextchar = NULL;
+        return 'W';   /* Let the application handle it.   */
       }
     if (temp[1] == ':')
       {
@@ -1058,7 +1114,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
                   c = '?';
               }
             else
-              /* We already incremented `optind' once;
+              /* We already incremented 'optind' once;
                  increment it again when taking next ARGV-elt as argument.  */
               d->optarg = argv[d->optind++];
             d->__nextchar = NULL;
@@ -1121,7 +1177,7 @@ __posix_getopt (int argc, char *const *argv, const char *optstring)
 #ifdef TEST
 
 /* Compile with -DTEST to make an executable for use in testing
-   the above definition of `getopt'.  */
+   the above definition of 'getopt'.  */
 
 int
 main (int argc, char **argv)
index 57a8e8992d98cd03cd5cbb1119b00e3dd56a7937..06b6dfc50c2dbf2f9011ada0a28099e42d27595f 100644 (file)
@@ -1,5 +1,5 @@
 /* Declarations for getopt.
-   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2010 Free Software
+   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2012 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_GETOPT_H
+#ifndef _@GUARD_PREFIX@_GETOPT_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 /* The include_next requires a split double-inclusion guard.  We must
    also inform the replacement unistd.h to not recursively use
 # undef _GL_SYSTEM_GETOPT
 #endif
 
-#ifndef _GL_GETOPT_H
+#ifndef _@GUARD_PREFIX@_GETOPT_H
 
 #ifndef __need_getopt
-# define _GL_GETOPT_H 1
+# define _@GUARD_PREFIX@_GETOPT_H 1
 #endif
 
 /* Standalone applications should #define __GETOPT_PREFIX to an
@@ -81,7 +82,7 @@
    getopt_long_only can permute argv; this is required for backward
    compatibility (e.g., for LSB 2.0.1).
 
-   This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt',
+   This used to be '#if defined __GETOPT_PREFIX && !defined __need_getopt',
    but it caused redefinition warnings if both unistd.h and getopt.h were
    included, since unistd.h includes getopt.h having previously defined
    __need_getopt.
 extern "C" {
 #endif
 
-/* For communication from `getopt' to the caller.
-   When `getopt' finds an option that takes an argument,
+/* For communication from 'getopt' to the caller.
+   When 'getopt' finds an option that takes an argument,
    the argument value is returned here.
-   Also, when `ordering' is RETURN_IN_ORDER,
+   Also, when 'ordering' is RETURN_IN_ORDER,
    each non-option ARGV-element is returned here.  */
 
 extern char *optarg;
 
 /* Index in ARGV of the next element to be scanned.
    This is used for communication to and from the caller
-   and for communication between successive calls to `getopt'.
+   and for communication between successive calls to 'getopt'.
 
-   On entry to `getopt', zero means this is the first call; initialize.
+   On entry to 'getopt', zero means this is the first call; initialize.
 
-   When `getopt' returns -1, this is the index of the first of the
+   When 'getopt' returns -1, this is the index of the first of the
    non-option elements that the caller should itself scan.
 
-   Otherwise, `optind' communicates from one call to the next
+   Otherwise, 'optind' communicates from one call to the next
    how much of ARGV has been scanned so far.  */
 
 extern int optind;
 
-/* Callers store zero here to inhibit the error message `getopt' prints
+/* Callers store zero here to inhibit the error message 'getopt' prints
    for unrecognized options.  */
 
 extern int opterr;
@@ -161,25 +162,26 @@ extern int optopt;
 #ifndef __need_getopt
 /* Describe the long-named options requested by the application.
    The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
-   of `struct option' terminated by an element containing a name which is
+   of 'struct option' terminated by an element containing a name which is
    zero.
 
-   The field `has_arg' is:
+   The field 'has_arg' is:
    no_argument          (or 0) if the option does not take an argument,
    required_argument    (or 1) if the option requires an argument,
    optional_argument    (or 2) if the option takes an optional argument.
 
-   If the field `flag' is not NULL, it points to a variable that is set
-   to the value given in the field `val' when the option is found, but
+   If the field 'flag' is not NULL, it points to a variable that is set
+   to the value given in the field 'val' when the option is found, but
    left unchanged if the option is not found.
 
-   To have a long-named option do something other than set an `int' to
-   a compiled-in constant, such as set a value from `optarg', set the
-   option's `flag' field to zero and its `val' field to a nonzero
+   To have a long-named option do something other than set an 'int' to
+   a compiled-in constant, such as set a value from 'optarg', set the
+   option's 'flag' field to zero and its 'val' field to a nonzero
    value (the equivalent single-letter option character, if there is
-   one).  For long options that have a zero `flag' field, `getopt'
-   returns the contents of the `val' field.  */
+   one).  For long options that have a zero 'flag' field, 'getopt'
+   returns the contents of the 'val' field.  */
 
+# if !GNULIB_defined_struct_option
 struct option
 {
   const char *name;
@@ -189,8 +191,10 @@ struct option
   int *flag;
   int val;
 };
+#  define GNULIB_defined_struct_option 1
+# endif
 
-/* Names for the values of the `has_arg' field of `struct option'.  */
+/* Names for the values of the 'has_arg' field of 'struct option'.  */
 
 # define no_argument            0
 # define required_argument      1
@@ -204,23 +208,23 @@ struct option
 
    Return the option character from OPTS just read.  Return -1 when
    there are no more options.  For unrecognized options, or options
-   missing arguments, `optopt' is set to the option letter, and '?' is
+   missing arguments, 'optopt' is set to the option letter, and '?' is
    returned.
 
    The OPTS string is a list of characters which are recognized option
    letters, optionally followed by colons, specifying that that letter
-   takes an argument, to be placed in `optarg'.
+   takes an argument, to be placed in 'optarg'.
 
    If a letter in OPTS is followed by two colons, its argument is
-   optional.  This behavior is specific to the GNU `getopt'.
+   optional.  This behavior is specific to the GNU 'getopt'.
 
-   The argument `--' causes premature termination of argument
-   scanning, explicitly telling `getopt' that there are no more
+   The argument '--' causes premature termination of argument
+   scanning, explicitly telling 'getopt' that there are no more
    options.
 
-   If OPTS begins with `-', then non-option arguments are treated as
+   If OPTS begins with '-', then non-option arguments are treated as
    arguments to the option '\1'.  This behavior is specific to the GNU
-   `getopt'.  If OPTS begins with `+', or POSIXLY_CORRECT is set in
+   'getopt'.  If OPTS begins with '+', or POSIXLY_CORRECT is set in
    the environment, then do not permute arguments.  */
 
 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
@@ -245,5 +249,5 @@ extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
 /* Make sure we later can get all the definitions and declarations.  */
 #undef __need_getopt
 
-#endif /* getopt.h */
-#endif /* getopt.h */
+#endif /* _@GUARD_PREFIX@_GETOPT_H */
+#endif /* _@GUARD_PREFIX@_GETOPT_H */
index 046d69f940f619bab7c922ba7d9e1f2e6d8c7c47..fb2a8f5a7b1a7b874c0b6eefe95eafb8b936589e 100644 (file)
@@ -1,6 +1,6 @@
 /* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
-   1998, 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2012 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
@@ -141,11 +141,11 @@ main (int argc, char **argv)
           break;
 
         case 'c':
-          printf ("option c with value `%s'\n", optarg);
+          printf ("option c with value '%s'\n", optarg);
           break;
 
         case 'd':
-          printf ("option d with value `%s'\n", optarg);
+          printf ("option d with value '%s'\n", optarg);
           break;
 
         case '?':
index 169def5b2653ecf5b91832b9258a690c135e6a7b..2da020c995a12d2437d7aab417a126a56170381c 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal declarations for getopt.
-   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2010 Free Software
+   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2012 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -30,6 +30,40 @@ extern int _getopt_internal (int ___argc, char **___argv,
 /* Reentrant versions which can handle parsing multiple argument
    vectors at the same time.  */
 
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+   If the caller did not specify anything,
+   the default is REQUIRE_ORDER if the environment variable
+   POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+   REQUIRE_ORDER means don't recognize them as options;
+   stop option processing when the first non-option is seen.
+   This is what Unix does.
+   This mode of operation is selected by either setting the environment
+   variable POSIXLY_CORRECT, or using '+' as the first character
+   of the list of option characters, or by calling getopt.
+
+   PERMUTE is the default.  We permute the contents of ARGV as we
+   scan, so that eventually all the non-options are at the end.
+   This allows options to be given in any order, even with programs
+   that were not written to expect this.
+
+   RETURN_IN_ORDER is an option available to programs that were
+   written to expect options and other ARGV-elements in any order
+   and that care about the ordering of the two.  We describe each
+   non-option ARGV-element as if it were the argument of an option
+   with character code 1.  Using '-' as the first character of the
+   list of option characters selects this mode of operation.
+
+   The special argument '--' forces an end of option-scanning regardless
+   of the value of 'ordering'.  In the case of RETURN_IN_ORDER, only
+   '--' can cause 'getopt' to return -1 with 'optind' != ARGC.  */
+
+enum __ord
+  {
+    REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+  };
+
 /* Data type for reentrant functions.  */
 struct _getopt_data
 {
@@ -54,39 +88,8 @@ struct _getopt_data
      by advancing to the next ARGV-element.  */
   char *__nextchar;
 
-  /* Describe how to deal with options that follow non-option ARGV-elements.
-
-     If the caller did not specify anything,
-     the default is REQUIRE_ORDER if the environment variable
-     POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
-     REQUIRE_ORDER means don't recognize them as options;
-     stop option processing when the first non-option is seen.
-     This is what Unix does.
-     This mode of operation is selected by either setting the environment
-     variable POSIXLY_CORRECT, or using `+' as the first character
-     of the list of option characters, or by calling getopt.
-
-     PERMUTE is the default.  We permute the contents of ARGV as we
-     scan, so that eventually all the non-options are at the end.
-     This allows options to be given in any order, even with programs
-     that were not written to expect this.
-
-     RETURN_IN_ORDER is an option available to programs that were
-     written to expect options and other ARGV-elements in any order
-     and that care about the ordering of the two.  We describe each
-     non-option ARGV-element as if it were the argument of an option
-     with character code 1.  Using `-' as the first character of the
-     list of option characters selects this mode of operation.
-
-     The special argument `--' forces an end of option-scanning regardless
-     of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
-     `--' can cause `getopt' to return -1 with `optind' != ARGC.  */
-
-  enum
-    {
-      REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
-    } __ordering;
+  /* See __ord above.  */
+  enum __ord __ordering;
 
   /* If the POSIXLY_CORRECT environment variable is set
      or getopt was called.  */
@@ -96,8 +99,8 @@ struct _getopt_data
   /* Handle permutation of arguments.  */
 
   /* Describe the part of ARGV that contains non-options that have
-     been skipped.  `first_nonopt' is the index in ARGV of the first
-     of them; `last_nonopt' is the index after the last of them.  */
+     been skipped.  'first_nonopt' is the index in ARGV of the first
+     of them; 'last_nonopt' is the index after the last of them.  */
 
   int __first_nonopt;
   int __last_nonopt;
@@ -105,7 +108,7 @@ struct _getopt_data
 #if defined _LIBC && defined USE_NONOPTION_FLAGS
   int __nonoption_flags_max_len;
   int __nonoption_flags_len;
-# endif
+#endif
 };
 
 /* The initializer is necessary to set OPTIND and OPTERR to their
index 360d176188372c18c63483580d2022f8b1cda512..75875cdb0fb5cfa42fcbdf7df52828c1748a8d63 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2010 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -15,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBGETTEXT_H
 #define _LIBGETTEXT_H 1
@@ -56,7 +53,7 @@
    it now, to make later inclusions of <libintl.h> a NOP.  */
 #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
 # include <cstdlib>
-# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H
 #  include <libintl.h>
 # endif
 #endif
@@ -83,7 +80,7 @@
     ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
 # undef dcngettext
 # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
-    ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
+    ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))
 # undef textdomain
 # define textdomain(Domainname) ((const char *) (Domainname))
 # undef bindtextdomain
 
 #endif
 
+/* Prefer gnulib's setlocale override over libintl's setlocale override.  */
+#ifdef GNULIB_defined_setlocale
+# undef setlocale
+# define setlocale rpl_setlocale
+#endif
+
 /* A pseudo function call that serves as a marker for the automated
    extraction of messages, but does not call gettext().  The run-time
    translation is done at a different place in the code.
@@ -181,7 +184,7 @@ npgettext_aux (const char *domain,
 #include <string.h>
 
 #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
-  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
+  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
    /* || __STDC_VERSION__ >= 199901L */ )
 
 #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
index 044b26f0f30e7171603097489c098a1b5226a150..8075bfaf999931af7e397777ce78b6b7637e7e40 100644 (file)
@@ -1,6 +1,6 @@
 /* gettime -- get the system clock
 
-   Copyright (C) 2002, 2004-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004-2007, 2009-2012 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
index e1a6c698c9fcd60662bee3a34abedfa9c59493a1..5d35060950a32e51ffd8fd5e333a3b14be2d49b4 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Provide gettimeofday for systems that don't have it or for which it's broken.
 
-   Copyright (C) 2001-2003, 2005-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2007, 2009-2012 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,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* written by Jim Meyering */
 
 static struct tm tm_zero_buffer;
 static struct tm *localtime_buffer_addr = &tm_zero_buffer;
 
-#undef localtime
+# undef localtime
 extern struct tm *localtime (time_t const *);
 
-#undef gmtime
+# undef gmtime
 extern struct tm *gmtime (time_t const *);
 
 /* This is a wrapper for localtime.  It is used only on systems for which
@@ -81,7 +78,7 @@ rpl_gmtime (time_t const *timep)
 
 #if TZSET_CLOBBERS_LOCALTIME
 
-#undef tzset
+# undef tzset
 extern void tzset (void);
 
 /* This is a wrapper for tzset, for systems on which tzset may clobber
@@ -102,7 +99,7 @@ rpl_tzset (void)
    causes problems.  */
 
 int
-rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz)
+gettimeofday (struct timeval *restrict tv, void *restrict tz)
 {
 #undef gettimeofday
 #if HAVE_GETTIMEOFDAY
@@ -112,7 +109,18 @@ rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz)
   struct tm save = *localtime_buffer_addr;
 # endif
 
+# if defined timeval /* 'struct timeval' overridden by gnulib?  */
+#  undef timeval
+  struct timeval otv;
+  int result = gettimeofday (&otv, (struct timezone *) tz);
+  if (result == 0)
+    {
+      tv->tv_sec = otv.tv_sec;
+      tv->tv_usec = otv.tv_usec;
+    }
+# else
   int result = gettimeofday (tv, (struct timezone *) tz);
+# endif
 
 # if GETTIMEOFDAY_CLOBBERS_LOCALTIME
   *localtime_buffer_addr = save;
diff --git a/lib/glthread/lock.c b/lib/glthread/lock.c
new file mode 100644 (file)
index 0000000..9a391ea
--- /dev/null
@@ -0,0 +1,1057 @@
+/* Locking in multithreaded situations.
+   Copyright (C) 2005-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
+   gthr-win32.h.  */
+
+#include <config.h>
+
+#include "glthread/lock.h"
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+# if HAVE_PTHREAD_RWLOCK
+
+#  if !defined PTHREAD_RWLOCK_INITIALIZER
+
+int
+glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
+{
+  int err;
+
+  err = pthread_rwlock_init (&lock->rwlock, NULL);
+  if (err != 0)
+    return err;
+  lock->initialized = 1;
+  return 0;
+}
+
+int
+glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
+{
+  if (!lock->initialized)
+    {
+      int err;
+
+      err = pthread_mutex_lock (&lock->guard);
+      if (err != 0)
+        return err;
+      if (!lock->initialized)
+        {
+          err = glthread_rwlock_init_multithreaded (lock);
+          if (err != 0)
+            {
+              pthread_mutex_unlock (&lock->guard);
+              return err;
+            }
+        }
+      err = pthread_mutex_unlock (&lock->guard);
+      if (err != 0)
+        return err;
+    }
+  return pthread_rwlock_rdlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
+{
+  if (!lock->initialized)
+    {
+      int err;
+
+      err = pthread_mutex_lock (&lock->guard);
+      if (err != 0)
+        return err;
+      if (!lock->initialized)
+        {
+          err = glthread_rwlock_init_multithreaded (lock);
+          if (err != 0)
+            {
+              pthread_mutex_unlock (&lock->guard);
+              return err;
+            }
+        }
+      err = pthread_mutex_unlock (&lock->guard);
+      if (err != 0)
+        return err;
+    }
+  return pthread_rwlock_wrlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
+{
+  if (!lock->initialized)
+    return EINVAL;
+  return pthread_rwlock_unlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock)
+{
+  int err;
+
+  if (!lock->initialized)
+    return EINVAL;
+  err = pthread_rwlock_destroy (&lock->rwlock);
+  if (err != 0)
+    return err;
+  lock->initialized = 0;
+  return 0;
+}
+
+#  endif
+
+# else
+
+int
+glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
+{
+  int err;
+
+  err = pthread_mutex_init (&lock->lock, NULL);
+  if (err != 0)
+    return err;
+  err = pthread_cond_init (&lock->waiting_readers, NULL);
+  if (err != 0)
+    return err;
+  err = pthread_cond_init (&lock->waiting_writers, NULL);
+  if (err != 0)
+    return err;
+  lock->waiting_writers_count = 0;
+  lock->runcount = 0;
+  return 0;
+}
+
+int
+glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
+{
+  int err;
+
+  err = pthread_mutex_lock (&lock->lock);
+  if (err != 0)
+    return err;
+  /* Test whether only readers are currently running, and whether the runcount
+     field will not overflow.  */
+  /* POSIX says: "It is implementation-defined whether the calling thread
+     acquires the lock when a writer does not hold the lock and there are
+     writers blocked on the lock."  Let's say, no: give the writers a higher
+     priority.  */
+  while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+         waiting_readers.  */
+      err = pthread_cond_wait (&lock->waiting_readers, &lock->lock);
+      if (err != 0)
+        {
+          pthread_mutex_unlock (&lock->lock);
+          return err;
+        }
+    }
+  lock->runcount++;
+  return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
+{
+  int err;
+
+  err = pthread_mutex_lock (&lock->lock);
+  if (err != 0)
+    return err;
+  /* Test whether no readers or writers are currently running.  */
+  while (!(lock->runcount == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+         waiting_writers.  */
+      lock->waiting_writers_count++;
+      err = pthread_cond_wait (&lock->waiting_writers, &lock->lock);
+      if (err != 0)
+        {
+          lock->waiting_writers_count--;
+          pthread_mutex_unlock (&lock->lock);
+          return err;
+        }
+      lock->waiting_writers_count--;
+    }
+  lock->runcount--; /* runcount becomes -1 */
+  return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
+{
+  int err;
+
+  err = pthread_mutex_lock (&lock->lock);
+  if (err != 0)
+    return err;
+  if (lock->runcount < 0)
+    {
+      /* Drop a writer lock.  */
+      if (!(lock->runcount == -1))
+        {
+          pthread_mutex_unlock (&lock->lock);
+          return EINVAL;
+        }
+      lock->runcount = 0;
+    }
+  else
+    {
+      /* Drop a reader lock.  */
+      if (!(lock->runcount > 0))
+        {
+          pthread_mutex_unlock (&lock->lock);
+          return EINVAL;
+        }
+      lock->runcount--;
+    }
+  if (lock->runcount == 0)
+    {
+      /* POSIX recommends that "write locks shall take precedence over read
+         locks", to avoid "writer starvation".  */
+      if (lock->waiting_writers_count > 0)
+        {
+          /* Wake up one of the waiting writers.  */
+          err = pthread_cond_signal (&lock->waiting_writers);
+          if (err != 0)
+            {
+              pthread_mutex_unlock (&lock->lock);
+              return err;
+            }
+        }
+      else
+        {
+          /* Wake up all waiting readers.  */
+          err = pthread_cond_broadcast (&lock->waiting_readers);
+          if (err != 0)
+            {
+              pthread_mutex_unlock (&lock->lock);
+              return err;
+            }
+        }
+    }
+  return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock)
+{
+  int err;
+
+  err = pthread_mutex_destroy (&lock->lock);
+  if (err != 0)
+    return err;
+  err = pthread_cond_destroy (&lock->waiting_readers);
+  if (err != 0)
+    return err;
+  err = pthread_cond_destroy (&lock->waiting_writers);
+  if (err != 0)
+    return err;
+  return 0;
+}
+
+# endif
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+# if HAVE_PTHREAD_MUTEX_RECURSIVE
+
+#  if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+  pthread_mutexattr_t attributes;
+  int err;
+
+  err = pthread_mutexattr_init (&attributes);
+  if (err != 0)
+    return err;
+  err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE);
+  if (err != 0)
+    {
+      pthread_mutexattr_destroy (&attributes);
+      return err;
+    }
+  err = pthread_mutex_init (lock, &attributes);
+  if (err != 0)
+    {
+      pthread_mutexattr_destroy (&attributes);
+      return err;
+    }
+  err = pthread_mutexattr_destroy (&attributes);
+  if (err != 0)
+    return err;
+  return 0;
+}
+
+#  else
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+  pthread_mutexattr_t attributes;
+  int err;
+
+  err = pthread_mutexattr_init (&attributes);
+  if (err != 0)
+    return err;
+  err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE);
+  if (err != 0)
+    {
+      pthread_mutexattr_destroy (&attributes);
+      return err;
+    }
+  err = pthread_mutex_init (&lock->recmutex, &attributes);
+  if (err != 0)
+    {
+      pthread_mutexattr_destroy (&attributes);
+      return err;
+    }
+  err = pthread_mutexattr_destroy (&attributes);
+  if (err != 0)
+    return err;
+  lock->initialized = 1;
+  return 0;
+}
+
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
+{
+  if (!lock->initialized)
+    {
+      int err;
+
+      err = pthread_mutex_lock (&lock->guard);
+      if (err != 0)
+        return err;
+      if (!lock->initialized)
+        {
+          err = glthread_recursive_lock_init_multithreaded (lock);
+          if (err != 0)
+            {
+              pthread_mutex_unlock (&lock->guard);
+              return err;
+            }
+        }
+      err = pthread_mutex_unlock (&lock->guard);
+      if (err != 0)
+        return err;
+    }
+  return pthread_mutex_lock (&lock->recmutex);
+}
+
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
+{
+  if (!lock->initialized)
+    return EINVAL;
+  return pthread_mutex_unlock (&lock->recmutex);
+}
+
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
+{
+  int err;
+
+  if (!lock->initialized)
+    return EINVAL;
+  err = pthread_mutex_destroy (&lock->recmutex);
+  if (err != 0)
+    return err;
+  lock->initialized = 0;
+  return 0;
+}
+
+#  endif
+
+# else
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+  int err;
+
+  err = pthread_mutex_init (&lock->mutex, NULL);
+  if (err != 0)
+    return err;
+  lock->owner = (pthread_t) 0;
+  lock->depth = 0;
+  return 0;
+}
+
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
+{
+  pthread_t self = pthread_self ();
+  if (lock->owner != self)
+    {
+      int err;
+
+      err = pthread_mutex_lock (&lock->mutex);
+      if (err != 0)
+        return err;
+      lock->owner = self;
+    }
+  if (++(lock->depth) == 0) /* wraparound? */
+    {
+      lock->depth--;
+      return EAGAIN;
+    }
+  return 0;
+}
+
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != pthread_self ())
+    return EPERM;
+  if (lock->depth == 0)
+    return EINVAL;
+  if (--(lock->depth) == 0)
+    {
+      lock->owner = (pthread_t) 0;
+      return pthread_mutex_unlock (&lock->mutex);
+    }
+  else
+    return 0;
+}
+
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != (pthread_t) 0)
+    return EBUSY;
+  return pthread_mutex_destroy (&lock->mutex);
+}
+
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT;
+
+int
+glthread_once_singlethreaded (pthread_once_t *once_control)
+{
+  /* We don't know whether pthread_once_t is an integer type, a floating-point
+     type, a pointer type, or a structure type.  */
+  char *firstbyte = (char *)once_control;
+  if (*firstbyte == *(const char *)&fresh_once)
+    {
+      /* First time use of once_control.  Invert the first byte.  */
+      *firstbyte = ~ *(const char *)&fresh_once;
+      return 1;
+    }
+  else
+    return 0;
+}
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_PTH_THREADS
+
+/* Use the GNU Pth threads library.  */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+static void
+glthread_once_call (void *arg)
+{
+  void (**gl_once_temp_addr) (void) = (void (**) (void)) arg;
+  void (*initfunction) (void) = *gl_once_temp_addr;
+  initfunction ();
+}
+
+int
+glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void))
+{
+  void (*temp) (void) = initfunction;
+  return (!pth_once (once_control, glthread_once_call, &temp) ? errno : 0);
+}
+
+int
+glthread_once_singlethreaded (pth_once_t *once_control)
+{
+  /* We know that pth_once_t is an integer type.  */
+  if (*once_control == PTH_ONCE_INIT)
+    {
+      /* First time use of once_control.  Invert the marker.  */
+      *once_control = ~ PTH_ONCE_INIT;
+      return 1;
+    }
+  else
+    return 0;
+}
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_SOLARIS_THREADS
+
+/* Use the old Solaris threads library.  */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+  int err;
+
+  err = mutex_init (&lock->mutex, USYNC_THREAD, NULL);
+  if (err != 0)
+    return err;
+  lock->owner = (thread_t) 0;
+  lock->depth = 0;
+  return 0;
+}
+
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
+{
+  thread_t self = thr_self ();
+  if (lock->owner != self)
+    {
+      int err;
+
+      err = mutex_lock (&lock->mutex);
+      if (err != 0)
+        return err;
+      lock->owner = self;
+    }
+  if (++(lock->depth) == 0) /* wraparound? */
+    {
+      lock->depth--;
+      return EAGAIN;
+    }
+  return 0;
+}
+
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != thr_self ())
+    return EPERM;
+  if (lock->depth == 0)
+    return EINVAL;
+  if (--(lock->depth) == 0)
+    {
+      lock->owner = (thread_t) 0;
+      return mutex_unlock (&lock->mutex);
+    }
+  else
+    return 0;
+}
+
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != (thread_t) 0)
+    return EBUSY;
+  return mutex_destroy (&lock->mutex);
+}
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+int
+glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void))
+{
+  if (!once_control->inited)
+    {
+      int err;
+
+      /* Use the mutex to guarantee that if another thread is already calling
+         the initfunction, this thread waits until it's finished.  */
+      err = mutex_lock (&once_control->mutex);
+      if (err != 0)
+        return err;
+      if (!once_control->inited)
+        {
+          once_control->inited = 1;
+          initfunction ();
+        }
+      return mutex_unlock (&once_control->mutex);
+    }
+  else
+    return 0;
+}
+
+int
+glthread_once_singlethreaded (gl_once_t *once_control)
+{
+  /* We know that gl_once_t contains an integer type.  */
+  if (!once_control->inited)
+    {
+      /* First time use of once_control.  Invert the marker.  */
+      once_control->inited = ~ 0;
+      return 1;
+    }
+  else
+    return 0;
+}
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+void
+glthread_lock_init_func (gl_lock_t *lock)
+{
+  InitializeCriticalSection (&lock->lock);
+  lock->guard.done = 1;
+}
+
+int
+glthread_lock_lock_func (gl_lock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glthread_lock_init (lock);
+      else
+        /* Yield the CPU while waiting for another thread to finish
+           initializing this lock.  */
+        while (!lock->guard.done)
+          Sleep (0);
+    }
+  EnterCriticalSection (&lock->lock);
+  return 0;
+}
+
+int
+glthread_lock_unlock_func (gl_lock_t *lock)
+{
+  if (!lock->guard.done)
+    return EINVAL;
+  LeaveCriticalSection (&lock->lock);
+  return 0;
+}
+
+int
+glthread_lock_destroy_func (gl_lock_t *lock)
+{
+  if (!lock->guard.done)
+    return EINVAL;
+  DeleteCriticalSection (&lock->lock);
+  lock->guard.done = 0;
+  return 0;
+}
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+/* In this file, the waitqueues are implemented as circular arrays.  */
+#define gl_waitqueue_t gl_carray_waitqueue_t
+
+static inline void
+gl_waitqueue_init (gl_waitqueue_t *wq)
+{
+  wq->array = NULL;
+  wq->count = 0;
+  wq->alloc = 0;
+  wq->offset = 0;
+}
+
+/* Enqueues the current thread, represented by an event, in a wait queue.
+   Returns INVALID_HANDLE_VALUE if an allocation failure occurs.  */
+static HANDLE
+gl_waitqueue_add (gl_waitqueue_t *wq)
+{
+  HANDLE event;
+  unsigned int index;
+
+  if (wq->count == wq->alloc)
+    {
+      unsigned int new_alloc = 2 * wq->alloc + 1;
+      HANDLE *new_array =
+        (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
+      if (new_array == NULL)
+        /* No more memory.  */
+        return INVALID_HANDLE_VALUE;
+      /* Now is a good opportunity to rotate the array so that its contents
+         starts at offset 0.  */
+      if (wq->offset > 0)
+        {
+          unsigned int old_count = wq->count;
+          unsigned int old_alloc = wq->alloc;
+          unsigned int old_offset = wq->offset;
+          unsigned int i;
+          if (old_offset + old_count > old_alloc)
+            {
+              unsigned int limit = old_offset + old_count - old_alloc;
+              for (i = 0; i < limit; i++)
+                new_array[old_alloc + i] = new_array[i];
+            }
+          for (i = 0; i < old_count; i++)
+            new_array[i] = new_array[old_offset + i];
+          wq->offset = 0;
+        }
+      wq->array = new_array;
+      wq->alloc = new_alloc;
+    }
+  /* Whether the created event is a manual-reset one or an auto-reset one,
+     does not matter, since we will wait on it only once.  */
+  event = CreateEvent (NULL, TRUE, FALSE, NULL);
+  if (event == INVALID_HANDLE_VALUE)
+    /* No way to allocate an event.  */
+    return INVALID_HANDLE_VALUE;
+  index = wq->offset + wq->count;
+  if (index >= wq->alloc)
+    index -= wq->alloc;
+  wq->array[index] = event;
+  wq->count++;
+  return event;
+}
+
+/* Notifies the first thread from a wait queue and dequeues it.  */
+static inline void
+gl_waitqueue_notify_first (gl_waitqueue_t *wq)
+{
+  SetEvent (wq->array[wq->offset + 0]);
+  wq->offset++;
+  wq->count--;
+  if (wq->count == 0 || wq->offset == wq->alloc)
+    wq->offset = 0;
+}
+
+/* Notifies all threads from a wait queue and dequeues them all.  */
+static inline void
+gl_waitqueue_notify_all (gl_waitqueue_t *wq)
+{
+  unsigned int i;
+
+  for (i = 0; i < wq->count; i++)
+    {
+      unsigned int index = wq->offset + i;
+      if (index >= wq->alloc)
+        index -= wq->alloc;
+      SetEvent (wq->array[index]);
+    }
+  wq->count = 0;
+  wq->offset = 0;
+}
+
+void
+glthread_rwlock_init_func (gl_rwlock_t *lock)
+{
+  InitializeCriticalSection (&lock->lock);
+  gl_waitqueue_init (&lock->waiting_readers);
+  gl_waitqueue_init (&lock->waiting_writers);
+  lock->runcount = 0;
+  lock->guard.done = 1;
+}
+
+int
+glthread_rwlock_rdlock_func (gl_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glthread_rwlock_init (lock);
+      else
+        /* Yield the CPU while waiting for another thread to finish
+           initializing this lock.  */
+        while (!lock->guard.done)
+          Sleep (0);
+    }
+  EnterCriticalSection (&lock->lock);
+  /* Test whether only readers are currently running, and whether the runcount
+     field will not overflow.  */
+  if (!(lock->runcount + 1 > 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+         waiting_readers.  */
+      HANDLE event = gl_waitqueue_add (&lock->waiting_readers);
+      if (event != INVALID_HANDLE_VALUE)
+        {
+          DWORD result;
+          LeaveCriticalSection (&lock->lock);
+          /* Wait until another thread signals this event.  */
+          result = WaitForSingleObject (event, INFINITE);
+          if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+            abort ();
+          CloseHandle (event);
+          /* The thread which signalled the event already did the bookkeeping:
+             removed us from the waiting_readers, incremented lock->runcount.  */
+          if (!(lock->runcount > 0))
+            abort ();
+          return 0;
+        }
+      else
+        {
+          /* Allocation failure.  Weird.  */
+          do
+            {
+              LeaveCriticalSection (&lock->lock);
+              Sleep (1);
+              EnterCriticalSection (&lock->lock);
+            }
+          while (!(lock->runcount + 1 > 0));
+        }
+    }
+  lock->runcount++;
+  LeaveCriticalSection (&lock->lock);
+  return 0;
+}
+
+int
+glthread_rwlock_wrlock_func (gl_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glthread_rwlock_init (lock);
+      else
+        /* Yield the CPU while waiting for another thread to finish
+           initializing this lock.  */
+        while (!lock->guard.done)
+          Sleep (0);
+    }
+  EnterCriticalSection (&lock->lock);
+  /* Test whether no readers or writers are currently running.  */
+  if (!(lock->runcount == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+         waiting_writers.  */
+      HANDLE event = gl_waitqueue_add (&lock->waiting_writers);
+      if (event != INVALID_HANDLE_VALUE)
+        {
+          DWORD result;
+          LeaveCriticalSection (&lock->lock);
+          /* Wait until another thread signals this event.  */
+          result = WaitForSingleObject (event, INFINITE);
+          if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+            abort ();
+          CloseHandle (event);
+          /* The thread which signalled the event already did the bookkeeping:
+             removed us from the waiting_writers, set lock->runcount = -1.  */
+          if (!(lock->runcount == -1))
+            abort ();
+          return 0;
+        }
+      else
+        {
+          /* Allocation failure.  Weird.  */
+          do
+            {
+              LeaveCriticalSection (&lock->lock);
+              Sleep (1);
+              EnterCriticalSection (&lock->lock);
+            }
+          while (!(lock->runcount == 0));
+        }
+    }
+  lock->runcount--; /* runcount becomes -1 */
+  LeaveCriticalSection (&lock->lock);
+  return 0;
+}
+
+int
+glthread_rwlock_unlock_func (gl_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    return EINVAL;
+  EnterCriticalSection (&lock->lock);
+  if (lock->runcount < 0)
+    {
+      /* Drop a writer lock.  */
+      if (!(lock->runcount == -1))
+        abort ();
+      lock->runcount = 0;
+    }
+  else
+    {
+      /* Drop a reader lock.  */
+      if (!(lock->runcount > 0))
+        {
+          LeaveCriticalSection (&lock->lock);
+          return EPERM;
+        }
+      lock->runcount--;
+    }
+  if (lock->runcount == 0)
+    {
+      /* POSIX recommends that "write locks shall take precedence over read
+         locks", to avoid "writer starvation".  */
+      if (lock->waiting_writers.count > 0)
+        {
+          /* Wake up one of the waiting writers.  */
+          lock->runcount--;
+          gl_waitqueue_notify_first (&lock->waiting_writers);
+        }
+      else
+        {
+          /* Wake up all waiting readers.  */
+          lock->runcount += lock->waiting_readers.count;
+          gl_waitqueue_notify_all (&lock->waiting_readers);
+        }
+    }
+  LeaveCriticalSection (&lock->lock);
+  return 0;
+}
+
+int
+glthread_rwlock_destroy_func (gl_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    return EINVAL;
+  if (lock->runcount != 0)
+    return EBUSY;
+  DeleteCriticalSection (&lock->lock);
+  if (lock->waiting_readers.array != NULL)
+    free (lock->waiting_readers.array);
+  if (lock->waiting_writers.array != NULL)
+    free (lock->waiting_writers.array);
+  lock->guard.done = 0;
+  return 0;
+}
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+void
+glthread_recursive_lock_init_func (gl_recursive_lock_t *lock)
+{
+  lock->owner = 0;
+  lock->depth = 0;
+  InitializeCriticalSection (&lock->lock);
+  lock->guard.done = 1;
+}
+
+int
+glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glthread_recursive_lock_init (lock);
+      else
+        /* Yield the CPU while waiting for another thread to finish
+           initializing this lock.  */
+        while (!lock->guard.done)
+          Sleep (0);
+    }
+  {
+    DWORD self = GetCurrentThreadId ();
+    if (lock->owner != self)
+      {
+        EnterCriticalSection (&lock->lock);
+        lock->owner = self;
+      }
+    if (++(lock->depth) == 0) /* wraparound? */
+      {
+        lock->depth--;
+        return EAGAIN;
+      }
+  }
+  return 0;
+}
+
+int
+glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != GetCurrentThreadId ())
+    return EPERM;
+  if (lock->depth == 0)
+    return EINVAL;
+  if (--(lock->depth) == 0)
+    {
+      lock->owner = 0;
+      LeaveCriticalSection (&lock->lock);
+    }
+  return 0;
+}
+
+int
+glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != 0)
+    return EBUSY;
+  DeleteCriticalSection (&lock->lock);
+  lock->guard.done = 0;
+  return 0;
+}
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+void
+glthread_once_func (gl_once_t *once_control, void (*initfunction) (void))
+{
+  if (once_control->inited <= 0)
+    {
+      if (InterlockedIncrement (&once_control->started) == 0)
+        {
+          /* This thread is the first one to come to this once_control.  */
+          InitializeCriticalSection (&once_control->lock);
+          EnterCriticalSection (&once_control->lock);
+          once_control->inited = 0;
+          initfunction ();
+          once_control->inited = 1;
+          LeaveCriticalSection (&once_control->lock);
+        }
+      else
+        {
+          /* Undo last operation.  */
+          InterlockedDecrement (&once_control->started);
+          /* Some other thread has already started the initialization.
+             Yield the CPU while waiting for the other thread to finish
+             initializing and taking the lock.  */
+          while (once_control->inited < 0)
+            Sleep (0);
+          if (once_control->inited <= 0)
+            {
+              /* Take the lock.  This blocks until the other thread has
+                 finished calling the initfunction.  */
+              EnterCriticalSection (&once_control->lock);
+              LeaveCriticalSection (&once_control->lock);
+              if (!(once_control->inited > 0))
+                abort ();
+            }
+        }
+    }
+}
+
+#endif
+
+/* ========================================================================= */
diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h
new file mode 100644 (file)
index 0000000..6782d49
--- /dev/null
@@ -0,0 +1,927 @@
+/* Locking in multithreaded situations.
+   Copyright (C) 2005-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
+   gthr-win32.h.  */
+
+/* This file contains locking primitives for use with a given thread library.
+   It does not contain primitives for creating threads or for other
+   synchronization primitives.
+
+   Normal (non-recursive) locks:
+     Type:                gl_lock_t
+     Declaration:         gl_lock_define(extern, name)
+     Initializer:         gl_lock_define_initialized(, name)
+     Initialization:      gl_lock_init (name);
+     Taking the lock:     gl_lock_lock (name);
+     Releasing the lock:  gl_lock_unlock (name);
+     De-initialization:   gl_lock_destroy (name);
+   Equivalent functions with control of error handling:
+     Initialization:      err = glthread_lock_init (&name);
+     Taking the lock:     err = glthread_lock_lock (&name);
+     Releasing the lock:  err = glthread_lock_unlock (&name);
+     De-initialization:   err = glthread_lock_destroy (&name);
+
+   Read-Write (non-recursive) locks:
+     Type:                gl_rwlock_t
+     Declaration:         gl_rwlock_define(extern, name)
+     Initializer:         gl_rwlock_define_initialized(, name)
+     Initialization:      gl_rwlock_init (name);
+     Taking the lock:     gl_rwlock_rdlock (name);
+                          gl_rwlock_wrlock (name);
+     Releasing the lock:  gl_rwlock_unlock (name);
+     De-initialization:   gl_rwlock_destroy (name);
+   Equivalent functions with control of error handling:
+     Initialization:      err = glthread_rwlock_init (&name);
+     Taking the lock:     err = glthread_rwlock_rdlock (&name);
+                          err = glthread_rwlock_wrlock (&name);
+     Releasing the lock:  err = glthread_rwlock_unlock (&name);
+     De-initialization:   err = glthread_rwlock_destroy (&name);
+
+   Recursive locks:
+     Type:                gl_recursive_lock_t
+     Declaration:         gl_recursive_lock_define(extern, name)
+     Initializer:         gl_recursive_lock_define_initialized(, name)
+     Initialization:      gl_recursive_lock_init (name);
+     Taking the lock:     gl_recursive_lock_lock (name);
+     Releasing the lock:  gl_recursive_lock_unlock (name);
+     De-initialization:   gl_recursive_lock_destroy (name);
+   Equivalent functions with control of error handling:
+     Initialization:      err = glthread_recursive_lock_init (&name);
+     Taking the lock:     err = glthread_recursive_lock_lock (&name);
+     Releasing the lock:  err = glthread_recursive_lock_unlock (&name);
+     De-initialization:   err = glthread_recursive_lock_destroy (&name);
+
+  Once-only execution:
+     Type:                gl_once_t
+     Initializer:         gl_once_define(extern, name)
+     Execution:           gl_once (name, initfunction);
+   Equivalent functions with control of error handling:
+     Execution:           err = glthread_once (&name, initfunction);
+*/
+
+
+#ifndef _LOCK_H
+#define _LOCK_H
+
+#include <errno.h>
+#include <stdlib.h>
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* Use the POSIX threads library.  */
+
+# include <pthread.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+/* The pthread_in_use() detection needs to be done at runtime.  */
+#  define pthread_in_use() \
+     glthread_in_use ()
+extern int glthread_in_use (void);
+
+# endif
+
+# if USE_POSIX_THREADS_WEAK
+
+/* Use weak references to the POSIX threads library.  */
+
+/* Weak references avoid dragging in external libraries if the other parts
+   of the program don't use them.  Here we use them, because we don't want
+   every program that uses libintl to depend on libpthread.  This assumes
+   that libpthread would not be loaded after libintl; i.e. if libintl is
+   loaded first, by an executable that does not depend on libpthread, and
+   then a module is dynamically loaded that depends on libpthread, libintl
+   will not be multithread-safe.  */
+
+/* The way to test at runtime whether libpthread is present is to test
+   whether a function pointer's value, such as &pthread_mutex_init, is
+   non-NULL.  However, some versions of GCC have a bug through which, in
+   PIC mode, &foo != NULL always evaluates to true if there is a direct
+   call to foo(...) in the same function.  To avoid this, we test the
+   address of a function in libpthread that we don't use.  */
+
+#  pragma weak pthread_mutex_init
+#  pragma weak pthread_mutex_lock
+#  pragma weak pthread_mutex_unlock
+#  pragma weak pthread_mutex_destroy
+#  pragma weak pthread_rwlock_init
+#  pragma weak pthread_rwlock_rdlock
+#  pragma weak pthread_rwlock_wrlock
+#  pragma weak pthread_rwlock_unlock
+#  pragma weak pthread_rwlock_destroy
+#  pragma weak pthread_once
+#  pragma weak pthread_cond_init
+#  pragma weak pthread_cond_wait
+#  pragma weak pthread_cond_signal
+#  pragma weak pthread_cond_broadcast
+#  pragma weak pthread_cond_destroy
+#  pragma weak pthread_mutexattr_init
+#  pragma weak pthread_mutexattr_settype
+#  pragma weak pthread_mutexattr_destroy
+#  ifndef pthread_self
+#   pragma weak pthread_self
+#  endif
+
+#  if !PTHREAD_IN_USE_DETECTION_HARD
+#   pragma weak pthread_cancel
+#   define pthread_in_use() (pthread_cancel != NULL)
+#  endif
+
+# else
+
+#  if !PTHREAD_IN_USE_DETECTION_HARD
+#   define pthread_in_use() 1
+#  endif
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef pthread_mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS pthread_mutex_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS pthread_mutex_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+    PTHREAD_MUTEX_INITIALIZER
+# define glthread_lock_init(LOCK) \
+    (pthread_in_use () ? pthread_mutex_init (LOCK, NULL) : 0)
+# define glthread_lock_lock(LOCK) \
+    (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
+# define glthread_lock_unlock(LOCK) \
+    (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
+# define glthread_lock_destroy(LOCK) \
+    (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+# if HAVE_PTHREAD_RWLOCK
+
+#  ifdef PTHREAD_RWLOCK_INITIALIZER
+
+typedef pthread_rwlock_t gl_rwlock_t;
+#   define gl_rwlock_define(STORAGECLASS, NAME) \
+      STORAGECLASS pthread_rwlock_t NAME;
+#   define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+      STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer;
+#   define gl_rwlock_initializer \
+      PTHREAD_RWLOCK_INITIALIZER
+#   define glthread_rwlock_init(LOCK) \
+      (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
+#   define glthread_rwlock_rdlock(LOCK) \
+      (pthread_in_use () ? pthread_rwlock_rdlock (LOCK) : 0)
+#   define glthread_rwlock_wrlock(LOCK) \
+      (pthread_in_use () ? pthread_rwlock_wrlock (LOCK) : 0)
+#   define glthread_rwlock_unlock(LOCK) \
+      (pthread_in_use () ? pthread_rwlock_unlock (LOCK) : 0)
+#   define glthread_rwlock_destroy(LOCK) \
+      (pthread_in_use () ? pthread_rwlock_destroy (LOCK) : 0)
+
+#  else
+
+typedef struct
+        {
+          int initialized;
+          pthread_mutex_t guard;   /* protects the initialization */
+          pthread_rwlock_t rwlock; /* read-write lock */
+        }
+        gl_rwlock_t;
+#   define gl_rwlock_define(STORAGECLASS, NAME) \
+      STORAGECLASS gl_rwlock_t NAME;
+#   define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+      STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+#   define gl_rwlock_initializer \
+      { 0, PTHREAD_MUTEX_INITIALIZER }
+#   define glthread_rwlock_init(LOCK) \
+      (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
+#   define glthread_rwlock_rdlock(LOCK) \
+      (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
+#   define glthread_rwlock_wrlock(LOCK) \
+      (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
+#   define glthread_rwlock_unlock(LOCK) \
+      (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
+#   define glthread_rwlock_destroy(LOCK) \
+      (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
+
+#  endif
+
+# else
+
+typedef struct
+        {
+          pthread_mutex_t lock; /* protects the remaining fields */
+          pthread_cond_t waiting_readers; /* waiting readers */
+          pthread_cond_t waiting_writers; /* waiting writers */
+          unsigned int waiting_writers_count; /* number of waiting writers */
+          int runcount; /* number of readers running, or -1 when a writer runs */
+        }
+        gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+    { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 }
+# define glthread_rwlock_init(LOCK) \
+    (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+    (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+    (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+    (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+    (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
+
+# endif
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+# if HAVE_PTHREAD_MUTEX_RECURSIVE
+
+#  if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+
+typedef pthread_mutex_t gl_recursive_lock_t;
+#   define gl_recursive_lock_define(STORAGECLASS, NAME) \
+      STORAGECLASS pthread_mutex_t NAME;
+#   define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+      STORAGECLASS pthread_mutex_t NAME = gl_recursive_lock_initializer;
+#   ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#    define gl_recursive_lock_initializer \
+       PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#   else
+#    define gl_recursive_lock_initializer \
+       PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#   endif
+#   define glthread_recursive_lock_init(LOCK) \
+      (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+#   define glthread_recursive_lock_lock(LOCK) \
+      (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
+#   define glthread_recursive_lock_unlock(LOCK) \
+      (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
+#   define glthread_recursive_lock_destroy(LOCK) \
+      (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+
+#  else
+
+typedef struct
+        {
+          pthread_mutex_t recmutex; /* recursive mutex */
+          pthread_mutex_t guard;    /* protects the initialization */
+          int initialized;
+        }
+        gl_recursive_lock_t;
+#   define gl_recursive_lock_define(STORAGECLASS, NAME) \
+      STORAGECLASS gl_recursive_lock_t NAME;
+#   define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+      STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+#   define gl_recursive_lock_initializer \
+      { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, 0 }
+#   define glthread_recursive_lock_init(LOCK) \
+      (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+#   define glthread_recursive_lock_lock(LOCK) \
+      (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+#   define glthread_recursive_lock_unlock(LOCK) \
+      (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+#   define glthread_recursive_lock_destroy(LOCK) \
+      (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
+
+#  endif
+
+# else
+
+/* Old versions of POSIX threads on Solaris did not have recursive locks.
+   We have to implement them ourselves.  */
+
+typedef struct
+        {
+          pthread_mutex_t mutex;
+          pthread_t owner;
+          unsigned long depth;
+        }
+        gl_recursive_lock_t;
+#  define gl_recursive_lock_define(STORAGECLASS, NAME) \
+     STORAGECLASS gl_recursive_lock_t NAME;
+#  define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+     STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+#  define gl_recursive_lock_initializer \
+     { PTHREAD_MUTEX_INITIALIZER, (pthread_t) 0, 0 }
+#  define glthread_recursive_lock_init(LOCK) \
+     (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+#  define glthread_recursive_lock_lock(LOCK) \
+     (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+#  define glthread_recursive_lock_unlock(LOCK) \
+     (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+#  define glthread_recursive_lock_destroy(LOCK) \
+     (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
+
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef pthread_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+    STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+    (pthread_in_use ()                                                         \
+     ? pthread_once (ONCE_CONTROL, INITFUNCTION)                               \
+     : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_singlethreaded (pthread_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_PTH_THREADS
+
+/* Use the GNU Pth threads library.  */
+
+# include <pth.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if USE_PTH_THREADS_WEAK
+
+/* Use weak references to the GNU Pth threads library.  */
+
+#  pragma weak pth_mutex_init
+#  pragma weak pth_mutex_acquire
+#  pragma weak pth_mutex_release
+#  pragma weak pth_rwlock_init
+#  pragma weak pth_rwlock_acquire
+#  pragma weak pth_rwlock_release
+#  pragma weak pth_once
+
+#  pragma weak pth_cancel
+#  define pth_in_use() (pth_cancel != NULL)
+
+# else
+
+#  define pth_in_use() 1
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef pth_mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS pth_mutex_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS pth_mutex_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+    PTH_MUTEX_INIT
+# define glthread_lock_init(LOCK) \
+    (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
+# define glthread_lock_lock(LOCK) \
+    (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
+# define glthread_lock_unlock(LOCK) \
+    (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
+# define glthread_lock_destroy(LOCK) \
+    ((void)(LOCK), 0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef pth_rwlock_t gl_rwlock_t;
+#  define gl_rwlock_define(STORAGECLASS, NAME) \
+     STORAGECLASS pth_rwlock_t NAME;
+#  define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+     STORAGECLASS pth_rwlock_t NAME = gl_rwlock_initializer;
+#  define gl_rwlock_initializer \
+     PTH_RWLOCK_INIT
+#  define glthread_rwlock_init(LOCK) \
+     (pth_in_use () && !pth_rwlock_init (LOCK) ? errno : 0)
+#  define glthread_rwlock_rdlock(LOCK) \
+     (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RD, 0, NULL) ? errno : 0)
+#  define glthread_rwlock_wrlock(LOCK) \
+     (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RW, 0, NULL) ? errno : 0)
+#  define glthread_rwlock_unlock(LOCK) \
+     (pth_in_use () && !pth_rwlock_release (LOCK) ? errno : 0)
+#  define glthread_rwlock_destroy(LOCK) \
+     ((void)(LOCK), 0)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* In Pth, mutexes are recursive by default.  */
+typedef pth_mutex_t gl_recursive_lock_t;
+#  define gl_recursive_lock_define(STORAGECLASS, NAME) \
+     STORAGECLASS pth_mutex_t NAME;
+#  define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+     STORAGECLASS pth_mutex_t NAME = gl_recursive_lock_initializer;
+#  define gl_recursive_lock_initializer \
+     PTH_MUTEX_INIT
+#  define glthread_recursive_lock_init(LOCK) \
+     (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
+#  define glthread_recursive_lock_lock(LOCK) \
+     (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
+#  define glthread_recursive_lock_unlock(LOCK) \
+     (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
+#  define glthread_recursive_lock_destroy(LOCK) \
+     ((void)(LOCK), 0)
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef pth_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+    STORAGECLASS pth_once_t NAME = PTH_ONCE_INIT;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+    (pth_in_use ()                                                             \
+     ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION)                \
+     : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void));
+extern int glthread_once_singlethreaded (pth_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_SOLARIS_THREADS
+
+/* Use the old Solaris threads library.  */
+
+# include <thread.h>
+# include <synch.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if USE_SOLARIS_THREADS_WEAK
+
+/* Use weak references to the old Solaris threads library.  */
+
+#  pragma weak mutex_init
+#  pragma weak mutex_lock
+#  pragma weak mutex_unlock
+#  pragma weak mutex_destroy
+#  pragma weak rwlock_init
+#  pragma weak rw_rdlock
+#  pragma weak rw_wrlock
+#  pragma weak rw_unlock
+#  pragma weak rwlock_destroy
+#  pragma weak thr_self
+
+#  pragma weak thr_suspend
+#  define thread_in_use() (thr_suspend != NULL)
+
+# else
+
+#  define thread_in_use() 1
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS mutex_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS mutex_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+    DEFAULTMUTEX
+# define glthread_lock_init(LOCK) \
+    (thread_in_use () ? mutex_init (LOCK, USYNC_THREAD, NULL) : 0)
+# define glthread_lock_lock(LOCK) \
+    (thread_in_use () ? mutex_lock (LOCK) : 0)
+# define glthread_lock_unlock(LOCK) \
+    (thread_in_use () ? mutex_unlock (LOCK) : 0)
+# define glthread_lock_destroy(LOCK) \
+    (thread_in_use () ? mutex_destroy (LOCK) : 0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef rwlock_t gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+    STORAGECLASS rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+    DEFAULTRWLOCK
+# define glthread_rwlock_init(LOCK) \
+    (thread_in_use () ? rwlock_init (LOCK, USYNC_THREAD, NULL) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+    (thread_in_use () ? rw_rdlock (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+    (thread_in_use () ? rw_wrlock (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+    (thread_in_use () ? rw_unlock (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+    (thread_in_use () ? rwlock_destroy (LOCK) : 0)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* Old Solaris threads did not have recursive locks.
+   We have to implement them ourselves.  */
+
+typedef struct
+        {
+          mutex_t mutex;
+          thread_t owner;
+          unsigned long depth;
+        }
+        gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+    { DEFAULTMUTEX, (thread_t) 0, 0 }
+# define glthread_recursive_lock_init(LOCK) \
+    (thread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+    (thread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+    (thread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+    (thread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef struct
+        {
+          volatile int inited;
+          mutex_t mutex;
+        }
+        gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_once_t NAME = { 0, DEFAULTMUTEX };
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+    (thread_in_use ()                                                          \
+     ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION)                \
+     : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void));
+extern int glthread_once_singlethreaded (gl_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+# include <windows.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* We can use CRITICAL_SECTION directly, rather than the native Windows Event,
+   Mutex, Semaphore types, because
+     - we need only to synchronize inside a single process (address space),
+       not inter-process locking,
+     - we don't need to support trylock operations.  (TryEnterCriticalSection
+       does not work on Windows 95/98/ME.  Packages that need trylock usually
+       define their own mutex type.)  */
+
+/* There is no way to statically initialize a CRITICAL_SECTION.  It needs
+   to be done lazily, once only.  For this we need spinlocks.  */
+
+typedef struct { volatile int done; volatile long started; } gl_spinlock_t;
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef struct
+        {
+          gl_spinlock_t guard; /* protects the initialization */
+          CRITICAL_SECTION lock;
+        }
+        gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_lock_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS gl_lock_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+    { { 0, -1 } }
+# define glthread_lock_init(LOCK) \
+    (glthread_lock_init_func (LOCK), 0)
+# define glthread_lock_lock(LOCK) \
+    glthread_lock_lock_func (LOCK)
+# define glthread_lock_unlock(LOCK) \
+    glthread_lock_unlock_func (LOCK)
+# define glthread_lock_destroy(LOCK) \
+    glthread_lock_destroy_func (LOCK)
+extern void glthread_lock_init_func (gl_lock_t *lock);
+extern int glthread_lock_lock_func (gl_lock_t *lock);
+extern int glthread_lock_unlock_func (gl_lock_t *lock);
+extern int glthread_lock_destroy_func (gl_lock_t *lock);
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+/* It is impossible to implement read-write locks using plain locks, without
+   introducing an extra thread dedicated to managing read-write locks.
+   Therefore here we need to use the low-level Event type.  */
+
+typedef struct
+        {
+          HANDLE *array; /* array of waiting threads, each represented by an event */
+          unsigned int count; /* number of waiting threads */
+          unsigned int alloc; /* length of allocated array */
+          unsigned int offset; /* index of first waiting thread in array */
+        }
+        gl_carray_waitqueue_t;
+typedef struct
+        {
+          gl_spinlock_t guard; /* protects the initialization */
+          CRITICAL_SECTION lock; /* protects the remaining fields */
+          gl_carray_waitqueue_t waiting_readers; /* waiting readers */
+          gl_carray_waitqueue_t waiting_writers; /* waiting writers */
+          int runcount; /* number of readers running, or -1 when a writer runs */
+        }
+        gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+    { { 0, -1 } }
+# define glthread_rwlock_init(LOCK) \
+    (glthread_rwlock_init_func (LOCK), 0)
+# define glthread_rwlock_rdlock(LOCK) \
+    glthread_rwlock_rdlock_func (LOCK)
+# define glthread_rwlock_wrlock(LOCK) \
+    glthread_rwlock_wrlock_func (LOCK)
+# define glthread_rwlock_unlock(LOCK) \
+    glthread_rwlock_unlock_func (LOCK)
+# define glthread_rwlock_destroy(LOCK) \
+    glthread_rwlock_destroy_func (LOCK)
+extern void glthread_rwlock_init_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_func (gl_rwlock_t *lock);
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* The native Windows documentation says that CRITICAL_SECTION already
+   implements a recursive lock.  But we need not rely on it: It's easy to
+   implement a recursive lock without this assumption.  */
+
+typedef struct
+        {
+          gl_spinlock_t guard; /* protects the initialization */
+          DWORD owner;
+          unsigned long depth;
+          CRITICAL_SECTION lock;
+        }
+        gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+    { { 0, -1 }, 0, 0 }
+# define glthread_recursive_lock_init(LOCK) \
+    (glthread_recursive_lock_init_func (LOCK), 0)
+# define glthread_recursive_lock_lock(LOCK) \
+    glthread_recursive_lock_lock_func (LOCK)
+# define glthread_recursive_lock_unlock(LOCK) \
+    glthread_recursive_lock_unlock_func (LOCK)
+# define glthread_recursive_lock_destroy(LOCK) \
+    glthread_recursive_lock_destroy_func (LOCK)
+extern void glthread_recursive_lock_init_func (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock);
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef struct
+        {
+          volatile int inited;
+          volatile long started;
+          CRITICAL_SECTION lock;
+        }
+        gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_once_t NAME = { -1, -1 };
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+    (glthread_once_func (ONCE_CONTROL, INITFUNCTION), 0)
+extern void glthread_once_func (gl_once_t *once_control, void (*initfunction) (void));
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
+
+/* Provide dummy implementation if threads are not supported.  */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef int gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME)
+# define gl_lock_define_initialized(STORAGECLASS, NAME)
+# define glthread_lock_init(NAME) 0
+# define glthread_lock_lock(NAME) 0
+# define glthread_lock_unlock(NAME) 0
+# define glthread_lock_destroy(NAME) 0
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef int gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME)
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME)
+# define glthread_rwlock_init(NAME) 0
+# define glthread_rwlock_rdlock(NAME) 0
+# define glthread_rwlock_wrlock(NAME) 0
+# define glthread_rwlock_unlock(NAME) 0
+# define glthread_rwlock_destroy(NAME) 0
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+typedef int gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME)
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME)
+# define glthread_recursive_lock_init(NAME) 0
+# define glthread_recursive_lock_lock(NAME) 0
+# define glthread_recursive_lock_unlock(NAME) 0
+# define glthread_recursive_lock_destroy(NAME) 0
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef int gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_once_t NAME = 0;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+    (*(ONCE_CONTROL) == 0 ? (*(ONCE_CONTROL) = ~ 0, INITFUNCTION (), 0) : 0)
+
+#endif
+
+/* ========================================================================= */
+
+/* Macros with built-in error handling.  */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+#define gl_lock_init(NAME) \
+   do                                  \
+     {                                 \
+       if (glthread_lock_init (&NAME)) \
+         abort ();                     \
+     }                                 \
+   while (0)
+#define gl_lock_lock(NAME) \
+   do                                  \
+     {                                 \
+       if (glthread_lock_lock (&NAME)) \
+         abort ();                     \
+     }                                 \
+   while (0)
+#define gl_lock_unlock(NAME) \
+   do                                    \
+     {                                   \
+       if (glthread_lock_unlock (&NAME)) \
+         abort ();                       \
+     }                                   \
+   while (0)
+#define gl_lock_destroy(NAME) \
+   do                                     \
+     {                                    \
+       if (glthread_lock_destroy (&NAME)) \
+         abort ();                        \
+     }                                    \
+   while (0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+#define gl_rwlock_init(NAME) \
+   do                                    \
+     {                                   \
+       if (glthread_rwlock_init (&NAME)) \
+         abort ();                       \
+     }                                   \
+   while (0)
+#define gl_rwlock_rdlock(NAME) \
+   do                                      \
+     {                                     \
+       if (glthread_rwlock_rdlock (&NAME)) \
+         abort ();                         \
+     }                                     \
+   while (0)
+#define gl_rwlock_wrlock(NAME) \
+   do                                      \
+     {                                     \
+       if (glthread_rwlock_wrlock (&NAME)) \
+         abort ();                         \
+     }                                     \
+   while (0)
+#define gl_rwlock_unlock(NAME) \
+   do                                      \
+     {                                     \
+       if (glthread_rwlock_unlock (&NAME)) \
+         abort ();                         \
+     }                                     \
+   while (0)
+#define gl_rwlock_destroy(NAME) \
+   do                                       \
+     {                                      \
+       if (glthread_rwlock_destroy (&NAME)) \
+         abort ();                          \
+     }                                      \
+   while (0)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+#define gl_recursive_lock_init(NAME) \
+   do                                            \
+     {                                           \
+       if (glthread_recursive_lock_init (&NAME)) \
+         abort ();                               \
+     }                                           \
+   while (0)
+#define gl_recursive_lock_lock(NAME) \
+   do                                            \
+     {                                           \
+       if (glthread_recursive_lock_lock (&NAME)) \
+         abort ();                               \
+     }                                           \
+   while (0)
+#define gl_recursive_lock_unlock(NAME) \
+   do                                              \
+     {                                             \
+       if (glthread_recursive_lock_unlock (&NAME)) \
+         abort ();                                 \
+     }                                             \
+   while (0)
+#define gl_recursive_lock_destroy(NAME) \
+   do                                               \
+     {                                              \
+       if (glthread_recursive_lock_destroy (&NAME)) \
+         abort ();                                  \
+     }                                              \
+   while (0)
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+#define gl_once(NAME, INITFUNCTION) \
+   do                                           \
+     {                                          \
+       if (glthread_once (&NAME, INITFUNCTION)) \
+         abort ();                              \
+     }                                          \
+   while (0)
+
+/* ========================================================================= */
+
+#endif /* _LOCK_H */
diff --git a/lib/glthread/threadlib.c b/lib/glthread/threadlib.c
new file mode 100644 (file)
index 0000000..946268e
--- /dev/null
@@ -0,0 +1,73 @@
+/* Multithreading primitives.
+   Copyright (C) 2005-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
+
+#include <config.h>
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* Use the POSIX threads library.  */
+
+# include <pthread.h>
+# include <stdlib.h>
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+/* The function to be executed by a dummy thread.  */
+static void *
+dummy_thread_func (void *arg)
+{
+  return arg;
+}
+
+int
+glthread_in_use (void)
+{
+  static int tested;
+  static int result; /* 1: linked with -lpthread, 0: only with libc */
+
+  if (!tested)
+    {
+      pthread_t thread;
+
+      if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
+        /* Thread creation failed.  */
+        result = 0;
+      else
+        {
+          /* Thread creation works.  */
+          void *retval;
+          if (pthread_join (thread, &retval) != 0)
+            abort ();
+          result = 1;
+        }
+      tested = 1;
+    }
+  return result;
+}
+
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+/* This declaration is solely to ensure that after preprocessing
+   this file is never empty.  */
+typedef int dummy;
index bb79c0d2b6c7664b17aa8beb76b27a4bfb4073f8..7abaae7507a238ddeab303b9c6b9be3a53261b24 100644 (file)
@@ -1,33 +1,30 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
 #
-# This file is free software, distributed under the terms of the GNU
-# General Public License.  As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
+# This file 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 3 of the License, or
+# (at your option) any later version.
+#
+# This file 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 file.  If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libgzip --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=getline --avoid=rpmatch --no-libtool --macro-prefix=gl announce-gen calloc close closein fclose fcntl fcntl-safer fdl fdopendir fprintf-posix getopt-gnu git-version-gen gitlog-to-changelog gnu-make gnu-web-doc-update gnumakefile gnupload ignore-value lstat maintainer-makefile malloc manywarnings perror printf-posix realloc stat-time sys_stat time update-copyright utimens xalloc yesno
-
-AUTOMAKE_OPTIONS = 1.5 gnits
-
-SUBDIRS =
-noinst_HEADERS =
-noinst_LIBRARIES =
-noinst_LTLIBRARIES =
-EXTRA_DIST =
-BUILT_SOURCES =
-SUFFIXES =
-MOSTLYCLEANFILES = core *.stackdump
-MOSTLYCLEANDIRS =
-CLEANFILES =
-DISTCLEANFILES =
-MAINTAINERCLEANFILES =
-
-AM_CPPFLAGS =
-AM_CFLAGS =
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libgzip --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=getline --avoid=rpmatch --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen calloc close closein fclose fcntl fcntl-safer fdl fdopendir fprintf-posix getopt-gnu git-version-gen gitlog-to-changelog gnu-make gnu-web-doc-update gnumakefile gnupload ignore-value largefile lib-ignore lstat maintainer-makefile malloc-gnu manywarnings perror printf-posix readme-release realloc-gnu savedir stat-time sys_stat time update-copyright utimens xalloc yesno
+
+
+MOSTLYCLEANFILES += core *.stackdump
 
 noinst_LIBRARIES += libgzip.a
 
@@ -42,12 +39,17 @@ BUILT_SOURCES += $(ALLOCA_H)
 
 # We need the following in order to create <alloca.h> when the system
 # doesn't have one that works with the given compiler.
-alloca.h: alloca.in.h
+if GL_GENERATE_ALLOCA_H
+alloca.h: alloca.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          cat $(srcdir)/alloca.in.h; \
        } > $@-t && \
        mv -f $@-t $@
+else
+alloca.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += alloca.h alloca.h-t
 
 EXTRA_DIST += alloca.in.h
@@ -61,38 +63,42 @@ EXTRA_DIST += $(top_srcdir)/build-aux/announce-gen
 
 ## end   gnulib module announce-gen
 
-## begin gnulib module arg-nonnull
+## begin gnulib module at-internal
 
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
 
-BUILT_SOURCES += arg-nonnull.h
-# The arg-nonnull.h that gets inserted into generated .h files is the same as
-# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
-arg-nonnull.h: $(top_srcdir)/build-aux/arg-nonnull.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/build-aux/arg-nonnull.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+EXTRA_DIST += openat-priv.h openat-proc.c
 
-ARG_NONNULL_H=arg-nonnull.h
+EXTRA_libgzip_a_SOURCES += openat-proc.c
+
+## end   gnulib module at-internal
+
+## begin gnulib module c-ctype
 
-EXTRA_DIST += $(top_srcdir)/build-aux/arg-nonnull.h
+libgzip_a_SOURCES += c-ctype.h c-ctype.c
 
-## end   gnulib module arg-nonnull
+## end   gnulib module c-ctype
 
-## begin gnulib module calloc
+## begin gnulib module c-strcase
+
+libgzip_a_SOURCES += c-strcase.h c-strcasecmp.c c-strncasecmp.c
+
+## end   gnulib module c-strcase
+
+## begin gnulib module c-strcaseeq
+
+
+EXTRA_DIST += c-strcaseeq.h
+
+## end   gnulib module c-strcaseeq
+
+## begin gnulib module calloc-gnu
 
 
 EXTRA_DIST += calloc.c
 
 EXTRA_libgzip_a_SOURCES += calloc.c
 
-## end   gnulib module calloc
+## end   gnulib module calloc-gnu
 
 ## begin gnulib module calloc-posix
 
@@ -112,14 +118,13 @@ EXTRA_libgzip_a_SOURCES += chdir-long.c
 
 ## end   gnulib module chdir-long
 
-## begin gnulib module chown
-
+## begin gnulib module cloexec
 
-EXTRA_DIST += chown.c fchown-stub.c
+libgzip_a_SOURCES += cloexec.c
 
-EXTRA_libgzip_a_SOURCES += chown.c fchown-stub.c
+EXTRA_DIST += cloexec.h
 
-## end   gnulib module chown
+## end   gnulib module cloexec
 
 ## begin gnulib module close
 
@@ -130,58 +135,43 @@ EXTRA_libgzip_a_SOURCES += close.c
 
 ## end   gnulib module close
 
-## begin gnulib module close-hook
+## begin gnulib module close-stream
 
-libgzip_a_SOURCES += close-hook.c
+libgzip_a_SOURCES += close-stream.c
 
-EXTRA_DIST += close-hook.h
+EXTRA_DIST += close-stream.h
 
-## end   gnulib module close-hook
+## end   gnulib module close-stream
 
-## begin gnulib module close-stream
+## begin gnulib module closedir
 
 
-EXTRA_DIST += close-stream.c close-stream.h
+EXTRA_DIST += closedir.c dirent-private.h
 
-EXTRA_libgzip_a_SOURCES += close-stream.c
+EXTRA_libgzip_a_SOURCES += closedir.c
 
-## end   gnulib module close-stream
+## end   gnulib module closedir
 
 ## begin gnulib module closein
 
+libgzip_a_SOURCES += closein.c
 
-EXTRA_DIST += closein.c closein.h
-
-EXTRA_libgzip_a_SOURCES += closein.c
+EXTRA_DIST += closein.h
 
 ## end   gnulib module closein
 
 ## begin gnulib module closeout
 
+libgzip_a_SOURCES += closeout.c
 
-EXTRA_DIST += closeout.c closeout.h
-
-EXTRA_libgzip_a_SOURCES += closeout.c
+EXTRA_DIST += closeout.h
 
 ## end   gnulib module closeout
 
 ## begin gnulib module configmake
 
-# Retrieve values of the variables through 'configure' followed by
-# 'make', not directly through 'configure', so that a user who
-# sets some of these variables consistently on the 'make' command
-# line gets correct results.
-#
-# One advantage of this approach, compared to the classical
-# approach of adding -DLIBDIR=\"$(libdir)\" etc. to AM_CPPFLAGS,
-# is that it protects against the use of undefined variables.
-# If, say, $(libdir) is not set in the Makefile, LIBDIR is not
-# defined by this module, and code using LIBDIR gives a
-# compilation error.
-#
-# Another advantage is that 'make' output is shorter.
-#
-# Listed in the same order as the GNU makefile conventions.
+# Listed in the same order as the GNU makefile conventions, and
+# provided by autoconf 2.59c+.
 # The Automake-defined pkg* macros are appended, in the order
 # listed in the Automake 1.10a+ documentation.
 configmake.h: Makefile
@@ -215,11 +205,7 @@ configmake.h: Makefile
          echo '#define PKGLIBDIR "$(pkglibdir)"'; \
          echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
        } | sed '/""/d' > $@-t && \
-       if test -f $@ && cmp $@-t $@ > /dev/null; then \
-         rm -f $@-t; \
-       else \
-         rm -f $@; mv $@-t $@; \
-       fi
+       mv -f $@-t $@
 
 BUILT_SOURCES += configmake.h
 CLEANFILES += configmake.h configmake.h-t
@@ -232,25 +218,39 @@ BUILT_SOURCES += dirent.h
 
 # We need the following in order to create <dirent.h> when the system
 # doesn't have one that works with the given compiler.
-dirent.h: dirent.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
-             -e 's|@''GNULIB_DIRFD''@|$(GNULIB_DIRFD)|g' \
-             -e 's|@''GNULIB_FDOPENDIR''@|$(GNULIB_FDOPENDIR)|g' \
-             -e 's|@''GNULIB_SCANDIR''@|$(GNULIB_SCANDIR)|g' \
-             -e 's|@''GNULIB_ALPHASORT''@|$(GNULIB_ALPHASORT)|g' \
+             -e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \
+             -e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \
+             -e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \
+             -e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \
+             -e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \
+             -e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \
+             -e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \
+             -e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \
+             -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
+             -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
+             -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
+             -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
              -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
+             -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
              -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
              -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
              -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
+             -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
              -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
+             -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
              -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
-             -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/dirent.in.h; \
        } > $@-t && \
        mv $@-t $@
@@ -260,6 +260,14 @@ EXTRA_DIST += dirent.in.h
 
 ## end   gnulib module dirent
 
+## begin gnulib module dirent-safer
+
+libgzip_a_SOURCES += opendir-safer.c
+
+EXTRA_DIST += dirent--.h dirent-safer.h
+
+## end   gnulib module dirent-safer
+
 ## begin gnulib module dirfd
 
 
@@ -271,13 +279,35 @@ EXTRA_libgzip_a_SOURCES += dirfd.c
 
 ## begin gnulib module dirname-lgpl
 
+libgzip_a_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c
 
-EXTRA_DIST += basename-lgpl.c dirname-lgpl.c dirname.h stripslash.c
-
-EXTRA_libgzip_a_SOURCES += basename-lgpl.c dirname-lgpl.c stripslash.c
+EXTRA_DIST += dirname.h
 
 ## end   gnulib module dirname-lgpl
 
+## begin gnulib module do-release-commit-and-tag
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/do-release-commit-and-tag
+
+## end   gnulib module do-release-commit-and-tag
+
+## begin gnulib module dosname
+
+
+EXTRA_DIST += dosname.h
+
+## end   gnulib module dosname
+
+## begin gnulib module dup
+
+
+EXTRA_DIST += dup.c
+
+EXTRA_libgzip_a_SOURCES += dup.c
+
+## end   gnulib module dup
+
 ## begin gnulib module dup2
 
 
@@ -293,11 +323,14 @@ BUILT_SOURCES += $(ERRNO_H)
 
 # We need the following in order to create <errno.h> when the system
 # doesn't have one that is POSIX compliant.
-errno.h: errno.in.h
+if GL_GENERATE_ERRNO_H
+errno.h: errno.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
              -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
              -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
@@ -308,6 +341,10 @@ errno.h: errno.in.h
              < $(srcdir)/errno.in.h; \
        } > $@-t && \
        mv $@-t $@
+else
+errno.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += errno.h errno.h-t
 
 EXTRA_DIST += errno.in.h
@@ -325,10 +362,9 @@ EXTRA_libgzip_a_SOURCES += error.c
 
 ## begin gnulib module exitfail
 
+libgzip_a_SOURCES += exitfail.c
 
-EXTRA_DIST += exitfail.c exitfail.h
-
-EXTRA_libgzip_a_SOURCES += exitfail.c
+EXTRA_DIST += exitfail.h
 
 ## end   gnulib module exitfail
 
@@ -365,22 +401,26 @@ BUILT_SOURCES += fcntl.h
 
 # We need the following in order to create <fcntl.h> when the system
 # doesn't have one that works with the given compiler.
-fcntl.h: fcntl.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
-             -e 's|@''GNULIB_FCNTL''@|$(GNULIB_FCNTL)|g' \
-             -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \
-             -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \
+             -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
+             -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
+             -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
              -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
              -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
              -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
              -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
              -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/fcntl.in.h; \
        } > $@-t && \
        mv $@-t $@
@@ -392,19 +432,26 @@ EXTRA_DIST += fcntl.in.h
 
 ## begin gnulib module fcntl-safer
 
+libgzip_a_SOURCES += creat-safer.c open-safer.c
 
-EXTRA_DIST += creat-safer.c fcntl--.h fcntl-safer.h open-safer.c
-
-EXTRA_libgzip_a_SOURCES += creat-safer.c open-safer.c
+EXTRA_DIST += fcntl--.h fcntl-safer.h
 
 ## end   gnulib module fcntl-safer
 
+## begin gnulib module fd-hook
+
+libgzip_a_SOURCES += fd-hook.c
+
+EXTRA_DIST += fd-hook.h
+
+## end   gnulib module fd-hook
+
 ## begin gnulib module fdopendir
 
 
-EXTRA_DIST += fdopendir.c openat-priv.h openat-proc.c
+EXTRA_DIST += fdopendir.c
 
-EXTRA_libgzip_a_SOURCES += fdopendir.c openat-proc.c
+EXTRA_libgzip_a_SOURCES += fdopendir.c
 
 ## end   gnulib module fdopendir
 
@@ -417,24 +464,49 @@ EXTRA_libgzip_a_SOURCES += fflush.c
 
 ## end   gnulib module fflush
 
+## begin gnulib module filename
+
+
+EXTRA_DIST += filename.h
+
+## end   gnulib module filename
+
+## begin gnulib module filenamecat-lgpl
+
+libgzip_a_SOURCES += filenamecat-lgpl.c
+
+EXTRA_DIST += filenamecat.h
+
+## end   gnulib module filenamecat-lgpl
+
 ## begin gnulib module float
 
 BUILT_SOURCES += $(FLOAT_H)
 
 # We need the following in order to create <float.h> when the system
 # doesn't have one that works with the given compiler.
-float.h: float.in.h
+if GL_GENERATE_FLOAT_H
+float.h: float.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
+             -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
              < $(srcdir)/float.in.h; \
        } > $@-t && \
        mv $@-t $@
+else
+float.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += float.h float.h-t
 
-EXTRA_DIST += float.in.h
+EXTRA_DIST += float.c float.in.h itold.c
+
+EXTRA_libgzip_a_SOURCES += float.c itold.c
 
 ## end   gnulib module float
 
@@ -506,6 +578,15 @@ EXTRA_libgzip_a_SOURCES += frexp.c frexpl.c
 
 ## end   gnulib module frexpl-nolibm
 
+## begin gnulib module fseek
+
+
+EXTRA_DIST += fseek.c
+
+EXTRA_libgzip_a_SOURCES += fseek.c
+
+## end   gnulib module fseek
+
 ## begin gnulib module fseeko
 
 
@@ -523,10 +604,28 @@ EXTRA_DIST += fseterr.h stdio-impl.h
 
 ## end   gnulib module fseterr
 
+## begin gnulib module fstat
+
+
+EXTRA_DIST += fstat.c
+
+EXTRA_libgzip_a_SOURCES += fstat.c
+
+## end   gnulib module fstat
+
+## begin gnulib module ftell
+
+
+EXTRA_DIST += ftell.c
+
+EXTRA_libgzip_a_SOURCES += ftell.c
+
+## end   gnulib module ftell
+
 ## begin gnulib module ftello
 
 
-EXTRA_DIST += ftello.c
+EXTRA_DIST += ftello.c stdio-impl.h
 
 EXTRA_libgzip_a_SOURCES += ftello.c
 
@@ -539,14 +638,23 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gendocs.sh
 
 ## end   gnulib module gendocs
 
-## begin gnulib module getcwd
+## begin gnulib module getcwd-lgpl
+
+
+EXTRA_DIST += getcwd-lgpl.c
+
+EXTRA_libgzip_a_SOURCES += getcwd-lgpl.c
+
+## end   gnulib module getcwd-lgpl
 
+## begin gnulib module getdtablesize
 
-EXTRA_DIST += getcwd.c
 
-EXTRA_libgzip_a_SOURCES += getcwd.c
+EXTRA_DIST += getdtablesize.c
 
-## end   gnulib module getcwd
+EXTRA_libgzip_a_SOURCES += getdtablesize.c
+
+## end   gnulib module getdtablesize
 
 ## begin gnulib module getopt-posix
 
@@ -554,12 +662,14 @@ BUILT_SOURCES += $(GETOPT_H)
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
-getopt.h: getopt.in.h $(ARG_NONNULL_H)
+getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              < $(srcdir)/getopt.in.h; \
@@ -581,10 +691,7 @@ libgzip_a_SOURCES += gettext.h
 
 ## begin gnulib module gettime
 
-
-EXTRA_DIST += gettime.c
-
-EXTRA_libgzip_a_SOURCES += gettime.c
+libgzip_a_SOURCES += gettime.c
 
 ## end   gnulib module gettime
 
@@ -648,9 +755,17 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gnupload
 
 ## end   gnulib module gnupload
 
+## begin gnulib module havelib
+
+
+EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
+
+## end   gnulib module havelib
+
 ## begin gnulib module ignore-value
 
-libgzip_a_SOURCES += ignore-value.h
+
+EXTRA_DIST += ignore-value.h
 
 ## end   gnulib module ignore-value
 
@@ -688,39 +803,6 @@ EXTRA_libgzip_a_SOURCES += isnan.c isnanl.c
 
 ## end   gnulib module isnanl-nolibm
 
-## begin gnulib module lchown
-
-
-EXTRA_DIST += lchown.c
-
-EXTRA_libgzip_a_SOURCES += lchown.c
-
-## end   gnulib module lchown
-
-## begin gnulib module link-warning
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-BUILT_SOURCES += link-warning.h
-# The link-warning.h that gets inserted into generated .h files is the same as
-# build-aux/link-warning.h, except that it has the copyright header cut off.
-link-warning.h: $(top_srcdir)/build-aux/link-warning.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_LINK_WARNING/,$$p' \
-         < $(top_srcdir)/build-aux/link-warning.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += link-warning.h link-warning.h-t
-
-LINK_WARNING_H=link-warning.h
-
-EXTRA_DIST += $(top_srcdir)/build-aux/link-warning.h
-
-## end   gnulib module link-warning
-
 ## begin gnulib module localcharset
 
 libgzip_a_SOURCES += localcharset.h localcharset.c
@@ -795,6 +877,12 @@ EXTRA_DIST += config.charset ref-add.sin ref-del.sin
 
 ## end   gnulib module localcharset
 
+## begin gnulib module lock
+
+libgzip_a_SOURCES += glthread/lock.h glthread/lock.c
+
+## end   gnulib module lock
+
 ## begin gnulib module lseek
 
 
@@ -819,14 +907,14 @@ EXTRA_DIST += $(top_srcdir)/maint.mk
 
 ## end   gnulib module maintainer-makefile
 
-## begin gnulib module malloc
+## begin gnulib module malloc-gnu
 
 
 EXTRA_DIST += malloc.c
 
 EXTRA_libgzip_a_SOURCES += malloc.c
 
-## end   gnulib module malloc
+## end   gnulib module malloc-gnu
 
 ## begin gnulib module malloc-posix
 
@@ -843,88 +931,275 @@ BUILT_SOURCES += math.h
 
 # We need the following in order to create <math.h> when the system
 # doesn't have one that works with the given compiler.
-math.h: math.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \
-             -e 's|@''GNULIB_ACOSL''@|$(GNULIB_ACOSL)|g' \
-             -e 's|@''GNULIB_ASINL''@|$(GNULIB_ASINL)|g' \
-             -e 's|@''GNULIB_ATANL''@|$(GNULIB_ATANL)|g' \
-             -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \
-             -e 's|@''GNULIB_CEILL''@|$(GNULIB_CEILL)|g' \
-             -e 's|@''GNULIB_COSL''@|$(GNULIB_COSL)|g' \
-             -e 's|@''GNULIB_EXPL''@|$(GNULIB_EXPL)|g' \
-             -e 's|@''GNULIB_FLOORF''@|$(GNULIB_FLOORF)|g' \
-             -e 's|@''GNULIB_FLOORL''@|$(GNULIB_FLOORL)|g' \
-             -e 's|@''GNULIB_FREXP''@|$(GNULIB_FREXP)|g' \
-             -e 's|@''GNULIB_FREXPL''@|$(GNULIB_FREXPL)|g' \
-             -e 's|@''GNULIB_ISFINITE''@|$(GNULIB_ISFINITE)|g' \
-             -e 's|@''GNULIB_ISINF''@|$(GNULIB_ISINF)|g' \
-             -e 's|@''GNULIB_ISNAN''@|$(GNULIB_ISNAN)|g' \
-             -e 's|@''GNULIB_ISNANF''@|$(GNULIB_ISNANF)|g' \
-             -e 's|@''GNULIB_ISNAND''@|$(GNULIB_ISNAND)|g' \
-             -e 's|@''GNULIB_ISNANL''@|$(GNULIB_ISNANL)|g' \
-             -e 's|@''GNULIB_LDEXPL''@|$(GNULIB_LDEXPL)|g' \
-             -e 's|@''GNULIB_LOGL''@|$(GNULIB_LOGL)|g' \
-             -e 's|@''GNULIB_ROUND''@|$(GNULIB_ROUND)|g' \
-             -e 's|@''GNULIB_ROUNDF''@|$(GNULIB_ROUNDF)|g' \
-             -e 's|@''GNULIB_ROUNDL''@|$(GNULIB_ROUNDL)|g' \
-             -e 's|@''GNULIB_SIGNBIT''@|$(GNULIB_SIGNBIT)|g' \
-             -e 's|@''GNULIB_SINL''@|$(GNULIB_SINL)|g' \
-             -e 's|@''GNULIB_SQRTL''@|$(GNULIB_SQRTL)|g' \
-             -e 's|@''GNULIB_TANL''@|$(GNULIB_TANL)|g' \
-             -e 's|@''GNULIB_TRUNC''@|$(GNULIB_TRUNC)|g' \
-             -e 's|@''GNULIB_TRUNCF''@|$(GNULIB_TRUNCF)|g' \
-             -e 's|@''GNULIB_TRUNCL''@|$(GNULIB_TRUNCL)|g' \
+             -e 's/@''GNULIB_ACOSF''@/$(GNULIB_ACOSF)/g' \
+             -e 's/@''GNULIB_ACOSL''@/$(GNULIB_ACOSL)/g' \
+             -e 's/@''GNULIB_ASINF''@/$(GNULIB_ASINF)/g' \
+             -e 's/@''GNULIB_ASINL''@/$(GNULIB_ASINL)/g' \
+             -e 's/@''GNULIB_ATANF''@/$(GNULIB_ATANF)/g' \
+             -e 's/@''GNULIB_ATANL''@/$(GNULIB_ATANL)/g' \
+             -e 's/@''GNULIB_ATAN2F''@/$(GNULIB_ATAN2F)/g' \
+             -e 's/@''GNULIB_CBRT''@/$(GNULIB_CBRT)/g' \
+             -e 's/@''GNULIB_CBRTF''@/$(GNULIB_CBRTF)/g' \
+             -e 's/@''GNULIB_CBRTL''@/$(GNULIB_CBRTL)/g' \
+             -e 's/@''GNULIB_CEIL''@/$(GNULIB_CEIL)/g' \
+             -e 's/@''GNULIB_CEILF''@/$(GNULIB_CEILF)/g' \
+             -e 's/@''GNULIB_CEILL''@/$(GNULIB_CEILL)/g' \
+             -e 's/@''GNULIB_COPYSIGN''@/$(GNULIB_COPYSIGN)/g' \
+             -e 's/@''GNULIB_COPYSIGNF''@/$(GNULIB_COPYSIGNF)/g' \
+             -e 's/@''GNULIB_COPYSIGNL''@/$(GNULIB_COPYSIGNL)/g' \
+             -e 's/@''GNULIB_COSF''@/$(GNULIB_COSF)/g' \
+             -e 's/@''GNULIB_COSL''@/$(GNULIB_COSL)/g' \
+             -e 's/@''GNULIB_COSHF''@/$(GNULIB_COSHF)/g' \
+             -e 's/@''GNULIB_EXPF''@/$(GNULIB_EXPF)/g' \
+             -e 's/@''GNULIB_EXPL''@/$(GNULIB_EXPL)/g' \
+             -e 's/@''GNULIB_EXP2''@/$(GNULIB_EXP2)/g' \
+             -e 's/@''GNULIB_EXP2F''@/$(GNULIB_EXP2F)/g' \
+             -e 's/@''GNULIB_EXP2L''@/$(GNULIB_EXP2L)/g' \
+             -e 's/@''GNULIB_EXPM1''@/$(GNULIB_EXPM1)/g' \
+             -e 's/@''GNULIB_EXPM1F''@/$(GNULIB_EXPM1F)/g' \
+             -e 's/@''GNULIB_EXPM1L''@/$(GNULIB_EXPM1L)/g' \
+             -e 's/@''GNULIB_FABSF''@/$(GNULIB_FABSF)/g' \
+             -e 's/@''GNULIB_FABSL''@/$(GNULIB_FABSL)/g' \
+             -e 's/@''GNULIB_FLOOR''@/$(GNULIB_FLOOR)/g' \
+             -e 's/@''GNULIB_FLOORF''@/$(GNULIB_FLOORF)/g' \
+             -e 's/@''GNULIB_FLOORL''@/$(GNULIB_FLOORL)/g' \
+             -e 's/@''GNULIB_FMA''@/$(GNULIB_FMA)/g' \
+             -e 's/@''GNULIB_FMAF''@/$(GNULIB_FMAF)/g' \
+             -e 's/@''GNULIB_FMAL''@/$(GNULIB_FMAL)/g' \
+             -e 's/@''GNULIB_FMOD''@/$(GNULIB_FMOD)/g' \
+             -e 's/@''GNULIB_FMODF''@/$(GNULIB_FMODF)/g' \
+             -e 's/@''GNULIB_FMODL''@/$(GNULIB_FMODL)/g' \
+             -e 's/@''GNULIB_FREXPF''@/$(GNULIB_FREXPF)/g' \
+             -e 's/@''GNULIB_FREXP''@/$(GNULIB_FREXP)/g' \
+             -e 's/@''GNULIB_FREXPL''@/$(GNULIB_FREXPL)/g' \
+             -e 's/@''GNULIB_HYPOT''@/$(GNULIB_HYPOT)/g' \
+             -e 's/@''GNULIB_HYPOTF''@/$(GNULIB_HYPOTF)/g' \
+             -e 's/@''GNULIB_HYPOTL''@/$(GNULIB_HYPOTL)/g' \
+             < $(srcdir)/math.in.h | \
+         sed -e 's/@''GNULIB_ILOGB''@/$(GNULIB_ILOGB)/g' \
+             -e 's/@''GNULIB_ILOGBF''@/$(GNULIB_ILOGBF)/g' \
+             -e 's/@''GNULIB_ILOGBL''@/$(GNULIB_ILOGBL)/g' \
+             -e 's/@''GNULIB_ISFINITE''@/$(GNULIB_ISFINITE)/g' \
+             -e 's/@''GNULIB_ISINF''@/$(GNULIB_ISINF)/g' \
+             -e 's/@''GNULIB_ISNAN''@/$(GNULIB_ISNAN)/g' \
+             -e 's/@''GNULIB_ISNANF''@/$(GNULIB_ISNANF)/g' \
+             -e 's/@''GNULIB_ISNAND''@/$(GNULIB_ISNAND)/g' \
+             -e 's/@''GNULIB_ISNANL''@/$(GNULIB_ISNANL)/g' \
+             -e 's/@''GNULIB_LDEXPF''@/$(GNULIB_LDEXPF)/g' \
+             -e 's/@''GNULIB_LDEXPL''@/$(GNULIB_LDEXPL)/g' \
+             -e 's/@''GNULIB_LOG''@/$(GNULIB_LOG)/g' \
+             -e 's/@''GNULIB_LOGF''@/$(GNULIB_LOGF)/g' \
+             -e 's/@''GNULIB_LOGL''@/$(GNULIB_LOGL)/g' \
+             -e 's/@''GNULIB_LOG10''@/$(GNULIB_LOG10)/g' \
+             -e 's/@''GNULIB_LOG10F''@/$(GNULIB_LOG10F)/g' \
+             -e 's/@''GNULIB_LOG10L''@/$(GNULIB_LOG10L)/g' \
+             -e 's/@''GNULIB_LOG1P''@/$(GNULIB_LOG1P)/g' \
+             -e 's/@''GNULIB_LOG1PF''@/$(GNULIB_LOG1PF)/g' \
+             -e 's/@''GNULIB_LOG1PL''@/$(GNULIB_LOG1PL)/g' \
+             -e 's/@''GNULIB_LOG2''@/$(GNULIB_LOG2)/g' \
+             -e 's/@''GNULIB_LOG2F''@/$(GNULIB_LOG2F)/g' \
+             -e 's/@''GNULIB_LOG2L''@/$(GNULIB_LOG2L)/g' \
+             -e 's/@''GNULIB_LOGB''@/$(GNULIB_LOGB)/g' \
+             -e 's/@''GNULIB_LOGBF''@/$(GNULIB_LOGBF)/g' \
+             -e 's/@''GNULIB_LOGBL''@/$(GNULIB_LOGBL)/g' \
+             -e 's/@''GNULIB_MODF''@/$(GNULIB_MODF)/g' \
+             -e 's/@''GNULIB_MODFF''@/$(GNULIB_MODFF)/g' \
+             -e 's/@''GNULIB_MODFL''@/$(GNULIB_MODFL)/g' \
+             -e 's/@''GNULIB_POWF''@/$(GNULIB_POWF)/g' \
+             -e 's/@''GNULIB_REMAINDER''@/$(GNULIB_REMAINDER)/g' \
+             -e 's/@''GNULIB_REMAINDERF''@/$(GNULIB_REMAINDERF)/g' \
+             -e 's/@''GNULIB_REMAINDERL''@/$(GNULIB_REMAINDERL)/g' \
+             -e 's/@''GNULIB_RINT''@/$(GNULIB_RINT)/g' \
+             -e 's/@''GNULIB_RINTF''@/$(GNULIB_RINTF)/g' \
+             -e 's/@''GNULIB_RINTL''@/$(GNULIB_RINTL)/g' \
+             -e 's/@''GNULIB_ROUND''@/$(GNULIB_ROUND)/g' \
+             -e 's/@''GNULIB_ROUNDF''@/$(GNULIB_ROUNDF)/g' \
+             -e 's/@''GNULIB_ROUNDL''@/$(GNULIB_ROUNDL)/g' \
+             -e 's/@''GNULIB_SIGNBIT''@/$(GNULIB_SIGNBIT)/g' \
+             -e 's/@''GNULIB_SINF''@/$(GNULIB_SINF)/g' \
+             -e 's/@''GNULIB_SINL''@/$(GNULIB_SINL)/g' \
+             -e 's/@''GNULIB_SINHF''@/$(GNULIB_SINHF)/g' \
+             -e 's/@''GNULIB_SQRTF''@/$(GNULIB_SQRTF)/g' \
+             -e 's/@''GNULIB_SQRTL''@/$(GNULIB_SQRTL)/g' \
+             -e 's/@''GNULIB_TANF''@/$(GNULIB_TANF)/g' \
+             -e 's/@''GNULIB_TANL''@/$(GNULIB_TANL)/g' \
+             -e 's/@''GNULIB_TANHF''@/$(GNULIB_TANHF)/g' \
+             -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \
+             -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \
+             -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \
+         | \
+         sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \
              -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
+             -e 's|@''HAVE_ASINF''@|$(HAVE_ASINF)|g' \
              -e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \
+             -e 's|@''HAVE_ATANF''@|$(HAVE_ATANF)|g' \
              -e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \
+             -e 's|@''HAVE_ATAN2F''@|$(HAVE_ATAN2F)|g' \
+             -e 's|@''HAVE_CBRT''@|$(HAVE_CBRT)|g' \
+             -e 's|@''HAVE_CBRTF''@|$(HAVE_CBRTF)|g' \
+             -e 's|@''HAVE_CBRTL''@|$(HAVE_CBRTL)|g' \
+             -e 's|@''HAVE_COPYSIGN''@|$(HAVE_COPYSIGN)|g' \
+             -e 's|@''HAVE_COPYSIGNL''@|$(HAVE_COPYSIGNL)|g' \
+             -e 's|@''HAVE_COSF''@|$(HAVE_COSF)|g' \
              -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \
+             -e 's|@''HAVE_COSHF''@|$(HAVE_COSHF)|g' \
+             -e 's|@''HAVE_EXPF''@|$(HAVE_EXPF)|g' \
              -e 's|@''HAVE_EXPL''@|$(HAVE_EXPL)|g' \
+             -e 's|@''HAVE_EXPM1''@|$(HAVE_EXPM1)|g' \
+             -e 's|@''HAVE_EXPM1F''@|$(HAVE_EXPM1F)|g' \
+             -e 's|@''HAVE_FABSF''@|$(HAVE_FABSF)|g' \
+             -e 's|@''HAVE_FABSL''@|$(HAVE_FABSL)|g' \
+             -e 's|@''HAVE_FMA''@|$(HAVE_FMA)|g' \
+             -e 's|@''HAVE_FMAF''@|$(HAVE_FMAF)|g' \
+             -e 's|@''HAVE_FMAL''@|$(HAVE_FMAL)|g' \
+             -e 's|@''HAVE_FMODF''@|$(HAVE_FMODF)|g' \
+             -e 's|@''HAVE_FMODL''@|$(HAVE_FMODL)|g' \
+             -e 's|@''HAVE_FREXPF''@|$(HAVE_FREXPF)|g' \
+             -e 's|@''HAVE_HYPOTF''@|$(HAVE_HYPOTF)|g' \
+             -e 's|@''HAVE_HYPOTL''@|$(HAVE_HYPOTL)|g' \
+             -e 's|@''HAVE_ILOGB''@|$(HAVE_ILOGB)|g' \
+             -e 's|@''HAVE_ILOGBF''@|$(HAVE_ILOGBF)|g' \
+             -e 's|@''HAVE_ILOGBL''@|$(HAVE_ILOGBL)|g' \
              -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \
              -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \
              -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \
+             -e 's|@''HAVE_LDEXPF''@|$(HAVE_LDEXPF)|g' \
+             -e 's|@''HAVE_LOGF''@|$(HAVE_LOGF)|g' \
              -e 's|@''HAVE_LOGL''@|$(HAVE_LOGL)|g' \
+             -e 's|@''HAVE_LOG10F''@|$(HAVE_LOG10F)|g' \
+             -e 's|@''HAVE_LOG10L''@|$(HAVE_LOG10L)|g' \
+             -e 's|@''HAVE_LOG1P''@|$(HAVE_LOG1P)|g' \
+             -e 's|@''HAVE_LOG1PF''@|$(HAVE_LOG1PF)|g' \
+             -e 's|@''HAVE_LOG1PL''@|$(HAVE_LOG1PL)|g' \
+             -e 's|@''HAVE_LOGBF''@|$(HAVE_LOGBF)|g' \
+             -e 's|@''HAVE_LOGBL''@|$(HAVE_LOGBL)|g' \
+             -e 's|@''HAVE_MODFF''@|$(HAVE_MODFF)|g' \
+             -e 's|@''HAVE_MODFL''@|$(HAVE_MODFL)|g' \
+             -e 's|@''HAVE_POWF''@|$(HAVE_POWF)|g' \
+             -e 's|@''HAVE_REMAINDER''@|$(HAVE_REMAINDER)|g' \
+             -e 's|@''HAVE_REMAINDERF''@|$(HAVE_REMAINDERF)|g' \
+             -e 's|@''HAVE_RINT''@|$(HAVE_RINT)|g' \
+             -e 's|@''HAVE_RINTL''@|$(HAVE_RINTL)|g' \
+             -e 's|@''HAVE_SINF''@|$(HAVE_SINF)|g' \
              -e 's|@''HAVE_SINL''@|$(HAVE_SINL)|g' \
+             -e 's|@''HAVE_SINHF''@|$(HAVE_SINHF)|g' \
+             -e 's|@''HAVE_SQRTF''@|$(HAVE_SQRTF)|g' \
              -e 's|@''HAVE_SQRTL''@|$(HAVE_SQRTL)|g' \
+             -e 's|@''HAVE_TANF''@|$(HAVE_TANF)|g' \
              -e 's|@''HAVE_TANL''@|$(HAVE_TANL)|g' \
+             -e 's|@''HAVE_TANHF''@|$(HAVE_TANHF)|g' \
              -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \
              -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \
              -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \
+             -e 's|@''HAVE_DECL_CBRTF''@|$(HAVE_DECL_CBRTF)|g' \
+             -e 's|@''HAVE_DECL_CBRTL''@|$(HAVE_DECL_CBRTL)|g' \
+             -e 's|@''HAVE_DECL_CEILF''@|$(HAVE_DECL_CEILF)|g' \
+             -e 's|@''HAVE_DECL_CEILL''@|$(HAVE_DECL_CEILL)|g' \
+             -e 's|@''HAVE_DECL_COPYSIGNF''@|$(HAVE_DECL_COPYSIGNF)|g' \
              -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \
              -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \
+             -e 's|@''HAVE_DECL_EXP2''@|$(HAVE_DECL_EXP2)|g' \
+             -e 's|@''HAVE_DECL_EXP2F''@|$(HAVE_DECL_EXP2F)|g' \
+             -e 's|@''HAVE_DECL_EXP2L''@|$(HAVE_DECL_EXP2L)|g' \
+             -e 's|@''HAVE_DECL_EXPM1L''@|$(HAVE_DECL_EXPM1L)|g' \
+             -e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \
+             -e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \
              -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \
              -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \
              -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \
+             -e 's|@''HAVE_DECL_LOG10L''@|$(HAVE_DECL_LOG10L)|g' \
+             -e 's|@''HAVE_DECL_LOG2''@|$(HAVE_DECL_LOG2)|g' \
+             -e 's|@''HAVE_DECL_LOG2F''@|$(HAVE_DECL_LOG2F)|g' \
+             -e 's|@''HAVE_DECL_LOG2L''@|$(HAVE_DECL_LOG2L)|g' \
+             -e 's|@''HAVE_DECL_LOGB''@|$(HAVE_DECL_LOGB)|g' \
+             -e 's|@''HAVE_DECL_REMAINDER''@|$(HAVE_DECL_REMAINDER)|g' \
+             -e 's|@''HAVE_DECL_REMAINDERL''@|$(HAVE_DECL_REMAINDERL)|g' \
+             -e 's|@''HAVE_DECL_RINTF''@|$(HAVE_DECL_RINTF)|g' \
+             -e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \
+             -e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \
+             -e 's|@''HAVE_DECL_ROUNDL''@|$(HAVE_DECL_ROUNDL)|g' \
              -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \
              -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \
              -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \
              -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \
              -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \
+             -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \
+         | \
+         sed -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \
+             -e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \
+             -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \
              -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
              -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
+             -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \
+             -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \
+             -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \
+             -e 's|@''REPLACE_EXP2L''@|$(REPLACE_EXP2L)|g' \
+             -e 's|@''REPLACE_FABSL''@|$(REPLACE_FABSL)|g' \
+             -e 's|@''REPLACE_FLOOR''@|$(REPLACE_FLOOR)|g' \
              -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \
              -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \
+             -e 's|@''REPLACE_FMA''@|$(REPLACE_FMA)|g' \
+             -e 's|@''REPLACE_FMAF''@|$(REPLACE_FMAF)|g' \
+             -e 's|@''REPLACE_FMAL''@|$(REPLACE_FMAL)|g' \
+             -e 's|@''REPLACE_FMOD''@|$(REPLACE_FMOD)|g' \
+             -e 's|@''REPLACE_FMODF''@|$(REPLACE_FMODF)|g' \
+             -e 's|@''REPLACE_FMODL''@|$(REPLACE_FMODL)|g' \
+             -e 's|@''REPLACE_FREXPF''@|$(REPLACE_FREXPF)|g' \
              -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \
              -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \
              -e 's|@''REPLACE_HUGE_VAL''@|$(REPLACE_HUGE_VAL)|g' \
+             -e 's|@''REPLACE_HYPOT''@|$(REPLACE_HYPOT)|g' \
+             -e 's|@''REPLACE_HYPOTF''@|$(REPLACE_HYPOTF)|g' \
+             -e 's|@''REPLACE_HYPOTL''@|$(REPLACE_HYPOTL)|g' \
+             -e 's|@''REPLACE_ILOGB''@|$(REPLACE_ILOGB)|g' \
+             -e 's|@''REPLACE_ILOGBF''@|$(REPLACE_ILOGBF)|g' \
              -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \
              -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \
              -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \
+             -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
              -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \
+             -e 's|@''REPLACE_LOG''@|$(REPLACE_LOG)|g' \
+             -e 's|@''REPLACE_LOGF''@|$(REPLACE_LOGF)|g' \
+             -e 's|@''REPLACE_LOGL''@|$(REPLACE_LOGL)|g' \
+             -e 's|@''REPLACE_LOG10''@|$(REPLACE_LOG10)|g' \
+             -e 's|@''REPLACE_LOG10F''@|$(REPLACE_LOG10F)|g' \
+             -e 's|@''REPLACE_LOG10L''@|$(REPLACE_LOG10L)|g' \
+             -e 's|@''REPLACE_LOG1P''@|$(REPLACE_LOG1P)|g' \
+             -e 's|@''REPLACE_LOG1PF''@|$(REPLACE_LOG1PF)|g' \
+             -e 's|@''REPLACE_LOG1PL''@|$(REPLACE_LOG1PL)|g' \
+             -e 's|@''REPLACE_LOG2''@|$(REPLACE_LOG2)|g' \
+             -e 's|@''REPLACE_LOG2F''@|$(REPLACE_LOG2F)|g' \
+             -e 's|@''REPLACE_LOG2L''@|$(REPLACE_LOG2L)|g' \
+             -e 's|@''REPLACE_LOGB''@|$(REPLACE_LOGB)|g' \
+             -e 's|@''REPLACE_LOGBF''@|$(REPLACE_LOGBF)|g' \
+             -e 's|@''REPLACE_LOGBL''@|$(REPLACE_LOGBL)|g' \
+             -e 's|@''REPLACE_MODF''@|$(REPLACE_MODF)|g' \
+             -e 's|@''REPLACE_MODFF''@|$(REPLACE_MODFF)|g' \
+             -e 's|@''REPLACE_MODFL''@|$(REPLACE_MODFL)|g' \
              -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|g' \
+             -e 's|@''REPLACE_REMAINDER''@|$(REPLACE_REMAINDER)|g' \
+             -e 's|@''REPLACE_REMAINDERF''@|$(REPLACE_REMAINDERF)|g' \
+             -e 's|@''REPLACE_REMAINDERL''@|$(REPLACE_REMAINDERL)|g' \
              -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \
              -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \
              -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
              -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
              -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \
+             -e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \
+             -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \
+             -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \
              -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/math.in.h; \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += math.h math.h-t
@@ -978,14 +1253,23 @@ EXTRA_libgzip_a_SOURCES += memrchr.c
 
 ## end   gnulib module memrchr
 
-## begin gnulib module mkdir
+## begin gnulib module msvc-inval
+
 
+EXTRA_DIST += msvc-inval.c msvc-inval.h
 
-EXTRA_DIST += mkdir.c
+EXTRA_libgzip_a_SOURCES += msvc-inval.c
 
-EXTRA_libgzip_a_SOURCES += mkdir.c
+## end   gnulib module msvc-inval
 
-## end   gnulib module mkdir
+## begin gnulib module msvc-nothrow
+
+
+EXTRA_DIST += msvc-nothrow.c msvc-nothrow.h
+
+EXTRA_libgzip_a_SOURCES += msvc-nothrow.c
+
+## end   gnulib module msvc-nothrow
 
 ## begin gnulib module open
 
@@ -999,9 +1283,9 @@ EXTRA_libgzip_a_SOURCES += open.c
 ## begin gnulib module openat
 
 
-EXTRA_DIST += at-func.c fchmodat.c fchownat.c fstatat.c mkdirat.c openat-priv.h openat-proc.c openat.c openat.h unlinkat.c
+EXTRA_DIST += openat-priv.h openat.c
 
-EXTRA_libgzip_a_SOURCES += at-func.c fchmodat.c fchownat.c fstatat.c mkdirat.c openat-proc.c openat.c unlinkat.c
+EXTRA_libgzip_a_SOURCES += openat.c
 
 ## end   gnulib module openat
 
@@ -1011,6 +1295,29 @@ libgzip_a_SOURCES += openat-die.c
 
 ## end   gnulib module openat-die
 
+## begin gnulib module openat-h
+
+
+EXTRA_DIST += openat.h
+
+## end   gnulib module openat-h
+
+## begin gnulib module opendir
+
+
+EXTRA_DIST += dirent-private.h opendir.c
+
+EXTRA_libgzip_a_SOURCES += opendir.c
+
+## end   gnulib module opendir
+
+## begin gnulib module pathmax
+
+
+EXTRA_DIST += pathmax.h
+
+## end   gnulib module pathmax
+
 ## begin gnulib module perror
 
 
@@ -1049,56 +1356,62 @@ EXTRA_libgzip_a_SOURCES += printf.c
 
 ## begin gnulib module quotearg
 
+libgzip_a_SOURCES += quotearg.c
 
-EXTRA_DIST += quotearg.c quotearg.h
-
-EXTRA_libgzip_a_SOURCES += quotearg.c
+EXTRA_DIST += quote.h quotearg.h
 
 ## end   gnulib module quotearg
 
-## begin gnulib module realloc
+## begin gnulib module readdir
 
 
-EXTRA_DIST += realloc.c
+EXTRA_DIST += dirent-private.h readdir.c
 
-EXTRA_libgzip_a_SOURCES += realloc.c
+EXTRA_libgzip_a_SOURCES += readdir.c
 
-## end   gnulib module realloc
+## end   gnulib module readdir
 
-## begin gnulib module realloc-posix
+## begin gnulib module readme-release
 
 
-EXTRA_DIST += realloc.c
+EXTRA_DIST += $(top_srcdir)/README-release
 
-EXTRA_libgzip_a_SOURCES += realloc.c
+## end   gnulib module readme-release
 
-## end   gnulib module realloc-posix
+## begin gnulib module realloc-gnu
 
-## begin gnulib module rmdir
 
+EXTRA_DIST += realloc.c
 
-EXTRA_DIST += rmdir.c
+EXTRA_libgzip_a_SOURCES += realloc.c
 
-EXTRA_libgzip_a_SOURCES += rmdir.c
+## end   gnulib module realloc-gnu
 
-## end   gnulib module rmdir
+## begin gnulib module realloc-posix
 
-## begin gnulib module same-inode
 
+EXTRA_DIST += realloc.c
 
-EXTRA_DIST += same-inode.h
+EXTRA_libgzip_a_SOURCES += realloc.c
 
-## end   gnulib module same-inode
+## end   gnulib module realloc-posix
 
 ## begin gnulib module save-cwd
 
+libgzip_a_SOURCES += save-cwd.c
 
-EXTRA_DIST += save-cwd.c save-cwd.h
-
-EXTRA_libgzip_a_SOURCES += save-cwd.c
+EXTRA_DIST += save-cwd.h
 
 ## end   gnulib module save-cwd
 
+## begin gnulib module savedir
+
+libgzip_a_SOURCES += savedir.c
+
+EXTRA_DIST += savedir.h
+
+## end   gnulib module savedir
+
 ## begin gnulib module signbit
 
 
@@ -1114,6 +1427,112 @@ libgzip_a_SOURCES += size_max.h
 
 ## end   gnulib module size_max
 
+## begin gnulib module snippet/_Noreturn
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all Makefile.am that
+# need it. This is ensured by the applicability 'all' defined above.
+
+_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
+
+## end   gnulib module snippet/_Noreturn
+
+## begin gnulib module snippet/arg-nonnull
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += arg-nonnull.h
+# The arg-nonnull.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
+# off.
+arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_ARG_NONNULL/,$$p' \
+         < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+
+ARG_NONNULL_H=arg-nonnull.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+
+## end   gnulib module snippet/arg-nonnull
+
+## begin gnulib module snippet/c++defs
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += c++defs.h
+# The c++defs.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
+c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/_GL_CXXDEFS/,$$p' \
+         < $(top_srcdir)/build-aux/snippet/c++defs.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+
+CXXDEFS_H=c++defs.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
+
+## end   gnulib module snippet/c++defs
+
+## begin gnulib module snippet/unused-parameter
+
+# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+# statements but through direct file reference. Therefore this snippet must be
+# present in all Makefile.am that need it. This is ensured by the applicability
+# 'all' defined above.
+
+BUILT_SOURCES += unused-parameter.h
+# The unused-parameter.h that gets inserted into generated .h files is the same
+# as build-aux/snippet/unused-parameter.h, except that it has the copyright
+# header cut off.
+unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
+         < $(top_srcdir)/build-aux/snippet/unused-parameter.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += unused-parameter.h unused-parameter.h-t
+
+UNUSED_PARAMETER_H=unused-parameter.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/unused-parameter.h
+
+## end   gnulib module snippet/unused-parameter
+
+## begin gnulib module snippet/warn-on-use
+
+BUILT_SOURCES += warn-on-use.h
+# The warn-on-use.h that gets inserted into generated .h files is the same as
+# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
+# off.
+warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       sed -n -e '/^.ifndef/,$$p' \
+         < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
+         > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+
+WARN_ON_USE_H=warn-on-use.h
+
+EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
+
+## end   gnulib module snippet/warn-on-use
+
 ## begin gnulib module stat
 
 
@@ -1136,12 +1555,17 @@ BUILT_SOURCES += $(STDBOOL_H)
 
 # We need the following in order to create <stdbool.h> when the system
 # doesn't have one that works.
-stdbool.h: stdbool.in.h
+if GL_GENERATE_STDBOOL_H
+stdbool.h: stdbool.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
        } > $@-t && \
        mv $@-t $@
+else
+stdbool.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += stdbool.h stdbool.h-t
 
 EXTRA_DIST += stdbool.in.h
@@ -1154,17 +1578,24 @@ BUILT_SOURCES += $(STDDEF_H)
 
 # We need the following in order to create <stddef.h> when the system
 # doesn't have one that works with the given compiler.
-stddef.h: stddef.in.h
+if GL_GENERATE_STDDEF_H
+stddef.h: stddef.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
              -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
              -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
              < $(srcdir)/stddef.in.h; \
        } > $@-t && \
        mv $@-t $@
+else
+stddef.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += stddef.h stddef.h-t
 
 EXTRA_DIST += stddef.in.h
@@ -1177,17 +1608,21 @@ BUILT_SOURCES += $(STDINT_H)
 
 # We need the following in order to create <stdint.h> when the system
 # doesn't have one that works with the given compiler.
-stdint.h: stdint.in.h
+if GL_GENERATE_STDINT_H
+stdint.h: stdint.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
              -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
              -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
              -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
              -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
+             -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
              -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
              -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
              -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
@@ -1207,6 +1642,10 @@ stdint.h: stdint.in.h
              < $(srcdir)/stdint.in.h; \
        } > $@-t && \
        mv $@-t $@
+else
+stdint.h: $(top_builddir)/config.status
+       rm -f $@
+endif
 MOSTLYCLEANFILES += stdint.h stdint.h-t
 
 EXTRA_DIST += stdint.in.h
@@ -1219,65 +1658,87 @@ BUILT_SOURCES += stdio.h
 
 # We need the following in order to create <stdio.h> when the system
 # doesn't have one that works with the given compiler.
-stdio.h: stdio.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-             -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
-             -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
-             -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-             -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
-             -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
-             -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
-             -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
-             -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
-             -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
-             -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
-             -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
-             -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
-             -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
-             -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
-             -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
-             -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
-             -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
-             -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
-             -e 's|@''GNULIB_POPEN''@|$(GNULIB_POPEN)|g' \
-             -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
-             -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
-             -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
-             -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
-             -e 's|@''GNULIB_REMOVE''@|$(GNULIB_REMOVE)|g' \
-             -e 's|@''GNULIB_RENAME''@|$(GNULIB_RENAME)|g' \
-             -e 's|@''GNULIB_RENAMEAT''@|$(GNULIB_RENAMEAT)|g' \
-             -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
-             -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
-             -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
-             -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
-             -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
-             -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
-             -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
-             -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
-             -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
+             -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
+             -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
+             -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
+             -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
+             -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
+             -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
+             -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
+             -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
+             -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
+             -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
+             -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
+             -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
+             -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
+             -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
+             -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
+             -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
+             -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
+             -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
+             -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
+             -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
+             -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
+             -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
+             -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
+             -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
+             -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
+             -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
+             -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
+             -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
+             -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
+             -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
+             -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
+             -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
+             -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
+             -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
+             -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
+             -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
+             -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
+             -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
+             -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
+             -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
+             -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
+             -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
+             -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
+             -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
+             -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
              < $(srcdir)/stdio.in.h | \
          sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+             -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+             -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
              -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
              -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
              -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
              -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
              -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
              -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
+             -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
+             -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
+             -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
+             -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
              -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
              -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
              -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
              -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
              -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
+             -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
              -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
              -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
              -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
@@ -1287,6 +1748,7 @@ stdio.h: stdio.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
              -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
              -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
              -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
+             -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
              -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
              -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
              -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
@@ -1297,23 +1759,24 @@ stdio.h: stdio.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
              -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
              -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
              -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
+             -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
              -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
+             -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
              -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
              -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
              -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
              -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
              -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
              -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += stdio.h stdio.h-t
 
-EXTRA_DIST += stdio-write.c stdio.in.h
-
-EXTRA_libgzip_a_SOURCES += stdio-write.c
+EXTRA_DIST += stdio.in.h
 
 ## end   gnulib module stdio
 
@@ -1323,65 +1786,92 @@ BUILT_SOURCES += stdlib.h
 
 # We need the following in order to create <stdlib.h> when the system
 # doesn't have one that works with the given compiler.
-stdlib.h: stdlib.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
+  $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
-             -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \
-             -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
-             -e 's|@''GNULIB_CANONICALIZE_FILE_NAME''@|$(GNULIB_CANONICALIZE_FILE_NAME)|g' \
-             -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \
-             -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
-             -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
-             -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
-             -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \
-             -e 's|@''GNULIB_MKOSTEMPS''@|$(GNULIB_MKOSTEMPS)|g' \
-             -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
-             -e 's|@''GNULIB_MKSTEMPS''@|$(GNULIB_MKSTEMPS)|g' \
-             -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
-             -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
-             -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
-             -e 's|@''GNULIB_REALPATH''@|$(GNULIB_REALPATH)|g' \
-             -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
-             -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
-             -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
-             -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \
-             -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \
-             -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
+             -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
+             -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
+             -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
+             -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \
+             -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \
+             -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \
+             -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \
+             -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \
+             -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \
+             -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
+             -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
+             -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
+             -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \
+             -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
+             -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
+             -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
+             -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
+             -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
+             -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
+             -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
+             -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
+             -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
+             -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
+             -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
+             -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
+             -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
+             -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
+             -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
+             < $(srcdir)/stdlib.in.h | \
+         sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
-             -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
              -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
              -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
              -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
-             -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
+             -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
              -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
              -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
              -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
+             -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
              -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
+             -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
+             -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
+             -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
+             -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
              -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
              -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
-             -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
              -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
              -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
-             -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
+             -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
              -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
              -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
              -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
              -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
              -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-             -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
+             -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
+             -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+             -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
              -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
+             -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+             -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+             -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
+             -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
              -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
              -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
              -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
              -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _Noreturn/r $(_NORETURN_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             < $(srcdir)/stdlib.in.h; \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += stdlib.h stdlib.h-t
@@ -1415,53 +1905,80 @@ EXTRA_libgzip_a_SOURCES += strerror.c
 
 ## end   gnulib module strerror
 
+## begin gnulib module strerror-override
+
+
+EXTRA_DIST += strerror-override.c strerror-override.h
+
+EXTRA_libgzip_a_SOURCES += strerror-override.c
+
+## end   gnulib module strerror-override
+
+## begin gnulib module strerror_r-posix
+
+
+EXTRA_DIST += strerror_r.c
+
+EXTRA_libgzip_a_SOURCES += strerror_r.c
+
+## end   gnulib module strerror_r-posix
+
 ## begin gnulib module string
 
 BUILT_SOURCES += string.h
 
 # We need the following in order to create <string.h> when the system
 # doesn't have one that works with the given compiler.
-string.h: string.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
-             -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \
-             -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \
-             -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \
-             -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \
-             -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \
-             -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \
-             -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \
-             -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \
-             -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \
-             -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \
-             -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \
-             -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
-             -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
-             -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
-             -e 's|@''GNULIB_MEMCHR''@|$(GNULIB_MEMCHR)|g' \
-             -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
-             -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
-             -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
-             -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \
-             -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
-             -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
-             -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
-             -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
-             -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \
-             -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
-             -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
-             -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
-             -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \
-             -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
-             -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
-             -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
-             -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \
-             -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \
+             -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
+             -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
+             -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
+             -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
+             -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
+             -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
+             -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
+             -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
+             -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
+             -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
+             -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
+             -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
+             -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
+             -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
+             -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
+             -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
+             -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
+             -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
+             -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
+             -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
+             -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
+             -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
+             -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
+             -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
+             -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
+             -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
+             -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
+             -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
+             -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
+             -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
+             -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
+             -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
+             -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
+             -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
+             -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
+             -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
+             -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
              < $(srcdir)/string.in.h | \
-         sed -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+         sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+             -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+             -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+             -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
              -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
              -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
              -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
@@ -1476,21 +1993,28 @@ string.h: string.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
              -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
              -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
-             -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \
+             -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
              -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
              -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+             -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
              -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
              -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
              -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+             -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
              -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
              -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
              -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+             -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
+             -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
              -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+             -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
              -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
              -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
              -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
-             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)'; \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+             < $(srcdir)/string.in.h; \
        } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += string.h string.h-t
@@ -1505,25 +2029,29 @@ BUILT_SOURCES += sys/stat.h
 
 # We need the following in order to create <sys/stat.h> when the system
 # has one that is incomplete.
-sys/stat.h: sys_stat.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_at)$(MKDIR_P) sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
-             -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
-             -e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
-             -e 's|@''GNULIB_FUTIMENS''@|$(GNULIB_FUTIMENS)|g' \
-             -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
-             -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
-             -e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
-             -e 's|@''GNULIB_MKFIFO''@|$(GNULIB_MKFIFO)|g' \
-             -e 's|@''GNULIB_MKFIFOAT''@|$(GNULIB_MKFIFOAT)|g' \
-             -e 's|@''GNULIB_MKNOD''@|$(GNULIB_MKNOD)|g' \
-             -e 's|@''GNULIB_MKNODAT''@|$(GNULIB_MKNODAT)|g' \
-             -e 's|@''GNULIB_STAT''@|$(GNULIB_STAT)|g' \
-             -e 's|@''GNULIB_UTIMENSAT''@|$(GNULIB_UTIMENSAT)|g' \
+             -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
+             -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
+             -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \
+             -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
+             -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \
+             -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \
+             -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \
+             -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \
+             -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \
+             -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \
+             -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \
+             -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \
+             -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
+             -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \
              -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
              -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
              -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
@@ -1544,8 +2072,9 @@ sys/stat.h: sys_stat.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
              -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
              -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
              -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_stat.in.h; \
        } > $@-t && \
        mv $@-t $@
@@ -1558,21 +2087,29 @@ EXTRA_DIST += sys_stat.in.h
 
 ## begin gnulib module sys_time
 
-BUILT_SOURCES += $(SYS_TIME_H)
+BUILT_SOURCES += sys/time.h
 
 # We need the following in order to create <sys/time.h> when the system
 # doesn't have one that works with the given compiler.
-sys/time.h: sys_time.in.h $(ARG_NONNULL_H)
+sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_at)$(MKDIR_P) sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
-             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
+             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+             -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
              -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_time.in.h; \
        } > $@-t && \
        mv $@-t $@
@@ -1582,26 +2119,72 @@ EXTRA_DIST += sys_time.in.h
 
 ## end   gnulib module sys_time
 
+## begin gnulib module sys_types
+
+BUILT_SOURCES += sys/types.h
+
+# We need the following in order to create <sys/types.h> when the system
+# doesn't have one that works with the given compiler.
+sys/types.h: sys_types.in.h $(top_builddir)/config.status
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
+             -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+             < $(srcdir)/sys_types.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += sys/types.h sys/types.h-t
+
+EXTRA_DIST += sys_types.in.h
+
+## end   gnulib module sys_types
+
+## begin gnulib module threadlib
+
+libgzip_a_SOURCES += glthread/threadlib.c
+
+EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
+
+## end   gnulib module threadlib
+
 ## begin gnulib module time
 
 BUILT_SOURCES += time.h
 
 # We need the following in order to create <time.h> when the system
 # doesn't have one that works with the given compiler.
-time.h: time.in.h $(ARG_NONNULL_H)
+time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
-             -e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
-             -e 's|@REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-             -e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-             -e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \
-             -e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
-             -e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-             -e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+             -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
+             -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
+             -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
+             -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
+             -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
+             -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
+             -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
+             -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
+             -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+             -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
+             -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
+             -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
+             -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+             -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/time.in.h; \
        } > $@-t && \
        mv $@-t $@
@@ -1624,108 +2207,140 @@ BUILT_SOURCES += unistd.h
 
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
-unistd.h: unistd.in.h $(LINK_WARNING_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
-             -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
-             -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
-             -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
-             -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \
-             -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
-             -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \
-             -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \
-             -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
-             -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \
-             -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
-             -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
-             -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
-             -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \
-             -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \
-             -e 's|@''GNULIB_GETGROUPS''@|$(GNULIB_GETGROUPS)|g' \
-             -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \
-             -e 's|@''GNULIB_GETLOGIN''@|$(GNULIB_GETLOGIN)|g' \
-             -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
-             -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
-             -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \
-             -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
-             -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
-             -e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \
-             -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
-             -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
-             -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
-             -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
-             -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
-             -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
-             -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
-             -e 's|@''GNULIB_SYMLINK''@|$(GNULIB_SYMLINK)|g' \
-             -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \
-             -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \
-             -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
-             -e 's|@''GNULIB_UNLINK''@|$(GNULIB_UNLINK)|g' \
-             -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \
-             -e 's|@''GNULIB_USLEEP''@|$(GNULIB_USLEEP)|g' \
-             -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
+             -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+             -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \
+             -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
+             -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
+             -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \
+             -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \
+             -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
+             -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \
+             -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \
+             -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \
+             -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \
+             -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \
+             -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \
+             -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \
+             -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \
+             -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
+             -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
+             -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
+             -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
+             -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
+             -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
+             -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
+             -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
+             -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
+             -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
+             -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
+             -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
+             -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
+             -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
+             -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \
+             -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \
+             -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \
+             -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \
+             -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \
+             -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \
+             -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \
+             -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \
+             -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \
+             -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \
+             -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
+             -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
+             -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
+             -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
+             -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \
+             -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
+             -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
+             -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
+             -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
              < $(srcdir)/unistd.in.h | \
          sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
              -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
              -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
              -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
              -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
+             -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
              -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
+             -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \
              -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
              -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
-             -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
              -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
              -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
-             -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \
+             -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
              -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
              -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
              -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
+             -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \
              -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
              -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+             -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
              -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
              -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
+             -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
              -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
              -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
              -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
              -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+             -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
+             -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
+             -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
              -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
+             -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
+             -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
+             -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
+             -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
              -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
              -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
-             -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+         | \
+         sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
              -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
              -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
-             -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
+             -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+             -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
+             -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
              -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
              -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
+             -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
              -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
              -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
              -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
              -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+             -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
+             -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
              -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
              -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
              -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+             -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
              -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
              -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
              -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
              -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
              -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
              -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
@@ -1738,22 +2353,12 @@ EXTRA_DIST += unistd.in.h
 
 ## begin gnulib module unistd-safer
 
+libgzip_a_SOURCES += dup-safer.c fd-safer.c pipe-safer.c
 
-EXTRA_DIST += dup-safer.c fd-safer.c pipe-safer.c unistd--.h unistd-safer.h
-
-EXTRA_libgzip_a_SOURCES += dup-safer.c fd-safer.c pipe-safer.c
+EXTRA_DIST += unistd--.h unistd-safer.h
 
 ## end   gnulib module unistd-safer
 
-## begin gnulib module unlink
-
-
-EXTRA_DIST += unlink.c
-
-EXTRA_libgzip_a_SOURCES += unlink.c
-
-## end   gnulib module unlink
-
 ## begin gnulib module update-copyright
 
 
@@ -1770,10 +2375,9 @@ EXTRA_DIST += $(top_srcdir)/build-aux/useless-if-before-free
 
 ## begin gnulib module utimens
 
+libgzip_a_SOURCES += utimens.c
 
-EXTRA_DIST += utimens.c utimens.h
-
-EXTRA_libgzip_a_SOURCES += utimens.c
+EXTRA_DIST += utimens.h
 
 ## end   gnulib module utimens
 
@@ -1795,7 +2399,8 @@ EXTRA_DIST += $(top_srcdir)/build-aux/vc-list-files
 
 ## begin gnulib module verify
 
-libgzip_a_SOURCES += verify.h
+
+EXTRA_DIST += verify.h
 
 ## end   gnulib module verify
 
@@ -1808,50 +2413,63 @@ EXTRA_libgzip_a_SOURCES += vfprintf.c
 
 ## end   gnulib module vfprintf-posix
 
-## begin gnulib module warn-on-use
-
-BUILT_SOURCES += warn-on-use.h
-# The warn-on-use.h that gets inserted into generated .h files is the same as
-# build-aux/warn-on-use.h, except that it has the copyright header cut off.
-warn-on-use.h: $(top_srcdir)/build-aux/warn-on-use.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/build-aux/warn-on-use.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
-
-WARN_ON_USE_H=warn-on-use.h
-
-EXTRA_DIST += $(top_srcdir)/build-aux/warn-on-use.h
-
-## end   gnulib module warn-on-use
-
 ## begin gnulib module wchar
 
 BUILT_SOURCES += wchar.h
 
 # We need the following in order to create <wchar.h> when the system
 # version does not work standalone.
-wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
+wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
              -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
              -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
-             -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \
-             -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \
-             -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \
-             -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \
-             -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \
-             -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \
-             -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \
-             -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \
-             -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
-             -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
-             -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
-             -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
+             -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
+             -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
+             -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \
+             -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \
+             -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \
+             -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \
+             -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \
+             -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \
+             -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \
+             -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \
+             -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \
+             -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \
+             -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \
+             -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \
+             -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \
+             -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \
+             -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \
+             -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \
+             -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \
+             -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \
+             -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \
+             -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \
+             -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \
+             -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \
+             -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \
+             -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \
+             -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \
+             -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \
+             -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \
+             -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \
+             -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \
+             -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \
+             -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \
+             -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \
+             -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \
+             -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \
+             -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \
+             -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \
+             -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \
+             < $(srcdir)/wchar.in.h | \
+         sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
              -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
              -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
              -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
@@ -1861,9 +2479,38 @@ wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
              -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
              -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
+             -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \
+             -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
+             -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
+             -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+             -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
+             -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
+             -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
+             -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \
+             -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \
+             -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \
+             -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \
+             -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \
+             -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \
+             -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \
+             -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \
+             -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \
+             -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \
+             -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \
+             -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \
+             -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \
+             -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \
+             -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \
+             -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \
+             -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \
+             -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \
+             -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \
+             -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
+             -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
              -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
              -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
-             -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
+         | \
+         sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
              -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
              -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
              -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
@@ -1875,9 +2522,10 @@ wchar.h: wchar.in.h $(LINK_WARNING_H) $(ARG_NONNULL_H)
              -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
              -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
              -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-             -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
+             -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-           < $(srcdir)/wchar.in.h; \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
 MOSTLYCLEANFILES += wchar.h wchar.h-t
@@ -1886,22 +2534,36 @@ EXTRA_DIST += wchar.in.h
 
 ## end   gnulib module wchar
 
-## begin gnulib module wctype
+## begin gnulib module wctype-h
 
-BUILT_SOURCES += $(WCTYPE_H)
+BUILT_SOURCES += wctype.h
 
 # We need the following in order to create <wctype.h> when the system
 # doesn't have one that works with the given compiler.
-wctype.h: wctype.in.h
+wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+             -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
+             -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
+             -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
+             -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \
+             -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \
+             -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \
+             -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
              -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
+             -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \
+             -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \
              -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+             -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
              -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
+             -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/wctype.in.h; \
        } > $@-t && \
        mv $@-t $@
@@ -1909,14 +2571,13 @@ MOSTLYCLEANFILES += wctype.h wctype.h-t
 
 EXTRA_DIST += wctype.in.h
 
-## end   gnulib module wctype
+## end   gnulib module wctype-h
 
 ## begin gnulib module xalloc
 
+libgzip_a_SOURCES += xmalloc.c
 
-EXTRA_DIST += xalloc.h xmalloc.c
-
-EXTRA_libgzip_a_SOURCES += xmalloc.c
+EXTRA_DIST += xalloc.h
 
 ## end   gnulib module xalloc
 
@@ -1926,14 +2587,12 @@ libgzip_a_SOURCES += xalloc-die.c
 
 ## end   gnulib module xalloc-die
 
-## begin gnulib module xgetcwd
+## begin gnulib module xalloc-oversized
 
 
-EXTRA_DIST += xgetcwd.c xgetcwd.h
+EXTRA_DIST += xalloc-oversized.h
 
-EXTRA_libgzip_a_SOURCES += xgetcwd.c
-
-## end   gnulib module xgetcwd
+## end   gnulib module xalloc-oversized
 
 ## begin gnulib module xsize
 
@@ -1943,10 +2602,9 @@ libgzip_a_SOURCES += xsize.h
 
 ## begin gnulib module yesno
 
+libgzip_a_SOURCES += yesno.c
 
-EXTRA_DIST += yesno.c yesno.h
-
-EXTRA_libgzip_a_SOURCES += yesno.c
+EXTRA_DIST += yesno.h
 
 ## end   gnulib module yesno
 
index 2eb6918db579a258af4e2046508ea09866c81e1e..2e344350946e8a4cd5170f764a2621e8caa9de8f 100644 (file)
@@ -1,6 +1,6 @@
 /* ignore a function return without a compiler warning
 
-   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 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,9 +15,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* Written by Jim Meyering.  */
+/* Written by Jim Meyering, Eric Blake and Pádraig Brady.  */
 
-/* Use these functions to avoid a warning when using a function declared with
+/* Use "ignore_value" to avoid a warning when using a function declared with
    gcc's warn_unused_result attribute, but for which you really do want to
    ignore the result.  Traditionally, people have used a "(void)" cast to
    indicate that a function's return value is deliberately unused.  However,
    "copy.c:233: warning: ignoring return value of 'fchown',
    declared with attribute warn_unused_result".  */
 
-static inline void ignore_value (int i) { (void) i; }
-static inline void ignore_ptr (void* p) { (void) p; }
-/* FIXME: what about aggregate types? */
+#ifndef _GL_IGNORE_VALUE_H
+# define _GL_IGNORE_VALUE_H
+
+/* The __attribute__((__warn_unused_result__)) feature
+   is available in gcc versions 3.4 and newer,
+   while the typeof feature has been available since 2.7 at least.  */
+# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
+#  define ignore_value(x) ((void) (x))
+# else
+#  define ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
+# endif
+
+#endif
index 46f4d47d709c7018fe5fe2e203e990416bce0f3a..2485c78d4ba9555f37914541ca9ff128d0bcbf59 100644 (file)
@@ -1,7 +1,6 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009, 2010 Free Software
-   Foundation, Inc.
+   Copyright (C) 2001-2005, 2009-2012 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
 
 /* Written by Paul Eggert.  */
 
-#ifndef GL_INTPROPS_H
-# define GL_INTPROPS_H
+#ifndef _GL_INTPROPS_H
+#define _GL_INTPROPS_H
 
-# include <limits.h>
+#include <limits.h>
+
+/* Return an integer value, converted to the same type as the integer
+   expression E after integer type promotion.  V is the unconverted value.  */
+#define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
+
+/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
+   <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>.  */
+#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v))
 
 /* The extra casts in the following macros work around compiler bugs,
    e.g., in Cray C 5.0.3.0.  */
 
 /* True if the arithmetic type T is an integer type.  bool counts as
    an integer.  */
-# define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
+#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
 
 /* True if negative values of the signed integer type T use two's
    complement, ones' complement, or signed magnitude representation,
    respectively.  Much GNU code assumes two's complement, but some
    people like to be portable to all possible C hosts.  */
-# define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
-# define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
-# define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
+#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
+#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
+#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
+
+/* True if the signed integer expression E uses two's complement.  */
+#define _GL_INT_TWOS_COMPLEMENT(e) (~ _GL_INT_CONVERT (e, 0) == -1)
 
 /* True if the arithmetic type T is signed.  */
-# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
 
-/* The maximum and minimum values for the integer type T.  These
+/* Return 1 if the integer expression E, after integer promotion, has
+   a signed type.  */
+#define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+
+
+/* Minimum and maximum values for integer types and expressions.  These
    macros have undefined behavior if T is signed and has padding bits.
    If this is a problem for you, please let us know how to fix it for
    your host.  */
-# define TYPE_MINIMUM(t) \
-  ((t) (! TYPE_SIGNED (t) \
-        ? (t) 0 \
-        : TYPE_SIGNED_MAGNITUDE (t) \
-        ? ~ (t) 0 \
-        : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
-# define TYPE_MAXIMUM(t) \
-  ((t) (! TYPE_SIGNED (t) \
-        ? (t) -1 \
-        : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
-
-/* Return zero if T can be determined to be an unsigned type.
-   Otherwise, return 1.
-   When compiling with GCC, INT_STRLEN_BOUND uses this macro to obtain a
-   tighter bound.  Otherwise, it overestimates the true bound by one byte
-   when applied to unsigned types of size 2, 4, 16, ... bytes.
-   The symbol signed_type_or_expr__ is private to this header file.  */
-# if __GNUC__ >= 2
-#  define signed_type_or_expr__(t) TYPE_SIGNED (__typeof__ (t))
-# else
-#  define signed_type_or_expr__(t) 1
-# endif
+
+/* The maximum and minimum values for the integer type T.  */
+#define TYPE_MINIMUM(t)                                                 \
+  ((t) (! TYPE_SIGNED (t)                                               \
+        ? (t) 0                                                         \
+        : TYPE_SIGNED_MAGNITUDE (t)                                     \
+        ? ~ (t) 0                                                       \
+        : ~ TYPE_MAXIMUM (t)))
+#define TYPE_MAXIMUM(t)                                                 \
+  ((t) (! TYPE_SIGNED (t)                                               \
+        ? (t) -1                                                        \
+        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+
+/* The maximum and minimum values for the type of the expression E,
+   after integer promotion.  E should not have side effects.  */
+#define _GL_INT_MINIMUM(e)                                              \
+  (_GL_INT_SIGNED (e)                                                   \
+   ? - _GL_INT_TWOS_COMPLEMENT (e) - _GL_SIGNED_INT_MAXIMUM (e)         \
+   : _GL_INT_CONVERT (e, 0))
+#define _GL_INT_MAXIMUM(e)                                              \
+  (_GL_INT_SIGNED (e)                                                   \
+   ? _GL_SIGNED_INT_MAXIMUM (e)                                         \
+   : _GL_INT_NEGATE_CONVERT (e, 1))
+#define _GL_SIGNED_INT_MAXIMUM(e)                                       \
+  (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
+
+
+/* Return 1 if the __typeof__ keyword works.  This could be done by
+   'configure', but for now it's easier to do it by hand.  */
+#if 2 <= __GNUC__ || 0x5110 <= __SUNPRO_C
+# define _GL_HAVE___TYPEOF__ 1
+#else
+# define _GL_HAVE___TYPEOF__ 0
+#endif
+
+/* Return 1 if the integer type or expression T might be signed.  Return 0
+   if it is definitely unsigned.  This macro does not evaluate its argument,
+   and expands to an integer constant expression.  */
+#if _GL_HAVE___TYPEOF__
+# define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t))
+#else
+# define _GL_SIGNED_TYPE_OR_EXPR(t) 1
+#endif
+
+/* Bound on length of the string representing an unsigned integer
+   value representable in B bits.  log10 (2.0) < 146/485.  The
+   smallest value of B where this bound is not tight is 2621.  */
+#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
 
 /* Bound on length of the string representing an integer type or expression T.
-   Subtract 1 for the sign bit if T is signed; log10 (2.0) < 146/485;
-   add 1 for integer division truncation; add 1 more for a minus sign
-   if needed.  */
-# define INT_STRLEN_BOUND(t) \
-  ((sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) * 146 / 485 \
-   + signed_type_or_expr__ (t) + 1)
+   Subtract 1 for the sign bit if T is signed, and then add 1 more for
+   a minus sign if needed.
+
+   Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 0 when its argument is
+   signed, this macro may overestimate the true bound by one byte when
+   applied to unsigned types of size 2, 4, 16, ... bytes.  */
+#define INT_STRLEN_BOUND(t)                                     \
+  (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT                 \
+                          - _GL_SIGNED_TYPE_OR_EXPR (t))        \
+   + _GL_SIGNED_TYPE_OR_EXPR (t))
 
 /* Bound on buffer size needed to represent an integer type or expression T,
    including the terminating null.  */
-# define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
+#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
+
+
+/* Range overflow checks.
+
+   The INT_<op>_RANGE_OVERFLOW macros return 1 if the corresponding C
+   operators might not yield numerically correct answers due to
+   arithmetic overflow.  They do not rely on undefined or
+   implementation-defined behavior.  Their implementations are simple
+   and straightforward, but they are a bit harder to use than the
+   INT_<op>_OVERFLOW macros described below.
+
+   Example usage:
+
+     long int i = ...;
+     long int j = ...;
+     if (INT_MULTIPLY_RANGE_OVERFLOW (i, j, LONG_MIN, LONG_MAX))
+       printf ("multiply would overflow");
+     else
+       printf ("product is %ld", i * j);
+
+   Restrictions on *_RANGE_OVERFLOW macros:
+
+   These macros do not check for all possible numerical problems or
+   undefined or unspecified behavior: they do not check for division
+   by zero, for bad shift counts, or for shifting negative numbers.
+
+   These macros may evaluate their arguments zero or multiple times,
+   so the arguments should not have side effects.  The arithmetic
+   arguments (including the MIN and MAX arguments) must be of the same
+   integer type after the usual arithmetic conversions, and the type
+   must have minimum value MIN and maximum MAX.  Unsigned types should
+   use a zero MIN of the proper type.
+
+   These macros are tuned for constant MIN and MAX.  For commutative
+   operations such as A + B, they are also tuned for constant B.  */
+
+/* Return 1 if A + B would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  */
+#define INT_ADD_RANGE_OVERFLOW(a, b, min, max)          \
+  ((b) < 0                                              \
+   ? (a) < (min) - (b)                                  \
+   : (max) - (b) < (a))
+
+/* Return 1 if A - B would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  */
+#define INT_SUBTRACT_RANGE_OVERFLOW(a, b, min, max)     \
+  ((b) < 0                                              \
+   ? (max) + (b) < (a)                                  \
+   : (a) < (min) + (b))
+
+/* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  */
+#define INT_NEGATE_RANGE_OVERFLOW(a, min, max)          \
+  ((min) < 0                                            \
+   ? (a) < - (max)                                      \
+   : 0 < (a))
+
+/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  Avoid && and || as they tickle
+   bugs in Sun C 5.11 2010/08/13 and other compilers; see
+   <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>.  */
+#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max)     \
+  ((b) < 0                                              \
+   ? ((a) < 0                                           \
+      ? (a) < (max) / (b)                               \
+      : (b) == -1                                       \
+      ? 0                                               \
+      : (min) / (b) < (a))                              \
+   : (b) == 0                                           \
+   ? 0                                                  \
+   : ((a) < 0                                           \
+      ? (a) < (min) / (b)                               \
+      : (max) / (b) < (a)))
+
+/* Return 1 if A / B would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  Do not check for division by zero.  */
+#define INT_DIVIDE_RANGE_OVERFLOW(a, b, min, max)       \
+  ((min) < 0 && (b) == -1 && (a) < - (max))
+
+/* Return 1 if A % B would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  Do not check for division by zero.
+   Mathematically, % should never overflow, but on x86-like hosts
+   INT_MIN % -1 traps, and the C standard permits this, so treat this
+   as an overflow too.  */
+#define INT_REMAINDER_RANGE_OVERFLOW(a, b, min, max)    \
+  INT_DIVIDE_RANGE_OVERFLOW (a, b, min, max)
+
+/* Return 1 if A << B would overflow in [MIN,MAX] arithmetic.
+   See above for restrictions.  Here, MIN and MAX are for A only, and B need
+   not be of the same type as the other arguments.  The C standard says that
+   behavior is undefined for shifts unless 0 <= B < wordwidth, and that when
+   A is negative then A << B has undefined behavior and A >> B has
+   implementation-defined behavior, but do not check these other
+   restrictions.  */
+#define INT_LEFT_SHIFT_RANGE_OVERFLOW(a, b, min, max)   \
+  ((a) < 0                                              \
+   ? (a) < (min) >> (b)                                 \
+   : (max) >> (b) < (a))
+
+
+/* The _GL*_OVERFLOW macros have the same restrictions as the
+   *_RANGE_OVERFLOW macros, except that they do not assume that operands
+   (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
+   that the result (e.g., A + B) has that type.  */
+#define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+  ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max)                  \
+   : (a) < 0 ? (b) <= (a) + (b)                                         \
+   : (b) < 0 ? (a) <= (a) + (b)                                         \
+   : (a) + (b) < (b))
+#define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
+  ((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max)             \
+   : (a) < 0 ? 1                                                        \
+   : (b) < 0 ? (a) - (b) <= (a)                                         \
+   : (a) < (b))
+#define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
+  (((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a))))       \
+   || INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
+#define _GL_DIVIDE_OVERFLOW(a, b, min, max)                             \
+  ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max)  \
+   : (a) < 0 ? (b) <= (a) + (b) - 1                                     \
+   : (b) < 0 && (a) + (b) <= (a))
+#define _GL_REMAINDER_OVERFLOW(a, b, min, max)                          \
+  ((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max)  \
+   : (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b)                     \
+   : (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max))
+
+/* Return a nonzero value if A is a mathematical multiple of B, where
+   A is unsigned, B is negative, and MAX is the maximum value of A's
+   type.  A's type must be the same as (A % B)'s type.  Normally (A %
+   -B == 0) suffices, but things get tricky if -B would overflow.  */
+#define _GL_UNSIGNED_NEG_MULTIPLE(a, b, max)                            \
+  (((b) < -_GL_SIGNED_INT_MAXIMUM (b)                                   \
+    ? (_GL_SIGNED_INT_MAXIMUM (b) == (max)                              \
+       ? (a)                                                            \
+       : (a) % (_GL_INT_CONVERT (a, _GL_SIGNED_INT_MAXIMUM (b)) + 1))   \
+    : (a) % - (b))                                                      \
+   == 0)
+
+
+/* Integer overflow checks.
+
+   The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators
+   might not yield numerically correct answers due to arithmetic overflow.
+   They work correctly on all known practical hosts, and do not rely
+   on undefined behavior due to signed arithmetic overflow.
+
+   Example usage:
+
+     long int i = ...;
+     long int j = ...;
+     if (INT_MULTIPLY_OVERFLOW (i, j))
+       printf ("multiply would overflow");
+     else
+       printf ("product is %ld", i * j);
+
+   These macros do not check for all possible numerical problems or
+   undefined or unspecified behavior: they do not check for division
+   by zero, for bad shift counts, or for shifting negative numbers.
+
+   These macros may evaluate their arguments zero or multiple times, so the
+   arguments should not have side effects.
+
+   These macros are tuned for their last argument being a constant.
+
+   Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B,
+   A % B, and A << B would overflow, respectively.  */
+
+#define INT_ADD_OVERFLOW(a, b) \
+  _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
+#define INT_SUBTRACT_OVERFLOW(a, b) \
+  _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
+#define INT_NEGATE_OVERFLOW(a) \
+  INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+#define INT_MULTIPLY_OVERFLOW(a, b) \
+  _GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
+#define INT_DIVIDE_OVERFLOW(a, b) \
+  _GL_BINARY_OP_OVERFLOW (a, b, _GL_DIVIDE_OVERFLOW)
+#define INT_REMAINDER_OVERFLOW(a, b) \
+  _GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW)
+#define INT_LEFT_SHIFT_OVERFLOW(a, b) \
+  INT_LEFT_SHIFT_RANGE_OVERFLOW (a, b, \
+                                 _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
+
+/* Return 1 if the expression A <op> B would overflow,
+   where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test,
+   assuming MIN and MAX are the minimum and maximum for the result type.
+   Arguments should be free of side effects.  */
+#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow)        \
+  op_result_overflow (a, b,                                     \
+                      _GL_INT_MINIMUM (0 * (b) + (a)),          \
+                      _GL_INT_MAXIMUM (0 * (b) + (a)))
 
-#endif /* GL_INTPROPS_H */
+#endif /* _GL_INTPROPS_H */
index ee9fa8b6440d9758a7906eeeae2518bdb962cf5c..a5a7d92c032c7743c66761532be276a34d396748 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
@@ -21,7 +21,7 @@
 /* Specification.  */
 #ifdef USE_LONG_DOUBLE
 /* Specification found in math.h or isnanl-nolibm.h.  */
-extern int rpl_isnanl (long double x);
+extern int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
 #elif ! defined USE_FLOAT
 /* Specification found in math.h or isnand-nolibm.h.  */
 extern int rpl_isnand (double x);
@@ -83,7 +83,7 @@ int
 FUNC (DOUBLE x)
 {
 #ifdef KNOWN_EXPBIT0_LOCATION
-# if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
+# if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
   /* Special CPU dependent code is needed to treat bit patterns outside the
      IEEE 754 specification (such as Pseudo-NaNs, Pseudo-Infinities,
      Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals) as NaNs.
@@ -117,16 +117,20 @@ FUNC (DOUBLE x)
 # else
   /* Be careful to not do any floating-point operation on x, such as x == x,
      because x may be a signaling NaN.  */
-#  if defined __SUNPRO_C || defined __DECC || (defined __sgi && !defined __GNUC__)
-  /* The Sun C 5.0 compilers and the Compaq (ex-DEC) 6.4 compilers don't
-     recognize the initializers as constant expressions.  The latter compiler
-     also fails when constant-folding 0.0 / 0.0 even when constant-folding is
-     not required.  The SGI MIPSpro C compiler complains about "floating-point
-     operation result is out of range".  */
+#  if defined __SUNPRO_C || defined __ICC || defined _MSC_VER \
+      || defined __DECC || defined __TINYC__ \
+      || (defined __sgi && !defined __GNUC__)
+  /* The Sun C 5.0, Intel ICC 10.0, Microsoft Visual C/C++ 9.0, Compaq (ex-DEC)
+     6.4, and TinyCC compilers don't recognize the initializers as constant
+     expressions.  The Compaq compiler also fails when constant-folding
+     0.0 / 0.0 even when constant-folding is not required.  The Microsoft
+     Visual C/C++ compiler also fails when constant-folding 1.0 / 0.0 even
+     when constant-folding is not required. The SGI MIPSpro C compiler
+     complains about "floating-point operation result is out of range".  */
   static DOUBLE zero = L_(0.0);
   memory_double nan;
-  DOUBLE plus_inf = L_(1.0) / L_(0.0);
-  DOUBLE minus_inf = -L_(1.0) / L_(0.0);
+  DOUBLE plus_inf = L_(1.0) / zero;
+  DOUBLE minus_inf = -L_(1.0) / zero;
   nan.value = zero / zero;
 #  else
   static memory_double nan = { L_(0.0) / L_(0.0) };
@@ -153,7 +157,7 @@ FUNC (DOUBLE x)
      the signaling NaNs, handle only the quiet NaNs.  */
   if (x == x)
     {
-# if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
+# if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
       /* Detect any special bit patterns that pass ==; see comment above.  */
       memory_double m1;
       memory_double m2;
index bcf6b85a1fc33ff79080a92bd898a74db19bfba7..56fb27094c0949b56f9b21c7f4b63db3a62f9069 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
index de026deffdaaf0ad24107f2b56afdca97c00cd62..ef815f3c95134132a0c3223ddcc2f3dabf1c6796 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 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
index 4f90031fbebc9e78101c31266a0abd2cdc0f5ff3..9d550e0977507d46b507415647ff597f31ac4cf0 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
 # elif defined isnan
 #  undef isnanf
 #  define isnanf(x) isnan ((float)(x))
+# else
+   /* Get declaration of isnanf(), if not declared in <math.h>.  */
+#  if defined __sgi
+   /* We can't include <ieeefp.h>, because it conflicts with our definition of
+      isnand.  Therefore declare isnanf separately.  */
+extern int isnanf (float x);
+#  endif
 # endif
 #else
 /* Test whether X is a NaN.  */
index 4f2e5abc4ab43a64005eef3cb5c422b00bafd009..0816704bc36ac67acab1bf9dfde5daec22931132 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
index 3dbba8bc67d559b234daff49bad879cf0f632cfa..58d963dbc39699a1f363031534f8c6e352990b16 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
index 9594801fd2ad47e5bb627861d57852a0d1c4e626..597ac2a8fea830111c6f2740d9ab55a82d1f8fba 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
diff --git a/lib/itold.c b/lib/itold.c
new file mode 100644 (file)
index 0000000..95ff7e1
--- /dev/null
@@ -0,0 +1,28 @@
+/* Replacement for 'int' to 'long double' conversion routine.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+   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 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <float.h>
+
+void
+_Qp_itoq (long double *result, int a)
+{
+  /* Convert from 'int' to 'double', then from 'double' to 'long double'.  */
+  *result = (double) a;
+}
diff --git a/lib/lchown.c b/lib/lchown.c
deleted file mode 100644 (file)
index 0d2ecb0..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Provide a stub lchown function for systems that lack it.
-
-   Copyright (C) 1998-1999, 2002, 2004, 2006-2007, 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* written by Jim Meyering */
-
-#include <config.h>
-
-#include <unistd.h>
-
-#include <errno.h>
-#include <stdbool.h>
-#include <string.h>
-#include <sys/stat.h>
-
-#if !HAVE_LCHOWN
-
-/* If the system chown does not follow symlinks, we don't want it
-   replaced by gnulib's chown, which does follow symlinks.  */
-# if CHOWN_MODIFIES_SYMLINK
-#  undef chown
-# endif
-
-/* Work just like chown, except when FILE is a symbolic link.
-   In that case, set errno to EOPNOTSUPP and return -1.
-   But if autoconf tests determined that chown modifies
-   symlinks, then just call chown.  */
-
-int
-lchown (const char *file, uid_t uid, gid_t gid)
-{
-# if HAVE_CHOWN
-#  if ! CHOWN_MODIFIES_SYMLINK
-  struct stat stats;
-
-  if (lstat (file, &stats) == 0 && S_ISLNK (stats.st_mode))
-    {
-      errno = EOPNOTSUPP;
-      return -1;
-    }
-#  endif
-
-  return chown (file, uid, gid);
-
-# else /* !HAVE_CHOWN */
-  errno = ENOSYS;
-  return -1;
-# endif
-}
-
-#else /* HAVE_LCHOWN */
-
-# undef lchown
-
-/* Work around trailing slash bugs in lchown.  */
-int
-rpl_lchown (const char *file, uid_t uid, gid_t gid)
-{
-  struct stat st;
-  bool stat_valid = false;
-  int result;
-
-# if CHOWN_CHANGE_TIME_BUG
-  if (gid != (gid_t) -1 || uid != (uid_t) -1)
-    {
-      if (lstat (file, &st))
-        return -1;
-      stat_valid = true;
-      if (!S_ISLNK (st.st_mode))
-        return chown (file, uid, gid);
-    }
-# endif
-
-# if CHOWN_TRAILING_SLASH_BUG
-  if (!stat_valid)
-    {
-      size_t len = strlen (file);
-      if (len && file[len - 1] == '/')
-        return chown (file, uid, gid);
-    }
-# endif
-
-  result = lchown (file, uid, gid);
-
-# if CHOWN_CHANGE_TIME_BUG && HAVE_LCHMOD
-  if (result == 0 && stat_valid
-      && (uid == st.st_uid || uid == (uid_t) -1)
-      && (gid == st.st_gid || gid == (gid_t) -1))
-    {
-      /* No change in ownership, but at least one argument was not -1,
-         so we are required to update ctime.  Since lchown succeeded,
-         we assume that lchmod will do likewise.  But if the system
-         lacks lchmod and lutimes, we are out of luck.  Oh well.  */
-      result = lchmod (file, st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO
-                                           | S_ISUID | S_ISGID | S_ISVTX));
-    }
-# endif
-
-  return result;
-}
-
-#endif /* HAVE_LCHOWN */
index 4255174418b5b14cde8935f6df3f38bd86413ac0..113205dea41503209ddf71412dbc1ca5282c8bf0 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Determine a canonical name for the current locale's character encoding.
 
-   Copyright (C) 2000-2006, 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2000-2006, 2008-2012 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,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>.  */
 
@@ -36,7 +33,7 @@
 #endif
 
 #if defined _WIN32 || defined __WIN32__
-# define WIN32_NATIVE
+# define WINDOWS_NATIVE
 #endif
 
 #if defined __EMX__
@@ -46,7 +43,7 @@
 # endif
 #endif
 
-#if !defined WIN32_NATIVE
+#if !defined WINDOWS_NATIVE
 # include <unistd.h>
 # if HAVE_LANGINFO_CODESET
 #  include <langinfo.h>
@@ -59,7 +56,7 @@
 #  define WIN32_LEAN_AND_MEAN
 #  include <windows.h>
 # endif
-#elif defined WIN32_NATIVE
+#elif defined WINDOWS_NATIVE
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 #endif
@@ -85,7 +82,7 @@
 #endif
 
 #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
-  /* Win32, Cygwin, OS/2, DOS */
+  /* Native Windows, Cygwin, OS/2, DOS */
 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
 #endif
 
@@ -125,7 +122,7 @@ get_charset_aliases (void)
   cp = charset_aliases;
   if (cp == NULL)
     {
-#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
+#if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__)
       const char *dir;
       const char *base = "charset.alias";
       char *file_name;
@@ -230,8 +227,7 @@ get_charset_aliases (void)
                         {
                           /* Out of memory. */
                           res_size = 0;
-                          if (old_res_ptr != NULL)
-                            free (old_res_ptr);
+                          free (old_res_ptr);
                           break;
                         }
                       strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
@@ -311,7 +307,7 @@ get_charset_aliases (void)
            "DECKOREAN" "\0" "EUC-KR" "\0";
 # endif
 
-# if defined WIN32_NATIVE || defined __CYGWIN__
+# if defined WINDOWS_NATIVE || defined __CYGWIN__
       /* To avoid the troubles of installing a separate file in the same
          directory as the DLL and of retrieving the DLL's directory at
          runtime, simply inline the aliases here.  */
@@ -363,7 +359,7 @@ locale_charset (void)
   const char *codeset;
   const char *aliases;
 
-#if !(defined WIN32_NATIVE || defined OS2)
+#if !(defined WINDOWS_NATIVE || defined OS2)
 
 # if HAVE_LANGINFO_CODESET
 
@@ -371,10 +367,9 @@ locale_charset (void)
   codeset = nl_langinfo (CODESET);
 
 #  ifdef __CYGWIN__
-  /* Cygwin 1.5.x does not have locales.  nl_langinfo (CODESET) always
-     returns "US-ASCII".  As long as this is not fixed, return the suffix
-     of the locale name from the environment variables (if present) or
-     the codepage as a number.  */
+  /* Cygwin < 1.7 does not have locales.  nl_langinfo (CODESET) always
+     returns "US-ASCII".  Return the suffix of the locale name from the
+     environment variables (if present) or the codepage as a number.  */
   if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
     {
       const char *locale;
@@ -411,10 +406,10 @@ locale_charset (void)
             }
         }
 
-      /* Woe32 has a function returning the locale's codepage as a number:
-         GetACP().  This encoding is used by Cygwin, unless the user has set
-         the environment variable CYGWIN=codepage:oem (which very few people
-         do).
+      /* The Windows API has a function returning the locale's codepage as a
+         number: GetACP().  This encoding is used by Cygwin, unless the user
+         has set the environment variable CYGWIN=codepage:oem (which very few
+         people do).
          Output directed to console windows needs to be converted (to
          GetOEMCP() if the console is using a raster font, or to
          GetConsoleOutputCP() if it is using a TrueType font).  Cygwin does
@@ -457,12 +452,12 @@ locale_charset (void)
 
 # endif
 
-#elif defined WIN32_NATIVE
+#elif defined WINDOWS_NATIVE
 
   static char buf[2 + 10 + 1];
 
-  /* Woe32 has a function returning the locale's codepage as a number:
-     GetACP().
+  /* The Windows API has a function returning the locale's codepage as a
+     number: GetACP().
      When the output goes to a console window, it needs to be provided in
      GetOEMCP() encoding if the console is using a raster font, or in
      GetConsoleOutputCP() encoding if it is using a TrueType font.
index 9a67c0deb0ee3366ceabf1ad14680537214cc293..39dc59399519850fa1e15265ed3c5d64e8324414 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Determine a canonical name for the current locale's character encoding.
-   Copyright (C) 2000-2003, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2009-2012 Free Software Foundation, Inc.
    This file is part of the GNU CHARSET Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -15,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _LOCALCHARSET_H
 #define _LOCALCHARSET_H
index 831e538343cba4bbfd8a7ffc4a8c9e58edb47035..794c2304477fde8dd417beb90a5055718ac78ac9 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* An lseek() function that detects pipes.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
@@ -14,8 +12,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -26,6 +23,8 @@
 /* Windows platforms.  */
 /* Get GetFileType.  */
 # include <windows.h>
+/* Get _get_osfhandle.  */
+# include "msvc-nothrow.h"
 #else
 # include <sys/stat.h>
 #endif
@@ -60,5 +59,9 @@ rpl_lseek (int fd, off_t offset, int whence)
       return -1;
     }
 #endif
+#if _GL_WINDOWS_64_BIT_OFF_T
+  return _lseeki64 (fd, offset, whence);
+#else
   return lseek (fd, offset, whence);
+#endif
 }
index 586ab16b2abfa74c2fe46deee9aa358ae336a714..db119a10d3f48db6f760dab5953696eb6b49902b 100644 (file)
@@ -1,6 +1,6 @@
 /* Work around a bug of lstat on some systems
 
-   Copyright (C) 1997-2006, 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-2006, 2008-2012 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
 
 /* written by Jim Meyering */
 
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+   the system's <sys/stat.h> here, so that orig_lstat doesn't recurse to
+   rpl_lstat.  */
+#define __need_system_sys_stat_h
 #include <config.h>
 
 #if !HAVE_LSTAT
@@ -27,7 +31,6 @@ typedef int dummy;
 #else /* HAVE_LSTAT */
 
 /* Get the original definition of lstat.  It might be defined as a macro.  */
-# define __need_system_sys_stat_h
 # include <sys/types.h>
 # include <sys/stat.h>
 # undef __need_system_sys_stat_h
@@ -39,17 +42,20 @@ orig_lstat (const char *filename, struct stat *buf)
 }
 
 /* Specification.  */
-# include <sys/stat.h>
+/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
+   eliminates this include because of the preliminary #include <sys/stat.h>
+   above.  */
+# include "sys/stat.h"
 
 # include <string.h>
 # include <errno.h>
 
 /* lstat works differently on Linux and Solaris systems.  POSIX (see
-   `pathname resolution' in the glossary) requires that programs like
-   `ls' take into consideration the fact that FILE has a trailing slash
+   "pathname resolution" in the glossary) requires that programs like
+   'ls' take into consideration the fact that FILE has a trailing slash
    when FILE is a symbolic link.  On Linux and Solaris 10 systems, the
    lstat function already has the desired semantics (in treating
-   `lstat ("symlink/", sbuf)' just like `lstat ("symlink/.", sbuf)',
+   'lstat ("symlink/", sbuf)' just like 'lstat ("symlink/.", sbuf)',
    but on Solaris 9 and earlier it does not.
 
    If FILE has a trailing slash and specifies a symbolic link,
index d9eec75e5d114cced0bb6ead665fabbdea15f375..e0d5c89d189acf2393fe48da2de88f2ab364a962 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* malloc() function that is glibc compatible.
 
-   Copyright (C) 1997-1998, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-1998, 2006-2007, 2009-2012 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
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* written by Jim Meyering and Bruno Haible */
 
+#define _GL_USE_STDLIB_ALLOC 1
 #include <config.h>
 /* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h.  */
 #ifdef malloc
-# define NEED_MALLOC_GNU
+# define NEED_MALLOC_GNU 1
 # undef malloc
+/* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU.  */
+#elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU
+# define NEED_MALLOC_GNU 1
 #endif
 
-/* Specification.  */
 #include <stdlib.h>
 
 #include <errno.h>
 
-/* Call the system's malloc below.  */
-#undef malloc
-
 /* Allocate an N-byte block of memory from the heap.
    If N is zero, allocate a 1-byte block.  */
 
@@ -43,7 +40,7 @@ rpl_malloc (size_t n)
 {
   void *result;
 
-#ifdef NEED_MALLOC_GNU
+#if NEED_MALLOC_GNU
   if (n == 0)
     n = 1;
 #endif
index 1de3697f533b941cccbb67ee01d968df88ff4dcc..ac32ed0f6e34fa5eb21bc020a94c0f370cd47f24 100644 (file)
@@ -1,6 +1,6 @@
 /* match.s -- optional optimized asm version of longest match in deflate.c
 
-   Copyright (C) 2002, 2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006, 2009-2012 Free Software Foundation, Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly
 
    This program is free software; you can redistribute it and/or modify
@@ -28,8 +28,6 @@
  * David Mosberger-Tang <davidm@hpl.hp.com>.
  */
 
-#include <config.h>
-
 /* Preprocess with -DNO_UNDERLINE if your C compiler does not prefix
  * external symbols with an underline character '_'.
  */
@@ -61,7 +59,7 @@
  * This version assumes static allocation of the arrays (-DDYN_ALLOC not used).
  */
 
-       .file   "match.S"
+        .file   "match.S"
 
 #define MAX_MATCH      258
 #define MAX_MATCH2     $128 /* MAX_MATCH/2-1 */
 #define    WSIZE       $32768
 #define MAX_DIST       WSIZE - MAX_MATCH - MIN_MATCH - 1
 
-       .globl  _match_init
-       .globl  _longest_match
+        .globl _match_init
+        .globl  _longest_match
 
-       .text
+        .text
 
 _match_init:
-       ret
+        ret
 
 /*-----------------------------------------------------------------------
  * Set match_start to the longest match starting at the given string and
@@ -92,8 +90,8 @@ _longest_match:       /* int longest_match(cur_match) */
      /* return address */               /* esp+16 */
         push    %ebp                    /* esp+12 */
         push    %edi                    /* esp+8  */
-       push    %esi                    /* esp+4  */
-       push    %ebx                    /* esp    */
+        push   %esi                    /* esp+4  */
+        push    %ebx                   /* esp    */
 
 /*
  *      match        equ esi
@@ -102,21 +100,21 @@ _longest_match:   /* int longest_match(cur_match) */
  *      best_len     equ ebx
  *      limit        equ edx
  */
-       mov     cur_match,%esi
+        mov    cur_match,%esi
         mov    _max_chain_length,%ebp /* chain_length = max_chain_length */
-       mov     _strstart,%edi
-       mov     %edi,%edx
-       sub     MAX_DIST,%edx          /* limit = strstart-MAX_DIST */
-       jae     limit_ok
-       sub     %edx,%edx              /* limit = NIL */
+        mov    _strstart,%edi
+        mov    %edi,%edx
+        sub    MAX_DIST,%edx          /* limit = strstart-MAX_DIST */
+        jae    limit_ok
+        sub    %edx,%edx              /* limit = NIL */
 limit_ok:
         add    $2+_window,%edi        /* edi = offset(window+strstart+2) */
         mov    _prev_length,%ebx      /* best_len = prev_length */
         movw   -3(%ebx,%edi),%ax      /* ax = scan[best_len-1..best_len] */
         movw   -2(%edi),%cx           /* cx = scan[0..1] */
-       cmp     _good_match,%ebx       /* do we have a good match already? */
+        cmp    _good_match,%ebx       /* do we have a good match already? */
         jb      do_scan
-       shr     $2,%ebp                /* chain_length >>= 2 */
+        shr    $2,%ebp                /* chain_length >>= 2 */
         jmp     do_scan
 
         .align  4
@@ -152,8 +150,8 @@ mismatch:
         subb    -2(%esi),%cl        /* cl = 0 if first bytes equal */
         xchg    %edi,%eax           /* edi = scan+2, eax = end of scan */
         sub     %edi,%eax           /* eax = len */
-       sub     %eax,%esi           /* esi = cur_match + 2 + offset(window) */
-       sub     $2+_window,%esi     /* esi = cur_match */
+        sub    %eax,%esi           /* esi = cur_match + 2 + offset(window) */
+        sub    $2+_window,%esi     /* esi = cur_match */
         subb    $1,%cl              /* set carry if cl == 0 (cannot use DEC) */
         adc     $0,%eax             /* eax = carry ? len+1 : len */
         cmp     %ebx,%eax           /* len > best_len ? */
@@ -164,7 +162,7 @@ mismatch:
         jl      long_loop
 the_end:
         mov     %ebx,%eax               /* result = eax = best_len */
-       pop     %ebx
+        pop     %ebx
         pop     %esi
         pop     %edi
         pop     %ebp
@@ -276,15 +274,15 @@ maxmatch:
 #define WSIZE          32768
 #define MAX_DIST       (WSIZE - MAX_MATCH - MIN_MATCH - 1)
 
-       GLOBAL  (_match_init)
-       GLOBAL  (_longest_match)
+        GLOBAL (_match_init)
+        GLOBAL (_longest_match)
 
-       TEXT
+        TEXT
 
-       FILE    ("match.S")
+        FILE   ("match.S")
 
 _match_init:
-       rts
+        rts
 
 /*-----------------------------------------------------------------------
  * Set match_start to the longest match starting at the given string and
@@ -306,91 +304,91 @@ _match_init:
 #endif
 
 _longest_match:
-       movel   IndBase(4,Stack_Pointer),Cur_Match
-       moveml  imm(pushreg),predec(Stack_Pointer)
-       movel   _max_chain_length,Chain_Length
-       movel   _prev_length,Best_Len
-       movel   imm(_prev),Prev_Address
-       movel   imm(_window+MIN_MATCH),Match_Ini
-       movel   _strstart,Limit
-       movel   Match_Ini,Scan_Ini
-       addl    Limit,Scan_Ini
-       subw    imm(MAX_DIST),Limit
-       bhis    L__limit_ok
-       clrl    Limit
+        movel  IndBase(4,Stack_Pointer),Cur_Match
+        moveml imm(pushreg),predec(Stack_Pointer)
+        movel  _max_chain_length,Chain_Length
+        movel  _prev_length,Best_Len
+        movel  imm(_prev),Prev_Address
+        movel  imm(_window+MIN_MATCH),Match_Ini
+        movel  _strstart,Limit
+        movel  Match_Ini,Scan_Ini
+        addl   Limit,Scan_Ini
+        subw   imm(MAX_DIST),Limit
+        bhis   L__limit_ok
+        clrl   Limit
 L__limit_ok:
-       cmpl    invert_maybe(_good_match,Best_Len)
-       blos    L__length_ok
-       lsrl    imm(2),Chain_Length
+        cmpl   invert_maybe(_good_match,Best_Len)
+        blos   L__length_ok
+        lsrl   imm(2),Chain_Length
 L__length_ok:
-       subql   imm(1),Chain_Length
+        subql  imm(1),Chain_Length
 #ifdef UNALIGNED_OK
-       movew   IndBase(-MIN_MATCH,Scan_Ini),Scan_Start
-       movew   IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End
+        movew  IndBase(-MIN_MATCH,Scan_Ini),Scan_Start
+        movew  IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End
 #else
-       moveb   IndBase(-MIN_MATCH,Scan_Ini),Scan_Start
-       lslw    imm(8),Scan_Start
-       moveb   IndBase(-MIN_MATCH+1,Scan_Ini),Scan_Start
-       moveb   IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End
-       lslw    imm(8),Scan_End
-       moveb   IndBaseNdxw(-MIN_MATCH,Scan_Ini,Best_Len),Scan_End
+        moveb  IndBase(-MIN_MATCH,Scan_Ini),Scan_Start
+        lslw   imm(8),Scan_Start
+        moveb  IndBase(-MIN_MATCH+1,Scan_Ini),Scan_Start
+        moveb  IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End
+        lslw   imm(8),Scan_End
+        moveb  IndBaseNdxw(-MIN_MATCH,Scan_Ini,Best_Len),Scan_End
 #endif
-       bras    L__do_scan
+        bras   L__do_scan
 
 L__long_loop:
 #ifdef UNALIGNED_OK
-       movew   IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End
+        movew  IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End
 #else
-       moveb   IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End
-       lslw    imm(8),Scan_End
-       moveb   IndBaseNdxw(-MIN_MATCH,Scan_Ini,Best_Len),Scan_End
+        moveb  IndBaseNdxw(-MIN_MATCH-1,Scan_Ini,Best_Len),Scan_End
+        lslw   imm(8),Scan_End
+        moveb  IndBaseNdxw(-MIN_MATCH,Scan_Ini,Best_Len),Scan_End
 #endif
 
 L__short_loop:
-       lslw    imm(1),Cur_Match
-       movew   IndBaseNdxl(0,Prev_Address,Cur_Match),Cur_Match
-       cmpw    invert_maybe(Limit,Cur_Match)
-       dbls    Chain_Length,L__do_scan
-       bras    L__return
+        lslw   imm(1),Cur_Match
+        movew  IndBaseNdxl(0,Prev_Address,Cur_Match),Cur_Match
+        cmpw   invert_maybe(Limit,Cur_Match)
+        dbls   Chain_Length,L__do_scan
+        bras   L__return
 
 L__do_scan:
-       movel   Match_Ini,Match
-       addl    Cur_Match,Match
+        movel  Match_Ini,Match
+        addl   Cur_Match,Match
 #ifdef UNALIGNED_OK
-       cmpw    invert_maybe(IndBaseNdxw(-MIN_MATCH-1,Match,Best_Len),Scan_End)
-       bne     L__short_loop
-       cmpw    invert_maybe(IndBase(-MIN_MATCH,Match),Scan_Start)
-       bne     L__short_loop
+        cmpw   invert_maybe(IndBaseNdxw(-MIN_MATCH-1,Match,Best_Len),Scan_End)
+        bne    L__short_loop
+        cmpw   invert_maybe(IndBase(-MIN_MATCH,Match),Scan_Start)
+        bne    L__short_loop
 #else
-       moveb   IndBaseNdxw(-MIN_MATCH-1,Match,Best_Len),Scan_Test
-       lslw    imm(8),Scan_Test
-       moveb   IndBaseNdxw(-MIN_MATCH,Match,Best_Len),Scan_Test
-       cmpw    invert_maybe(Scan_Test,Scan_End)
-       bne     L__short_loop
-       moveb   IndBase(-MIN_MATCH,Match),Scan_Test
-       lslw    imm(8),Scan_Test
-       moveb   IndBase(-MIN_MATCH+1,Match),Scan_Test
-       cmpw    invert_maybe(Scan_Test,Scan_Start)
-       bne     L__short_loop
+        moveb  IndBaseNdxw(-MIN_MATCH-1,Match,Best_Len),Scan_Test
+        lslw   imm(8),Scan_Test
+        moveb  IndBaseNdxw(-MIN_MATCH,Match,Best_Len),Scan_Test
+        cmpw   invert_maybe(Scan_Test,Scan_End)
+        bne    L__short_loop
+        moveb  IndBase(-MIN_MATCH,Match),Scan_Test
+        lslw   imm(8),Scan_Test
+        moveb  IndBase(-MIN_MATCH+1,Match),Scan_Test
+        cmpw   invert_maybe(Scan_Test,Scan_Start)
+        bne    L__short_loop
 #endif
 
-       movew   imm((MAX_MATCH-MIN_MATCH+1)-1),Loop_Counter
-       movel   Scan_Ini,Scan
+        movew  imm((MAX_MATCH-MIN_MATCH+1)-1),Loop_Counter
+        movel  Scan_Ini,Scan
 L__scan_loop:
-       cmpmb   postinc(Match),postinc(Scan)
-       dbne    Loop_Counter,L__scan_loop
-
-       subl    Scan_Ini,Scan
-       addql   imm(MIN_MATCH-1),Scan
-       cmpl    invert_maybe(Best_Len,Scan)
-       bls     L__short_loop
-       movel   Scan,Best_Len
-       movel   Cur_Match,_match_start
-       cmpl    invert_maybe(_nice_match,Best_Len)
-       blos    L__long_loop
+        cmpmb  postinc(Match),postinc(Scan)
+        dbne   Loop_Counter,L__scan_loop
+
+        subl   Scan_Ini,Scan
+        addql  imm(MIN_MATCH-1),Scan
+        cmpl   invert_maybe(Best_Len,Scan)
+        bls    L__short_loop
+        movel  Scan,Best_Len
+        movel  Cur_Match,_match_start
+        cmpl   invert_maybe(_nice_match,Best_Len)
+        blos   L__long_loop
 L__return:
-       moveml  postinc(Stack_Pointer),imm(popreg)
-       rts
+        moveml postinc(Stack_Pointer),imm(popreg)
+        rts
 
 #else
 
@@ -495,188 +493,188 @@ L__return:
 #define cgeu                   cmp.ge.unc
 #define cneu                   cmp.ne.unc
 
-       .global longest_match
-       .proc longest_match
-       .align 32
+        .global longest_match
+        .proc longest_match
+        .align 32
 longest_match:
 // --  Cycle: 0
-       .prologue
+        .prologue
 {.mmi
-        alloc r2=ar.pfs,R_INPUT,R_LOCAL,R_OUTPUT,R_ROTATING
-       .rotr scan[MLAT+2], match[MLAT+2], shscan0[SHLAT+1], \
-             shscan1[SHLAT+1], shmatch0[SHLAT+1], shmatch1[SHLAT+1]
-       .rotp lc[MLAT+SHLAT+2]
-       mova s_vspec_cmatch=in0 // cur_match from input register
-       add s_tm1=@gprel(strstart),gp // a(a(strstart))
+         alloc r2=ar.pfs,R_INPUT,R_LOCAL,R_OUTPUT,R_ROTATING
+        .rotr scan[MLAT+2], match[MLAT+2], shscan0[SHLAT+1], \
+              shscan1[SHLAT+1], shmatch0[SHLAT+1], shmatch1[SHLAT+1]
+        .rotp lc[MLAT+SHLAT+2]
+        mova s_vspec_cmatch=in0 // cur_match from input register
+        add s_tm1=@gprel(strstart),gp // a(a(strstart))
 }{.mmi
-       add s_tm3=@gprel(prev_length),gp // a(a(prev_length))
-       add s_tm5=@ltoff(window),gp // a(a(window))
-       add s_tm6=@ltoff(prev),gp // a(a(prev))
-       ;;
+        add s_tm3=@gprel(prev_length),gp // a(a(prev_length))
+        add s_tm5=@ltoff(window),gp // a(a(window))
+        add s_tm6=@ltoff(prev),gp // a(a(prev))
+        ;;
 }{.mmb //  Cycle: 1
-       ld4 s_vstrstart=[s_tm1] // strstart
-       ld4 s_vbestlen=[s_tm3] // best_len = prev_length
-       brp.loop.imp .cmploop,.cmploop+48
+        ld4 s_vstrstart=[s_tm1] // strstart
+        ld4 s_vbestlen=[s_tm3] // best_len = prev_length
+        brp.loop.imp .cmploop,.cmploop+48
 }{.mli
-       add s_tm2=@gprel(max_chain_length),gp // a(a(max_chain_length))
-       movl s_wmask=WSIZE-1
-       ;;
+        add s_tm2=@gprel(max_chain_length),gp // a(a(max_chain_length))
+        movl s_wmask=WSIZE-1
+        ;;
 }{.mmi //  Cycle: 2
-       ld8 s_aprev=[s_tm6] // a(prev)
-       ld8 s_awindow=[s_tm5] // a(window)
-       .save pr, s_prsave
-       movi0 s_prsave=pr // save predicates
+        ld8 s_aprev=[s_tm6] // a(prev)
+        ld8 s_awindow=[s_tm5] // a(window)
+        .save pr, s_prsave
+        movi0 s_prsave=pr // save predicates
 }{.mmi
-       add s_tm4=@gprel(good_match),gp // a(a(good_match))
-       add s_tm7=@ltoff(nice_match),gp // a(a(nice_match))
-       add s_tm8=@ltoff(match_start),gp // a(match_start)
-       ;;
+        add s_tm4=@gprel(good_match),gp // a(a(good_match))
+        add s_tm7=@ltoff(nice_match),gp // a(a(nice_match))
+        add s_tm8=@ltoff(match_start),gp // a(match_start)
+        ;;
 }{.mmi //  Cycle: 3
-       ld8 s_anicematch=[s_tm7] // a(nice_match)
-       ld8 s_amatchstart=[s_tm8] // a(match_start)
-       .save ar.lc, s_lcsave
-       movi0 s_lcsave=ar.lc // save loop count register
+        ld8 s_anicematch=[s_tm7] // a(nice_match)
+        ld8 s_amatchstart=[s_tm8] // a(match_start)
+        .save ar.lc, s_lcsave
+        movi0 s_lcsave=ar.lc // save loop count register
 }{.mmi
-       .body
-       add s_tm1=-(MAX_MATCH + MIN_MATCH),s_wmask // maxdist
-       cmp.eq p_ll,p0=r0,r0 // parallel compare initialized as 'true'
-       mova s_vcurmatch=s_vspec_cmatch
-       ;;
+        .body
+        add s_tm1=-(MAX_MATCH + MIN_MATCH),s_wmask // maxdist
+        cmp.eq p_ll,p0=r0,r0 // parallel compare initialized as 'true'
+        mova s_vcurmatch=s_vspec_cmatch
+        ;;
 }{.mmi //  Cycle: 4
-       ld4 s_vchainlen=[s_tm2] // chain_length=max_chain_length
-       ld4 s_tm4=[s_tm4] // v(good_match)
-       add s_ascan=s_awindow,s_vstrstart // scan=window + strstart
+        ld4 s_vchainlen=[s_tm2] // chain_length=max_chain_length
+        ld4 s_tm4=[s_tm4] // v(good_match)
+        add s_ascan=s_awindow,s_vstrstart // scan=window + strstart
 }{.mmi
-       sub s_vlimit=s_vstrstart, s_tm1 // limit=strstart - MAX_DIST
-       add s_amatch=s_awindow,s_vspec_cmatch // match=window + cur_match
-       and s_vspec_cmatch =s_vspec_cmatch,s_wmask
-       ;;
+        sub s_vlimit=s_vstrstart, s_tm1 // limit=strstart - MAX_DIST
+        add s_amatch=s_awindow,s_vspec_cmatch // match=window + cur_match
+        and s_vspec_cmatch =s_vspec_cmatch,s_wmask
+        ;;
 }{.mmi //  Cycle: 5
-       add s_amatblen=s_amatch,s_vbestlen //
-       cneu p_bn2,p0=2,s_vbestlen // set if bestlen != 2
-       add s_ascanend=s_ascan,s_vbestlen // compute a(scan) + best_len
+        add s_amatblen=s_amatch,s_vbestlen //
+        cneu p_bn2,p0=2,s_vbestlen // set if bestlen != 2
+        add s_ascanend=s_ascan,s_vbestlen // compute a(scan) + best_len
 }{.mmi
-       ld1 s_vscan0=[s_ascan],1 // NB: s_ascan++
-       ld1 s_vmatch0=[s_amatch],1
-       cgtu p0,p_no=s_vlimit,r0 // is result positive ?
-       ;;
+        ld1 s_vscan0=[s_ascan],1 // NB: s_ascan++
+        ld1 s_vmatch0=[s_amatch],1
+        cgtu p0,p_no=s_vlimit,r0 // is result positive ?
+        ;;
 }{.mmi //  Cycle: 6
-       ld1.nt1 s_vscan1=[s_ascan],2 // NB: s_ascan+3 in total
-       ld1.nt1 s_vmatch1=[s_amatch],2
-       add s_awinbest=s_awindow,s_vbestlen //
-       ;;
+        ld1.nt1 s_vscan1=[s_ascan],2 // NB: s_ascan+3 in total
+        ld1.nt1 s_vmatch1=[s_amatch],2
+        add s_awinbest=s_awindow,s_vbestlen //
+        ;;
 }{.mmi //  Cycle: 7
-       ld1.nt1 s_vscanend=[s_ascanend],-1 // scan_end=scan[best_len]
-       ld1.nt1 s_vmatbst=[s_amatblen],-1
+        ld1.nt1 s_vscanend=[s_ascanend],-1 // scan_end=scan[best_len]
+        ld1.nt1 s_vmatbst=[s_amatblen],-1
 (p_no) mova s_vlimit=r0
-       ;;
+        ;;
 }{.mmi //  Cycle: 8
 (p_bn2)        ld1.nt1 s_vscanend1=[s_ascanend],1 // scan_end1=scan[best_len-1]
 (p_bn2)        ld1.nt1 s_vmatbst1=[s_amatblen]
-       shladd s_vspec_cmatch =s_vspec_cmatch,1,s_aprev
+        shladd s_vspec_cmatch =s_vspec_cmatch,1,s_aprev
 }{.mmi
-       cgeu p_shf,p0=s_vbestlen,s_tm4 // is (prev_length >= good_match) ?
-       ;;
+        cgeu p_shf,p0=s_vbestlen,s_tm4 // is (prev_length >= good_match) ?
+        ;;
 }{.mmi //  Cycle: 9
-       ld1.nt1 s_vscan3=[s_ascan]
-       ld2.nt1 s_vspec_cmatch=[s_vspec_cmatch]
-       mova    s_vlen=3
+        ld1.nt1 s_vscan3=[s_ascan]
+        ld2.nt1 s_vspec_cmatch=[s_vspec_cmatch]
+        mova   s_vlen=3
 }{.mmi
 (p_shf)        shr.u s_vchainlen=s_vchainlen,2 // (cur_len) >> 2
-       ;;
+        ;;
 }{.mmi //  Cycle: 10
-       ld1.nt1 s_vmatch3=[s_amatch]
-       // p_ll switched on as soon as we get a mismatch:
-       cmp.eq.and p_ll,p0=s_vmatch0,s_vscan0
-       cmp.eq.and p_ll,p0=s_vmatbst,s_vscanend
+        ld1.nt1 s_vmatch3=[s_amatch]
+        // p_ll switched on as soon as we get a mismatch:
+        cmp.eq.and p_ll,p0=s_vmatch0,s_vscan0
+        cmp.eq.and p_ll,p0=s_vmatbst,s_vscanend
 }{.mib
-       cmp.eq.and p_ll,p0=s_vmatch1,s_vscan1
+        cmp.eq.and p_ll,p0=s_vmatch1,s_vscan1
 (p_bn2)        cmp.eq.and p_ll,p0=s_vmatbst1,s_vscanend1
 (p_ll) br.cond.dpnt.many .test_more
-       ;;
+        ;;
 }
 
 .next_iter:
 {.mmi  // Cycle 0
-       add s_amatch=s_awindow,s_vspec_cmatch   // match=window + cur_match
-       mov s_vcurmatch=s_vspec_cmatch          // current value
-       add s_vchainlen=-1,s_vchainlen          // --chain_length
+        add s_amatch=s_awindow,s_vspec_cmatch          // match=window + cur_match
+        mov s_vcurmatch=s_vspec_cmatch         // current value
+        add s_vchainlen=-1,s_vchainlen                 // --chain_length
 }{.mib
-       cmp.le.unc p_end,p0=s_vspec_cmatch,s_vlimit
-       and s_vspec_cmatch=s_vspec_cmatch,s_wmask
+        cmp.le.unc p_end,p0=s_vspec_cmatch,s_vlimit
+        and s_vspec_cmatch=s_vspec_cmatch,s_wmask
 (p_end)        br.cond.dptk.many .terminate
-       ;;
+        ;;
 }{.mmi // Cycle 1
-       ld1 s_vmatch0=[s_amatch],1              // load match[0]
-       // compute prev[cur_match]:
-       shladd s_vspec_cmatch=s_vspec_cmatch,1,s_aprev
-       cmp.eq.unc p_end,p0=s_vchainlen,r0
+        ld1 s_vmatch0=[s_amatch],1             // load match[0]
+        // compute prev[cur_match]:
+        shladd s_vspec_cmatch=s_vspec_cmatch,1,s_aprev
+        cmp.eq.unc p_end,p0=s_vchainlen,r0
 } {.mib
-       nop.m 0
-       add s_amatblen=s_awinbest,s_vcurmatch   // match=window + cur_match
+        nop.m 0
+        add s_amatblen=s_awinbest,s_vcurmatch  // match=window + cur_match
 (p_end)        br.cond.dptk.many .terminate
-       ;;
+        ;;
 }{.mmi // Cycle 2 (short)
-       ld2.nt1 s_vspec_cmatch=[s_vspec_cmatch]         // get next cur_match
-       ;;
+        ld2.nt1 s_vspec_cmatch=[s_vspec_cmatch]                // get next cur_match
+        ;;
 }{.mmi // Cycle 3 (short)
-       ld1.nt1 s_vmatbst=[s_amatblen],-1       // load match[best_len]
-       cmp.ne.unc p_ll,p0=r0,r0     // parallel compare initialized as 'false'
-       ;;
+        ld1.nt1 s_vmatbst=[s_amatblen],-1      // load match[best_len]
+        cmp.ne.unc p_ll,p0=r0,r0     // parallel compare initialized as 'false'
+        ;;
 }{.mmi // Cycle 4 (short)
-       // load match[1] - - note: match += 3 (in total):
-       ld1.nt1 s_vmatch1=[s_amatch],2
-       ;;
-       // Cycle 5  (short)
+        // load match[1] - - note: match += 3 (in total):
+        ld1.nt1 s_vmatch1=[s_amatch],2
+        ;;
+        // Cycle 5  (short)
 (p_bn2)        ld1.nt1 s_vmatbst1=[s_amatblen]         // load match[best_len-1]
 }{.mib // Here we (MOST LIKELY) pay a L2-fetch stall
-       // p_ll switched on as soon as we get a mismatch:
-       cmp.ne.or p_ll,p0=s_vmatch0,s_vscan0
-       cmp.ne.or p_ll,p0=s_vmatbst,s_vscanend
+        // p_ll switched on as soon as we get a mismatch:
+        cmp.ne.or p_ll,p0=s_vmatch0,s_vscan0
+        cmp.ne.or p_ll,p0=s_vmatbst,s_vscanend
 (p_ll) br.cond.dptk.many .next_iter
-       ;;
+        ;;
 }{.mmi // Cycle 6
-       ld1.nt1 s_vmatch3=[s_amatch]
-       mova s_vlen=3
-       nop.i 0
+        ld1.nt1 s_vmatch3=[s_amatch]
+        mova s_vlen=3
+        nop.i 0
 }{.mib
-       cmp.ne.or p_ll,p0=s_vmatch1,s_vscan1
+        cmp.ne.or p_ll,p0=s_vmatch1,s_vscan1
 (p_bn2)        cmp.ne.or p_ll,p0=s_vmatbst1,s_vscanend1
 (p_ll) br.cond.dptk.many .next_iter
-       ;;
+        ;;
 }
 
 // We have passed the first hurdle - Are there additional matches ???
 
 .test_more:
 {.mmi  // Cycle 0
-       and s_tm3=7,s_ascan                     // get byte offset
-       and s_tm4=7,s_amatch                    // get byte offset
-       movi0 ar.ec=MLAT+SHLAT+2                // NB: One trip more than usual
+        and s_tm3=7,s_ascan                    // get byte offset
+        and s_tm4=7,s_amatch                   // get byte offset
+        movi0 ar.ec=MLAT+SHLAT+2               // NB: One trip more than usual
 }{.mib
-       cmp.ne.unc p_no,p0=s_vscan3,s_vmatch3   // does not next one differ?
+        cmp.ne.unc p_no,p0=s_vscan3,s_vmatch3  // does not next one differ?
 (p_no)  br.cond.dptk.many .only3
-       ;;
+        ;;
 }{.mmi // Cycle 1
-       and s_tm1=-8,s_ascan    // get aligned address
-       shladd s_tm3=s_tm3,3,r0
-       movi0 ar.lc=31          // 32 times around the loop (8B at a time)
+        and s_tm1=-8,s_ascan   // get aligned address
+        shladd s_tm3=s_tm3,3,r0
+        movi0 ar.lc=31         // 32 times around the loop (8B at a time)
 }{.mib
-       and s_tm2=-8,s_amatch                   // get aligned address
-       shladd s_tm4=s_tm4,3,r0
-       nop.b 0
-       ;;
+        and s_tm2=-8,s_amatch                  // get aligned address
+        shladd s_tm4=s_tm4,3,r0
+        nop.b 0
+        ;;
 }{.mmi // Cycle 2
-       ld8.nt1 scan[1]=[s_tm1],8                       // load first chunk
-       sub s_tm5=64,s_tm3                              // 64 - amount
-       movi0 pr.rot=1<<16
+        ld8.nt1 scan[1]=[s_tm1],8                      // load first chunk
+        sub s_tm5=64,s_tm3                             // 64 - amount
+        movi0 pr.rot=1<<16
 }{.mmi
-       ld8.nt1 match[1]=[s_tm2],8      // load first chunk
-       sub s_tm6=64,s_tm4              // 64 - amount
-       add s_vlen=-8,s_vlen            // will be updated at least once
-       ;;
+        ld8.nt1 match[1]=[s_tm2],8     // load first chunk
+        sub s_tm6=64,s_tm4             // 64 - amount
+        add s_vlen=-8,s_vlen           // will be updated at least once
+        ;;
 }
-       .align 32
+        .align 32
 .cmploop:
 {.mmi  // Cycle 0
 (lc[0])                        ld8 scan[0]=[s_tm1],8           // next scan chunk
@@ -686,84 +684,84 @@ longest_match:
 (lc[MLAT+SHLAT+1])     cmp.ne.unc p_no,p0=s_tm7,s_tm8  // break search if !=
 (lc[MLAT])             first shmatch0[0]=match[MLAT+1],s_tm4
 (p_no)                 br.cond.dpnt.many .mismatch
-                       ;;
+                        ;;
 }{.mii  // Cycle 1
 (lc[0])                        ld8 match[0]=[s_tm2],8
-                       // shift left(le) or right(be):
+                        // shift left(le) or right(be):
 (lc[MLAT])             second shscan1[0]=scan[MLAT],s_tm5
 (lc[MLAT])             second shmatch1[0]=match[MLAT],s_tm6
 }{.mmb
 (lc[MLAT+SHLAT])       or s_tm7=shscan0[SHLAT],shscan1[SHLAT]
 (lc[MLAT+SHLAT])       or s_tm8=shmatch0[SHLAT],shmatch1[SHLAT]
-                       br.ctop.dptk.many .cmploop
-                       ;;
+                        br.ctop.dptk.many .cmploop
+                        ;;
 }{.mfi
-       mov s_vlen=258
-       nop.f 0
+        mov s_vlen=258
+        nop.f 0
 }{.mfi
-       nop.f 0    // realign
-       ;;
+        nop.f 0    // realign
+        ;;
 }
 .mismatch:
 {.mii  // Cycle 0 (short)
 (p_no) pcmp1.eq s_tm2=s_tm7,s_tm8      // find first non-matching character
-       nop.i 0
-       ;;
-       // Cycle 1 (short)
+        nop.i 0
+        ;;
+        // Cycle 1 (short)
 (p_no) count s_tm1=s_tm2
-       ;;
+        ;;
 }{.mib // Cycle 2 (short)
 (p_no) add s_vlen=s_vlen,s_tm1         // effective length
-       nop.i 0
-       clrrrb
-       ;;
+        nop.i 0
+        clrrrb
+        ;;
 }
 
 .only3:
 {.mib  // Cycle 0 (short)
-       cmp.gt.unc p0,p_nbs=s_vlen,s_vbestlen           // (len > best_len) ?
+        cmp.gt.unc p0,p_nbs=s_vlen,s_vbestlen          // (len > best_len) ?
 (p_nbs)        br.cond.dpnt.many .next_iter                    // if not, re-iternate
-       ;;
+        ;;
 }{.mmi // Cycle 1 (short)
-       ld4 s_tm7=[s_anicematch]                        // nice_match
-       st4 [s_amatchstart]= s_vcurmatch
-       add s_ascanend=s_ascan,s_vlen                   // reset with best_len
-       ;;
+        ld4 s_tm7=[s_anicematch]                       // nice_match
+        st4 [s_amatchstart]= s_vcurmatch
+        add s_ascanend=s_ascan,s_vlen                  // reset with best_len
+        ;;
 }{.mmi // Cycle 2 (short)
-       mova s_vbestlen=s_vlen
-       add s_ascanend=-3,s_ascanend            // remember extra offset
-       ;;
+        mova s_vbestlen=s_vlen
+        add s_ascanend=-3,s_ascanend           // remember extra offset
+        ;;
 }{.mmi // Cycle 3 (short)
-       ld1 s_vscanend=[s_ascanend],-1          // scan_end=scan[best_len]
-       add s_awinbest=s_awindow,s_vbestlen     // update with new best_len
-       cmp.ne.unc p_bn2,p0=2,s_vbestlen        // set if bestlen != 2
-       ;;
+        ld1 s_vscanend=[s_ascanend],-1         // scan_end=scan[best_len]
+        add s_awinbest=s_awindow,s_vbestlen    // update with new best_len
+        cmp.ne.unc p_bn2,p0=2,s_vbestlen       // set if bestlen != 2
+        ;;
 }{.mib // Cycle 4 (short)
-       // scan_end1=scan[best_len-1] NB: s_ascanend reset:
-       ld1.nt1 s_vscanend1=[s_ascanend],1
-       cmp.lt.unc p_nnc,p0=s_vlen,s_tm7        // compare with nice_match
+        // scan_end1=scan[best_len-1] NB: s_ascanend reset:
+        ld1.nt1 s_vscanend1=[s_ascanend],1
+        cmp.lt.unc p_nnc,p0=s_vlen,s_tm7       // compare with nice_match
 (p_nnc)        br.cond.dptk.many .next_iter
-       ;;
+        ;;
 }
 .terminate:
 {.mii  // Cycle 0/1
-       nop.m 0
-       movi0 ar.lc=s_lcsave
-       movi0 pr=s_prsave,-1
+        nop.m 0
+        movi0 ar.lc=s_lcsave
+        movi0 pr=s_prsave,-1
 }{.mbb
-       nop.m 0
-       nop.b 0
-       br.ret.sptk.many rp     // ret0 is identical to best_len
-       ;;
+        nop.m 0
+        nop.b 0
+        br.ret.sptk.many rp    // ret0 is identical to best_len
+        ;;
 }
-       .endp
+        .endp
 
-       .global match_init
-       .proc match_init
+        .global match_init
+        .proc match_init
 match_init:
-       sub ret0=ret0,ret0
-       br.ret.sptk.many rp
-       .endp
+        sub ret0=ret0,ret0
+        br.ret.sptk.many rp
+        .endp
 
 # else
  error: this asm version is for 386 or 680x0 or ia64 only
index 4e21cf95cb6fc346b30e2b1ebe6b5820f60ad772..0625777acc169d3b7be4646bd0c3cb3b07cb54db 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <math.h>.
 
-   Copyright (C) 2002-2003, 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2007-2012 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
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_MATH_H
+#ifndef _@GUARD_PREFIX@_MATH_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
 
-#ifndef _GL_MATH_H
-#define _GL_MATH_H
+#ifndef _@GUARD_PREFIX@_MATH_H
+#define _@GUARD_PREFIX@_MATH_H
 
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+#ifdef __cplusplus
+/* Helper macros to define type-generic function FUNC as overloaded functions,
+   rather than as macros like in C.  POSIX declares these with an argument of
+   real-floating (that is, one of float, double, or long double).  */
+# define _GL_MATH_CXX_REAL_FLOATING_DECL_1(func) \
+static inline int                                                   \
+_gl_cxx_ ## func ## f (float f)                                     \
+{                                                                   \
+  return func (f);                                                  \
+}                                                                   \
+static inline int                                                   \
+_gl_cxx_ ## func ## d (double d)                                    \
+{                                                                   \
+  return func (d);                                                  \
+}                                                                   \
+static inline int                                                   \
+_gl_cxx_ ## func ## l (long double l)                               \
+{                                                                   \
+  return func (l);                                                  \
+}
+# define _GL_MATH_CXX_REAL_FLOATING_DECL_2(func) \
+inline int                                                          \
+func (float f)                                                      \
+{                                                                   \
+  return _gl_cxx_ ## func ## f (f);                                 \
+}                                                                   \
+inline int                                                          \
+func (double d)                                                     \
+{                                                                   \
+  return _gl_cxx_ ## func ## d (d);                                 \
+}                                                                   \
+inline int                                                          \
+func (long double l)                                                \
+{                                                                   \
+  return _gl_cxx_ ## func ## l (l);                                 \
+}
+#endif
+
 /* Helper macros to define a portability warning for the
    classification macro FUNC called with VALUE.  POSIX declares the
    classification macros with an argument of real-floating (that is,
@@ -64,376 +105,1939 @@ _GL_WARN_ON_USE (rpl_ ## func ## l, #func " is unportable - "       \
    : rpl_ ## func ## l (value))
 
 
-#ifdef __cplusplus
-extern "C" {
+#if @REPLACE_ITOLD@
+/* Pull in a function that fixes the 'int' to 'long double' conversion
+   of glibc 2.7.  */
+_GL_EXTERN_C void _Qp_itoq (long double *, int);
+static void (*_gl_math_fix_itold) (long double *, int) = _Qp_itoq;
+#endif
+
+
+/* POSIX allows platforms that don't support NAN.  But all major
+   machines in the past 15 years have supported something close to
+   IEEE NaN, so we define this unconditionally.  We also must define
+   it on platforms like Solaris 10, where NAN is present but defined
+   as a function pointer rather than a floating point constant.  */
+#if !defined NAN || @REPLACE_NAN@
+# if !GNULIB_defined_NAN
+#  undef NAN
+  /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler
+     choke on the expression 0.0 / 0.0.  */
+#  if defined __DECC || defined _MSC_VER
+static float
+_NaN ()
+{
+  static float zero = 0.0f;
+  return zero / zero;
+}
+#   define NAN (_NaN())
+#  else
+#   define NAN (0.0f / 0.0f)
+#  endif
+#  define GNULIB_defined_NAN 1
+# endif
+#endif
+
+/* Solaris 10 defines HUGE_VAL, but as a function pointer rather
+   than a floating point constant.  */
+#if @REPLACE_HUGE_VAL@
+# undef HUGE_VALF
+# define HUGE_VALF (1.0f / 0.0f)
+# undef HUGE_VAL
+# define HUGE_VAL (1.0 / 0.0)
+# undef HUGE_VALL
+# define HUGE_VALL (1.0L / 0.0L)
+#endif
+
+/* HUGE_VALF is a 'float' Infinity.  */
+#ifndef HUGE_VALF
+# if defined _MSC_VER
+/* The Microsoft MSVC 9 compiler chokes on the expression 1.0f / 0.0f.  */
+#  define HUGE_VALF (1e25f * 1e25f)
+# else
+#  define HUGE_VALF (1.0f / 0.0f)
+# endif
+#endif
+
+/* HUGE_VAL is a 'double' Infinity.  */
+#ifndef HUGE_VAL
+# if defined _MSC_VER
+/* The Microsoft MSVC 9 compiler chokes on the expression 1.0 / 0.0.  */
+#  define HUGE_VAL (1e250 * 1e250)
+# else
+#  define HUGE_VAL (1.0 / 0.0)
+# endif
+#endif
+
+/* HUGE_VALL is a 'long double' Infinity.  */
+#ifndef HUGE_VALL
+# if defined _MSC_VER
+/* The Microsoft MSVC 9 compiler chokes on the expression 1.0L / 0.0L.  */
+#  define HUGE_VALL (1e250L * 1e250L)
+# else
+#  define HUGE_VALL (1.0L / 0.0L)
+# endif
+#endif
+
+
+/* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined.  */
+#if !(defined FP_ILOGB0 && defined FP_ILOGBNAN)
+# if defined __NetBSD__ || defined __sgi
+  /* NetBSD, IRIX 6.5: match what ilogb() does */
+#  define FP_ILOGB0   (- 2147483647 - 1) /* INT_MIN */
+#  define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
+# elif defined _AIX
+  /* AIX 5.1: match what ilogb() does in AIX >= 5.2 */
+#  define FP_ILOGB0   (- 2147483647 - 1) /* INT_MIN */
+#  define FP_ILOGBNAN 2147483647 /* INT_MAX */
+# elif defined __sun
+  /* Solaris 9: match what ilogb() does */
+#  define FP_ILOGB0   (- 2147483647) /* - INT_MAX */
+#  define FP_ILOGBNAN 2147483647 /* INT_MAX */
+# else
+  /* Gnulib defined values.  */
+#  define FP_ILOGB0   (- 2147483647) /* - INT_MAX */
+#  define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
+# endif
+#endif
+
+
+#if @GNULIB_ACOSF@
+# if !@HAVE_ACOSF@
+#  undef acosf
+_GL_FUNCDECL_SYS (acosf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (acosf, float, (float x));
+_GL_CXXALIASWARN (acosf);
+#elif defined GNULIB_POSIXCHECK
+# undef acosf
+# if HAVE_RAW_DECL_ACOSF
+_GL_WARN_ON_USE (acosf, "acosf is unportable - "
+                 "use gnulib module acosf for portability");
+# endif
+#endif
+
+#if @GNULIB_ACOSL@
+# if !@HAVE_ACOSL@ || !@HAVE_DECL_ACOSL@
+#  undef acosl
+_GL_FUNCDECL_SYS (acosl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (acosl, long double, (long double x));
+_GL_CXXALIASWARN (acosl);
+#elif defined GNULIB_POSIXCHECK
+# undef acosl
+# if HAVE_RAW_DECL_ACOSL
+_GL_WARN_ON_USE (acosl, "acosl is unportable - "
+                 "use gnulib module acosl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ASINF@
+# if !@HAVE_ASINF@
+#  undef asinf
+_GL_FUNCDECL_SYS (asinf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (asinf, float, (float x));
+_GL_CXXALIASWARN (asinf);
+#elif defined GNULIB_POSIXCHECK
+# undef asinf
+# if HAVE_RAW_DECL_ASINF
+_GL_WARN_ON_USE (asinf, "asinf is unportable - "
+                 "use gnulib module asinf for portability");
+# endif
+#endif
+
+#if @GNULIB_ASINL@
+# if !@HAVE_ASINL@ || !@HAVE_DECL_ASINL@
+#  undef asinl
+_GL_FUNCDECL_SYS (asinl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (asinl, long double, (long double x));
+_GL_CXXALIASWARN (asinl);
+#elif defined GNULIB_POSIXCHECK
+# undef asinl
+# if HAVE_RAW_DECL_ASINL
+_GL_WARN_ON_USE (asinl, "asinl is unportable - "
+                 "use gnulib module asinl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ATANF@
+# if !@HAVE_ATANF@
+#  undef atanf
+_GL_FUNCDECL_SYS (atanf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (atanf, float, (float x));
+_GL_CXXALIASWARN (atanf);
+#elif defined GNULIB_POSIXCHECK
+# undef atanf
+# if HAVE_RAW_DECL_ATANF
+_GL_WARN_ON_USE (atanf, "atanf is unportable - "
+                 "use gnulib module atanf for portability");
+# endif
+#endif
+
+#if @GNULIB_ATANL@
+# if !@HAVE_ATANL@ || !@HAVE_DECL_ATANL@
+#  undef atanl
+_GL_FUNCDECL_SYS (atanl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (atanl, long double, (long double x));
+_GL_CXXALIASWARN (atanl);
+#elif defined GNULIB_POSIXCHECK
+# undef atanl
+# if HAVE_RAW_DECL_ATANL
+_GL_WARN_ON_USE (atanl, "atanl is unportable - "
+                 "use gnulib module atanl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ATAN2F@
+# if !@HAVE_ATAN2F@
+#  undef atan2f
+_GL_FUNCDECL_SYS (atan2f, float, (float y, float x));
+# endif
+_GL_CXXALIAS_SYS (atan2f, float, (float y, float x));
+_GL_CXXALIASWARN (atan2f);
+#elif defined GNULIB_POSIXCHECK
+# undef atan2f
+# if HAVE_RAW_DECL_ATAN2F
+_GL_WARN_ON_USE (atan2f, "atan2f is unportable - "
+                 "use gnulib module atan2f for portability");
+# endif
+#endif
+
+
+#if @GNULIB_CBRTF@
+# if @REPLACE_CBRTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef cbrtf
+#   define cbrtf rpl_cbrtf
+#  endif
+_GL_FUNCDECL_RPL (cbrtf, float, (float x));
+_GL_CXXALIAS_RPL (cbrtf, float, (float x));
+# else
+#  if !@HAVE_DECL_CBRTF@
+_GL_FUNCDECL_SYS (cbrtf, float, (float x));
+#  endif
+_GL_CXXALIAS_SYS (cbrtf, float, (float x));
+# endif
+_GL_CXXALIASWARN (cbrtf);
+#elif defined GNULIB_POSIXCHECK
+# undef cbrtf
+# if HAVE_RAW_DECL_CBRTF
+_GL_WARN_ON_USE (cbrtf, "cbrtf is unportable - "
+                 "use gnulib module cbrtf for portability");
+# endif
+#endif
+
+#if @GNULIB_CBRT@
+# if !@HAVE_CBRT@
+_GL_FUNCDECL_SYS (cbrt, double, (double x));
+# endif
+_GL_CXXALIAS_SYS (cbrt, double, (double x));
+_GL_CXXALIASWARN (cbrt);
+#elif defined GNULIB_POSIXCHECK
+# undef cbrt
+# if HAVE_RAW_DECL_CBRT
+_GL_WARN_ON_USE (cbrt, "cbrt is unportable - "
+                 "use gnulib module cbrt for portability");
+# endif
+#endif
+
+#if @GNULIB_CBRTL@
+# if @REPLACE_CBRTL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef cbrtl
+#   define cbrtl rpl_cbrtl
+#  endif
+_GL_FUNCDECL_RPL (cbrtl, long double, (long double x));
+_GL_CXXALIAS_RPL (cbrtl, long double, (long double x));
+# else
+#  if !@HAVE_DECL_CBRTL@
+_GL_FUNCDECL_SYS (cbrtl, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (cbrtl, long double, (long double x));
+# endif
+_GL_CXXALIASWARN (cbrtl);
+#elif defined GNULIB_POSIXCHECK
+# undef cbrtl
+# if HAVE_RAW_DECL_CBRTL
+_GL_WARN_ON_USE (cbrtl, "cbrtl is unportable - "
+                 "use gnulib module cbrtl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_CEILF@
+# if @REPLACE_CEILF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ceilf
+#   define ceilf rpl_ceilf
+#  endif
+_GL_FUNCDECL_RPL (ceilf, float, (float x));
+_GL_CXXALIAS_RPL (ceilf, float, (float x));
+# else
+#  if !@HAVE_DECL_CEILF@
+#   undef ceilf
+_GL_FUNCDECL_SYS (ceilf, float, (float x));
+#  endif
+_GL_CXXALIAS_SYS (ceilf, float, (float x));
+# endif
+_GL_CXXALIASWARN (ceilf);
+#elif defined GNULIB_POSIXCHECK
+# undef ceilf
+# if HAVE_RAW_DECL_CEILF
+_GL_WARN_ON_USE (ceilf, "ceilf is unportable - "
+                 "use gnulib module ceilf for portability");
+# endif
+#endif
+
+#if @GNULIB_CEIL@
+# if @REPLACE_CEIL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define ceil rpl_ceil
+#  endif
+_GL_FUNCDECL_RPL (ceil, double, (double x));
+_GL_CXXALIAS_RPL (ceil, double, (double x));
+# else
+_GL_CXXALIAS_SYS (ceil, double, (double x));
+# endif
+_GL_CXXALIASWARN (ceil);
+#endif
+
+#if @GNULIB_CEILL@
+# if @REPLACE_CEILL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ceill
+#   define ceill rpl_ceill
+#  endif
+_GL_FUNCDECL_RPL (ceill, long double, (long double x));
+_GL_CXXALIAS_RPL (ceill, long double, (long double x));
+# else
+#  if !@HAVE_DECL_CEILL@
+#   undef ceill
+_GL_FUNCDECL_SYS (ceill, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (ceill, long double, (long double x));
+# endif
+_GL_CXXALIASWARN (ceill);
+#elif defined GNULIB_POSIXCHECK
+# undef ceill
+# if HAVE_RAW_DECL_CEILL
+_GL_WARN_ON_USE (ceill, "ceill is unportable - "
+                 "use gnulib module ceill for portability");
+# endif
+#endif
+
+
+#if @GNULIB_COPYSIGNF@
+# if !@HAVE_DECL_COPYSIGNF@
+_GL_FUNCDECL_SYS (copysignf, float, (float x, float y));
+# endif
+_GL_CXXALIAS_SYS (copysignf, float, (float x, float y));
+_GL_CXXALIASWARN (copysignf);
+#elif defined GNULIB_POSIXCHECK
+# undef copysignf
+# if HAVE_RAW_DECL_COPYSIGNF
+_GL_WARN_ON_USE (copysignf, "copysignf is unportable - "
+                 "use gnulib module copysignf for portability");
+# endif
+#endif
+
+#if @GNULIB_COPYSIGN@
+# if !@HAVE_COPYSIGN@
+_GL_FUNCDECL_SYS (copysign, double, (double x, double y));
+# endif
+_GL_CXXALIAS_SYS (copysign, double, (double x, double y));
+_GL_CXXALIASWARN (copysign);
+#elif defined GNULIB_POSIXCHECK
+# undef copysign
+# if HAVE_RAW_DECL_COPYSIGN
+_GL_WARN_ON_USE (copysign, "copysign is unportable - "
+                 "use gnulib module copysign for portability");
+# endif
+#endif
+
+#if @GNULIB_COPYSIGNL@
+# if !@HAVE_COPYSIGNL@
+_GL_FUNCDECL_SYS (copysignl, long double, (long double x, long double y));
+# endif
+_GL_CXXALIAS_SYS (copysignl, long double, (long double x, long double y));
+_GL_CXXALIASWARN (copysignl);
+#elif defined GNULIB_POSIXCHECK
+# undef copysignl
+# if HAVE_RAW_DECL_COPYSIGNL
+_GL_WARN_ON_USE (copysign, "copysignl is unportable - "
+                 "use gnulib module copysignl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_COSF@
+# if !@HAVE_COSF@
+#  undef cosf
+_GL_FUNCDECL_SYS (cosf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (cosf, float, (float x));
+_GL_CXXALIASWARN (cosf);
+#elif defined GNULIB_POSIXCHECK
+# undef cosf
+# if HAVE_RAW_DECL_COSF
+_GL_WARN_ON_USE (cosf, "cosf is unportable - "
+                 "use gnulib module cosf for portability");
+# endif
+#endif
+
+#if @GNULIB_COSL@
+# if !@HAVE_COSL@ || !@HAVE_DECL_COSL@
+#  undef cosl
+_GL_FUNCDECL_SYS (cosl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (cosl, long double, (long double x));
+_GL_CXXALIASWARN (cosl);
+#elif defined GNULIB_POSIXCHECK
+# undef cosl
+# if HAVE_RAW_DECL_COSL
+_GL_WARN_ON_USE (cosl, "cosl is unportable - "
+                 "use gnulib module cosl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_COSHF@
+# if !@HAVE_COSHF@
+#  undef coshf
+_GL_FUNCDECL_SYS (coshf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (coshf, float, (float x));
+_GL_CXXALIASWARN (coshf);
+#elif defined GNULIB_POSIXCHECK
+# undef coshf
+# if HAVE_RAW_DECL_COSHF
+_GL_WARN_ON_USE (coshf, "coshf is unportable - "
+                 "use gnulib module coshf for portability");
+# endif
+#endif
+
+
+#if @GNULIB_EXPF@
+# if !@HAVE_EXPF@
+#  undef expf
+_GL_FUNCDECL_SYS (expf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (expf, float, (float x));
+_GL_CXXALIASWARN (expf);
+#elif defined GNULIB_POSIXCHECK
+# undef expf
+# if HAVE_RAW_DECL_EXPF
+_GL_WARN_ON_USE (expf, "expf is unportable - "
+                 "use gnulib module expf for portability");
+# endif
+#endif
+
+#if @GNULIB_EXPL@
+# if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
+#  undef expl
+_GL_FUNCDECL_SYS (expl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (expl, long double, (long double x));
+_GL_CXXALIASWARN (expl);
+#elif defined GNULIB_POSIXCHECK
+# undef expl
+# if HAVE_RAW_DECL_EXPL
+_GL_WARN_ON_USE (expl, "expl is unportable - "
+                 "use gnulib module expl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_EXP2F@
+# if !@HAVE_DECL_EXP2F@
+_GL_FUNCDECL_SYS (exp2f, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (exp2f, float, (float x));
+_GL_CXXALIASWARN (exp2f);
+#elif defined GNULIB_POSIXCHECK
+# undef exp2f
+# if HAVE_RAW_DECL_EXP2F
+_GL_WARN_ON_USE (exp2f, "exp2f is unportable - "
+                 "use gnulib module exp2f for portability");
+# endif
+#endif
+
+#if @GNULIB_EXP2@
+# if @REPLACE_EXP2@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef exp2
+#   define exp2 rpl_exp2
+#  endif
+_GL_FUNCDECL_RPL (exp2, double, (double x));
+_GL_CXXALIAS_RPL (exp2, double, (double x));
+# else
+#  if !@HAVE_DECL_EXP2@
+_GL_FUNCDECL_SYS (exp2, double, (double x));
+#  endif
+_GL_CXXALIAS_SYS (exp2, double, (double x));
+# endif
+_GL_CXXALIASWARN (exp2);
+#elif defined GNULIB_POSIXCHECK
+# undef exp2
+# if HAVE_RAW_DECL_EXP2
+_GL_WARN_ON_USE (exp2, "exp2 is unportable - "
+                 "use gnulib module exp2 for portability");
+# endif
+#endif
+
+#if @GNULIB_EXP2L@
+# if @REPLACE_EXP2L@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef exp2l
+#   define exp2l rpl_exp2l
+#  endif
+_GL_FUNCDECL_RPL (exp2l, long double, (long double x));
+_GL_CXXALIAS_RPL (exp2l, long double, (long double x));
+# else
+#  if !@HAVE_DECL_EXP2L@
+#   undef exp2l
+_GL_FUNCDECL_SYS (exp2l, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (exp2l, long double, (long double x));
+# endif
+_GL_CXXALIASWARN (exp2l);
+#elif defined GNULIB_POSIXCHECK
+# undef exp2l
+# if HAVE_RAW_DECL_EXP2L
+_GL_WARN_ON_USE (exp2l, "exp2l is unportable - "
+                 "use gnulib module exp2l for portability");
+# endif
+#endif
+
+
+#if @GNULIB_EXPM1F@
+# if @REPLACE_EXPM1F@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef expm1f
+#   define expm1f rpl_expm1f
+#  endif
+_GL_FUNCDECL_RPL (expm1f, float, (float x));
+_GL_CXXALIAS_RPL (expm1f, float, (float x));
+# else
+#  if !@HAVE_EXPM1F@
+_GL_FUNCDECL_SYS (expm1f, float, (float x));
+#  endif
+_GL_CXXALIAS_SYS (expm1f, float, (float x));
+# endif
+_GL_CXXALIASWARN (expm1f);
+#elif defined GNULIB_POSIXCHECK
+# undef expm1f
+# if HAVE_RAW_DECL_EXPM1F
+_GL_WARN_ON_USE (expm1f, "expm1f is unportable - "
+                 "use gnulib module expm1f for portability");
+# endif
+#endif
+
+#if @GNULIB_EXPM1@
+# if @REPLACE_EXPM1@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef expm1
+#   define expm1 rpl_expm1
+#  endif
+_GL_FUNCDECL_RPL (expm1, double, (double x));
+_GL_CXXALIAS_RPL (expm1, double, (double x));
+# else
+#  if !@HAVE_EXPM1@
+_GL_FUNCDECL_SYS (expm1, double, (double x));
+#  endif
+_GL_CXXALIAS_SYS (expm1, double, (double x));
+# endif
+_GL_CXXALIASWARN (expm1);
+#elif defined GNULIB_POSIXCHECK
+# undef expm1
+# if HAVE_RAW_DECL_EXPM1
+_GL_WARN_ON_USE (expm1, "expm1 is unportable - "
+                 "use gnulib module expm1 for portability");
+# endif
+#endif
+
+#if @GNULIB_EXPM1L@
+# if !@HAVE_DECL_EXPM1L@
+#  undef expm1l
+_GL_FUNCDECL_SYS (expm1l, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (expm1l, long double, (long double x));
+_GL_CXXALIASWARN (expm1l);
+#elif defined GNULIB_POSIXCHECK
+# undef expm1l
+# if HAVE_RAW_DECL_EXPM1L
+_GL_WARN_ON_USE (expm1l, "expm1l is unportable - "
+                 "use gnulib module expm1l for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FABSF@
+# if !@HAVE_FABSF@
+#  undef fabsf
+_GL_FUNCDECL_SYS (fabsf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (fabsf, float, (float x));
+_GL_CXXALIASWARN (fabsf);
+#elif defined GNULIB_POSIXCHECK
+# undef fabsf
+# if HAVE_RAW_DECL_FABSF
+_GL_WARN_ON_USE (fabsf, "fabsf is unportable - "
+                 "use gnulib module fabsf for portability");
+# endif
+#endif
+
+#if @GNULIB_FABSL@
+# if @REPLACE_FABSL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fabsl
+#   define fabsl rpl_fabsl
+#  endif
+_GL_FUNCDECL_RPL (fabsl, long double, (long double x));
+_GL_CXXALIAS_RPL (fabsl, long double, (long double x));
+# else
+#  if !@HAVE_FABSL@
+#   undef fabsl
+_GL_FUNCDECL_SYS (fabsl, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (fabsl, long double, (long double x));
+# endif
+_GL_CXXALIASWARN (fabsl);
+#elif defined GNULIB_POSIXCHECK
+# undef fabsl
+# if HAVE_RAW_DECL_FABSL
+_GL_WARN_ON_USE (fabsl, "fabsl is unportable - "
+                 "use gnulib module fabsl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FLOORF@
+# if @REPLACE_FLOORF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef floorf
+#   define floorf rpl_floorf
+#  endif
+_GL_FUNCDECL_RPL (floorf, float, (float x));
+_GL_CXXALIAS_RPL (floorf, float, (float x));
+# else
+#  if !@HAVE_DECL_FLOORF@
+#   undef floorf
+_GL_FUNCDECL_SYS (floorf, float, (float x));
+#  endif
+_GL_CXXALIAS_SYS (floorf, float, (float x));
+# endif
+_GL_CXXALIASWARN (floorf);
+#elif defined GNULIB_POSIXCHECK
+# undef floorf
+# if HAVE_RAW_DECL_FLOORF
+_GL_WARN_ON_USE (floorf, "floorf is unportable - "
+                 "use gnulib module floorf for portability");
+# endif
+#endif
+
+#if @GNULIB_FLOOR@
+# if @REPLACE_FLOOR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define floor rpl_floor
+#  endif
+_GL_FUNCDECL_RPL (floor, double, (double x));
+_GL_CXXALIAS_RPL (floor, double, (double x));
+# else
+_GL_CXXALIAS_SYS (floor, double, (double x));
+# endif
+_GL_CXXALIASWARN (floor);
+#endif
+
+#if @GNULIB_FLOORL@
+# if @REPLACE_FLOORL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef floorl
+#   define floorl rpl_floorl
+#  endif
+_GL_FUNCDECL_RPL (floorl, long double, (long double x));
+_GL_CXXALIAS_RPL (floorl, long double, (long double x));
+# else
+#  if !@HAVE_DECL_FLOORL@
+#   undef floorl
+_GL_FUNCDECL_SYS (floorl, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (floorl, long double, (long double x));
+# endif
+_GL_CXXALIASWARN (floorl);
+#elif defined GNULIB_POSIXCHECK
+# undef floorl
+# if HAVE_RAW_DECL_FLOORL
+_GL_WARN_ON_USE (floorl, "floorl is unportable - "
+                 "use gnulib module floorl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FMAF@
+# if @REPLACE_FMAF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fmaf
+#   define fmaf rpl_fmaf
+#  endif
+_GL_FUNCDECL_RPL (fmaf, float, (float x, float y, float z));
+_GL_CXXALIAS_RPL (fmaf, float, (float x, float y, float z));
+# else
+#  if !@HAVE_FMAF@
+_GL_FUNCDECL_SYS (fmaf, float, (float x, float y, float z));
+#  endif
+_GL_CXXALIAS_SYS (fmaf, float, (float x, float y, float z));
+# endif
+_GL_CXXALIASWARN (fmaf);
+#elif defined GNULIB_POSIXCHECK
+# undef fmaf
+# if HAVE_RAW_DECL_FMAF
+_GL_WARN_ON_USE (fmaf, "fmaf is unportable - "
+                 "use gnulib module fmaf for portability");
+# endif
+#endif
+
+#if @GNULIB_FMA@
+# if @REPLACE_FMA@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fma
+#   define fma rpl_fma
+#  endif
+_GL_FUNCDECL_RPL (fma, double, (double x, double y, double z));
+_GL_CXXALIAS_RPL (fma, double, (double x, double y, double z));
+# else
+#  if !@HAVE_FMA@
+_GL_FUNCDECL_SYS (fma, double, (double x, double y, double z));
+#  endif
+_GL_CXXALIAS_SYS (fma, double, (double x, double y, double z));
+# endif
+_GL_CXXALIASWARN (fma);
+#elif defined GNULIB_POSIXCHECK
+# undef fma
+# if HAVE_RAW_DECL_FMA
+_GL_WARN_ON_USE (fma, "fma is unportable - "
+                 "use gnulib module fma for portability");
+# endif
+#endif
+
+#if @GNULIB_FMAL@
+# if @REPLACE_FMAL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fmal
+#   define fmal rpl_fmal
+#  endif
+_GL_FUNCDECL_RPL (fmal, long double,
+                  (long double x, long double y, long double z));
+_GL_CXXALIAS_RPL (fmal, long double,
+                  (long double x, long double y, long double z));
+# else
+#  if !@HAVE_FMAL@
+#   undef fmal
+_GL_FUNCDECL_SYS (fmal, long double,
+                  (long double x, long double y, long double z));
+#  endif
+_GL_CXXALIAS_SYS (fmal, long double,
+                  (long double x, long double y, long double z));
+# endif
+_GL_CXXALIASWARN (fmal);
+#elif defined GNULIB_POSIXCHECK
+# undef fmal
+# if HAVE_RAW_DECL_FMAL
+_GL_WARN_ON_USE (fmal, "fmal is unportable - "
+                 "use gnulib module fmal for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FMODF@
+# if @REPLACE_FMODF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fmodf
+#   define fmodf rpl_fmodf
+#  endif
+_GL_FUNCDECL_RPL (fmodf, float, (float x, float y));
+_GL_CXXALIAS_RPL (fmodf, float, (float x, float y));
+# else
+#  if !@HAVE_FMODF@
+#   undef fmodf
+_GL_FUNCDECL_SYS (fmodf, float, (float x, float y));
+#  endif
+_GL_CXXALIAS_SYS (fmodf, float, (float x, float y));
+# endif
+_GL_CXXALIASWARN (fmodf);
+#elif defined GNULIB_POSIXCHECK
+# undef fmodf
+# if HAVE_RAW_DECL_FMODF
+_GL_WARN_ON_USE (fmodf, "fmodf is unportable - "
+                 "use gnulib module fmodf for portability");
+# endif
+#endif
+
+#if @GNULIB_FMOD@
+# if @REPLACE_FMOD@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fmod
+#   define fmod rpl_fmod
+#  endif
+_GL_FUNCDECL_RPL (fmod, double, (double x, double y));
+_GL_CXXALIAS_RPL (fmod, double, (double x, double y));
+# else
+_GL_CXXALIAS_SYS (fmod, double, (double x, double y));
+# endif
+_GL_CXXALIASWARN (fmod);
+#elif defined GNULIB_POSIXCHECK
+# undef fmod
+# if HAVE_RAW_DECL_FMOD
+_GL_WARN_ON_USE (fmod, "fmod has portability problems - "
+                 "use gnulib module fmod for portability");
+# endif
+#endif
+
+#if @GNULIB_FMODL@
+# if @REPLACE_FMODL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fmodl
+#   define fmodl rpl_fmodl
+#  endif
+_GL_FUNCDECL_RPL (fmodl, long double, (long double x, long double y));
+_GL_CXXALIAS_RPL (fmodl, long double, (long double x, long double y));
+# else
+#  if !@HAVE_FMODL@
+#   undef fmodl
+_GL_FUNCDECL_SYS (fmodl, long double, (long double x, long double y));
+#  endif
+_GL_CXXALIAS_SYS (fmodl, long double, (long double x, long double y));
+# endif
+_GL_CXXALIASWARN (fmodl);
+#elif defined GNULIB_POSIXCHECK
+# undef fmodl
+# if HAVE_RAW_DECL_FMODL
+_GL_WARN_ON_USE (fmodl, "fmodl is unportable - "
+                 "use gnulib module fmodl for portability");
+# endif
+#endif
+
+
+/* Write x as
+     x = mantissa * 2^exp
+   where
+     If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
+     If x is zero: mantissa = x, exp = 0.
+     If x is infinite or NaN: mantissa = x, exp unspecified.
+   Store exp in *EXPPTR and return mantissa.  */
+#if @GNULIB_FREXPF@
+# if @REPLACE_FREXPF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef frexpf
+#   define frexpf rpl_frexpf
+#  endif
+_GL_FUNCDECL_RPL (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (frexpf, float, (float x, int *expptr));
+# else
+#  if !@HAVE_FREXPF@
+#   undef frexpf
+_GL_FUNCDECL_SYS (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (frexpf, float, (float x, int *expptr));
+# endif
+_GL_CXXALIASWARN (frexpf);
+#elif defined GNULIB_POSIXCHECK
+# undef frexpf
+# if HAVE_RAW_DECL_FREXPF
+_GL_WARN_ON_USE (frexpf, "frexpf is unportable - "
+                 "use gnulib module frexpf for portability");
+# endif
+#endif
+
+/* Write x as
+     x = mantissa * 2^exp
+   where
+     If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
+     If x is zero: mantissa = x, exp = 0.
+     If x is infinite or NaN: mantissa = x, exp unspecified.
+   Store exp in *EXPPTR and return mantissa.  */
+#if @GNULIB_FREXP@
+# if @REPLACE_FREXP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define frexp rpl_frexp
+#  endif
+_GL_FUNCDECL_RPL (frexp, double, (double x, int *expptr) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr));
+# else
+_GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
+# endif
+_GL_CXXALIASWARN (frexp);
+#elif defined GNULIB_POSIXCHECK
+# undef frexp
+/* Assume frexp is always declared.  */
+_GL_WARN_ON_USE (frexp, "frexp is unportable - "
+                 "use gnulib module frexp for portability");
+#endif
+
+/* Write x as
+     x = mantissa * 2^exp
+   where
+     If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
+     If x is zero: mantissa = x, exp = 0.
+     If x is infinite or NaN: mantissa = x, exp unspecified.
+   Store exp in *EXPPTR and return mantissa.  */
+#if @GNULIB_FREXPL@ && @REPLACE_FREXPL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  undef frexpl
+#  define frexpl rpl_frexpl
+# endif
+_GL_FUNCDECL_RPL (frexpl, long double,
+                  (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (frexpl, long double, (long double x, int *expptr));
+#else
+# if !@HAVE_DECL_FREXPL@
+_GL_FUNCDECL_SYS (frexpl, long double,
+                  (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
+# endif
+# if @GNULIB_FREXPL@
+_GL_CXXALIAS_SYS (frexpl, long double, (long double x, int *expptr));
+# endif
+#endif
+#if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@)
+_GL_CXXALIASWARN (frexpl);
+#endif
+#if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
+# undef frexpl
+# if HAVE_RAW_DECL_FREXPL
+_GL_WARN_ON_USE (frexpl, "frexpl is unportable - "
+                 "use gnulib module frexpl for portability");
+# endif
+#endif
+
+
+/* Return sqrt(x^2+y^2).  */
+#if @GNULIB_HYPOTF@
+# if @REPLACE_HYPOTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef hypotf
+#   define hypotf rpl_hypotf
+#  endif
+_GL_FUNCDECL_RPL (hypotf, float, (float x, float y));
+_GL_CXXALIAS_RPL (hypotf, float, (float x, float y));
+# else
+#  if !@HAVE_HYPOTF@
+_GL_FUNCDECL_SYS (hypotf, float, (float x, float y));
+#  endif
+_GL_CXXALIAS_SYS (hypotf, float, (float x, float y));
+# endif
+_GL_CXXALIASWARN (hypotf);
+#elif defined GNULIB_POSIXCHECK
+# undef hypotf
+# if HAVE_RAW_DECL_HYPOTF
+_GL_WARN_ON_USE (hypotf, "hypotf is unportable - "
+                 "use gnulib module hypotf for portability");
+# endif
+#endif
+
+/* Return sqrt(x^2+y^2).  */
+#if @GNULIB_HYPOT@
+# if @REPLACE_HYPOT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef hypot
+#   define hypot rpl_hypot
+#  endif
+_GL_FUNCDECL_RPL (hypot, double, (double x, double y));
+_GL_CXXALIAS_RPL (hypot, double, (double x, double y));
+# else
+_GL_CXXALIAS_SYS (hypot, double, (double x, double y));
+# endif
+_GL_CXXALIASWARN (hypot);
+#elif defined GNULIB_POSIXCHECK
+# undef hypot
+# if HAVE_RAW_DECL_HYPOT
+_GL_WARN_ON_USE (hypotf, "hypot has portability problems - "
+                 "use gnulib module hypot for portability");
+# endif
+#endif
+
+/* Return sqrt(x^2+y^2).  */
+#if @GNULIB_HYPOTL@
+# if @REPLACE_HYPOTL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef hypotl
+#   define hypotl rpl_hypotl
+#  endif
+_GL_FUNCDECL_RPL (hypotl, long double, (long double x, long double y));
+_GL_CXXALIAS_RPL (hypotl, long double, (long double x, long double y));
+# else
+#  if !@HAVE_HYPOTL@
+_GL_FUNCDECL_SYS (hypotl, long double, (long double x, long double y));
+#  endif
+_GL_CXXALIAS_SYS (hypotl, long double, (long double x, long double y));
+# endif
+_GL_CXXALIASWARN (hypotl);
+#elif defined GNULIB_POSIXCHECK
+# undef hypotl
+# if HAVE_RAW_DECL_HYPOTL
+_GL_WARN_ON_USE (hypotl, "hypotl is unportable - "
+                 "use gnulib module hypotl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ILOGBF@
+# if @REPLACE_ILOGBF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ilogbf
+#   define ilogbf rpl_ilogbf
+#  endif
+_GL_FUNCDECL_RPL (ilogbf, int, (float x));
+_GL_CXXALIAS_RPL (ilogbf, int, (float x));
+# else
+#  if !@HAVE_ILOGBF@
+_GL_FUNCDECL_SYS (ilogbf, int, (float x));
+#  endif
+_GL_CXXALIAS_SYS (ilogbf, int, (float x));
+# endif
+_GL_CXXALIASWARN (ilogbf);
+#elif defined GNULIB_POSIXCHECK
+# undef ilogbf
+# if HAVE_RAW_DECL_ILOGBF
+_GL_WARN_ON_USE (ilogbf, "ilogbf is unportable - "
+                 "use gnulib module ilogbf for portability");
+# endif
+#endif
+
+#if @GNULIB_ILOGB@
+# if @REPLACE_ILOGB@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ilogb
+#   define ilogb rpl_ilogb
+#  endif
+_GL_FUNCDECL_RPL (ilogb, int, (double x));
+_GL_CXXALIAS_RPL (ilogb, int, (double x));
+# else
+#  if !@HAVE_ILOGB@
+_GL_FUNCDECL_SYS (ilogb, int, (double x));
+#  endif
+_GL_CXXALIAS_SYS (ilogb, int, (double x));
+# endif
+_GL_CXXALIASWARN (ilogb);
+#elif defined GNULIB_POSIXCHECK
+# undef ilogb
+# if HAVE_RAW_DECL_ILOGB
+_GL_WARN_ON_USE (ilogb, "ilogb is unportable - "
+                 "use gnulib module ilogb for portability");
+# endif
+#endif
+
+#if @GNULIB_ILOGBL@
+# if !@HAVE_ILOGBL@
+_GL_FUNCDECL_SYS (ilogbl, int, (long double x));
+# endif
+_GL_CXXALIAS_SYS (ilogbl, int, (long double x));
+_GL_CXXALIASWARN (ilogbl);
+#elif defined GNULIB_POSIXCHECK
+# undef ilogbl
+# if HAVE_RAW_DECL_ILOGBL
+_GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - "
+                 "use gnulib module ilogbl for portability");
+# endif
+#endif
+
+
+/* Return x * 2^exp.  */
+#if @GNULIB_LDEXPF@
+# if !@HAVE_LDEXPF@
+#  undef ldexpf
+_GL_FUNCDECL_SYS (ldexpf, float, (float x, int exp));
+# endif
+_GL_CXXALIAS_SYS (ldexpf, float, (float x, int exp));
+_GL_CXXALIASWARN (ldexpf);
+#elif defined GNULIB_POSIXCHECK
+# undef ldexpf
+# if HAVE_RAW_DECL_LDEXPF
+_GL_WARN_ON_USE (ldexpf, "ldexpf is unportable - "
+                 "use gnulib module ldexpf for portability");
+# endif
+#endif
+
+/* Return x * 2^exp.  */
+#if @GNULIB_LDEXPL@ && @REPLACE_LDEXPL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  undef ldexpl
+#  define ldexpl rpl_ldexpl
+# endif
+_GL_FUNCDECL_RPL (ldexpl, long double, (long double x, int exp));
+_GL_CXXALIAS_RPL (ldexpl, long double, (long double x, int exp));
+#else
+# if !@HAVE_DECL_LDEXPL@
+_GL_FUNCDECL_SYS (ldexpl, long double, (long double x, int exp));
+# endif
+# if @GNULIB_LDEXPL@
+_GL_CXXALIAS_SYS (ldexpl, long double, (long double x, int exp));
+# endif
+#endif
+#if @GNULIB_LDEXPL@
+_GL_CXXALIASWARN (ldexpl);
+#endif
+#if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK
+# undef ldexpl
+# if HAVE_RAW_DECL_LDEXPL
+_GL_WARN_ON_USE (ldexpl, "ldexpl is unportable - "
+                 "use gnulib module ldexpl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LOGF@
+# if @REPLACE_LOGF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef logf
+#   define logf rpl_logf
+#  endif
+_GL_FUNCDECL_RPL (logf, float, (float x));
+_GL_CXXALIAS_RPL (logf, float, (float x));
+# else
+#  if !@HAVE_LOGF@
+#   undef logf
+_GL_FUNCDECL_SYS (logf, float, (float x));
+#  endif
+_GL_CXXALIAS_SYS (logf, float, (float x));
+# endif
+_GL_CXXALIASWARN (logf);
+#elif defined GNULIB_POSIXCHECK
+# undef logf
+# if HAVE_RAW_DECL_LOGF
+_GL_WARN_ON_USE (logf, "logf is unportable - "
+                 "use gnulib module logf for portability");
+# endif
+#endif
+
+#if @GNULIB_LOG@
+# if @REPLACE_LOG@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef log
+#   define log rpl_log
+#  endif
+_GL_FUNCDECL_RPL (log, double, (double x));
+_GL_CXXALIAS_RPL (log, double, (double x));
+# else
+_GL_CXXALIAS_SYS (log, double, (double x));
+# endif
+_GL_CXXALIASWARN (log);
+#elif defined GNULIB_POSIXCHECK
+# undef log
+# if HAVE_RAW_DECL_LOG
+_GL_WARN_ON_USE (log, "log has portability problems - "
+                 "use gnulib module log for portability");
+# endif
+#endif
+
+#if @GNULIB_LOGL@
+# if @REPLACE_LOGL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef logl
+#   define logl rpl_logl
+#  endif
+_GL_FUNCDECL_RPL (logl, long double, (long double x));
+_GL_CXXALIAS_RPL (logl, long double, (long double x));
+# else
+#  if !@HAVE_LOGL@ || !@HAVE_DECL_LOGL@
+#   undef logl
+_GL_FUNCDECL_SYS (logl, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (logl, long double, (long double x));
+# endif
+_GL_CXXALIASWARN (logl);
+#elif defined GNULIB_POSIXCHECK
+# undef logl
+# if HAVE_RAW_DECL_LOGL
+_GL_WARN_ON_USE (logl, "logl is unportable - "
+                 "use gnulib module logl for portability");
+# endif
 #endif
 
 
-/* POSIX allows platforms that don't support NAN.  But all major
-   machines in the past 15 years have supported something close to
-   IEEE NaN, so we define this unconditionally.  We also must define
-   it on platforms like Solaris 10, where NAN is present but defined
-   as a function pointer rather than a floating point constant.  */
-#if !defined NAN || @REPLACE_NAN@
-# undef NAN
-  /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
-# ifdef __DECC
-static float
-_NaN ()
-{
-  static float zero = 0.0f;
-  return zero / zero;
-}
-#  define NAN (_NaN())
+#if @GNULIB_LOG10F@
+# if @REPLACE_LOG10F@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef log10f
+#   define log10f rpl_log10f
+#  endif
+_GL_FUNCDECL_RPL (log10f, float, (float x));
+_GL_CXXALIAS_RPL (log10f, float, (float x));
 # else
-#  define NAN (0.0f / 0.0f)
+#  if !@HAVE_LOG10F@
+#   undef log10f
+_GL_FUNCDECL_SYS (log10f, float, (float x));
+#  endif
+_GL_CXXALIAS_SYS (log10f, float, (float x));
+# endif
+_GL_CXXALIASWARN (log10f);
+#elif defined GNULIB_POSIXCHECK
+# undef log10f
+# if HAVE_RAW_DECL_LOG10F
+_GL_WARN_ON_USE (log10f, "log10f is unportable - "
+                 "use gnulib module log10f for portability");
 # endif
 #endif
 
-/* Solaris 10 defines HUGE_VAL, but as a function pointer rather
-   than a floating point constant.  */
-#if @REPLACE_HUGE_VAL@
-# undef HUGE_VAL
-# define HUGE_VAL (1.0 / 0.0)
+#if @GNULIB_LOG10@
+# if @REPLACE_LOG10@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef log10
+#   define log10 rpl_log10
+#  endif
+_GL_FUNCDECL_RPL (log10, double, (double x));
+_GL_CXXALIAS_RPL (log10, double, (double x));
+# else
+_GL_CXXALIAS_SYS (log10, double, (double x));
+# endif
+_GL_CXXALIASWARN (log10);
+#elif defined GNULIB_POSIXCHECK
+# undef log10
+# if HAVE_RAW_DECL_LOG10
+_GL_WARN_ON_USE (log10, "log10 has portability problems - "
+                 "use gnulib module log10 for portability");
+# endif
 #endif
 
-/* Write x as
-     x = mantissa * 2^exp
-   where
-     If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
-     If x is zero: mantissa = x, exp = 0.
-     If x is infinite or NaN: mantissa = x, exp unspecified.
-   Store exp in *EXPPTR and return mantissa.  */
-#if @GNULIB_FREXP@
-# if @REPLACE_FREXP@
-#  define frexp rpl_frexp
-extern double frexp (double x, int *expptr) _GL_ARG_NONNULL ((2));
+#if @GNULIB_LOG10L@
+# if @REPLACE_LOG10L@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef log10l
+#   define log10l rpl_log10l
+#  endif
+_GL_FUNCDECL_RPL (log10l, long double, (long double x));
+_GL_CXXALIAS_RPL (log10l, long double, (long double x));
+# else
+#  if !@HAVE_LOG10L@ || !@HAVE_DECL_LOG10L@
+#   undef log10l
+_GL_FUNCDECL_SYS (log10l, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (log10l, long double, (long double x));
 # endif
+_GL_CXXALIASWARN (log10l);
 #elif defined GNULIB_POSIXCHECK
-# undef frexp
-# define frexp(x,e) \
-    (GL_LINK_WARNING ("frexp is unportable - " \
-                      "use gnulib module frexp for portability"), \
-     frexp (x, e))
+# undef log10l
+# if HAVE_RAW_DECL_LOG10L
+_GL_WARN_ON_USE (log10l, "log10l is unportable - "
+                 "use gnulib module log10l for portability");
+# endif
 #endif
 
 
-#if @GNULIB_ACOSL@
-# if !@HAVE_ACOSL@ || !@HAVE_DECL_ACOSL@
-extern long double acosl (long double x);
+#if @GNULIB_LOG1PF@
+# if @REPLACE_LOG1PF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef log1pf
+#   define log1pf rpl_log1pf
+#  endif
+_GL_FUNCDECL_RPL (log1pf, float, (float x));
+_GL_CXXALIAS_RPL (log1pf, float, (float x));
+# else
+#  if !@HAVE_LOG1PF@
+_GL_FUNCDECL_SYS (log1pf, float, (float x));
+#  endif
+_GL_CXXALIAS_SYS (log1pf, float, (float x));
 # endif
+_GL_CXXALIASWARN (log1pf);
 #elif defined GNULIB_POSIXCHECK
-# undef acosl
-# define acosl(x) \
-    (GL_LINK_WARNING ("acosl is unportable - " \
-                      "use gnulib module mathl for portability"), \
-     acosl (x))
+# undef log1pf
+# if HAVE_RAW_DECL_LOG1PF
+_GL_WARN_ON_USE (log1pf, "log1pf is unportable - "
+                 "use gnulib module log1pf for portability");
+# endif
 #endif
 
+#if @GNULIB_LOG1P@
+# if @REPLACE_LOG1P@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef log1p
+#   define log1p rpl_log1p
+#  endif
+_GL_FUNCDECL_RPL (log1p, double, (double x));
+_GL_CXXALIAS_RPL (log1p, double, (double x));
+# else
+#  if !@HAVE_LOG1P@
+_GL_FUNCDECL_SYS (log1p, double, (double x));
+#  endif
+_GL_CXXALIAS_SYS (log1p, double, (double x));
+# endif
+_GL_CXXALIASWARN (log1p);
+#elif defined GNULIB_POSIXCHECK
+# undef log1p
+# if HAVE_RAW_DECL_LOG1P
+_GL_WARN_ON_USE (log1p, "log1p has portability problems - "
+                 "use gnulib module log1p for portability");
+# endif
+#endif
 
-#if @GNULIB_ASINL@
-# if !@HAVE_ASINL@ || !@HAVE_DECL_ASINL@
-extern long double asinl (long double x);
+#if @GNULIB_LOG1PL@
+# if @REPLACE_LOG1PL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef log1pl
+#   define log1pl rpl_log1pl
+#  endif
+_GL_FUNCDECL_RPL (log1pl, long double, (long double x));
+_GL_CXXALIAS_RPL (log1pl, long double, (long double x));
+# else
+#  if !@HAVE_LOG1PL@
+_GL_FUNCDECL_SYS (log1pl, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (log1pl, long double, (long double x));
 # endif
+_GL_CXXALIASWARN (log1pl);
 #elif defined GNULIB_POSIXCHECK
-# undef asinl
-# define asinl(x) \
-    (GL_LINK_WARNING ("asinl is unportable - " \
-                      "use gnulib module mathl for portability"), \
-     asinl (x))
+# undef log1pl
+# if HAVE_RAW_DECL_LOG1PL
+_GL_WARN_ON_USE (log1pl, "log1pl has portability problems - "
+                 "use gnulib module log1pl for portability");
+# endif
 #endif
 
 
-#if @GNULIB_ATANL@
-# if !@HAVE_ATANL@ || !@HAVE_DECL_ATANL@
-extern long double atanl (long double x);
+#if @GNULIB_LOG2F@
+# if @REPLACE_LOG2F@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef log2f
+#   define log2f rpl_log2f
+#  endif
+_GL_FUNCDECL_RPL (log2f, float, (float x));
+_GL_CXXALIAS_RPL (log2f, float, (float x));
+# else
+#  if !@HAVE_DECL_LOG2F@
+#   undef log2f
+_GL_FUNCDECL_SYS (log2f, float, (float x));
+#  endif
+_GL_CXXALIAS_SYS (log2f, float, (float x));
 # endif
+_GL_CXXALIASWARN (log2f);
 #elif defined GNULIB_POSIXCHECK
-# undef atanl
-# define atanl(x) \
-    (GL_LINK_WARNING ("atanl is unportable - " \
-                      "use gnulib module mathl for portability"), \
-     atanl (x))
+# undef log2f
+# if HAVE_RAW_DECL_LOG2F
+_GL_WARN_ON_USE (log2f, "log2f is unportable - "
+                 "use gnulib module log2f for portability");
+# endif
 #endif
 
-
-#if @GNULIB_CEILF@
-# if @REPLACE_CEILF@
-#  define ceilf rpl_ceilf
-extern float ceilf (float x);
+#if @GNULIB_LOG2@
+# if @REPLACE_LOG2@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef log2
+#   define log2 rpl_log2
+#  endif
+_GL_FUNCDECL_RPL (log2, double, (double x));
+_GL_CXXALIAS_RPL (log2, double, (double x));
+# else
+#  if !@HAVE_DECL_LOG2@
+#   undef log2
+_GL_FUNCDECL_SYS (log2, double, (double x));
+#  endif
+_GL_CXXALIAS_SYS (log2, double, (double x));
 # endif
+_GL_CXXALIASWARN (log2);
 #elif defined GNULIB_POSIXCHECK
-# undef ceilf
-# define ceilf(x) \
-    (GL_LINK_WARNING ("ceilf is unportable - " \
-                      "use gnulib module ceilf for portability"), \
-     ceilf (x))
+# undef log2
+# if HAVE_RAW_DECL_LOG2
+_GL_WARN_ON_USE (log2, "log2 is unportable - "
+                 "use gnulib module log2 for portability");
+# endif
 #endif
 
-#if @GNULIB_CEILL@
-# if @REPLACE_CEILL@
-#  define ceill rpl_ceill
-extern long double ceill (long double x);
+#if @GNULIB_LOG2L@
+# if @REPLACE_LOG2L@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef log2l
+#   define log2l rpl_log2l
+#  endif
+_GL_FUNCDECL_RPL (log2l, long double, (long double x));
+_GL_CXXALIAS_RPL (log2l, long double, (long double x));
+# else
+#  if !@HAVE_DECL_LOG2L@
+_GL_FUNCDECL_SYS (log2l, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (log2l, long double, (long double x));
 # endif
+_GL_CXXALIASWARN (log2l);
 #elif defined GNULIB_POSIXCHECK
-# undef ceill
-# define ceill(x) \
-    (GL_LINK_WARNING ("ceill is unportable - " \
-                      "use gnulib module ceill for portability"), \
-     ceill (x))
+# undef log2l
+# if HAVE_RAW_DECL_LOG2L
+_GL_WARN_ON_USE (log2l, "log2l is unportable - "
+                 "use gnulib module log2l for portability");
+# endif
 #endif
 
 
-#if @GNULIB_COSL@
-# if !@HAVE_COSL@
-#  undef cosl
-#  define cosl rpl_cosl
-# endif
-# if !@HAVE_COSL@ || !@HAVE_DECL_COSL@
-extern long double cosl (long double x);
+#if @GNULIB_LOGBF@
+# if @REPLACE_LOGBF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef logbf
+#   define logbf rpl_logbf
+#  endif
+_GL_FUNCDECL_RPL (logbf, float, (float x));
+_GL_CXXALIAS_RPL (logbf, float, (float x));
+# else
+#  if !@HAVE_LOGBF@
+_GL_FUNCDECL_SYS (logbf, float, (float x));
+#  endif
+_GL_CXXALIAS_SYS (logbf, float, (float x));
 # endif
+_GL_CXXALIASWARN (logbf);
 #elif defined GNULIB_POSIXCHECK
-# undef cosl
-# define cosl(x) \
-    (GL_LINK_WARNING ("cosl is unportable - " \
-                      "use gnulib module mathl for portability"), \
-     cosl (x))
+# undef logbf
+# if HAVE_RAW_DECL_LOGBF
+_GL_WARN_ON_USE (logbf, "logbf is unportable - "
+                 "use gnulib module logbf for portability");
+# endif
 #endif
 
+#if @GNULIB_LOGB@
+# if @REPLACE_LOGB@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef logb
+#   define logb rpl_logb
+#  endif
+_GL_FUNCDECL_RPL (logb, double, (double x));
+_GL_CXXALIAS_RPL (logb, double, (double x));
+# else
+#  if !@HAVE_DECL_LOGB@
+_GL_FUNCDECL_SYS (logb, double, (double x));
+#  endif
+_GL_CXXALIAS_SYS (logb, double, (double x));
+# endif
+_GL_CXXALIASWARN (logb);
+#elif defined GNULIB_POSIXCHECK
+# undef logb
+# if HAVE_RAW_DECL_LOGB
+_GL_WARN_ON_USE (logb, "logb is unportable - "
+                 "use gnulib module logb for portability");
+# endif
+#endif
 
-#if @GNULIB_EXPL@
-# if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
-extern long double expl (long double x);
+#if @GNULIB_LOGBL@
+# if @REPLACE_LOGBL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef logbl
+#   define logbl rpl_logbl
+#  endif
+_GL_FUNCDECL_RPL (logbl, long double, (long double x));
+_GL_CXXALIAS_RPL (logbl, long double, (long double x));
+# else
+#  if !@HAVE_LOGBL@
+_GL_FUNCDECL_SYS (logbl, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (logbl, long double, (long double x));
 # endif
+_GL_CXXALIASWARN (logbl);
 #elif defined GNULIB_POSIXCHECK
-# undef expl
-# define expl(x) \
-    (GL_LINK_WARNING ("expl is unportable - " \
-                      "use gnulib module mathl for portability"), \
-     expl (x))
+# undef logbl
+# if HAVE_RAW_DECL_LOGBL
+_GL_WARN_ON_USE (logbl, "logbl is unportable - "
+                 "use gnulib module logbl for portability");
+# endif
 #endif
 
 
-#if @GNULIB_FLOORF@
-# if @REPLACE_FLOORF@
-#  define floorf rpl_floorf
-extern float floorf (float x);
+#if @GNULIB_MODFF@
+# if @REPLACE_MODFF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef modff
+#   define modff rpl_modff
+#  endif
+_GL_FUNCDECL_RPL (modff, float, (float x, float *iptr) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (modff, float, (float x, float *iptr));
+# else
+#  if !@HAVE_MODFF@
+#   undef modff
+_GL_FUNCDECL_SYS (modff, float, (float x, float *iptr) _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (modff, float, (float x, float *iptr));
 # endif
+_GL_CXXALIASWARN (modff);
 #elif defined GNULIB_POSIXCHECK
-# undef floorf
-# define floorf(x) \
-    (GL_LINK_WARNING ("floorf is unportable - " \
-                      "use gnulib module floorf for portability"), \
-     floorf (x))
+# undef modff
+# if HAVE_RAW_DECL_MODFF
+_GL_WARN_ON_USE (modff, "modff is unportable - "
+                 "use gnulib module modff for portability");
+# endif
 #endif
 
-#if @GNULIB_FLOORL@
-# if @REPLACE_FLOORL@
-#  define floorl rpl_floorl
-extern long double floorl (long double x);
+#if @GNULIB_MODF@
+# if @REPLACE_MODF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef modf
+#   define modf rpl_modf
+#  endif
+_GL_FUNCDECL_RPL (modf, double, (double x, double *iptr) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (modf, double, (double x, double *iptr));
+# else
+_GL_CXXALIAS_SYS (modf, double, (double x, double *iptr));
 # endif
+_GL_CXXALIASWARN (modf);
 #elif defined GNULIB_POSIXCHECK
-# undef floorl
-# define floorl(x) \
-    (GL_LINK_WARNING ("floorl is unportable - " \
-                      "use gnulib module floorl for portability"), \
-     floorl (x))
+# undef modf
+# if HAVE_RAW_DECL_MODF
+_GL_WARN_ON_USE (modf, "modf has portability problems - "
+                 "use gnulib module modf for portability");
+# endif
 #endif
 
-
-/* Write x as
-     x = mantissa * 2^exp
-   where
-     If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
-     If x is zero: mantissa = x, exp = 0.
-     If x is infinite or NaN: mantissa = x, exp unspecified.
-   Store exp in *EXPPTR and return mantissa.  */
-#if @GNULIB_FREXPL@ && @REPLACE_FREXPL@
-# define frexpl rpl_frexpl
-#endif
-#if (@GNULIB_FREXPL@ && @REPLACE_FREXPL@) || !@HAVE_DECL_FREXPL@
-extern long double frexpl (long double x, int *expptr) _GL_ARG_NONNULL ((2));
+#if @GNULIB_MODFL@
+# if @REPLACE_MODFL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef modfl
+#   define modfl rpl_modfl
+#  endif
+_GL_FUNCDECL_RPL (modfl, long double, (long double x, long double *iptr)
+                                      _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (modfl, long double, (long double x, long double *iptr));
+# else
+#  if !@HAVE_MODFL@
+#   undef modfl
+_GL_FUNCDECL_SYS (modfl, long double, (long double x, long double *iptr)
+                                      _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (modfl, long double, (long double x, long double *iptr));
+# endif
+_GL_CXXALIASWARN (modfl);
+#elif defined GNULIB_POSIXCHECK
+# undef modfl
+# if HAVE_RAW_DECL_MODFL
+_GL_WARN_ON_USE (modfl, "modfl is unportable - "
+                 "use gnulib module modfl for portability");
+# endif
 #endif
-#if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
-# undef frexpl
-# define frexpl(x,e) \
-    (GL_LINK_WARNING ("frexpl is unportable - " \
-                      "use gnulib module frexpl for portability"), \
-     frexpl (x, e))
+
+
+#if @GNULIB_POWF@
+# if !@HAVE_POWF@
+#  undef powf
+_GL_FUNCDECL_SYS (powf, float, (float x, float y));
+# endif
+_GL_CXXALIAS_SYS (powf, float, (float x, float y));
+_GL_CXXALIASWARN (powf);
+#elif defined GNULIB_POSIXCHECK
+# undef powf
+# if HAVE_RAW_DECL_POWF
+_GL_WARN_ON_USE (powf, "powf is unportable - "
+                 "use gnulib module powf for portability");
+# endif
 #endif
 
 
-/* Return x * 2^exp.  */
-#if @GNULIB_LDEXPL@ && @REPLACE_LDEXPL@
-# define ldexpl rpl_ldexpl
+#if @GNULIB_REMAINDERF@
+# if @REPLACE_REMAINDERF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef remainderf
+#   define remainderf rpl_remainderf
+#  endif
+_GL_FUNCDECL_RPL (remainderf, float, (float x, float y));
+_GL_CXXALIAS_RPL (remainderf, float, (float x, float y));
+# else
+#  if !@HAVE_REMAINDERF@
+_GL_FUNCDECL_SYS (remainderf, float, (float x, float y));
+#  endif
+_GL_CXXALIAS_SYS (remainderf, float, (float x, float y));
+# endif
+_GL_CXXALIASWARN (remainderf);
+#elif defined GNULIB_POSIXCHECK
+# undef remainderf
+# if HAVE_RAW_DECL_REMAINDERF
+_GL_WARN_ON_USE (remainderf, "remainderf is unportable - "
+                 "use gnulib module remainderf for portability");
+# endif
 #endif
-#if (@GNULIB_LDEXPL@ && @REPLACE_LDEXPL@) || !@HAVE_DECL_LDEXPL@
-extern long double ldexpl (long double x, int exp);
+
+#if @GNULIB_REMAINDER@
+# if @REPLACE_REMAINDER@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef remainder
+#   define remainder rpl_remainder
+#  endif
+_GL_FUNCDECL_RPL (remainder, double, (double x, double y));
+_GL_CXXALIAS_RPL (remainder, double, (double x, double y));
+# else
+#  if !@HAVE_REMAINDER@ || !@HAVE_DECL_REMAINDER@
+_GL_FUNCDECL_SYS (remainder, double, (double x, double y));
+#  endif
+_GL_CXXALIAS_SYS (remainder, double, (double x, double y));
+# endif
+_GL_CXXALIASWARN (remainder);
+#elif defined GNULIB_POSIXCHECK
+# undef remainder
+# if HAVE_RAW_DECL_REMAINDER
+_GL_WARN_ON_USE (remainder, "remainder is unportable - "
+                 "use gnulib module remainder for portability");
+# endif
 #endif
-#if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK
-# undef ldexpl
-# define ldexpl(x,e) \
-    (GL_LINK_WARNING ("ldexpl is unportable - " \
-                      "use gnulib module ldexpl for portability"), \
-     ldexpl (x, e))
+
+#if @GNULIB_REMAINDERL@
+# if @REPLACE_REMAINDERL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef remainderl
+#   define remainderl rpl_remainderl
+#  endif
+_GL_FUNCDECL_RPL (remainderl, long double, (long double x, long double y));
+_GL_CXXALIAS_RPL (remainderl, long double, (long double x, long double y));
+# else
+#  if !@HAVE_DECL_REMAINDERL@
+#   undef remainderl
+_GL_FUNCDECL_SYS (remainderl, long double, (long double x, long double y));
+#  endif
+_GL_CXXALIAS_SYS (remainderl, long double, (long double x, long double y));
+# endif
+_GL_CXXALIASWARN (remainderl);
+#elif defined GNULIB_POSIXCHECK
+# undef remainderl
+# if HAVE_RAW_DECL_REMAINDERL
+_GL_WARN_ON_USE (remainderl, "remainderl is unportable - "
+                 "use gnulib module remainderl for portability");
+# endif
 #endif
 
 
-#if @GNULIB_LOGL@
-# if !@HAVE_LOGL@
-#  undef logl
-#  define logl rpl_logl
+#if @GNULIB_RINTF@
+# if !@HAVE_DECL_RINTF@
+_GL_FUNCDECL_SYS (rintf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (rintf, float, (float x));
+_GL_CXXALIASWARN (rintf);
+#elif defined GNULIB_POSIXCHECK
+# undef rintf
+# if HAVE_RAW_DECL_RINTF
+_GL_WARN_ON_USE (rintf, "rintf is unportable - "
+                 "use gnulib module rintf for portability");
 # endif
-# if !@HAVE_LOGL@ || !@HAVE_DECL_LOGL@
-extern long double logl (long double x);
+#endif
+
+#if @GNULIB_RINT@
+# if !@HAVE_RINT@
+_GL_FUNCDECL_SYS (rint, double, (double x));
 # endif
+_GL_CXXALIAS_SYS (rint, double, (double x));
+_GL_CXXALIASWARN (rint);
 #elif defined GNULIB_POSIXCHECK
-# undef logl
-# define logl(x) \
-    (GL_LINK_WARNING ("logl is unportable - " \
-                      "use gnulib module mathl for portability"), \
-     logl (x))
+# undef rint
+# if HAVE_RAW_DECL_RINT
+_GL_WARN_ON_USE (rint, "rint is unportable - "
+                 "use gnulib module rint for portability");
+# endif
+#endif
+
+#if @GNULIB_RINTL@
+# if !@HAVE_RINTL@
+_GL_FUNCDECL_SYS (rintl, long double, (long double x));
+# endif
+_GL_CXXALIAS_SYS (rintl, long double, (long double x));
+_GL_CXXALIASWARN (rintl);
+#elif defined GNULIB_POSIXCHECK
+# undef rintl
+# if HAVE_RAW_DECL_RINTL
+_GL_WARN_ON_USE (rintl, "rintl is unportable - "
+                 "use gnulib module rintl for portability");
+# endif
 #endif
 
 
 #if @GNULIB_ROUNDF@
 # if @REPLACE_ROUNDF@
-#  undef roundf
-#  define roundf rpl_roundf
-extern float roundf (float x);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef roundf
+#   define roundf rpl_roundf
+#  endif
+_GL_FUNCDECL_RPL (roundf, float, (float x));
+_GL_CXXALIAS_RPL (roundf, float, (float x));
+# else
+#  if !@HAVE_DECL_ROUNDF@
+_GL_FUNCDECL_SYS (roundf, float, (float x));
+#  endif
+_GL_CXXALIAS_SYS (roundf, float, (float x));
 # endif
+_GL_CXXALIASWARN (roundf);
 #elif defined GNULIB_POSIXCHECK
 # undef roundf
-# define roundf(x) \
-    (GL_LINK_WARNING ("roundf is unportable - " \
-                      "use gnulib module roundf for portability"), \
-     roundf (x))
+# if HAVE_RAW_DECL_ROUNDF
+_GL_WARN_ON_USE (roundf, "roundf is unportable - "
+                 "use gnulib module roundf for portability");
+# endif
 #endif
 
 #if @GNULIB_ROUND@
 # if @REPLACE_ROUND@
-#  undef round
-#  define round rpl_round
-extern double round (double x);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef round
+#   define round rpl_round
+#  endif
+_GL_FUNCDECL_RPL (round, double, (double x));
+_GL_CXXALIAS_RPL (round, double, (double x));
+# else
+#  if !@HAVE_DECL_ROUND@
+_GL_FUNCDECL_SYS (round, double, (double x));
+#  endif
+_GL_CXXALIAS_SYS (round, double, (double x));
 # endif
+_GL_CXXALIASWARN (round);
 #elif defined GNULIB_POSIXCHECK
 # undef round
-# define round(x) \
-    (GL_LINK_WARNING ("round is unportable - " \
-                      "use gnulib module round for portability"), \
-     round (x))
+# if HAVE_RAW_DECL_ROUND
+_GL_WARN_ON_USE (round, "round is unportable - "
+                 "use gnulib module round for portability");
+# endif
 #endif
 
 #if @GNULIB_ROUNDL@
 # if @REPLACE_ROUNDL@
-#  undef roundl
-#  define roundl rpl_roundl
-extern long double roundl (long double x);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef roundl
+#   define roundl rpl_roundl
+#  endif
+_GL_FUNCDECL_RPL (roundl, long double, (long double x));
+_GL_CXXALIAS_RPL (roundl, long double, (long double x));
+# else
+#  if !@HAVE_DECL_ROUNDL@
+#   undef roundl
+_GL_FUNCDECL_SYS (roundl, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (roundl, long double, (long double x));
 # endif
+_GL_CXXALIASWARN (roundl);
 #elif defined GNULIB_POSIXCHECK
 # undef roundl
-# define roundl(x) \
-    (GL_LINK_WARNING ("roundl is unportable - " \
-                      "use gnulib module roundl for portability"), \
-     roundl (x))
+# if HAVE_RAW_DECL_ROUNDL
+_GL_WARN_ON_USE (roundl, "roundl is unportable - "
+                 "use gnulib module roundl for portability");
+# endif
 #endif
 
 
-#if @GNULIB_SINL@
-# if !@HAVE_SINL@
-#  undef sinl
-#  define sinl rpl_sinl
+#if @GNULIB_SINF@
+# if !@HAVE_SINF@
+#  undef sinf
+_GL_FUNCDECL_SYS (sinf, float, (float x));
 # endif
+_GL_CXXALIAS_SYS (sinf, float, (float x));
+_GL_CXXALIASWARN (sinf);
+#elif defined GNULIB_POSIXCHECK
+# undef sinf
+# if HAVE_RAW_DECL_SINF
+_GL_WARN_ON_USE (sinf, "sinf is unportable - "
+                 "use gnulib module sinf for portability");
+# endif
+#endif
+
+#if @GNULIB_SINL@
 # if !@HAVE_SINL@ || !@HAVE_DECL_SINL@
-extern long double sinl (long double x);
+#  undef sinl
+_GL_FUNCDECL_SYS (sinl, long double, (long double x));
 # endif
+_GL_CXXALIAS_SYS (sinl, long double, (long double x));
+_GL_CXXALIASWARN (sinl);
 #elif defined GNULIB_POSIXCHECK
 # undef sinl
-# define sinl(x) \
-    (GL_LINK_WARNING ("sinl is unportable - " \
-                      "use gnulib module mathl for portability"), \
-     sinl (x))
+# if HAVE_RAW_DECL_SINL
+_GL_WARN_ON_USE (sinl, "sinl is unportable - "
+                 "use gnulib module sinl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_SINHF@
+# if !@HAVE_SINHF@
+#  undef sinhf
+_GL_FUNCDECL_SYS (sinhf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (sinhf, float, (float x));
+_GL_CXXALIASWARN (sinhf);
+#elif defined GNULIB_POSIXCHECK
+# undef sinhf
+# if HAVE_RAW_DECL_SINHF
+_GL_WARN_ON_USE (sinhf, "sinhf is unportable - "
+                 "use gnulib module sinhf for portability");
+# endif
 #endif
 
 
+#if @GNULIB_SQRTF@
+# if !@HAVE_SQRTF@
+#  undef sqrtf
+_GL_FUNCDECL_SYS (sqrtf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (sqrtf, float, (float x));
+_GL_CXXALIASWARN (sqrtf);
+#elif defined GNULIB_POSIXCHECK
+# undef sqrtf
+# if HAVE_RAW_DECL_SQRTF
+_GL_WARN_ON_USE (sqrtf, "sqrtf is unportable - "
+                 "use gnulib module sqrtf for portability");
+# endif
+#endif
+
 #if @GNULIB_SQRTL@
-# if !@HAVE_SQRTL@ || !@HAVE_DECL_SQRTL@
-extern long double sqrtl (long double x);
+# if @REPLACE_SQRTL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef sqrtl
+#   define sqrtl rpl_sqrtl
+#  endif
+_GL_FUNCDECL_RPL (sqrtl, long double, (long double x));
+_GL_CXXALIAS_RPL (sqrtl, long double, (long double x));
+# else
+#  if !@HAVE_SQRTL@ || !@HAVE_DECL_SQRTL@
+#   undef sqrtl
+_GL_FUNCDECL_SYS (sqrtl, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (sqrtl, long double, (long double x));
 # endif
+_GL_CXXALIASWARN (sqrtl);
 #elif defined GNULIB_POSIXCHECK
 # undef sqrtl
-# define sqrtl(x) \
-    (GL_LINK_WARNING ("sqrtl is unportable - " \
-                      "use gnulib module mathl for portability"), \
-     sqrtl (x))
+# if HAVE_RAW_DECL_SQRTL
+_GL_WARN_ON_USE (sqrtl, "sqrtl is unportable - "
+                 "use gnulib module sqrtl for portability");
+# endif
 #endif
 
 
+#if @GNULIB_TANF@
+# if !@HAVE_TANF@
+#  undef tanf
+_GL_FUNCDECL_SYS (tanf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (tanf, float, (float x));
+_GL_CXXALIASWARN (tanf);
+#elif defined GNULIB_POSIXCHECK
+# undef tanf
+# if HAVE_RAW_DECL_TANF
+_GL_WARN_ON_USE (tanf, "tanf is unportable - "
+                 "use gnulib module tanf for portability");
+# endif
+#endif
+
 #if @GNULIB_TANL@
 # if !@HAVE_TANL@ || !@HAVE_DECL_TANL@
-extern long double tanl (long double x);
+#  undef tanl
+_GL_FUNCDECL_SYS (tanl, long double, (long double x));
 # endif
+_GL_CXXALIAS_SYS (tanl, long double, (long double x));
+_GL_CXXALIASWARN (tanl);
 #elif defined GNULIB_POSIXCHECK
 # undef tanl
-# define tanl(x) \
-    (GL_LINK_WARNING ("tanl is unportable - " \
-                      "use gnulib module mathl for portability"), \
-     tanl (x))
+# if HAVE_RAW_DECL_TANL
+_GL_WARN_ON_USE (tanl, "tanl is unportable - "
+                 "use gnulib module tanl for portability");
+# endif
+#endif
+
+
+#if @GNULIB_TANHF@
+# if !@HAVE_TANHF@
+#  undef tanhf
+_GL_FUNCDECL_SYS (tanhf, float, (float x));
+# endif
+_GL_CXXALIAS_SYS (tanhf, float, (float x));
+_GL_CXXALIASWARN (tanhf);
+#elif defined GNULIB_POSIXCHECK
+# undef tanhf
+# if HAVE_RAW_DECL_TANHF
+_GL_WARN_ON_USE (tanhf, "tanhf is unportable - "
+                 "use gnulib module tanhf for portability");
+# endif
 #endif
 
 
 #if @GNULIB_TRUNCF@
-# if !@HAVE_DECL_TRUNCF@
-#  define truncf rpl_truncf
-extern float truncf (float x);
+# if @REPLACE_TRUNCF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define truncf rpl_truncf
+#  endif
+_GL_FUNCDECL_RPL (truncf, float, (float x));
+_GL_CXXALIAS_RPL (truncf, float, (float x));
+# else
+#  if !@HAVE_DECL_TRUNCF@
+_GL_FUNCDECL_SYS (truncf, float, (float x));
+#  endif
+_GL_CXXALIAS_SYS (truncf, float, (float x));
 # endif
+_GL_CXXALIASWARN (truncf);
 #elif defined GNULIB_POSIXCHECK
 # undef truncf
-# define truncf(x) \
-    (GL_LINK_WARNING ("truncf is unportable - " \
-                      "use gnulib module truncf for portability"), \
-     truncf (x))
+# if HAVE_RAW_DECL_TRUNCF
+_GL_WARN_ON_USE (truncf, "truncf is unportable - "
+                 "use gnulib module truncf for portability");
+# endif
 #endif
 
 #if @GNULIB_TRUNC@
-# if !@HAVE_DECL_TRUNC@
-#  define trunc rpl_trunc
-extern double trunc (double x);
+# if @REPLACE_TRUNC@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define trunc rpl_trunc
+#  endif
+_GL_FUNCDECL_RPL (trunc, double, (double x));
+_GL_CXXALIAS_RPL (trunc, double, (double x));
+# else
+#  if !@HAVE_DECL_TRUNC@
+_GL_FUNCDECL_SYS (trunc, double, (double x));
+#  endif
+_GL_CXXALIAS_SYS (trunc, double, (double x));
 # endif
+_GL_CXXALIASWARN (trunc);
 #elif defined GNULIB_POSIXCHECK
 # undef trunc
-# define trunc(x) \
-    (GL_LINK_WARNING ("trunc is unportable - " \
-                      "use gnulib module trunc for portability"), \
-     trunc (x))
+# if HAVE_RAW_DECL_TRUNC
+_GL_WARN_ON_USE (trunc, "trunc is unportable - "
+                 "use gnulib module trunc for portability");
+# endif
 #endif
 
 #if @GNULIB_TRUNCL@
 # if @REPLACE_TRUNCL@
-#  undef truncl
-#  define truncl rpl_truncl
-extern long double truncl (long double x);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef truncl
+#   define truncl rpl_truncl
+#  endif
+_GL_FUNCDECL_RPL (truncl, long double, (long double x));
+_GL_CXXALIAS_RPL (truncl, long double, (long double x));
+# else
+#  if !@HAVE_DECL_TRUNCL@
+_GL_FUNCDECL_SYS (truncl, long double, (long double x));
+#  endif
+_GL_CXXALIAS_SYS (truncl, long double, (long double x));
 # endif
+_GL_CXXALIASWARN (truncl);
 #elif defined GNULIB_POSIXCHECK
 # undef truncl
-# define truncl(x) \
-    (GL_LINK_WARNING ("truncl is unportable - " \
-                      "use gnulib module truncl for portability"), \
-     truncl (x))
+# if HAVE_RAW_DECL_TRUNCL
+_GL_WARN_ON_USE (truncl, "truncl is unportable - "
+                 "use gnulib module truncl for portability");
+# endif
 #endif
 
 
+/* Definitions of function-like macros come here, after the function
+   declarations.  */
+
+
 #if @GNULIB_ISFINITE@
 # if @REPLACE_ISFINITE@
-extern int gl_isfinitef (float x);
-extern int gl_isfinited (double x);
-extern int gl_isfinitel (long double x);
+_GL_EXTERN_C int gl_isfinitef (float x);
+_GL_EXTERN_C int gl_isfinited (double x);
+_GL_EXTERN_C int gl_isfinitel (long double x);
 #  undef isfinite
 #  define isfinite(x) \
    (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \
     sizeof (x) == sizeof (double) ? gl_isfinited (x) : \
     gl_isfinitef (x))
 # endif
+# ifdef __cplusplus
+#  ifdef isfinite
+_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite)
+#   undef isfinite
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite)
+#  endif
+# endif
 #elif defined GNULIB_POSIXCHECK
 # if defined isfinite
 _GL_WARN_REAL_FLOATING_DECL (isfinite);
@@ -445,15 +2049,22 @@ _GL_WARN_REAL_FLOATING_DECL (isfinite);
 
 #if @GNULIB_ISINF@
 # if @REPLACE_ISINF@
-extern int gl_isinff (float x);
-extern int gl_isinfd (double x);
-extern int gl_isinfl (long double x);
+_GL_EXTERN_C int gl_isinff (float x);
+_GL_EXTERN_C int gl_isinfd (double x);
+_GL_EXTERN_C int gl_isinfl (long double x);
 #  undef isinf
 #  define isinf(x) \
    (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \
     sizeof (x) == sizeof (double) ? gl_isinfd (x) : \
     gl_isinff (x))
 # endif
+# ifdef __cplusplus
+#  ifdef isinf
+_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf)
+#   undef isinf
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf)
+#  endif
+# endif
 #elif defined GNULIB_POSIXCHECK
 # if defined isinf
 _GL_WARN_REAL_FLOATING_DECL (isinf);
@@ -480,7 +2091,7 @@ _GL_WARN_REAL_FLOATING_DECL (isinf);
 /* Test whether X is a NaN.  */
 #  undef isnanf
 #  define isnanf rpl_isnanf
-extern int isnanf (float x);
+_GL_EXTERN_C int isnanf (float x);
 # endif
 #endif
 
@@ -489,7 +2100,8 @@ extern int isnanf (float x);
    This function is a gnulib extension, unlike isnan() which applied only
    to 'double' numbers earlier but now is a type-generic macro.  */
 # if @HAVE_ISNAND@
-/* The original <math.h> included above provides a declaration of isnan macro.  */
+/* The original <math.h> included above provides a declaration of isnan
+   macro.  */
 #  if __GNUC__ >= 4
     /* GCC 4.0 and newer provides three built-ins for isnan.  */
 #   undef isnand
@@ -502,14 +2114,15 @@ extern int isnanf (float x);
 /* Test whether X is a NaN.  */
 #  undef isnand
 #  define isnand rpl_isnand
-extern int isnand (double x);
+_GL_EXTERN_C int isnand (double x);
 # endif
 #endif
 
 #if @GNULIB_ISNANL@
 /* Test for NaN for 'long double' numbers.  */
 # if @HAVE_ISNANL@
-/* The original <math.h> included above provides a declaration of isnan macro or (older) isnanl function.  */
+/* The original <math.h> included above provides a declaration of isnan
+   macro or (older) isnanl function.  */
 #  if __GNUC__ >= 4
     /* GCC 4.0 and newer provides three built-ins for isnan.  */
 #   undef isnanl
@@ -522,7 +2135,7 @@ extern int isnand (double x);
 /* Test whether X is a NaN.  */
 #  undef isnanl
 #  define isnanl rpl_isnanl
-extern int isnanl (long double x);
+_GL_EXTERN_C int isnanl (long double x) _GL_ATTRIBUTE_CONST;
 # endif
 #endif
 
@@ -534,21 +2147,21 @@ extern int isnanl (long double x);
    that recursively expand back to isnan.  So use the gnulib
    replacements for them directly. */
 #  if @HAVE_ISNANF@ && __GNUC__ >= 4
-#   define gl_isnan_f(x) __builtin_isnan ((float)(x))
+#   define gl_isnan_f(x) __builtin_isnanf ((float)(x))
 #  else
-extern int rpl_isnanf (float x);
+_GL_EXTERN_C int rpl_isnanf (float x);
 #   define gl_isnan_f(x) rpl_isnanf (x)
 #  endif
 #  if @HAVE_ISNAND@ && __GNUC__ >= 4
 #   define gl_isnan_d(x) __builtin_isnan ((double)(x))
 #  else
-extern int rpl_isnand (double x);
+_GL_EXTERN_C int rpl_isnand (double x);
 #   define gl_isnan_d(x) rpl_isnand (x)
 #  endif
 #  if @HAVE_ISNANL@ && __GNUC__ >= 4
-#   define gl_isnan_l(x) __builtin_isnan ((long double)(x))
+#   define gl_isnan_l(x) __builtin_isnanl ((long double)(x))
 #  else
-extern int rpl_isnanl (long double x);
+_GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
 #   define gl_isnan_l(x) rpl_isnanl (x)
 #  endif
 #  undef isnan
@@ -556,6 +2169,24 @@ extern int rpl_isnanl (long double x);
    (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
     sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
     gl_isnan_f (x))
+# elif __GNUC__ >= 4
+#  undef isnan
+#  define isnan(x) \
+   (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \
+    sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
+    __builtin_isnanf ((float)(x)))
+# endif
+# ifdef __cplusplus
+#  ifdef isnan
+_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan)
+#   undef isnan
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan)
+#  endif
+# else
+/* Ensure isnan is a macro.  */
+#  ifndef isnan
+#   define isnan isnan
+#  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
 # if defined isnan
@@ -577,15 +2208,17 @@ _GL_WARN_REAL_FLOATING_DECL (isnan);
 # endif
 # if @REPLACE_SIGNBIT@
 #  undef signbit
-extern int gl_signbitf (float arg);
-extern int gl_signbitd (double arg);
-extern int gl_signbitl (long double arg);
-#  if __GNUC__ >= 2 && !__STRICT_ANSI__
+_GL_EXTERN_C int gl_signbitf (float arg);
+_GL_EXTERN_C int gl_signbitd (double arg);
+_GL_EXTERN_C int gl_signbitl (long double arg);
+#  if __GNUC__ >= 2 && !defined __STRICT_ANSI__
+#   define _GL_NUM_UINT_WORDS(type) \
+      ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
 #   if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
 #    define gl_signbitf_OPTIMIZED_MACRO
 #    define gl_signbitf(arg) \
        ({ union { float _value;                                         \
-                  unsigned int _word[(sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \
+                  unsigned int _word[_GL_NUM_UINT_WORDS (float)];       \
                 } _m;                                                   \
           _m._value = (arg);                                            \
           (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1;          \
@@ -594,8 +2227,8 @@ extern int gl_signbitl (long double arg);
 #   if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd
 #    define gl_signbitd_OPTIMIZED_MACRO
 #    define gl_signbitd(arg) \
-       ({ union { double _value;                                                \
-                  unsigned int _word[(sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \
+       ({ union { double _value;                                        \
+                  unsigned int _word[_GL_NUM_UINT_WORDS (double)];      \
                 } _m;                                                   \
           _m._value = (arg);                                            \
           (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1;          \
@@ -605,10 +2238,10 @@ extern int gl_signbitl (long double arg);
 #    define gl_signbitl_OPTIMIZED_MACRO
 #    define gl_signbitl(arg) \
        ({ union { long double _value;                                   \
-                  unsigned int _word[(sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)]; \
+                  unsigned int _word[_GL_NUM_UINT_WORDS (long double)]; \
                 } _m;                                                   \
           _m._value = (arg);                                            \
-          (_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1;                \
+          (_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1;        \
         })
 #   endif
 #  endif
@@ -617,6 +2250,13 @@ extern int gl_signbitl (long double arg);
     sizeof (x) == sizeof (double) ? gl_signbitd (x) : \
     gl_signbitf (x))
 # endif
+# ifdef __cplusplus
+#  ifdef signbit
+_GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit)
+#   undef signbit
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
+#  endif
+# endif
 #elif defined GNULIB_POSIXCHECK
 # if defined signbit
 _GL_WARN_REAL_FLOATING_DECL (signbit);
@@ -626,9 +2266,5 @@ _GL_WARN_REAL_FLOATING_DECL (signbit);
 #endif
 
 
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _GL_MATH_H */
-#endif /* _GL_MATH_H */
+#endif /* _@GUARD_PREFIX@_MATH_H */
+#endif /* _@GUARD_PREFIX@_MATH_H */
index 5c2650e9520751569df711577333e7d53ecc8c58..e3f354beedfc06f952aab568b0cabc21bf8a8c10 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 1999-2002, 2005-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002, 2005-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -40,9 +40,6 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
 {
   char *pstate = (char *)ps;
 
-  if (pstate == NULL)
-    pstate = internal_state;
-
   if (s == NULL)
     {
       pwc = NULL;
@@ -54,6 +51,10 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
     return (size_t)(-2);
 
   /* Here n > 0.  */
+
+  if (pstate == NULL)
+    pstate = internal_state;
+
   {
     size_t nstate = pstate[0];
     char buf[4];
@@ -91,7 +92,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
 
     /* Here m > 0.  */
 
-# if __GLIBC__
+# if __GLIBC__ || defined __UCLIBC__
     /* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */
     mbtowc (NULL, NULL, 0);
 # endif
@@ -127,7 +128,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
       {
         const char *encoding = locale_charset ();
 
-        if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
+        if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
           {
             /* Cf. unistr/u8-mblen.c.  */
             unsigned char c = (unsigned char) p[0];
@@ -184,7 +185,8 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
         /* As a reference for this code, you can use the GNU libiconv
            implementation.  Look for uses of the RET_TOOFEW macro.  */
 
-        if (STREQ (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
+        if (STREQ_OPT (encoding,
+                       "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
           {
             if (m == 1)
               {
@@ -207,9 +209,12 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
               }
             goto invalid;
           }
-        if (STREQ (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
-            || STREQ (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
-            || STREQ (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
+        if (STREQ_OPT (encoding,
+                       "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
+            || STREQ_OPT (encoding,
+                          "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
+            || STREQ_OPT (encoding,
+                          "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
           {
             if (m == 1)
               {
@@ -220,7 +225,8 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
               }
             goto invalid;
           }
-        if (STREQ (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
+        if (STREQ_OPT (encoding,
+                       "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
           {
             if (m == 1)
               {
@@ -238,7 +244,8 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
               }
             goto invalid;
           }
-        if (STREQ (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
+        if (STREQ_OPT (encoding,
+                       "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
           {
             if (m == 1)
               {
@@ -271,7 +278,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
               }
             goto invalid;
           }
-        if (STREQ (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
+        if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
           {
             if (m == 1)
               {
@@ -321,7 +328,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
 size_t
 rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
 {
-# if MBRTOWC_NULL_ARG_BUG || MBRTOWC_RETVAL_BUG
+# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG
   if (s == NULL)
     {
       pwc = NULL;
@@ -334,7 +341,7 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
   {
     static mbstate_t internal_state;
 
-    /* Override mbrtowc's internal state.  We can not call mbsinit() on the
+    /* Override mbrtowc's internal state.  We cannot call mbsinit() on the
        hidden internal state, but we can call it on our variable.  */
     if (ps == NULL)
       ps = &internal_state;
@@ -379,7 +386,16 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
     return ret;
   }
 # else
-  return mbrtowc (pwc, s, n, ps);
+  {
+#   if MBRTOWC_NULL_ARG1_BUG
+    wchar_t dummy;
+
+    if (pwc == NULL)
+      pwc = &dummy;
+#   endif
+
+    return mbrtowc (pwc, s, n, ps);
+  }
 # endif
 }
 
index 066ddfe5bf1dcfa789e17c71ef3c41b10106540c..638142e8baf2c6d4211bd0e8f8be594f18842d1c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for initial conversion state.
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
 
 #include "verify.h"
 
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+
+/* On native Windows, 'mbstate_t' is defined as 'int'.  */
+
+int
+mbsinit (const mbstate_t *ps)
+{
+  return ps == NULL || *ps == 0;
+}
+
+#else
+
 /* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs()
    and wcrtomb(), wcsrtombs().
    We assume that
@@ -43,5 +55,7 @@ mbsinit (const mbstate_t *ps)
 {
   const char *pstate = (const char *)ps;
 
-  return pstate[0] == 0;
+  return pstate == NULL || pstate[0] == 0;
 }
+
+#endif
index 6c2b2d6c7dc15cdc1bf15664653cdaecae7e18a7..b8fb0efb95e956bb4a23f9b675c440801b4bfeab 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2010
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2012
    Free Software Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
index c6031406a8dbfb365aa981c39ef90b78b0597287..a97fe42295e545e4e44ef1354b1b5c95c2d6fdf0 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Copy memory area and return pointer after last written byte.
-   Copyright (C) 2003, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007, 2009-2012 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
@@ -14,8 +12,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 358f61834b40626e40e50909fdf76c8b42997d38..8f2edeb3e4fa3adc6d65d82680a0278553136831 100644 (file)
@@ -1,6 +1,6 @@
 /* memrchr -- find the last occurrence of a byte in a memory block
 
-   Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2010 Free Software
+   Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2012 Free Software
    Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
diff --git a/lib/mkdir.c b/lib/mkdir.c
deleted file mode 100644 (file)
index b117b76..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/* On some systems, mkdir ("foo/", 0700) fails because of the trailing
-   slash.  On those systems, this wrapper removes the trailing slash.
-
-   Copyright (C) 2001, 2003, 2006, 2008-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* written by Jim Meyering */
-
-#include <config.h>
-
-/* Specification.  */
-#include <sys/stat.h>
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "dirname.h"
-
-/* Disable the definition of mkdir to rpl_mkdir (from the <sys/stat.h>
-   substitute) in this file.  Otherwise, we'd get an endless recursion.  */
-#undef mkdir
-
-/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
-   Additionally, it declares _mkdir (and depending on compile flags, an
-   alias mkdir), only in the nonstandard io.h.  */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-# define mkdir(name,mode) _mkdir (name)
-# define maybe_unused _GL_UNUSED
-#else
-# define maybe_unused /* empty */
-#endif
-
-/* This function is required at least for NetBSD 1.5.2.  */
-
-int
-rpl_mkdir (char const *dir, mode_t mode maybe_unused)
-{
-  int ret_val;
-  char *tmp_dir;
-  size_t len = strlen (dir);
-
-  if (len && dir[len - 1] == '/')
-    {
-      tmp_dir = strdup (dir);
-      if (!tmp_dir)
-        {
-          /* Rather than rely on strdup-posix, we set errno ourselves.  */
-          errno = ENOMEM;
-          return -1;
-        }
-      strip_trailing_slashes (tmp_dir);
-    }
-  else
-    {
-      tmp_dir = (char *) dir;
-    }
-#if FUNC_MKDIR_DOT_BUG
-  /* Additionally, cygwin 1.5 mistakenly creates a directory "d/./".  */
-  {
-    char *last = last_component (tmp_dir);
-    if (*last == '.' && (last[1] == '\0'
-                         || (last[1] == '.' && last[2] == '\0')))
-      {
-        struct stat st;
-        if (stat (tmp_dir, &st) == 0)
-          errno = EEXIST;
-        return -1;
-      }
-  }
-#endif /* FUNC_MKDIR_DOT_BUG */
-
-  ret_val = mkdir (tmp_dir, mode);
-
-  if (tmp_dir != dir)
-    free (tmp_dir);
-
-  return ret_val;
-}
diff --git a/lib/mkdirat.c b/lib/mkdirat.c
deleted file mode 100644 (file)
index 9e68222..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* fd-relative mkdir
-   Copyright (C) 2005-2006, 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* written by Jim Meyering */
-
-#include <config.h>
-
-#include <unistd.h>
-
-/* Solaris 10 has no function like this.
-   Create a subdirectory, FILE, with mode MODE, in the directory
-   open on descriptor FD.  If possible, do it without changing the
-   working directory.  Otherwise, resort to using save_cwd/fchdir,
-   then mkdir/restore_cwd.  If either the save_cwd or the restore_cwd
-   fails, then give a diagnostic and exit nonzero.  */
-
-#define AT_FUNC_NAME mkdirat
-#define AT_FUNC_F1 mkdir
-#define AT_FUNC_POST_FILE_PARAM_DECLS , mode_t mode
-#define AT_FUNC_POST_FILE_ARGS        , mode
-#include "at-func.c"
diff --git a/lib/msvc-inval.c b/lib/msvc-inval.c
new file mode 100644 (file)
index 0000000..ba76a7e
--- /dev/null
@@ -0,0 +1,129 @@
+/* Invalid parameter handler for MSVC runtime libraries.
+   Copyright (C) 2011-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "msvc-inval.h"
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+    && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING)
+
+/* Get _invalid_parameter_handler type and _set_invalid_parameter_handler
+   declaration.  */
+# include <stdlib.h>
+
+# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+
+static void cdecl
+gl_msvc_invalid_parameter_handler (const wchar_t *expression,
+                                   const wchar_t *function,
+                                   const wchar_t *file,
+                                   unsigned int line,
+                                   uintptr_t dummy)
+{
+}
+
+# else
+
+/* Get declarations of the native Windows API functions.  */
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+
+#  if defined _MSC_VER
+
+static void cdecl
+gl_msvc_invalid_parameter_handler (const wchar_t *expression,
+                                   const wchar_t *function,
+                                   const wchar_t *file,
+                                   unsigned int line,
+                                   uintptr_t dummy)
+{
+  RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL);
+}
+
+#  else
+
+/* An index to thread-local storage.  */
+static DWORD tls_index;
+static int tls_initialized /* = 0 */;
+
+/* Used as a fallback only.  */
+static struct gl_msvc_inval_per_thread not_per_thread;
+
+struct gl_msvc_inval_per_thread *
+gl_msvc_inval_current (void)
+{
+  if (!tls_initialized)
+    {
+      tls_index = TlsAlloc ();
+      tls_initialized = 1;
+    }
+  if (tls_index == TLS_OUT_OF_INDEXES)
+    /* TlsAlloc had failed.  */
+    return &not_per_thread;
+  else
+    {
+      struct gl_msvc_inval_per_thread *pointer =
+        (struct gl_msvc_inval_per_thread *) TlsGetValue (tls_index);
+      if (pointer == NULL)
+        {
+          /* First call.  Allocate a new 'struct gl_msvc_inval_per_thread'.  */
+          pointer =
+            (struct gl_msvc_inval_per_thread *)
+            malloc (sizeof (struct gl_msvc_inval_per_thread));
+          if (pointer == NULL)
+            /* Could not allocate memory.  Use the global storage.  */
+            pointer = &not_per_thread;
+          TlsSetValue (tls_index, pointer);
+        }
+      return pointer;
+    }
+}
+
+static void cdecl
+gl_msvc_invalid_parameter_handler (const wchar_t *expression,
+                                   const wchar_t *function,
+                                   const wchar_t *file,
+                                   unsigned int line,
+                                   uintptr_t dummy)
+{
+  struct gl_msvc_inval_per_thread *current = gl_msvc_inval_current ();
+  if (current->restart_valid)
+    longjmp (current->restart, 1);
+  else
+    /* An invalid parameter notification from outside the gnulib code.
+       Give the caller a chance to intervene.  */
+    RaiseException (STATUS_GNULIB_INVALID_PARAMETER, 0, 0, NULL);
+}
+
+#  endif
+
+# endif
+
+static int gl_msvc_inval_initialized /* = 0 */;
+
+void
+gl_msvc_inval_ensure_handler (void)
+{
+  if (gl_msvc_inval_initialized == 0)
+    {
+      _set_invalid_parameter_handler (gl_msvc_invalid_parameter_handler);
+      gl_msvc_inval_initialized = 1;
+    }
+}
+
+#endif
diff --git a/lib/msvc-inval.h b/lib/msvc-inval.h
new file mode 100644 (file)
index 0000000..eb6930b
--- /dev/null
@@ -0,0 +1,222 @@
+/* Invalid parameter handler for MSVC runtime libraries.
+   Copyright (C) 2011-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _MSVC_INVAL_H
+#define _MSVC_INVAL_H
+
+/* With MSVC runtime libraries with the "invalid parameter handler" concept,
+   functions like fprintf(), dup2(), or close() crash when the caller passes
+   an invalid argument.  But POSIX wants error codes (such as EINVAL or EBADF)
+   instead.
+   This file defines macros that turn such an invalid parameter notification
+   into a non-local exit.  An error code can then be produced at the target
+   of this exit.  You can thus write code like
+
+     TRY_MSVC_INVAL
+       {
+         <Code that can trigger an invalid parameter notification
+          but does not do 'return', 'break', 'continue', nor 'goto'.>
+       }
+     CATCH_MSVC_INVAL
+       {
+         <Code that handles an invalid parameter notification
+          but does not do 'return', 'break', 'continue', nor 'goto'.>
+       }
+     DONE_MSVC_INVAL;
+
+   This entire block expands to a single statement.
+
+   The handling of invalid parameters can be done in three ways:
+
+     * The default way, which is reasonable for programs (not libraries):
+       AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [DEFAULT_HANDLING])
+
+     * The way for libraries that make "hairy" calls (like close(-1), or
+       fclose(fp) where fileno(fp) is closed, or simply getdtablesize()):
+       AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [HAIRY_LIBRARY_HANDLING])
+
+     * The way for libraries that make no "hairy" calls:
+       AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [SANE_LIBRARY_HANDLING])
+ */
+
+#define DEFAULT_HANDLING       0
+#define HAIRY_LIBRARY_HANDLING 1
+#define SANE_LIBRARY_HANDLING  2
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER \
+    && !(MSVC_INVALID_PARAMETER_HANDLING == SANE_LIBRARY_HANDLING)
+/* A native Windows platform with the "invalid parameter handler" concept,
+   and either DEFAULT_HANDLING or HAIRY_LIBRARY_HANDLING.  */
+
+# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
+/* Default handling.  */
+
+#  ifdef __cplusplus
+extern "C" {
+#  endif
+
+/* Ensure that the invalid parameter handler in installed that just returns.
+   Because we assume no other part of the program installs a different
+   invalid parameter handler, this solution is multithread-safe.  */
+extern void gl_msvc_inval_ensure_handler (void);
+
+#  ifdef __cplusplus
+}
+#  endif
+
+#  define TRY_MSVC_INVAL \
+     do                                                                        \
+       {                                                                       \
+         gl_msvc_inval_ensure_handler ();                                      \
+         if (1)
+#  define CATCH_MSVC_INVAL \
+         else
+#  define DONE_MSVC_INVAL \
+       }                                                                       \
+     while (0)
+
+# else
+/* Handling for hairy libraries.  */
+
+#  include <excpt.h>
+
+/* Gnulib can define its own status codes, as described in the page
+   "Raising Software Exceptions" on microsoft.com
+   <http://msdn.microsoft.com/en-us/library/het71c37.aspx>.
+   Our status codes are composed of
+     - 0xE0000000, mandatory for all user-defined status codes,
+     - 0x474E550, a API identifier ("GNU"),
+     - 0, 1, 2, ..., used to distinguish different status codes from the
+       same API.  */
+#  define STATUS_GNULIB_INVALID_PARAMETER (0xE0000000 + 0x474E550 + 0)
+
+#  if defined _MSC_VER
+/* A compiler that supports __try/__except, as described in the page
+   "try-except statement" on microsoft.com
+   <http://msdn.microsoft.com/en-us/library/s58ftw19.aspx>.
+   With __try/__except, we can use the multithread-safe exception handling.  */
+
+#   ifdef __cplusplus
+extern "C" {
+#   endif
+
+/* Ensure that the invalid parameter handler in installed that raises a
+   software exception with code STATUS_GNULIB_INVALID_PARAMETER.
+   Because we assume no other part of the program installs a different
+   invalid parameter handler, this solution is multithread-safe.  */
+extern void gl_msvc_inval_ensure_handler (void);
+
+#   ifdef __cplusplus
+}
+#   endif
+
+#   define TRY_MSVC_INVAL \
+      do                                                                       \
+        {                                                                      \
+          gl_msvc_inval_ensure_handler ();                                     \
+          __try
+#   define CATCH_MSVC_INVAL \
+          __except (GetExceptionCode () == STATUS_GNULIB_INVALID_PARAMETER     \
+                    ? EXCEPTION_EXECUTE_HANDLER                                \
+                    : EXCEPTION_CONTINUE_SEARCH)
+#   define DONE_MSVC_INVAL \
+        }                                                                      \
+      while (0)
+
+#  else
+/* Any compiler.
+   We can only use setjmp/longjmp.  */
+
+#   include <setjmp.h>
+
+#   ifdef __cplusplus
+extern "C" {
+#   endif
+
+struct gl_msvc_inval_per_thread
+{
+  /* The restart that will resume execution at the code between
+     CATCH_MSVC_INVAL and DONE_MSVC_INVAL.  It is enabled only between
+     TRY_MSVC_INVAL and CATCH_MSVC_INVAL.  */
+  jmp_buf restart;
+
+  /* Tells whether the contents of restart is valid.  */
+  int restart_valid;
+};
+
+/* Ensure that the invalid parameter handler in installed that passes
+   control to the gl_msvc_inval_restart if it is valid, or raises a
+   software exception with code STATUS_GNULIB_INVALID_PARAMETER otherwise.
+   Because we assume no other part of the program installs a different
+   invalid parameter handler, this solution is multithread-safe.  */
+extern void gl_msvc_inval_ensure_handler (void);
+
+/* Return a pointer to the per-thread data for the current thread.  */
+extern struct gl_msvc_inval_per_thread *gl_msvc_inval_current (void);
+
+#   ifdef __cplusplus
+}
+#   endif
+
+#   define TRY_MSVC_INVAL \
+      do                                                                       \
+        {                                                                      \
+          struct gl_msvc_inval_per_thread *msvc_inval_current;                 \
+          gl_msvc_inval_ensure_handler ();                                     \
+          msvc_inval_current = gl_msvc_inval_current ();                       \
+          /* First, initialize gl_msvc_inval_restart.  */                      \
+          if (setjmp (msvc_inval_current->restart) == 0)                       \
+            {                                                                  \
+              /* Then, mark it as valid.  */                                   \
+              msvc_inval_current->restart_valid = 1;
+#   define CATCH_MSVC_INVAL \
+              /* Execution completed.                                          \
+                 Mark gl_msvc_inval_restart as invalid.  */                    \
+              msvc_inval_current->restart_valid = 0;                           \
+            }                                                                  \
+          else                                                                 \
+            {                                                                  \
+              /* Execution triggered an invalid parameter notification.        \
+                 Mark gl_msvc_inval_restart as invalid.  */                    \
+              msvc_inval_current->restart_valid = 0;
+#   define DONE_MSVC_INVAL \
+            }                                                                  \
+        }                                                                      \
+      while (0)
+
+#  endif
+
+# endif
+
+#else
+/* A platform that does not need to the invalid parameter handler,
+   or when SANE_LIBRARY_HANDLING is desired.  */
+
+/* The braces here avoid GCC warnings like
+   "warning: suggest explicit braces to avoid ambiguous 'else'".  */
+# define TRY_MSVC_INVAL \
+    do                                                                         \
+      {                                                                        \
+        if (1)
+# define CATCH_MSVC_INVAL \
+        else
+# define DONE_MSVC_INVAL \
+      }                                                                        \
+    while (0)
+
+#endif
+
+#endif /* _MSVC_INVAL_H */
diff --git a/lib/msvc-nothrow.c b/lib/msvc-nothrow.c
new file mode 100644 (file)
index 0000000..e5cf181
--- /dev/null
@@ -0,0 +1,49 @@
+/* Wrappers that don't throw invalid parameter notifications
+   with MSVC runtime libraries.
+   Copyright (C) 2011-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "msvc-nothrow.h"
+
+/* Get declarations of the native Windows API functions.  */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "msvc-inval.h"
+
+#undef _get_osfhandle
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+intptr_t
+_gl_nothrow_get_osfhandle (int fd)
+{
+  intptr_t result;
+
+  TRY_MSVC_INVAL
+    {
+      result = _get_osfhandle (fd);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = (intptr_t) INVALID_HANDLE_VALUE;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+#endif
diff --git a/lib/msvc-nothrow.h b/lib/msvc-nothrow.h
new file mode 100644 (file)
index 0000000..2b71945
--- /dev/null
@@ -0,0 +1,43 @@
+/* Wrappers that don't throw invalid parameter notifications
+   with MSVC runtime libraries.
+   Copyright (C) 2011-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _MSVC_NOTHROW_H
+#define _MSVC_NOTHROW_H
+
+/* With MSVC runtime libraries with the "invalid parameter handler" concept,
+   functions like fprintf(), dup2(), or close() crash when the caller passes
+   an invalid argument.  But POSIX wants error codes (such as EINVAL or EBADF)
+   instead.
+   This file defines wrappers that turn such an invalid parameter notification
+   into an error code.  */
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* Get original declaration of _get_osfhandle.  */
+# include <io.h>
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+
+/* Override _get_osfhandle.  */
+extern intptr_t _gl_nothrow_get_osfhandle (int fd);
+#  define _get_osfhandle _gl_nothrow_get_osfhandle
+
+# endif
+
+#endif
+
+#endif /* _MSVC_NOTHROW_H */
index 3b36471f2373bb47973c280915769af4ee5b5071..17f7600fff6a6670fd76c85b01f0aadaf4066d79 100644 (file)
@@ -1,6 +1,6 @@
 /* Invoke open, but avoid some glitches.
 
-   Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2012 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
index f612b802d2185505b2aa19cc72290ab790190cba..27801b916cdc1bd4c15732bd34a9f971c7be4313 100644 (file)
@@ -1,5 +1,5 @@
 /* Open a descriptor to a file.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
+/* If the user's config.h happens to include <fcntl.h>, let it include only
+   the system's <fcntl.h> here, so that orig_open doesn't recurse to
+   rpl_open.  */
+#define __need_system_fcntl_h
 #include <config.h>
 
 /* Get the original definition of open.  It might be defined as a macro.  */
-#define __need_system_fcntl_h
 #include <fcntl.h>
-#undef __need_system_fcntl_h
 #include <sys/types.h>
+#undef __need_system_fcntl_h
 
 static inline int
 orig_open (const char *filename, int flags, mode_t mode)
@@ -31,7 +34,9 @@ orig_open (const char *filename, int flags, mode_t mode)
 }
 
 /* Specification.  */
-#include <fcntl.h>
+/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates
+   this include because of the preliminary #include <fcntl.h> above.  */
+#include "fcntl.h"
 
 #include <errno.h>
 #include <stdarg.h>
@@ -63,6 +68,15 @@ open (const char *filename, int flags, ...)
       va_end (arg);
     }
 
+#if GNULIB_defined_O_NONBLOCK
+  /* The only known platform that lacks O_NONBLOCK is mingw, but it
+     also lacks named pipes and Unix sockets, which are the only two
+     file types that require non-blocking handling in open().
+     Therefore, it is safe to ignore O_NONBLOCK here.  It is handy
+     that mingw also lacks openat(), so that is also covered here.  */
+  flags &= ~O_NONBLOCK;
+#endif
+
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
   if (strcmp (filename, "/dev/null") == 0)
     filename = "NUL";
@@ -111,7 +125,8 @@ open (const char *filename, int flags, ...)
      override fstat() in fchdir.c to hide the fact that we have a
      dummy.  */
   if (REPLACE_OPEN_DIRECTORY && fd < 0 && errno == EACCES
-      && (flags & O_ACCMODE) == O_RDONLY)
+      && ((flags & O_ACCMODE) == O_RDONLY
+          || (O_SEARCH != O_RDONLY && (flags & O_ACCMODE) == O_SEARCH)))
     {
       struct stat statbuf;
       if (stat (filename, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))
index a8639e11dedd95b5cd281aa1016ac918adbd9c21..a5f17d8a55e14358f37d84356ef671e871ec03ba 100644 (file)
@@ -1,6 +1,6 @@
 /* Report a save- or restore-cwd failure in our openat replacement and then exit.
 
-   Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2008-2012 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
 
 #include <stdlib.h>
 
-#include "error.h"
+#ifndef GNULIB_LIBPOSIX
+# include "error.h"
+#endif
+
 #include "exitfail.h"
 
 #include "gettext.h"
 void
 openat_save_fail (int errnum)
 {
+#ifndef GNULIB_LIBPOSIX
   error (exit_failure, errnum,
          _("unable to record current working directory"));
-
-  /* The `noreturn' attribute cannot be applied to error, since it returns
+#endif
+  /* _Noreturn cannot be applied to error, since it returns
      when its first argument is 0.  To help compilers understand that this
      function does not return, call abort.  Also, the abort is a
      safety feature if exit_failure is 0 (which shouldn't happen).  */
@@ -48,8 +52,10 @@ openat_save_fail (int errnum)
 void
 openat_restore_fail (int errnum)
 {
+#ifndef GNULIB_LIBPOSIX
   error (exit_failure, errnum,
          _("failed to return to initial working directory"));
+#endif
 
   /* As above.  */
   abort ();
index e0818731f4506c98d25f6bd153d733fe7adc4e27..fd0adc1855f9622f9942f974e67e7f5d30cf5690 100644 (file)
@@ -1,6 +1,6 @@
 /* Internals for openat-like functions.
 
-   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2012 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
 #define _GL_HEADER_OPENAT_PRIV
 
 #include <errno.h>
+#include <limits.h>
 #include <stdlib.h>
 
-#define OPENAT_BUFFER_SIZE 512
+/* Maximum number of bytes that it is safe to allocate as a single
+   array on the stack, and that is known as a compile-time constant.
+   The assumption is that we'll touch the array very quickly, or a
+   temporary very near the array, provoking an out-of-memory trap.  On
+   some operating systems, there is only one guard page for the stack,
+   and a page size can be as small as 4096 bytes.  Subtract 64 in the
+   hope that this will let the compiler touch a nearby temporary and
+   provoke a trap.  */
+#define SAFER_ALLOCA_MAX (4096 - 64)
+
+#define SAFER_ALLOCA(m) ((m) < SAFER_ALLOCA_MAX ? (m) : SAFER_ALLOCA_MAX)
+
+#if defined PATH_MAX
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (PATH_MAX)
+#elif defined _XOPEN_PATH_MAX
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (_XOPEN_PATH_MAX)
+#else
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (1024)
+#endif
+
 char *openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file);
 
 /* Trying to access a BUILD_PROC_NAME file will fail on systems without
index 25384127ebf944f7aeb83ef11e40ef19afb34776..186cda0833aa3ede3ff3241292dd4061c434db7d 100644 (file)
@@ -1,6 +1,6 @@
 /* Create /proc/self/fd-related names for subfiles of open directories.
 
-   Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2012 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
 #include <fcntl.h>
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
-#include "dirname.h"
 #include "intprops.h"
-#include "same-inode.h"
-#include "xalloc.h"
 
 /* The results of open() in this file are not used with fchdir,
    and we do not leak fds to any single-threaded code that could use stdio,
@@ -52,7 +50,8 @@
 /* Set BUF to the expansion of PROC_SELF_FD_FORMAT, using FD and FILE
    respectively for %d and %s.  If successful, return BUF if the
    result fits in BUF, dynamically allocated memory otherwise.  But
-   return NULL if /proc is not reliable.  */
+   return NULL if /proc is not reliable, either because the operating
+   system support is lacking or because memory is low.  */
 char *
 openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
 {
@@ -75,20 +74,20 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
          problem is exhibited on code that built on Solaris 8 and
          running on Solaris 10.  */
 
-      int proc_self_fd = open ("/proc/self/fd", O_RDONLY);
+      int proc_self_fd = open ("/proc/self/fd",
+                               O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
       if (proc_self_fd < 0)
         proc_status = -1;
       else
         {
-          struct stat proc_self_fd_dotdot_st;
-          struct stat proc_self_st;
-          char dotdot_buf[PROC_SELF_FD_NAME_SIZE_BOUND (sizeof ".." - 1)];
-          sprintf (dotdot_buf, PROC_SELF_FD_FORMAT, proc_self_fd, "..");
-          proc_status =
-            ((stat (dotdot_buf, &proc_self_fd_dotdot_st) == 0
-              && stat ("/proc/self", &proc_self_st) == 0
-              && SAME_INODE (proc_self_fd_dotdot_st, proc_self_st))
-             ? 1 : -1);
+          /* Detect whether /proc/self/fd/%i/../fd exists, where %i is the
+             number of a file descriptor open on /proc/self/fd.  On Linux,
+             that name resolves to /proc/self/fd, which was opened above.
+             However, on Solaris, it may resolve to /proc/self/fd/fd, which
+             cannot exist, since all names in /proc/self/fd are numeric.  */
+          char dotdot_buf[PROC_SELF_FD_NAME_SIZE_BOUND (sizeof "../fd" - 1)];
+          sprintf (dotdot_buf, PROC_SELF_FD_FORMAT, proc_self_fd, "../fd");
+          proc_status = access (dotdot_buf, F_OK) ? -1 : 1;
           close (proc_self_fd);
         }
     }
@@ -98,7 +97,13 @@ openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
   else
     {
       size_t bufsize = PROC_SELF_FD_NAME_SIZE_BOUND (strlen (file));
-      char *result = (bufsize < OPENAT_BUFFER_SIZE ? buf : xmalloc (bufsize));
+      char *result = buf;
+      if (OPENAT_BUFFER_SIZE < bufsize)
+        {
+          result = malloc (bufsize);
+          if (! result)
+            return NULL;
+        }
       sprintf (result, PROC_SELF_FD_FORMAT, fd, file);
       return result;
     }
index f2eac868d447c9829100f003345cc4d6c31ef785..ac2496e907e3ef22fca2db1434a039e3c3e5c1ec 100644 (file)
@@ -1,5 +1,5 @@
 /* provide a replacement openat function
-   Copyright (C) 2004-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004-2012 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
 
 /* written by Jim Meyering */
 
+/* If the user's config.h happens to include <fcntl.h>, let it include only
+   the system's <fcntl.h> here, so that orig_openat doesn't recurse to
+   rpl_openat.  */
+#define __need_system_fcntl_h
 #include <config.h>
 
+/* Get the original definition of open.  It might be defined as a macro.  */
+#include <fcntl.h>
+#include <sys/types.h>
+#undef __need_system_fcntl_h
+
+#if HAVE_OPENAT
+static inline int
+orig_openat (int fd, char const *filename, int flags, mode_t mode)
+{
+  return openat (fd, filename, flags, mode);
+}
+#endif
+
+/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates
+   this include because of the preliminary #include <fcntl.h> above.  */
+#include "fcntl.h"
+
 #include "openat.h"
 
 #include <stdarg.h>
+#include <stdbool.h>
 #include <stddef.h>
 #include <string.h>
 #include <sys/stat.h>
-
-#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
-#include "openat-priv.h"
-#include "save-cwd.h"
+#include <errno.h>
 
 #if HAVE_OPENAT
 
-# undef openat
-
 /* Like openat, but work around Solaris 9 bugs with trailing slash.  */
 int
 rpl_openat (int dfd, char const *filename, int flags, ...)
@@ -53,7 +70,7 @@ rpl_openat (int dfd, char const *filename, int flags, ...)
       va_end (arg);
     }
 
-#if OPEN_TRAILING_SLASH_BUG
+# if OPEN_TRAILING_SLASH_BUG
   /* If the filename ends in a slash and one of O_CREAT, O_WRONLY, O_RDWR
      is specified, then fail.
      Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html>
@@ -84,11 +101,11 @@ rpl_openat (int dfd, char const *filename, int flags, ...)
           return -1;
         }
     }
-#endif
+# endif
 
-  fd = openat (dfd, filename, flags, mode);
+  fd = orig_openat (dfd, filename, flags, mode);
 
-#if OPEN_TRAILING_SLASH_BUG
+# if OPEN_TRAILING_SLASH_BUG
   /* If the filename ends in a slash and fd does not refer to a directory,
      then fail.
      Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html>
@@ -117,13 +134,17 @@ rpl_openat (int dfd, char const *filename, int flags, ...)
             }
         }
     }
-#endif
+# endif
 
   return fd;
 }
 
 #else /* !HAVE_OPENAT */
 
+# include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+# include "openat-priv.h"
+# include "save-cwd.h"
+
 /* Replacement for Solaris' openat function.
    <http://www.google.com/search?q=openat+site:docs.sun.com>
    First, try to simulate it via open ("/proc/self/fd/FD/FILE").
@@ -159,7 +180,7 @@ openat (int fd, char const *file, int flags, ...)
    directory argument.
 
    If a previous attempt to restore the current working directory
-   failed, then we must not even try to access a `.'-relative name.
+   failed, then we must not even try to access a '.'-relative name.
    It is the caller's responsibility not to call this function
    in that case.  */
 
@@ -244,7 +265,7 @@ bool
 openat_needs_fchdir (void)
 {
   bool needs_fchdir = true;
-  int fd = open ("/", O_RDONLY);
+  int fd = open ("/", O_SEARCH);
 
   if (0 <= fd)
     {
index 11a0314d2426d820ae0c39bfe9e58e8f7eeb6b7d..d646250bb354a19331fc2287741d7961ec20ad66 100644 (file)
@@ -1,5 +1,5 @@
 /* provide a replacement openat function
-   Copyright (C) 2004-2006, 2008-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004-2006, 2008-2012 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
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <dirent.h>
 #include <unistd.h>
 #include <stdbool.h>
 
-#ifndef __attribute__
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
-#  define __attribute__(x) /* empty */
-# endif
-#endif
-
-#ifndef ATTRIBUTE_NORETURN
-# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#endif
-
 #if !HAVE_OPENAT
 
 int openat_permissive (int fd, char const *file, int flags, mode_t mode,
@@ -51,12 +40,15 @@ bool openat_needs_fchdir (void);
 
 #endif
 
-void openat_restore_fail (int) ATTRIBUTE_NORETURN;
-void openat_save_fail (int) ATTRIBUTE_NORETURN;
+_Noreturn void openat_restore_fail (int);
+_Noreturn void openat_save_fail (int);
 
 /* Using these function names makes application code
    slightly more readable than it would be with
    fchownat (..., 0) or fchownat (..., AT_SYMLINK_NOFOLLOW).  */
+
+#if GNULIB_FCHOWNAT
+
 static inline int
 chownat (int fd, char const *file, uid_t owner, gid_t group)
 {
@@ -69,6 +61,10 @@ lchownat (int fd, char const *file, uid_t owner, gid_t group)
   return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
 }
 
+#endif
+
+#if GNULIB_FCHMODAT
+
 static inline int
 chmodat (int fd, char const *file, mode_t mode)
 {
@@ -81,6 +77,10 @@ lchmodat (int fd, char const *file, mode_t mode)
   return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
 }
 
+#endif
+
+#if GNULIB_FSTATAT
+
 static inline int
 statat (int fd, char const *name, struct stat *st)
 {
@@ -93,22 +93,12 @@ lstatat (int fd, char const *name, struct stat *st)
   return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
 }
 
-#if GNULIB_FACCESSAT
+#endif
+
 /* For now, there are no wrappers named laccessat or leuidaccessat,
    since gnulib doesn't support faccessat(,AT_SYMLINK_NOFOLLOW) and
-   since access rights on symlinks are of limited utility.  */
-
-static inline int
-accessat (int fd, char const *file, int mode)
-{
-  return faccessat (fd, file, mode, 0);
-}
-
-static inline int
-euidaccessat (int fd, char const *file, int mode)
-{
-  return faccessat (fd, file, mode, AT_EACCESS);
-}
-#endif
+   since access rights on symlinks are of limited utility.  Likewise,
+   wrappers are not provided for accessat or euidaccessat, so as to
+   avoid dragging in -lgen on some platforms.  */
 
 #endif /* _GL_HEADER_OPENAT */
diff --git a/lib/opendir-safer.c b/lib/opendir-safer.c
new file mode 100644 (file)
index 0000000..4320716
--- /dev/null
@@ -0,0 +1,76 @@
+/* Invoke opendir, but avoid some glitches.
+
+   Copyright (C) 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake.  */
+
+#include <config.h>
+
+#include "dirent-safer.h"
+
+#include <errno.h>
+#include <unistd.h>
+#include "unistd-safer.h"
+
+/* Like opendir, but do not clobber stdin, stdout, or stderr.  */
+
+DIR *
+opendir_safer (char const *name)
+{
+  DIR *dp = opendir (name);
+
+  if (dp)
+    {
+      int fd = dirfd (dp);
+
+      if (0 <= fd && fd <= STDERR_FILENO)
+        {
+          /* If fdopendir is native (as on Linux), then it is safe to
+             assume dirfd(fdopendir(n))==n.  If we are using the
+             gnulib module fdopendir, then this guarantee is not met,
+             but fdopendir recursively calls opendir_safer up to 3
+             times to at least get a safe fd.  If fdopendir is not
+             present but dirfd is accurate (as on cygwin 1.5.x), then
+             we recurse up to 3 times ourselves.  Finally, if dirfd
+             always fails (as on mingw), then we are already safe.  */
+          DIR *newdp;
+          int e;
+#if HAVE_FDOPENDIR || GNULIB_FDOPENDIR
+          int f = dup_safer (fd);
+          if (f < 0)
+            {
+              e = errno;
+              newdp = NULL;
+            }
+          else
+            {
+              newdp = fdopendir (f);
+              e = errno;
+              if (! newdp)
+                close (f);
+            }
+#else /* !FDOPENDIR */
+          newdp = opendir_safer (name);
+          e = errno;
+#endif
+          closedir (dp);
+          errno = e;
+          dp = newdp;
+        }
+    }
+
+  return dp;
+}
diff --git a/lib/opendir.c b/lib/opendir.c
new file mode 100644 (file)
index 0000000..50e25e3
--- /dev/null
@@ -0,0 +1,148 @@
+/* Start reading the entries of a directory.
+   Copyright (C) 2006-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <dirent.h>
+
+#include <errno.h>
+#include <stddef.h>
+
+#if HAVE_OPENDIR
+
+/* Override opendir(), to keep track of the open file descriptors.
+   Needed because there is a function dirfd().  */
+
+#else
+
+# include <stdlib.h>
+
+# include "dirent-private.h"
+# include "filename.h"
+
+#endif
+
+#if REPLACE_FCHDIR
+# include <unistd.h>
+#endif
+
+DIR *
+opendir (const char *dir_name)
+{
+#if HAVE_OPENDIR
+# undef opendir
+  DIR *dirp;
+
+  dirp = opendir (dir_name);
+  if (dirp == NULL)
+    return NULL;
+
+#else
+
+  char dir_name_mask[MAX_PATH + 1 + 1 + 1];
+  int status;
+  HANDLE current;
+  WIN32_FIND_DATA entry;
+  struct gl_directory *dirp;
+
+  if (dir_name[0] == '\0')
+    {
+      errno = ENOENT;
+      return NULL;
+    }
+
+  /* Make the dir_name absolute, so that we continue reading the same
+     directory if the current directory changed between this opendir()
+     call and a subsequent rewinddir() call.  */
+  if (!GetFullPathName (dir_name, MAX_PATH, dir_name_mask, NULL))
+    {
+      errno = EINVAL;
+      return NULL;
+    }
+
+  /* Append the mask.
+     "*" and "*.*" appear to be equivalent.  */
+  {
+    char *p;
+
+    p = dir_name_mask + strlen (dir_name_mask);
+    if (p > dir_name_mask && !ISSLASH (p[-1]))
+      *p++ = '\\';
+    *p++ = '*';
+    *p = '\0';
+  }
+
+  /* Start searching the directory.  */
+  status = -1;
+  current = FindFirstFile (dir_name_mask, &entry);
+  if (current == INVALID_HANDLE_VALUE)
+    {
+      switch (GetLastError ())
+        {
+        case ERROR_FILE_NOT_FOUND:
+          status = -2;
+          break;
+        case ERROR_PATH_NOT_FOUND:
+          errno = ENOENT;
+          return NULL;
+        case ERROR_DIRECTORY:
+          errno = ENOTDIR;
+          return NULL;
+        case ERROR_ACCESS_DENIED:
+          errno = EACCES;
+          return NULL;
+        default:
+          errno = EIO;
+          return NULL;
+        }
+    }
+
+  /* Allocate the result.  */
+  dirp =
+    (struct gl_directory *)
+    malloc (offsetof (struct gl_directory, dir_name_mask[0])
+            + strlen (dir_name_mask) + 1);
+  if (dirp == NULL)
+    {
+      if (current != INVALID_HANDLE_VALUE)
+        FindClose (current);
+      errno = ENOMEM;
+      return NULL;
+    }
+  dirp->status = status;
+  dirp->current = current;
+  if (status == -1)
+    memcpy (&dirp->entry, &entry, sizeof (WIN32_FIND_DATA));
+  strcpy (dirp->dir_name_mask, dir_name_mask);
+
+#endif
+
+#if REPLACE_FCHDIR
+  {
+    int fd = dirfd (dirp);
+    if (0 <= fd && _gl_register_fd (fd, dir_name) != fd)
+      {
+        int saved_errno = errno;
+        closedir (dirp);
+        errno = saved_errno;
+        return NULL;
+      }
+  }
+#endif
+
+  return dirp;
+}
diff --git a/lib/pathmax.h b/lib/pathmax.h
new file mode 100644 (file)
index 0000000..03db7cb
--- /dev/null
@@ -0,0 +1,83 @@
+/* Define PATH_MAX somehow.  Requires sys/types.h.
+   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _PATHMAX_H
+# define _PATHMAX_H
+
+/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename,
+   including the terminating NUL byte.
+   <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html>
+   PATH_MAX is not defined on systems which have no limit on filename length,
+   such as GNU/Hurd.
+
+   This file does *not* define PATH_MAX always.  Programs that use this file
+   can handle the GNU/Hurd case in several ways:
+     - Either with a package-wide handling, or with a per-file handling,
+     - Either through a
+         #ifdef PATH_MAX
+       or through a fallback like
+         #ifndef PATH_MAX
+         # define PATH_MAX 8192
+         #endif
+       or through a fallback like
+         #ifndef PATH_MAX
+         # define PATH_MAX pathconf ("/", _PC_PATH_MAX)
+         #endif
+ */
+
+# include <unistd.h>
+
+# include <limits.h>
+
+# ifndef _POSIX_PATH_MAX
+#  define _POSIX_PATH_MAX 256
+# endif
+
+/* Don't include sys/param.h if it already has been.  */
+# if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+#  include <sys/param.h>
+# endif
+
+# if !defined PATH_MAX && defined MAXPATHLEN
+#  define PATH_MAX MAXPATHLEN
+# endif
+
+# ifdef __hpux
+/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename,
+   *not* including the terminating NUL byte, and is set to 1023.
+   Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is
+   not defined at all any more.  */
+#  undef PATH_MAX
+#  define PATH_MAX 1024
+# endif
+
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com,
+   section "Maximum Path Length Limitation",
+   <http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx#maxpath>
+   explains that the maximum size of a filename, including the terminating
+   NUL byte, is 260 = 3 + 256 + 1.
+   This is the same value as
+     - FILENAME_MAX in <stdio.h>,
+     - _MAX_PATH in <stdlib.h>,
+     - MAX_PATH in <windef.h>.
+   Undefine the original value, because mingw's <limits.h> gets it wrong.  */
+#  undef PATH_MAX
+#  define PATH_MAX 260
+# endif
+
+#endif /* _PATHMAX_H */
index bc3c764911dfec960ea29b9bee85db4b0f43ada3..4853d1b14a5b02bbbf67d9144aa25bee579c970c 100644 (file)
@@ -1,5 +1,5 @@
 /* Print a message describing error code.
-   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2008-2012 Free Software Foundation, Inc.
    Written by Bruno Haible and Simon Josefsson.
 
    This program is free software: you can redistribute it and/or modify
 #include <stdio.h>
 
 #include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 
+#include "strerror-override.h"
+
+/* Use the system functions, not the gnulib overrides in this file.  */
+#undef fprintf
+
 void
 perror (const char *string)
 {
-  const char *errno_description = strerror (errno);
+  char stackbuf[STACKBUF_LEN];
+  int ret;
+
+  /* Our implementation guarantees that this will be a non-empty
+     string, even if it returns EINVAL; and stackbuf should be sized
+     large enough to avoid ERANGE.  */
+  ret = strerror_r (errno, stackbuf, sizeof stackbuf);
+  if (ret == ERANGE)
+    abort ();
 
   if (string != NULL && *string != '\0')
-    fprintf (stderr, "%s: %s\n", string, errno_description);
+    fprintf (stderr, "%s: %s\n", string, stackbuf);
   else
-    fprintf (stderr, "%s\n", errno_description);
+    fprintf (stderr, "%s\n", stackbuf);
 }
index ae9f2e3e0fe76bd66bb0a309a70e308461d2c284..d6dce5ffc18e7076d7e37eed2cbbb2f5b60f1944 100644 (file)
@@ -1,5 +1,5 @@
 /* Invoke pipe, but avoid some glitches.
-   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2012 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
index 452ce405816fdd68e25ae85075472071cb86b8a5..47b20dc238bc78d6ae94db11a00c801b0daac746 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2010 Free Software
+   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -15,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* This file can be parametrized with the following macros:
      ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
index 100cbbdf1963ee4ff61686b29ab0c636d33364ce..aa811aff549353a7d330aa5338fb19c7dd429c08 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2006-2007, 2009-2010 Free Software
+   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -15,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _PRINTF_ARGS_H
 #define _PRINTF_ARGS_H
@@ -138,10 +135,14 @@ typedef struct
 }
 argument;
 
+/* Number of directly allocated arguments (no malloc() needed).  */
+#define N_DIRECT_ALLOC_ARGUMENTS 7
+
 typedef struct
 {
   size_t count;
   argument *arg;
+  argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS];
 }
 arguments;
 
index 1a53846851e973b662d9eae050ecfaf33575fb9c..eb47205a2670f729f9ecbf89559ff9099d32d624 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a double into fraction and mantissa, for hexadecimal printf.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
@@ -14,7 +14,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include <config.h>
+#if ! defined USE_LONG_DOUBLE
+# include <config.h>
+#endif
 
 /* Specification.  */
 #ifdef USE_LONG_DOUBLE
index 0dc60f8ff50c832fdf1e3bbd3cdf1d1162a26e35..985d7d29e565b04f3f020455a9eb3af2a5024cda 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a double into fraction and mantissa, for hexadecimal printf.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
index 36bac7492b2cbb6991ec4451414c06ebd4e2b380..568d2ffc90638c2d080a12aa788d912efa755ceb 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a 'long double' into fraction and mantissa, for hexadecimal printf.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#define USE_LONG_DOUBLE
-#include "printf-frexp.c"
+#include <config.h>
+
+#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+
+/* Specification.  */
+# include "printf-frexpl.h"
+
+# include "printf-frexp.h"
+
+long double
+printf_frexpl (long double x, int *expptr)
+{
+  return printf_frexp (x, expptr);
+}
+
+#else
+
+# define USE_LONG_DOUBLE
+# include "printf-frexp.c"
+
+#endif
index 1b5f7f779b56563af80726600bb35e5edbe6cd17..341ddedc4a3bfb66bc0bcc828f9a508969ae1886 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a 'long double' into fraction and mantissa, for hexadecimal printf.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
index 206a62bc9e061a746be27c8eab91f3cf27a60dea..308a1755b1a1ae98a03b1712940224b36e6dc784 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2012 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
@@ -14,8 +12,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* This file can be parametrized with the following macros:
      CHAR_T             The element type of the format string.
@@ -65,6 +62,9 @@
 /* malloc(), realloc(), free().  */
 #include <stdlib.h>
 
+/* memcpy().  */
+#include <string.h>
+
 /* errno.  */
 #include <errno.h>
 
@@ -82,23 +82,20 @@ STATIC
 int
 PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
 {
-  const CHAR_T *cp = format;            /* pointer into format */
+  const CHAR_T *cp = format;    /* pointer into format */
   size_t arg_posn = 0;          /* number of regular arguments consumed */
-  size_t d_allocated;                   /* allocated elements of d->dir */
-  size_t a_allocated;                   /* allocated elements of a->arg */
+  size_t d_allocated;           /* allocated elements of d->dir */
+  size_t a_allocated;           /* allocated elements of a->arg */
   size_t max_width_length = 0;
   size_t max_precision_length = 0;
 
   d->count = 0;
-  d_allocated = 1;
-  d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE));
-  if (d->dir == NULL)
-    /* Out of memory.  */
-    goto out_of_memory_1;
+  d_allocated = N_DIRECT_ALLOC_DIRECTIVES;
+  d->dir = d->direct_alloc_dir;
 
   a->count = 0;
-  a_allocated = 0;
-  a->arg = NULL;
+  a_allocated = N_DIRECT_ALLOC_ARGUMENTS;
+  a->arg = a->direct_alloc_arg;
 
 #define REGISTER_ARG(_index_,_type_) \
   {                                                                     \
@@ -115,12 +112,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
         if (size_overflow_p (memory_size))                              \
           /* Overflow, would lead to out of memory.  */                 \
           goto out_of_memory;                                           \
-        memory = (argument *) (a->arg                                   \
+        memory = (argument *) (a->arg != a->direct_alloc_arg            \
                                ? realloc (a->arg, memory_size)          \
                                : malloc (memory_size));                 \
         if (memory == NULL)                                             \
           /* Out of memory.  */                                         \
           goto out_of_memory;                                           \
+        if (a->arg == a->direct_alloc_arg)                              \
+          memcpy (memory, a->arg, a->count * sizeof (argument));        \
         a->arg = memory;                                                \
       }                                                                 \
     while (a->count <= n)                                               \
@@ -208,6 +207,13 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                   dp->flags |= FLAG_ZERO;
                   cp++;
                 }
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
+              else if (*cp == 'I')
+                {
+                  dp->flags |= FLAG_LOCALIZED;
+                  cp++;
+                }
+#endif
               else
                 break;
             }
@@ -414,7 +420,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                     }
 #endif
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-                  /* On native Win32, PRIdMAX is defined as "I64d".
+                  /* On native Windows, PRIdMAX is defined as "I64d".
                      We cannot change it to "lld" because PRIdMAX must also
                      be understood by the system's printf routines.  */
                   else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
@@ -583,10 +589,14 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
               if (size_overflow_p (memory_size))
                 /* Overflow, would lead to out of memory.  */
                 goto out_of_memory;
-              memory = (DIRECTIVE *) realloc (d->dir, memory_size);
+              memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir
+                                      ? realloc (d->dir, memory_size)
+                                      : malloc (memory_size));
               if (memory == NULL)
                 /* Out of memory.  */
                 goto out_of_memory;
+              if (d->dir == d->direct_alloc_dir)
+                memcpy (memory, d->dir, d->count * sizeof (DIRECTIVE));
               d->dir = memory;
             }
         }
@@ -605,19 +615,18 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
   return 0;
 
 error:
-  if (a->arg)
+  if (a->arg != a->direct_alloc_arg)
     free (a->arg);
-  if (d->dir)
+  if (d->dir != d->direct_alloc_dir)
     free (d->dir);
   errno = EINVAL;
   return -1;
 
 out_of_memory:
-  if (a->arg)
+  if (a->arg != a->direct_alloc_arg)
     free (a->arg);
-  if (d->dir)
+  if (d->dir != d->direct_alloc_dir)
     free (d->dir);
-out_of_memory_1:
   errno = ENOMEM;
   return -1;
 }
index 67b79843c3a1b71bb6bf7012ab09115049e67b3d..577099a50ed93962b6db497697f24875278e6a87 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Parse printf format string.
-   Copyright (C) 1999, 2002-2003, 2005, 2007, 2009-2010 Free Software
+   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2012 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -15,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _PRINTF_PARSE_H
 #define _PRINTF_PARSE_H
      ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
      STATIC             Set to 'static' to declare the function static.  */
 
+#if HAVE_FEATURES_H
+# include <features.h> /* for __GLIBC__, __UCLIBC__ */
+#endif
+
 #include "printf-args.h"
 
 
@@ -35,6 +36,9 @@
 #define FLAG_SPACE       8      /* space flag */
 #define FLAG_ALT        16      /* # flag */
 #define FLAG_ZERO       32
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
+# define FLAG_LOCALIZED 64      /* I flag, uses localized digits */
+#endif
 
 /* arg_index value indicating that no argument is consumed.  */
 #define ARG_NONE        (~(size_t)0)
@@ -42,6 +46,9 @@
 /* xxx_directive: A parsed directive.
    xxx_directives: A parsed format string.  */
 
+/* Number of directly allocated directives (no malloc() needed).  */
+#define N_DIRECT_ALLOC_DIRECTIVES 7
+
 /* A parsed directive.  */
 typedef struct
 {
@@ -66,6 +73,7 @@ typedef struct
   char_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
+  char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
 }
 char_directives;
 
@@ -95,6 +103,7 @@ typedef struct
   u8_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
+  u8_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
 }
 u8_directives;
 
@@ -122,6 +131,7 @@ typedef struct
   u16_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
+  u16_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
 }
 u16_directives;
 
@@ -149,6 +159,7 @@ typedef struct
   u32_directive *dir;
   size_t max_width_length;
   size_t max_precision_length;
+  u32_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES];
 }
 u32_directives;
 
index d09608675bc00b511a8e412e7cb4c4dc868a662b..bd64612f5d66d976a8ba40f526d1ed7fbd732510 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to a stream.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2010-2012 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
diff --git a/lib/quote.h b/lib/quote.h
new file mode 100644 (file)
index 0000000..b30b166
--- /dev/null
@@ -0,0 +1,33 @@
+/* quote.h - prototypes for quote.c
+
+   Copyright (C) 1998-2001, 2003, 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef QUOTE_H_
+# define QUOTE_H_ 1
+
+/* The quoting options used by quote_n and quote.  Its type is incomplete,
+   so it's useful only in expressions like '&quote_quoting_options'.  */
+extern struct quoting_options quote_quoting_options;
+
+/* Return an unambiguous printable representation of NAME,
+   allocated in slot N, suitable for diagnostics.  */
+char const *quote_n (int n, char const *name);
+
+/* Return an unambiguous printable representation of NAME,
+   suitable for diagnostics.  */
+char const *quote (char const *name);
+
+#endif /* !QUOTE_H_ */
index 5418f512bcff0a12cdbf021af4328da593ccdb13..1ea583d9c2a8ac5c2924a0bf49341aab3e34f9b4 100644 (file)
@@ -1,7 +1,6 @@
 /* quotearg.c - quote arguments for output
 
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008,
-   2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1998-2002, 2004-2012 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
 
 /* Written by Paul Eggert <eggert@twinsun.com> */
 
+/* Without this pragma, gcc 4.7.0 20111124 mistakenly suggests that
+   the quoting_options_from_style function might be candidate for
+   attribute 'pure'  */
+#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
+#endif
+
 #include <config.h>
 
 #include "quotearg.h"
+#include "quote.h"
 
 #include "xalloc.h"
+#include "c-strcaseeq.h"
+#include "localcharset.h"
 
 #include <ctype.h>
 #include <errno.h>
@@ -166,25 +175,54 @@ set_custom_quoting (struct quoting_options *o,
 }
 
 /* Return quoting options for STYLE, with no extra quoting.  */
-static struct quoting_options
+static struct quoting_options /* NOT PURE!! */
 quoting_options_from_style (enum quoting_style style)
 {
-  struct quoting_options o;
+  struct quoting_options o = { 0, 0, { 0 }, NULL, NULL };
+  if (style == custom_quoting_style)
+    abort ();
   o.style = style;
-  o.flags = 0;
-  memset (o.quote_these_too, 0, sizeof o.quote_these_too);
   return o;
 }
 
 /* MSGID approximates a quotation mark.  Return its translation if it
-   has one; otherwise, return either it or "\"", depending on S.  */
+   has one; otherwise, return either it or "\"", depending on S.
+
+   S is either clocale_quoting_style or locale_quoting_style.  */
 static char const *
 gettext_quote (char const *msgid, enum quoting_style s)
 {
   char const *translation = _(msgid);
-  if (translation == msgid && s == clocale_quoting_style)
-    translation = "\"";
-  return translation;
+  char const *locale_code;
+
+  if (translation != msgid)
+    return translation;
+
+  /* For UTF-8 and GB-18030, use single quotes U+2018 and U+2019.
+     Here is a list of other locales that include U+2018 and U+2019:
+
+        ISO-8859-7   0xA1                 KOI8-T       0x91
+        CP869        0x8B                 CP874        0x91
+        CP932        0x81 0x65            CP936        0xA1 0xAE
+        CP949        0xA1 0xAE            CP950        0xA1 0xA5
+        CP1250       0x91                 CP1251       0x91
+        CP1252       0x91                 CP1253       0x91
+        CP1254       0x91                 CP1255       0x91
+        CP1256       0x91                 CP1257       0x91
+        EUC-JP       0xA1 0xC6            EUC-KR       0xA1 0xAE
+        EUC-TW       0xA1 0xE4            BIG5         0xA1 0xA5
+        BIG5-HKSCS   0xA1 0xA5            EUC-CN       0xA1 0xAE
+        GBK          0xA1 0xAE            Georgian-PS  0x91
+        PT154        0x91
+
+     None of these is still in wide use; using iconv is overkill.  */
+  locale_code = locale_charset ();
+  if (STRCASEEQ (locale_code, "UTF-8", 'U','T','F','-','8',0,0,0,0))
+    return msgid[0] == '`' ? "\xe2\x80\x98": "\xe2\x80\x99";
+  if (STRCASEEQ (locale_code, "GB18030", 'G','B','1','8','0','3','0',0,0))
+    return msgid[0] == '`' ? "\xa1\ae": "\xa1\xaf";
+
+  return (s == clocale_quoting_style ? "\"" : "'");
 }
 
 /* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
@@ -252,22 +290,24 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
           {
             /* TRANSLATORS:
                Get translations for open and closing quotation marks.
-
                The message catalog should translate "`" to a left
                quotation mark suitable for the locale, and similarly for
-               "'".  If the catalog has no translation,
-               locale_quoting_style quotes `like this', and
-               clocale_quoting_style quotes "like this".
-
-               For example, an American English Unicode locale should
-               translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and
-               should translate "'" to U+201D (RIGHT DOUBLE QUOTATION
-               MARK).  A British English Unicode locale should instead
-               translate these to U+2018 (LEFT SINGLE QUOTATION MARK)
-               and U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
+               "'".  For example, a French Unicode local should translate
+               these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+               QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+               QUOTATION MARK), respectively.
+
+               If the catalog has no translation, we will try to
+               use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+               Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+               current locale is not Unicode, locale_quoting_style
+               will quote 'like this', and clocale_quoting_style will
+               quote "like this".  You should always include translations
+               for "`" and "'" even if U+2018 and U+2019 are appropriate
+               for your locale.
 
                If you don't know what to put here, please see
-               <http://en.wikipedia.org/wiki/Quotation_mark#Glyphs>
+               <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
                and use glyphs suitable for your language.  */
             left_quote = gettext_quote (N_("`"), quoting_style);
             right_quote = gettext_quote (N_("'"), quoting_style);
@@ -731,7 +771,7 @@ quotearg_n_options (int n, char const *arg, size_t argsize,
 
   if (nslots <= n0)
     {
-      /* FIXME: technically, the type of n1 should be `unsigned int',
+      /* FIXME: technically, the type of n1 should be 'unsigned int',
          but that evokes an unsuppressible warning from gcc-4.0.1 and
          older.  If gcc ever provides an option to suppress that warning,
          revert to the original type, so that the test in xalloc_oversized
@@ -887,3 +927,25 @@ quotearg_custom_mem (char const *left_quote, char const *right_quote,
   return quotearg_n_custom_mem (0, left_quote, right_quote, arg,
                                 argsize);
 }
+
+
+/* The quoting option used by quote_n and quote.  */
+struct quoting_options quote_quoting_options =
+  {
+    locale_quoting_style,
+    0,
+    { 0 },
+    NULL, NULL
+  };
+
+char const *
+quote_n (int n, char const *name)
+{
+  return quotearg_n_options (n, name, SIZE_MAX, &quote_quoting_options);
+}
+
+char const *
+quote (char const *name)
+{
+  return quote_n (0, name);
+}
index 084cd1b2de64482ec33c30133c036787f9d9c107..e6b08ab2307e1b87d55dd7d730a0b7125e70c5c1 100644 (file)
@@ -1,7 +1,7 @@
 /* quotearg.h - quote arguments for output
 
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2006, 2008, 2009, 2010
-   Free Software Foundation, Inc.
+   Copyright (C) 1998-2002, 2004, 2006, 2008-2012 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
@@ -112,8 +112,10 @@ enum quoting_style
     */
     escape_quoting_style,
 
-    /* Like clocale_quoting_style, but quote `like this' instead of
-       "like this" in the default C locale (ls --quoting-style=locale).
+    /* Like clocale_quoting_style, but use single quotes in the
+       default C locale or if the program does not use gettext
+       (ls --quoting-style=locale).  For UTF-8 locales, quote
+       characters will use Unicode.
 
        LC_MESSAGES=C
        quotearg_buffer:
diff --git a/lib/readdir.c b/lib/readdir.c
new file mode 100644 (file)
index 0000000..28aff9c
--- /dev/null
@@ -0,0 +1,98 @@
+/* Read the next entry of a directory.
+   Copyright (C) 2011-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <dirent.h>
+
+#include <errno.h>
+#include <stddef.h>
+
+#include "dirent-private.h"
+
+struct dirent *
+readdir (DIR *dirp)
+{
+  char type;
+  struct dirent *result;
+
+  /* There is no need to add code to produce entries for "." and "..".
+     According to the POSIX:2008 section "4.12 Pathname Resolution"
+     <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html>
+     "." and ".." are syntactic entities.
+     POSIX also says:
+       "If entries for dot or dot-dot exist, one entry shall be returned
+        for dot and one entry shall be returned for dot-dot; otherwise,
+        they shall not be returned."  */
+
+  switch (dirp->status)
+    {
+    case -2:
+      /* End of directory already reached.  */
+      return NULL;
+    case -1:
+      break;
+    case 0:
+      if (!FindNextFile (dirp->current, &dirp->entry))
+        {
+          switch (GetLastError ())
+            {
+            case ERROR_NO_MORE_FILES:
+              dirp->status = -2;
+              return NULL;
+            default:
+              errno = EIO;
+              return NULL;
+            }
+        }
+      break;
+    default:
+      errno = dirp->status;
+      return NULL;
+    }
+
+  dirp->status = 0;
+
+  if (dirp->entry.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+    type = DT_DIR;
+  else if (dirp->entry.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
+    type = DT_LNK;
+  else if ((dirp->entry.dwFileAttributes
+            & ~(FILE_ATTRIBUTE_READONLY
+                | FILE_ATTRIBUTE_HIDDEN
+                | FILE_ATTRIBUTE_SYSTEM
+                | FILE_ATTRIBUTE_ARCHIVE
+                | FILE_ATTRIBUTE_NORMAL
+                | FILE_ATTRIBUTE_TEMPORARY
+                | FILE_ATTRIBUTE_SPARSE_FILE
+                | FILE_ATTRIBUTE_COMPRESSED
+                | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
+                | FILE_ATTRIBUTE_ENCRYPTED)) == 0)
+    /* Devices like COM1, LPT1, NUL would also have the attributes 0x20 but
+       they cannot occur here.  */
+    type = DT_REG;
+  else
+    type = DT_UNKNOWN;
+
+  /* Reuse the memory of dirp->entry for the result.  */
+  result =
+    (struct dirent *)
+    ((char *) dirp->entry.cFileName - offsetof (struct dirent, d_name[0]));
+  result->d_type = type;
+
+  return result;
+}
index 36aeecc41b7203574b658edaebb6bd9975c9f737..99556ccf9c32fb72a9fcf49535d7d1a88f7481bb 100644 (file)
@@ -1,6 +1,6 @@
 /* realloc() function that is glibc compatible.
 
-   Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2010 Free Software
+   Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
 
 /* written by Jim Meyering and Bruno Haible */
 
+#define _GL_USE_STDLIB_ALLOC 1
 #include <config.h>
 
 /* Only the AC_FUNC_REALLOC macro defines 'realloc' already in config.h.  */
 #ifdef realloc
 # define NEED_REALLOC_GNU 1
+/* Whereas the gnulib module 'realloc-gnu' defines HAVE_REALLOC_GNU.  */
+#elif GNULIB_REALLOC_GNU && !HAVE_REALLOC_GNU
+# define NEED_REALLOC_GNU 1
 #endif
 
 /* Infer the properties of the system's malloc function.
-   Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h.  */
-#if GNULIB_MALLOC_GNU && !defined malloc
+   The gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU.  */
+#if GNULIB_MALLOC_GNU && HAVE_MALLOC_GNU
 # define SYSTEM_MALLOC_GLIBC_COMPATIBLE 1
 #endif
 
-/* Below we want to call the system's malloc and realloc.
-   Undefine the symbols here so that including <stdlib.h> provides a
-   declaration of malloc(), not of rpl_malloc(), and likewise for realloc.  */
-#undef malloc
-#undef realloc
-
-/* Specification.  */
 #include <stdlib.h>
 
 #include <errno.h>
 
-/* Below we want to call the system's malloc and realloc.
-   Undefine the symbols, if they were defined by gnulib's <stdlib.h>
-   replacement.  */
-#undef malloc
-#undef realloc
-
 /* Change the size of an allocated block of memory P to N bytes,
    with error checking.  If N is zero, change it to 1.  If P is NULL,
    use malloc.  */
index dbb61df3dc7c7a8d621518af8941004687180f53..4ec043f87d0a72d118cd0b4c82551374135a6f60 100644 (file)
@@ -1,6 +1,6 @@
 # Add this package to a list of references stored in a text file.
 #
-#   Copyright (C) 2000, 2009, 2010 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009-2012 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
@@ -13,8 +13,7 @@
 #   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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#   with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # Written by Bruno Haible <haible@clisp.cons.org>.
 #
index 4c31a6eafd83f02ef617a58cb6464eb13e05a19c..eb0388117b6b54873360982ba0d170a6b95a7444 100644 (file)
@@ -1,6 +1,6 @@
 # Remove this package from a list of references stored in a text file.
 #
-#   Copyright (C) 2000, 2009, 2010 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2009-2012 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
@@ -13,8 +13,7 @@
 #   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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#   with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # Written by Bruno Haible <haible@clisp.cons.org>.
 #
diff --git a/lib/rmdir.c b/lib/rmdir.c
deleted file mode 100644 (file)
index 36a6118..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Work around rmdir bugs.
-
-   Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-#include <unistd.h>
-
-#include <errno.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#undef rmdir
-
-/* Remove directory DIR.
-   Return 0 if successful, -1 if not.  */
-
-int
-rpl_rmdir (char const *dir)
-{
-#if HAVE_RMDIR
-  /* Work around cygwin 1.5.x bug where rmdir("dir/./") succeeds.  */
-  size_t len = strlen (dir);
-  int result;
-  while (len && ISSLASH (dir[len - 1]))
-    len--;
-  if (len && dir[len - 1] == '.' && (1 == len || ISSLASH (dir[len - 2])))
-    {
-      errno = EINVAL;
-      return -1;
-    }
-  result = rmdir (dir);
-  /* Work around mingw bug, where rmdir("file/") fails with EINVAL
-     instead of ENOTDIR.  We've already filtered out trailing ., the
-     only reason allowed by POSIX for EINVAL.  */
-  if (result == -1 && errno == EINVAL)
-    errno = ENOTDIR;
-  return result;
-
-#else /* !HAVE_RMDIR */
-  /* rmdir adapted from GNU tar.  FIXME: Delete this implementation in
-     2010 if no one reports a system with missing rmdir.  */
-  pid_t cpid;
-  int status;
-  struct stat statbuf;
-
-  if (stat (dir, &statbuf) != 0)
-    return -1;                  /* errno already set */
-
-  if (!S_ISDIR (statbuf.st_mode))
-    {
-      errno = ENOTDIR;
-      return -1;
-    }
-
-  cpid = fork ();
-  switch (cpid)
-    {
-    case -1:                    /* cannot fork */
-      return -1;                /* errno already set */
-
-    case 0:                     /* child process */
-      execl ("/bin/rmdir", "rmdir", dir, (char *) 0);
-      _exit (1);
-
-    default:                    /* parent process */
-
-      /* Wait for kid to finish.  */
-
-      while (wait (&status) != cpid)
-        /* Do nothing.  */ ;
-
-      if (status)
-        {
-
-          /* /bin/rmdir failed.  */
-
-          errno = EIO;
-          return -1;
-        }
-      return 0;
-    }
-#endif /* !HAVE_RMDIR */
-}
diff --git a/lib/same-inode.h b/lib/same-inode.h
deleted file mode 100644 (file)
index e978abb..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Determine whether two stat buffers refer to the same file.
-
-   Copyright (C) 2006, 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef SAME_INODE_H
-# define SAME_INODE_H 1
-
-# 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)
-
-#endif
index 7394d50acce33b67a4b6351552d79ba7c799370e..592d274eeca10144d686161572b34bbc9297892f 100644 (file)
@@ -1,6 +1,6 @@
 /* save-cwd.c -- Save and restore current working directory.
 
-   Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2010 Free Software
+   Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -30,7 +30,7 @@
 
 #include "chdir-long.h"
 #include "unistd--.h"
-#include "xgetcwd.h"
+#include "cloexec.h"
 
 #if GNULIB_FCNTL_SAFER
 # include "fcntl--.h"
 # define GNULIB_FCNTL_SAFER 0
 #endif
 
-/* On systems without the fchdir function (WOE), pretend that open
-   always returns -1 so that save_cwd resorts to using xgetcwd.
-   Since chdir_long requires fchdir, use chdir instead.  */
-#if !HAVE_FCHDIR
-# undef open
-# define open(File, Flags) (-1)
-# undef fchdir
-# define fchdir(Fd) (abort (), -1)
-# undef chdir_long
-# define chdir_long(Dir) chdir (Dir)
-#endif
-
 /* Record the location of the current working directory in CWD so that
    the program may change to other directories and later use restore_cwd
    to return to the recorded location.  This function may allocate
-   space using malloc (via xgetcwd) or leave a file descriptor open;
+   space using malloc (via getcwd) or leave a file descriptor open;
    use free_cwd to perform the necessary free or close.  Upon failure,
    no memory is allocated, any locally opened file descriptors are
    closed;  return non-zero -- in that case, free_cwd need not be
    called, but doing so is ok.  Otherwise, return zero.
 
-   The `raison d'etre' for this interface is that the working directory
+   The _raison d'etre_ for this interface is that the working directory
    is sometimes inaccessible, and getcwd is not robust or as efficient.
    So, we prefer to use the open/fchdir approach, but fall back on
-   getcwd if necessary.
+   getcwd if necessary.  This module works for most cases with just
+   the getcwd-lgpl module, but to be truly robust, use the getcwd module.
 
    Some systems lack fchdir altogether: e.g., OS/2, pre-2001 Cygwin,
    SCO Xenix.  Also, SunOS 4 and Irix 5.3 provide the function, yet it
@@ -75,15 +64,16 @@ save_cwd (struct saved_cwd *cwd)
 {
   cwd->name = NULL;
 
-  cwd->desc = open (".", O_RDONLY);
+  cwd->desc = open (".", O_SEARCH);
   if (!GNULIB_FCNTL_SAFER)
     cwd->desc = fd_safer (cwd->desc);
   if (cwd->desc < 0)
     {
-      cwd->name = xgetcwd ();
+      cwd->name = getcwd (NULL, 0);
       return cwd->name ? 0 : -1;
     }
 
+  set_cloexec_flag (cwd->desc, true);
   return 0;
 }
 
index 955f846e61be7c3d9fe5d2e5858e6e01675c117b..0c875da284a2f6b12562620a766c78ffb49a2453 100644 (file)
@@ -1,6 +1,6 @@
 /* Save and restore current working directory.
 
-   Copyright (C) 1995, 1997-1998, 2003, 2009-2010 Free Software Foundation,
+   Copyright (C) 1995, 1997-1998, 2003, 2009-2012 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
diff --git a/lib/savedir.c b/lib/savedir.c
new file mode 100644 (file)
index 0000000..95dc6c6
--- /dev/null
@@ -0,0 +1,145 @@
+/* savedir.c -- save the list of files in a directory in a string
+
+   Copyright (C) 1990, 1997-2001, 2003-2006, 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
+
+#include <config.h>
+
+#include "savedir.h"
+
+#include <sys/types.h>
+
+#include <errno.h>
+
+#include "dirent--.h"
+#ifndef _D_EXACT_NAMLEN
+# define _D_EXACT_NAMLEN(dp)    strlen ((dp)->d_name)
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "xalloc.h"
+
+#ifndef NAME_SIZE_DEFAULT
+# define NAME_SIZE_DEFAULT 512
+#endif
+
+/* Return a freshly allocated string containing the file names
+   in directory DIRP, separated by '\0' characters;
+   the end is marked by two '\0' characters in a row.
+   Return NULL (setting errno) if DIRP cannot be read.
+   If DIRP is NULL, return NULL without affecting errno.  */
+
+char *
+streamsavedir (DIR *dirp)
+{
+  char *name_space;
+  size_t allocated = NAME_SIZE_DEFAULT;
+  size_t used = 0;
+  int save_errno;
+
+  if (dirp == NULL)
+    return NULL;
+
+  name_space = xmalloc (allocated);
+
+  for (;;)
+    {
+      struct dirent const *dp;
+      char const *entry;
+
+      errno = 0;
+      dp = readdir (dirp);
+      if (! dp)
+        break;
+
+      /* Skip "", ".", and "..".  "" is returned by at least one buggy
+         implementation: Solaris 2.4 readdir on NFS file systems.  */
+      entry = dp->d_name;
+      if (entry[entry[0] != '.' ? 0 : entry[1] != '.' ? 1 : 2] != '\0')
+        {
+          size_t entry_size = _D_EXACT_NAMLEN (dp) + 1;
+          if (used + entry_size < used)
+            xalloc_die ();
+          if (allocated <= used + entry_size)
+            {
+              do
+                {
+                  if (2 * allocated < allocated)
+                    xalloc_die ();
+                  allocated *= 2;
+                }
+              while (allocated <= used + entry_size);
+
+              name_space = xrealloc (name_space, allocated);
+            }
+          memcpy (name_space + used, entry, entry_size);
+          used += entry_size;
+        }
+    }
+  name_space[used] = '\0';
+  save_errno = errno;
+  if (save_errno != 0)
+    {
+      free (name_space);
+      errno = save_errno;
+      return NULL;
+    }
+  return name_space;
+}
+
+/* Like streamsavedir (DIRP), except also close DIRP.  */
+
+static char *
+savedirstream (DIR *dirp)
+{
+  char *name_space = streamsavedir (dirp);
+  if (dirp && closedir (dirp) != 0)
+    {
+      int save_errno = errno;
+      free (name_space);
+      errno = save_errno;
+      return NULL;
+    }
+  return name_space;
+}
+
+/* Return a freshly allocated string containing the file names
+   in directory DIR, separated by '\0' characters;
+   the end is marked by two '\0' characters in a row.
+   Return NULL (setting errno) if DIR cannot be opened, read, or closed.  */
+
+char *
+savedir (char const *dir)
+{
+  return savedirstream (opendir (dir));
+}
+
+/* Return a freshly allocated string containing the file names
+   in directory FD, separated by '\0' characters;
+   the end is marked by two '\0' characters in a row.
+   Return NULL (setting errno) if FD cannot be read or closed.  */
+
+/* deprecated */
+char *
+fdsavedir (int fd)
+{
+  return savedirstream (fdopendir (fd));
+}
diff --git a/lib/savedir.h b/lib/savedir.h
new file mode 100644 (file)
index 0000000..aeb392c
--- /dev/null
@@ -0,0 +1,29 @@
+/* Save the list of files in a directory in a string.
+
+   Copyright (C) 1997, 1999, 2001, 2003, 2005, 2009-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
+
+#ifndef _GL_SAVEDIR_H
+#define _GL_SAVEDIR_H
+
+#include <dirent.h>
+char *streamsavedir (DIR *dirp);
+char *savedir (char const *dir);
+char *fdsavedir (int fd); /* deprecated */
+
+#endif
index 3645615ea99915a6fac4b697f71a1958f93d752a..7629ff5005f03014bf70080ab792437a6b6a2266 100644 (file)
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
index becc7e0c4eed2bdb3c1b13dc1055f79e1f861765..f99f992091ad2157c28647d5976e85e62de78c74 100644 (file)
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
index c0dd49fa8ab683d1583464ea27a277911adf2b7c..35afcf1ae7d63376582b4138ced19f08941a814f 100644 (file)
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2012 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
index 58443ab660fa488823dc6ccd0c5ab4b7fd2e8831..964244195962132f9c3c5736a837e1a54ba8e69d 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* size_max.h -- declare SIZE_MAX through system headers
-   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
@@ -15,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef GNULIB_SIZE_MAX_H
 #define GNULIB_SIZE_MAX_H
index 16300485f328ef9ce69230fe337d31987f7067cb..30c2acdab63637b73c590bfb91e06502839bcf94 100644 (file)
@@ -1,6 +1,6 @@
 /* stat-related time functions.
 
-   Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2012 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
@@ -142,7 +142,7 @@ get_stat_mtime (struct stat const *st)
 }
 
 /* Return *ST's birth time, if available; otherwise return a value
-   with negative tv_nsec.  */
+   with tv_sec and tv_nsec both equal to -1.  */
 static inline struct timespec
 get_stat_birthtime (struct stat const *st)
 {
@@ -155,13 +155,13 @@ get_stat_birthtime (struct stat const *st)
   t.tv_sec = st->st_birthtime;
   t.tv_nsec = st->st_birthtimensec;
 #elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-  /* Woe32 native platforms (but not Cygwin) put the "file creation
+  /* Native Windows platforms (but not Cygwin) put the "file creation
      time" in st_ctime (!).  See
      <http://msdn2.microsoft.com/de-de/library/14h5k7ff(VS.80).aspx>.  */
   t.tv_sec = st->st_ctime;
   t.tv_nsec = 0;
 #else
-  /* Birth time is not supported.  Set tv_sec to avoid undefined behavior.  */
+  /* Birth time is not supported.  */
   t.tv_sec = -1;
   t.tv_nsec = -1;
   /* Avoid a "parameter unused" warning.  */
@@ -175,10 +175,12 @@ get_stat_birthtime (struct stat const *st)
      using zero.  Attempt to work around this problem.  Alas, this can
      report failure even for valid time stamps.  Also, NetBSD
      sometimes returns junk in the birth time fields; work around this
-     bug if it it is detected.  There's no need to detect negative
-     tv_nsec junk as negative tv_nsec already indicates an error.  */
-  if (t.tv_sec == 0 || 1000000000 <= t.tv_nsec)
-    t.tv_nsec = -1;
+     bug if it is detected.  */
+  if (! (t.tv_sec && 0 <= t.tv_nsec && t.tv_nsec < 1000000000))
+    {
+      t.tv_sec = -1;
+      t.tv_nsec = -1;
+    }
 #endif
 
   return t;
index 875317bf52bbb4f3849b349dcae5787188f1a0ea..1fc633eeef035cf6af3c4e0994a1e5f9dc01ed6e 100644 (file)
@@ -1,5 +1,5 @@
 /* Work around platform bugs in stat.
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 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
 
 /* written by Eric Blake */
 
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+   the system's <sys/stat.h> here, so that orig_stat doesn't recurse to
+   rpl_stat.  */
+#define __need_system_sys_stat_h
 #include <config.h>
 
 /* Get the original definition of stat.  It might be defined as a macro.  */
-#define __need_system_sys_stat_h
 #include <sys/types.h>
 #include <sys/stat.h>
 #undef __need_system_sys_stat_h
 
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if _GL_WINDOWS_64_BIT_ST_SIZE
+#  define stat _stati64
+#  define REPLACE_FUNC_STAT_DIR 1
+#  undef REPLACE_FUNC_STAT_FILE
+# elif REPLACE_FUNC_STAT_FILE
+/* mingw64 has a broken stat() function, based on _stat(), in libmingwex.a.
+   Bypass it.  */
+#  define stat _stat
+#  define REPLACE_FUNC_STAT_DIR 1
+#  undef REPLACE_FUNC_STAT_FILE
+# endif
+#endif
+
 static inline int
 orig_stat (const char *filename, struct stat *buf)
 {
@@ -31,12 +48,26 @@ orig_stat (const char *filename, struct stat *buf)
 }
 
 /* Specification.  */
-#include <sys/stat.h>
+/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
+   eliminates this include because of the preliminary #include <sys/stat.h>
+   above.  */
+#include "sys/stat.h"
 
 #include <errno.h>
 #include <limits.h>
 #include <stdbool.h>
 #include <string.h>
+#include "dosname.h"
+#include "verify.h"
+
+#if REPLACE_FUNC_STAT_DIR
+# include "pathmax.h"
+  /* The only known systems where REPLACE_FUNC_STAT_DIR is needed also
+     have a constant PATH_MAX.  */
+# ifndef PATH_MAX
+#  error "Please port this replacement to your platform"
+# endif
+#endif
 
 /* Store information about NAME into ST.  Work around bugs with
    trailing slashes.  Mingw has other bugs (such as st_ino always
@@ -62,6 +93,7 @@ rpl_stat (char const *name, struct stat *st)
     }
 #endif /* REPLACE_FUNC_STAT_FILE */
 #if REPLACE_FUNC_STAT_DIR
+
   if (result == -1 && errno == ENOENT)
     {
       /* Due to mingw's oddities, there are some directories (like
@@ -76,6 +108,7 @@ rpl_stat (char const *name, struct stat *st)
       char fixed_name[PATH_MAX + 1] = {0};
       size_t len = strlen (name);
       bool check_dir = false;
+      verify (PATH_MAX <= 4096);
       if (PATH_MAX <= len)
         errno = ENAMETOOLONG;
       else if (len)
index 39d1847dca8b5ec8f72f88a5b2a217f0b593b4e9..ed1f9aa488b1329a039aad50df316dc24d3a5653 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-/* Copyright (C) 2001-2003, 2006-2010 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2012 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -14,8 +12,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_STDBOOL_H
 #define _GL_STDBOOL_H
@@ -52,6 +49,9 @@
          with this substitute.  With this substitute, only the values 0 and 1
          give the expected result when converted to _Bool' or 'bool'.
 
+       - C99 allows the use of (_Bool)0.0 in constant expressions, but
+         this substitute cannot always provide this property.
+
    Also, it is suggested that programs use 'bool' rather than '_Bool';
    this isn't required, but 'bool' is more common.  */
 
index 2de616b88da33be8f84d68992d888248f0413606..17fcaea2bfe6df6afb1e8f8561e55a709c082682 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2012 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,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake.  */
 
@@ -28,6 +25,7 @@
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 #if defined __need_wchar_t || defined __need_size_t  \
   || defined __need_ptrdiff_t || defined __need_NULL \
@@ -39,9 +37,9 @@
    remember if special invocation has ever been used to obtain wint_t,
    in which case we need to clean up NULL yet again.  */
 
-# if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T)
+# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T)
 #  ifdef __need_wint_t
-#   undef _GL_STDDEF_H
+#   undef _@GUARD_PREFIX@_STDDEF_H
 #   define _GL_STDDEF_WINT_T
 #  endif
 #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
 #else
 /* Normal invocation convention.  */
 
-# ifndef _GL_STDDEF_H
+# ifndef _@GUARD_PREFIX@_STDDEF_H
 
 /* The include_next requires a split double-inclusion guard.  */
 
 #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
 
-#  ifndef _GL_STDDEF_H
-#   define _GL_STDDEF_H
+#  ifndef _@GUARD_PREFIX@_STDDEF_H
+#   define _@GUARD_PREFIX@_STDDEF_H
 
 /* On NetBSD 5.0, the definition of NULL lacks proper parentheses.  */
 #if @REPLACE_NULL@
@@ -83,6 +81,6 @@
 # define wchar_t int
 #endif
 
-#  endif /* _GL_STDDEF_H */
-# endif /* _GL_STDDEF_H */
+#  endif /* _@GUARD_PREFIX@_STDDEF_H */
+# endif /* _@GUARD_PREFIX@_STDDEF_H */
 #endif /* __need_XXX */
index 8fd48f086e0f513151c4b7cb5a23d3138d39e9ed..59c00d59c03c62bd2b13ecabe35e9b12a81c75e8 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-/* Copyright (C) 2001-2002, 2004-2010 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2012 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /*
  * ISO C 99 <stdint.h> for platforms that lack it.
  * <http://www.opengroup.org/susv3xbd/stdint.h.html>
  */
 
-#ifndef _GL_STDINT_H
+#ifndef _@GUARD_PREFIX@_STDINT_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
 
 /* When including a system file that in turn includes <inttypes.h>,
    use the system <inttypes.h>, not our substitute.  This avoids
    <inttypes.h>.  */
 #define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 
+/* On Android (Bionic libc), <sys/types.h> includes this file before
+   having defined 'time_t'.  Therefore in this case avoid including
+   other system header files; just include the system's <stdint.h>.
+   Ideally we should test __BIONIC__ here, but it is only defined after
+   <sys/cdefs.h> has been included; hence test __ANDROID__ instead.  */
+#if defined __ANDROID__ \
+    && defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_
+# @INCLUDE_NEXT@ @NEXT_STDINT_H@
+#else
+
 /* Get those types that are already defined in other system include
    files, so that we can "#define int8_t signed char" below without
    worrying about a later system include file containing a "typedef
       diagnostics.  */
 #  define __STDINT_H__
 # endif
+
+  /* Some pre-C++11 <stdint.h> implementations need this.  */
+# ifdef __cplusplus
+#  ifndef __STDC_CONSTANT_MACROS
+#   define __STDC_CONSTANT_MACROS 1
+#  endif
+#  ifndef __STDC_LIMIT_MACROS
+#   define __STDC_LIMIT_MACROS 1
+#  endif
+# endif
+
   /* Other systems may have an incomplete or buggy <stdint.h>.
      Include it before <inttypes.h>, since any "#include <stdint.h>"
      in <inttypes.h> would reinclude us, skipping our contents because
-     _GL_STDINT_H is defined.
+     _@GUARD_PREFIX@_STDINT_H is defined.
      The include_next requires a split double-inclusion guard.  */
-# if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-# endif
 # @INCLUDE_NEXT@ @NEXT_STDINT_H@
 #endif
 
-#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
-#define _GL_STDINT_H
+#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+#define _@GUARD_PREFIX@_STDINT_H
 
 /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
    IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
@@ -70,7 +90,8 @@
 # include <sys/types.h>
 #endif
 
-/* Get LONG_MIN, LONG_MAX, ULONG_MAX.  */
+/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
+   LONG_MIN, LONG_MAX, ULONG_MAX.  */
 #include <limits.h>
 
 #if @HAVE_INTTYPES_H@
 
 #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 
-/* Minimum and maximum values for a integer type under the usual assumption.
+/* Minimum and maximum values for an integer type under the usual assumption.
    Return an unspecified value if BITS == 0, adding a check to pacify
    picky compilers.  */
 
         warnings in the signed case.  */ \
      ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
 
+#if !GNULIB_defined_stdint_types
+
 /* 7.18.1.1. Exact-width integer types */
 
 /* Here we assume a standard architecture where the hardware integer
@@ -134,40 +157,54 @@ typedef unsigned int gl_uint32_t;
 #define int32_t gl_int32_t
 #define uint32_t gl_uint32_t
 
+/* If the system defines INT64_MAX, assume int64_t works.  That way,
+   if the underlying platform defines int64_t to be a 64-bit long long
+   int, the code below won't mistakenly define it to be a 64-bit long
+   int, which would mess up C++ name mangling.  We must use #ifdef
+   rather than #if, to avoid an error with HP-UX 10.20 cc.  */
+
+#ifdef INT64_MAX
+# define GL_INT64_T
+#else
 /* Do not undefine int64_t if gnulib is not being used with 64-bit
    types, since otherwise it breaks platforms like Tandem/NSK.  */
-#if LONG_MAX >> 31 >> 31 == 1
-# undef int64_t
+# if LONG_MAX >> 31 >> 31 == 1
+#  undef int64_t
 typedef long int gl_int64_t;
-# define int64_t gl_int64_t
-# define GL_INT64_T
-#elif defined _MSC_VER
-# undef int64_t
+#  define int64_t gl_int64_t
+#  define GL_INT64_T
+# elif defined _MSC_VER
+#  undef int64_t
 typedef __int64 gl_int64_t;
-# define int64_t gl_int64_t
-# define GL_INT64_T
-#elif @HAVE_LONG_LONG_INT@
-# undef int64_t
+#  define int64_t gl_int64_t
+#  define GL_INT64_T
+# elif @HAVE_LONG_LONG_INT@
+#  undef int64_t
 typedef long long int gl_int64_t;
-# define int64_t gl_int64_t
-# define GL_INT64_T
+#  define int64_t gl_int64_t
+#  define GL_INT64_T
+# endif
 #endif
 
-#if ULONG_MAX >> 31 >> 31 >> 1 == 1
-# undef uint64_t
-typedef unsigned long int gl_uint64_t;
-# define uint64_t gl_uint64_t
+#ifdef UINT64_MAX
 # define GL_UINT64_T
-#elif defined _MSC_VER
-# undef uint64_t
+#else
+# if ULONG_MAX >> 31 >> 31 >> 1 == 1
+#  undef uint64_t
+typedef unsigned long int gl_uint64_t;
+#  define uint64_t gl_uint64_t
+#  define GL_UINT64_T
+# elif defined _MSC_VER
+#  undef uint64_t
 typedef unsigned __int64 gl_uint64_t;
-# define uint64_t gl_uint64_t
-# define GL_UINT64_T
-#elif @HAVE_UNSIGNED_LONG_LONG_INT@
-# undef uint64_t
+#  define uint64_t gl_uint64_t
+#  define GL_UINT64_T
+# elif @HAVE_UNSIGNED_LONG_LONG_INT@
+#  undef uint64_t
 typedef unsigned long long int gl_uint64_t;
-# define uint64_t gl_uint64_t
-# define GL_UINT64_T
+#  define uint64_t gl_uint64_t
+#  define GL_UINT64_T
+# endif
 #endif
 
 /* Avoid collision with Solaris 2.5.1 <pthread.h> etc.  */
@@ -210,8 +247,9 @@ typedef unsigned long long int gl_uint64_t;
 
 /* Here we assume a standard architecture where the hardware integer
    types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
-   are taken from the same list of types.  Assume that 'long int'
-   is fast enough for all narrower integers.  */
+   are taken from the same list of types.  The following code normally
+   uses types consistent with glibc, as that lessens the chance of
+   incompatibility with older GNU hosts.  */
 
 #undef int_fast8_t
 #undef uint_fast8_t
@@ -221,12 +259,21 @@ typedef unsigned long long int gl_uint64_t;
 #undef uint_fast32_t
 #undef int_fast64_t
 #undef uint_fast64_t
-typedef long int gl_int_fast8_t;
-typedef unsigned long int gl_uint_fast8_t;
-typedef long int gl_int_fast16_t;
-typedef unsigned long int gl_uint_fast16_t;
+typedef signed char gl_int_fast8_t;
+typedef unsigned char gl_uint_fast8_t;
+
+#ifdef __sun
+/* Define types compatible with SunOS 5.10, so that code compiled under
+   earlier SunOS versions works with code compiled under SunOS 5.10.  */
+typedef int gl_int_fast32_t;
+typedef unsigned int gl_uint_fast32_t;
+#else
 typedef long int gl_int_fast32_t;
 typedef unsigned long int gl_uint_fast32_t;
+#endif
+typedef gl_int_fast32_t gl_int_fast16_t;
+typedef gl_uint_fast32_t gl_uint_fast16_t;
+
 #define int_fast8_t gl_int_fast8_t
 #define uint_fast8_t gl_uint_fast8_t
 #define int_fast16_t gl_int_fast16_t
@@ -254,36 +301,48 @@ typedef unsigned long int gl_uintptr_t;
 /* Note: These types are compiler dependent. It may be unwise to use them in
    public header files. */
 
-#undef intmax_t
-#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+/* If the system defines INTMAX_MAX, assume that intmax_t works, and
+   similarly for UINTMAX_MAX and uintmax_t.  This avoids problems with
+   assuming one type where another is used by the system.  */
+
+#ifndef INTMAX_MAX
+# undef INTMAX_C
+# undef intmax_t
+# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
 typedef long long int gl_intmax_t;
-# define intmax_t gl_intmax_t
-#elif defined GL_INT64_T
-# define intmax_t int64_t
-#else
+#  define intmax_t gl_intmax_t
+# elif defined GL_INT64_T
+#  define intmax_t int64_t
+# else
 typedef long int gl_intmax_t;
-# define intmax_t gl_intmax_t
+#  define intmax_t gl_intmax_t
+# endif
 #endif
 
-#undef uintmax_t
-#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#ifndef UINTMAX_MAX
+# undef UINTMAX_C
+# undef uintmax_t
+# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
 typedef unsigned long long int gl_uintmax_t;
-# define uintmax_t gl_uintmax_t
-#elif defined GL_UINT64_T
-# define uintmax_t uint64_t
-#else
+#  define uintmax_t gl_uintmax_t
+# elif defined GL_UINT64_T
+#  define uintmax_t uint64_t
+# else
 typedef unsigned long int gl_uintmax_t;
-# define uintmax_t gl_uintmax_t
+#  define uintmax_t gl_uintmax_t
+# endif
 #endif
 
 /* Verify that intmax_t and uintmax_t have the same size.  Too much code
    breaks if this is not the case.  If this check fails, the reason is likely
    to be found in the autoconf macros.  */
-typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - 1];
+typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
+                                ? 1 : -1];
 
-/* 7.18.2. Limits of specified-width integer types */
+#define GNULIB_defined_stdint_types 1
+#endif /* !GNULIB_defined_stdint_types */
 
-#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
+/* 7.18.2. Limits of specified-width integer types */
 
 /* 7.18.2.1. Limits of exact-width integer types */
 
@@ -311,17 +370,14 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
 #define INT32_MAX  2147483647
 #define UINT32_MAX  4294967295U
 
-#undef INT64_MIN
-#undef INT64_MAX
-#ifdef GL_INT64_T
+#if defined GL_INT64_T && ! defined INT64_MAX
 /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
    evaluates the latter incorrectly in preprocessor expressions.  */
 # define INT64_MIN  (- INTMAX_C (1) << 63)
 # define INT64_MAX  INTMAX_C (9223372036854775807)
 #endif
 
-#undef UINT64_MAX
-#ifdef GL_UINT64_T
+#if defined GL_UINT64_T && ! defined UINT64_MAX
 # define UINT64_MAX  UINTMAX_C (18446744073709551615)
 #endif
 
@@ -373,23 +429,29 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
 #undef INT_FAST8_MIN
 #undef INT_FAST8_MAX
 #undef UINT_FAST8_MAX
-#define INT_FAST8_MIN  LONG_MIN
-#define INT_FAST8_MAX  LONG_MAX
-#define UINT_FAST8_MAX  ULONG_MAX
+#define INT_FAST8_MIN  SCHAR_MIN
+#define INT_FAST8_MAX  SCHAR_MAX
+#define UINT_FAST8_MAX  UCHAR_MAX
 
 #undef INT_FAST16_MIN
 #undef INT_FAST16_MAX
 #undef UINT_FAST16_MAX
-#define INT_FAST16_MIN  LONG_MIN
-#define INT_FAST16_MAX  LONG_MAX
-#define UINT_FAST16_MAX  ULONG_MAX
+#define INT_FAST16_MIN  INT_FAST32_MIN
+#define INT_FAST16_MAX  INT_FAST32_MAX
+#define UINT_FAST16_MAX  UINT_FAST32_MAX
 
 #undef INT_FAST32_MIN
 #undef INT_FAST32_MAX
 #undef UINT_FAST32_MAX
-#define INT_FAST32_MIN  LONG_MIN
-#define INT_FAST32_MAX  LONG_MAX
-#define UINT_FAST32_MAX  ULONG_MAX
+#ifdef __sun
+# define INT_FAST32_MIN  INT_MIN
+# define INT_FAST32_MAX  INT_MAX
+# define UINT_FAST32_MAX  UINT_MAX
+#else
+# define INT_FAST32_MIN  LONG_MIN
+# define INT_FAST32_MAX  LONG_MAX
+# define UINT_FAST32_MAX  ULONG_MAX
+#endif
 
 #undef INT_FAST64_MIN
 #undef INT_FAST64_MAX
@@ -414,21 +476,23 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
 
 /* 7.18.2.5. Limits of greatest-width integer types */
 
-#undef INTMAX_MIN
-#undef INTMAX_MAX
-#ifdef INT64_MAX
-# define INTMAX_MIN  INT64_MIN
-# define INTMAX_MAX  INT64_MAX
-#else
-# define INTMAX_MIN  INT32_MIN
-# define INTMAX_MAX  INT32_MAX
+#ifndef INTMAX_MAX
+# undef INTMAX_MIN
+# ifdef INT64_MAX
+#  define INTMAX_MIN  INT64_MIN
+#  define INTMAX_MAX  INT64_MAX
+# else
+#  define INTMAX_MIN  INT32_MIN
+#  define INTMAX_MAX  INT32_MAX
+# endif
 #endif
 
-#undef UINTMAX_MAX
-#ifdef UINT64_MAX
-# define UINTMAX_MAX  UINT64_MAX
-#else
-# define UINTMAX_MAX  UINT32_MAX
+#ifndef UINTMAX_MAX
+# ifdef UINT64_MAX
+#  define UINTMAX_MAX  UINT64_MAX
+# else
+#  define UINTMAX_MAX  UINT32_MAX
+# endif
 #endif
 
 /* 7.18.3. Limits of other integer types */
@@ -476,10 +540,16 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
 
 /* wchar_t limits */
 /* Get WCHAR_MIN, WCHAR_MAX.
-   This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested
-   includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
+   This include is not on the top, above, because on OSF/1 4.0 we have a
+   sequence of nested includes
+   <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
    <stdint.h> and assumes its types are already defined.  */
-#if ! (defined WCHAR_MIN && defined WCHAR_MAX)
+#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
+  /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+     included before <wchar.h>.  */
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
 # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
 # include <wchar.h>
 # undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
@@ -499,12 +569,8 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
 #define WINT_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
 
-#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
-
 /* 7.18.4. Macros for integer constants */
 
-#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
-
 /* 7.18.4.1. Macros for minimum-width integer constants */
 /* According to ISO C 99 Technical Corrigendum 1 */
 
@@ -545,25 +611,26 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
 
 /* 7.18.4.2. Macros for greatest-width integer constants */
 
-#undef INTMAX_C
-#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
-# define INTMAX_C(x)   x##LL
-#elif defined GL_INT64_T
-# define INTMAX_C(x)   INT64_C(x)
-#else
-# define INTMAX_C(x)   x##L
+#ifndef INTMAX_C
+# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+#  define INTMAX_C(x)   x##LL
+# elif defined GL_INT64_T
+#  define INTMAX_C(x)   INT64_C(x)
+# else
+#  define INTMAX_C(x)   x##L
+# endif
 #endif
 
-#undef UINTMAX_C
-#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
-# define UINTMAX_C(x)  x##ULL
-#elif defined GL_UINT64_T
-# define UINTMAX_C(x)  UINT64_C(x)
-#else
-# define UINTMAX_C(x)  x##UL
+#ifndef UINTMAX_C
+# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#  define UINTMAX_C(x)  x##ULL
+# elif defined GL_UINT64_T
+#  define UINTMAX_C(x)  UINT64_C(x)
+# else
+#  define UINTMAX_C(x)  x##UL
+# endif
 #endif
 
-#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
-
-#endif /* _GL_STDINT_H */
-#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
+#endif /* _@GUARD_PREFIX@_STDINT_H */
+#endif /* !(defined __ANDROID__ && ...) */
+#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
index 7d719efe1b4fcfae109ccfcafb972236a63b1b36..49357953742acdf89c40c472ad1bd09a8e522819 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation details of FILE streams.
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008, 2010-2012 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
 
 /* BSD stdio derived implementations.  */
 
+#if defined __NetBSD__                         /* NetBSD */
+/* Get __NetBSD_Version__.  */
+# include <sys/param.h>
+#endif
+
+#include <errno.h>                             /* For detecting Plan9.  */
+
 #if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
 
 # if defined __DragonFly__          /* DragonFly */
@@ -50,7 +57,7 @@
 #  define fp_ fp
 # endif
 
-# if defined __NetBSD__ || defined __OpenBSD__ /* NetBSD, OpenBSD */
+# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ /* NetBSD >= 1.5ZA, OpenBSD */
   /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
      and <http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */
   struct __sfileext
@@ -59,7 +66,7 @@
       /* More fields, not relevant here.  */
     };
 #  define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
-# else                                         /* FreeBSD, DragonFly, MacOS X, Cygwin */
+# else                                         /* FreeBSD, NetBSD <= 1.5Z, DragonFly, MacOS X, Cygwin */
 #  define fp_ub fp_->_ub
 # endif
 
 
 /* SystemV derived implementations.  */
 
+#ifdef __TANDEM                     /* NonStop Kernel */
+# ifndef _IOERR
+/* These values were determined by the program 'stdioext-flags' at
+   <http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>.  */
+#  define _IOERR   0x40
+#  define _IOREAD  0x80
+#  define _IOWRT    0x4
+#  define _IORW   0x100
+# endif
+#endif
+
 #if defined _IOERR
 
 # if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
diff --git a/lib/stdio-write.c b/lib/stdio-write.c
deleted file mode 100644 (file)
index f7da9e4..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/* POSIX compatible FILE stream write function.
-   Copyright (C) 2008-2010 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2008.
-
-   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 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include <stdio.h>
-
-/* Replace these functions only if module 'sigpipe' is requested.  */
-#if GNULIB_SIGPIPE
-
-/* On native Windows platforms, SIGPIPE does not exist.  When write() is
-   called on a pipe with no readers, WriteFile() fails with error
-   GetLastError() = ERROR_NO_DATA, and write() in consequence fails with
-   error EINVAL.  This write() function is at the basis of the function
-   which flushes the buffer of a FILE stream.  */
-
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-
-#  include <errno.h>
-#  include <signal.h>
-#  include <io.h>
-
-#  define WIN32_LEAN_AND_MEAN  /* avoid including junk */
-#  include <windows.h>
-
-#  define CALL_WITH_SIGPIPE_EMULATION(RETTYPE, EXPRESSION, FAILED) \
-  if (ferror (stream))                                                        \
-    return (EXPRESSION);                                                      \
-  else                                                                        \
-    {                                                                         \
-      RETTYPE ret;                                                            \
-      SetLastError (0);                                                       \
-      ret = (EXPRESSION);                                                     \
-      if (FAILED && GetLastError () == ERROR_NO_DATA && ferror (stream))      \
-        {                                                                     \
-          int fd = fileno (stream);                                           \
-          if (fd >= 0                                                         \
-              && GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_PIPE)\
-            {                                                                 \
-              /* Try to raise signal SIGPIPE.  */                             \
-              raise (SIGPIPE);                                                \
-              /* If it is currently blocked or ignored, change errno from     \
-                 EINVAL to EPIPE.  */                                         \
-              errno = EPIPE;                                                  \
-            }                                                                 \
-        }                                                                     \
-      return ret;                                                             \
-    }
-
-#  if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
-#   if !DEPENDS_ON_LIBINTL /* avoid collision with intl/printf.c */
-int
-printf (const char *format, ...)
-{
-  int retval;
-  va_list args;
-
-  va_start (args, format);
-  retval = vfprintf (stdout, format, args);
-  va_end (args);
-
-  return retval;
-}
-#   endif
-#  endif
-
-#  if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
-int
-fprintf (FILE *stream, const char *format, ...)
-{
-  int retval;
-  va_list args;
-
-  va_start (args, format);
-  retval = vfprintf (stream, format, args);
-  va_end (args);
-
-  return retval;
-}
-#  endif
-
-#  if !REPLACE_VPRINTF_POSIX /* avoid collision with vprintf.c */
-int
-vprintf (const char *format, va_list args)
-{
-  return vfprintf (stdout, format, args);
-}
-#  endif
-
-#  if !REPLACE_VFPRINTF_POSIX /* avoid collision with vfprintf.c */
-int
-vfprintf (FILE *stream, const char *format, va_list args)
-#undef vfprintf
-{
-  CALL_WITH_SIGPIPE_EMULATION (int, vfprintf (stream, format, args), ret == EOF)
-}
-#  endif
-
-int
-putchar (int c)
-{
-  return fputc (c, stdout);
-}
-
-int
-fputc (int c, FILE *stream)
-#undef fputc
-{
-  CALL_WITH_SIGPIPE_EMULATION (int, fputc (c, stream), ret == EOF)
-}
-
-int
-fputs (const char *string, FILE *stream)
-#undef fputs
-{
-  CALL_WITH_SIGPIPE_EMULATION (int, fputs (string, stream), ret == EOF)
-}
-
-int
-puts (const char *string)
-#undef puts
-{
-  FILE *stream = stdout;
-  CALL_WITH_SIGPIPE_EMULATION (int, puts (string), ret == EOF)
-}
-
-size_t
-fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
-#undef fwrite
-{
-  CALL_WITH_SIGPIPE_EMULATION (size_t, fwrite (ptr, s, n, stream), ret < n)
-}
-
-# endif
-#endif
index a815b6f0965b21013bf6f01bf1904b8f812a0a74..b1b543dee727416cc57cdc7aab77d0226968b20f 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2012 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
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
-#if defined __need_FILE || defined __need___FILE
-/* Special invocation convention inside glibc header files.  */
+#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H
+/* Special invocation convention:
+   - Inside glibc header files.
+   - On OSF/1 5.1 we have a sequence of nested includes
+     <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> ->
+     <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>.
+     In this situation, the functions are not yet declared, therefore we cannot
+     provide the C++ aliases.  */
 
 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
 
 #else
 /* Normal invocation convention.  */
 
-#ifndef _GL_STDIO_H
+#ifndef _@GUARD_PREFIX@_STDIO_H
+
+#define _GL_ALREADY_INCLUDING_STDIO_H
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STDIO_H@
 
-#ifndef _GL_STDIO_H
-#define _GL_STDIO_H
+#undef _GL_ALREADY_INCLUDING_STDIO_H
+
+#ifndef _@GUARD_PREFIX@_STDIO_H
+#define _@GUARD_PREFIX@_STDIO_H
 
 /* Get va_list.  Needed on many systems, including glibc 2.8.  */
 #include <stdarg.h>
 
 #include <stddef.h>
 
-/* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8.  */
+/* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8
+   and eglibc 2.11.2.
+   May also define off_t to a 64-bit type on native Windows.  */
 #include <sys/types.h>
 
-#ifndef __attribute__
 /* The __attribute__ feature is available in gcc versions 2.5 and later.
    The __-protected variants of the attributes 'format' and 'printf' are
    accepted by gcc versions 2.6.4 (effectively 2.7) and later.
-   We enable __attribute__ only if these are supported too, because
+   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
    gnulib and libintl do '#define printf __printf__' when they override
    the 'printf' function.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-#  define __attribute__(Spec)   /* empty */
-# endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
 #endif
 
+/* _GL_ATTRIBUTE_FORMAT_PRINTF
+   indicates to GCC that the function takes a format string and arguments,
+   where the format string directives are the ones standardized by ISO C99
+   and POSIX.  */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
+   _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
+#else
+# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
+   _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
+#endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
+   except that it indicates to GCC that the supported format string directives
+   are the ones of the system printf(), rather than the ones standardized by
+   ISO C99 and POSIX.  */
+#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
+  _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
+
+/* _GL_ATTRIBUTE_FORMAT_SCANF
+   indicates to GCC that the function takes a format string and arguments,
+   where the format string directives are the ones standardized by ISO C99
+   and POSIX.  */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
+   _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, first_argument))
+#else
+# define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
+   _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
+#endif
+
+/* _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_SCANF,
+   except that it indicates to GCC that the supported format string directives
+   are the ones of the system scanf(), rather than the ones standardized by
+   ISO C99 and POSIX.  */
+#define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
+  _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
+
+/* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \
+    && ! defined __GLIBC__
+# include <unistd.h>
+#endif
+
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
+/* Macros for stringification.  */
+#define _GL_STDIO_STRINGIZE(token) #token
+#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 
 #if @GNULIB_DPRINTF@
 # if @REPLACE_DPRINTF@
-#  define dprintf rpl_dprintf
-# endif
-# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@
-extern int dprintf (int fd, const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define dprintf rpl_dprintf
+#  endif
+_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                                _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
+# else
+#  if !@HAVE_DPRINTF@
+_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                                _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
 # endif
+_GL_CXXALIASWARN (dprintf);
 #elif defined GNULIB_POSIXCHECK
 # undef dprintf
-# define dprintf \
-    (GL_LINK_WARNING ("dprintf is unportable - " \
-                      "use gnulib module dprintf for portability"), \
-     dprintf)
+# if HAVE_RAW_DECL_DPRINTF
+_GL_WARN_ON_USE (dprintf, "dprintf is unportable - "
+                 "use gnulib module dprintf for portability");
+# endif
 #endif
 
 #if @GNULIB_FCLOSE@
+/* Close STREAM and its underlying file descriptor.  */
 # if @REPLACE_FCLOSE@
-#  define fclose rpl_fclose
-  /* Close STREAM and its underlying file descriptor.  */
-extern int fclose (FILE *stream) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define fclose rpl_fclose
+#  endif
+_GL_FUNCDECL_RPL (fclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
 # endif
+_GL_CXXALIASWARN (fclose);
 #elif defined GNULIB_POSIXCHECK
 # undef fclose
-# define fclose(f) \
-   (GL_LINK_WARNING ("fclose is not always POSIX compliant - " \
-                     "use gnulib module fclose for portable " \
-                     "POSIX compliance"), \
-    fclose (f))
+/* Assume fclose is always declared.  */
+_GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
+                 "use gnulib module fclose for portable POSIX compliance");
+#endif
+
+#if @GNULIB_FDOPEN@
+# if @REPLACE_FDOPEN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fdopen
+#   define fdopen rpl_fdopen
+#  endif
+_GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode)
+                                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
+# endif
+_GL_CXXALIASWARN (fdopen);
+#elif defined GNULIB_POSIXCHECK
+# undef fdopen
+/* Assume fdopen is always declared.  */
+_GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
+                 "use gnulib module fdopen for portability");
 #endif
 
 #if @GNULIB_FFLUSH@
+/* Flush all pending data on STREAM according to POSIX rules.  Both
+   output and seekable input streams are supported.
+   Note! LOSS OF DATA can occur if fflush is applied on an input stream
+   that is _not_seekable_ or on an update stream that is _not_seekable_
+   and in which the most recent operation was input.  Seekability can
+   be tested with lseek(fileno(fp),0,SEEK_CUR).  */
 # if @REPLACE_FFLUSH@
-#  define fflush rpl_fflush
-  /* Flush all pending data on STREAM according to POSIX rules.  Both
-     output and seekable input streams are supported.
-     Note! LOSS OF DATA can occur if fflush is applied on an input stream
-     that is _not_seekable_ or on an update stream that is _not_seekable_
-     and in which the most recent operation was input.  Seekability can
-     be tested with lseek(fileno(fp),0,SEEK_CUR).  */
-  extern int fflush (FILE *gl_stream);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define fflush rpl_fflush
+#  endif
+_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
+_GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
+# else
+_GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
 # endif
+_GL_CXXALIASWARN (fflush);
 #elif defined GNULIB_POSIXCHECK
 # undef fflush
-# define fflush(f) \
-   (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
-                     "use gnulib module fflush for portable " \
-                     "POSIX compliance"), \
-    fflush (f))
+/* Assume fflush is always declared.  */
+_GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
+                 "use gnulib module fflush for portable POSIX compliance");
 #endif
 
-/* It is very rare that the developer ever has full control of stdin,
-   so any use of gets warrants an unconditional warning.  Assume it is
-   always declared, since it is required by C89.  */
-#undef gets
-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#if @GNULIB_FGETC@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fgetc
+#   define fgetc rpl_fgetc
+#  endif
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
+# endif
+_GL_CXXALIASWARN (fgetc);
+#endif
+
+#if @GNULIB_FGETS@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fgets
+#   define fgets rpl_fgets
+#  endif
+_GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream)
+                                 _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fgets);
+#endif
 
 #if @GNULIB_FOPEN@
 # if @REPLACE_FOPEN@
-#  undef fopen
-#  define fopen rpl_fopen
-extern FILE * fopen (const char *filename, const char *mode)
-     _GL_ARG_NONNULL ((1, 2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fopen
+#   define fopen rpl_fopen
+#  endif
+_GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
+                                 _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
 # endif
+_GL_CXXALIASWARN (fopen);
 #elif defined GNULIB_POSIXCHECK
 # undef fopen
-# define fopen(f,m) \
-   (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \
-                     "use gnulib module fopen for portability"), \
-    fopen (f, m))
-#endif
-
-#if @GNULIB_FPRINTF_POSIX@
-# if @REPLACE_FPRINTF@
-#  define fprintf rpl_fprintf
-extern int fprintf (FILE *fp, const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 2, 3)))
-       _GL_ARG_NONNULL ((1, 2));
-# endif
-#elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define fprintf rpl_fprintf
-extern int fprintf (FILE *fp, const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 2, 3)))
-       _GL_ARG_NONNULL ((1, 2));
-#elif defined GNULIB_POSIXCHECK
-# undef fprintf
-# define fprintf \
-    (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \
-                      "use gnulib module fprintf-posix for portable " \
-                      "POSIX compliance"), \
-     fprintf)
+/* Assume fopen is always declared.  */
+_GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX compliant - "
+                 "use gnulib module fopen for portability");
+#endif
+
+#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
+# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
+     || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define fprintf rpl_fprintf
+#  endif
+#  define GNULIB_overrides_fprintf 1
+#  if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                                _GL_ARG_NONNULL ((1, 2)));
+#  else
+_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
+                                _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
+# else
+_GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (fprintf);
+#endif
+#if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_fprintf
+#  undef fprintf
+# endif
+/* Assume fprintf is always declared.  */
+_GL_WARN_ON_USE (fprintf, "fprintf is not always POSIX compliant - "
+                 "use gnulib module fprintf-posix for portable "
+                 "POSIX compliance");
 #endif
 
 #if @GNULIB_FPURGE@
+/* Discard all pending buffered I/O data on STREAM.
+   STREAM must not be wide-character oriented.
+   When discarding pending output, the file position is set back to where it
+   was before the write calls.  When discarding pending input, the file
+   position is advanced to match the end of the previously read input.
+   Return 0 if successful.  Upon error, return -1 and set errno.  */
 # if @REPLACE_FPURGE@
-#  define fpurge rpl_fpurge
-# endif
-# if @REPLACE_FPURGE@ || !@HAVE_DECL_FPURGE@
-  /* Discard all pending buffered I/O data on STREAM.
-     STREAM must not be wide-character oriented.
-     When discarding pending output, the file position is set back to where it
-     was before the write calls.  When discarding pending input, the file
-     position is advanced to match the end of the previously read input.
-     Return 0 if successful.  Upon error, return -1 and set errno.  */
-  extern int fpurge (FILE *gl_stream) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define fpurge rpl_fpurge
+#  endif
+_GL_FUNCDECL_RPL (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fpurge, int, (FILE *gl_stream));
+# else
+#  if !@HAVE_DECL_FPURGE@
+_GL_FUNCDECL_SYS (fpurge, int, (FILE *gl_stream) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (fpurge, int, (FILE *gl_stream));
 # endif
+_GL_CXXALIASWARN (fpurge);
 #elif defined GNULIB_POSIXCHECK
 # undef fpurge
-# define fpurge(f) \
-   (GL_LINK_WARNING ("fpurge is not always present - " \
-                     "use gnulib module fpurge for portability"), \
-    fpurge (f))
+# if HAVE_RAW_DECL_FPURGE
+_GL_WARN_ON_USE (fpurge, "fpurge is not always present - "
+                 "use gnulib module fpurge for portability");
+# endif
+#endif
+
+#if @GNULIB_FPUTC@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fputc
+#   define fputc rpl_fputc
+#  endif
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fputc);
 #endif
 
-#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef fputc
-# define fputc rpl_fputc
-extern int fputc (int c, FILE *stream) _GL_ARG_NONNULL ((2));
+#if @GNULIB_FPUTS@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fputs
+#   define fputs rpl_fputs
+#  endif
+_GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream)
+                              _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fputs);
 #endif
 
-#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef fputs
-# define fputs rpl_fputs
-extern int fputs (const char *string, FILE *stream) _GL_ARG_NONNULL ((1, 2));
+#if @GNULIB_FREAD@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fread
+#   define fread rpl_fread
+#  endif
+_GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)
+                                 _GL_ARG_NONNULL ((4)));
+_GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
+# endif
+_GL_CXXALIASWARN (fread);
 #endif
 
 #if @GNULIB_FREOPEN@
 # if @REPLACE_FREOPEN@
-#  undef freopen
-#  define freopen rpl_freopen
-extern FILE * freopen (const char *filename, const char *mode, FILE *stream)
-     _GL_ARG_NONNULL ((2, 3));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef freopen
+#   define freopen rpl_freopen
+#  endif
+_GL_FUNCDECL_RPL (freopen, FILE *,
+                  (const char *filename, const char *mode, FILE *stream)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (freopen, FILE *,
+                  (const char *filename, const char *mode, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (freopen, FILE *,
+                  (const char *filename, const char *mode, FILE *stream));
 # endif
+_GL_CXXALIASWARN (freopen);
 #elif defined GNULIB_POSIXCHECK
 # undef freopen
-# define freopen(f,m,s) \
-   (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \
-                     "use gnulib module freopen for portability"), \
-    freopen (f, m, s))
+/* Assume freopen is always declared.  */
+_GL_WARN_ON_USE (freopen,
+                 "freopen on native Windows platforms is not POSIX compliant - "
+                 "use gnulib module freopen for portability");
 #endif
 
+#if @GNULIB_FSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fscanf
+#   define fscanf rpl_fscanf
+#  endif
+_GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...)
+                               _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
+                               _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
+# else
+_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
+# endif
+_GL_CXXALIASWARN (fscanf);
+#endif
+
+
 /* Set up the following warnings, based on which modules are in use.
    GNU Coding Standards discourage the use of fseek, since it imposes
    an arbitrary limitation on some 32-bit hosts.  Remember that the
@@ -235,9 +432,12 @@ extern FILE * freopen (const char *filename, const char *mode, FILE *stream)
    fseek and was trying to avoid it, so issue a warning even when
    GNULIB_POSIXCHECK is undefined.  Again, _GL_NO_LARGE_FILES can be
    defined to silence the warning in particular compilation units.
+   In C++ compilations with GNULIB_NAMESPACE, in order to avoid that
+   fseek gets defined as a macro, it is recommended that the developer
+   uses the fseek module, even if he is not calling the fseek function.
 
    Most gnulib clients that perform stream operations should fall into
-   category three.  */
+   category 3.  */
 
 #if @GNULIB_FSEEK@
 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
@@ -245,10 +445,17 @@ extern FILE * freopen (const char *filename, const char *mode, FILE *stream)
 #  undef fseek
 # endif
 # if @REPLACE_FSEEK@
-#  undef fseek
-#  define fseek rpl_fseek
-extern int fseek (FILE *fp, long offset, int whence) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fseek
+#   define fseek rpl_fseek
+#  endif
+_GL_FUNCDECL_RPL (fseek, int, (FILE *fp, long offset, int whence)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
+# else
+_GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
 # endif
+_GL_CXXALIASWARN (fseek);
 #endif
 
 #if @GNULIB_FSEEKO@
@@ -257,21 +464,23 @@ extern int fseek (FILE *fp, long offset, int whence) _GL_ARG_NONNULL ((1));
 #  undef fseek
 # endif
 # if @REPLACE_FSEEKO@
-/* Provide fseek, fseeko functions that are aware of a preceding
-   fflush(), and which detect pipes.  */
-#  undef fseeko
-#  define fseeko rpl_fseeko
-extern int fseeko (FILE *fp, off_t offset, int whence) _GL_ARG_NONNULL ((1));
-#  if !@GNULIB_FSEEK@
-#   undef fseek
-#   define fseek rpl_fseek
-static inline int _GL_ARG_NONNULL ((1))
-rpl_fseek (FILE *fp, long offset, int whence)
-{
-  return fseeko (fp, offset, whence);
-}
+/* Provide an fseeko function that is aware of a preceding fflush(), and which
+   detects pipes.  */
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fseeko
+#   define fseeko rpl_fseeko
 #  endif
+_GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence));
+# else
+#  if ! @HAVE_DECL_FSEEKO@
+_GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence)
+                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
 # endif
+_GL_CXXALIASWARN (fseeko);
 #elif defined GNULIB_POSIXCHECK
 # define _GL_FSEEK_WARN /* Category 1, above.  */
 # undef fseek
@@ -291,7 +500,8 @@ _GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
                  "use fseeko function for handling of large files");
 #endif
 
-/* See the comments on fseek/fseeko.  */
+
+/* ftell, ftello.  See the comments on fseek/fseeko.  */
 
 #if @GNULIB_FTELL@
 # if defined GNULIB_POSIXCHECK && !defined _GL_NO_LARGE_FILES
@@ -299,10 +509,16 @@ _GL_WARN_ON_USE (fseek, "fseek cannot handle files larger than 4 GB "
 #  undef ftell
 # endif
 # if @REPLACE_FTELL@
-#  undef ftell
-#  define ftell rpl_ftell
-extern long ftell (FILE *fp) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ftell
+#   define ftell rpl_ftell
+#  endif
+_GL_FUNCDECL_RPL (ftell, long, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
+# else
+_GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
 # endif
+_GL_CXXALIASWARN (ftell);
 #endif
 
 #if @GNULIB_FTELLO@
@@ -311,19 +527,19 @@ extern long ftell (FILE *fp) _GL_ARG_NONNULL ((1));
 #  undef ftell
 # endif
 # if @REPLACE_FTELLO@
-#  undef ftello
-#  define ftello rpl_ftello
-extern off_t ftello (FILE *fp) _GL_ARG_NONNULL ((1));
-#  if !@GNULIB_FTELL@
-#   undef ftell
-#   define ftell rpl_ftell
-static inline long _GL_ARG_NONNULL ((1))
-rpl_ftell (FILE *f)
-{
-  return ftello (f);
-}
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ftello
+#   define ftello rpl_ftello
 #  endif
+_GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp));
+# else
+#  if ! @HAVE_DECL_FTELLO@
+_GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
 # endif
+_GL_CXXALIASWARN (ftello);
 #elif defined GNULIB_POSIXCHECK
 # define _GL_FTELL_WARN /* Category 1, above.  */
 # undef ftell
@@ -343,219 +559,493 @@ _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
                  "use ftello function for handling of large files");
 #endif
 
-#if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef fwrite
-# define fwrite rpl_fwrite
-extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
-     _GL_ARG_NONNULL ((1, 4));
+
+#if @GNULIB_FWRITE@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fwrite
+#   define fwrite rpl_fwrite
+#  endif
+_GL_FUNCDECL_RPL (fwrite, size_t,
+                  (const void *ptr, size_t s, size_t n, FILE *stream)
+                  _GL_ARG_NONNULL ((1, 4)));
+_GL_CXXALIAS_RPL (fwrite, size_t,
+                  (const void *ptr, size_t s, size_t n, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (fwrite, size_t,
+                  (const void *ptr, size_t s, size_t n, FILE *stream));
+
+/* Work around glibc bug 11959
+   <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
+   which sometimes causes an unwanted diagnostic for fwrite calls.
+   This affects only function declaration attributes, so it's not
+   needed for C++.  */
+#  if !defined __cplusplus && 0 < __USE_FORTIFY_LEVEL
+static inline size_t _GL_ARG_NONNULL ((1, 4))
+rpl_fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
+{
+  size_t r = fwrite (ptr, s, n, stream);
+  (void) r;
+  return r;
+}
+#   undef fwrite
+#   define fwrite rpl_fwrite
+#  endif
+# endif
+_GL_CXXALIASWARN (fwrite);
+#endif
+
+#if @GNULIB_GETC@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getc
+#   define getc rpl_fgetc
+#  endif
+_GL_FUNCDECL_RPL (fgetc, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
+# else
+_GL_CXXALIAS_SYS (getc, int, (FILE *stream));
+# endif
+_GL_CXXALIASWARN (getc);
+#endif
+
+#if @GNULIB_GETCHAR@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getchar
+#   define getchar rpl_getchar
+#  endif
+_GL_FUNCDECL_RPL (getchar, int, (void));
+_GL_CXXALIAS_RPL (getchar, int, (void));
+# else
+_GL_CXXALIAS_SYS (getchar, int, (void));
+# endif
+_GL_CXXALIASWARN (getchar);
 #endif
 
 #if @GNULIB_GETDELIM@
-# if !@HAVE_DECL_GETDELIM@
 /* Read input, up to (and including) the next occurrence of DELIMITER, from
    STREAM, store it in *LINEPTR (and NUL-terminate it).
    *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
    bytes of space.  It is realloc'd as necessary.
    Return the number of bytes read and stored at *LINEPTR (not including the
    NUL terminator), or -1 on error or EOF.  */
-extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter,
-                         FILE *stream)
-     _GL_ARG_NONNULL ((1, 2, 4));
+# if @REPLACE_GETDELIM@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getdelim
+#   define getdelim rpl_getdelim
+#  endif
+_GL_FUNCDECL_RPL (getdelim, ssize_t,
+                  (char **lineptr, size_t *linesize, int delimiter,
+                   FILE *stream)
+                  _GL_ARG_NONNULL ((1, 2, 4)));
+_GL_CXXALIAS_RPL (getdelim, ssize_t,
+                  (char **lineptr, size_t *linesize, int delimiter,
+                   FILE *stream));
+# else
+#  if !@HAVE_DECL_GETDELIM@
+_GL_FUNCDECL_SYS (getdelim, ssize_t,
+                  (char **lineptr, size_t *linesize, int delimiter,
+                   FILE *stream)
+                  _GL_ARG_NONNULL ((1, 2, 4)));
+#  endif
+_GL_CXXALIAS_SYS (getdelim, ssize_t,
+                  (char **lineptr, size_t *linesize, int delimiter,
+                   FILE *stream));
 # endif
+_GL_CXXALIASWARN (getdelim);
 #elif defined GNULIB_POSIXCHECK
 # undef getdelim
-# define getdelim(l, s, d, f)                                       \
-  (GL_LINK_WARNING ("getdelim is unportable - "                     \
-                    "use gnulib module getdelim for portability"),  \
-   getdelim (l, s, d, f))
+# if HAVE_RAW_DECL_GETDELIM
+_GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
+                 "use gnulib module getdelim for portability");
+# endif
 #endif
 
 #if @GNULIB_GETLINE@
-# if @REPLACE_GETLINE@
-#  undef getline
-#  define getline rpl_getline
-# endif
-# if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@
 /* Read a line, up to (and including) the next newline, from STREAM, store it
    in *LINEPTR (and NUL-terminate it).
    *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
    bytes of space.  It is realloc'd as necessary.
    Return the number of bytes read and stored at *LINEPTR (not including the
    NUL terminator), or -1 on error or EOF.  */
-extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream)
-     _GL_ARG_NONNULL ((1, 2, 3));
+# if @REPLACE_GETLINE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getline
+#   define getline rpl_getline
+#  endif
+_GL_FUNCDECL_RPL (getline, ssize_t,
+                  (char **lineptr, size_t *linesize, FILE *stream)
+                  _GL_ARG_NONNULL ((1, 2, 3)));
+_GL_CXXALIAS_RPL (getline, ssize_t,
+                  (char **lineptr, size_t *linesize, FILE *stream));
+# else
+#  if !@HAVE_DECL_GETLINE@
+_GL_FUNCDECL_SYS (getline, ssize_t,
+                  (char **lineptr, size_t *linesize, FILE *stream)
+                  _GL_ARG_NONNULL ((1, 2, 3)));
+#  endif
+_GL_CXXALIAS_SYS (getline, ssize_t,
+                  (char **lineptr, size_t *linesize, FILE *stream));
+# endif
+# if @HAVE_DECL_GETLINE@
+_GL_CXXALIASWARN (getline);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getline
-# define getline(l, s, f)                                               \
-  (GL_LINK_WARNING ("getline is unportable - "                          \
-                    "use gnulib module getline for portability"),       \
-   getline (l, s, f))
+# if HAVE_RAW_DECL_GETLINE
+_GL_WARN_ON_USE (getline, "getline is unportable - "
+                 "use gnulib module getline for portability");
+# endif
 #endif
 
-#if @GNULIB_OBSTACK_PRINTF@
+/* It is very rare that the developer ever has full control of stdin,
+   so any use of gets warrants an unconditional warning; besides, C11
+   removed it.  */
+#undef gets
+#if HAVE_RAW_DECL_GETS
+_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
+
+
+#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
+struct obstack;
+/* Grow an obstack with formatted output.  Return the number of
+   bytes added to OBS.  No trailing nul byte is added, and the
+   object should be closed with obstack_finish before use.  Upon
+   memory allocation error, call obstack_alloc_failed_handler.  Upon
+   other error, return -1.  */
 # if @REPLACE_OBSTACK_PRINTF@
-#  define obstack_printf rpl_osbtack_printf
-#  define obstack_vprintf rpl_obstack_vprintf
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define obstack_printf rpl_obstack_printf
+#  endif
+_GL_FUNCDECL_RPL (obstack_printf, int,
+                  (struct obstack *obs, const char *format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (obstack_printf, int,
+                  (struct obstack *obs, const char *format, ...));
+# else
+#  if !@HAVE_DECL_OBSTACK_PRINTF@
+_GL_FUNCDECL_SYS (obstack_printf, int,
+                  (struct obstack *obs, const char *format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (obstack_printf, int,
+                  (struct obstack *obs, const char *format, ...));
 # endif
-# if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
-  struct obstack;
-  /* Grow an obstack with formatted output.  Return the number of
-     bytes added to OBS.  No trailing nul byte is added, and the
-     object should be closed with obstack_finish before use.  Upon
-     memory allocation error, call obstack_alloc_failed_handler.  Upon
-     other error, return -1.  */
-  extern int obstack_printf (struct obstack *obs, const char *format, ...)
-    __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((1, 2));
-  extern int obstack_vprintf (struct obstack *obs, const char *format,
-                              va_list args)
-    __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((1, 2));
+_GL_CXXALIASWARN (obstack_printf);
+# if @REPLACE_OBSTACK_PRINTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define obstack_vprintf rpl_obstack_vprintf
+#  endif
+_GL_FUNCDECL_RPL (obstack_vprintf, int,
+                  (struct obstack *obs, const char *format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (obstack_vprintf, int,
+                  (struct obstack *obs, const char *format, va_list args));
+# else
+#  if !@HAVE_DECL_OBSTACK_PRINTF@
+_GL_FUNCDECL_SYS (obstack_vprintf, int,
+                  (struct obstack *obs, const char *format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (obstack_vprintf, int,
+                  (struct obstack *obs, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (obstack_vprintf);
+#endif
+
+#if @GNULIB_PCLOSE@
+# if !@HAVE_PCLOSE@
+_GL_FUNCDECL_SYS (pclose, int, (FILE *stream) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pclose, int, (FILE *stream));
+_GL_CXXALIASWARN (pclose);
+#elif defined GNULIB_POSIXCHECK
+# undef pclose
+# if HAVE_RAW_DECL_PCLOSE
+_GL_WARN_ON_USE (pclose, "pclose is unportable - "
+                 "use gnulib module pclose for more portability");
 # endif
 #endif
 
 #if @GNULIB_PERROR@
-# if @REPLACE_PERROR@
-#  define perror rpl_perror
 /* Print a message to standard error, describing the value of ERRNO,
    (if STRING is not NULL and not empty) prefixed with STRING and ": ",
    and terminated with a newline.  */
-extern void perror (const char *string);
+# if @REPLACE_PERROR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define perror rpl_perror
+#  endif
+_GL_FUNCDECL_RPL (perror, void, (const char *string));
+_GL_CXXALIAS_RPL (perror, void, (const char *string));
+# else
+_GL_CXXALIAS_SYS (perror, void, (const char *string));
 # endif
+_GL_CXXALIASWARN (perror);
 #elif defined GNULIB_POSIXCHECK
 # undef perror
-# define perror(s) \
-    (GL_LINK_WARNING ("perror is not always POSIX compliant - " \
-                      "use gnulib module perror for portability"), \
-     perror (s))
+/* Assume perror is always declared.  */
+_GL_WARN_ON_USE (perror, "perror is not always POSIX compliant - "
+                 "use gnulib module perror for portability");
 #endif
 
 #if @GNULIB_POPEN@
 # if @REPLACE_POPEN@
-#  undef popen
-#  define popen rpl_popen
-extern FILE *popen (const char *cmd, const char *mode)
-     _GL_ARG_NONNULL ((1, 2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef popen
+#   define popen rpl_popen
+#  endif
+_GL_FUNCDECL_RPL (popen, FILE *, (const char *cmd, const char *mode)
+                                 _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (popen, FILE *, (const char *cmd, const char *mode));
+# else
+#  if !@HAVE_POPEN@
+_GL_FUNCDECL_SYS (popen, FILE *, (const char *cmd, const char *mode)
+                                 _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (popen, FILE *, (const char *cmd, const char *mode));
 # endif
+_GL_CXXALIASWARN (popen);
 #elif defined GNULIB_POSIXCHECK
 # undef popen
-# define popen(c,m) \
-   (GL_LINK_WARNING ("popen is buggy on some platforms - " \
-                     "use gnulib module popen or pipe for more portability"), \
-    popen (c, m))
+# if HAVE_RAW_DECL_POPEN
+_GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
+                 "use gnulib module popen or pipe for more portability");
+# endif
 #endif
 
-#if @GNULIB_PRINTF_POSIX@
-# if @REPLACE_PRINTF@
+#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
+# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
+     || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+#  if defined __GNUC__
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 /* Don't break __attribute__((format(printf,M,N))).  */
-#  define printf __printf__
-extern int printf (const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
+#    define printf __printf__
+#   endif
+#   if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL_1 (__printf__, int,
+                    (const char *format, ...)
+                    __asm__ (@ASM_SYMBOL_PREFIX@
+                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+                    _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
+                    _GL_ARG_NONNULL ((1)));
+#   else
+_GL_FUNCDECL_RPL_1 (__printf__, int,
+                    (const char *format, ...)
+                    __asm__ (@ASM_SYMBOL_PREFIX@
+                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
+                    _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
+                    _GL_ARG_NONNULL ((1)));
+#   endif
+_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
+#  else
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define printf rpl_printf
+#   endif
+_GL_FUNCDECL_RPL (printf, int,
+                  (const char *format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
+#  endif
+#  define GNULIB_overrides_printf 1
+# else
+_GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
 # endif
-#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-/* Don't break __attribute__((format(printf,M,N))).  */
-# define printf __printf__
-extern int printf (const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 1, 2))) _GL_ARG_NONNULL ((1));
-#elif defined GNULIB_POSIXCHECK
-# undef printf
-# define printf \
-    (GL_LINK_WARNING ("printf is not always POSIX compliant - " \
-                      "use gnulib module printf-posix for portable " \
-                      "POSIX compliance"), \
-     printf)
-/* Don't break __attribute__((format(printf,M,N))).  */
-# define format(kind,m,n) format (__##kind##__, m, n)
-# define __format__(kind,m,n) __format__ (__##kind##__, m, n)
-# define ____printf____ __printf__
-# define ____scanf____ __scanf__
-# define ____strftime____ __strftime__
-# define ____strfmon____ __strfmon__
+_GL_CXXALIASWARN (printf);
+#endif
+#if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_printf
+#  undef printf
+# endif
+/* Assume printf is always declared.  */
+_GL_WARN_ON_USE (printf, "printf is not always POSIX compliant - "
+                 "use gnulib module printf-posix for portable "
+                 "POSIX compliance");
 #endif
 
-#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef putc
-# define putc rpl_fputc
-extern int putc (int c, FILE *stream) _GL_ARG_NONNULL ((2));
+#if @GNULIB_PUTC@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef putc
+#   define putc rpl_fputc
+#  endif
+_GL_FUNCDECL_RPL (fputc, int, (int c, FILE *stream) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
+# else
+_GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
+# endif
+_GL_CXXALIASWARN (putc);
 #endif
 
-#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef putchar
-# define putchar rpl_putchar
-extern int putchar (int c);
+#if @GNULIB_PUTCHAR@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef putchar
+#   define putchar rpl_putchar
+#  endif
+_GL_FUNCDECL_RPL (putchar, int, (int c));
+_GL_CXXALIAS_RPL (putchar, int, (int c));
+# else
+_GL_CXXALIAS_SYS (putchar, int, (int c));
+# endif
+_GL_CXXALIASWARN (putchar);
 #endif
 
-#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# undef puts
-# define puts rpl_puts
-extern int puts (const char *string) _GL_ARG_NONNULL ((1));
+#if @GNULIB_PUTS@
+# if @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef puts
+#   define puts rpl_puts
+#  endif
+_GL_FUNCDECL_RPL (puts, int, (const char *string) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (puts, int, (const char *string));
+# else
+_GL_CXXALIAS_SYS (puts, int, (const char *string));
+# endif
+_GL_CXXALIASWARN (puts);
 #endif
 
 #if @GNULIB_REMOVE@
 # if @REPLACE_REMOVE@
-#  undef remove
-#  define remove rpl_remove
-extern int remove (const char *name) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef remove
+#   define remove rpl_remove
+#  endif
+_GL_FUNCDECL_RPL (remove, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (remove, int, (const char *name));
+# else
+_GL_CXXALIAS_SYS (remove, int, (const char *name));
 # endif
+_GL_CXXALIASWARN (remove);
 #elif defined GNULIB_POSIXCHECK
 # undef remove
-# define remove(n)                                         \
-   (GL_LINK_WARNING ("remove cannot handle directories on some platforms - " \
-                     "use gnulib module remove for more portability"), \
-    remove (n))
+/* Assume remove is always declared.  */
+_GL_WARN_ON_USE (remove, "remove cannot handle directories on some platforms - "
+                 "use gnulib module remove for more portability");
 #endif
 
 #if @GNULIB_RENAME@
 # if @REPLACE_RENAME@
-#  undef rename
-#  define rename rpl_rename
-extern int rename (const char *old_filename, const char *new_filename)
-     _GL_ARG_NONNULL ((1, 2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef rename
+#   define rename rpl_rename
+#  endif
+_GL_FUNCDECL_RPL (rename, int,
+                  (const char *old_filename, const char *new_filename)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (rename, int,
+                  (const char *old_filename, const char *new_filename));
+# else
+_GL_CXXALIAS_SYS (rename, int,
+                  (const char *old_filename, const char *new_filename));
 # endif
+_GL_CXXALIASWARN (rename);
 #elif defined GNULIB_POSIXCHECK
 # undef rename
-# define rename(o,n)                                       \
-   (GL_LINK_WARNING ("rename is buggy on some platforms - " \
-                     "use gnulib module rename for more portability"), \
-    rename (o, n))
+/* Assume rename is always declared.  */
+_GL_WARN_ON_USE (rename, "rename is buggy on some platforms - "
+                 "use gnulib module rename for more portability");
 #endif
 
 #if @GNULIB_RENAMEAT@
 # if @REPLACE_RENAMEAT@
-#  undef renameat
-#  define renameat rpl_renameat
-# endif
-# if !@HAVE_RENAMEAT@ || @REPLACE_RENAMEAT@
-extern int renameat (int fd1, char const *file1, int fd2, char const *file2)
-     _GL_ARG_NONNULL ((2, 4));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef renameat
+#   define renameat rpl_renameat
+#  endif
+_GL_FUNCDECL_RPL (renameat, int,
+                  (int fd1, char const *file1, int fd2, char const *file2)
+                  _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (renameat, int,
+                  (int fd1, char const *file1, int fd2, char const *file2));
+# else
+#  if !@HAVE_RENAMEAT@
+_GL_FUNCDECL_SYS (renameat, int,
+                  (int fd1, char const *file1, int fd2, char const *file2)
+                  _GL_ARG_NONNULL ((2, 4)));
+#  endif
+_GL_CXXALIAS_SYS (renameat, int,
+                  (int fd1, char const *file1, int fd2, char const *file2));
 # endif
+_GL_CXXALIASWARN (renameat);
 #elif defined GNULIB_POSIXCHECK
 # undef renameat
-# define renameat(d1,f1,d2,f2)             \
-    (GL_LINK_WARNING ("renameat is not portable - " \
-                      "use gnulib module renameat for portability"), \
-     renameat (d1, f1, d2, f2))
+# if HAVE_RAW_DECL_RENAMEAT
+_GL_WARN_ON_USE (renameat, "renameat is not portable - "
+                 "use gnulib module renameat for portability");
+# endif
+#endif
+
+#if @GNULIB_SCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if defined __GNUC__
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef scanf
+/* Don't break __attribute__((format(scanf,M,N))).  */
+#    define scanf __scanf__
+#   endif
+_GL_FUNCDECL_RPL_1 (__scanf__, int,
+                    (const char *format, ...)
+                    __asm__ (@ASM_SYMBOL_PREFIX@
+                             _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
+                    _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
+                    _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...));
+#  else
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef scanf
+#    define scanf rpl_scanf
+#   endif
+_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
+                              _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
+#  endif
+# else
+_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
+# endif
+_GL_CXXALIASWARN (scanf);
 #endif
 
 #if @GNULIB_SNPRINTF@
 # if @REPLACE_SNPRINTF@
-#  define snprintf rpl_snprintf
-# endif
-# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
-extern int snprintf (char *str, size_t size, const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 3, 4)))
-       _GL_ARG_NONNULL ((3));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define snprintf rpl_snprintf
+#  endif
+_GL_FUNCDECL_RPL (snprintf, int,
+                  (char *str, size_t size, const char *format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
+                  _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_RPL (snprintf, int,
+                  (char *str, size_t size, const char *format, ...));
+# else
+#  if !@HAVE_DECL_SNPRINTF@
+_GL_FUNCDECL_SYS (snprintf, int,
+                  (char *str, size_t size, const char *format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
+                  _GL_ARG_NONNULL ((3)));
+#  endif
+_GL_CXXALIAS_SYS (snprintf, int,
+                  (char *str, size_t size, const char *format, ...));
 # endif
+_GL_CXXALIASWARN (snprintf);
 #elif defined GNULIB_POSIXCHECK
 # undef snprintf
-# define snprintf \
-    (GL_LINK_WARNING ("snprintf is unportable - " \
-                      "use gnulib module snprintf for portability"), \
-     snprintf)
+# if HAVE_RAW_DECL_SNPRINTF
+_GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
+                 "use gnulib module snprintf for portability");
+# endif
 #endif
 
-/* Some people would argue that sprintf should be handled like gets
-   (for example, OpenBSD issues a link warning for both functions),
-   since both can cause security holes due to buffer overruns.
+/* Some people would argue that all sprintf uses should be warned about
+   (for example, OpenBSD issues a link warning for it),
+   since it can cause security holes due to buffer overruns.
    However, we believe that sprintf can be used safely, and is more
    efficient than snprintf in those safe cases; and as proof of our
    belief, we use sprintf in several gnulib modules.  So this header
@@ -564,130 +1054,286 @@ extern int snprintf (char *str, size_t size, const char *format, ...)
 
 #if @GNULIB_SPRINTF_POSIX@
 # if @REPLACE_SPRINTF@
-#  define sprintf rpl_sprintf
-extern int sprintf (char *str, const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 2, 3)))
-       _GL_ARG_NONNULL ((1, 2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define sprintf rpl_sprintf
+#  endif
+_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                                _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
+# else
+_GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
 # endif
+_GL_CXXALIASWARN (sprintf);
 #elif defined GNULIB_POSIXCHECK
 # undef sprintf
-# define sprintf \
-    (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
-                      "use gnulib module sprintf-posix for portable " \
-                      "POSIX compliance"), \
-     sprintf)
+/* Assume sprintf is always declared.  */
+_GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
+                 "use gnulib module sprintf-posix for portable "
+                 "POSIX compliance");
+#endif
+
+#if @GNULIB_TMPFILE@
+# if @REPLACE_TMPFILE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define tmpfile rpl_tmpfile
+#  endif
+_GL_FUNCDECL_RPL (tmpfile, FILE *, (void));
+_GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
+# else
+_GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
+# endif
+_GL_CXXALIASWARN (tmpfile);
+#elif defined GNULIB_POSIXCHECK
+# undef tmpfile
+# if HAVE_RAW_DECL_TMPFILE
+_GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
+                 "use gnulib module tmpfile for portability");
+# endif
 #endif
 
 #if @GNULIB_VASPRINTF@
+/* Write formatted output to a string dynamically allocated with malloc().
+   If the memory allocation succeeds, store the address of the string in
+   *RESULT and return the number of resulting bytes, excluding the trailing
+   NUL.  Upon memory allocation error, or some other error, return -1.  */
 # if @REPLACE_VASPRINTF@
-#  define asprintf rpl_asprintf
-#  define vasprintf rpl_vasprintf
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define asprintf rpl_asprintf
+#  endif
+_GL_FUNCDECL_RPL (asprintf, int,
+                  (char **result, const char *format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (asprintf, int,
+                  (char **result, const char *format, ...));
+# else
+#  if !@HAVE_VASPRINTF@
+_GL_FUNCDECL_SYS (asprintf, int,
+                  (char **result, const char *format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (asprintf, int,
+                  (char **result, const char *format, ...));
 # endif
-# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
-  /* Write formatted output to a string dynamically allocated with malloc().
-     If the memory allocation succeeds, store the address of the string in
-     *RESULT and return the number of resulting bytes, excluding the trailing
-     NUL.  Upon memory allocation error, or some other error, return -1.  */
-  extern int asprintf (char **result, const char *format, ...)
-    __attribute__ ((__format__ (__printf__, 2, 3))) _GL_ARG_NONNULL ((1, 2));
-  extern int vasprintf (char **result, const char *format, va_list args)
-    __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((1, 2));
+_GL_CXXALIASWARN (asprintf);
+# if @REPLACE_VASPRINTF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vasprintf rpl_vasprintf
+#  endif
+_GL_FUNCDECL_RPL (vasprintf, int,
+                  (char **result, const char *format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vasprintf, int,
+                  (char **result, const char *format, va_list args));
+# else
+#  if !@HAVE_VASPRINTF@
+_GL_FUNCDECL_SYS (vasprintf, int,
+                  (char **result, const char *format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (vasprintf, int,
+                  (char **result, const char *format, va_list args));
 # endif
+_GL_CXXALIASWARN (vasprintf);
 #endif
 
 #if @GNULIB_VDPRINTF@
 # if @REPLACE_VDPRINTF@
-#  define vdprintf rpl_vdprintf
-# endif
-# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@
-extern int vdprintf (int fd, const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 2, 0))) _GL_ARG_NONNULL ((2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vdprintf rpl_vdprintf
+#  endif
+_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
+                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                                 _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
+# else
+#  if !@HAVE_VDPRINTF@
+_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
+                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                                 _GL_ARG_NONNULL ((2)));
+#  endif
+/* Need to cast, because on Solaris, the third parameter will likely be
+                                                    __va_list args.  */
+_GL_CXXALIAS_SYS_CAST (vdprintf, int,
+                       (int fd, const char *format, va_list args));
 # endif
+_GL_CXXALIASWARN (vdprintf);
 #elif defined GNULIB_POSIXCHECK
 # undef vdprintf
-# define vdprintf(d,f,a) \
-    (GL_LINK_WARNING ("vdprintf is unportable - " \
-                      "use gnulib module vdprintf for portability"), \
-     vdprintf (d, f, a))
-#endif
-
-#if @GNULIB_VFPRINTF_POSIX@
-# if @REPLACE_VFPRINTF@
-#  define vfprintf rpl_vfprintf
-extern int vfprintf (FILE *fp, const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 2, 0)))
-       _GL_ARG_NONNULL ((1, 2));
-# endif
-#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define vfprintf rpl_vfprintf
-extern int vfprintf (FILE *fp, const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 2, 0)))
-       _GL_ARG_NONNULL ((1, 2));
-#elif defined GNULIB_POSIXCHECK
-# undef vfprintf
-# define vfprintf(s,f,a) \
-    (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
-                      "use gnulib module vfprintf-posix for portable " \
-                      "POSIX compliance"), \
-     vfprintf (s, f, a))
-#endif
-
-#if @GNULIB_VPRINTF_POSIX@
-# if @REPLACE_VPRINTF@
-#  define vprintf rpl_vprintf
-extern int vprintf (const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
-# endif
-#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
-# define vprintf rpl_vprintf
-extern int vprintf (const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 1, 0))) _GL_ARG_NONNULL ((1));
-#elif defined GNULIB_POSIXCHECK
-# undef vprintf
-# define vprintf(f,a) \
-    (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
-                      "use gnulib module vprintf-posix for portable " \
-                      "POSIX compliance"), \
-     vprintf (f, a))
+# if HAVE_RAW_DECL_VDPRINTF
+_GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
+                 "use gnulib module vdprintf for portability");
+# endif
+#endif
+
+#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
+# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
+     || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vfprintf rpl_vfprintf
+#  endif
+#  define GNULIB_overrides_vfprintf 1
+#  if @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
+                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                                 _GL_ARG_NONNULL ((1, 2)));
+#  else
+_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
+                                 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
+                                 _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
+# else
+/* Need to cast, because on Solaris, the third parameter is
+                                                      __va_list args
+   and GCC's fixincludes did not change this to __gnuc_va_list.  */
+_GL_CXXALIAS_SYS_CAST (vfprintf, int,
+                       (FILE *fp, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vfprintf);
+#endif
+#if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vfprintf
+#  undef vfprintf
+# endif
+/* Assume vfprintf is always declared.  */
+_GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
+                 "use gnulib module vfprintf-posix for portable "
+                      "POSIX compliance");
+#endif
+
+#if @GNULIB_VFSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef vfscanf
+#   define vfscanf rpl_vfscanf
+#  endif
+_GL_FUNCDECL_RPL (vfscanf, int,
+                  (FILE *stream, const char *format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vfscanf, int,
+                  (FILE *stream, const char *format, va_list args));
+# else
+_GL_CXXALIAS_SYS (vfscanf, int,
+                  (FILE *stream, const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vfscanf);
+#endif
+
+#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
+# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
+     || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vprintf rpl_vprintf
+#  endif
+#  define GNULIB_overrides_vprintf 1
+#  if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
+_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
+                                _GL_ARG_NONNULL ((1)));
+#  else
+_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
+                                _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
+# else
+/* Need to cast, because on Solaris, the second parameter is
+                                                          __va_list args
+   and GCC's fixincludes did not change this to __gnuc_va_list.  */
+_GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vprintf);
+#endif
+#if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
+# if !GNULIB_overrides_vprintf
+#  undef vprintf
+# endif
+/* Assume vprintf is always declared.  */
+_GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
+                 "use gnulib module vprintf-posix for portable "
+                 "POSIX compliance");
+#endif
+
+#if @GNULIB_VSCANF@
+# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef vscanf
+#   define vscanf rpl_vscanf
+#  endif
+_GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args)
+                               _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args));
+# else
+_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
+# endif
+_GL_CXXALIASWARN (vscanf);
 #endif
 
 #if @GNULIB_VSNPRINTF@
 # if @REPLACE_VSNPRINTF@
-#  define vsnprintf rpl_vsnprintf
-# endif
-# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
-extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 3, 0)))
-       _GL_ARG_NONNULL ((3));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vsnprintf rpl_vsnprintf
+#  endif
+_GL_FUNCDECL_RPL (vsnprintf, int,
+                  (char *str, size_t size, const char *format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
+                  _GL_ARG_NONNULL ((3)));
+_GL_CXXALIAS_RPL (vsnprintf, int,
+                  (char *str, size_t size, const char *format, va_list args));
+# else
+#  if !@HAVE_DECL_VSNPRINTF@
+_GL_FUNCDECL_SYS (vsnprintf, int,
+                  (char *str, size_t size, const char *format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
+                  _GL_ARG_NONNULL ((3)));
+#  endif
+_GL_CXXALIAS_SYS (vsnprintf, int,
+                  (char *str, size_t size, const char *format, va_list args));
 # endif
+_GL_CXXALIASWARN (vsnprintf);
 #elif defined GNULIB_POSIXCHECK
 # undef vsnprintf
-# define vsnprintf(b,s,f,a) \
-    (GL_LINK_WARNING ("vsnprintf is unportable - " \
-                      "use gnulib module vsnprintf for portability"), \
-     vsnprintf (b, s, f, a))
+# if HAVE_RAW_DECL_VSNPRINTF
+_GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
+                 "use gnulib module vsnprintf for portability");
+# endif
 #endif
 
 #if @GNULIB_VSPRINTF_POSIX@
 # if @REPLACE_VSPRINTF@
-#  define vsprintf rpl_vsprintf
-extern int vsprintf (char *str, const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 2, 0)))
-       _GL_ARG_NONNULL ((1, 2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define vsprintf rpl_vsprintf
+#  endif
+_GL_FUNCDECL_RPL (vsprintf, int,
+                  (char *str, const char *format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (vsprintf, int,
+                  (char *str, const char *format, va_list args));
+# else
+/* Need to cast, because on Solaris, the third parameter is
+                                                       __va_list args
+   and GCC's fixincludes did not change this to __gnuc_va_list.  */
+_GL_CXXALIAS_SYS_CAST (vsprintf, int,
+                       (char *str, const char *format, va_list args));
 # endif
+_GL_CXXALIASWARN (vsprintf);
 #elif defined GNULIB_POSIXCHECK
 # undef vsprintf
-# define vsprintf(b,f,a) \
-    (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
-                      "use gnulib module vsprintf-posix for portable " \
-                      "POSIX compliance"), \
-     vsprintf (b, f, a))
+/* Assume vsprintf is always declared.  */
+_GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - "
+                 "use gnulib module vsprintf-posix for portable "
+                      "POSIX compliance");
 #endif
 
-#ifdef __cplusplus
-}
-#endif
 
-#endif /* _GL_STDIO_H */
-#endif /* _GL_STDIO_H */
+#endif /* _@GUARD_PREFIX@_STDIO_H */
+#endif /* _@GUARD_PREFIX@_STDIO_H */
 #endif
index 5f546ffa8ef1d8ef649a2a04f3ab4ecf6d201fed..b546133c3affa37b470c68a9958e6a698eb1015a 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2012 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
@@ -18,6 +18,7 @@
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 #if defined __need_malloc_and_calloc
 /* Special invocation convention inside glibc header files.  */
 #else
 /* Normal invocation convention.  */
 
-#ifndef _GL_STDLIB_H
+#ifndef _@GUARD_PREFIX@_STDLIB_H
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
 
-#ifndef _GL_STDLIB_H
-#define _GL_STDLIB_H
+#ifndef _@GUARD_PREFIX@_STDLIB_H
+#define _@GUARD_PREFIX@_STDLIB_H
 
 /* NetBSD 5.0 mis-defines NULL.  */
 #include <stddef.h>
 
+/* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>.  */
+#if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
+# include <sys/wait.h>
+#endif
+
 /* Solaris declares getloadavg() in <sys/loadavg.h>.  */
 #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
 # include <sys/loadavg.h>
 #endif
 
-/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
-   from <stdlib.h> if _REENTRANT is defined.  Include it always.  */
-#if @HAVE_RANDOM_H@
-# include <random.h>
+/* Native Windows platforms declare mktemp() in <io.h>.  */
+#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+# include <io.h>
 #endif
 
-#if !@HAVE_STRUCT_RANDOM_DATA@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@) \
-    || defined GNULIB_POSIXCHECK
-# include <stdint.h>
-#endif
+#if @GNULIB_RANDOM_R@
+
+/* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
+   from <stdlib.h> if _REENTRANT is defined.  Include it whenever we need
+   'struct random_data'.  */
+# if @HAVE_RANDOM_H@
+#  include <random.h>
+# endif
+
+# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@
+#  include <stdint.h>
+# endif
 
-#if !@HAVE_STRUCT_RANDOM_DATA@
+# if !@HAVE_STRUCT_RANDOM_DATA@
+/* Define 'struct random_data'.
+   But allow multiple gnulib generated <stdlib.h> replacements to coexist.  */
+#  if !GNULIB_defined_struct_random_data
 struct random_data
 {
   int32_t *fptr;                /* Front pointer.  */
@@ -65,19 +81,35 @@ struct random_data
   int rand_sep;                 /* Distance between front and rear.  */
   int32_t *end_ptr;             /* Pointer behind state table.  */
 };
+#   define GNULIB_defined_struct_random_data 1
+#  endif
+# endif
 #endif
 
-#if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__
+#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
 /* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
+/* On MacOS X 10.5, only <unistd.h> declares mkstemps.  */
 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
-/* But avoid namespace pollution on glibc systems.  */
+/* But avoid namespace pollution on glibc systems and native Windows.  */
 # include <unistd.h>
 #endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+   The attribute __pure__ was added in gcc 2.96.  */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The definition of _Noreturn is copied here.  */
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 
 /* Some systems do not define EXIT_*, despite otherwise supporting C89.  */
 #ifndef EXIT_SUCCESS
@@ -93,67 +125,102 @@ struct random_data
 #endif
 
 
-#ifdef __cplusplus
-extern "C" {
+#if @GNULIB__EXIT@
+/* Terminate the current process with the given return code, without running
+   the 'atexit' handlers.  */
+# if !@HAVE__EXIT@
+_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
+# endif
+_GL_CXXALIAS_SYS (_Exit, void, (int status));
+_GL_CXXALIASWARN (_Exit);
+#elif defined GNULIB_POSIXCHECK
+# undef _Exit
+# if HAVE_RAW_DECL__EXIT
+_GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
+                 "use gnulib module _Exit for portability");
+# endif
 #endif
 
+
 #if @GNULIB_ATOLL@
-# if !@HAVE_ATOLL@
 /* Parse a signed decimal integer.
    Returns the value of the integer.  Errors are not detected.  */
-extern long long atoll (const char *string) _GL_ARG_NONNULL ((1));
+# if !@HAVE_ATOLL@
+_GL_FUNCDECL_SYS (atoll, long long, (const char *string)
+                                    _GL_ATTRIBUTE_PURE
+                                    _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (atoll, long long, (const char *string));
+_GL_CXXALIASWARN (atoll);
 #elif defined GNULIB_POSIXCHECK
 # undef atoll
-# define atoll(s) \
-    (GL_LINK_WARNING ("atoll is unportable - " \
-                      "use gnulib module atoll for portability"), \
-     atoll (s))
+# if HAVE_RAW_DECL_ATOLL
+_GL_WARN_ON_USE (atoll, "atoll is unportable - "
+                 "use gnulib module atoll for portability");
+# endif
 #endif
 
 #if @GNULIB_CALLOC_POSIX@
-# if !@HAVE_CALLOC_POSIX@
-#  undef calloc
-#  define calloc rpl_calloc
-extern void * calloc (size_t nmemb, size_t size);
+# if @REPLACE_CALLOC@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef calloc
+#   define calloc rpl_calloc
+#  endif
+_GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
+_GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
+# else
+_GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
 # endif
+_GL_CXXALIASWARN (calloc);
 #elif defined GNULIB_POSIXCHECK
 # undef calloc
-# define calloc(n,s) \
-    (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \
-                      "use gnulib module calloc-posix for portability"), \
-     calloc (n, s))
+/* Assume calloc is always declared.  */
+_GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
+                 "use gnulib module calloc-posix for portability");
 #endif
 
 #if @GNULIB_CANONICALIZE_FILE_NAME@
 # if @REPLACE_CANONICALIZE_FILE_NAME@
-#  define canonicalize_file_name rpl_canonicalize_file_name
-# endif
-# if !@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@
-extern char *canonicalize_file_name (const char *name) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define canonicalize_file_name rpl_canonicalize_file_name
+#  endif
+_GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
+                                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
+# else
+#  if !@HAVE_CANONICALIZE_FILE_NAME@
+_GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
+                                                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
 # endif
+_GL_CXXALIASWARN (canonicalize_file_name);
 #elif defined GNULIB_POSIXCHECK
 # undef canonicalize_file_name
-# define canonicalize_file_name(n)                        \
-    (GL_LINK_WARNING ("canonicalize_file_name is unportable - " \
-                      "use gnulib module canonicalize-lgpl for portability"), \
-     canonicalize_file_name (n))
+# if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
+_GL_WARN_ON_USE (canonicalize_file_name,
+                 "canonicalize_file_name is unportable - "
+                 "use gnulib module canonicalize-lgpl for portability");
+# endif
 #endif
 
 #if @GNULIB_GETLOADAVG@
-# if !@HAVE_DECL_GETLOADAVG@
 /* Store max(NELEM,3) load average numbers in LOADAVG[].
    The three numbers are the load average of the last 1 minute, the last 5
    minutes, and the last 15 minutes, respectively.
    LOADAVG is an array of NELEM numbers.  */
-extern int getloadavg (double loadavg[], int nelem) _GL_ARG_NONNULL ((1));
+# if !@HAVE_DECL_GETLOADAVG@
+_GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
+                                   _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
+_GL_CXXALIASWARN (getloadavg);
 #elif defined GNULIB_POSIXCHECK
 # undef getloadavg
-# define getloadavg(l,n) \
-    (GL_LINK_WARNING ("getloadavg is not portable - " \
-                      "use gnulib module getloadavg for portability"), \
-     getloadavg (l, n))
+# if HAVE_RAW_DECL_GETLOADAVG
+_GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
+                 "use gnulib module getloadavg for portability");
+# endif
 #endif
 
 #if @GNULIB_GETSUBOPT@
@@ -169,50 +236,96 @@ extern int getloadavg (double loadavg[], int nelem) _GL_ARG_NONNULL ((1));
    For more details see the POSIX:2001 specification.
    http://www.opengroup.org/susv3xsh/getsubopt.html */
 # if !@HAVE_GETSUBOPT@
-extern int getsubopt (char **optionp, char *const *tokens, char **valuep)
-     _GL_ARG_NONNULL ((1, 2, 3));
+_GL_FUNCDECL_SYS (getsubopt, int,
+                  (char **optionp, char *const *tokens, char **valuep)
+                  _GL_ARG_NONNULL ((1, 2, 3)));
 # endif
+_GL_CXXALIAS_SYS (getsubopt, int,
+                  (char **optionp, char *const *tokens, char **valuep));
+_GL_CXXALIASWARN (getsubopt);
 #elif defined GNULIB_POSIXCHECK
 # undef getsubopt
-# define getsubopt(o,t,v) \
-    (GL_LINK_WARNING ("getsubopt is unportable - " \
-                      "use gnulib module getsubopt for portability"), \
-     getsubopt (o, t, v))
+# if HAVE_RAW_DECL_GETSUBOPT
+_GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
+                 "use gnulib module getsubopt for portability");
+# endif
 #endif
 
-#if @GNULIB_MALLOC_POSIX@
-# if !@HAVE_MALLOC_POSIX@
-#  undef malloc
-#  define malloc rpl_malloc
-extern void * malloc (size_t size);
+#if @GNULIB_GRANTPT@
+/* Change the ownership and access permission of the slave side of the
+   pseudo-terminal whose master side is specified by FD.  */
+# if !@HAVE_GRANTPT@
+_GL_FUNCDECL_SYS (grantpt, int, (int fd));
 # endif
+_GL_CXXALIAS_SYS (grantpt, int, (int fd));
+_GL_CXXALIASWARN (grantpt);
 #elif defined GNULIB_POSIXCHECK
+# undef grantpt
+# if HAVE_RAW_DECL_GRANTPT
+_GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
+                 "use gnulib module grantpt for portability");
+# endif
+#endif
+
+/* If _GL_USE_STDLIB_ALLOC is nonzero, the including module does not
+   rely on GNU or POSIX semantics for malloc and realloc (for example,
+   by never specifying a zero size), so it does not need malloc or
+   realloc to be redefined.  */
+#if @GNULIB_MALLOC_POSIX@
+# if @REPLACE_MALLOC@
+#  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
+        || _GL_USE_STDLIB_ALLOC)
+#   undef malloc
+#   define malloc rpl_malloc
+#  endif
+_GL_FUNCDECL_RPL (malloc, void *, (size_t size));
+_GL_CXXALIAS_RPL (malloc, void *, (size_t size));
+# else
+_GL_CXXALIAS_SYS (malloc, void *, (size_t size));
+# endif
+_GL_CXXALIASWARN (malloc);
+#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
 # undef malloc
-# define malloc(s) \
-    (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \
-                      "use gnulib module malloc-posix for portability"), \
-     malloc (s))
+/* Assume malloc is always declared.  */
+_GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
+                 "use gnulib module malloc-posix for portability");
+#endif
+
+/* Convert a multibyte character to a wide character.  */
+#if @GNULIB_MBTOWC@
+# if @REPLACE_MBTOWC@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mbtowc
+#   define mbtowc rpl_mbtowc
+#  endif
+_GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
+_GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
+# else
+_GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
+# endif
+_GL_CXXALIASWARN (mbtowc);
 #endif
 
 #if @GNULIB_MKDTEMP@
-# if !@HAVE_MKDTEMP@
 /* Create a unique temporary directory from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the directory name unique.
    Returns TEMPLATE, or a null pointer if it cannot get a unique name.
    The directory is created mode 700.  */
-extern char * mkdtemp (char * /*template*/) _GL_ARG_NONNULL ((1));
+# if !@HAVE_MKDTEMP@
+_GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
+_GL_CXXALIASWARN (mkdtemp);
 #elif defined GNULIB_POSIXCHECK
 # undef mkdtemp
-# define mkdtemp(t) \
-    (GL_LINK_WARNING ("mkdtemp is unportable - " \
-                      "use gnulib module mkdtemp for portability"), \
-     mkdtemp (t))
+# if HAVE_RAW_DECL_MKDTEMP
+_GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
+                 "use gnulib module mkdtemp for portability");
+# endif
 #endif
 
 #if @GNULIB_MKOSTEMP@
-# if !@HAVE_MKOSTEMP@
 /* Create a unique temporary file from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the file name unique.
@@ -225,18 +338,21 @@ extern char * mkdtemp (char * /*template*/) _GL_ARG_NONNULL ((1));
    implementation.
    Returns the open file descriptor if successful, otherwise -1 and errno
    set.  */
-extern int mkostemp (char * /*template*/, int /*flags*/) _GL_ARG_NONNULL ((1));
+# if !@HAVE_MKOSTEMP@
+_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
+                                 _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
+_GL_CXXALIASWARN (mkostemp);
 #elif defined GNULIB_POSIXCHECK
 # undef mkostemp
-# define mkostemp(t,f) \
-    (GL_LINK_WARNING ("mkostemp is unportable - " \
-                      "use gnulib module mkostemp for portability"), \
-     mkostemp (t, f))
+# if HAVE_RAW_DECL_MKOSTEMP
+_GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
+                 "use gnulib module mkostemp for portability");
+# endif
 #endif
 
 #if @GNULIB_MKOSTEMPS@
-# if !@HAVE_MKOSTEMPS@
 /* Create a unique temporary file from TEMPLATE.
    The last six characters of TEMPLATE before a suffix of length
    SUFFIXLEN must be "XXXXXX";
@@ -250,19 +366,23 @@ extern int mkostemp (char * /*template*/, int /*flags*/) _GL_ARG_NONNULL ((1));
    implementation.
    Returns the open file descriptor if successful, otherwise -1 and errno
    set.  */
-extern int mkostemps (char * /*template*/, int /*suffixlen*/, int /*flags*/)
-     _GL_ARG_NONNULL ((1));
+# if !@HAVE_MKOSTEMPS@
+_GL_FUNCDECL_SYS (mkostemps, int,
+                  (char * /*template*/, int /*suffixlen*/, int /*flags*/)
+                  _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (mkostemps, int,
+                  (char * /*template*/, int /*suffixlen*/, int /*flags*/));
+_GL_CXXALIASWARN (mkostemps);
 #elif defined GNULIB_POSIXCHECK
 # undef mkostemps
-# define mkostemps(t,s,f)                          \
-    (GL_LINK_WARNING ("mkostemps is unportable - " \
-                      "use gnulib module mkostemps for portability"), \
-     mkostemps (t, s, f))
+# if HAVE_RAW_DECL_MKOSTEMPS
+_GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
+                 "use gnulib module mkostemps for portability");
+# endif
 #endif
 
 #if @GNULIB_MKSTEMP@
-# if @REPLACE_MKSTEMP@
 /* Create a unique temporary file from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
    they are replaced with a string that makes the file name unique.
@@ -272,19 +392,28 @@ extern int mkostemps (char * /*template*/, int /*suffixlen*/, int /*flags*/)
    implementation.
    Returns the open file descriptor if successful, otherwise -1 and errno
    set.  */
-#  define mkstemp rpl_mkstemp
-extern int mkstemp (char * /*template*/) _GL_ARG_NONNULL ((1));
+# if @REPLACE_MKSTEMP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mkstemp rpl_mkstemp
+#  endif
+_GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
+# else
+#  if ! @HAVE_MKSTEMP@
+_GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
 # endif
+_GL_CXXALIASWARN (mkstemp);
 #elif defined GNULIB_POSIXCHECK
 # undef mkstemp
-# define mkstemp(t) \
-    (GL_LINK_WARNING ("mkstemp is unportable - " \
-                      "use gnulib module mkstemp for portability"), \
-     mkstemp (t))
+# if HAVE_RAW_DECL_MKSTEMP
+_GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
+                 "use gnulib module mkstemp for portability");
+# endif
 #endif
 
 #if @GNULIB_MKSTEMPS@
-# if !@HAVE_MKSTEMPS@
 /* Create a unique temporary file from TEMPLATE.
    The last six characters of TEMPLATE prior to a suffix of length
    SUFFIXLEN must be "XXXXXX";
@@ -295,145 +424,398 @@ extern int mkstemp (char * /*template*/) _GL_ARG_NONNULL ((1));
    implementation.
    Returns the open file descriptor if successful, otherwise -1 and errno
    set.  */
-extern int mkstemps (char * /*template*/, int /*suffixlen*/)
-     _GL_ARG_NONNULL ((1));
+# if !@HAVE_MKSTEMPS@
+_GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
+                                 _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
+_GL_CXXALIASWARN (mkstemps);
 #elif defined GNULIB_POSIXCHECK
 # undef mkstemps
-# define mkstemps(t,s)                             \
-    (GL_LINK_WARNING ("mkstemps is unportable - " \
-                      "use gnulib module mkstemps for portability"), \
-     mkstemps (t, s))
+# if HAVE_RAW_DECL_MKSTEMPS
+_GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
+                 "use gnulib module mkstemps for portability");
+# endif
+#endif
+
+#if @GNULIB_POSIX_OPENPT@
+/* Return an FD open to the master side of a pseudo-terminal.  Flags should
+   include O_RDWR, and may also include O_NOCTTY.  */
+# if !@HAVE_POSIX_OPENPT@
+_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
+# endif
+_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
+_GL_CXXALIASWARN (posix_openpt);
+#elif defined GNULIB_POSIXCHECK
+# undef posix_openpt
+# if HAVE_RAW_DECL_POSIX_OPENPT
+_GL_WARN_ON_USE (posix_openpt, "posix_openpt is not portable - "
+                 "use gnulib module posix_openpt for portability");
+# endif
+#endif
+
+#if @GNULIB_PTSNAME@
+/* Return the pathname of the pseudo-terminal slave associated with
+   the master FD is open on, or NULL on errors.  */
+# if !@HAVE_PTSNAME@
+_GL_FUNCDECL_SYS (ptsname, char *, (int fd));
+# endif
+_GL_CXXALIAS_SYS (ptsname, char *, (int fd));
+_GL_CXXALIASWARN (ptsname);
+#elif defined GNULIB_POSIXCHECK
+# undef ptsname
+# if HAVE_RAW_DECL_PTSNAME
+_GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
+                 "use gnulib module ptsname for portability");
+# endif
+#endif
+
+#if @GNULIB_PTSNAME_R@
+/* Set the pathname of the pseudo-terminal slave associated with
+   the master FD is open on and return 0, or set errno and return
+   non-zero on errors.  */
+# if @REPLACE_PTSNAME_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ptsname_r
+#   define ptsname_r rpl_ptsname_r
+#  endif
+_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
+_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
+# else
+#  if !@HAVE_PTSNAME_R@
+_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
+#  endif
+_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
+# endif
+_GL_CXXALIASWARN (ptsname_r);
+#elif defined GNULIB_POSIXCHECK
+# undef ptsname_r
+# if HAVE_RAW_DECL_PTSNAME_R
+_GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
+                 "use gnulib module ptsname_r for portability");
+# endif
 #endif
 
 #if @GNULIB_PUTENV@
 # if @REPLACE_PUTENV@
-#  undef putenv
-#  define putenv rpl_putenv
-extern int putenv (char *string) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef putenv
+#   define putenv rpl_putenv
+#  endif
+_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (putenv, int, (char *string));
+# else
+_GL_CXXALIAS_SYS (putenv, int, (char *string));
 # endif
+_GL_CXXALIASWARN (putenv);
 #endif
 
+
 #if @GNULIB_RANDOM_R@
 # if !@HAVE_RANDOM_R@
-
 #  ifndef RAND_MAX
 #   define RAND_MAX 2147483647
 #  endif
+# endif
+#endif
+
+
+#if @GNULIB_RANDOM@
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (random, long, (void));
+# endif
+_GL_CXXALIAS_SYS (random, long, (void));
+_GL_CXXALIASWARN (random);
+#elif defined GNULIB_POSIXCHECK
+# undef random
+# if HAVE_RAW_DECL_RANDOM
+_GL_WARN_ON_USE (random, "random is unportable - "
+                 "use gnulib module random for portability");
+# endif
+#endif
 
-int srandom_r (unsigned int seed, struct random_data *rand_state)
-     _GL_ARG_NONNULL ((2));
-int initstate_r (unsigned int seed, char *buf, size_t buf_size,
-                 struct random_data *rand_state)
-     _GL_ARG_NONNULL ((2, 4));
-int setstate_r (char *arg_state, struct random_data *rand_state)
-     _GL_ARG_NONNULL ((1, 2));
-int random_r (struct random_data *buf, int32_t *result)
-     _GL_ARG_NONNULL ((1, 2));
+#if @GNULIB_RANDOM@
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
 # endif
+_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
+_GL_CXXALIASWARN (srandom);
+#elif defined GNULIB_POSIXCHECK
+# undef srandom
+# if HAVE_RAW_DECL_SRANDOM
+_GL_WARN_ON_USE (srandom, "srandom is unportable - "
+                 "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (initstate, char *,
+                  (unsigned int seed, char *buf, size_t buf_size)
+                  _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (initstate, char *,
+                  (unsigned int seed, char *buf, size_t buf_size));
+_GL_CXXALIASWARN (initstate);
+#elif defined GNULIB_POSIXCHECK
+# undef initstate
+# if HAVE_RAW_DECL_INITSTATE_R
+_GL_WARN_ON_USE (initstate, "initstate is unportable - "
+                 "use gnulib module random for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM@
+# if !@HAVE_RANDOM@
+_GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
+_GL_CXXALIASWARN (setstate);
+#elif defined GNULIB_POSIXCHECK
+# undef setstate
+# if HAVE_RAW_DECL_SETSTATE_R
+_GL_WARN_ON_USE (setstate, "setstate is unportable - "
+                 "use gnulib module random for portability");
+# endif
+#endif
+
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef random_r
+#   define random_r rpl_random_r
+#  endif
+_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result)
+                                 _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result));
+# else
+#  if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
+                                 _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
+# endif
+_GL_CXXALIASWARN (random_r);
 #elif defined GNULIB_POSIXCHECK
 # undef random_r
-# define random_r(b,r)                            \
-    (GL_LINK_WARNING ("random_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     random_r (b,r))
-# undef initstate_r
-# define initstate_r(s,b,sz,r)                       \
-    (GL_LINK_WARNING ("initstate_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     initstate_r (s,b,sz,r))
+# if HAVE_RAW_DECL_RANDOM_R
+_GL_WARN_ON_USE (random_r, "random_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef srandom_r
+#   define srandom_r rpl_srandom_r
+#  endif
+_GL_FUNCDECL_RPL (srandom_r, int,
+                  (unsigned int seed, struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (srandom_r, int,
+                  (unsigned int seed, struct random_data *rand_state));
+# else
+#  if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (srandom_r, int,
+                  (unsigned int seed, struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (srandom_r, int,
+                  (unsigned int seed, struct random_data *rand_state));
+# endif
+_GL_CXXALIASWARN (srandom_r);
+#elif defined GNULIB_POSIXCHECK
 # undef srandom_r
-# define srandom_r(s,r)                            \
-    (GL_LINK_WARNING ("srandom_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     srandom_r (s,r))
+# if HAVE_RAW_DECL_SRANDOM_R
+_GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef initstate_r
+#   define initstate_r rpl_initstate_r
+#  endif
+_GL_FUNCDECL_RPL (initstate_r, int,
+                  (unsigned int seed, char *buf, size_t buf_size,
+                   struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (initstate_r, int,
+                  (unsigned int seed, char *buf, size_t buf_size,
+                   struct random_data *rand_state));
+# else
+#  if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (initstate_r, int,
+                  (unsigned int seed, char *buf, size_t buf_size,
+                   struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((2, 4)));
+#  endif
+_GL_CXXALIAS_SYS (initstate_r, int,
+                  (unsigned int seed, char *buf, size_t buf_size,
+                   struct random_data *rand_state));
+# endif
+_GL_CXXALIASWARN (initstate_r);
+#elif defined GNULIB_POSIXCHECK
+# undef initstate_r
+# if HAVE_RAW_DECL_INITSTATE_R
+_GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
+#endif
+
+#if @GNULIB_RANDOM_R@
+# if @REPLACE_RANDOM_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef setstate_r
+#   define setstate_r rpl_setstate_r
+#  endif
+_GL_FUNCDECL_RPL (setstate_r, int,
+                  (char *arg_state, struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (setstate_r, int,
+                  (char *arg_state, struct random_data *rand_state));
+# else
+#  if !@HAVE_RANDOM_R@
+_GL_FUNCDECL_SYS (setstate_r, int,
+                  (char *arg_state, struct random_data *rand_state)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (setstate_r, int,
+                  (char *arg_state, struct random_data *rand_state));
+# endif
+_GL_CXXALIASWARN (setstate_r);
+#elif defined GNULIB_POSIXCHECK
 # undef setstate_r
-# define setstate_r(a,r)                                    \
-    (GL_LINK_WARNING ("setstate_r is unportable - " \
-                      "use gnulib module random_r for portability"), \
-     setstate_r (a,r))
+# if HAVE_RAW_DECL_SETSTATE_R
+_GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
+                 "use gnulib module random_r for portability");
+# endif
 #endif
 
+
 #if @GNULIB_REALLOC_POSIX@
-# if !@HAVE_REALLOC_POSIX@
-#  undef realloc
-#  define realloc rpl_realloc
-extern void * realloc (void *ptr, size_t size);
+# if @REPLACE_REALLOC@
+#  if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
+        || _GL_USE_STDLIB_ALLOC)
+#   undef realloc
+#   define realloc rpl_realloc
+#  endif
+_GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
+_GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
+# else
+_GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
 # endif
-#elif defined GNULIB_POSIXCHECK
+_GL_CXXALIASWARN (realloc);
+#elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
 # undef realloc
-# define realloc(p,s) \
-    (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \
-                      "use gnulib module realloc-posix for portability"), \
-     realloc (p, s))
+/* Assume realloc is always declared.  */
+_GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
+                 "use gnulib module realloc-posix for portability");
 #endif
 
 #if @GNULIB_REALPATH@
 # if @REPLACE_REALPATH@
-#  define realpath rpl_realpath
-# endif
-# if !@HAVE_REALPATH@ || @REPLACE_REALPATH@
-extern char *realpath (const char *name, char *resolved) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define realpath rpl_realpath
+#  endif
+_GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
+                                    _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
+# else
+#  if !@HAVE_REALPATH@
+_GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
+                                    _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved));
 # endif
+_GL_CXXALIASWARN (realpath);
 #elif defined GNULIB_POSIXCHECK
 # undef realpath
-# define realpath(n,r)                        \
-    (GL_LINK_WARNING ("realpath is unportable - use gnulib module " \
-                      "canonicalize or canonicalize-lgpl for portability"), \
-     realpath (n, r))
+# if HAVE_RAW_DECL_REALPATH
+_GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
+                 "canonicalize or canonicalize-lgpl for portability");
+# endif
 #endif
 
 #if @GNULIB_RPMATCH@
-# if !@HAVE_RPMATCH@
 /* Test a user response to a question.
    Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear.  */
-extern int rpmatch (const char *response) _GL_ARG_NONNULL ((1));
+# if !@HAVE_RPMATCH@
+_GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
+_GL_CXXALIASWARN (rpmatch);
 #elif defined GNULIB_POSIXCHECK
 # undef rpmatch
-# define rpmatch(r) \
-    (GL_LINK_WARNING ("rpmatch is unportable - " \
-                      "use gnulib module rpmatch for portability"), \
-     rpmatch (r))
+# if HAVE_RAW_DECL_RPMATCH
+_GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
+                 "use gnulib module rpmatch for portability");
+# endif
 #endif
 
 #if @GNULIB_SETENV@
-# if @REPLACE_SETENV@
-#  undef setenv
-#  define setenv rpl_setenv
-# endif
-# if !@HAVE_SETENV@ || @REPLACE_SETENV@
 /* Set NAME to VALUE in the environment.
    If REPLACE is nonzero, overwrite an existing value.  */
-extern int setenv (const char *name, const char *value, int replace)
-     _GL_ARG_NONNULL ((1));
+# if @REPLACE_SETENV@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef setenv
+#   define setenv rpl_setenv
+#  endif
+_GL_FUNCDECL_RPL (setenv, int,
+                  (const char *name, const char *value, int replace)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (setenv, int,
+                  (const char *name, const char *value, int replace));
+# else
+#  if !@HAVE_DECL_SETENV@
+_GL_FUNCDECL_SYS (setenv, int,
+                  (const char *name, const char *value, int replace)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (setenv, int,
+                  (const char *name, const char *value, int replace));
+# endif
+# if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
+_GL_CXXALIASWARN (setenv);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef setenv
-# define setenv(n,v,o)                                                  \
-    (GL_LINK_WARNING ("setenv is unportable - "                         \
-                      "use gnulib module setenv for portability"),      \
-     setenv (n, v, o))
+# if HAVE_RAW_DECL_SETENV
+_GL_WARN_ON_USE (setenv, "setenv is unportable - "
+                 "use gnulib module setenv for portability");
+# endif
 #endif
 
 #if @GNULIB_STRTOD@
-# if @REPLACE_STRTOD@
-#  define strtod rpl_strtod
-# endif
-# if !@HAVE_STRTOD@ || @REPLACE_STRTOD@
  /* Parse a double from STRING, updating ENDP if appropriate.  */
-extern double strtod (const char *str, char **endp) _GL_ARG_NONNULL ((1));
+# if @REPLACE_STRTOD@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strtod rpl_strtod
+#  endif
+_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
+                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
+# else
+#  if !@HAVE_STRTOD@
+_GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
+                                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
 # endif
+_GL_CXXALIASWARN (strtod);
 #elif defined GNULIB_POSIXCHECK
 # undef strtod
-# define strtod(s, e)                           \
-    (GL_LINK_WARNING ("strtod is unportable - " \
-                      "use gnulib module strtod for portability"), \
-     strtod (s, e))
+# if HAVE_RAW_DECL_STRTOD
+_GL_WARN_ON_USE (strtod, "strtod is unportable - "
+                 "use gnulib module strtod for portability");
+# endif
 #endif
 
 #if @GNULIB_STRTOLL@
-# if !@HAVE_STRTOLL@
 /* Parse a signed integer whose textual representation starts at STRING.
    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
@@ -442,19 +824,23 @@ extern double strtod (const char *str, char **endp) _GL_ARG_NONNULL ((1));
    stored in *ENDPTR.
    Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
    to ERANGE.  */
-extern long long strtoll (const char *string, char **endptr, int base)
-     _GL_ARG_NONNULL ((1));
+# if !@HAVE_STRTOLL@
+_GL_FUNCDECL_SYS (strtoll, long long,
+                  (const char *string, char **endptr, int base)
+                  _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (strtoll, long long,
+                  (const char *string, char **endptr, int base));
+_GL_CXXALIASWARN (strtoll);
 #elif defined GNULIB_POSIXCHECK
 # undef strtoll
-# define strtoll(s,e,b) \
-    (GL_LINK_WARNING ("strtoll is unportable - " \
-                      "use gnulib module strtoll for portability"), \
-     strtoll (s, e, b))
+# if HAVE_RAW_DECL_STRTOLL
+_GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
+                 "use gnulib module strtoll for portability");
+# endif
 #endif
 
 #if @GNULIB_STRTOULL@
-# if !@HAVE_STRTOULL@
 /* Parse an unsigned integer whose textual representation starts at STRING.
    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
    it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
@@ -463,38 +849,80 @@ extern long long strtoll (const char *string, char **endptr, int base)
    stored in *ENDPTR.
    Upon overflow, the return value is ULLONG_MAX, and errno is set to
    ERANGE.  */
-extern unsigned long long strtoull (const char *string, char **endptr, int base)
-     _GL_ARG_NONNULL ((1));
+# if !@HAVE_STRTOULL@
+_GL_FUNCDECL_SYS (strtoull, unsigned long long,
+                  (const char *string, char **endptr, int base)
+                  _GL_ARG_NONNULL ((1)));
 # endif
+_GL_CXXALIAS_SYS (strtoull, unsigned long long,
+                  (const char *string, char **endptr, int base));
+_GL_CXXALIASWARN (strtoull);
 #elif defined GNULIB_POSIXCHECK
 # undef strtoull
-# define strtoull(s,e,b) \
-    (GL_LINK_WARNING ("strtoull is unportable - " \
-                      "use gnulib module strtoull for portability"), \
-     strtoull (s, e, b))
+# if HAVE_RAW_DECL_STRTOULL
+_GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
+                 "use gnulib module strtoull for portability");
+# endif
+#endif
+
+#if @GNULIB_UNLOCKPT@
+/* Unlock the slave side of the pseudo-terminal whose master side is specified
+   by FD, so that it can be opened.  */
+# if !@HAVE_UNLOCKPT@
+_GL_FUNCDECL_SYS (unlockpt, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (unlockpt, int, (int fd));
+_GL_CXXALIASWARN (unlockpt);
+#elif defined GNULIB_POSIXCHECK
+# undef unlockpt
+# if HAVE_RAW_DECL_UNLOCKPT
+_GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
+                 "use gnulib module unlockpt for portability");
+# endif
 #endif
 
 #if @GNULIB_UNSETENV@
+/* Remove the variable NAME from the environment.  */
 # if @REPLACE_UNSETENV@
-#  undef unsetenv
-#  define unsetenv rpl_unsetenv
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef unsetenv
+#   define unsetenv rpl_unsetenv
+#  endif
+_GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
+# else
+#  if !@HAVE_DECL_UNSETENV@
+_GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
 # endif
-# if !@HAVE_UNSETENV@ || @REPLACE_UNSETENV@
-/* Remove the variable NAME from the environment.  */
-extern int unsetenv (const char *name) _GL_ARG_NONNULL ((1));
+# if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
+_GL_CXXALIASWARN (unsetenv);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef unsetenv
-# define unsetenv(n)                                                    \
-    (GL_LINK_WARNING ("unsetenv is unportable - "                       \
-                      "use gnulib module unsetenv for portability"),    \
-     unsetenv (n))
+# if HAVE_RAW_DECL_UNSETENV
+_GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
+                 "use gnulib module unsetenv for portability");
+# endif
 #endif
 
-#ifdef __cplusplus
-}
+/* Convert a wide character to a multibyte character.  */
+#if @GNULIB_WCTOMB@
+# if @REPLACE_WCTOMB@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wctomb
+#   define wctomb rpl_wctomb
+#  endif
+_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
+_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
+# else
+_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
+# endif
+_GL_CXXALIASWARN (wctomb);
 #endif
 
-#endif /* _GL_STDLIB_H */
-#endif /* _GL_STDLIB_H */
+
+#endif /* _@GUARD_PREFIX@_STDLIB_H */
+#endif /* _@GUARD_PREFIX@_STDLIB_H */
 #endif
index 223ac7f583390824792ce3bb22a4f5b2fe0d2fb4..a3f8c863f38c10d77e6355948a6a80e58626a352 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-/* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004, 2006, 2007, 2009,
-   2010 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2012 Free Software
+   Foundation, Inc.
 
    This file is part of the GNU C Library.
 
@@ -16,8 +14,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBC
 # include <config.h>
index 97ebcbe0e91668ac2763d7d1a4fc9ff46331477c..b312f7f917fe7235bda06c584bcb3a0e307a437e 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Optimized string comparison.
-   Copyright (C) 2001-2002, 2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2007, 2009-2012 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
@@ -11,7 +9,7 @@
    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
-   Lesser General Public License for more details.
+   General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
@@ -23,8 +21,8 @@
 
 #include <string.h>
 
-/* STREQ allows to optimize string comparison with a small literal string.
-     STREQ (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
+/* STREQ_OPT allows to optimize string comparison with a small literal string.
+     STREQ_OPT (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
    is semantically equivalent to
      strcmp (s, "EUC-KR") == 0
    just faster.  */
@@ -165,12 +163,12 @@ streq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23,
     return 0;
 }
 
-#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
   streq0 (s1, s2, s20, s21, s22, s23, s24, s25, s26, s27, s28)
 
 #else
 
-#define STREQ(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
+#define STREQ_OPT(s1,s2,s20,s21,s22,s23,s24,s25,s26,s27,s28) \
   (strcmp (s1, s2) == 0)
 
 #endif
diff --git a/lib/strerror-override.c b/lib/strerror-override.c
new file mode 100644 (file)
index 0000000..9f55cfa
--- /dev/null
@@ -0,0 +1,297 @@
+/* strerror-override.c --- POSIX compatible system error routine
+
+   Copyright (C) 2010-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
+
+#include <config.h>
+
+#include "strerror-override.h"
+
+#include <errno.h>
+
+#if GNULIB_defined_EWINSOCK /* native Windows platforms */
+# if HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
+#endif
+
+/* If ERRNUM maps to an errno value defined by gnulib, return a string
+   describing the error.  Otherwise return NULL.  */
+const char *
+strerror_override (int errnum)
+{
+  /* These error messages are taken from glibc/sysdeps/gnu/errlist.c.  */
+  switch (errnum)
+    {
+#if REPLACE_STRERROR_0
+    case 0:
+      return "Success";
+#endif
+
+#if GNULIB_defined_ESOCK /* native Windows platforms with older <errno.h> */
+    case EINPROGRESS:
+      return "Operation now in progress";
+    case EALREADY:
+      return "Operation already in progress";
+    case ENOTSOCK:
+      return "Socket operation on non-socket";
+    case EDESTADDRREQ:
+      return "Destination address required";
+    case EMSGSIZE:
+      return "Message too long";
+    case EPROTOTYPE:
+      return "Protocol wrong type for socket";
+    case ENOPROTOOPT:
+      return "Protocol not available";
+    case EPROTONOSUPPORT:
+      return "Protocol not supported";
+    case EOPNOTSUPP:
+      return "Operation not supported";
+    case EAFNOSUPPORT:
+      return "Address family not supported by protocol";
+    case EADDRINUSE:
+      return "Address already in use";
+    case EADDRNOTAVAIL:
+      return "Cannot assign requested address";
+    case ENETDOWN:
+      return "Network is down";
+    case ENETUNREACH:
+      return "Network is unreachable";
+    case ECONNRESET:
+      return "Connection reset by peer";
+    case ENOBUFS:
+      return "No buffer space available";
+    case EISCONN:
+      return "Transport endpoint is already connected";
+    case ENOTCONN:
+      return "Transport endpoint is not connected";
+    case ETIMEDOUT:
+      return "Connection timed out";
+    case ECONNREFUSED:
+      return "Connection refused";
+    case ELOOP:
+      return "Too many levels of symbolic links";
+    case EHOSTUNREACH:
+      return "No route to host";
+    case EWOULDBLOCK:
+      return "Operation would block";
+#endif
+#if GNULIB_defined_ESTREAMS /* native Windows platforms with older <errno.h> */
+    case ETXTBSY:
+      return "Text file busy";
+    case ENODATA:
+      return "No data available";
+    case ENOSR:
+      return "Out of streams resources";
+    case ENOSTR:
+      return "Device not a stream";
+    case ETIME:
+      return "Timer expired";
+    case EOTHER:
+      return "Other error";
+#endif
+#if GNULIB_defined_EWINSOCK /* native Windows platforms */
+    case ESOCKTNOSUPPORT:
+      return "Socket type not supported";
+    case EPFNOSUPPORT:
+      return "Protocol family not supported";
+    case ESHUTDOWN:
+      return "Cannot send after transport endpoint shutdown";
+    case ETOOMANYREFS:
+      return "Too many references: cannot splice";
+    case EHOSTDOWN:
+      return "Host is down";
+    case EPROCLIM:
+      return "Too many processes";
+    case EUSERS:
+      return "Too many users";
+    case EDQUOT:
+      return "Disk quota exceeded";
+    case ESTALE:
+      return "Stale NFS file handle";
+    case EREMOTE:
+      return "Object is remote";
+# if HAVE_WINSOCK2_H
+      /* WSA_INVALID_HANDLE maps to EBADF */
+      /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */
+      /* WSA_INVALID_PARAMETER maps to EINVAL */
+    case WSA_OPERATION_ABORTED:
+      return "Overlapped operation aborted";
+    case WSA_IO_INCOMPLETE:
+      return "Overlapped I/O event object not in signaled state";
+    case WSA_IO_PENDING:
+      return "Overlapped operations will complete later";
+      /* WSAEINTR maps to EINTR */
+      /* WSAEBADF maps to EBADF */
+      /* WSAEACCES maps to EACCES */
+      /* WSAEFAULT maps to EFAULT */
+      /* WSAEINVAL maps to EINVAL */
+      /* WSAEMFILE maps to EMFILE */
+      /* WSAEWOULDBLOCK maps to EWOULDBLOCK */
+      /* WSAEINPROGRESS maps to EINPROGRESS */
+      /* WSAEALREADY maps to EALREADY */
+      /* WSAENOTSOCK maps to ENOTSOCK */
+      /* WSAEDESTADDRREQ maps to EDESTADDRREQ */
+      /* WSAEMSGSIZE maps to EMSGSIZE */
+      /* WSAEPROTOTYPE maps to EPROTOTYPE */
+      /* WSAENOPROTOOPT maps to ENOPROTOOPT */
+      /* WSAEPROTONOSUPPORT maps to EPROTONOSUPPORT */
+      /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */
+      /* WSAEOPNOTSUPP maps to EOPNOTSUPP */
+      /* WSAEPFNOSUPPORT is EPFNOSUPPORT */
+      /* WSAEAFNOSUPPORT maps to EAFNOSUPPORT */
+      /* WSAEADDRINUSE maps to EADDRINUSE */
+      /* WSAEADDRNOTAVAIL maps to EADDRNOTAVAIL */
+      /* WSAENETDOWN maps to ENETDOWN */
+      /* WSAENETUNREACH maps to ENETUNREACH */
+      /* WSAENETRESET maps to ENETRESET */
+      /* WSAECONNABORTED maps to ECONNABORTED */
+      /* WSAECONNRESET maps to ECONNRESET */
+      /* WSAENOBUFS maps to ENOBUFS */
+      /* WSAEISCONN maps to EISCONN */
+      /* WSAENOTCONN maps to ENOTCONN */
+      /* WSAESHUTDOWN is ESHUTDOWN */
+      /* WSAETOOMANYREFS is ETOOMANYREFS */
+      /* WSAETIMEDOUT maps to ETIMEDOUT */
+      /* WSAECONNREFUSED maps to ECONNREFUSED */
+      /* WSAELOOP maps to ELOOP */
+      /* WSAENAMETOOLONG maps to ENAMETOOLONG */
+      /* WSAEHOSTDOWN is EHOSTDOWN */
+      /* WSAEHOSTUNREACH maps to EHOSTUNREACH */
+      /* WSAENOTEMPTY maps to ENOTEMPTY */
+      /* WSAEPROCLIM is EPROCLIM */
+      /* WSAEUSERS is EUSERS */
+      /* WSAEDQUOT is EDQUOT */
+      /* WSAESTALE is ESTALE */
+      /* WSAEREMOTE is EREMOTE */
+    case WSASYSNOTREADY:
+      return "Network subsystem is unavailable";
+    case WSAVERNOTSUPPORTED:
+      return "Winsock.dll version out of range";
+    case WSANOTINITIALISED:
+      return "Successful WSAStartup not yet performed";
+    case WSAEDISCON:
+      return "Graceful shutdown in progress";
+    case WSAENOMORE: case WSA_E_NO_MORE:
+      return "No more results";
+    case WSAECANCELLED: case WSA_E_CANCELLED:
+      return "Call was canceled";
+    case WSAEINVALIDPROCTABLE:
+      return "Procedure call table is invalid";
+    case WSAEINVALIDPROVIDER:
+      return "Service provider is invalid";
+    case WSAEPROVIDERFAILEDINIT:
+      return "Service provider failed to initialize";
+    case WSASYSCALLFAILURE:
+      return "System call failure";
+    case WSASERVICE_NOT_FOUND:
+      return "Service not found";
+    case WSATYPE_NOT_FOUND:
+      return "Class type not found";
+    case WSAEREFUSED:
+      return "Database query was refused";
+    case WSAHOST_NOT_FOUND:
+      return "Host not found";
+    case WSATRY_AGAIN:
+      return "Nonauthoritative host not found";
+    case WSANO_RECOVERY:
+      return "Nonrecoverable error";
+    case WSANO_DATA:
+      return "Valid name, no data record of requested type";
+      /* WSA_QOS_* omitted */
+# endif
+#endif
+
+#if GNULIB_defined_ENOMSG
+    case ENOMSG:
+      return "No message of desired type";
+#endif
+
+#if GNULIB_defined_EIDRM
+    case EIDRM:
+      return "Identifier removed";
+#endif
+
+#if GNULIB_defined_ENOLINK
+    case ENOLINK:
+      return "Link has been severed";
+#endif
+
+#if GNULIB_defined_EPROTO
+    case EPROTO:
+      return "Protocol error";
+#endif
+
+#if GNULIB_defined_EMULTIHOP
+    case EMULTIHOP:
+      return "Multihop attempted";
+#endif
+
+#if GNULIB_defined_EBADMSG
+    case EBADMSG:
+      return "Bad message";
+#endif
+
+#if GNULIB_defined_EOVERFLOW
+    case EOVERFLOW:
+      return "Value too large for defined data type";
+#endif
+
+#if GNULIB_defined_ENOTSUP
+    case ENOTSUP:
+      return "Not supported";
+#endif
+
+#if GNULIB_defined_ENETRESET
+    case ENETRESET:
+      return "Network dropped connection on reset";
+#endif
+
+#if GNULIB_defined_ECONNABORTED
+    case ECONNABORTED:
+      return "Software caused connection abort";
+#endif
+
+#if GNULIB_defined_ESTALE
+    case ESTALE:
+      return "Stale NFS file handle";
+#endif
+
+#if GNULIB_defined_EDQUOT
+    case EDQUOT:
+      return "Disk quota exceeded";
+#endif
+
+#if GNULIB_defined_ECANCELED
+    case ECANCELED:
+      return "Operation canceled";
+#endif
+
+#if GNULIB_defined_EOWNERDEAD
+    case EOWNERDEAD:
+      return "Owner died";
+#endif
+
+#if GNULIB_defined_ENOTRECOVERABLE
+    case ENOTRECOVERABLE:
+      return "State not recoverable";
+#endif
+
+    default:
+      return NULL;
+    }
+}
diff --git a/lib/strerror-override.h b/lib/strerror-override.h
new file mode 100644 (file)
index 0000000..fe1fb2c
--- /dev/null
@@ -0,0 +1,55 @@
+/* strerror-override.h --- POSIX compatible system error routine
+
+   Copyright (C) 2010-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _GL_STRERROR_OVERRIDE_H
+# define _GL_STRERROR_OVERRIDE_H
+
+# include <errno.h>
+# include <stddef.h>
+
+/* Reasonable buffer size that should never trigger ERANGE; if this
+   proves too small, we intentionally abort(), to remind us to fix
+   this value.  */
+# define STACKBUF_LEN 256
+
+/* If ERRNUM maps to an errno value defined by gnulib, return a string
+   describing the error.  Otherwise return NULL.  */
+# if REPLACE_STRERROR_0 \
+     || GNULIB_defined_ESOCK \
+     || GNULIB_defined_ESTREAMS \
+     || GNULIB_defined_EWINSOCK \
+     || GNULIB_defined_ENOMSG \
+     || GNULIB_defined_EIDRM \
+     || GNULIB_defined_ENOLINK \
+     || GNULIB_defined_EPROTO \
+     || GNULIB_defined_EMULTIHOP \
+     || GNULIB_defined_EBADMSG \
+     || GNULIB_defined_EOVERFLOW \
+     || GNULIB_defined_ENOTSUP \
+     || GNULIB_defined_ENETRESET \
+     || GNULIB_defined_ECONNABORTED \
+     || GNULIB_defined_ESTALE \
+     || GNULIB_defined_EDQUOT \
+     || GNULIB_defined_ECANCELED \
+     || GNULIB_defined_EOWNERDEAD \
+     || GNULIB_defined_ENOTRECOVERABLE
+extern const char *strerror_override (int errnum);
+# else
+#  define strerror_override(ignored) NULL
+# endif
+
+#endif /* _GL_STRERROR_OVERRIDE_H */
index b0df7784898a90c5f284cd30bd880c92f1165621..587bd21a6c6a34ab3d2b745b2dee03f26c70e587 100644 (file)
@@ -1,6 +1,6 @@
 /* strerror.c --- POSIX compatible system error routine
 
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
 
 #include <config.h>
 
+/* Specification.  */
 #include <string.h>
 
-#if REPLACE_STRERROR
-
-# include <errno.h>
-# include <stdio.h>
-
-# if GNULIB_defined_ESOCK /* native Windows platforms */
-#  if HAVE_WINSOCK2_H
-#   include <winsock2.h>
-#  endif
-# endif
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
-# include "intprops.h"
+#include "intprops.h"
+#include "strerror-override.h"
+#include "verify.h"
 
-# undef strerror
-# if ! HAVE_DECL_STRERROR
-#  define strerror(n) NULL
-# endif
+/* Use the system functions, not the gnulib overrides in this file.  */
+#undef sprintf
 
 char *
-rpl_strerror (int n)
+strerror (int n)
+#undef strerror
 {
-  char const *msg = NULL;
-  /* These error messages are taken from glibc/sysdeps/gnu/errlist.c.  */
-  switch (n)
-    {
-# if GNULIB_defined_ETXTBSY
-    case ETXTBSY:
-      msg = "Text file busy";
-      break;
-# endif
-
-# if GNULIB_defined_ESOCK /* native Windows platforms */
-    /* EWOULDBLOCK is the same as EAGAIN.  */
-    case EINPROGRESS:
-      msg = "Operation now in progress";
-      break;
-    case EALREADY:
-      msg = "Operation already in progress";
-      break;
-    case ENOTSOCK:
-      msg = "Socket operation on non-socket";
-      break;
-    case EDESTADDRREQ:
-      msg = "Destination address required";
-      break;
-    case EMSGSIZE:
-      msg = "Message too long";
-      break;
-    case EPROTOTYPE:
-      msg = "Protocol wrong type for socket";
-      break;
-    case ENOPROTOOPT:
-      msg = "Protocol not available";
-      break;
-    case EPROTONOSUPPORT:
-      msg = "Protocol not supported";
-      break;
-    case ESOCKTNOSUPPORT:
-      msg = "Socket type not supported";
-      break;
-    case EOPNOTSUPP:
-      msg = "Operation not supported";
-      break;
-    case EPFNOSUPPORT:
-      msg = "Protocol family not supported";
-      break;
-    case EAFNOSUPPORT:
-      msg = "Address family not supported by protocol";
-      break;
-    case EADDRINUSE:
-      msg = "Address already in use";
-      break;
-    case EADDRNOTAVAIL:
-      msg = "Cannot assign requested address";
-      break;
-    case ENETDOWN:
-      msg = "Network is down";
-      break;
-    case ENETUNREACH:
-      msg = "Network is unreachable";
-      break;
-    case ENETRESET:
-      msg = "Network dropped connection on reset";
-      break;
-    case ECONNABORTED:
-      msg = "Software caused connection abort";
-      break;
-    case ECONNRESET:
-      msg = "Connection reset by peer";
-      break;
-    case ENOBUFS:
-      msg = "No buffer space available";
-      break;
-    case EISCONN:
-      msg = "Transport endpoint is already connected";
-      break;
-    case ENOTCONN:
-      msg = "Transport endpoint is not connected";
-      break;
-    case ESHUTDOWN:
-      msg = "Cannot send after transport endpoint shutdown";
-      break;
-    case ETOOMANYREFS:
-      msg = "Too many references: cannot splice";
-      break;
-    case ETIMEDOUT:
-      msg = "Connection timed out";
-      break;
-    case ECONNREFUSED:
-      msg = "Connection refused";
-      break;
-    case ELOOP:
-      msg = "Too many levels of symbolic links";
-      break;
-    case EHOSTDOWN:
-      msg = "Host is down";
-      break;
-    case EHOSTUNREACH:
-      msg = "No route to host";
-      break;
-    case EPROCLIM:
-      msg = "Too many processes";
-      break;
-    case EUSERS:
-      msg = "Too many users";
-      break;
-    case EDQUOT:
-      msg = "Disk quota exceeded";
-      break;
-    case ESTALE:
-      msg = "Stale NFS file handle";
-      break;
-    case EREMOTE:
-      msg = "Object is remote";
-      break;
-#  if HAVE_WINSOCK2_H
-    /* WSA_INVALID_HANDLE maps to EBADF */
-    /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */
-    /* WSA_INVALID_PARAMETER maps to EINVAL */
-    case WSA_OPERATION_ABORTED:
-      msg = "Overlapped operation aborted";
-      break;
-    case WSA_IO_INCOMPLETE:
-      msg = "Overlapped I/O event object not in signaled state";
-      break;
-    case WSA_IO_PENDING:
-      msg = "Overlapped operations will complete later";
-      break;
-    /* WSAEINTR maps to EINTR */
-    /* WSAEBADF maps to EBADF */
-    /* WSAEACCES maps to EACCES */
-    /* WSAEFAULT maps to EFAULT */
-    /* WSAEINVAL maps to EINVAL */
-    /* WSAEMFILE maps to EMFILE */
-    /* WSAEWOULDBLOCK maps to EWOULDBLOCK */
-    /* WSAEINPROGRESS is EINPROGRESS */
-    /* WSAEALREADY is EALREADY */
-    /* WSAENOTSOCK is ENOTSOCK */
-    /* WSAEDESTADDRREQ is EDESTADDRREQ */
-    /* WSAEMSGSIZE is EMSGSIZE */
-    /* WSAEPROTOTYPE is EPROTOTYPE */
-    /* WSAENOPROTOOPT is ENOPROTOOPT */
-    /* WSAEPROTONOSUPPORT is EPROTONOSUPPORT */
-    /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */
-    /* WSAEOPNOTSUPP is EOPNOTSUPP */
-    /* WSAEPFNOSUPPORT is EPFNOSUPPORT */
-    /* WSAEAFNOSUPPORT is EAFNOSUPPORT */
-    /* WSAEADDRINUSE is EADDRINUSE */
-    /* WSAEADDRNOTAVAIL is EADDRNOTAVAIL */
-    /* WSAENETDOWN is ENETDOWN */
-    /* WSAENETUNREACH is ENETUNREACH */
-    /* WSAENETRESET is ENETRESET */
-    /* WSAECONNABORTED is ECONNABORTED */
-    /* WSAECONNRESET is ECONNRESET */
-    /* WSAENOBUFS is ENOBUFS */
-    /* WSAEISCONN is EISCONN */
-    /* WSAENOTCONN is ENOTCONN */
-    /* WSAESHUTDOWN is ESHUTDOWN */
-    /* WSAETOOMANYREFS is ETOOMANYREFS */
-    /* WSAETIMEDOUT is ETIMEDOUT */
-    /* WSAECONNREFUSED is ECONNREFUSED */
-    /* WSAELOOP is ELOOP */
-    /* WSAENAMETOOLONG maps to ENAMETOOLONG */
-    /* WSAEHOSTDOWN is EHOSTDOWN */
-    /* WSAEHOSTUNREACH is EHOSTUNREACH */
-    /* WSAENOTEMPTY maps to ENOTEMPTY */
-    /* WSAEPROCLIM is EPROCLIM */
-    /* WSAEUSERS is EUSERS */
-    /* WSAEDQUOT is EDQUOT */
-    /* WSAESTALE is ESTALE */
-    /* WSAEREMOTE is EREMOTE */
-    case WSASYSNOTREADY:
-      msg = "Network subsystem is unavailable";
-      break;
-    case WSAVERNOTSUPPORTED:
-      msg = "Winsock.dll version out of range";
-      break;
-    case WSANOTINITIALISED:
-      msg = "Successful WSAStartup not yet performed";
-      break;
-    case WSAEDISCON:
-      msg = "Graceful shutdown in progress";
-      break;
-    case WSAENOMORE: case WSA_E_NO_MORE:
-      msg = "No more results";
-      break;
-    case WSAECANCELLED: case WSA_E_CANCELLED:
-      msg = "Call was canceled";
-      break;
-    case WSAEINVALIDPROCTABLE:
-      msg = "Procedure call table is invalid";
-      break;
-    case WSAEINVALIDPROVIDER:
-      msg = "Service provider is invalid";
-      break;
-    case WSAEPROVIDERFAILEDINIT:
-      msg = "Service provider failed to initialize";
-      break;
-    case WSASYSCALLFAILURE:
-      msg = "System call failure";
-      break;
-    case WSASERVICE_NOT_FOUND:
-      msg = "Service not found";
-      break;
-    case WSATYPE_NOT_FOUND:
-      msg = "Class type not found";
-      break;
-    case WSAEREFUSED:
-      msg = "Database query was refused";
-      break;
-    case WSAHOST_NOT_FOUND:
-      msg = "Host not found";
-      break;
-    case WSATRY_AGAIN:
-      msg = "Nonauthoritative host not found";
-      break;
-    case WSANO_RECOVERY:
-      msg = "Nonrecoverable error";
-      break;
-    case WSANO_DATA:
-      msg = "Valid name, no data record of requested type";
-      break;
-    /* WSA_QOS_* omitted */
-#  endif
-# endif
-
-# if GNULIB_defined_ENOMSG
-    case ENOMSG:
-      msg = "No message of desired type";
-      break;
-# endif
-
-# if GNULIB_defined_EIDRM
-    case EIDRM:
-      msg = "Identifier removed";
-      break;
-# endif
-
-# if GNULIB_defined_ENOLINK
-    case ENOLINK:
-      msg = "Link has been severed";
-      break;
-# endif
-
-# if GNULIB_defined_EPROTO
-    case EPROTO:
-      msg = "Protocol error";
-      break;
-# endif
-
-# if GNULIB_defined_EMULTIHOP
-    case EMULTIHOP:
-      msg = "Multihop attempted";
-      break;
-# endif
-
-# if GNULIB_defined_EBADMSG
-    case EBADMSG:
-      msg = "Bad message";
-      break;
-# endif
-
-# if GNULIB_defined_EOVERFLOW
-    case EOVERFLOW:
-      msg = "Value too large for defined data type";
-      break;
-# endif
-
-# if GNULIB_defined_ENOTSUP
-    case ENOTSUP:
-      msg = "Not supported";
-      break;
-# endif
-
-# if GNULIB_defined_ESTALE
-    case ESTALE:
-      msg = "Stale NFS file handle";
-      break;
-# endif
-
-# if GNULIB_defined_ECANCELED
-    case ECANCELED:
-      msg = "Operation canceled";
-      break;
-# endif
-    }
+  static char buf[STACKBUF_LEN];
+  size_t len;
 
+  /* Cast away const, due to the historical signature of strerror;
+     callers should not be modifying the string.  */
+  const char *msg = strerror_override (n);
   if (msg)
     return (char *) msg;
 
-  {
-    char *result = strerror (n);
+  msg = strerror (n);
 
-    if (result == NULL || result[0] == '\0')
-      {
-        static char const fmt[] = "Unknown error (%d)";
-        static char msg_buf[sizeof fmt + INT_STRLEN_BOUND (n)];
-        sprintf (msg_buf, fmt, n);
-        return msg_buf;
-      }
+  /* Our strerror_r implementation might use the system's strerror
+     buffer, so all other clients of strerror have to see the error
+     copied into a buffer that we manage.  This is not thread-safe,
+     even if the system strerror is, but portable programs shouldn't
+     be using strerror if they care about thread-safety.  */
+  if (!msg || !*msg)
+    {
+      static char const fmt[] = "Unknown error %d";
+      verify (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n));
+      sprintf (buf, fmt, n);
+      errno = EINVAL;
+      return buf;
+    }
 
-    return result;
-  }
-}
+  /* Fix STACKBUF_LEN if this ever aborts.  */
+  len = strlen (msg);
+  if (sizeof buf <= len)
+    abort ();
 
-#endif
+  return memcpy (buf, msg, len + 1);
+}
diff --git a/lib/strerror_r.c b/lib/strerror_r.c
new file mode 100644 (file)
index 0000000..76f6fc6
--- /dev/null
@@ -0,0 +1,326 @@
+/* strerror_r.c --- POSIX compatible system error routine
+
+   Copyright (C) 2010-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
+
+#include <config.h>
+
+/* Enable declaration of sys_nerr and sys_errlist in <errno.h> on NetBSD.  */
+#define _NETBSD_SOURCE 1
+
+/* Specification.  */
+#include <string.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "strerror-override.h"
+
+#if (__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__) && HAVE___XPG_STRERROR_R /* glibc >= 2.3.4, cygwin >= 1.7.9 */
+
+# define USE_XPG_STRERROR_R 1
+extern int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
+
+#elif HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__)
+
+/* The system's strerror_r function is OK, except that its third argument
+   is 'int', not 'size_t', or its return type is wrong.  */
+
+# include <limits.h>
+
+# define USE_SYSTEM_STRERROR_R 1
+
+#else /* (__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__ ? !HAVE___XPG_STRERROR_R : !HAVE_DECL_STRERROR_R) */
+
+/* Use the system's strerror().  Exclude glibc and cygwin because the
+   system strerror_r has the wrong return type, and cygwin 1.7.9
+   strerror_r clobbers strerror.  */
+# undef strerror
+
+# define USE_SYSTEM_STRERROR 1
+
+# if defined __NetBSD__ || defined __hpux || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __sgi || (defined __sun && !defined _LP64) || defined __CYGWIN__
+
+/* No locking needed.  */
+
+/* Get catgets internationalization functions.  */
+#  if HAVE_CATGETS
+#   include <nl_types.h>
+#  endif
+
+/* Get sys_nerr, sys_errlist on HP-UX (otherwise only declared in C++ mode).
+   Get sys_nerr, sys_errlist on IRIX (otherwise only declared with _SGIAPI).  */
+#  if defined __hpux || defined __sgi
+extern int sys_nerr;
+extern char *sys_errlist[];
+#  endif
+
+/* Get sys_nerr on Solaris.  */
+#  if defined __sun && !defined _LP64
+extern int sys_nerr;
+#  endif
+
+# else
+
+#  include "glthread/lock.h"
+
+/* This lock protects the buffer returned by strerror().  We assume that
+   no other uses of strerror() exist in the program.  */
+gl_lock_define_initialized(static, strerror_lock)
+
+# endif
+
+#endif
+
+/* On MSVC, there is no snprintf() function, just a _snprintf().
+   It is of lower quality, but sufficient for the simple use here.
+   We only have to make sure to NUL terminate the result (_snprintf
+   does not NUL terminate, like strncpy).  */
+#if !HAVE_SNPRINTF
+static int
+local_snprintf (char *buf, size_t buflen, const char *format, ...)
+{
+  va_list args;
+  int result;
+
+  va_start (args, format);
+  result = _vsnprintf (buf, buflen, format, args);
+  va_end (args);
+  if (buflen > 0 && (result < 0 || result >= buflen))
+    buf[buflen - 1] = '\0';
+  return result;
+}
+# define snprintf local_snprintf
+#endif
+
+/* Copy as much of MSG into BUF as possible, without corrupting errno.
+   Return 0 if MSG fit in BUFLEN, otherwise return ERANGE.  */
+static int
+safe_copy (char *buf, size_t buflen, const char *msg)
+{
+  size_t len = strlen (msg);
+  int ret;
+
+  if (len < buflen)
+    {
+      /* Although POSIX allows memcpy() to corrupt errno, we don't
+         know of any implementation where this is a real problem.  */
+      memcpy (buf, msg, len + 1);
+      ret = 0;
+    }
+  else
+    {
+      memcpy (buf, msg, buflen - 1);
+      buf[buflen - 1] = '\0';
+      ret = ERANGE;
+    }
+  return ret;
+}
+
+
+int
+strerror_r (int errnum, char *buf, size_t buflen)
+#undef strerror_r
+{
+  /* Filter this out now, so that rest of this replacement knows that
+     there is room for a non-empty message and trailing NUL.  */
+  if (buflen <= 1)
+    {
+      if (buflen)
+        *buf = '\0';
+      return ERANGE;
+    }
+  *buf = '\0';
+
+  /* Check for gnulib overrides.  */
+  {
+    char const *msg = strerror_override (errnum);
+
+    if (msg)
+      return safe_copy (buf, buflen, msg);
+  }
+
+  {
+    int ret;
+    int saved_errno = errno;
+
+#if USE_XPG_STRERROR_R
+
+    {
+      ret = __xpg_strerror_r (errnum, buf, buflen);
+      if (ret < 0)
+        ret = errno;
+      if (!*buf)
+        {
+          /* glibc 2.13 would not touch buf on err, so we have to fall
+             back to GNU strerror_r which always returns a thread-safe
+             untruncated string to (partially) copy into our buf.  */
+          safe_copy (buf, buflen, strerror_r (errnum, buf, buflen));
+        }
+    }
+
+#elif USE_SYSTEM_STRERROR_R
+
+    if (buflen > INT_MAX)
+      buflen = INT_MAX;
+
+# ifdef __hpux
+    /* On HP-UX 11.31, strerror_r always fails when buflen < 80; it
+       also fails to change buf on EINVAL.  */
+    {
+      char stackbuf[80];
+
+      if (buflen < sizeof stackbuf)
+        {
+          ret = strerror_r (errnum, stackbuf, sizeof stackbuf);
+          if (ret == 0)
+            ret = safe_copy (buf, buflen, stackbuf);
+        }
+      else
+        ret = strerror_r (errnum, buf, buflen);
+    }
+# else
+    ret = strerror_r (errnum, buf, buflen);
+
+    /* Some old implementations may return (-1, EINVAL) instead of EINVAL.  */
+    if (ret < 0)
+      ret = errno;
+# endif
+
+# ifdef _AIX
+    /* AIX returns 0 rather than ERANGE when truncating strings; try
+       again until we are sure we got the entire string.  */
+    if (!ret && strlen (buf) == buflen - 1)
+      {
+        char stackbuf[STACKBUF_LEN];
+        size_t len;
+        strerror_r (errnum, stackbuf, sizeof stackbuf);
+        len = strlen (stackbuf);
+        /* STACKBUF_LEN should have been large enough.  */
+        if (len + 1 == sizeof stackbuf)
+          abort ();
+        if (buflen <= len)
+          ret = ERANGE;
+      }
+# else
+    /* Solaris 10 does not populate buf on ERANGE.  OpenBSD 4.7
+       truncates early on ERANGE rather than return a partial integer.
+       We prefer the maximal string.  We set buf[0] earlier, and we
+       know of no implementation that modifies buf to be an
+       unterminated string, so this strlen should be portable in
+       practice (rather than pulling in a safer strnlen).  */
+    if (ret == ERANGE && strlen (buf) < buflen - 1)
+      {
+        char stackbuf[STACKBUF_LEN];
+
+        /* STACKBUF_LEN should have been large enough.  */
+        if (strerror_r (errnum, stackbuf, sizeof stackbuf) == ERANGE)
+          abort ();
+        safe_copy (buf, buflen, stackbuf);
+      }
+# endif
+
+#else /* USE_SYSTEM_STRERROR */
+
+    /* Try to do what strerror (errnum) does, but without clobbering the
+       buffer used by strerror().  */
+
+# if defined __NetBSD__ || defined __hpux || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __CYGWIN__ /* NetBSD, HP-UX, native Windows, Cygwin */
+
+    /* NetBSD:         sys_nerr, sys_errlist are declared through _NETBSD_SOURCE
+                       and <errno.h> above.
+       HP-UX:          sys_nerr, sys_errlist are declared explicitly above.
+       native Windows: sys_nerr, sys_errlist are declared in <stdlib.h>.
+       Cygwin:         sys_nerr, sys_errlist are declared in <errno.h>.  */
+    if (errnum >= 0 && errnum < sys_nerr)
+      {
+#  if HAVE_CATGETS && (defined __NetBSD__ || defined __hpux)
+#   if defined __NetBSD__
+        nl_catd catd = catopen ("libc", NL_CAT_LOCALE);
+        const char *errmsg =
+          (catd != (nl_catd)-1
+           ? catgets (catd, 1, errnum, sys_errlist[errnum])
+           : sys_errlist[errnum]);
+#   endif
+#   if defined __hpux
+        nl_catd catd = catopen ("perror", NL_CAT_LOCALE);
+        const char *errmsg =
+          (catd != (nl_catd)-1
+           ? catgets (catd, 1, 1 + errnum, sys_errlist[errnum])
+           : sys_errlist[errnum]);
+#   endif
+#  else
+        const char *errmsg = sys_errlist[errnum];
+#  endif
+        if (errmsg == NULL || *errmsg == '\0')
+          ret = EINVAL;
+        else
+          ret = safe_copy (buf, buflen, errmsg);
+#  if HAVE_CATGETS && (defined __NetBSD__ || defined __hpux)
+        if (catd != (nl_catd)-1)
+          catclose (catd);
+#  endif
+      }
+    else
+      ret = EINVAL;
+
+# elif defined __sgi || (defined __sun && !defined _LP64) /* IRIX, Solaris <= 9 32-bit */
+
+    /* For a valid error number, the system's strerror() function returns
+       a pointer to a not copied string, not to a buffer.  */
+    if (errnum >= 0 && errnum < sys_nerr)
+      {
+        char *errmsg = strerror (errnum);
+
+        if (errmsg == NULL || *errmsg == '\0')
+          ret = EINVAL;
+        else
+          ret = safe_copy (buf, buflen, errmsg);
+      }
+    else
+      ret = EINVAL;
+
+# else
+
+    gl_lock_lock (strerror_lock);
+
+    {
+      char *errmsg = strerror (errnum);
+
+      /* For invalid error numbers, strerror() on
+           - IRIX 6.5 returns NULL,
+           - HP-UX 11 returns an empty string.  */
+      if (errmsg == NULL || *errmsg == '\0')
+        ret = EINVAL;
+      else
+        ret = safe_copy (buf, buflen, errmsg);
+    }
+
+    gl_lock_unlock (strerror_lock);
+
+# endif
+
+#endif
+
+    if (ret == EINVAL && !*buf)
+      snprintf (buf, buflen, "Unknown error %d", errnum);
+
+    errno = saved_errno;
+    return ret;
+  }
+}
index 4893ea268f26f58cd8ddd9739fb9fd9096cda50b..f8d7520eaaae2e25b937cf92c7ee27e20f4c47c3 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2010 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 2001-2012 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
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_STRING_H
+#ifndef _@GUARD_PREFIX@_STRING_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_STRING_H@
 
-#ifndef _GL_STRING_H
-#define _GL_STRING_H
+#ifndef _@GUARD_PREFIX@_STRING_H
+#define _@GUARD_PREFIX@_STRING_H
 
 /* NetBSD 5.0 mis-defines NULL.  */
 #include <stddef.h>
 # include <wchar.h>
 #endif
 
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-#  define __attribute__(Spec) /* empty */
-# endif
-/* The attribute __pure__ was added in gcc 2.96.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
-#  define __pure__ /* empty */
-# endif
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+   The attribute __pure__ was added in gcc 2.96.  */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
 #endif
 
+/* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) && defined __NetBSD__ \
+    && ! defined __GLIBC__
+# include <unistd.h>
+#endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
+/* Find the index of the least-significant set bit.  */
+#if @GNULIB_FFSL@
+# if !@HAVE_FFSL@
+_GL_FUNCDECL_SYS (ffsl, int, (long int i));
+# endif
+_GL_CXXALIAS_SYS (ffsl, int, (long int i));
+_GL_CXXALIASWARN (ffsl);
+#elif defined GNULIB_POSIXCHECK
+# undef ffsl
+# if HAVE_RAW_DECL_FFSL
+_GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
+# endif
+#endif
+
 
-#ifdef __cplusplus
-extern "C" {
+/* Find the index of the least-significant set bit.  */
+#if @GNULIB_FFSLL@
+# if !@HAVE_FFSLL@
+_GL_FUNCDECL_SYS (ffsll, int, (long long int i));
+# endif
+_GL_CXXALIAS_SYS (ffsll, int, (long long int i));
+_GL_CXXALIASWARN (ffsll);
+#elif defined GNULIB_POSIXCHECK
+# undef ffsll
+# if HAVE_RAW_DECL_FFSLL
+_GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module");
+# endif
 #endif
 
 
 /* Return the first instance of C within N bytes of S, or NULL.  */
 #if @GNULIB_MEMCHR@
 # if @REPLACE_MEMCHR@
-#  define memchr rpl_memchr
-extern void *memchr (void const *__s, int __c, size_t __n)
-     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define memchr rpl_memchr
+#  endif
+_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
+# else
+#  if ! @HAVE_MEMCHR@
+_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1)));
+#  endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C" { const void * std::memchr (const void *, int, size_t); }
+       extern "C++" { void * std::memchr (void *, int, size_t); }  */
+_GL_CXXALIAS_SYS_CAST2 (memchr,
+                        void *, (void const *__s, int __c, size_t __n),
+                        void const *, (void const *__s, int __c, size_t __n));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
+_GL_CXXALIASWARN1 (memchr, void const *,
+                   (void const *__s, int __c, size_t __n));
+# else
+_GL_CXXALIASWARN (memchr);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memchr
-# define memchr(s,c,n) \
-    (GL_LINK_WARNING ("memchr has platform-specific bugs - " \
-                      "use gnulib module memchr for portability" ), \
-     memchr (s, c, n))
+/* Assume memchr is always declared.  */
+_GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
+                 "use gnulib module memchr for portability" );
 #endif
 
 /* Return the first occurrence of NEEDLE in HAYSTACK.  */
 #if @GNULIB_MEMMEM@
 # if @REPLACE_MEMMEM@
-#  define memmem rpl_memmem
-# endif
-# if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@
-extern void *memmem (void const *__haystack, size_t __haystack_len,
-                     void const *__needle, size_t __needle_len)
-     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define memmem rpl_memmem
+#  endif
+_GL_FUNCDECL_RPL (memmem, void *,
+                  (void const *__haystack, size_t __haystack_len,
+                   void const *__needle, size_t __needle_len)
+                  _GL_ATTRIBUTE_PURE
+                  _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (memmem, void *,
+                  (void const *__haystack, size_t __haystack_len,
+                   void const *__needle, size_t __needle_len));
+# else
+#  if ! @HAVE_DECL_MEMMEM@
+_GL_FUNCDECL_SYS (memmem, void *,
+                  (void const *__haystack, size_t __haystack_len,
+                   void const *__needle, size_t __needle_len)
+                  _GL_ATTRIBUTE_PURE
+                  _GL_ARG_NONNULL ((1, 3)));
+#  endif
+_GL_CXXALIAS_SYS (memmem, void *,
+                  (void const *__haystack, size_t __haystack_len,
+                   void const *__needle, size_t __needle_len));
 # endif
+_GL_CXXALIASWARN (memmem);
 #elif defined GNULIB_POSIXCHECK
 # undef memmem
-# define memmem(a,al,b,bl) \
-    (GL_LINK_WARNING ("memmem is unportable and often quadratic - " \
-                      "use gnulib module memmem-simple for portability, " \
-                      "and module memmem for speed" ), \
-     memmem (a, al, b, bl))
+# if HAVE_RAW_DECL_MEMMEM
+_GL_WARN_ON_USE (memmem, "memmem is unportable and often quadratic - "
+                 "use gnulib module memmem-simple for portability, "
+                 "and module memmem for speed" );
+# endif
 #endif
 
 /* Copy N bytes of SRC to DEST, return pointer to bytes after the
    last written byte.  */
 #if @GNULIB_MEMPCPY@
 # if ! @HAVE_MEMPCPY@
-extern void *mempcpy (void *restrict __dest, void const *restrict __src,
-                      size_t __n)
-     _GL_ARG_NONNULL ((1, 2));
+_GL_FUNCDECL_SYS (mempcpy, void *,
+                  (void *restrict __dest, void const *restrict __src,
+                   size_t __n)
+                  _GL_ARG_NONNULL ((1, 2)));
 # endif
+_GL_CXXALIAS_SYS (mempcpy, void *,
+                  (void *restrict __dest, void const *restrict __src,
+                   size_t __n));
+_GL_CXXALIASWARN (mempcpy);
 #elif defined GNULIB_POSIXCHECK
 # undef mempcpy
-# define mempcpy(a,b,n) \
-    (GL_LINK_WARNING ("mempcpy is unportable - " \
-                      "use gnulib module mempcpy for portability"), \
-     mempcpy (a, b, n))
+# if HAVE_RAW_DECL_MEMPCPY
+_GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
+                 "use gnulib module mempcpy for portability");
+# endif
 #endif
 
 /* Search backwards through a block for a byte (specified as an int).  */
 #if @GNULIB_MEMRCHR@
 # if ! @HAVE_DECL_MEMRCHR@
-extern void *memrchr (void const *, int, size_t)
-     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
+_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1)));
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" { const void * std::memrchr (const void *, int, size_t); }
+       extern "C++" { void * std::memrchr (void *, int, size_t); }  */
+_GL_CXXALIAS_SYS_CAST2 (memrchr,
+                        void *, (void const *, int, size_t),
+                        void const *, (void const *, int, size_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t));
+_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t));
+# else
+_GL_CXXALIASWARN (memrchr);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memrchr
-# define memrchr(a,b,c) \
-    (GL_LINK_WARNING ("memrchr is unportable - " \
-                      "use gnulib module memrchr for portability"), \
-     memrchr (a, b, c))
+# if HAVE_RAW_DECL_MEMRCHR
+_GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
+                 "use gnulib module memrchr for portability");
+# endif
 #endif
 
 /* Find the first occurrence of C in S.  More efficient than
@@ -129,121 +216,237 @@ extern void *memrchr (void const *, int, size_t)
    occur within N bytes.  */
 #if @GNULIB_RAWMEMCHR@
 # if ! @HAVE_RAWMEMCHR@
-extern void *rawmemchr (void const *__s, int __c_in)
-     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
+_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
+                                     _GL_ATTRIBUTE_PURE
+                                     _GL_ARG_NONNULL ((1)));
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" { const void * std::rawmemchr (const void *, int); }
+       extern "C++" { void * std::rawmemchr (void *, int); }  */
+_GL_CXXALIAS_SYS_CAST2 (rawmemchr,
+                        void *, (void const *__s, int __c_in),
+                        void const *, (void const *__s, int __c_in));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in));
+_GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in));
+# else
+_GL_CXXALIASWARN (rawmemchr);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef rawmemchr
-# define rawmemchr(a,b) \
-    (GL_LINK_WARNING ("rawmemchr is unportable - " \
-                      "use gnulib module rawmemchr for portability"), \
-     rawmemchr (a, b))
+# if HAVE_RAW_DECL_RAWMEMCHR
+_GL_WARN_ON_USE (rawmemchr, "rawmemchr is unportable - "
+                 "use gnulib module rawmemchr for portability");
+# endif
 #endif
 
 /* Copy SRC to DST, returning the address of the terminating '\0' in DST.  */
 #if @GNULIB_STPCPY@
 # if ! @HAVE_STPCPY@
-extern char *stpcpy (char *restrict __dst, char const *restrict __src)
-     _GL_ARG_NONNULL ((1, 2));
+_GL_FUNCDECL_SYS (stpcpy, char *,
+                  (char *restrict __dst, char const *restrict __src)
+                  _GL_ARG_NONNULL ((1, 2)));
 # endif
+_GL_CXXALIAS_SYS (stpcpy, char *,
+                  (char *restrict __dst, char const *restrict __src));
+_GL_CXXALIASWARN (stpcpy);
 #elif defined GNULIB_POSIXCHECK
 # undef stpcpy
-# define stpcpy(a,b) \
-    (GL_LINK_WARNING ("stpcpy is unportable - " \
-                      "use gnulib module stpcpy for portability"), \
-     stpcpy (a, b))
+# if HAVE_RAW_DECL_STPCPY
+_GL_WARN_ON_USE (stpcpy, "stpcpy is unportable - "
+                 "use gnulib module stpcpy for portability");
+# endif
 #endif
 
 /* Copy no more than N bytes of SRC to DST, returning a pointer past the
    last non-NUL byte written into DST.  */
 #if @GNULIB_STPNCPY@
-# if ! @HAVE_STPNCPY@
-#  define stpncpy gnu_stpncpy
-extern char *stpncpy (char *restrict __dst, char const *restrict __src,
-                      size_t __n)
-     _GL_ARG_NONNULL ((1, 2));
+# if @REPLACE_STPNCPY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef stpncpy
+#   define stpncpy rpl_stpncpy
+#  endif
+_GL_FUNCDECL_RPL (stpncpy, char *,
+                  (char *restrict __dst, char const *restrict __src,
+                   size_t __n)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (stpncpy, char *,
+                  (char *restrict __dst, char const *restrict __src,
+                   size_t __n));
+# else
+#  if ! @HAVE_STPNCPY@
+_GL_FUNCDECL_SYS (stpncpy, char *,
+                  (char *restrict __dst, char const *restrict __src,
+                   size_t __n)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (stpncpy, char *,
+                  (char *restrict __dst, char const *restrict __src,
+                   size_t __n));
 # endif
+_GL_CXXALIASWARN (stpncpy);
 #elif defined GNULIB_POSIXCHECK
 # undef stpncpy
-# define stpncpy(a,b,n) \
-    (GL_LINK_WARNING ("stpncpy is unportable - " \
-                      "use gnulib module stpncpy for portability"), \
-     stpncpy (a, b, n))
+# if HAVE_RAW_DECL_STPNCPY
+_GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
+                 "use gnulib module stpncpy for portability");
+# endif
 #endif
 
 #if defined GNULIB_POSIXCHECK
 /* strchr() does not work with multibyte strings if the locale encoding is
    GB18030 and the character to be searched is a digit.  */
 # undef strchr
-# define strchr(s,c) \
-    (GL_LINK_WARNING ("strchr cannot work correctly on character strings " \
-                      "in some multibyte locales - " \
-                      "use mbschr if you care about internationalization"), \
-     strchr (s, c))
+/* Assume strchr is always declared.  */
+_GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
+                 "in some multibyte locales - "
+                 "use mbschr if you care about internationalization");
 #endif
 
 /* Find the first occurrence of C in S or the final NUL byte.  */
 #if @GNULIB_STRCHRNUL@
-# if ! @HAVE_STRCHRNUL@
-extern char *strchrnul (char const *__s, int __c_in)
-     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
+# if @REPLACE_STRCHRNUL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strchrnul rpl_strchrnul
+#  endif
+_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in)
+                                     _GL_ATTRIBUTE_PURE
+                                     _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strchrnul, char *,
+                  (const char *str, int ch));
+# else
+#  if ! @HAVE_STRCHRNUL@
+_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
+                                     _GL_ATTRIBUTE_PURE
+                                     _GL_ARG_NONNULL ((1)));
+#  endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" { const char * std::strchrnul (const char *, int); }
+       extern "C++" { char * std::strchrnul (char *, int); }  */
+_GL_CXXALIAS_SYS_CAST2 (strchrnul,
+                        char *, (char const *__s, int __c_in),
+                        char const *, (char const *__s, int __c_in));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
+_GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in));
+# else
+_GL_CXXALIASWARN (strchrnul);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strchrnul
-# define strchrnul(a,b) \
-    (GL_LINK_WARNING ("strchrnul is unportable - " \
-                      "use gnulib module strchrnul for portability"), \
-     strchrnul (a, b))
+# if HAVE_RAW_DECL_STRCHRNUL
+_GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
+                 "use gnulib module strchrnul for portability");
+# endif
 #endif
 
 /* Duplicate S, returning an identical malloc'd string.  */
 #if @GNULIB_STRDUP@
 # if @REPLACE_STRDUP@
-#  undef strdup
-#  define strdup rpl_strdup
-# endif
-# if !(@HAVE_DECL_STRDUP@ || defined strdup) || @REPLACE_STRDUP@
-extern char *strdup (char const *__s) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strdup
+#   define strdup rpl_strdup
+#  endif
+_GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
+# else
+#  if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
+    /* strdup exists as a function and as a macro.  Get rid of the macro.  */
+#   undef strdup
+#  endif
+#  if !(@HAVE_DECL_STRDUP@ || defined strdup)
+_GL_FUNCDECL_SYS (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
 # endif
+_GL_CXXALIASWARN (strdup);
 #elif defined GNULIB_POSIXCHECK
 # undef strdup
-# define strdup(a) \
-    (GL_LINK_WARNING ("strdup is unportable - " \
-                      "use gnulib module strdup for portability"), \
-     strdup (a))
+# if HAVE_RAW_DECL_STRDUP
+_GL_WARN_ON_USE (strdup, "strdup is unportable - "
+                 "use gnulib module strdup for portability");
+# endif
+#endif
+
+/* Append no more than N characters from SRC onto DEST.  */
+#if @GNULIB_STRNCAT@
+# if @REPLACE_STRNCAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strncat
+#   define strncat rpl_strncat
+#  endif
+_GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n)
+                                   _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n));
+# else
+_GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n));
+# endif
+_GL_CXXALIASWARN (strncat);
+#elif defined GNULIB_POSIXCHECK
+# undef strncat
+# if HAVE_RAW_DECL_STRNCAT
+_GL_WARN_ON_USE (strncat, "strncat is unportable - "
+                 "use gnulib module strncat for portability");
+# endif
 #endif
 
 /* Return a newly allocated copy of at most N bytes of STRING.  */
 #if @GNULIB_STRNDUP@
 # if @REPLACE_STRNDUP@
-#  undef strndup
-#  define strndup rpl_strndup
-# endif
-# if @REPLACE_STRNDUP@ || ! @HAVE_DECL_STRNDUP@
-extern char *strndup (char const *__string, size_t __n) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strndup
+#   define strndup rpl_strndup
+#  endif
+_GL_FUNCDECL_RPL (strndup, char *, (char const *__string, size_t __n)
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n));
+# else
+#  if ! @HAVE_DECL_STRNDUP@
+_GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n)
+                                   _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strndup, char *, (char const *__string, size_t __n));
 # endif
+_GL_CXXALIASWARN (strndup);
 #elif defined GNULIB_POSIXCHECK
 # undef strndup
-# define strndup(a,n) \
-    (GL_LINK_WARNING ("strndup is unportable - " \
-                      "use gnulib module strndup for portability"), \
-     strndup (a, n))
+# if HAVE_RAW_DECL_STRNDUP
+_GL_WARN_ON_USE (strndup, "strndup is unportable - "
+                 "use gnulib module strndup for portability");
+# endif
 #endif
 
 /* Find the length (number of bytes) of STRING, but scan at most
    MAXLEN bytes.  If no '\0' terminator is found in that many bytes,
    return MAXLEN.  */
 #if @GNULIB_STRNLEN@
-# if ! @HAVE_DECL_STRNLEN@
-extern size_t strnlen (char const *__string, size_t __maxlen)
-     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1));
+# if @REPLACE_STRNLEN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strnlen
+#   define strnlen rpl_strnlen
+#  endif
+_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
+# else
+#  if ! @HAVE_DECL_STRNLEN@
+_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen));
 # endif
+_GL_CXXALIASWARN (strnlen);
 #elif defined GNULIB_POSIXCHECK
 # undef strnlen
-# define strnlen(a,n) \
-    (GL_LINK_WARNING ("strnlen is unportable - " \
-                      "use gnulib module strnlen for portability"), \
-     strnlen (a, n))
+# if HAVE_RAW_DECL_STRNLEN
+_GL_WARN_ON_USE (strnlen, "strnlen is unportable - "
+                 "use gnulib module strnlen for portability");
+# endif
 #endif
 
 #if defined GNULIB_POSIXCHECK
@@ -252,18 +455,32 @@ extern size_t strnlen (char const *__string, size_t __maxlen)
    locale encoding is GB18030 and one of the characters to be searched is a
    digit.  */
 # undef strcspn
-# define strcspn(s,a) \
-    (GL_LINK_WARNING ("strcspn cannot work correctly on character strings " \
-                      "in multibyte locales - " \
-                      "use mbscspn if you care about internationalization"), \
-     strcspn (s, a))
+/* Assume strcspn is always declared.  */
+_GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbscspn if you care about internationalization");
 #endif
 
 /* Find the first occurrence in S of any character in ACCEPT.  */
 #if @GNULIB_STRPBRK@
 # if ! @HAVE_STRPBRK@
-extern char *strpbrk (char const *__s, char const *__accept)
-     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
+_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1, 2)));
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C" { const char * strpbrk (const char *, const char *); }
+       extern "C++" { char * strpbrk (char *, const char *); }  */
+_GL_CXXALIAS_SYS_CAST2 (strpbrk,
+                        char *, (char const *__s, char const *__accept),
+                        const char *, (char const *__s, char const *__accept));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
+_GL_CXXALIASWARN1 (strpbrk, char const *,
+                   (char const *__s, char const *__accept));
+# else
+_GL_CXXALIASWARN (strpbrk);
 # endif
 # if defined GNULIB_POSIXCHECK
 /* strpbrk() assumes the second argument is a list of single-byte characters.
@@ -271,40 +488,36 @@ extern char *strpbrk (char const *__s, char const *__accept)
    locale encoding is GB18030 and one of the characters to be searched is a
    digit.  */
 #  undef strpbrk
-#  define strpbrk(s,a) \
-     (GL_LINK_WARNING ("strpbrk cannot work correctly on character strings " \
-                       "in multibyte locales - " \
-                       "use mbspbrk if you care about internationalization"), \
-      strpbrk (s, a))
+_GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbspbrk if you care about internationalization");
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strpbrk
-# define strpbrk(s,a) \
-    (GL_LINK_WARNING ("strpbrk is unportable - " \
-                      "use gnulib module strpbrk for portability"), \
-     strpbrk (s, a))
+# if HAVE_RAW_DECL_STRPBRK
+_GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - "
+                 "use gnulib module strpbrk for portability");
+# endif
 #endif
 
 #if defined GNULIB_POSIXCHECK
 /* strspn() assumes the second argument is a list of single-byte characters.
    Even in this simple case, it cannot work with multibyte strings.  */
 # undef strspn
-# define strspn(s,a) \
-    (GL_LINK_WARNING ("strspn cannot work correctly on character strings " \
-                      "in multibyte locales - " \
-                      "use mbsspn if you care about internationalization"), \
-     strspn (s, a))
+/* Assume strspn is always declared.  */
+_GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbsspn if you care about internationalization");
 #endif
 
 #if defined GNULIB_POSIXCHECK
 /* strrchr() does not work with multibyte strings if the locale encoding is
    GB18030 and the character to be searched is a digit.  */
 # undef strrchr
-# define strrchr(s,c) \
-    (GL_LINK_WARNING ("strrchr cannot work correctly on character strings " \
-                      "in some multibyte locales - " \
-                      "use mbsrchr if you care about internationalization"), \
-     strrchr (s, c))
+/* Assume strrchr is always declared.  */
+_GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings "
+                 "in some multibyte locales - "
+                 "use mbsrchr if you care about internationalization");
 #endif
 
 /* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
@@ -325,30 +538,51 @@ extern char *strpbrk (char const *__s, char const *__accept)
    See also strtok_r().  */
 #if @GNULIB_STRSEP@
 # if ! @HAVE_STRSEP@
-extern char *strsep (char **restrict __stringp, char const *restrict __delim)
-     _GL_ARG_NONNULL ((1, 2));
+_GL_FUNCDECL_SYS (strsep, char *,
+                  (char **restrict __stringp, char const *restrict __delim)
+                  _GL_ARG_NONNULL ((1, 2)));
 # endif
+_GL_CXXALIAS_SYS (strsep, char *,
+                  (char **restrict __stringp, char const *restrict __delim));
+_GL_CXXALIASWARN (strsep);
 # if defined GNULIB_POSIXCHECK
 #  undef strsep
-#  define strsep(s,d) \
-     (GL_LINK_WARNING ("strsep cannot work correctly on character strings " \
-                       "in multibyte locales - " \
-                       "use mbssep if you care about internationalization"), \
-      strsep (s, d))
+_GL_WARN_ON_USE (strsep, "strsep cannot work correctly on character strings "
+                 "in multibyte locales - "
+                 "use mbssep if you care about internationalization");
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strsep
-# define strsep(s,d) \
-    (GL_LINK_WARNING ("strsep is unportable - " \
-                      "use gnulib module strsep for portability"), \
-     strsep (s, d))
+# if HAVE_RAW_DECL_STRSEP
+_GL_WARN_ON_USE (strsep, "strsep is unportable - "
+                 "use gnulib module strsep for portability");
+# endif
 #endif
 
 #if @GNULIB_STRSTR@
 # if @REPLACE_STRSTR@
-#  define strstr rpl_strstr
-extern char *strstr (const char *haystack, const char *needle)
-     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strstr rpl_strstr
+#  endif
+_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
+# else
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" { const char * strstr (const char *, const char *); }
+       extern "C++" { char * strstr (char *, const char *); }  */
+_GL_CXXALIAS_SYS_CAST2 (strstr,
+                        char *, (const char *haystack, const char *needle),
+                        const char *, (const char *haystack, const char *needle));
+# endif
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
+_GL_CXXALIASWARN1 (strstr, const char *,
+                   (const char *haystack, const char *needle));
+# else
+_GL_CXXALIASWARN (strstr);
 # endif
 #elif defined GNULIB_POSIXCHECK
 /* strstr() does not work with multibyte strings if the locale encoding is
@@ -356,37 +590,61 @@ extern char *strstr (const char *haystack, const char *needle)
    POSIX says that it operates on "strings", and "string" in POSIX is defined
    as a sequence of bytes, not of characters.  */
 # undef strstr
-# define strstr(a,b) \
-    (GL_LINK_WARNING ("strstr is quadratic on many systems, and cannot " \
-                      "work correctly on character strings in most "    \
-                      "multibyte locales - " \
-                      "use mbsstr if you care about internationalization, " \
-                      "or use strstr if you care about speed"), \
-     strstr (a, b))
+/* Assume strstr is always declared.  */
+_GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
+                 "work correctly on character strings in most "
+                 "multibyte locales - "
+                 "use mbsstr if you care about internationalization, "
+                 "or use strstr if you care about speed");
 #endif
 
 /* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
    comparison.  */
 #if @GNULIB_STRCASESTR@
 # if @REPLACE_STRCASESTR@
-#  define strcasestr rpl_strcasestr
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strcasestr rpl_strcasestr
+#  endif
+_GL_FUNCDECL_RPL (strcasestr, char *,
+                  (const char *haystack, const char *needle)
+                  _GL_ATTRIBUTE_PURE
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strcasestr, char *,
+                  (const char *haystack, const char *needle));
+# else
+#  if ! @HAVE_STRCASESTR@
+_GL_FUNCDECL_SYS (strcasestr, char *,
+                  (const char *haystack, const char *needle)
+                  _GL_ATTRIBUTE_PURE
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" { const char * strcasestr (const char *, const char *); }
+       extern "C++" { char * strcasestr (char *, const char *); }  */
+_GL_CXXALIAS_SYS_CAST2 (strcasestr,
+                        char *, (const char *haystack, const char *needle),
+                        const char *, (const char *haystack, const char *needle));
 # endif
-# if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@
-extern char *strcasestr (const char *haystack, const char *needle)
-     __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle));
+_GL_CXXALIASWARN1 (strcasestr, const char *,
+                   (const char *haystack, const char *needle));
+# else
+_GL_CXXALIASWARN (strcasestr);
 # endif
 #elif defined GNULIB_POSIXCHECK
 /* strcasestr() does not work with multibyte strings:
    It is a glibc extension, and glibc implements it only for unibyte
    locales.  */
 # undef strcasestr
-# define strcasestr(a,b) \
-    (GL_LINK_WARNING ("strcasestr does work correctly on character strings " \
-                      "in multibyte locales - " \
-                      "use mbscasestr if you care about " \
-                      "internationalization, or use c-strcasestr if you want " \
-                      "a locale independent function"), \
-     strcasestr (a, b))
+# if HAVE_RAW_DECL_STRCASESTR
+_GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
+                 "strings in multibyte locales - "
+                 "use mbscasestr if you care about "
+                 "internationalization, or use c-strcasestr if you want "
+                 "a locale independent function");
+# endif
 #endif
 
 /* Parse S into tokens separated by characters in DELIM.
@@ -413,30 +671,43 @@ extern char *strcasestr (const char *haystack, const char *needle)
    See also strsep().  */
 #if @GNULIB_STRTOK_R@
 # if @REPLACE_STRTOK_R@
-#  undef strtok_r
-#  define strtok_r rpl_strtok_r
-# elif @UNDEFINE_STRTOK_R@
-#  undef strtok_r
-# endif
-# if ! @HAVE_DECL_STRTOK_R@ || @REPLACE_STRTOK_R@
-extern char *strtok_r (char *restrict s, char const *restrict delim,
-                       char **restrict save_ptr)
-     _GL_ARG_NONNULL ((2, 3));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strtok_r
+#   define strtok_r rpl_strtok_r
+#  endif
+_GL_FUNCDECL_RPL (strtok_r, char *,
+                  (char *restrict s, char const *restrict delim,
+                   char **restrict save_ptr)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (strtok_r, char *,
+                  (char *restrict s, char const *restrict delim,
+                   char **restrict save_ptr));
+# else
+#  if @UNDEFINE_STRTOK_R@ || defined GNULIB_POSIXCHECK
+#   undef strtok_r
+#  endif
+#  if ! @HAVE_DECL_STRTOK_R@
+_GL_FUNCDECL_SYS (strtok_r, char *,
+                  (char *restrict s, char const *restrict delim,
+                   char **restrict save_ptr)
+                  _GL_ARG_NONNULL ((2, 3)));
+#  endif
+_GL_CXXALIAS_SYS (strtok_r, char *,
+                  (char *restrict s, char const *restrict delim,
+                   char **restrict save_ptr));
 # endif
+_GL_CXXALIASWARN (strtok_r);
 # if defined GNULIB_POSIXCHECK
-#  undef strtok_r
-#  define strtok_r(s,d,p) \
-     (GL_LINK_WARNING ("strtok_r cannot work correctly on character strings " \
-                       "in multibyte locales - " \
-                       "use mbstok_r if you care about internationalization"), \
-      strtok_r (s, d, p))
+_GL_WARN_ON_USE (strtok_r, "strtok_r cannot work correctly on character "
+                 "strings in multibyte locales - "
+                 "use mbstok_r if you care about internationalization");
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strtok_r
-# define strtok_r(s,d,p) \
-    (GL_LINK_WARNING ("strtok_r is unportable - " \
-                      "use gnulib module strtok_r for portability"), \
-     strtok_r (s, d, p))
+# if HAVE_RAW_DECL_STRTOK_R
+_GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
+                 "use gnulib module strtok_r for portability");
+# endif
 #endif
 
 
@@ -450,15 +721,28 @@ extern char *strtok_r (char *restrict s, char const *restrict delim,
 #  undef mbslen
 # endif
 # if @HAVE_MBSLEN@  /* AIX, OSF/1, MirBSD define mbslen already in libc.  */
-#  define mbslen rpl_mbslen
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mbslen rpl_mbslen
+#  endif
+_GL_FUNCDECL_RPL (mbslen, size_t, (const char *string)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbslen, size_t, (const char *string));
+# else
+_GL_FUNCDECL_SYS (mbslen, size_t, (const char *string)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbslen, size_t, (const char *string));
 # endif
-extern size_t mbslen (const char *string) _GL_ARG_NONNULL ((1));
+_GL_CXXALIASWARN (mbslen);
 #endif
 
 #if @GNULIB_MBSNLEN@
 /* Return the number of multibyte characters in the character string starting
    at STRING and ending at STRING + LEN.  */
-extern size_t mbsnlen (const char *string, size_t len) _GL_ARG_NONNULL ((1));
+_GL_EXTERN_C size_t mbsnlen (const char *string, size_t len)
+     _GL_ATTRIBUTE_PURE
+     _GL_ARG_NONNULL ((1));
 #endif
 
 #if @GNULIB_MBSCHR@
@@ -466,8 +750,21 @@ extern size_t mbsnlen (const char *string, size_t len) _GL_ARG_NONNULL ((1));
    and return a pointer to it.  Return NULL if C is not found in STRING.
    Unlike strchr(), this function works correctly in multibyte locales with
    encodings such as GB18030.  */
-# define mbschr rpl_mbschr /* avoid collision with HP-UX function */
-extern char * mbschr (const char *string, int c) _GL_ARG_NONNULL ((1));
+# if defined __hpux
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mbschr rpl_mbschr /* avoid collision with HP-UX function */
+#  endif
+_GL_FUNCDECL_RPL (mbschr, char *, (const char *string, int c)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbschr, char *, (const char *string, int c));
+# else
+_GL_FUNCDECL_SYS (mbschr, char *, (const char *string, int c)
+                                  _GL_ATTRIBUTE_PURE
+                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbschr, char *, (const char *string, int c));
+# endif
+_GL_CXXALIASWARN (mbschr);
 #endif
 
 #if @GNULIB_MBSRCHR@
@@ -475,8 +772,21 @@ extern char * mbschr (const char *string, int c) _GL_ARG_NONNULL ((1));
    and return a pointer to it.  Return NULL if C is not found in STRING.
    Unlike strrchr(), this function works correctly in multibyte locales with
    encodings such as GB18030.  */
-# define mbsrchr rpl_mbsrchr /* avoid collision with HP-UX function */
-extern char * mbsrchr (const char *string, int c) _GL_ARG_NONNULL ((1));
+# if defined __hpux || defined __INTERIX
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mbsrchr rpl_mbsrchr /* avoid collision with system function */
+#  endif
+_GL_FUNCDECL_RPL (mbsrchr, char *, (const char *string, int c)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mbsrchr, char *, (const char *string, int c));
+# else
+_GL_FUNCDECL_SYS (mbsrchr, char *, (const char *string, int c)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (mbsrchr, char *, (const char *string, int c));
+# endif
+_GL_CXXALIASWARN (mbsrchr);
 #endif
 
 #if @GNULIB_MBSSTR@
@@ -484,7 +794,8 @@ extern char * mbsrchr (const char *string, int c) _GL_ARG_NONNULL ((1));
    string HAYSTACK.  Return NULL if NEEDLE is not found in HAYSTACK.
    Unlike strstr(), this function works correctly in multibyte locales with
    encodings different from UTF-8.  */
-extern char * mbsstr (const char *haystack, const char *needle)
+_GL_EXTERN_C char * mbsstr (const char *haystack, const char *needle)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -495,7 +806,8 @@ extern char * mbsstr (const char *haystack, const char *needle)
    Note: This function may, in multibyte locales, return 0 for strings of
    different lengths!
    Unlike strcasecmp(), this function works correctly in multibyte locales.  */
-extern int mbscasecmp (const char *s1, const char *s2)
+_GL_EXTERN_C int mbscasecmp (const char *s1, const char *s2)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -509,21 +821,22 @@ extern int mbscasecmp (const char *s1, const char *s2)
    of different lengths!
    Unlike strncasecmp(), this function works correctly in multibyte locales.
    But beware that N is not a byte count but a character count!  */
-extern int mbsncasecmp (const char *s1, const char *s2, size_t n)
+_GL_EXTERN_C int mbsncasecmp (const char *s1, const char *s2, size_t n)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
 #if @GNULIB_MBSPCASECMP@
 /* Compare the initial segment of the character string STRING consisting of
    at most mbslen (PREFIX) characters with the character string PREFIX,
-   ignoring case, returning less than, equal to or greater than zero if this
-   initial segment is lexicographically less than, equal to or greater than
-   PREFIX.
-   Note: This function may, in multibyte locales, return 0 if STRING is of
-   smaller length than PREFIX!
+   ignoring case.  If the two match, return a pointer to the first byte
+   after this prefix in STRING.  Otherwise, return NULL.
+   Note: This function may, in multibyte locales, return non-NULL if STRING
+   is of smaller length than PREFIX!
    Unlike strncasecmp(), this function works correctly in multibyte
    locales.  */
-extern char * mbspcasecmp (const char *string, const char *prefix)
+_GL_EXTERN_C char * mbspcasecmp (const char *string, const char *prefix)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -533,7 +846,8 @@ extern char * mbspcasecmp (const char *string, const char *prefix)
    Note: This function may, in multibyte locales, return success even if
    strlen (haystack) < strlen (needle) !
    Unlike strcasestr(), this function works correctly in multibyte locales.  */
-extern char * mbscasestr (const char *haystack, const char *needle)
+_GL_EXTERN_C char * mbscasestr (const char *haystack, const char *needle)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -543,7 +857,8 @@ extern char * mbscasestr (const char *haystack, const char *needle)
    beginning of the string to this occurrence, or to the end of the string
    if none exists.
    Unlike strcspn(), this function works correctly in multibyte locales.  */
-extern size_t mbscspn (const char *string, const char *accept)
+_GL_EXTERN_C size_t mbscspn (const char *string, const char *accept)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -552,9 +867,21 @@ extern size_t mbscspn (const char *string, const char *accept)
    in the character string ACCEPT.  Return the pointer to it, or NULL if none
    exists.
    Unlike strpbrk(), this function works correctly in multibyte locales.  */
-# define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
-extern char * mbspbrk (const char *string, const char *accept)
-     _GL_ARG_NONNULL ((1, 2));
+# if defined __hpux
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mbspbrk rpl_mbspbrk /* avoid collision with HP-UX function */
+#  endif
+_GL_FUNCDECL_RPL (mbspbrk, char *, (const char *string, const char *accept)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (mbspbrk, char *, (const char *string, const char *accept));
+# else
+_GL_FUNCDECL_SYS (mbspbrk, char *, (const char *string, const char *accept)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_SYS (mbspbrk, char *, (const char *string, const char *accept));
+# endif
+_GL_CXXALIASWARN (mbspbrk);
 #endif
 
 #if @GNULIB_MBSSPN@
@@ -563,7 +890,8 @@ extern char * mbspbrk (const char *string, const char *accept)
    beginning of the string to this occurrence, or to the end of the string
    if none exists.
    Unlike strspn(), this function works correctly in multibyte locales.  */
-extern size_t mbsspn (const char *string, const char *reject)
+_GL_EXTERN_C size_t mbsspn (const char *string, const char *reject)
+     _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -582,7 +910,7 @@ extern size_t mbsspn (const char *string, const char *reject)
    Caveat: The identity of the delimiting character is lost.
 
    See also mbstok_r().  */
-extern char * mbssep (char **stringp, const char *delim)
+_GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
      _GL_ARG_NONNULL ((1, 2));
 #endif
 
@@ -603,56 +931,99 @@ extern char * mbssep (char **stringp, const char *delim)
    Caveat: The identity of the delimiting character is lost.
 
    See also mbssep().  */
-extern char * mbstok_r (char *string, const char *delim, char **save_ptr)
+_GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr)
      _GL_ARG_NONNULL ((2, 3));
 #endif
 
 /* Map any int, typically from errno, into an error message.  */
 #if @GNULIB_STRERROR@
 # if @REPLACE_STRERROR@
-#  undef strerror
-#  define strerror rpl_strerror
-extern char *strerror (int);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strerror
+#   define strerror rpl_strerror
+#  endif
+_GL_FUNCDECL_RPL (strerror, char *, (int));
+_GL_CXXALIAS_RPL (strerror, char *, (int));
+# else
+_GL_CXXALIAS_SYS (strerror, char *, (int));
 # endif
+_GL_CXXALIASWARN (strerror);
 #elif defined GNULIB_POSIXCHECK
 # undef strerror
-# define strerror(e) \
-    (GL_LINK_WARNING ("strerror is unportable - " \
-                      "use gnulib module strerror to guarantee non-NULL result"), \
-     strerror (e))
+/* Assume strerror is always declared.  */
+_GL_WARN_ON_USE (strerror, "strerror is unportable - "
+                 "use gnulib module strerror to guarantee non-NULL result");
+#endif
+
+/* Map any int, typically from errno, into an error message.  Multithread-safe.
+   Uses the POSIX declaration, not the glibc declaration.  */
+#if @GNULIB_STRERROR_R@
+# if @REPLACE_STRERROR_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strerror_r
+#   define strerror_r rpl_strerror_r
+#  endif
+_GL_FUNCDECL_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen)
+                                   _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (strerror_r, int, (int errnum, char *buf, size_t buflen));
+# else
+#  if !@HAVE_DECL_STRERROR_R@
+_GL_FUNCDECL_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen)
+                                   _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (strerror_r, int, (int errnum, char *buf, size_t buflen));
+# endif
+# if @HAVE_DECL_STRERROR_R@
+_GL_CXXALIASWARN (strerror_r);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strerror_r
+# if HAVE_RAW_DECL_STRERROR_R
+_GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - "
+                 "use gnulib module strerror_r-posix for portability");
+# endif
 #endif
 
 #if @GNULIB_STRSIGNAL@
 # if @REPLACE_STRSIGNAL@
-#  define strsignal rpl_strsignal
-# endif
-# if ! @HAVE_DECL_STRSIGNAL@ || @REPLACE_STRSIGNAL@
-extern char *strsignal (int __sig);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strsignal rpl_strsignal
+#  endif
+_GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
+_GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
+# else
+#  if ! @HAVE_DECL_STRSIGNAL@
+_GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
+#  endif
+/* Need to cast, because on Cygwin 1.5.x systems, the return type is
+   'const char *'.  */
+_GL_CXXALIAS_SYS_CAST (strsignal, char *, (int __sig));
 # endif
+_GL_CXXALIASWARN (strsignal);
 #elif defined GNULIB_POSIXCHECK
 # undef strsignal
-# define strsignal(a) \
-    (GL_LINK_WARNING ("strsignal is unportable - " \
-                      "use gnulib module strsignal for portability"), \
-     strsignal (a))
+# if HAVE_RAW_DECL_STRSIGNAL
+_GL_WARN_ON_USE (strsignal, "strsignal is unportable - "
+                 "use gnulib module strsignal for portability");
+# endif
 #endif
 
 #if @GNULIB_STRVERSCMP@
 # if !@HAVE_STRVERSCMP@
-extern int strverscmp (const char *, const char *) _GL_ARG_NONNULL ((1, 2));
+_GL_FUNCDECL_SYS (strverscmp, int, (const char *, const char *)
+                                   _GL_ATTRIBUTE_PURE
+                                   _GL_ARG_NONNULL ((1, 2)));
 # endif
+_GL_CXXALIAS_SYS (strverscmp, int, (const char *, const char *));
+_GL_CXXALIASWARN (strverscmp);
 #elif defined GNULIB_POSIXCHECK
 # undef strverscmp
-# define strverscmp(a, b) \
-    (GL_LINK_WARNING ("strverscmp is unportable - " \
-                      "use gnulib module strverscmp for portability"), \
-     strverscmp (a, b))
+# if HAVE_RAW_DECL_STRVERSCMP
+_GL_WARN_ON_USE (strverscmp, "strverscmp is unportable - "
+                 "use gnulib module strverscmp for portability");
+# endif
 #endif
 
 
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _GL_STRING_H */
-#endif /* _GL_STRING_H */
+#endif /* _@GUARD_PREFIX@_STRING_H */
+#endif /* _@GUARD_PREFIX@_STRING_H */
index 3a5996fd90b84a0ee26b08af31b7086322199b56..ef458c63a96f57fd28f5d4a02afad14e3fc257a6 100644 (file)
@@ -1,6 +1,6 @@
 /* stripslash.c -- remove redundant trailing slashes from a file name
 
-   Copyright (C) 1990, 2001, 2003-2006, 2009-2010 Free Software Foundation,
+   Copyright (C) 1990, 2001, 2003-2006, 2009-2012 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -35,7 +35,7 @@ strip_trailing_slashes (char *file)
   bool had_slash;
 
   /* last_component returns "" for file system roots, but we need to turn
-     `///' into `/'.  */
+     "///" into "/".  */
   if (! *base)
     base = file;
   base_lim = base + base_len (base);
index e83ab1a11eb7f398d35e14ec61968810e1ebfdda..2efc1e92e06070bb77b9299166183b9c602a0767 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Provide a more complete sys/stat header file.
-   Copyright (C) 2005-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2012 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
@@ -14,8 +12,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake, Paul Eggert, and Jim Meyering.  */
 
@@ -26,6 +23,7 @@
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 #if defined __need_system_sys_stat_h
 /* Special invocation convention.  */
 #else
 /* Normal invocation convention.  */
 
-#ifndef _GL_SYS_STAT_H
+#ifndef _@GUARD_PREFIX@_SYS_STAT_H
 
-/* Get nlink_t.  */
+/* Get nlink_t.
+   May also define off_t to a 64-bit type on native Windows.  */
 #include <sys/types.h>
 
 /* Get struct timespec.  */
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
 
-#ifndef _GL_SYS_STAT_H
-#define _GL_SYS_STAT_H
+#ifndef _@GUARD_PREFIX@_SYS_STAT_H
+#define _@GUARD_PREFIX@_SYS_STAT_H
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 /* Before doing "#define mkdir rpl_mkdir" below, we need to include all
-   headers that may declare mkdir().  */
+   headers that may declare mkdir().  Native Windows platforms declare mkdir
+   in <io.h> and/or <direct.h>, not in <unistd.h>.  */
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# include <io.h>     /* mingw32, mingw64 */
+# include <direct.h> /* mingw64, MSVC 9 */
+#endif
+
+/* Native Windows platforms declare umask() in <io.h>.  */
+#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
 # include <io.h>
 #endif
 
+/* Large File Support on native Windows.  */
+#if @WINDOWS_64_BIT_ST_SIZE@
+# define stat _stati64
+#endif
+
+#ifndef S_IFIFO
+# ifdef _S_IFIFO
+#  define S_IFIFO _S_IFIFO
+# endif
+#endif
+
 #ifndef S_IFMT
 # define S_IFMT 0170000
 #endif
 #endif
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
 #if @GNULIB_FCHMODAT@
 # if !@HAVE_FCHMODAT@
-extern int fchmodat (int fd, char const *file, mode_t mode, int flag)
-     _GL_ARG_NONNULL ((2));
+_GL_FUNCDECL_SYS (fchmodat, int,
+                  (int fd, char const *file, mode_t mode, int flag)
+                  _GL_ARG_NONNULL ((2)));
 # endif
+_GL_CXXALIAS_SYS (fchmodat, int,
+                  (int fd, char const *file, mode_t mode, int flag));
+_GL_CXXALIASWARN (fchmodat);
 #elif defined GNULIB_POSIXCHECK
 # undef fchmodat
-# define fchmodat(d,n,m,f)                         \
-    (GL_LINK_WARNING ("fchmodat is not portable - " \
-                      "use gnulib module openat for portability"), \
-     fchmodat (d, n, m, f))
+# if HAVE_RAW_DECL_FCHMODAT
+_GL_WARN_ON_USE (fchmodat, "fchmodat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
 
-#if @REPLACE_FSTAT@
-# define fstat rpl_fstat
-extern int fstat (int fd, struct stat *buf) _GL_ARG_NONNULL ((2));
+#if @GNULIB_FSTAT@
+# if @REPLACE_FSTAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fstat
+#   define fstat rpl_fstat
+#  endif
+_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
+# else
+_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
+# endif
+_GL_CXXALIASWARN (fstat);
+#elif @WINDOWS_64_BIT_ST_SIZE@
+/* Above, we define stat to _stati64.  */
+# define fstat _fstati64
+#elif defined GNULIB_POSIXCHECK
+# undef fstat
+# if HAVE_RAW_DECL_FSTAT
+_GL_WARN_ON_USE (fstat, "fstat has portability problems - "
+                 "use gnulib module fstat for portability");
+# endif
 #endif
 
 
 #if @GNULIB_FSTATAT@
 # if @REPLACE_FSTATAT@
-#  undef fstatat
-#  define fstatat rpl_fstatat
-# endif
-# if !@HAVE_FSTATAT@ || @REPLACE_FSTATAT@
-extern int fstatat (int fd, char const *name, struct stat *st, int flags)
-     _GL_ARG_NONNULL ((2, 3));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fstatat
+#   define fstatat rpl_fstatat
+#  endif
+_GL_FUNCDECL_RPL (fstatat, int,
+                  (int fd, char const *name, struct stat *st, int flags)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (fstatat, int,
+                  (int fd, char const *name, struct stat *st, int flags));
+# else
+#  if !@HAVE_FSTATAT@
+_GL_FUNCDECL_SYS (fstatat, int,
+                  (int fd, char const *name, struct stat *st, int flags)
+                  _GL_ARG_NONNULL ((2, 3)));
+#  endif
+_GL_CXXALIAS_SYS (fstatat, int,
+                  (int fd, char const *name, struct stat *st, int flags));
 # endif
+_GL_CXXALIASWARN (fstatat);
 #elif defined GNULIB_POSIXCHECK
 # undef fstatat
-# define fstatat(d,n,s,f)                         \
-    (GL_LINK_WARNING ("fstatat is not portable - " \
-                      "use gnulib module openat for portability"), \
-     fstatat (d, n, s, f))
+# if HAVE_RAW_DECL_FSTATAT
+_GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
 
 #if @GNULIB_FUTIMENS@
-# if @REPLACE_FUTIMENS@
-#  undef futimens
-#  define futimens rpl_futimens
+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our futimens
+   implementation relies on futimesat, which on Solaris 10 makes an invocation
+   to futimens that is meant to invoke the libc's futimens(), not gnulib's
+   futimens().  */
+# if @REPLACE_FUTIMENS@ || (!@HAVE_FUTIMENS@ && defined __sun)
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef futimens
+#   define futimens rpl_futimens
+#  endif
+_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]));
+_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2]));
+# else
+#  if !@HAVE_FUTIMENS@
+_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
+#  endif
+_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
 # endif
-# if !@HAVE_FUTIMENS@ || @REPLACE_FUTIMENS@
-extern int futimens (int fd, struct timespec const times[2]);
+# if @HAVE_FUTIMENS@
+_GL_CXXALIASWARN (futimens);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef futimens
-# define futimens(f,t)                         \
-    (GL_LINK_WARNING ("futimens is not portable - " \
-                      "use gnulib module futimens for portability"), \
-     futimens (f, t))
+# if HAVE_RAW_DECL_FUTIMENS
+_GL_WARN_ON_USE (futimens, "futimens is not portable - "
+                 "use gnulib module futimens for portability");
+# endif
 #endif
 
 
@@ -363,17 +424,29 @@ extern int futimens (int fd, struct timespec const times[2]);
    invocation of lchmod, but we know of no workarounds that are
    reliable in general.  You might try requesting support for lchmod
    from your operating system supplier.  */
-#  define lchmod chmod
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define lchmod chmod
+#  endif
+/* Need to cast, because on mingw, the second parameter of chmod is
+                                                int mode.  */
+_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int,
+                         (const char *filename, mode_t mode));
+# else
+#  if 0 /* assume already declared */
+_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
+                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
 # endif
-# if 0 /* assume already declared */
-extern int lchmod (const char *filename, mode_t mode) _GL_ARG_NONNULL ((1));
+# if @HAVE_LCHMOD@
+_GL_CXXALIASWARN (lchmod);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef lchmod
-# define lchmod(f,m) \
-    (GL_LINK_WARNING ("lchmod is unportable - " \
-                      "use gnulib module lchmod for portability"), \
-     lchmod (f, m))
+# if HAVE_RAW_DECL_LCHMOD
+_GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
+                 "use gnulib module lchmod for portability");
+# endif
 #endif
 
 
@@ -381,117 +454,168 @@ extern int lchmod (const char *filename, mode_t mode) _GL_ARG_NONNULL ((1));
 # if ! @HAVE_LSTAT@
 /* mingw does not support symlinks, therefore it does not have lstat.  But
    without links, stat does just fine.  */
-#  define lstat stat
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define lstat stat
+#  endif
+_GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf));
 # elif @REPLACE_LSTAT@
-#  undef lstat
-#  define lstat rpl_lstat
-extern int rpl_lstat (const char *name, struct stat *buf)
-     _GL_ARG_NONNULL ((1, 2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef lstat
+#   define lstat rpl_lstat
+#  endif
+_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf)
+                              _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf));
+# else
+_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf));
+# endif
+# if @HAVE_LSTAT@
+_GL_CXXALIASWARN (lstat);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef lstat
-# define lstat(p,b)                                                     \
-  (GL_LINK_WARNING ("lstat is unportable - "                            \
-                    "use gnulib module lstat for portability"),         \
-   lstat (p, b))
+# if HAVE_RAW_DECL_LSTAT
+_GL_WARN_ON_USE (lstat, "lstat is unportable - "
+                 "use gnulib module lstat for portability");
+# endif
 #endif
 
 
 #if @REPLACE_MKDIR@
-# undef mkdir
-# define mkdir rpl_mkdir
-extern int mkdir (char const *name, mode_t mode) _GL_ARG_NONNULL ((1));
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#  undef mkdir
+#  define mkdir rpl_mkdir
+# endif
+_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
 #else
 /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
    Additionally, it declares _mkdir (and depending on compile flags, an
-   alias mkdir), only in the nonstandard <io.h>, which is included above.  */
+   alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
+   which are included above.  */
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
+#  if !GNULIB_defined_rpl_mkdir
 static inline int
 rpl_mkdir (char const *name, mode_t mode)
 {
   return _mkdir (name);
 }
+#   define GNULIB_defined_rpl_mkdir 1
+#  endif
 
-#  define mkdir rpl_mkdir
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define mkdir rpl_mkdir
+#  endif
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
 # endif
 #endif
+_GL_CXXALIASWARN (mkdir);
 
 
 #if @GNULIB_MKDIRAT@
 # if !@HAVE_MKDIRAT@
-extern int mkdirat (int fd, char const *file, mode_t mode)
-     _GL_ARG_NONNULL ((2));
+_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)
+                                _GL_ARG_NONNULL ((2)));
 # endif
+_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode));
+_GL_CXXALIASWARN (mkdirat);
 #elif defined GNULIB_POSIXCHECK
 # undef mkdirat
-# define mkdirat(d,n,m)                         \
-    (GL_LINK_WARNING ("mkdirat is not portable - " \
-                      "use gnulib module openat for portability"), \
-     mkdirat (d, n, m))
+# if HAVE_RAW_DECL_MKDIRAT
+_GL_WARN_ON_USE (mkdirat, "mkdirat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
 
 #if @GNULIB_MKFIFO@
 # if @REPLACE_MKFIFO@
-#  undef mkfifo
-#  define mkfifo rpl_mkfifo
-# endif
-# if !@HAVE_MKFIFO@ || @REPLACE_MKFIFO@
-extern int mkfifo (char const *file, mode_t mode) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mkfifo
+#   define mkfifo rpl_mkfifo
+#  endif
+_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode));
+# else
+#  if !@HAVE_MKFIFO@
+_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode)
+                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode));
 # endif
+_GL_CXXALIASWARN (mkfifo);
 #elif defined GNULIB_POSIXCHECK
 # undef mkfifo
-# define mkfifo(n,m)                                                    \
-    (GL_LINK_WARNING ("mkfifo is not portable - "                       \
-                      "use gnulib module mkfifo for portability"),      \
-     mkfifo (n, m))
+# if HAVE_RAW_DECL_MKFIFO
+_GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
+                 "use gnulib module mkfifo for portability");
+# endif
 #endif
 
 
 #if @GNULIB_MKFIFOAT@
 # if !@HAVE_MKFIFOAT@
-extern int mkfifoat (int fd, char const *file, mode_t mode)
-     _GL_ARG_NONNULL ((2));
+_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
+                                 _GL_ARG_NONNULL ((2)));
 # endif
+_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
+_GL_CXXALIASWARN (mkfifoat);
 #elif defined GNULIB_POSIXCHECK
 # undef mkfifoat
-# define mkfifoat(d,n,m)                                     \
-    (GL_LINK_WARNING ("mkfifoat is not portable - " \
-                      "use gnulib module mkfifoat for portability"), \
-     mkfifoat (d, n, m))
+# if HAVE_RAW_DECL_MKFIFOAT
+_GL_WARN_ON_USE (mkfifoat, "mkfifoat is not portable - "
+                 "use gnulib module mkfifoat for portability");
+# endif
 #endif
 
 
 #if @GNULIB_MKNOD@
 # if @REPLACE_MKNOD@
-#  undef mknod
-#  define mknod rpl_mknod
-# endif
-# if !@HAVE_MKNOD@ || @REPLACE_MKNOD@
-extern int mknod (char const *file, mode_t mode, dev_t dev)
-     _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mknod
+#   define mknod rpl_mknod
+#  endif
+_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
+# else
+#  if !@HAVE_MKNOD@
+_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
+                              _GL_ARG_NONNULL ((1)));
+#  endif
+/* Need to cast, because on OSF/1 5.1, the third parameter is '...'.  */
+_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev));
 # endif
+_GL_CXXALIASWARN (mknod);
 #elif defined GNULIB_POSIXCHECK
 # undef mknod
-# define mknod(n,m,d)                                                   \
-    (GL_LINK_WARNING ("mknod is not portable - "                        \
-                      "use gnulib module mknod for portability"),       \
-     mknod (n, m, d))
+# if HAVE_RAW_DECL_MKNOD
+_GL_WARN_ON_USE (mknod, "mknod is not portable - "
+                 "use gnulib module mknod for portability");
+# endif
 #endif
 
 
 #if @GNULIB_MKNODAT@
 # if !@HAVE_MKNODAT@
-extern int mknodat (int fd, char const *file, mode_t mode, dev_t dev)
-     _GL_ARG_NONNULL ((2));
+_GL_FUNCDECL_SYS (mknodat, int,
+                  (int fd, char const *file, mode_t mode, dev_t dev)
+                  _GL_ARG_NONNULL ((2)));
 # endif
+_GL_CXXALIAS_SYS (mknodat, int,
+                  (int fd, char const *file, mode_t mode, dev_t dev));
+_GL_CXXALIASWARN (mknodat);
 #elif defined GNULIB_POSIXCHECK
 # undef mknodat
-# define mknodat(f,n,m,d)                            \
-    (GL_LINK_WARNING ("mknodat is not portable - " \
-                      "use gnulib module mkfifoat for portability"), \
-     mknodat (f, n, m, d))
+# if HAVE_RAW_DECL_MKNODAT
+_GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
+                 "use gnulib module mkfifoat for portability");
+# endif
 #endif
 
 
@@ -500,51 +624,105 @@ extern int mknodat (int fd, char const *file, mode_t mode, dev_t dev)
 /* We can't use the object-like #define stat rpl_stat, because of
    struct stat.  This means that rpl_stat will not be used if the user
    does (stat)(a,b).  Oh well.  */
-#  undef stat
-#  ifdef _LARGE_FILES
+#  if defined _AIX && defined stat && defined _LARGE_FILES
     /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
        so we have to replace stat64() instead of stat(). */
-#   define stat stat64
 #   undef stat64
 #   define stat64(name, st) rpl_stat (name, st)
-#  else /* !_LARGE_FILES */
+#  elif @WINDOWS_64_BIT_ST_SIZE@
+    /* Above, we define stat to _stati64.  */
+#   if defined __MINGW32__ && defined _stati64
+#    ifndef _USE_32BIT_TIME_T
+      /* The system headers define _stati64 to _stat64.  */
+#     undef _stat64
+#     define _stat64(name, st) rpl_stat (name, st)
+#    endif
+#   elif defined _MSC_VER && defined _stati64
+#    ifdef _USE_32BIT_TIME_T
+      /* The system headers define _stati64 to _stat32i64.  */
+#     undef _stat32i64
+#     define _stat32i64(name, st) rpl_stat (name, st)
+#    else
+      /* The system headers define _stati64 to _stat64.  */
+#     undef _stat64
+#     define _stat64(name, st) rpl_stat (name, st)
+#    endif
+#   else
+#    undef _stati64
+#    define _stati64(name, st) rpl_stat (name, st)
+#   endif
+#  elif defined __MINGW32__ && defined stat
+#   ifdef _USE_32BIT_TIME_T
+     /* The system headers define stat to _stat32i64.  */
+#    undef _stat32i64
+#    define _stat32i64(name, st) rpl_stat (name, st)
+#   else
+     /* The system headers define stat to _stat64.  */
+#    undef _stat64
+#    define _stat64(name, st) rpl_stat (name, st)
+#   endif
+#  elif defined _MSC_VER && defined stat
+#   ifdef _USE_32BIT_TIME_T
+     /* The system headers define stat to _stat32.  */
+#    undef _stat32
+#    define _stat32(name, st) rpl_stat (name, st)
+#   else
+     /* The system headers define stat to _stat64i32.  */
+#    undef _stat64i32
+#    define _stat64i32(name, st) rpl_stat (name, st)
+#   endif
+#  else /* !(_AIX ||__MINGW32__ ||  _MSC_VER) */
+#   undef stat
 #   define stat(name, st) rpl_stat (name, st)
 #  endif /* !_LARGE_FILES */
-extern int stat (const char *name, struct stat *buf) _GL_ARG_NONNULL ((1, 2));
+_GL_EXTERN_C int stat (const char *name, struct stat *buf)
+                      _GL_ARG_NONNULL ((1, 2));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef stat
-# define stat(p,b)                                                      \
-  (GL_LINK_WARNING ("stat is unportable - "                             \
-                    "use gnulib module stat for portability"),          \
-   stat (p, b))
+# if HAVE_RAW_DECL_STAT
+_GL_WARN_ON_USE (stat, "stat is unportable - "
+                 "use gnulib module stat for portability");
+# endif
 #endif
 
 
 #if @GNULIB_UTIMENSAT@
-# if @REPLACE_UTIMENSAT@
-#  undef utimensat
-#  define utimensat rpl_utimensat
+/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat
+   implementation relies on futimesat, which on Solaris 10 makes an invocation
+   to utimensat that is meant to invoke the libc's utimensat(), not gnulib's
+   utimensat().  */
+# if @REPLACE_UTIMENSAT@ || (!@HAVE_UTIMENSAT@ && defined __sun)
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef utimensat
+#   define utimensat rpl_utimensat
+#  endif
+_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name,
+                                   struct timespec const times[2], int flag)
+                                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name,
+                                   struct timespec const times[2], int flag));
+# else
+#  if !@HAVE_UTIMENSAT@
+_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
+                                   struct timespec const times[2], int flag)
+                                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
+                                   struct timespec const times[2], int flag));
 # endif
-# if !@HAVE_UTIMENSAT@ || @REPLACE_UTIMENSAT@
-   extern int utimensat (int fd, char const *name,
-                         struct timespec const times[2], int flag)
-        _GL_ARG_NONNULL ((2));
+# if @HAVE_UTIMENSAT@
+_GL_CXXALIASWARN (utimensat);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef utimensat
-# define utimensat(d,n,t,f)                          \
-    (GL_LINK_WARNING ("utimensat is not portable - " \
-                      "use gnulib module utimensat for portability"), \
-     utimensat (d, n, t, f))
-#endif
-
-
-#ifdef __cplusplus
-}
+# if HAVE_RAW_DECL_UTIMENSAT
+_GL_WARN_ON_USE (utimensat, "utimensat is not portable - "
+                 "use gnulib module utimensat for portability");
+# endif
 #endif
 
 
-#endif /* _GL_SYS_STAT_H */
-#endif /* _GL_SYS_STAT_H */
+#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
+#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
 #endif
index 6ca17cf402a825ee54f998ef758d6eb81e48b395..d915cee467a2fe6af7c43cbbdaebdd3b2e5c2b1e 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Provide a more complete sys/time.h.
 
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
-#if defined _GL_SYS_TIME_H
+#if defined _@GUARD_PREFIX@_SYS_TIME_H
 
 /* Simply delegate to the system's header, without adding anything.  */
 # if @HAVE_SYS_TIME_H@
@@ -33,7 +31,7 @@
 
 #else
 
-# define _GL_SYS_TIME_H
+# define _@GUARD_PREFIX@_SYS_TIME_H
 
 # if @HAVE_SYS_TIME_H@
 #  @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
 #  include <time.h>
 # endif
 
+/* On native Windows with MSVC, get the 'struct timeval' type.
+   Also, on native Windows with a 64-bit time_t, where we are overriding the
+   'struct timeval' type, get all declarations of system functions whose
+   signature contains 'struct timeval'.  */
+# if (defined _MSC_VER || @REPLACE_STRUCT_TIMEVAL@) && @HAVE_WINSOCK2_H@ && !defined _GL_INCLUDING_WINSOCK2_H
+#  define _GL_INCLUDING_WINSOCK2_H
+#  include <winsock2.h>
+#  undef _GL_INCLUDING_WINSOCK2_H
+# endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
-#ifdef __cplusplus
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+# ifdef __cplusplus
 extern "C" {
-#endif
+# endif
+
+# if !@HAVE_STRUCT_TIMEVAL@ || @REPLACE_STRUCT_TIMEVAL@
+
+#  if @REPLACE_STRUCT_TIMEVAL@
+#   define timeval rpl_timeval
+#  endif
 
-# if ! @HAVE_STRUCT_TIMEVAL@
+#  if !GNULIB_defined_struct_timeval
 struct timeval
 {
   time_t tv_sec;
   long int tv_usec;
 };
+#   define GNULIB_defined_struct_timeval 1
+#  endif
+
+# endif
+
+# ifdef __cplusplus
+}
 # endif
 
-# if @REPLACE_GETTIMEOFDAY@
+# if @GNULIB_GETTIMEOFDAY@
+#  if @REPLACE_GETTIMEOFDAY@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef gettimeofday
+#    define gettimeofday rpl_gettimeofday
+#   endif
+_GL_FUNCDECL_RPL (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict));
+#  else
+#   if !@HAVE_GETTIMEOFDAY@
+_GL_FUNCDECL_SYS (gettimeofday, int,
+                  (struct timeval *restrict, void *restrict)
+                  _GL_ARG_NONNULL ((1)));
+#   endif
+/* Need to cast, because on glibc systems, by default, the second argument is
+                                                  struct timezone *.  */
+_GL_CXXALIAS_SYS_CAST (gettimeofday, int,
+                       (struct timeval *restrict, void *restrict));
+#  endif
+_GL_CXXALIASWARN (gettimeofday);
+# elif defined GNULIB_POSIXCHECK
 #  undef gettimeofday
-#  define gettimeofday rpl_gettimeofday
-extern int gettimeofday (struct timeval *restrict, void *restrict)
-     _GL_ARG_NONNULL ((1));
+#  if HAVE_RAW_DECL_GETTIMEOFDAY
+_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
+                 "use gnulib module gettimeofday for portability");
+#  endif
 # endif
 
-#ifdef __cplusplus
-}
-#endif
+/* Hide some function declarations from <winsock2.h>.  */
+
+# if defined _MSC_VER && @HAVE_WINSOCK2_H@
+#  if !defined _@GUARD_PREFIX@_UNISTD_H
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef close
+#    define close close_used_without_including_unistd_h
+#   else
+     _GL_WARN_ON_USE (close,
+                      "close() used without including <unistd.h>");
+#   endif
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef gethostname
+#    define gethostname gethostname_used_without_including_unistd_h
+#   else
+     _GL_WARN_ON_USE (gethostname,
+                      "gethostname() used without including <unistd.h>");
+#   endif
+#  endif
+#  if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef socket
+#    define socket              socket_used_without_including_sys_socket_h
+#    undef connect
+#    define connect             connect_used_without_including_sys_socket_h
+#    undef accept
+#    define accept              accept_used_without_including_sys_socket_h
+#    undef bind
+#    define bind                bind_used_without_including_sys_socket_h
+#    undef getpeername
+#    define getpeername         getpeername_used_without_including_sys_socket_h
+#    undef getsockname
+#    define getsockname         getsockname_used_without_including_sys_socket_h
+#    undef getsockopt
+#    define getsockopt          getsockopt_used_without_including_sys_socket_h
+#    undef listen
+#    define listen              listen_used_without_including_sys_socket_h
+#    undef recv
+#    define recv                recv_used_without_including_sys_socket_h
+#    undef send
+#    define send                send_used_without_including_sys_socket_h
+#    undef recvfrom
+#    define recvfrom            recvfrom_used_without_including_sys_socket_h
+#    undef sendto
+#    define sendto              sendto_used_without_including_sys_socket_h
+#    undef setsockopt
+#    define setsockopt          setsockopt_used_without_including_sys_socket_h
+#    undef shutdown
+#    define shutdown            shutdown_used_without_including_sys_socket_h
+#   else
+     _GL_WARN_ON_USE (socket,
+                      "socket() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (connect,
+                      "connect() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (accept,
+                      "accept() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (bind,
+                      "bind() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (getpeername,
+                      "getpeername() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (getsockname,
+                      "getsockname() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (getsockopt,
+                      "getsockopt() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (listen,
+                      "listen() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (recv,
+                      "recv() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (send,
+                      "send() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (recvfrom,
+                      "recvfrom() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (sendto,
+                      "sendto() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (setsockopt,
+                      "setsockopt() used without including <sys/socket.h>");
+     _GL_WARN_ON_USE (shutdown,
+                      "shutdown() used without including <sys/socket.h>");
+#   endif
+#  endif
+#  if !defined _@GUARD_PREFIX@_SYS_SELECT_H
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef select
+#    define select select_used_without_including_sys_select_h
+#   else
+     _GL_WARN_ON_USE (select,
+                      "select() used without including <sys/select.h>");
+#   endif
+#  endif
+# endif
 
-#endif /* _GL_SYS_TIME_H */
+#endif /* _@GUARD_PREFIX@_SYS_TIME_H */
diff --git a/lib/sys_types.in.h b/lib/sys_types.in.h
new file mode 100644 (file)
index 0000000..8139d98
--- /dev/null
@@ -0,0 +1,51 @@
+/* Provide a more complete sys/types.h.
+
+   Copyright (C) 2011-2012 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
+   the Free Software Foundation; either version 3, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
+
+#ifndef _@GUARD_PREFIX@_SYS_TYPES_H
+#define _@GUARD_PREFIX@_SYS_TYPES_H
+
+/* Override off_t if Large File Support is requested on native Windows.  */
+#if @WINDOWS_64_BIT_OFF_T@
+/* Same as int64_t in <stdint.h>.  */
+# if defined _MSC_VER
+#  define off_t __int64
+# else
+#  define off_t long long int
+# endif
+/* Indicator, for gnulib internal purposes.  */
+# define _GL_WINDOWS_64_BIT_OFF_T 1
+#endif
+
+/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>.  */
+/* But avoid namespace pollution on glibc systems.  */
+#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && ! defined __GLIBC__
+# include <stddef.h>
+#endif
+
+#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
+#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
index 22ae10e937fc3bcf446f2365890761bdc73caee7..04cde057cf070cbdbf95a09523893100dec998b7 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* A more-standard <time.h>.
 
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 /* Don't get in the way of glibc when it includes time.h merely to
    declare a few standard symbols, rather than to declare all the
    without adding our own declarations.  */
 #if (defined __need_time_t || defined __need_clock_t \
      || defined __need_timespec \
-     || defined _GL_TIME_H)
+     || defined _@GUARD_PREFIX@_TIME_H)
 
 # @INCLUDE_NEXT@ @NEXT_TIME_H@
 
 #else
 
-# define _GL_TIME_H
+# define _@GUARD_PREFIX@_TIME_H
 
 # @INCLUDE_NEXT@ @NEXT_TIME_H@
 
 /* NetBSD 5.0 mis-defines NULL.  */
-#include <stddef.h>
+# include <stddef.h>
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
-# ifdef __cplusplus
-extern "C" {
-# endif
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
 /* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
    Or they define it with the wrong member names or define it in <sys/time.h>
-   (e.g., FreeBSD circa 1997).  */
+   (e.g., FreeBSD circa 1997).  Stock Mingw does not define it, but the
+   pthreads-win32 library defines it in <pthread.h>.  */
 # if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
 #  if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 #   include <sys/time.h>
+#  elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+#   include <pthread.h>
+/* The pthreads-win32 <pthread.h> also defines a couple of broken macros.  */
+#   undef asctime_r
+#   undef ctime_r
+#   undef gmtime_r
+#   undef localtime_r
+#   undef rand_r
+#   undef strtok_r
 #  else
-#   undef timespec
-#   define timespec rpl_timespec
+
+#   ifdef __cplusplus
+extern "C" {
+#   endif
+
+#   if !GNULIB_defined_struct_timespec
+#    undef timespec
+#    define timespec rpl_timespec
 struct timespec
 {
   time_t tv_sec;
   long int tv_nsec;
 };
+#    define GNULIB_defined_struct_timespec 1
+#   endif
+
+#   ifdef __cplusplus
+}
+#   endif
+
 #  endif
 # endif
 
+# if !GNULIB_defined_struct_time_t_must_be_integral
+/* Per http://austingroupbugs.net/view.php?id=327, POSIX requires
+   time_t to be an integer type, even though C99 permits floating
+   point.  We don't know of any implementation that uses floating
+   point, and it is much easier to write code that doesn't have to
+   worry about that corner case, so we force the issue.  */
+struct __time_t_must_be_integral {
+  unsigned int __floating_time_t_unsupported : (time_t) 1;
+};
+#  define GNULIB_defined_struct_time_t_must_be_integral 1
+# endif
+
 /* Sleep for at least RQTP seconds unless interrupted,  If interrupted,
    return -1 and store the remaining time into RMTP.  See
    <http://www.opengroup.org/susv3xsh/nanosleep.html>.  */
-# if @REPLACE_NANOSLEEP@
-#  define nanosleep rpl_nanosleep
-extern int nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp)
-     _GL_ARG_NONNULL ((1));
+# if @GNULIB_NANOSLEEP@
+#  if @REPLACE_NANOSLEEP@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define nanosleep rpl_nanosleep
+#   endif
+_GL_FUNCDECL_RPL (nanosleep, int,
+                  (struct timespec const *__rqtp, struct timespec *__rmtp)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (nanosleep, int,
+                  (struct timespec const *__rqtp, struct timespec *__rmtp));
+#  else
+#   if ! @HAVE_NANOSLEEP@
+_GL_FUNCDECL_SYS (nanosleep, int,
+                  (struct timespec const *__rqtp, struct timespec *__rmtp)
+                  _GL_ARG_NONNULL ((1)));
+#   endif
+_GL_CXXALIAS_SYS (nanosleep, int,
+                  (struct timespec const *__rqtp, struct timespec *__rmtp));
+#  endif
+_GL_CXXALIASWARN (nanosleep);
 # endif
 
 /* Return the 'time_t' representation of TP and normalize TP.  */
-# if @REPLACE_MKTIME@
-#  define mktime rpl_mktime
-extern time_t mktime (struct tm *__tp) _GL_ARG_NONNULL ((1));
+# if @GNULIB_MKTIME@
+#  if @REPLACE_MKTIME@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define mktime rpl_mktime
+#   endif
+_GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
+#  else
+_GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
+#  endif
+_GL_CXXALIASWARN (mktime);
 # endif
 
 /* Convert TIMER to RESULT, assuming local time and UTC respectively.  See
    <http://www.opengroup.org/susv3xsh/localtime_r.html> and
    <http://www.opengroup.org/susv3xsh/gmtime_r.html>.  */
-# if @REPLACE_LOCALTIME_R@
-#  undef localtime_r
-#  define localtime_r rpl_localtime_r
-#  undef gmtime_r
-#  define gmtime_r rpl_gmtime_r
-extern struct tm *localtime_r (time_t const *restrict __timer,
-                               struct tm *restrict __result)
-     _GL_ARG_NONNULL ((1, 2));
-extern struct tm *gmtime_r (time_t const *restrict __timer,
-                            struct tm *restrict __result)
-     _GL_ARG_NONNULL ((1, 2));
+# if @GNULIB_TIME_R@
+#  if @REPLACE_LOCALTIME_R@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef localtime_r
+#    define localtime_r rpl_localtime_r
+#   endif
+_GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
+                                             struct tm *restrict __result)
+                                            _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
+                                             struct tm *restrict __result));
+#  else
+#   if ! @HAVE_DECL_LOCALTIME_R@
+_GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
+                                             struct tm *restrict __result)
+                                            _GL_ARG_NONNULL ((1, 2)));
+#   endif
+_GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
+                                             struct tm *restrict __result));
+#  endif
+#  if @HAVE_DECL_LOCALTIME_R@
+_GL_CXXALIASWARN (localtime_r);
+#  endif
+#  if @REPLACE_LOCALTIME_R@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef gmtime_r
+#    define gmtime_r rpl_gmtime_r
+#   endif
+_GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
+                                          struct tm *restrict __result)
+                                         _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
+                                          struct tm *restrict __result));
+#  else
+#   if ! @HAVE_DECL_LOCALTIME_R@
+_GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
+                                          struct tm *restrict __result)
+                                         _GL_ARG_NONNULL ((1, 2)));
+#   endif
+_GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
+                                          struct tm *restrict __result));
+#  endif
+#  if @HAVE_DECL_LOCALTIME_R@
+_GL_CXXALIASWARN (gmtime_r);
+#  endif
 # endif
 
 /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
    the resulting broken-down time into TM.  See
    <http://www.opengroup.org/susv3xsh/strptime.html>.  */
-# if @REPLACE_STRPTIME@
-#  undef strptime
-#  define strptime rpl_strptime
-extern char *strptime (char const *restrict __buf,
-                       char const *restrict __format,
-                       struct tm *restrict __tm)
-     _GL_ARG_NONNULL ((1, 2, 3));
+# if @GNULIB_STRPTIME@
+#  if ! @HAVE_STRPTIME@
+_GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
+                                     char const *restrict __format,
+                                     struct tm *restrict __tm)
+                                    _GL_ARG_NONNULL ((1, 2, 3)));
+#  endif
+_GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
+                                     char const *restrict __format,
+                                     struct tm *restrict __tm));
+_GL_CXXALIASWARN (strptime);
 # endif
 
 /* Convert TM to a time_t value, assuming UTC.  */
-# if @REPLACE_TIMEGM@
-#  undef timegm
-#  define timegm rpl_timegm
-extern time_t timegm (struct tm *__tm) _GL_ARG_NONNULL ((1));
+# if @GNULIB_TIMEGM@
+#  if @REPLACE_TIMEGM@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef timegm
+#    define timegm rpl_timegm
+#   endif
+_GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
+#  else
+#   if ! @HAVE_TIMEGM@
+_GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
+#   endif
+_GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
+#  endif
+_GL_CXXALIASWARN (timegm);
 # endif
 
 /* Encourage applications to avoid unsafe functions that can overrun
    buffers when given outlandish struct tm values.  Portable
    applications should use strftime (or even sprintf) instead.  */
-# if GNULIB_PORTCHECK
+# if defined GNULIB_POSIXCHECK
 #  undef asctime
-#  define asctime eschew_asctime
+_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
+                 "better use strftime (or even sprintf) instead");
+# endif
+# if defined GNULIB_POSIXCHECK
 #  undef asctime_r
-#  define asctime_r eschew_asctime_r
+_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - "
+                 "better use strftime (or even sprintf) instead");
+# endif
+# if defined GNULIB_POSIXCHECK
 #  undef ctime
-#  define ctime eschew_ctime
-#  undef ctime_r
-#  define ctime_r eschew_ctime_r
+_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - "
+                 "better use strftime (or even sprintf) instead");
 # endif
-
-# ifdef __cplusplus
-}
+# if defined GNULIB_POSIXCHECK
+#  undef ctime_r
+_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - "
+                 "better use strftime (or even sprintf) instead");
 # endif
 
 #endif
index 81b342300e62c10d1376a8f62a7874e32218d278..388ddb83a76120814003276f18966a4f7a904faf 100644 (file)
@@ -1,6 +1,6 @@
 /* timespec -- System time interface
 
-   Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2010 Free Software
+   Copyright (C) 2000, 2002, 2004-2005, 2007, 2009-2012 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
 # include <time.h>
 
 /* Return negative, zero, positive if A < B, A == B, A > B, respectively.
-   Assume the nanosecond components are in range, or close to it.  */
+
+   For each time stamp T, this code assumes that either:
+
+     * T.tv_nsec is in the range 0..999999999; or
+     * T.tv_sec corresponds to a valid leap second on a host that supports
+       leap seconds, and T.tv_nsec is in the range 1000000000..1999999999; or
+     * T.tv_sec is the minimum time_t value and T.tv_nsec is -1; or
+       T.tv_sec is the maximum time_t value and T.tv_nsec is 2000000000.
+       This allows for special struct timespec values that are less or
+       greater than all possible valid time stamps.
+
+   In all these cases, it is safe to subtract two tv_nsec values and
+   convert the result to integer without worrying about overflow on
+   any platform of interest to the GNU project, since all such
+   platforms have 32-bit int or wider.
+
+   Replacing "(int) (a.tv_nsec - b.tv_nsec)" with something like
+   "a.tv_nsec < b.tv_nsec ? -1 : a.tv_nsec > b.tv_nsec" would cause
+   this function to work in some cases where the above assumption is
+   violated, but not in all cases (e.g., a.tv_sec==1, a.tv_nsec==-2,
+   b.tv_sec==0, b.tv_nsec==999999999) and is arguably not worth the
+   extra instructions.  Using a subtraction has the advantage of
+   detecting some invalid cases on platforms that detect integer
+   overflow.
+
+   The (int) cast avoids a gcc -Wconversion warning.  */
+
 static inline int
 timespec_cmp (struct timespec a, struct timespec b)
 {
   return (a.tv_sec < b.tv_sec ? -1
           : a.tv_sec > b.tv_sec ? 1
-          : a.tv_nsec < b.tv_nsec ? -1
-          : a.tv_nsec > b.tv_nsec ? 1
-          : 0);
+          : (int) (a.tv_nsec - b.tv_nsec));
+}
+
+/* Return -1, 0, 1, depending on the sign of A.  A.tv_nsec must be
+   nonnegative.  */
+static inline int
+timespec_sign (struct timespec a)
+{
+  return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec;
+}
+
+struct timespec timespec_add (struct timespec, struct timespec);
+struct timespec timespec_sub (struct timespec, struct timespec);
+struct timespec dtotimespec (double);
+
+/* Return an approximation to A, of type 'double'.  */
+static inline double
+timespectod (struct timespec a)
+{
+  return a.tv_sec + a.tv_nsec / 1e9;
 }
 
 void gettime (struct timespec *);
index 5283d2c573f1085cdbc04413a3753805e22a923c..78b9e4ac76d1373dca332c21a49fa924d7aed418 100644 (file)
@@ -1,6 +1,6 @@
 /* Like unistd.h, but redefine some names to avoid glitches.
 
-   Copyright (C) 2005, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009-2012 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
index 190f108624fb43ce0756336e1b60d1b1e3290b2c..684bf79f5bf36e762ee9bb9229432edbd0101691 100644 (file)
@@ -1,6 +1,6 @@
 /* Invoke unistd-like functions, but avoid some glitches.
 
-   Copyright (C) 2001, 2003, 2005, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2005, 2009-2012 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
index bffdf8fa926b83f0c1c30d1e24328f6579524115..9115486cf37a094b94856a926af767555a647014 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2010 Free Software Foundation, Inc.
+   Copyright (C) 2003-2012 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
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
-
-#ifndef _GL_UNISTD_H
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
+
+/* Special invocation convention:
+   - On mingw, several headers, including <winsock2.h>, include <unistd.h>,
+     but we need to ensure that both the system <unistd.h> and <winsock2.h>
+     are completely included before we replace gethostname.  */
+#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
+  && !defined _GL_WINSOCK2_H_WITNESS && defined _WINSOCK2_H
+/* <unistd.h> is being indirectly included for the first time from
+   <winsock2.h>; avoid declaring any overrides.  */
+# if @HAVE_UNISTD_H@
+#  @INCLUDE_NEXT@ @NEXT_UNISTD_H@
+# else
+#  error unexpected; report this to bug-gnulib@gnu.org
+# endif
+# define _GL_WINSOCK2_H_WITNESS
+
+/* Normal invocation.  */
+#elif !defined _@GUARD_PREFIX@_UNISTD_H
 
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_UNISTD_H@
 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
 #endif
 
-#ifndef _GL_UNISTD_H
-#define _GL_UNISTD_H
+/* Get all possible declarations of gethostname().  */
+#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
+  && !defined _GL_INCLUDING_WINSOCK2_H
+# define _GL_INCLUDING_WINSOCK2_H
+# include <winsock2.h>
+# undef _GL_INCLUDING_WINSOCK2_H
+#endif
+
+#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
+#define _@GUARD_PREFIX@_UNISTD_H
 
 /* NetBSD 5.0 mis-defines NULL.  Also get size_t.  */
 #include <stddef.h>
 /* Cygwin 1.7.1 declares symlinkat in <stdio.h>, not in <unistd.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
-     || (@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK)) \
+     || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
+         && defined __CYGWIN__)) \
     && ! defined __GLIBC__
 # include <stdio.h>
 #endif
 
 /* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
-#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__
+#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \
+    && ! defined __GLIBC__
 # include <fcntl.h>
 #endif
 
 /* mingw fails to declare _exit in <unistd.h>.  */
-/* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
+/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
+   <unistd.h>.  */
 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
 #ifndef __GLIBC__
 # include <stdlib.h>
 #endif
 
-/* mingw declares getcwd in <io.h>, not in <unistd.h>.  */
-#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
+/* Native Windows platforms declare chdir, getcwd, rmdir in
+   <io.h> and/or <direct.h>, not in <unistd.h>.
+   They also declare access(), chmod(), close(), dup(), dup2(), isatty(),
+   lseek(), read(), unlink(), write() in <io.h>.  */
+#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
+      || defined GNULIB_POSIXCHECK) \
      && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# include <io.h>     /* mingw32, mingw64 */
+# include <direct.h> /* mingw64, MSVC 9 */
+#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \
+       || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \
+       || defined GNULIB_POSIXCHECK) \
+      && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
 # include <io.h>
 #endif
 
-#if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
-     || @GNULIB_PREAD@ || defined GNULIB_POSIXCHECK)
+/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
+   NonStop Kernel declares gethostname in <netdb.h>, not in <unistd.h>.  */
+/* But avoid namespace pollution on glibc systems.  */
+#if ((@GNULIB_GETDOMAINNAME@ && (defined _AIX || defined __osf__)) \
+     || (@GNULIB_GETHOSTNAME@ && defined __TANDEM)) \
+    && !defined __GLIBC__
+# include <netdb.h>
+#endif
+
+/* MSVC defines off_t in <sys/types.h>.
+   May also define off_t to a 64-bit type on native Windows.  */
+#if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@
+/* Get off_t.  */
+# include <sys/types.h>
+#endif
+
+#if (@GNULIB_READ@ || @GNULIB_WRITE@ \
+     || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
+     || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
 /* Get ssize_t.  */
 # include <sys/types.h>
 #endif
 # include <getopt.h>
 #endif
 
-#if @GNULIB_GETHOSTNAME@
-/* Get all possible declarations of gethostname().  */
-# if @UNISTD_H_HAVE_WINSOCK2_H@
-#  include <winsock2.h>
-#  if !defined _GL_SYS_SOCKET_H
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
+/* Hide some function declarations from <winsock2.h>.  */
+
+#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
+# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef socket
-#   define socket               socket_used_without_including_sys_socket_h
+#   define socket              socket_used_without_including_sys_socket_h
 #   undef connect
-#   define connect              connect_used_without_including_sys_socket_h
+#   define connect             connect_used_without_including_sys_socket_h
 #   undef accept
-#   define accept               accept_used_without_including_sys_socket_h
+#   define accept              accept_used_without_including_sys_socket_h
 #   undef bind
-#   define bind                 bind_used_without_including_sys_socket_h
+#   define bind                bind_used_without_including_sys_socket_h
 #   undef getpeername
-#   define getpeername          getpeername_used_without_including_sys_socket_h
+#   define getpeername         getpeername_used_without_including_sys_socket_h
 #   undef getsockname
-#   define getsockname          getsockname_used_without_including_sys_socket_h
+#   define getsockname         getsockname_used_without_including_sys_socket_h
 #   undef getsockopt
-#   define getsockopt           getsockopt_used_without_including_sys_socket_h
+#   define getsockopt          getsockopt_used_without_including_sys_socket_h
 #   undef listen
-#   define listen               listen_used_without_including_sys_socket_h
+#   define listen              listen_used_without_including_sys_socket_h
 #   undef recv
-#   define recv                 recv_used_without_including_sys_socket_h
+#   define recv                recv_used_without_including_sys_socket_h
 #   undef send
-#   define send                 send_used_without_including_sys_socket_h
+#   define send                send_used_without_including_sys_socket_h
 #   undef recvfrom
-#   define recvfrom             recvfrom_used_without_including_sys_socket_h
+#   define recvfrom            recvfrom_used_without_including_sys_socket_h
 #   undef sendto
-#   define sendto               sendto_used_without_including_sys_socket_h
+#   define sendto              sendto_used_without_including_sys_socket_h
 #   undef setsockopt
-#   define setsockopt           setsockopt_used_without_including_sys_socket_h
+#   define setsockopt          setsockopt_used_without_including_sys_socket_h
 #   undef shutdown
-#   define shutdown             shutdown_used_without_including_sys_socket_h
+#   define shutdown            shutdown_used_without_including_sys_socket_h
+#  else
+    _GL_WARN_ON_USE (socket,
+                     "socket() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (connect,
+                     "connect() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (accept,
+                     "accept() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (bind,
+                     "bind() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (getpeername,
+                     "getpeername() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (getsockname,
+                     "getsockname() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (getsockopt,
+                     "getsockopt() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (listen,
+                     "listen() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (recv,
+                     "recv() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (send,
+                     "send() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (recvfrom,
+                     "recvfrom() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (sendto,
+                     "sendto() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (setsockopt,
+                     "setsockopt() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (shutdown,
+                     "shutdown() used without including <sys/socket.h>");
 #  endif
-#  if !defined _GL_SYS_SELECT_H
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef select
-#   define select               select_used_without_including_sys_select_h
+#   define select              select_used_without_including_sys_select_h
+#  else
+    _GL_WARN_ON_USE (select,
+                     "select() used without including <sys/select.h>");
 #  endif
 # endif
 #endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
-
-/* The definition of _GL_ARG_NONNULL is copied here.  */
-
-/* The definition of _GL_WARN_ON_USE is copied here.  */
-
 
 /* OS/2 EMX lacks these macros.  */
 #ifndef STDIN_FILENO
 
 /* Declare overridden functions.  */
 
-#ifdef __cplusplus
-extern "C" {
+
+#if defined GNULIB_POSIXCHECK
+/* The access() function is a security risk.  */
+_GL_WARN_ON_USE (access, "the access function is a security risk - "
+                 "use the gnulib module faccessat instead");
 #endif
 
 
-#if @GNULIB_CHOWN@
-# if @REPLACE_CHOWN@
-#  undef chown
-#  define chown rpl_chown
+#if @GNULIB_CHDIR@
+_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIASWARN (chdir);
+#elif defined GNULIB_POSIXCHECK
+# undef chdir
+# if HAVE_RAW_DECL_CHDIR
+_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
+                 "use gnulib module chdir for portability");
 # endif
-# if !@HAVE_CHOWN@ || @REPLACE_CHOWN@
+#endif
+
+
+#if @GNULIB_CHOWN@
 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
    to GID (if GID is not -1).  Follow symbolic links.
    Return 0 if successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/chown.html>.  */
-extern int chown (const char *file, uid_t uid, gid_t gid)
-     _GL_ARG_NONNULL ((1));
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html.  */
+# if @REPLACE_CHOWN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef chown
+#   define chown rpl_chown
+#  endif
+_GL_FUNCDECL_RPL (chown, int, (const char *file, uid_t uid, gid_t gid)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (chown, int, (const char *file, uid_t uid, gid_t gid));
+# else
+#  if !@HAVE_CHOWN@
+_GL_FUNCDECL_SYS (chown, int, (const char *file, uid_t uid, gid_t gid)
+                              _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (chown, int, (const char *file, uid_t uid, gid_t gid));
 # endif
+_GL_CXXALIASWARN (chown);
 #elif defined GNULIB_POSIXCHECK
 # undef chown
-# define chown(f,u,g) \
-    (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \
-                      "doesn't treat a uid or gid of -1 on some systems - " \
-                      "use gnulib module chown for portability"), \
-     chown (f, u, g))
+# if HAVE_RAW_DECL_CHOWN
+_GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
+                 "doesn't treat a uid or gid of -1 on some systems - "
+                 "use gnulib module chown for portability");
+# endif
 #endif
 
 
 #if @GNULIB_CLOSE@
 # if @REPLACE_CLOSE@
 /* Automatically included by modules that need a replacement for close.  */
-#  undef close
-#  define close rpl_close
-extern int close (int);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef close
+#   define close rpl_close
+#  endif
+_GL_FUNCDECL_RPL (close, int, (int fd));
+_GL_CXXALIAS_RPL (close, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (close, int, (int fd));
 # endif
+_GL_CXXALIASWARN (close);
 #elif @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 # undef close
 # define close close_used_without_requesting_gnulib_module_close
 #elif defined GNULIB_POSIXCHECK
 # undef close
-# define close(f) \
-    (GL_LINK_WARNING ("close does not portably work on sockets - " \
-                      "use gnulib module close for portability"), \
-     close (f))
+/* Assume close is always declared.  */
+_GL_WARN_ON_USE (close, "close does not portably work on sockets - "
+                 "use gnulib module close for portability");
 #endif
 
 
-#if @REPLACE_DUP@
-# define dup rpl_dup
-extern int dup (int);
+#if @GNULIB_DUP@
+# if @REPLACE_DUP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define dup rpl_dup
+#  endif
+_GL_FUNCDECL_RPL (dup, int, (int oldfd));
+_GL_CXXALIAS_RPL (dup, int, (int oldfd));
+# else
+_GL_CXXALIAS_SYS (dup, int, (int oldfd));
+# endif
+_GL_CXXALIASWARN (dup);
+#elif defined GNULIB_POSIXCHECK
+# undef dup
+# if HAVE_RAW_DECL_DUP
+_GL_WARN_ON_USE (dup, "dup is unportable - "
+                 "use gnulib module dup for portability");
+# endif
 #endif
 
 
 #if @GNULIB_DUP2@
-# if @REPLACE_DUP2@
-#  define dup2 rpl_dup2
-# endif
-# if !@HAVE_DUP2@ || @REPLACE_DUP2@
 /* Copy the file descriptor OLDFD into file descriptor NEWFD.  Do nothing if
    NEWFD = OLDFD, otherwise close NEWFD first if it is open.
    Return newfd if successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/dup2.html>.  */
-extern int dup2 (int oldfd, int newfd);
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>.  */
+# if @REPLACE_DUP2@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define dup2 rpl_dup2
+#  endif
+_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
+_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
+# else
+#  if !@HAVE_DUP2@
+_GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd));
+#  endif
+_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
 # endif
+_GL_CXXALIASWARN (dup2);
 #elif defined GNULIB_POSIXCHECK
 # undef dup2
-# define dup2(o,n) \
-    (GL_LINK_WARNING ("dup2 is unportable - " \
-                      "use gnulib module dup2 for portability"), \
-     dup2 (o, n))
+# if HAVE_RAW_DECL_DUP2
+_GL_WARN_ON_USE (dup2, "dup2 is unportable - "
+                 "use gnulib module dup2 for portability");
+# endif
 #endif
 
 
@@ -230,15 +366,22 @@ extern int dup2 (int oldfd, int newfd);
    See the Linux man page at
    <http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>.  */
 # if @HAVE_DUP3@
-#  define dup3 rpl_dup3
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define dup3 rpl_dup3
+#  endif
+_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
+_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
+# else
+_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
+_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
 # endif
-extern int dup3 (int oldfd, int newfd, int flags);
+_GL_CXXALIASWARN (dup3);
 #elif defined GNULIB_POSIXCHECK
 # undef dup3
-# define dup3(o,n,f) \
-    (GL_LINK_WARNING ("dup3 is unportable - " \
-                      "use gnulib module dup3 for portability"), \
-     dup3 (o, n, f))
+# if HAVE_RAW_DECL_DUP3
+_GL_WARN_ON_USE (dup3, "dup3 is unportable - "
+                 "use gnulib module dup3 for portability");
+# endif
 #endif
 
 
@@ -250,7 +393,13 @@ extern int dup3 (int oldfd, int newfd, int flags);
 #   include <crt_externs.h>
 #   define environ (*_NSGetEnviron ())
 #  else
+#   ifdef __cplusplus
+extern "C" {
+#   endif
 extern char **environ;
+#   ifdef __cplusplus
+}
+#   endif
 #  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -269,133 +418,203 @@ _GL_WARN_ON_USE (rpl_environ, "environ is unportable - "
 
 
 #if @GNULIB_EUIDACCESS@
-# if !@HAVE_EUIDACCESS@
 /* Like access(), except that it uses the effective user id and group id of
    the current process.  */
-extern int euidaccess (const char *filename, int mode) _GL_ARG_NONNULL ((1));
+# if !@HAVE_EUIDACCESS@
+_GL_FUNCDECL_SYS (euidaccess, int, (const char *filename, int mode)
+                                   _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (euidaccess, int, (const char *filename, int mode));
+_GL_CXXALIASWARN (euidaccess);
+# if defined GNULIB_POSIXCHECK
+/* Like access(), this function is a security risk.  */
+_GL_WARN_ON_USE (euidaccess, "the euidaccess function is a security risk - "
+                 "use the gnulib module faccessat instead");
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef euidaccess
-# define euidaccess(f,m) \
-    (GL_LINK_WARNING ("euidaccess is unportable - " \
-                      "use gnulib module euidaccess for portability"), \
-     euidaccess (f, m))
+# if HAVE_RAW_DECL_EUIDACCESS
+_GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
+                 "use gnulib module euidaccess for portability");
+# endif
 #endif
 
 
 #if @GNULIB_FACCESSAT@
 # if !@HAVE_FACCESSAT@
-extern int faccessat (int fd, char const *file, int mode, int flag)
-     _GL_ARG_NONNULL ((2));
+_GL_FUNCDECL_SYS (faccessat, int,
+                  (int fd, char const *file, int mode, int flag)
+                  _GL_ARG_NONNULL ((2)));
 # endif
+_GL_CXXALIAS_SYS (faccessat, int,
+                  (int fd, char const *file, int mode, int flag));
+_GL_CXXALIASWARN (faccessat);
 #elif defined GNULIB_POSIXCHECK
 # undef faccessat
-# define faccessat(d,n,m,f)                         \
-    (GL_LINK_WARNING ("faccessat is not portable - " \
-                      "use gnulib module faccessat for portability"), \
-     faccessat (d, n, m, f))
+# if HAVE_RAW_DECL_FACCESSAT
+_GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
+                 "use gnulib module faccessat for portability");
+# endif
 #endif
 
 
 #if @GNULIB_FCHDIR@
-# if @REPLACE_FCHDIR@
 /* Change the process' current working directory to the directory on which
    the given file descriptor is open.
    Return 0 if successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/fchdir.html>.  */
-extern int fchdir (int /*fd*/);
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>.  */
+# if ! @HAVE_FCHDIR@
+_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
 
 /* Gnulib internal hooks needed to maintain the fchdir metadata.  */
-extern int _gl_register_fd (int fd, const char *filename)
+_GL_EXTERN_C int _gl_register_fd (int fd, const char *filename)
      _GL_ARG_NONNULL ((2));
-extern void _gl_unregister_fd (int fd);
-extern int _gl_register_dup (int oldfd, int newfd);
-extern const char *_gl_directory_name (int fd);
+_GL_EXTERN_C void _gl_unregister_fd (int fd);
+_GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd);
+_GL_EXTERN_C const char *_gl_directory_name (int fd);
 
+# else
+#  if !@HAVE_DECL_FCHDIR@
+_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
+#  endif
 # endif
+_GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/));
+_GL_CXXALIASWARN (fchdir);
 #elif defined GNULIB_POSIXCHECK
 # undef fchdir
-# define fchdir(f) \
-    (GL_LINK_WARNING ("fchdir is unportable - " \
-                      "use gnulib module fchdir for portability"), \
-     fchdir (f))
+# if HAVE_RAW_DECL_FCHDIR
+_GL_WARN_ON_USE (fchdir, "fchdir is unportable - "
+                 "use gnulib module fchdir for portability");
+# endif
 #endif
 
 
 #if @GNULIB_FCHOWNAT@
 # if @REPLACE_FCHOWNAT@
-#  undef fchownat
-#  define fchownat rpl_fchownat
-# endif
-# if !@HAVE_FCHOWNAT@ || @REPLACE_FCHOWNAT@
-extern int fchownat (int fd, char const *file, uid_t owner, gid_t group, int flag)
-     _GL_ARG_NONNULL ((2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fchownat
+#   define fchownat rpl_fchownat
+#  endif
+_GL_FUNCDECL_RPL (fchownat, int, (int fd, char const *file,
+                                  uid_t owner, gid_t group, int flag)
+                                 _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fchownat, int, (int fd, char const *file,
+                                  uid_t owner, gid_t group, int flag));
+# else
+#  if !@HAVE_FCHOWNAT@
+_GL_FUNCDECL_SYS (fchownat, int, (int fd, char const *file,
+                                  uid_t owner, gid_t group, int flag)
+                                 _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (fchownat, int, (int fd, char const *file,
+                                  uid_t owner, gid_t group, int flag));
 # endif
+_GL_CXXALIASWARN (fchownat);
 #elif defined GNULIB_POSIXCHECK
 # undef fchownat
-# define fchownat(d,n,o,g,f)                        \
-    (GL_LINK_WARNING ("fchownat is not portable - " \
-                      "use gnulib module openat for portability"), \
-     fchownat (d, n, o, g, f))
+# if HAVE_RAW_DECL_FCHOWNAT
+_GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
 
-#if @GNULIB_FSYNC@
+#if @GNULIB_FDATASYNC@
 /* Synchronize changes to a file.
    Return 0 if successful, otherwise -1 and errno set.
-   See POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/fsync.html>.  */
+   See POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>.  */
+# if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@
+_GL_FUNCDECL_SYS (fdatasync, int, (int fd));
+# endif
+_GL_CXXALIAS_SYS (fdatasync, int, (int fd));
+_GL_CXXALIASWARN (fdatasync);
+#elif defined GNULIB_POSIXCHECK
+# undef fdatasync
+# if HAVE_RAW_DECL_FDATASYNC
+_GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
+                 "use gnulib module fdatasync for portability");
+# endif
+#endif
+
+
+#if @GNULIB_FSYNC@
+/* Synchronize changes, including metadata, to a file.
+   Return 0 if successful, otherwise -1 and errno set.
+   See POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>.  */
 # if !@HAVE_FSYNC@
-extern int fsync (int fd);
+_GL_FUNCDECL_SYS (fsync, int, (int fd));
 # endif
+_GL_CXXALIAS_SYS (fsync, int, (int fd));
+_GL_CXXALIASWARN (fsync);
 #elif defined GNULIB_POSIXCHECK
 # undef fsync
-# define fsync(fd) \
-    (GL_LINK_WARNING ("fsync is unportable - " \
-                      "use gnulib module fsync for portability"), \
-     fsync (fd))
+# if HAVE_RAW_DECL_FSYNC
+_GL_WARN_ON_USE (fsync, "fsync is unportable - "
+                 "use gnulib module fsync for portability");
+# endif
 #endif
 
 
 #if @GNULIB_FTRUNCATE@
-# if !@HAVE_FTRUNCATE@
 /* Change the size of the file to which FD is opened to become equal to LENGTH.
    Return 0 if successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/ftruncate.html>.  */
-extern int ftruncate (int fd, off_t length);
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>.  */
+# if @REPLACE_FTRUNCATE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ftruncate
+#   define ftruncate rpl_ftruncate
+#  endif
+_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
+_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
+# else
+#  if !@HAVE_FTRUNCATE@
+_GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
+#  endif
+_GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
 # endif
+_GL_CXXALIASWARN (ftruncate);
 #elif defined GNULIB_POSIXCHECK
 # undef ftruncate
-# define ftruncate(f,l) \
-    (GL_LINK_WARNING ("ftruncate is unportable - " \
-                      "use gnulib module ftruncate for portability"), \
-     ftruncate (f, l))
+# if HAVE_RAW_DECL_FTRUNCATE
+_GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
+                 "use gnulib module ftruncate for portability");
+# endif
 #endif
 
 
 #if @GNULIB_GETCWD@
-# if @REPLACE_GETCWD@
 /* Get the name of the current working directory, and put it in SIZE bytes
    of BUF.
    Return BUF if successful, or NULL if the directory couldn't be determined
    or SIZE was too small.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/getcwd.html>.
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
    Additionally, the gnulib module 'getcwd' guarantees the following GNU
    extension: If BUF is NULL, an array is allocated with 'malloc'; the array
    is SIZE bytes long, unless SIZE == 0, in which case it is as big as
    necessary.  */
-#  define getcwd rpl_getcwd
-extern char * getcwd (char *buf, size_t size);
+# if @REPLACE_GETCWD@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define getcwd rpl_getcwd
+#  endif
+_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
+_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
+# else
+/* Need to cast, because on mingw, the second parameter is
+                                                   int size.  */
+_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
 # endif
+_GL_CXXALIASWARN (getcwd);
 #elif defined GNULIB_POSIXCHECK
 # undef getcwd
-# define getcwd(b,s) \
-    (GL_LINK_WARNING ("getcwd is unportable - " \
-                      "use gnulib module getcwd for portability"), \
-     getcwd (b, s))
+# if HAVE_RAW_DECL_GETCWD
+_GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
+                 "use gnulib module getcwd for portability");
+# endif
 #endif
 
 
@@ -410,52 +629,74 @@ extern char * getcwd (char *buf, size_t size);
    Null terminate it if the name is shorter than LEN.
    If the NIS domain name is longer than LEN, set errno = EINVAL and return -1.
    Return 0 if successful, otherwise set errno and return -1.  */
-# if !@HAVE_GETDOMAINNAME@
-extern int getdomainname(char *name, size_t len) _GL_ARG_NONNULL ((1));
+# if @REPLACE_GETDOMAINNAME@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getdomainname
+#   define getdomainname rpl_getdomainname
+#  endif
+_GL_FUNCDECL_RPL (getdomainname, int, (char *name, size_t len)
+                                      _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getdomainname, int, (char *name, size_t len));
+# else
+#  if !@HAVE_DECL_GETDOMAINNAME@
+_GL_FUNCDECL_SYS (getdomainname, int, (char *name, size_t len)
+                                      _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (getdomainname, int, (char *name, size_t len));
 # endif
+_GL_CXXALIASWARN (getdomainname);
 #elif defined GNULIB_POSIXCHECK
 # undef getdomainname
-# define getdomainname(n,l) \
-    (GL_LINK_WARNING ("getdomainname is unportable - " \
-                      "use gnulib module getdomainname for portability"), \
-     getdomainname (n, l))
+# if HAVE_RAW_DECL_GETDOMAINNAME
+_GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
+                 "use gnulib module getdomainname for portability");
+# endif
 #endif
 
 
 #if @GNULIB_GETDTABLESIZE@
-# if !@HAVE_GETDTABLESIZE@
 /* Return the maximum number of file descriptors in the current process.
    In POSIX, this is same as sysconf (_SC_OPEN_MAX).  */
-extern int getdtablesize (void);
+# if !@HAVE_GETDTABLESIZE@
+_GL_FUNCDECL_SYS (getdtablesize, int, (void));
 # endif
+_GL_CXXALIAS_SYS (getdtablesize, int, (void));
+_GL_CXXALIASWARN (getdtablesize);
 #elif defined GNULIB_POSIXCHECK
 # undef getdtablesize
-# define getdtablesize() \
-    (GL_LINK_WARNING ("getdtablesize is unportable - " \
-                      "use gnulib module getdtablesize for portability"), \
-     getdtablesize ())
+# if HAVE_RAW_DECL_GETDTABLESIZE
+_GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
+                 "use gnulib module getdtablesize for portability");
+# endif
 #endif
 
 
 #if @GNULIB_GETGROUPS@
-# if @REPLACE_GETGROUPS@
-#  undef getgroups
-#  define getgroups rpl_getgroups
-# endif
-# if !@HAVE_GETGROUPS@ || @REPLACE_GETGROUPS@
 /* Return the supplemental groups that the current process belongs to.
    It is unspecified whether the effective group id is in the list.
    If N is 0, return the group count; otherwise, N describes how many
    entries are available in GROUPS.  Return -1 and set errno if N is
    not 0 and not large enough.  Fails with ENOSYS on some systems.  */
-int getgroups (int n, gid_t *groups);
+# if @REPLACE_GETGROUPS@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getgroups
+#   define getgroups rpl_getgroups
+#  endif
+_GL_FUNCDECL_RPL (getgroups, int, (int n, gid_t *groups));
+_GL_CXXALIAS_RPL (getgroups, int, (int n, gid_t *groups));
+# else
+#  if !@HAVE_GETGROUPS@
+_GL_FUNCDECL_SYS (getgroups, int, (int n, gid_t *groups));
+#  endif
+_GL_CXXALIAS_SYS (getgroups, int, (int n, gid_t *groups));
 # endif
+_GL_CXXALIASWARN (getgroups);
 #elif defined GNULIB_POSIXCHECK
 # undef getgroups
-# define getgroups(n,g)                                                 \
-    (GL_LINK_WARNING ("getgroups is unportable - "                      \
-                      "use gnulib module getgroups for portability"),   \
-     getgroups (n, g))
+# if HAVE_RAW_DECL_GETGROUPS
+_GL_WARN_ON_USE (getgroups, "getgroups is unportable - "
+                 "use gnulib module getgroups for portability");
+# endif
 #endif
 
 
@@ -468,21 +709,33 @@ int getgroups (int n, gid_t *groups);
    If the host name is longer than LEN, set errno = EINVAL and return -1.
    Return 0 if successful, otherwise set errno and return -1.  */
 # if @UNISTD_H_HAVE_WINSOCK2_H@
-#  undef gethostname
-#  define gethostname rpl_gethostname
-# endif
-# if @UNISTD_H_HAVE_WINSOCK2_H@ || !@HAVE_GETHOSTNAME@
-extern int gethostname(char *name, size_t len) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef gethostname
+#   define gethostname rpl_gethostname
+#  endif
+_GL_FUNCDECL_RPL (gethostname, int, (char *name, size_t len)
+                                    _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len));
+# else
+#  if !@HAVE_GETHOSTNAME@
+_GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len)
+                                    _GL_ARG_NONNULL ((1)));
+#  endif
+/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second
+   parameter is
+                                                      int len.  */
+_GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len));
 # endif
+_GL_CXXALIASWARN (gethostname);
 #elif @UNISTD_H_HAVE_WINSOCK2_H@
 # undef gethostname
 # define gethostname gethostname_used_without_requesting_gnulib_module_gethostname
 #elif defined GNULIB_POSIXCHECK
 # undef gethostname
-# define gethostname(n,l) \
-    (GL_LINK_WARNING ("gethostname is unportable - " \
-                      "use gnulib module gethostname for portability"), \
-     gethostname (n, l))
+# if HAVE_RAW_DECL_GETHOSTNAME
+_GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
+                 "use gnulib module gethostname for portability");
+# endif
 #endif
 
 
@@ -498,14 +751,16 @@ extern int gethostname(char *name, size_t len) _GL_ARG_NONNULL ((1));
      $USERNAME               on native Windows platforms.
  */
 # if !@HAVE_GETLOGIN@
-extern char *getlogin (void);
+_GL_FUNCDECL_SYS (getlogin, char *, (void));
 # endif
+_GL_CXXALIAS_SYS (getlogin, char *, (void));
+_GL_CXXALIASWARN (getlogin);
 #elif defined GNULIB_POSIXCHECK
 # undef getlogin
-# define getlogin() \
-    (GL_LINK_WARNING ("getlogin is unportable - " \
-                      "use gnulib module getlogin for portability"), \
-     getlogin ())
+# if HAVE_RAW_DECL_GETLOGIN
+_GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
+                 "use gnulib module getlogin for portability");
+# endif
 #endif
 
 
@@ -524,185 +779,335 @@ extern char *getlogin (void);
      ${LOGNAME-$USER}        on Unix platforms,
      $USERNAME               on native Windows platforms.
  */
-# if !@HAVE_DECL_GETLOGIN_R@
-extern int getlogin_r (char *name, size_t size) _GL_ARG_NONNULL ((1));
+# if @REPLACE_GETLOGIN_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define getlogin_r rpl_getlogin_r
+#  endif
+_GL_FUNCDECL_RPL (getlogin_r, int, (char *name, size_t size)
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getlogin_r, int, (char *name, size_t size));
+# else
+#  if !@HAVE_DECL_GETLOGIN_R@
+_GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size)
+                                   _GL_ARG_NONNULL ((1)));
+#  endif
+/* Need to cast, because on Solaris 10 systems, the second argument is
+                                                     int size.  */
+_GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size));
 # endif
+_GL_CXXALIASWARN (getlogin_r);
 #elif defined GNULIB_POSIXCHECK
 # undef getlogin_r
-# define getlogin_r(n,s) \
-    (GL_LINK_WARNING ("getlogin_r is unportable - " \
-                      "use gnulib module getlogin_r for portability"), \
-     getlogin_r (n, s))
+# if HAVE_RAW_DECL_GETLOGIN_R
+_GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
+                 "use gnulib module getlogin_r for portability");
+# endif
 #endif
 
 
 #if @GNULIB_GETPAGESIZE@
 # if @REPLACE_GETPAGESIZE@
-#  define getpagesize rpl_getpagesize
-extern int getpagesize (void);
-# elif !@HAVE_GETPAGESIZE@
-/* This is for POSIX systems.  */
-#  if !defined getpagesize && defined _SC_PAGESIZE
-#   if ! (defined __VMS && __VMS_VER < 70000000)
-#    define getpagesize() sysconf (_SC_PAGESIZE)
-#   endif
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define getpagesize rpl_getpagesize
 #  endif
+_GL_FUNCDECL_RPL (getpagesize, int, (void));
+_GL_CXXALIAS_RPL (getpagesize, int, (void));
+# else
+#  if !@HAVE_GETPAGESIZE@
+#   if !defined getpagesize
+/* This is for POSIX systems.  */
+#    if !defined _gl_getpagesize && defined _SC_PAGESIZE
+#     if ! (defined __VMS && __VMS_VER < 70000000)
+#      define _gl_getpagesize() sysconf (_SC_PAGESIZE)
+#     endif
+#    endif
 /* This is for older VMS.  */
-#  if !defined getpagesize && defined __VMS
-#   ifdef __ALPHA
-#    define getpagesize() 8192
-#   else
-#    define getpagesize() 512
-#   endif
-#  endif
+#    if !defined _gl_getpagesize && defined __VMS
+#     ifdef __ALPHA
+#      define _gl_getpagesize() 8192
+#     else
+#      define _gl_getpagesize() 512
+#     endif
+#    endif
 /* This is for BeOS.  */
-#  if !defined getpagesize && @HAVE_OS_H@
-#   include <OS.h>
-#   if defined B_PAGE_SIZE
-#    define getpagesize() B_PAGE_SIZE
-#   endif
-#  endif
+#    if !defined _gl_getpagesize && @HAVE_OS_H@
+#     include <OS.h>
+#     if defined B_PAGE_SIZE
+#      define _gl_getpagesize() B_PAGE_SIZE
+#     endif
+#    endif
 /* This is for AmigaOS4.0.  */
-#  if !defined getpagesize && defined __amigaos4__
-#   define getpagesize() 2048
-#  endif
+#    if !defined _gl_getpagesize && defined __amigaos4__
+#     define _gl_getpagesize() 2048
+#    endif
 /* This is for older Unix systems.  */
-#  if !defined getpagesize && @HAVE_SYS_PARAM_H@
-#   include <sys/param.h>
-#   ifdef EXEC_PAGESIZE
-#    define getpagesize() EXEC_PAGESIZE
-#   else
-#    ifdef NBPG
-#     ifndef CLSIZE
-#      define CLSIZE 1
+#    if !defined _gl_getpagesize && @HAVE_SYS_PARAM_H@
+#     include <sys/param.h>
+#     ifdef EXEC_PAGESIZE
+#      define _gl_getpagesize() EXEC_PAGESIZE
+#     else
+#      ifdef NBPG
+#       ifndef CLSIZE
+#        define CLSIZE 1
+#       endif
+#       define _gl_getpagesize() (NBPG * CLSIZE)
+#      else
+#       ifdef NBPC
+#        define _gl_getpagesize() NBPC
+#       endif
+#      endif
 #     endif
-#     define getpagesize() (NBPG * CLSIZE)
+#    endif
+#    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#     define getpagesize() _gl_getpagesize ()
 #    else
-#     ifdef NBPC
-#      define getpagesize() NBPC
+#     if !GNULIB_defined_getpagesize_function
+static inline int
+getpagesize ()
+{
+  return _gl_getpagesize ();
+}
+#      define GNULIB_defined_getpagesize_function 1
 #     endif
 #    endif
 #   endif
 #  endif
+/* Need to cast, because on Cygwin 1.5.x systems, the return type is size_t.  */
+_GL_CXXALIAS_SYS_CAST (getpagesize, int, (void));
+# endif
+# if @HAVE_DECL_GETPAGESIZE@
+_GL_CXXALIASWARN (getpagesize);
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef getpagesize
-# define getpagesize() \
-    (GL_LINK_WARNING ("getpagesize is unportable - " \
-                      "use gnulib module getpagesize for portability"), \
-     getpagesize ())
+# if HAVE_RAW_DECL_GETPAGESIZE
+_GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
+                 "use gnulib module getpagesize for portability");
+# endif
 #endif
 
 
 #if @GNULIB_GETUSERSHELL@
-# if !@HAVE_GETUSERSHELL@
 /* Return the next valid login shell on the system, or NULL when the end of
    the list has been reached.  */
-extern char *getusershell (void);
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (getusershell, char *, (void));
+# endif
+_GL_CXXALIAS_SYS (getusershell, char *, (void));
+_GL_CXXALIASWARN (getusershell);
+#elif defined GNULIB_POSIXCHECK
+# undef getusershell
+# if HAVE_RAW_DECL_GETUSERSHELL
+_GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
+                 "use gnulib module getusershell for portability");
+# endif
+#endif
+
+#if @GNULIB_GETUSERSHELL@
 /* Rewind to pointer that is advanced at each getusershell() call.  */
-extern void setusershell (void);
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (setusershell, void, (void));
+# endif
+_GL_CXXALIAS_SYS (setusershell, void, (void));
+_GL_CXXALIASWARN (setusershell);
+#elif defined GNULIB_POSIXCHECK
+# undef setusershell
+# if HAVE_RAW_DECL_SETUSERSHELL
+_GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
+                 "use gnulib module getusershell for portability");
+# endif
+#endif
+
+#if @GNULIB_GETUSERSHELL@
 /* Free the pointer that is advanced at each getusershell() call and
    associated resources.  */
-extern void endusershell (void);
+# if !@HAVE_DECL_GETUSERSHELL@
+_GL_FUNCDECL_SYS (endusershell, void, (void));
 # endif
+_GL_CXXALIAS_SYS (endusershell, void, (void));
+_GL_CXXALIASWARN (endusershell);
 #elif defined GNULIB_POSIXCHECK
-# undef getusershell
-# define getusershell() \
-    (GL_LINK_WARNING ("getusershell is unportable - " \
-                      "use gnulib module getusershell for portability"), \
-     getusershell ())
-# undef setusershell
-# define setusershell() \
-    (GL_LINK_WARNING ("setusershell is unportable - " \
-                      "use gnulib module getusershell for portability"), \
-     setusershell ())
 # undef endusershell
-# define endusershell() \
-    (GL_LINK_WARNING ("endusershell is unportable - " \
-                      "use gnulib module getusershell for portability"), \
-     endusershell ())
+# if HAVE_RAW_DECL_ENDUSERSHELL
+_GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
+                 "use gnulib module getusershell for portability");
+# endif
 #endif
 
 
-#if @GNULIB_LCHOWN@
-# if @REPLACE_LCHOWN@
-#  undef lchown
-#  define lchown rpl_lchown
+#if @GNULIB_GROUP_MEMBER@
+/* Determine whether group id is in calling user's group list.  */
+# if !@HAVE_GROUP_MEMBER@
+_GL_FUNCDECL_SYS (group_member, int, (gid_t gid));
 # endif
-# if !@HAVE_LCHOWN@ || @REPLACE_LCHOWN@
+_GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
+_GL_CXXALIASWARN (group_member);
+#elif defined GNULIB_POSIXCHECK
+# undef group_member
+# if HAVE_RAW_DECL_GROUP_MEMBER
+_GL_WARN_ON_USE (group_member, "group_member is unportable - "
+                 "use gnulib module group-member for portability");
+# endif
+#endif
+
+
+#if @GNULIB_ISATTY@
+# if @REPLACE_ISATTY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef isatty
+#   define isatty rpl_isatty
+#  endif
+_GL_FUNCDECL_RPL (isatty, int, (int fd));
+_GL_CXXALIAS_RPL (isatty, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (isatty, int, (int fd));
+# endif
+_GL_CXXALIASWARN (isatty);
+#elif defined GNULIB_POSIXCHECK
+# undef isatty
+# if HAVE_RAW_DECL_ISATTY
+_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
+                 "use gnulib module isatty for portability");
+# endif
+#endif
+
+
+#if @GNULIB_LCHOWN@
 /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
    to GID (if GID is not -1).  Do not follow symbolic links.
    Return 0 if successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/lchown.html>.  */
-extern int lchown (char const *file, uid_t owner, gid_t group)
-     _GL_ARG_NONNULL ((1));
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>.  */
+# if @REPLACE_LCHOWN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef lchown
+#   define lchown rpl_lchown
+#  endif
+_GL_FUNCDECL_RPL (lchown, int, (char const *file, uid_t owner, gid_t group)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (lchown, int, (char const *file, uid_t owner, gid_t group));
+# else
+#  if !@HAVE_LCHOWN@
+_GL_FUNCDECL_SYS (lchown, int, (char const *file, uid_t owner, gid_t group)
+                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (lchown, int, (char const *file, uid_t owner, gid_t group));
 # endif
+_GL_CXXALIASWARN (lchown);
 #elif defined GNULIB_POSIXCHECK
 # undef lchown
-# define lchown(f,u,g) \
-    (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \
-                      "systems - use gnulib module lchown for portability"), \
-     lchown (f, u, g))
+# if HAVE_RAW_DECL_LCHOWN
+_GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
+                 "use gnulib module lchown for portability");
+# endif
 #endif
 
 
 #if @GNULIB_LINK@
-# if @REPLACE_LINK@
-#  define link rpl_link
-# endif
 /* Create a new hard link for an existing file.
    Return 0 if successful, otherwise -1 and errno set.
-   See POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/link.html>.  */
-# if !@HAVE_LINK@ || @REPLACE_LINK@
-extern int link (const char *path1, const char *path2)
-     _GL_ARG_NONNULL ((1, 2));
+   See POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>.  */
+# if @REPLACE_LINK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define link rpl_link
+#  endif
+_GL_FUNCDECL_RPL (link, int, (const char *path1, const char *path2)
+                             _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (link, int, (const char *path1, const char *path2));
+# else
+#  if !@HAVE_LINK@
+_GL_FUNCDECL_SYS (link, int, (const char *path1, const char *path2)
+                             _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (link, int, (const char *path1, const char *path2));
 # endif
+_GL_CXXALIASWARN (link);
 #elif defined GNULIB_POSIXCHECK
 # undef link
-# define link(path1,path2) \
-    (GL_LINK_WARNING ("link is unportable - " \
-                      "use gnulib module link for portability"), \
-     link (path1, path2))
+# if HAVE_RAW_DECL_LINK
+_GL_WARN_ON_USE (link, "link is unportable - "
+                 "use gnulib module link for portability");
+# endif
 #endif
 
+
 #if @GNULIB_LINKAT@
-# if @REPLACE_LINKAT@
-#  undef linkat
-#  define linkat rpl_linkat
-# endif
 /* Create a new hard link for an existing file, relative to two
    directories.  FLAG controls whether symlinks are followed.
    Return 0 if successful, otherwise -1 and errno set.  */
-# if !@HAVE_LINKAT@ || @REPLACE_LINKAT@
-extern int linkat (int fd1, const char *path1, int fd2, const char *path2,
+# if @REPLACE_LINKAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef linkat
+#   define linkat rpl_linkat
+#  endif
+_GL_FUNCDECL_RPL (linkat, int,
+                  (int fd1, const char *path1, int fd2, const char *path2,
+                   int flag)
+                  _GL_ARG_NONNULL ((2, 4)));
+_GL_CXXALIAS_RPL (linkat, int,
+                  (int fd1, const char *path1, int fd2, const char *path2,
+                   int flag));
+# else
+#  if !@HAVE_LINKAT@
+_GL_FUNCDECL_SYS (linkat, int,
+                  (int fd1, const char *path1, int fd2, const char *path2,
                    int flag)
-     _GL_ARG_NONNULL ((2, 4));
+                  _GL_ARG_NONNULL ((2, 4)));
+#  endif
+_GL_CXXALIAS_SYS (linkat, int,
+                  (int fd1, const char *path1, int fd2, const char *path2,
+                   int flag));
 # endif
+_GL_CXXALIASWARN (linkat);
 #elif defined GNULIB_POSIXCHECK
 # undef linkat
-# define linkat(f1,path1,f2,path2,f)              \
-    (GL_LINK_WARNING ("linkat is unportable - " \
-                      "use gnulib module linkat for portability"), \
-     linkat (f1, path1, f2, path2,f))
+# if HAVE_RAW_DECL_LINKAT
+_GL_WARN_ON_USE (linkat, "linkat is unportable - "
+                 "use gnulib module linkat for portability");
+# endif
 #endif
 
+
 #if @GNULIB_LSEEK@
-# if @REPLACE_LSEEK@
 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
    Return the new offset if successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/lseek.html>.  */
-#  define lseek rpl_lseek
-   extern off_t lseek (int fd, off_t offset, int whence);
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>.  */
+# if @REPLACE_LSEEK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define lseek rpl_lseek
+#  endif
+_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
+_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
+# else
+_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
 # endif
+_GL_CXXALIASWARN (lseek);
 #elif defined GNULIB_POSIXCHECK
 # undef lseek
-# define lseek(f,o,w) \
-    (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \
-                      "systems - use gnulib module lseek for portability"), \
-     lseek (f, o, w))
+# if HAVE_RAW_DECL_LSEEK
+_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
+                 "systems - use gnulib module lseek for portability");
+# endif
+#endif
+
+
+#if @GNULIB_PIPE@
+/* Create a pipe, defaulting to O_BINARY mode.
+   Store the read-end as fd[0] and the write-end as fd[1].
+   Return 0 upon success, or -1 with errno set upon failure.  */
+# if !@HAVE_PIPE@
+_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (pipe, int, (int fd[2]));
+_GL_CXXALIASWARN (pipe);
+#elif defined GNULIB_POSIXCHECK
+# undef pipe
+# if HAVE_RAW_DECL_PIPE
+_GL_WARN_ON_USE (pipe, "pipe is unportable - "
+                 "use gnulib module pipe-posix for portability");
+# endif
 #endif
 
 
@@ -716,211 +1121,415 @@ extern int linkat (int fd1, const char *path1, int fd2, const char *path2,
    See also the Linux man page at
    <http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>.  */
 # if @HAVE_PIPE2@
-#  define pipe2 rpl_pipe2
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define pipe2 rpl_pipe2
+#  endif
+_GL_FUNCDECL_RPL (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pipe2, int, (int fd[2], int flags));
+# else
+_GL_FUNCDECL_SYS (pipe2, int, (int fd[2], int flags) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_SYS (pipe2, int, (int fd[2], int flags));
 # endif
-extern int pipe2 (int fd[2], int flags) _GL_ARG_NONNULL ((1));
+_GL_CXXALIASWARN (pipe2);
 #elif defined GNULIB_POSIXCHECK
 # undef pipe2
-# define pipe2(f,o) \
-    (GL_LINK_WARNING ("pipe2 is unportable - " \
-                      "use gnulib module pipe2 for portability"), \
-     pipe2 (f, o))
+# if HAVE_RAW_DECL_PIPE2
+_GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
+                 "use gnulib module pipe2 for portability");
+# endif
 #endif
 
 
 #if @GNULIB_PREAD@
-# if @REPLACE_PREAD@
-#  define pread rpl_pread
-# endif
 /* Read at most BUFSIZE bytes from FD into BUF, starting at OFFSET.
    Return the number of bytes placed into BUF if successful, otherwise
-   set errno and return -1.  0 indicates EOF.  See the POSIX:2001
-   specification <http://www.opengroup.org/susv3xsh/pread.html>.  */
-# if !@HAVE_PREAD@ || @REPLACE_PREAD@
-  extern ssize_t pread (int fd, void *buf, size_t bufsize, off_t offset)
-       _GL_ARG_NONNULL ((2));
+   set errno and return -1.  0 indicates EOF.
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>.  */
+# if @REPLACE_PREAD@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pread
+#   define pread rpl_pread
+#  endif
+_GL_FUNCDECL_RPL (pread, ssize_t,
+                  (int fd, void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pread, ssize_t,
+                  (int fd, void *buf, size_t bufsize, off_t offset));
+# else
+#  if !@HAVE_PREAD@
+_GL_FUNCDECL_SYS (pread, ssize_t,
+                  (int fd, void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (pread, ssize_t,
+                  (int fd, void *buf, size_t bufsize, off_t offset));
 # endif
+_GL_CXXALIASWARN (pread);
 #elif defined GNULIB_POSIXCHECK
 # undef pread
-# define pread(f,b,s,o)                        \
-    (GL_LINK_WARNING ("pread is unportable - " \
-                      "use gnulib module pread for portability"), \
-     pread (f, b, s, o))
+# if HAVE_RAW_DECL_PREAD
+_GL_WARN_ON_USE (pread, "pread is unportable - "
+                 "use gnulib module pread for portability");
+# endif
 #endif
 
 
-#if @GNULIB_READLINK@
-# if @REPLACE_READLINK@
-#  define readlink rpl_readlink
+#if @GNULIB_PWRITE@
+/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
+   Return the number of bytes written if successful, otherwise
+   set errno and return -1.  0 indicates nothing written.  See the
+   POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>.  */
+# if @REPLACE_PWRITE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pwrite
+#   define pwrite rpl_pwrite
+#  endif
+_GL_FUNCDECL_RPL (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset));
+# else
+#  if !@HAVE_PWRITE@
+_GL_FUNCDECL_SYS (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (pwrite, ssize_t,
+                  (int fd, const void *buf, size_t bufsize, off_t offset));
+# endif
+_GL_CXXALIASWARN (pwrite);
+#elif defined GNULIB_POSIXCHECK
+# undef pwrite
+# if HAVE_RAW_DECL_PWRITE
+_GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
+                 "use gnulib module pwrite for portability");
 # endif
+#endif
+
+
+#if @GNULIB_READ@
+/* Read up to COUNT bytes from file descriptor FD into the buffer starting
+   at BUF.  See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>.  */
+# if @REPLACE_READ@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef read
+#   define read rpl_read
+#  endif
+_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
+                                 _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
+# else
+/* Need to cast, because on mingw, the third parameter is
+                                                          unsigned int count
+   and the return type is 'int'.  */
+_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (read);
+#endif
+
+
+#if @GNULIB_READLINK@
 /* Read the contents of the symbolic link FILE and place the first BUFSIZE
    bytes of it into BUF.  Return the number of bytes placed into BUF if
    successful, otherwise -1 and errno set.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/readlink.html>.  */
-# if !@HAVE_READLINK@ || @REPLACE_READLINK@
-extern ssize_t readlink (const char *file, char *buf, size_t bufsize)
-     _GL_ARG_NONNULL ((1, 2));
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>.  */
+# if @REPLACE_READLINK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define readlink rpl_readlink
+#  endif
+_GL_FUNCDECL_RPL (readlink, ssize_t,
+                  (const char *file, char *buf, size_t bufsize)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (readlink, ssize_t,
+                  (const char *file, char *buf, size_t bufsize));
+# else
+#  if !@HAVE_READLINK@
+_GL_FUNCDECL_SYS (readlink, ssize_t,
+                  (const char *file, char *buf, size_t bufsize)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (readlink, ssize_t,
+                  (const char *file, char *buf, size_t bufsize));
 # endif
+_GL_CXXALIASWARN (readlink);
 #elif defined GNULIB_POSIXCHECK
 # undef readlink
-# define readlink(f,b,s) \
-    (GL_LINK_WARNING ("readlink is unportable - " \
-                      "use gnulib module readlink for portability"), \
-     readlink (f, b, s))
+# if HAVE_RAW_DECL_READLINK
+_GL_WARN_ON_USE (readlink, "readlink is unportable - "
+                 "use gnulib module readlink for portability");
+# endif
 #endif
 
 
 #if @GNULIB_READLINKAT@
 # if !@HAVE_READLINKAT@
-extern ssize_t readlinkat (int fd, char const *file, char *buf, size_t len)
-     _GL_ARG_NONNULL ((2, 3));
+_GL_FUNCDECL_SYS (readlinkat, ssize_t,
+                  (int fd, char const *file, char *buf, size_t len)
+                  _GL_ARG_NONNULL ((2, 3)));
 # endif
+_GL_CXXALIAS_SYS (readlinkat, ssize_t,
+                  (int fd, char const *file, char *buf, size_t len));
+_GL_CXXALIASWARN (readlinkat);
 #elif defined GNULIB_POSIXCHECK
 # undef readlinkat
-# define readlinkat(d,n,b,l)                         \
-    (GL_LINK_WARNING ("readlinkat is not portable - " \
-                      "use gnulib module symlinkat for portability"), \
-     readlinkat (d, n, b, l))
+# if HAVE_RAW_DECL_READLINKAT
+_GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
+                 "use gnulib module readlinkat for portability");
+# endif
 #endif
 
 
 #if @GNULIB_RMDIR@
-# if @REPLACE_RMDIR@
-#  define rmdir rpl_rmdir
 /* Remove the directory DIR.  */
-extern int rmdir (char const *name) _GL_ARG_NONNULL ((1));
+# if @REPLACE_RMDIR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define rmdir rpl_rmdir
+#  endif
+_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (rmdir, int, (char const *name));
+# else
+_GL_CXXALIAS_SYS (rmdir, int, (char const *name));
 # endif
+_GL_CXXALIASWARN (rmdir);
 #elif defined GNULIB_POSIXCHECK
 # undef rmdir
-# define rmdir(n) \
-    (GL_LINK_WARNING ("rmdir is unportable - " \
-                      "use gnulib module rmdir for portability"), \
-     rmdir (n))
+# if HAVE_RAW_DECL_RMDIR
+_GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
+                 "use gnulib module rmdir for portability");
+# endif
 #endif
 
 
-#if @GNULIB_SLEEP@
-# if @REPLACE_SLEEP@
-#  undef sleep
-#  define sleep rpl_sleep
+#if @GNULIB_SETHOSTNAME@
+/* Set the host name of the machine.
+   The host name may or may not be fully qualified.
+
+   Put LEN bytes of NAME into the host name.
+   Return 0 if successful, otherwise, set errno and return -1.
+
+   Platforms with no ability to set the hostname return -1 and set
+   errno = ENOSYS.  */
+# if !@HAVE_SETHOSTNAME@ || !@HAVE_DECL_SETHOSTNAME@
+_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
+                                    _GL_ARG_NONNULL ((1)));
 # endif
+/* Need to cast, because on Solaris 11 2011-10, MacOS X 10.5, IRIX 6.5
+   and FreeBSD 6.4 the second parameter is int.  On Solaris 11
+   2011-10, the first parameter is not const.  */
+_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
+_GL_CXXALIASWARN (sethostname);
+#elif defined GNULIB_POSIXCHECK
+# undef sethostname
+# if HAVE_RAW_DECL_SETHOSTNAME
+_GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
+                 "use gnulib module sethostname for portability");
+# endif
+#endif
+
+
+#if @GNULIB_SLEEP@
 /* Pause the execution of the current thread for N seconds.
    Returns the number of seconds left to sleep.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/sleep.html>.  */
-# if !@HAVE_SLEEP@ || @REPLACE_SLEEP@
-extern unsigned int sleep (unsigned int n);
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>.  */
+# if @REPLACE_SLEEP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef sleep
+#   define sleep rpl_sleep
+#  endif
+_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
+_GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
+# else
+#  if !@HAVE_SLEEP@
+_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
+#  endif
+_GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
 # endif
+_GL_CXXALIASWARN (sleep);
 #elif defined GNULIB_POSIXCHECK
 # undef sleep
-# define sleep(n) \
-    (GL_LINK_WARNING ("sleep is unportable - " \
-                      "use gnulib module sleep for portability"), \
-     sleep (n))
+# if HAVE_RAW_DECL_SLEEP
+_GL_WARN_ON_USE (sleep, "sleep is unportable - "
+                 "use gnulib module sleep for portability");
+# endif
 #endif
 
 
 #if @GNULIB_SYMLINK@
 # if @REPLACE_SYMLINK@
-#  undef symlink
-#  define symlink rpl_symlink
-# endif
-# if !@HAVE_SYMLINK@ || @REPLACE_SYMLINK@
-extern int symlink (char const *contents, char const *file)
-     _GL_ARG_NONNULL ((1, 2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef symlink
+#   define symlink rpl_symlink
+#  endif
+_GL_FUNCDECL_RPL (symlink, int, (char const *contents, char const *file)
+                                _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (symlink, int, (char const *contents, char const *file));
+# else
+#  if !@HAVE_SYMLINK@
+_GL_FUNCDECL_SYS (symlink, int, (char const *contents, char const *file)
+                                _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (symlink, int, (char const *contents, char const *file));
 # endif
+_GL_CXXALIASWARN (symlink);
 #elif defined GNULIB_POSIXCHECK
 # undef symlink
-# define symlink(c,n)                        \
-    (GL_LINK_WARNING ("symlink is not portable - " \
-                      "use gnulib module symlink for portability"), \
-     symlink (c, n))
+# if HAVE_RAW_DECL_SYMLINK
+_GL_WARN_ON_USE (symlink, "symlink is not portable - "
+                 "use gnulib module symlink for portability");
+# endif
 #endif
 
 
 #if @GNULIB_SYMLINKAT@
 # if !@HAVE_SYMLINKAT@
-extern int symlinkat (char const *contents, int fd, char const *file)
-     _GL_ARG_NONNULL ((1, 3));
+_GL_FUNCDECL_SYS (symlinkat, int,
+                  (char const *contents, int fd, char const *file)
+                  _GL_ARG_NONNULL ((1, 3)));
 # endif
+_GL_CXXALIAS_SYS (symlinkat, int,
+                  (char const *contents, int fd, char const *file));
+_GL_CXXALIASWARN (symlinkat);
 #elif defined GNULIB_POSIXCHECK
 # undef symlinkat
-# define symlinkat(c,d,n)                            \
-    (GL_LINK_WARNING ("symlinkat is not portable - " \
-                      "use gnulib module symlinkat for portability"), \
-     symlinkat (c, d, n))
+# if HAVE_RAW_DECL_SYMLINKAT
+_GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
+                 "use gnulib module symlinkat for portability");
+# endif
+#endif
+
+
+#if @GNULIB_TTYNAME_R@
+/* Store at most BUFLEN characters of the pathname of the terminal FD is
+   open on in BUF.  Return 0 on success, otherwise an error number.  */
+# if @REPLACE_TTYNAME_R@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ttyname_r
+#   define ttyname_r rpl_ttyname_r
+#  endif
+_GL_FUNCDECL_RPL (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen));
+# else
+#  if !@HAVE_DECL_TTYNAME_R@
+_GL_FUNCDECL_SYS (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (ttyname_r, int,
+                  (int fd, char *buf, size_t buflen));
+# endif
+_GL_CXXALIASWARN (ttyname_r);
+#elif defined GNULIB_POSIXCHECK
+# undef ttyname_r
+# if HAVE_RAW_DECL_TTYNAME_R
+_GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
+                 "use gnulib module ttyname_r for portability");
+# endif
 #endif
 
 
 #if @GNULIB_UNLINK@
 # if @REPLACE_UNLINK@
-#  undef unlink
-#  define unlink rpl_unlink
-extern int unlink (char const *file) _GL_ARG_NONNULL ((1));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef unlink
+#   define unlink rpl_unlink
+#  endif
+_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (unlink, int, (char const *file));
+# else
+_GL_CXXALIAS_SYS (unlink, int, (char const *file));
 # endif
+_GL_CXXALIASWARN (unlink);
 #elif defined GNULIB_POSIXCHECK
 # undef unlink
-# define unlink(n)                         \
-    (GL_LINK_WARNING ("unlink is not portable - " \
-                      "use gnulib module unlink for portability"), \
-     unlink (n))
+# if HAVE_RAW_DECL_UNLINK
+_GL_WARN_ON_USE (unlink, "unlink is not portable - "
+                 "use gnulib module unlink for portability");
+# endif
 #endif
 
 
 #if @GNULIB_UNLINKAT@
 # if @REPLACE_UNLINKAT@
-#  undef unlinkat
-#  define unlinkat rpl_unlinkat
-# endif
-# if !@HAVE_UNLINKAT@ || @REPLACE_UNLINKAT@
-extern int unlinkat (int fd, char const *file, int flag) _GL_ARG_NONNULL ((2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef unlinkat
+#   define unlinkat rpl_unlinkat
+#  endif
+_GL_FUNCDECL_RPL (unlinkat, int, (int fd, char const *file, int flag)
+                                 _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (unlinkat, int, (int fd, char const *file, int flag));
+# else
+#  if !@HAVE_UNLINKAT@
+_GL_FUNCDECL_SYS (unlinkat, int, (int fd, char const *file, int flag)
+                                 _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (unlinkat, int, (int fd, char const *file, int flag));
 # endif
+_GL_CXXALIASWARN (unlinkat);
 #elif defined GNULIB_POSIXCHECK
 # undef unlinkat
-# define unlinkat(d,n,f)                         \
-    (GL_LINK_WARNING ("unlinkat is not portable - " \
-                      "use gnulib module openat for portability"), \
-     unlinkat (d, n, f))
+# if HAVE_RAW_DECL_UNLINKAT
+_GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
+                 "use gnulib module openat for portability");
+# endif
 #endif
 
 
 #if @GNULIB_USLEEP@
-# if @REPLACE_USLEEP@
-#  undef usleep
-#  define usleep rpl_usleep
-# endif
-# if !@HAVE_USLEEP@ || @REPLACE_USLEEP@
 /* Pause the execution of the current thread for N microseconds.
    Returns 0 on completion, or -1 on range error.
    See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/sleep.html>.  */
-extern int usleep (useconds_t n);
+   <http://www.opengroup.org/susv3xsh/usleep.html>.  */
+# if @REPLACE_USLEEP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef usleep
+#   define usleep rpl_usleep
+#  endif
+_GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
+_GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
+# else
+#  if !@HAVE_USLEEP@
+_GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
+#  endif
+_GL_CXXALIAS_SYS (usleep, int, (useconds_t n));
 # endif
+_GL_CXXALIASWARN (usleep);
 #elif defined GNULIB_POSIXCHECK
 # undef usleep
-# define usleep(n) \
-    (GL_LINK_WARNING ("usleep is unportable - " \
-                      "use gnulib module usleep for portability"), \
-     usleep (n))
+# if HAVE_RAW_DECL_USLEEP
+_GL_WARN_ON_USE (usleep, "usleep is unportable - "
+                 "use gnulib module usleep for portability");
+# endif
 #endif
 
 
-#if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
+#if @GNULIB_WRITE@
 /* Write up to COUNT bytes starting at BUF to file descriptor FD.
-   See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/write.html>.  */
-# undef write
-# define write rpl_write
-extern ssize_t write (int fd, const void *buf, size_t count)
-     _GL_ARG_NONNULL ((2));
-#endif
-
-
-#ifdef __cplusplus
-}
+   See the POSIX:2008 specification
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>.  */
+# if @REPLACE_WRITE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef write
+#   define write rpl_write
+#  endif
+_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
+                                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
+# else
+/* Need to cast, because on mingw, the third parameter is
+                                                             unsigned int count
+   and the return type is 'int'.  */
+_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (write);
 #endif
 
 
-#endif /* _GL_UNISTD_H */
-#endif /* _GL_UNISTD_H */
+#endif /* _@GUARD_PREFIX@_UNISTD_H */
+#endif /* _@GUARD_PREFIX@_UNISTD_H */
diff --git a/lib/unlink.c b/lib/unlink.c
deleted file mode 100644 (file)
index 3e42e28..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Work around unlink bugs.
-
-   Copyright (C) 2009, 2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-#include <unistd.h>
-
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-
-#undef unlink
-
-/* Remove file NAME.
-   Return 0 if successful, -1 if not.  */
-
-int
-rpl_unlink (char const *name)
-{
-  /* Work around Solaris 9 bug where unlink("file/") succeeds.  */
-  size_t len = strlen (name);
-  int result = 0;
-  if (len && ISSLASH (name[len - 1]))
-    {
-      /* We can't unlink(2) something if it doesn't exist.  If it does
-         exist, then it resolved to a directory, due to the trailing
-         slash, and POSIX requires that the unlink attempt to remove
-         that directory (which would leave the symlink dangling).
-         Unfortunately, Solaris 9 is one of the platforms where the
-         root user can unlink directories, and we don't want to
-         cripple this behavior on real directories, even if it is
-         seldom needed (at any rate, it's nicer to let coreutils'
-         unlink(1) give the correct errno for non-root users).  But we
-         don't know whether name was an actual directory, or a symlink
-         to a directory; and due to the bug of ignoring trailing
-         slash, Solaris 9 would end up successfully unlinking the
-         symlink instead of the directory.  Technically, we could use
-         realpath to find the canonical directory name to attempt
-         deletion on.  But that is a lot of work for a corner case; so
-         we instead just use an lstat on the shortened name, and
-         reject symlinks with trailing slashes.  The root user of
-         unlink(1) will just have to live with the rule that they
-         can't delete a directory via a symlink.  */
-      struct stat st;
-      result = lstat (name, &st);
-      if (result == 0)
-        {
-          /* Trailing NUL will overwrite the trailing slash.  */
-          char *short_name = malloc (len);
-          if (!short_name)
-            {
-              errno = EPERM;
-              return -1;
-            }
-          memcpy (short_name, name, len);
-          while (len && ISSLASH (short_name[len - 1]))
-            short_name[--len] = '\0';
-          if (len && (lstat (short_name, &st) || S_ISLNK (st.st_mode)))
-            {
-              free (short_name);
-              errno = EPERM;
-              return -1;
-            }
-          free (short_name);
-        }
-    }
-  if (!result)
-    result = unlink (name);
-  return result;
-}
diff --git a/lib/unlinkat.c b/lib/unlinkat.c
deleted file mode 100644 (file)
index 008192e..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Work around unlinkat bugs on Solaris 9.
-
-   Copyright (C) 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Written by Eric Blake.  */
-
-#include <config.h>
-
-#include <unistd.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <sys/stat.h>
-
-#include "openat.h"
-
-#if HAVE_UNLINKAT
-
-# undef unlinkat
-
-/* unlinkat without AT_REMOVEDIR does not honor trailing / on Solaris
-   9.  Solve it in a similar manner to unlink.  */
-
-int
-rpl_unlinkat (int fd, char const *name, int flag)
-{
-  size_t len;
-  int result = 0;
-  /* rmdir behavior has no problems with trailing slash.  */
-  if (flag & AT_REMOVEDIR)
-    return unlinkat (fd, name, flag);
-
-  len = strlen (name);
-  if (len && ISSLASH (name[len - 1]))
-    {
-      /* See the lengthy comment in unlink.c why we disobey the POSIX
-         rule of letting unlink("link-to-dir/") attempt to unlink a
-         directory.  */
-      struct stat st;
-      result = lstatat (fd, name, &st);
-      if (result == 0)
-        {
-          /* Trailing NUL will overwrite the trailing slash.  */
-          char *short_name = malloc (len);
-          if (!short_name)
-            {
-              errno = EPERM;
-              return -1;
-            }
-          memcpy (short_name, name, len);
-          while (len && ISSLASH (short_name[len - 1]))
-            short_name[--len] = '\0';
-          if (len && (lstatat (fd, short_name, &st) || S_ISLNK (st.st_mode)))
-            {
-              free (short_name);
-              errno = EPERM;
-              return -1;
-            }
-          free (short_name);
-        }
-    }
-  if (!result)
-    result = unlinkat (fd, name, flag);
-  return result;
-}
-
-#else /* !HAVE_UNLINKAT */
-
-/* Replacement for Solaris' function by the same name.
-   <http://www.google.com/search?q=unlinkat+site:docs.sun.com>
-   First, try to simulate it via (unlink|rmdir) ("/proc/self/fd/FD/FILE").
-   Failing that, simulate it via save_cwd/fchdir/(unlink|rmdir)/restore_cwd.
-   If either the save_cwd or the restore_cwd fails (relatively unlikely),
-   then give a diagnostic and exit nonzero.
-   Otherwise, this function works just like Solaris' unlinkat.  */
-
-# define AT_FUNC_NAME unlinkat
-# define AT_FUNC_F1 rmdir
-# define AT_FUNC_F2 unlink
-# define AT_FUNC_USE_F1_COND AT_REMOVEDIR
-# define AT_FUNC_POST_FILE_PARAM_DECLS , int flag
-# define AT_FUNC_POST_FILE_ARGS        /* empty */
-# include "at-func.c"
-# undef AT_FUNC_NAME
-# undef AT_FUNC_F1
-# undef AT_FUNC_F2
-# undef AT_FUNC_USE_F1_COND
-# undef AT_FUNC_POST_FILE_PARAM_DECLS
-# undef AT_FUNC_POST_FILE_ARGS
-
-#endif /* !HAVE_UNLINKAT */
index bdb5a25ae61856a490232eaedbd1cbfa41091a94..c126b9551a6dd4f681a44c3b5f2727a1116dca4e 100644 (file)
@@ -1,6 +1,6 @@
 /* Set file access and modification times.
 
-   Copyright (C) 2003-2010 Free Software Foundation, Inc.
+   Copyright (C) 2003-2012 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 the
@@ -164,7 +164,7 @@ update_timespec (struct stat const *statbuf, struct timespec *ts[2])
    Return 0 on success, -1 (setting errno) on failure.  */
 
 int
-fdutimens (char const *file, int fd, struct timespec const timespec[2])
+fdutimens (int fd, char const *file, struct timespec const timespec[2])
 {
   struct timespec adjusted_timespec[2];
   struct timespec *ts = timespec ? adjusted_timespec : NULL;
@@ -180,18 +180,13 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2])
   if (adjustment_needed < 0)
     return -1;
 
-  /* Require that at least one of FD or FILE are valid.  Works around
+  /* Require that at least one of FD or FILE are potentially valid, to avoid
      a Linux bug where futimens (AT_FDCWD, NULL) changes "." rather
      than failing.  */
-  if (!file)
+  if (fd < 0 && !file)
     {
-      if (fd < 0)
-        {
-          errno = EBADF;
-          return -1;
-        }
-      if (dup2 (fd, fd) != fd)
-        return -1;
+      errno = EBADF;
+      return -1;
     }
 
   /* Some Linux-based NFS clients are buggy, and mishandle time stamps
@@ -300,7 +295,7 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2])
   {
 #if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
     struct timeval timeval[2];
-    struct timeval const *t;
+    struct timeval *t;
     if (ts)
       {
         timeval[0].tv_sec = ts[0].tv_sec;
@@ -330,12 +325,53 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2])
            worth optimizing, and who knows what other messed-up systems
            are out there?  So play it safe and fall back on the code
            below.  */
-# if HAVE_FUTIMESAT && !FUTIMESAT_NULL_BUG
-        if (futimesat (fd, NULL, t) == 0)
-          return 0;
-# elif HAVE_FUTIMES
+
+# if (HAVE_FUTIMESAT && !FUTIMESAT_NULL_BUG) || HAVE_FUTIMES
+#  if HAVE_FUTIMESAT && !FUTIMESAT_NULL_BUG
+#   undef futimes
+#   define futimes(fd, t) futimesat (fd, NULL, t)
+#  endif
         if (futimes (fd, t) == 0)
-          return 0;
+          {
+#  if __linux__ && __GLIBC__
+            /* Work around a longstanding glibc bug, still present as
+               of 2010-12-27.  On older Linux kernels that lack both
+               utimensat and utimes, glibc's futimes rounds instead of
+               truncating when falling back on utime.  The same bug
+               occurs in futimesat with a null 2nd arg.  */
+            if (t)
+              {
+                bool abig = 500000 <= t[0].tv_usec;
+                bool mbig = 500000 <= t[1].tv_usec;
+                if ((abig | mbig) && fstat (fd, &st) == 0)
+                  {
+                    /* If these two subtractions overflow, they'll
+                       track the overflows inside the buggy glibc.  */
+                    time_t adiff = st.st_atime - t[0].tv_sec;
+                    time_t mdiff = st.st_mtime - t[1].tv_sec;
+
+                    struct timeval *tt = NULL;
+                    struct timeval truncated_timeval[2];
+                    truncated_timeval[0] = t[0];
+                    truncated_timeval[1] = t[1];
+                    if (abig && adiff == 1 && get_stat_atime_ns (&st) == 0)
+                      {
+                        tt = truncated_timeval;
+                        tt[0].tv_usec = 0;
+                      }
+                    if (mbig && mdiff == 1 && get_stat_mtime_ns (&st) == 0)
+                      {
+                        tt = truncated_timeval;
+                        tt[1].tv_usec = 0;
+                      }
+                    if (tt)
+                      futimes (fd, tt);
+                  }
+              }
+#  endif
+
+            return 0;
+          }
 # endif
       }
 #endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */
@@ -370,28 +406,12 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2])
   }
 }
 
-/* Set the access and modification time stamps of FD (a.k.a. FILE) to be
-   TIMESPEC[0] and TIMESPEC[1], respectively.
-   FD must be either negative -- in which case it is ignored --
-   or a file descriptor that is open on FILE.
-   If FD is nonnegative, then FILE can be NULL, which means
-   use just futimes (or equivalent) instead of utimes (or equivalent),
-   and fail if on an old system without futimes (or equivalent).
-   If TIMESPEC is null, set the time stamps to the current time.
-   Return 0 on success, -1 (setting errno) on failure.  */
-
-int
-gl_futimens (int fd, char const *file, struct timespec const timespec[2])
-{
-  return fdutimens (file, fd, timespec);
-}
-
 /* Set the access and modification time stamps of FILE to be
    TIMESPEC[0] and TIMESPEC[1], respectively.  */
 int
 utimens (char const *file, struct timespec const timespec[2])
 {
-  return fdutimens (file, -1, timespec);
+  return fdutimens (-1, file, timespec);
 }
 
 /* Set the access and modification time stamps of FILE to be
@@ -417,7 +437,7 @@ lutimens (char const *file, struct timespec const timespec[2])
 
   /* The Linux kernel did not support symlink timestamps until
      utimensat, in version 2.6.22, so we don't need to mimic
-     gl_futimens' worry about buggy NFS clients.  But we do have to
+     fdutimens' worry about buggy NFS clients.  But we do have to
      worry about bogus return values.  */
 
 #if HAVE_UTIMENSAT
@@ -484,7 +504,7 @@ lutimens (char const *file, struct timespec const timespec[2])
 #if HAVE_LUTIMES && !HAVE_UTIMENSAT
   {
     struct timeval timeval[2];
-    struct timeval const *t;
+    struct timeval *t;
     int result;
     if (ts)
       {
@@ -507,7 +527,7 @@ lutimens (char const *file, struct timespec const timespec[2])
   if (!(adjustment_needed || REPLACE_FUNC_STAT_FILE) && lstat (file, &st))
     return -1;
   if (!S_ISLNK (st.st_mode))
-    return fdutimens (file, -1, ts);
+    return fdutimens (-1, file, ts);
   errno = ENOSYS;
   return -1;
 }
index bb0326da5fc23b00cffba7081410f09f4df960f3..8c47cf93f887dc05a2e84eb3349d61d91da22177 100644 (file)
@@ -1,6 +1,5 @@
 #include <time.h>
-int fdutimens (char const *, int, struct timespec const [2]);
-int gl_futimens (int, char const *, struct timespec const [2]);
+int fdutimens (int, char const *, struct timespec const [2]);
 int utimens (char const *, struct timespec const [2]);
 int lutimens (char const *, struct timespec const [2]);
 
@@ -8,12 +7,13 @@ int lutimens (char const *, struct timespec const [2]);
 # include <fcntl.h>
 # include <sys/stat.h>
 
-int fdutimensat (int dir, char const *name, int fd, struct timespec const [2]);
+int fdutimensat (int fd, int dir, char const *name, struct timespec const [2],
+                 int atflag);
 
 /* Using this function makes application code slightly more readable.  */
 static inline int
-lutimensat (int fd, char const *file, struct timespec const times[2])
+lutimensat (int dir, char const *file, struct timespec const times[2])
 {
-  return utimensat (fd, file, times, AT_SYMLINK_NOFOLLOW);
+  return utimensat (dir, file, times, AT_SYMLINK_NOFOLLOW);
 }
 #endif
index 3fbba53e2359f6f51cb703854c0273b92b2939bf..0ebddf10a6eaaba96d15d28b457ac49dfa6a9198 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2010 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2012 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
@@ -14,8 +12,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* This file can be parametrized with the following macros:
      VASNPRINTF         The name of the function being defined.
@@ -90,6 +87,8 @@
 /* Checked size_t computations.  */
 #include "xsize.h"
 
+#include "verify.h"
+
 #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
 # include <math.h>
 # include "float+.h"
 # define USE_SNPRINTF 1
 # if HAVE_DECL__SNWPRINTF
    /* On Windows, the function swprintf() has a different signature than
-      on Unix; we use the _snwprintf() function instead.  */
-#  define SNPRINTF _snwprintf
+      on Unix; we use the function _snwprintf() or - on mingw - snwprintf()
+      instead.  The mingw function snwprintf() has fewer bugs than the
+      MSVCRT function _snwprintf(), so prefer that.  */
+#  if defined __MINGW32__
+#   define SNPRINTF snwprintf
+#  else
+#   define SNPRINTF _snwprintf
+#  endif
 # else
    /* Unix.  */
 #  define SNPRINTF swprintf
 #  define USE_SNPRINTF 0
 # endif
 # if HAVE_DECL__SNPRINTF
-   /* Windows.  */
-#  define SNPRINTF _snprintf
+   /* Windows.  The mingw function snprintf() has fewer bugs than the MSVCRT
+      function _snprintf(), so prefer that.  */
+#  if defined __MINGW32__
+#   define SNPRINTF snprintf
+    /* Here we need to call the native snprintf, not rpl_snprintf.  */
+#   undef snprintf
+#  else
+#   define SNPRINTF _snprintf
+#  endif
 # else
    /* Unix.  */
 #  define SNPRINTF snprintf
 #undef remainder
 #define remainder rem
 
-#if !USE_SNPRINTF && !WIDE_CHAR_VERSION
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && !WIDE_CHAR_VERSION
 # if (HAVE_STRNLEN && !defined _AIX)
 #  define local_strnlen strnlen
 # else
@@ -212,7 +224,7 @@ local_strnlen (const char *string, size_t maxlen)
 # endif
 #endif
 
-#if (!USE_SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T && (WIDE_CHAR_VERSION || DCHAR_IS_TCHAR)
+#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T
 # if HAVE_WCSLEN
 #  define local_wcslen wcslen
 # else
@@ -235,7 +247,7 @@ local_wcslen (const wchar_t *s)
 # endif
 #endif
 
-#if !USE_SNPRINTF && HAVE_WCHAR_T && WIDE_CHAR_VERSION
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && HAVE_WCHAR_T && WIDE_CHAR_VERSION
 # if HAVE_WCSNLEN
 #  define local_wcsnlen wcsnlen
 # else
@@ -266,7 +278,7 @@ decimal_point_char (void)
      multithread-safe on glibc systems and MacOS X systems, but is not required
      to be multithread-safe by POSIX.  sprintf(), however, is multithread-safe.
      localeconv() is rarely multithread-safe.  */
-#  if HAVE_NL_LANGINFO && (__GLIBC__ || (defined __APPLE__ && defined __MACH__))
+#  if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__))
   point = nl_langinfo (RADIXCHAR);
 #  elif 1
   char pointbuf[5];
@@ -311,11 +323,11 @@ is_infinite_or_zerol (long double x)
 
 typedef unsigned int mp_limb_t;
 # define GMP_LIMB_BITS 32
-typedef int mp_limb_verify[2 * (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS) - 1];
+verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
 
 typedef unsigned long long mp_twolimb_t;
 # define GMP_TWOLIMB_BITS 64
-typedef int mp_twolimb_verify[2 * (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS) - 1];
+verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
 
 /* Representation of a bignum >= 0.  */
 typedef struct
@@ -540,32 +552,61 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
       size_t s;
       {
         mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
-        s = 31;
-        if (msd >= 0x10000)
-          {
-            msd = msd >> 16;
-            s -= 16;
-          }
-        if (msd >= 0x100)
-          {
-            msd = msd >> 8;
-            s -= 8;
-          }
-        if (msd >= 0x10)
-          {
-            msd = msd >> 4;
-            s -= 4;
-          }
-        if (msd >= 0x4)
+        /* Determine s = GMP_LIMB_BITS - integer_length (msd).
+           Code copied from gnulib's integer_length.c.  */
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+        s = __builtin_clz (msd);
+# else
+#  if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
+        if (GMP_LIMB_BITS <= DBL_MANT_BIT)
           {
-            msd = msd >> 2;
-            s -= 2;
+            /* Use 'double' operations.
+               Assumes an IEEE 754 'double' implementation.  */
+#   define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
+#   define DBL_EXP_BIAS (DBL_EXP_MASK / 2 - 1)
+#   define NWORDS \
+     ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+            union { double value; unsigned int word[NWORDS]; } m;
+
+            /* Use a single integer to floating-point conversion.  */
+            m.value = msd;
+
+            s = GMP_LIMB_BITS
+                - (((m.word[DBL_EXPBIT0_WORD] >> DBL_EXPBIT0_BIT) & DBL_EXP_MASK)
+                   - DBL_EXP_BIAS);
           }
-        if (msd >= 0x2)
+        else
+#   undef NWORDS
+#  endif
           {
-            msd = msd >> 1;
-            s -= 1;
+            s = 31;
+            if (msd >= 0x10000)
+              {
+                msd = msd >> 16;
+                s -= 16;
+              }
+            if (msd >= 0x100)
+              {
+                msd = msd >> 8;
+                s -= 8;
+              }
+            if (msd >= 0x10)
+              {
+                msd = msd >> 4;
+                s -= 4;
+              }
+            if (msd >= 0x4)
+              {
+                msd = msd >> 2;
+                s -= 2;
+              }
+            if (msd >= 0x2)
+              {
+                msd = msd >> 1;
+                s -= 1;
+              }
           }
+# endif
       }
       /* 0 <= s < GMP_LIMB_BITS.
          Copy b, shifting it left by s bits.  */
@@ -872,9 +913,9 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
   y = frexpl (x, &exp);
   if (!(y >= 0.0L && y < 1.0L))
     abort ();
-  /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * LDBL_MANT_BIT), and the
+  /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * 2^LDBL_MANT_BIT), and the
      latter is an integer.  */
-  /* Convert the mantissa (y * LDBL_MANT_BIT) to a sequence of limbs.
+  /* Convert the mantissa (y * 2^LDBL_MANT_BIT) to a sequence of limbs.
      I'm not sure whether it's safe to cast a 'long double' value between
      2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
      'long double' values between 0 and 2^16 (to 'unsigned int' or 'int',
@@ -922,11 +963,11 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
         abort ();
       m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
     }
-#if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess
-         precision.  */
+#  if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess
+           precision.  */
   if (!(y == 0.0L))
     abort ();
-#endif
+#  endif
   /* Normalise.  */
   while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
     m.nlimbs--;
@@ -960,9 +1001,9 @@ decode_double (double x, int *ep, mpn_t *mp)
   y = frexp (x, &exp);
   if (!(y >= 0.0 && y < 1.0))
     abort ();
-  /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * DBL_MANT_BIT), and the
+  /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * 2^DBL_MANT_BIT), and the
      latter is an integer.  */
-  /* Convert the mantissa (y * DBL_MANT_BIT) to a sequence of limbs.
+  /* Convert the mantissa (y * 2^DBL_MANT_BIT) to a sequence of limbs.
      I'm not sure whether it's safe to cast a 'double' value between
      2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
      'double' values between 0 and 2^16 (to 'unsigned int' or 'int',
@@ -1476,6 +1517,258 @@ is_borderline (const char *digits, size_t precision)
 
 #endif
 
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99
+
+/* Use a different function name, to make it possible that the 'wchar_t'
+   parametrization and the 'char' parametrization get compiled in the same
+   translation unit.  */
+# if WIDE_CHAR_VERSION
+#  define MAX_ROOM_NEEDED wmax_room_needed
+# else
+#  define MAX_ROOM_NEEDED max_room_needed
+# endif
+
+/* Returns the number of TCHAR_T units needed as temporary space for the result
+   of sprintf or SNPRINTF of a single conversion directive.  */
+static inline size_t
+MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
+                 arg_type type, int flags, size_t width, int has_precision,
+                 size_t precision, int pad_ourselves)
+{
+  size_t tmp_length;
+
+  switch (conversion)
+    {
+    case 'd': case 'i': case 'u':
+# if HAVE_LONG_LONG_INT
+      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+                          * 0.30103 /* binary -> decimal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+# endif
+      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+                          * 0.30103 /* binary -> decimal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+        tmp_length =
+          (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+                          * 0.30103 /* binary -> decimal */
+                         )
+          + 1; /* turn floor into ceil */
+      if (tmp_length < precision)
+        tmp_length = precision;
+      /* Multiply by 2, as an estimate for FLAG_GROUP.  */
+      tmp_length = xsum (tmp_length, tmp_length);
+      /* Add 1, to account for a leading sign.  */
+      tmp_length = xsum (tmp_length, 1);
+      break;
+
+    case 'o':
+# if HAVE_LONG_LONG_INT
+      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+                          * 0.333334 /* binary -> octal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+# endif
+      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+                          * 0.333334 /* binary -> octal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+        tmp_length =
+          (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+                          * 0.333334 /* binary -> octal */
+                         )
+          + 1; /* turn floor into ceil */
+      if (tmp_length < precision)
+        tmp_length = precision;
+      /* Add 1, to account for a leading sign.  */
+      tmp_length = xsum (tmp_length, 1);
+      break;
+
+    case 'x': case 'X':
+# if HAVE_LONG_LONG_INT
+      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+                          * 0.25 /* binary -> hexadecimal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+# endif
+      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+        tmp_length =
+          (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+                          * 0.25 /* binary -> hexadecimal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+        tmp_length =
+          (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+                          * 0.25 /* binary -> hexadecimal */
+                         )
+          + 1; /* turn floor into ceil */
+      if (tmp_length < precision)
+        tmp_length = precision;
+      /* Add 2, to account for a leading sign or alternate form.  */
+      tmp_length = xsum (tmp_length, 2);
+      break;
+
+    case 'f': case 'F':
+      if (type == TYPE_LONGDOUBLE)
+        tmp_length =
+          (unsigned int) (LDBL_MAX_EXP
+                          * 0.30103 /* binary -> decimal */
+                          * 2 /* estimate for FLAG_GROUP */
+                         )
+          + 1 /* turn floor into ceil */
+          + 10; /* sign, decimal point etc. */
+      else
+        tmp_length =
+          (unsigned int) (DBL_MAX_EXP
+                          * 0.30103 /* binary -> decimal */
+                          * 2 /* estimate for FLAG_GROUP */
+                         )
+          + 1 /* turn floor into ceil */
+          + 10; /* sign, decimal point etc. */
+      tmp_length = xsum (tmp_length, precision);
+      break;
+
+    case 'e': case 'E': case 'g': case 'G':
+      tmp_length =
+        12; /* sign, decimal point, exponent etc. */
+      tmp_length = xsum (tmp_length, precision);
+      break;
+
+    case 'a': case 'A':
+      if (type == TYPE_LONGDOUBLE)
+        tmp_length =
+          (unsigned int) (LDBL_DIG
+                          * 0.831 /* decimal -> hexadecimal */
+                         )
+          + 1; /* turn floor into ceil */
+      else
+        tmp_length =
+          (unsigned int) (DBL_DIG
+                          * 0.831 /* decimal -> hexadecimal */
+                         )
+          + 1; /* turn floor into ceil */
+      if (tmp_length < precision)
+        tmp_length = precision;
+      /* Account for sign, decimal point etc. */
+      tmp_length = xsum (tmp_length, 12);
+      break;
+
+    case 'c':
+# if HAVE_WINT_T && !WIDE_CHAR_VERSION
+      if (type == TYPE_WIDE_CHAR)
+        tmp_length = MB_CUR_MAX;
+      else
+# endif
+        tmp_length = 1;
+      break;
+
+    case 's':
+# if HAVE_WCHAR_T
+      if (type == TYPE_WIDE_STRING)
+        {
+#  if WIDE_CHAR_VERSION
+          /* ISO C says about %ls in fwprintf:
+               "If the precision is not specified or is greater than the size
+                of the array, the array shall contain a null wide character."
+             So if there is a precision, we must not use wcslen.  */
+          const wchar_t *arg = ap->arg[arg_index].a.a_wide_string;
+
+          if (has_precision)
+            tmp_length = local_wcsnlen (arg, precision);
+          else
+            tmp_length = local_wcslen (arg);
+#  else
+          /* ISO C says about %ls in fprintf:
+               "If a precision is specified, no more than that many bytes are
+                written (including shift sequences, if any), and the array
+                shall contain a null wide character if, to equal the multibyte
+                character sequence length given by the precision, the function
+                would need to access a wide character one past the end of the
+                array."
+             So if there is a precision, we must not use wcslen.  */
+          /* This case has already been handled separately in VASNPRINTF.  */
+          abort ();
+#  endif
+        }
+      else
+# endif
+        {
+# if WIDE_CHAR_VERSION
+          /* ISO C says about %s in fwprintf:
+               "If the precision is not specified or is greater than the size
+                of the converted array, the converted array shall contain a
+                null wide character."
+             So if there is a precision, we must not use strlen.  */
+          /* This case has already been handled separately in VASNPRINTF.  */
+          abort ();
+# else
+          /* ISO C says about %s in fprintf:
+               "If the precision is not specified or greater than the size of
+                the array, the array shall contain a null character."
+             So if there is a precision, we must not use strlen.  */
+          const char *arg = ap->arg[arg_index].a.a_string;
+
+          if (has_precision)
+            tmp_length = local_strnlen (arg, precision);
+          else
+            tmp_length = strlen (arg);
+# endif
+        }
+      break;
+
+    case 'p':
+      tmp_length =
+        (unsigned int) (sizeof (void *) * CHAR_BIT
+                        * 0.25 /* binary -> hexadecimal */
+                       )
+          + 1 /* turn floor into ceil */
+          + 2; /* account for leading 0x */
+      break;
+
+    default:
+      abort ();
+    }
+
+  if (!pad_ourselves)
+    {
+# if ENABLE_UNISTDIO
+      /* Padding considers the number of characters, therefore the number of
+         elements after padding may be
+           > max (tmp_length, width)
+         but is certainly
+           <= tmp_length + width.  */
+      tmp_length = xsum (tmp_length, width);
+# else
+      /* Padding considers the number of elements, says POSIX.  */
+      if (tmp_length < width)
+        tmp_length = width;
+# endif
+    }
+
+  tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+  return tmp_length;
+}
+
+#endif
+
 DCHAR_T *
 VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
             const FCHAR_T *format, va_list args)
@@ -1488,8 +1781,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
     return NULL;
 
 #define CLEANUP() \
-  free (d.dir);                                                         \
-  if (a.arg)                                                            \
+  if (d.dir != d.direct_alloc_dir)                                      \
+    free (d.dir);                                                       \
+  if (a.arg != a.direct_alloc_arg)                                      \
     free (a.arg);
 
   if (PRINTF_FETCHARGS (args, &a) < 0)
@@ -2105,7 +2399,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   }
               }
 #endif
-#if (!USE_SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T
             else if (dp->conversion == 's'
 # if WIDE_CHAR_VERSION
                      && a.arg[dp->arg_index].type != TYPE_WIDE_STRING
@@ -2358,7 +2652,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   size_t characters;
 #  if !DCHAR_IS_TCHAR
                   /* This code assumes that TCHAR_T is 'char'.  */
-                  typedef int TCHAR_T_verify[2 * (sizeof (TCHAR_T) == 1) - 1];
+                  verify (sizeof (TCHAR_T) == 1);
                   TCHAR_T *tmpsrc;
                   DCHAR_T *tmpdst;
                   size_t tmpdst_len;
@@ -2519,7 +2813,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   if (has_width)
                     {
 #  if ENABLE_UNISTDIO
-                      /* Outside POSIX, it's preferrable to compare the width
+                      /* Outside POSIX, it's preferable to compare the width
                          against the number of _characters_ of the converted
                          value.  */
                       w = DCHAR_MBSNLEN (result + length, characters);
@@ -2594,8 +2888,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                           count = wctomb (cbuf, *arg);
 #   endif
                           if (count <= 0)
-                            /* Inconsistency.  */
-                            abort ();
+                            {
+                              /* Cannot convert.  */
+                              if (!(result == resultbuf || result == NULL))
+                                free (result);
+                              if (buf_malloced != NULL)
+                                free (buf_malloced);
+                              CLEANUP ();
+                              errno = EILSEQ;
+                              return NULL;
+                            }
                           ENSURE_ALLOCATION (xsum (length, count));
                           memcpy (result + length, cbuf, count);
                           length += count;
@@ -2618,8 +2920,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                       length += n;
                     }
                 }
-              }
 # endif
+              }
 #endif
 #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
             else if ((dp->conversion == 'a' || dp->conversion == 'A')
@@ -4303,11 +4605,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
               {
                 arg_type type = a.arg[dp->arg_index].type;
                 int flags = dp->flags;
-#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
                 int has_width;
                 size_t width;
 #endif
-#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION
                 int has_precision;
                 size_t precision;
 #endif
@@ -4326,13 +4628,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                 TCHAR_T *fbp;
                 unsigned int prefix_count;
                 int prefixes[2] IF_LINT (= { 0 });
+                int orig_errno;
 #if !USE_SNPRINTF
                 size_t tmp_length;
                 TCHAR_T tmpbuf[700];
                 TCHAR_T *tmp;
 #endif
 
-#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
                 has_width = 0;
                 width = 0;
                 if (dp->width_start != dp->width_end)
@@ -4366,7 +4669,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   }
 #endif
 
-#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION
                 has_precision = 0;
                 precision = 6;
                 if (dp->precision_start != dp->precision_end)
@@ -4439,246 +4742,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #if !USE_SNPRINTF
                 /* Allocate a temporary buffer of sufficient size for calling
                    sprintf.  */
-                {
-                  switch (dp->conversion)
-                    {
-
-                    case 'd': case 'i': case 'u':
-# if HAVE_LONG_LONG_INT
-                      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
-                        tmp_length =
-                          (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
-                                          * 0.30103 /* binary -> decimal */
-                                         )
-                          + 1; /* turn floor into ceil */
-                      else
-# endif
-                      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
-                        tmp_length =
-                          (unsigned int) (sizeof (unsigned long) * CHAR_BIT
-                                          * 0.30103 /* binary -> decimal */
-                                         )
-                          + 1; /* turn floor into ceil */
-                      else
-                        tmp_length =
-                          (unsigned int) (sizeof (unsigned int) * CHAR_BIT
-                                          * 0.30103 /* binary -> decimal */
-                                         )
-                          + 1; /* turn floor into ceil */
-                      if (tmp_length < precision)
-                        tmp_length = precision;
-                      /* Multiply by 2, as an estimate for FLAG_GROUP.  */
-                      tmp_length = xsum (tmp_length, tmp_length);
-                      /* Add 1, to account for a leading sign.  */
-                      tmp_length = xsum (tmp_length, 1);
-                      break;
-
-                    case 'o':
-# if HAVE_LONG_LONG_INT
-                      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
-                        tmp_length =
-                          (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
-                                          * 0.333334 /* binary -> octal */
-                                         )
-                          + 1; /* turn floor into ceil */
-                      else
-# endif
-                      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
-                        tmp_length =
-                          (unsigned int) (sizeof (unsigned long) * CHAR_BIT
-                                          * 0.333334 /* binary -> octal */
-                                         )
-                          + 1; /* turn floor into ceil */
-                      else
-                        tmp_length =
-                          (unsigned int) (sizeof (unsigned int) * CHAR_BIT
-                                          * 0.333334 /* binary -> octal */
-                                         )
-                          + 1; /* turn floor into ceil */
-                      if (tmp_length < precision)
-                        tmp_length = precision;
-                      /* Add 1, to account for a leading sign.  */
-                      tmp_length = xsum (tmp_length, 1);
-                      break;
-
-                    case 'x': case 'X':
-# if HAVE_LONG_LONG_INT
-                      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
-                        tmp_length =
-                          (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
-                                          * 0.25 /* binary -> hexadecimal */
-                                         )
-                          + 1; /* turn floor into ceil */
-                      else
-# endif
-                      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
-                        tmp_length =
-                          (unsigned int) (sizeof (unsigned long) * CHAR_BIT
-                                          * 0.25 /* binary -> hexadecimal */
-                                         )
-                          + 1; /* turn floor into ceil */
-                      else
-                        tmp_length =
-                          (unsigned int) (sizeof (unsigned int) * CHAR_BIT
-                                          * 0.25 /* binary -> hexadecimal */
-                                         )
-                          + 1; /* turn floor into ceil */
-                      if (tmp_length < precision)
-                        tmp_length = precision;
-                      /* Add 2, to account for a leading sign or alternate form.  */
-                      tmp_length = xsum (tmp_length, 2);
-                      break;
-
-                    case 'f': case 'F':
-                      if (type == TYPE_LONGDOUBLE)
-                        tmp_length =
-                          (unsigned int) (LDBL_MAX_EXP
-                                          * 0.30103 /* binary -> decimal */
-                                          * 2 /* estimate for FLAG_GROUP */
-                                         )
-                          + 1 /* turn floor into ceil */
-                          + 10; /* sign, decimal point etc. */
-                      else
-                        tmp_length =
-                          (unsigned int) (DBL_MAX_EXP
-                                          * 0.30103 /* binary -> decimal */
-                                          * 2 /* estimate for FLAG_GROUP */
-                                         )
-                          + 1 /* turn floor into ceil */
-                          + 10; /* sign, decimal point etc. */
-                      tmp_length = xsum (tmp_length, precision);
-                      break;
-
-                    case 'e': case 'E': case 'g': case 'G':
-                      tmp_length =
-                        12; /* sign, decimal point, exponent etc. */
-                      tmp_length = xsum (tmp_length, precision);
-                      break;
-
-                    case 'a': case 'A':
-                      if (type == TYPE_LONGDOUBLE)
-                        tmp_length =
-                          (unsigned int) (LDBL_DIG
-                                          * 0.831 /* decimal -> hexadecimal */
-                                         )
-                          + 1; /* turn floor into ceil */
-                      else
-                        tmp_length =
-                          (unsigned int) (DBL_DIG
-                                          * 0.831 /* decimal -> hexadecimal */
-                                         )
-                          + 1; /* turn floor into ceil */
-                      if (tmp_length < precision)
-                        tmp_length = precision;
-                      /* Account for sign, decimal point etc. */
-                      tmp_length = xsum (tmp_length, 12);
-                      break;
-
-                    case 'c':
-# if HAVE_WINT_T && !WIDE_CHAR_VERSION
-                      if (type == TYPE_WIDE_CHAR)
-                        tmp_length = MB_CUR_MAX;
-                      else
-# endif
-                        tmp_length = 1;
-                      break;
-
-                    case 's':
-# if HAVE_WCHAR_T
-                      if (type == TYPE_WIDE_STRING)
-                        {
-#  if WIDE_CHAR_VERSION
-                          /* ISO C says about %ls in fwprintf:
-                               "If the precision is not specified or is greater
-                                than the size of the array, the array shall
-                                contain a null wide character."
-                             So if there is a precision, we must not use
-                             wcslen.  */
-                          const wchar_t *arg =
-                            a.arg[dp->arg_index].a.a_wide_string;
-
-                          if (has_precision)
-                            tmp_length = local_wcsnlen (arg, precision);
-                          else
-                            tmp_length = local_wcslen (arg);
-#  else
-                          /* ISO C says about %ls in fprintf:
-                               "If a precision is specified, no more than that
-                                many bytes are written (including shift
-                                sequences, if any), and the array shall contain
-                                a null wide character if, to equal the
-                                multibyte character sequence length given by
-                                the precision, the function would need to
-                                access a wide character one past the end of the
-                                array."
-                             So if there is a precision, we must not use
-                             wcslen.  */
-                          /* This case has already been handled above.  */
-                          abort ();
-#  endif
-                        }
-                      else
-# endif
-                        {
-# if WIDE_CHAR_VERSION
-                          /* ISO C says about %s in fwprintf:
-                               "If the precision is not specified or is greater
-                                than the size of the converted array, the
-                                converted array shall contain a null wide
-                                character."
-                             So if there is a precision, we must not use
-                             strlen.  */
-                          /* This case has already been handled above.  */
-                          abort ();
-# else
-                          /* ISO C says about %s in fprintf:
-                               "If the precision is not specified or greater
-                                than the size of the array, the array shall
-                                contain a null character."
-                             So if there is a precision, we must not use
-                             strlen.  */
-                          const char *arg = a.arg[dp->arg_index].a.a_string;
-
-                          if (has_precision)
-                            tmp_length = local_strnlen (arg, precision);
-                          else
-                            tmp_length = strlen (arg);
-# endif
-                        }
-                      break;
-
-                    case 'p':
-                      tmp_length =
-                        (unsigned int) (sizeof (void *) * CHAR_BIT
-                                        * 0.25 /* binary -> hexadecimal */
-                                       )
-                          + 1 /* turn floor into ceil */
-                          + 2; /* account for leading 0x */
-                      break;
-
-                    default:
-                      abort ();
-                    }
-
-                  if (!pad_ourselves)
-                    {
-# if ENABLE_UNISTDIO
-                      /* Padding considers the number of characters, therefore
-                         the number of elements after padding may be
-                           > max (tmp_length, width)
-                         but is certainly
-                           <= tmp_length + width.  */
-                      tmp_length = xsum (tmp_length, width);
-# else
-                      /* Padding considers the number of elements,
-                         says POSIX.  */
-                      if (tmp_length < width)
-                        tmp_length = width;
-# endif
-                    }
-
-                  tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
-                }
+                tmp_length =
+                  MAX_ROOM_NEEDED (&a, dp->arg_index, dp->conversion, type,
+                                   flags, width, has_precision, precision,
+                                   pad_ourselves);
 
                 if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T))
                   tmp = tmpbuf;
@@ -4716,6 +4783,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   *fbp++ = ' ';
                 if (flags & FLAG_ALT)
                   *fbp++ = '#';
+#if __GLIBC__ >= 2 && !defined __UCLIBC__
+                if (flags & FLAG_LOCALIZED)
+                  *fbp++ = 'I';
+#endif
                 if (!pad_ourselves)
                   {
                     if (flags & FLAG_ZERO)
@@ -4799,20 +4870,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #endif
                   *fbp = dp->conversion;
 #if USE_SNPRINTF
-# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
                 fbp[1] = '%';
                 fbp[2] = 'n';
                 fbp[3] = '\0';
 # else
                 /* On glibc2 systems from glibc >= 2.3 - probably also older
-                   ones - we know that snprintf's returns value conforms to
-                   ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
+                   ones - we know that snprintf's return value conforms to
+                   ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and
+                   gl_SNPRINTF_TRUNCATION_C99 pass.
                    Therefore we can avoid using %n in this situation.
                    On glibc2 systems from 2004-10-18 or newer, the use of %n
                    in format strings in writable memory may crash the program
                    (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
                    in this situation.  */
-                /* On native Win32 systems (such as mingw), we can avoid using
+                /* On native Windows systems (such as mingw), we can avoid using
                    %n because:
                      - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
                        snprintf does not write more than the specified number
@@ -4821,7 +4893,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                      - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
                        allows us to recognize the case of an insufficient
                        buffer size: it returns -1 in this case.
-                   On native Win32 systems (such as mingw) where the OS is
+                   On native Windows systems (such as mingw) where the OS is
                    Windows Vista, the use of %n in format strings by default
                    crashes the program. See
                      <http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
@@ -4865,6 +4937,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                 *(TCHAR_T *) (result + length) = '\0';
 #endif
 
+                orig_errno = errno;
+
                 for (;;)
                   {
                     int count = -1;
@@ -4918,6 +4992,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                       }
 #endif
 
+                    errno = 0;
                     switch (type)
                       {
                       case TYPE_SCHAR:
@@ -5064,15 +5139,44 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                             /* Look at the snprintf() return value.  */
                             if (retcount < 0)
                               {
+# if !HAVE_SNPRINTF_RETVAL_C99
                                 /* HP-UX 10.20 snprintf() is doubly deficient:
                                    It doesn't understand the '%n' directive,
                                    *and* it returns -1 (rather than the length
                                    that would have been required) when the
-                                   buffer is too small.  */
-                                size_t bigger_need =
-                                  xsum (xtimes (allocated, 2), 12);
-                                ENSURE_ALLOCATION (bigger_need);
-                                continue;
+                                   buffer is too small.
+                                   But a failure at this point can also come
+                                   from other reasons than a too small buffer,
+                                   such as an invalid wide string argument to
+                                   the %ls directive, or possibly an invalid
+                                   floating-point argument.  */
+                                size_t tmp_length =
+                                  MAX_ROOM_NEEDED (&a, dp->arg_index,
+                                                   dp->conversion, type, flags,
+                                                   width, has_precision,
+                                                   precision, pad_ourselves);
+
+                                if (maxlen < tmp_length)
+                                  {
+                                    /* Make more room.  But try to do through
+                                       this reallocation only once.  */
+                                    size_t bigger_need =
+                                      xsum (length,
+                                            xsum (tmp_length,
+                                                  TCHARS_PER_DCHAR - 1)
+                                            / TCHARS_PER_DCHAR);
+                                    /* And always grow proportionally.
+                                       (There may be several arguments, each
+                                       needing a little more room than the
+                                       previous one.)  */
+                                    size_t bigger_need2 =
+                                      xsum (xtimes (allocated, 2), 12);
+                                    if (bigger_need < bigger_need2)
+                                      bigger_need = bigger_need2;
+                                    ENSURE_ALLOCATION (bigger_need);
+                                    continue;
+                                  }
+# endif
                               }
                             else
                               count = retcount;
@@ -5083,12 +5187,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     /* Attempt to handle failure.  */
                     if (count < 0)
                       {
+                        /* SNPRINTF or sprintf failed.  Save and use the errno
+                           that it has set, if any.  */
+                        int saved_errno = errno;
+
                         if (!(result == resultbuf || result == NULL))
                           free (result);
                         if (buf_malloced != NULL)
                           free (buf_malloced);
                         CLEANUP ();
-                        errno = EINVAL;
+                        errno =
+                          (saved_errno != 0
+                           ? saved_errno
+                           : (dp->conversion == 'c' || dp->conversion == 's'
+                              ? EILSEQ
+                              : EINVAL));
                         return NULL;
                       }
 
@@ -5210,8 +5323,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                         DCHAR_T *tmpdst;
                         size_t tmpdst_len;
                         /* This code assumes that TCHAR_T is 'char'.  */
-                        typedef int TCHAR_T_verify
-                                    [2 * (sizeof (TCHAR_T) == 1) - 1];
+                        verify (sizeof (TCHAR_T) == 1);
 # if USE_SNPRINTF
                         tmpsrc = (TCHAR_T *) (result + length);
 # else
@@ -5304,7 +5416,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                       {
                         size_t w;
 # if ENABLE_UNISTDIO
-                        /* Outside POSIX, it's preferrable to compare the width
+                        /* Outside POSIX, it's preferable to compare the width
                            against the number of _characters_ of the converted
                            value.  */
                         w = DCHAR_MBSNLEN (result + length, count);
@@ -5424,6 +5536,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     length += count;
                     break;
                   }
+                errno = orig_errno;
+#undef pad_ourselves
+#undef prec_ourselves
               }
           }
       }
@@ -5475,6 +5590,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
   }
 }
 
+#undef MAX_ROOM_NEEDED
 #undef TCHARS_PER_DCHAR
 #undef SNPRINTF
 #undef USE_SNPRINTF
index 701678c26c1d2eb9e0870d7be07944bd7a4a7235..dd8691469790a8ea24ff7a22931ddee0079de26d 100644 (file)
@@ -1,7 +1,5 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007-2012 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
@@ -14,8 +12,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _VASNPRINTF_H
 #define _VASNPRINTF_H
 /* Get size_t.  */
 #include <stddef.h>
 
-#ifndef __attribute__
 /* The __attribute__ feature is available in gcc versions 2.5 and later.
    The __-protected variants of the attributes 'format' and 'printf' are
    accepted by gcc versions 2.6.4 (effectively 2.7) and later.
-   We enable __attribute__ only if these are supported too, because
+   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
    gnulib and libintl do '#define printf __printf__' when they override
    the 'printf' function.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
-#  define __attribute__(Spec)   /* empty */
-# endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
 #endif
 
 #ifdef __cplusplus
@@ -71,9 +68,9 @@ extern "C" {
 # define vasnprintf rpl_vasnprintf
 #endif
 extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
-       __attribute__ ((__format__ (__printf__, 3, 4)));
+       _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
 extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
-       __attribute__ ((__format__ (__printf__, 3, 0)));
+       _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0));
 
 #ifdef __cplusplus
 }
index bcd3f5a09dceebb70a7d97f726297f315dbf60a1..cef14ad1571eb64a9f4006f696645b265dbf339f 100644 (file)
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2012 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
 
 /* Written by Paul Eggert, Bruno Haible, and Jim Meyering.  */
 
-#ifndef VERIFY_H
-# define VERIFY_H 1
+#ifndef _GL_VERIFY_H
+# define _GL_VERIFY_H
+
+
+/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11.
+   This is supported by GCC 4.6.0 and later, in C mode, and its use
+   here generates easier-to-read diagnostics when verify (R) fails.
+
+   Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11.
+   This will likely be supported by future GCC versions, in C++ mode.
+
+   Use this only with GCC.  If we were willing to slow 'configure'
+   down we could also use it with other compilers, but since this
+   affects only the quality of diagnostics, why bother?  */
+# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined __cplusplus
+#  define _GL_HAVE__STATIC_ASSERT 1
+# endif
+/* The condition (99 < __GNUC__) is temporary, until we know about the
+   first G++ release that supports static_assert.  */
+# if (99 < __GNUC__) && defined __cplusplus
+#  define _GL_HAVE_STATIC_ASSERT 1
+# endif
 
 /* Each of these macros verifies that its argument R is nonzero.  To
    be portable, R should be an integer constant expression.  Unlike
    assert (R), there is no run-time overhead.
 
-   There are two macros, since no single macro can be used in all
-   contexts in C.  verify_true (R) is for scalar contexts, including
-   integer constant expression contexts.  verify (R) is for declaration
-   contexts, e.g., the top level.
-
-   Symbols ending in "__" are private to this header.
+   If _Static_assert works, verify (R) uses it directly.  Similarly,
+   _GL_VERIFY_TRUE works by packaging a _Static_assert inside a struct
+   that is an operand of sizeof.
 
-   The code below uses several ideas.
+   The code below uses several ideas for C++ compilers, and for C
+   compilers that do not support _Static_assert:
 
    * The first step is ((R) ? 1 : -1).  Given an expression R, of
      integral or boolean or floating-point type, this yields an
@@ -39,7 +57,9 @@
      constant and nonnegative.
 
    * Next this expression W is wrapped in a type
-     struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }.
+     struct _gl_verify_type {
+       unsigned int _gl_verify_error_if_negative: W;
+     }.
      If W is negative, this yields a compile-time error.  No compiler can
      deal with a bit-field of negative size.
 
@@ -53,7 +73,7 @@
 
        void function (int n) { verify (n < 0); }
 
-   * For the verify macro, the struct verify_type__ will need to
+   * For the verify macro, the struct _gl_verify_type will need to
      somehow be embedded into a declaration.  To be portable, this
      declaration must declare an object, a constant, a function, or a
      typedef name.  If the declared entity uses the type directly,
      if the entity names are not disambiguated.  A workaround is to
      attach the current line number to the entity name:
 
-       #define GL_CONCAT0(x, y) x##y
-       #define GL_CONCAT(x, y) GL_CONCAT0 (x, y)
-       extern struct {...} * GL_CONCAT(dummy,__LINE__);
+       #define _GL_CONCAT0(x, y) x##y
+       #define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+       extern struct {...} * _GL_CONCAT (dummy, __LINE__);
 
      But this has the problem that two invocations of verify from
      within the same macro would collide, since the __LINE__ value
-     would be the same for both invocations.
+     would be the same for both invocations.  (The GCC __COUNTER__
+     macro solves this problem, but is not portable.)
 
      A solution is to use the sizeof operator.  It yields a number,
      getting rid of the identity of the type.  Declarations like
      Which of the following alternatives can be used?
 
        extern int dummy [sizeof (struct {...})];
-       extern int dummy [sizeof (struct verify_type__ {...})];
+       extern int dummy [sizeof (struct _gl_verify_type {...})];
        extern void dummy (int [sizeof (struct {...})]);
-       extern void dummy (int [sizeof (struct verify_type__ {...})]);
+       extern void dummy (int [sizeof (struct _gl_verify_type {...})]);
        extern int (*dummy (void)) [sizeof (struct {...})];
-       extern int (*dummy (void)) [sizeof (struct verify_type__ {...})];
+       extern int (*dummy (void)) [sizeof (struct _gl_verify_type {...})];
 
      In the second and sixth case, the struct type is exported to the
      outer scope; two such declarations therefore collide.  GCC warns
 
        extern int (*dummy (void)) [sizeof (struct {...})];
 
-   * This implementation exploits the fact that GCC does not warn about
-     the last declaration mentioned above.  If a future version of GCC
-     introduces a warning for this, the problem could be worked around
-     by using code specialized to GCC, e.g.,:
+   * GCC warns about duplicate declarations of the dummy function if
+     -Wredundant_decls is used.  GCC 4.3 and later have a builtin
+     __COUNTER__ macro that can let us generate unique identifiers for
+     each dummy function, to suppress this warning.
 
-       #if 4 <= __GNUC__
-       # define verify(R) \
-           extern int (* verify_function__ (void)) \
-                      [__builtin_constant_p (R) && (R) ? 1 : -1]
-       #endif
+   * This implementation exploits the fact that older versions of GCC,
+     which do not support _Static_assert, also do not warn about the
+     last declaration mentioned above.
 
    * In C++, any struct definition inside sizeof is invalid.
      Use a template type to work around the problem.  */
 
+/* Concatenate two preprocessor tokens.  */
+# define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+# define _GL_CONCAT0(x, y) x##y
 
-/* Verify requirement R at compile-time, as an integer constant expression.
-   Return 1.  */
+/* _GL_COUNTER is an integer, preferably one that changes each time we
+   use it.  Use __COUNTER__ if it works, falling back on __LINE__
+   otherwise.  __LINE__ isn't perfect, but it's better than a
+   constant.  */
+# if defined __COUNTER__ && __COUNTER__ != __COUNTER__
+#  define _GL_COUNTER __COUNTER__
+# else
+#  define _GL_COUNTER __LINE__
+# endif
+
+/* Generate a symbol with the given prefix, making it unique if
+   possible.  */
+# define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
+
+/* Verify requirement R at compile-time, as an integer constant expression
+   that returns 1.  If R is false, fail at compile-time, preferably
+   with a diagnostic that includes the string-literal DIAGNOSTIC.  */
+
+# define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \
+    (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
 
 # ifdef __cplusplus
+#  if !GNULIB_defined_struct__gl_verify_type
 template <int w>
-  struct verify_type__ { unsigned int verify_error_if_negative_size__: w; };
-#  define verify_true(R) \
-     (!!sizeof (verify_type__<(R) ? 1 : -1>))
+  struct _gl_verify_type {
+    unsigned int _gl_verify_error_if_negative: w;
+  };
+#   define GNULIB_defined_struct__gl_verify_type 1
+#  endif
+#  define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+    _gl_verify_type<(R) ? 1 : -1>
+# elif defined _GL_HAVE__STATIC_ASSERT
+#  define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+     struct {                                   \
+       _Static_assert (R, DIAGNOSTIC);          \
+       int _gl_dummy;                          \
+     }
+# else
+#  define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+     struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; }
+# endif
+
+/* Verify requirement R at compile-time, as a declaration without a
+   trailing ';'.  If R is false, fail at compile-time, preferably
+   with a diagnostic that includes the string-literal DIAGNOSTIC.
+
+   Unfortunately, unlike C11, this implementation must appear as an
+   ordinary declaration, and cannot appear inside struct { ... }.  */
+
+# ifdef _GL_HAVE__STATIC_ASSERT
+#  define _GL_VERIFY _Static_assert
 # else
-#  define verify_true(R) \
-     (!!sizeof \
-      (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; }))
+#  define _GL_VERIFY(R, DIAGNOSTIC)                                   \
+     extern int (*_GL_GENSYM (_gl_verify_function) (void))            \
+       [_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
 # endif
 
+/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h.  */
+# ifdef _GL_STATIC_ASSERT_H
+#  if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert
+#   define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
+#  endif
+#  if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
+#   define static_assert _Static_assert /* C11 requires this #define.  */
+#  endif
+# endif
+
+/* @assert.h omit start@  */
+
+/* Each of these macros verifies that its argument R is nonzero.  To
+   be portable, R should be an integer constant expression.  Unlike
+   assert (R), there is no run-time overhead.
+
+   There are two macros, since no single macro can be used in all
+   contexts in C.  verify_true (R) is for scalar contexts, including
+   integer constant expression contexts.  verify (R) is for declaration
+   contexts, e.g., the top level.  */
+
+/* Verify requirement R at compile-time, as an integer constant expression.
+   Return 1.  This is equivalent to verify_expr (R, 1).
+
+   verify_true is obsolescent; please use verify_expr instead.  */
+
+# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
+
+/* Verify requirement R at compile-time.  Return the value of the
+   expression E.  */
+
+# define verify_expr(R, E) \
+    (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
+
 /* Verify requirement R at compile-time, as a declaration without a
    trailing ';'.  */
 
-# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)]
+# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+
+/* @assert.h omit end@  */
 
 #endif
index cae62e5e18563fcb7bd5baa35f80a45b7ad05f97..bc1bec99d6379db28c2d374644ee1a210e30e483 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to a stream.
-   Copyright (C) 2004, 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2012 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
index fe3a058cb32e47055eadaa73c6d63e63be6e6682..f9bc30c03092e6e7eecb5a018d2d2145e180cd5d 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake.  */
 
@@ -31,6 +28,7 @@
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 #if defined __need_mbstate_t || defined __need_wint_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
 /* Special invocation convention:
 #else
 /* Normal invocation convention.  */
 
-#ifndef _GL_WCHAR_H
+#ifndef _@GUARD_PREFIX@_WCHAR_H
 
 #define _GL_ALREADY_INCLUDING_WCHAR_H
 
+#if @HAVE_FEATURES_H@
+# include <features.h> /* for __GLIBC__ */
+#endif
+
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
    included before <wchar.h>.
+   In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
+   by <stddef.h>.
    But avoid namespace pollution on glibc systems.  */
-#ifndef __GLIBC__
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <stddef.h>
+#endif
+#ifndef __GLIBC__
 # include <stdio.h>
 # include <time.h>
 #endif
 
 #undef _GL_ALREADY_INCLUDING_WCHAR_H
 
-#ifndef _GL_WCHAR_H
-#define _GL_WCHAR_H
+#ifndef _@GUARD_PREFIX@_WCHAR_H
+#define _@GUARD_PREFIX@_WCHAR_H
+
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+   The attribute __pure__ was added in gcc 2.96.  */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
 
-/* The definition of GL_LINK_WARNING is copied here.  */
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+/* The definition of _GL_WARN_ON_USE is copied here.  */
 
 
-/* Define wint_t.  (Also done in wctype.in.h.)  */
+/* Define wint_t and WEOF.  (Also done in wctype.in.h.)  */
 #if !@HAVE_WINT_T@ && !defined wint_t
 # define wint_t int
 # ifndef WEOF
 #  define WEOF -1
 # endif
+#else
+/* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
+   This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
+   "unchanged by default argument promotions".  Override it.  */
+# if defined _MSC_VER
+#  if !GNULIB_defined_wint_t
+#   include <crtdefs.h>
+typedef unsigned int rpl_wint_t;
+#   undef wint_t
+#   define wint_t rpl_wint_t
+#   define GNULIB_defined_wint_t 1
+#  endif
+# endif
+# ifndef WEOF
+#  define WEOF ((wint_t) -1)
+# endif
 #endif
 
 
@@ -99,223 +127,902 @@ extern "C" {
    On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
    implementing mbrtowc for encodings like UTF-8.  */
 #if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+# if !GNULIB_defined_mbstate_t
 typedef int rpl_mbstate_t;
-# undef mbstate_t
-# define mbstate_t rpl_mbstate_t
-# define GNULIB_defined_mbstate_t 1
+#  undef mbstate_t
+#  define mbstate_t rpl_mbstate_t
+#  define GNULIB_defined_mbstate_t 1
+# endif
 #endif
 
 
 /* Convert a single-byte character to a wide character.  */
 #if @GNULIB_BTOWC@
 # if @REPLACE_BTOWC@
-#  undef btowc
-#  define btowc rpl_btowc
-# endif
-# if !@HAVE_BTOWC@ || @REPLACE_BTOWC@
-extern wint_t btowc (int c);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef btowc
+#   define btowc rpl_btowc
+#  endif
+_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
+# else
+#  if !@HAVE_BTOWC@
+_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
+#  endif
+_GL_CXXALIAS_SYS (btowc, wint_t, (int c));
 # endif
+_GL_CXXALIASWARN (btowc);
 #elif defined GNULIB_POSIXCHECK
 # undef btowc
-# define btowc(c) \
-    (GL_LINK_WARNING ("btowc is unportable - " \
-                      "use gnulib module btowc for portability"), \
-     btowc (c))
+# if HAVE_RAW_DECL_BTOWC
+_GL_WARN_ON_USE (btowc, "btowc is unportable - "
+                 "use gnulib module btowc for portability");
+# endif
 #endif
 
 
 /* Convert a wide character to a single-byte character.  */
 #if @GNULIB_WCTOB@
 # if @REPLACE_WCTOB@
-#  undef wctob
-#  define wctob rpl_wctob
-# endif
-# if (!defined wctob && !@HAVE_DECL_WCTOB@) || @REPLACE_WCTOB@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wctob
+#   define wctob rpl_wctob
+#  endif
+_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
+# else
+#  if !defined wctob && !@HAVE_DECL_WCTOB@
 /* wctob is provided by gnulib, or wctob exists but is not declared.  */
-extern int wctob (wint_t wc);
+_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
+#  endif
+_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
 # endif
+_GL_CXXALIASWARN (wctob);
 #elif defined GNULIB_POSIXCHECK
 # undef wctob
-# define wctob(w) \
-    (GL_LINK_WARNING ("wctob is unportable - " \
-                      "use gnulib module wctob for portability"), \
-     wctob (w))
+# if HAVE_RAW_DECL_WCTOB
+_GL_WARN_ON_USE (wctob, "wctob is unportable - "
+                 "use gnulib module wctob for portability");
+# endif
 #endif
 
 
 /* Test whether *PS is in the initial state.  */
 #if @GNULIB_MBSINIT@
 # if @REPLACE_MBSINIT@
-#  undef mbsinit
-#  define mbsinit rpl_mbsinit
-# endif
-# if !@HAVE_MBSINIT@ || @REPLACE_MBSINIT@
-extern int mbsinit (const mbstate_t *ps);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mbsinit
+#   define mbsinit rpl_mbsinit
+#  endif
+_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
+_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
+# else
+#  if !@HAVE_MBSINIT@
+_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
+#  endif
+_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (mbsinit);
 #elif defined GNULIB_POSIXCHECK
 # undef mbsinit
-# define mbsinit(p) \
-    (GL_LINK_WARNING ("mbsinit is unportable - " \
-                      "use gnulib module mbsinit for portability"), \
-     mbsinit (p))
+# if HAVE_RAW_DECL_MBSINIT
+_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
+                 "use gnulib module mbsinit for portability");
+# endif
 #endif
 
 
 /* Convert a multibyte character to a wide character.  */
 #if @GNULIB_MBRTOWC@
 # if @REPLACE_MBRTOWC@
-#  undef mbrtowc
-#  define mbrtowc rpl_mbrtowc
-# endif
-# if !@HAVE_MBRTOWC@ || @REPLACE_MBRTOWC@
-extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mbrtowc
+#   define mbrtowc rpl_mbrtowc
+#  endif
+_GL_FUNCDECL_RPL (mbrtowc, size_t,
+                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+_GL_CXXALIAS_RPL (mbrtowc, size_t,
+                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+# else
+#  if !@HAVE_MBRTOWC@
+_GL_FUNCDECL_SYS (mbrtowc, size_t,
+                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+#  endif
+_GL_CXXALIAS_SYS (mbrtowc, size_t,
+                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (mbrtowc);
 #elif defined GNULIB_POSIXCHECK
 # undef mbrtowc
-# define mbrtowc(w,s,n,p) \
-    (GL_LINK_WARNING ("mbrtowc is unportable - " \
-                      "use gnulib module mbrtowc for portability"), \
-     mbrtowc (w, s, n, p))
+# if HAVE_RAW_DECL_MBRTOWC
+_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
+                 "use gnulib module mbrtowc for portability");
+# endif
 #endif
 
 
 /* Recognize a multibyte character.  */
 #if @GNULIB_MBRLEN@
 # if @REPLACE_MBRLEN@
-#  undef mbrlen
-#  define mbrlen rpl_mbrlen
-# endif
-# if !@HAVE_MBRLEN@ || @REPLACE_MBRLEN@
-extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mbrlen
+#   define mbrlen rpl_mbrlen
+#  endif
+_GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+_GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+# else
+#  if !@HAVE_MBRLEN@
+_GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+#  endif
+_GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (mbrlen);
 #elif defined GNULIB_POSIXCHECK
 # undef mbrlen
-# define mbrlen(s,n,p) \
-    (GL_LINK_WARNING ("mbrlen is unportable - " \
-                      "use gnulib module mbrlen for portability"), \
-     mbrlen (s, n, p))
+# if HAVE_RAW_DECL_MBRLEN
+_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
+                 "use gnulib module mbrlen for portability");
+# endif
 #endif
 
 
 /* Convert a string to a wide string.  */
 #if @GNULIB_MBSRTOWCS@
 # if @REPLACE_MBSRTOWCS@
-#  undef mbsrtowcs
-#  define mbsrtowcs rpl_mbsrtowcs
-# endif
-# if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@
-extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
-     _GL_ARG_NONNULL ((2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mbsrtowcs
+#   define mbsrtowcs rpl_mbsrtowcs
+#  endif
+_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t len,
+                   mbstate_t *ps));
+# else
+#  if !@HAVE_MBSRTOWCS@
+_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t len,
+                   mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (mbsrtowcs);
 #elif defined GNULIB_POSIXCHECK
 # undef mbsrtowcs
-# define mbsrtowcs(d,s,l,p) \
-    (GL_LINK_WARNING ("mbsrtowcs is unportable - " \
-                      "use gnulib module mbsrtowcs for portability"), \
-     mbsrtowcs (d, s, l, p))
+# if HAVE_RAW_DECL_MBSRTOWCS
+_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
+                 "use gnulib module mbsrtowcs for portability");
+# endif
 #endif
 
 
 /* Convert a string to a wide string.  */
 #if @GNULIB_MBSNRTOWCS@
 # if @REPLACE_MBSNRTOWCS@
-#  undef mbsnrtowcs
-#  define mbsnrtowcs rpl_mbsnrtowcs
-# endif
-# if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@
-extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps)
-     _GL_ARG_NONNULL ((2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mbsnrtowcs
+#   define mbsnrtowcs rpl_mbsnrtowcs
+#  endif
+_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps));
+# else
+#  if !@HAVE_MBSNRTOWCS@
+_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
+                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (mbsnrtowcs);
 #elif defined GNULIB_POSIXCHECK
 # undef mbsnrtowcs
-# define mbsnrtowcs(d,s,n,l,p) \
-    (GL_LINK_WARNING ("mbsnrtowcs is unportable - " \
-                      "use gnulib module mbsnrtowcs for portability"), \
-     mbsnrtowcs (d, s, n, l, p))
+# if HAVE_RAW_DECL_MBSNRTOWCS
+_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
+                 "use gnulib module mbsnrtowcs for portability");
+# endif
 #endif
 
 
 /* Convert a wide character to a multibyte character.  */
 #if @GNULIB_WCRTOMB@
 # if @REPLACE_WCRTOMB@
-#  undef wcrtomb
-#  define wcrtomb rpl_wcrtomb
-# endif
-# if !@HAVE_WCRTOMB@ || @REPLACE_WCRTOMB@
-extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcrtomb
+#   define wcrtomb rpl_wcrtomb
+#  endif
+_GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+_GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+# else
+#  if !@HAVE_WCRTOMB@
+_GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+#  endif
+_GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (wcrtomb);
 #elif defined GNULIB_POSIXCHECK
 # undef wcrtomb
-# define wcrtomb(s,w,p) \
-    (GL_LINK_WARNING ("wcrtomb is unportable - " \
-                      "use gnulib module wcrtomb for portability"), \
-     wcrtomb (s, w, p))
+# if HAVE_RAW_DECL_WCRTOMB
+_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
+                 "use gnulib module wcrtomb for portability");
+# endif
 #endif
 
 
 /* Convert a wide string to a string.  */
 #if @GNULIB_WCSRTOMBS@
 # if @REPLACE_WCSRTOMBS@
-#  undef wcsrtombs
-#  define wcsrtombs rpl_wcsrtombs
-# endif
-# if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@
-extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
-     _GL_ARG_NONNULL ((2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcsrtombs
+#   define wcsrtombs rpl_wcsrtombs
+#  endif
+_GL_FUNCDECL_RPL (wcsrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (wcsrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t len,
+                   mbstate_t *ps));
+# else
+#  if !@HAVE_WCSRTOMBS@
+_GL_FUNCDECL_SYS (wcsrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (wcsrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t len,
+                   mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (wcsrtombs);
 #elif defined GNULIB_POSIXCHECK
 # undef wcsrtombs
-# define wcsrtombs(d,s,l,p) \
-    (GL_LINK_WARNING ("wcsrtombs is unportable - " \
-                      "use gnulib module wcsrtombs for portability"), \
-     wcsrtombs (d, s, l, p))
+# if HAVE_RAW_DECL_WCSRTOMBS
+_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
+                 "use gnulib module wcsrtombs for portability");
+# endif
 #endif
 
 
 /* Convert a wide string to a string.  */
 #if @GNULIB_WCSNRTOMBS@
 # if @REPLACE_WCSNRTOMBS@
-#  undef wcsnrtombs
-#  define wcsnrtombs rpl_wcsnrtombs
-# endif
-# if !@HAVE_WCSNRTOMBS@ || @REPLACE_WCSNRTOMBS@
-extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps)
-     _GL_ARG_NONNULL ((2));
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcsnrtombs
+#   define wcsnrtombs rpl_wcsnrtombs
+#  endif
+_GL_FUNCDECL_RPL (wcsnrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps));
+# else
+#  if !@HAVE_WCSNRTOMBS@
+_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps)
+                  _GL_ARG_NONNULL ((2)));
+#  endif
+_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
+                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
+                   mbstate_t *ps));
 # endif
+_GL_CXXALIASWARN (wcsnrtombs);
 #elif defined GNULIB_POSIXCHECK
 # undef wcsnrtombs
-# define wcsnrtombs(d,s,n,l,p) \
-    (GL_LINK_WARNING ("wcsnrtombs is unportable - " \
-                      "use gnulib module wcsnrtombs for portability"), \
-     wcsnrtombs (d, s, n, l, p))
+# if HAVE_RAW_DECL_WCSNRTOMBS
+_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
+                 "use gnulib module wcsnrtombs for portability");
+# endif
 #endif
 
 
 /* Return the number of screen columns needed for WC.  */
 #if @GNULIB_WCWIDTH@
 # if @REPLACE_WCWIDTH@
-#  undef wcwidth
-#  define wcwidth rpl_wcwidth
-extern int wcwidth (wchar_t);
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcwidth
+#   define wcwidth rpl_wcwidth
+#  endif
+_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 # else
-#  if !defined wcwidth && !@HAVE_DECL_WCWIDTH@
+#  if !@HAVE_DECL_WCWIDTH@
 /* wcwidth exists but is not declared.  */
-extern int wcwidth (int /* actually wchar_t */);
+_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
 #  endif
+_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
 # endif
+_GL_CXXALIASWARN (wcwidth);
 #elif defined GNULIB_POSIXCHECK
 # undef wcwidth
-# define wcwidth(w) \
-    (GL_LINK_WARNING ("wcwidth is unportable - " \
-                      "use gnulib module wcwidth for portability"), \
-     wcwidth (w))
+# if HAVE_RAW_DECL_WCWIDTH
+_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
+                 "use gnulib module wcwidth for portability");
+# endif
+#endif
+
+
+/* Search N wide characters of S for C.  */
+#if @GNULIB_WMEMCHR@
+# if !@HAVE_WMEMCHR@
+_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
+                                      _GL_ATTRIBUTE_PURE);
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" {
+         const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
+         wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
+       }  */
+_GL_CXXALIAS_SYS_CAST2 (wmemchr,
+                        wchar_t *, (const wchar_t *, wchar_t, size_t),
+                        const wchar_t *, (const wchar_t *, wchar_t, size_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+_GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
+                   (const wchar_t *s, wchar_t c, size_t n));
+# else
+_GL_CXXALIASWARN (wmemchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmemchr
+# if HAVE_RAW_DECL_WMEMCHR
+_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
+                 "use gnulib module wmemchr for portability");
+# endif
+#endif
+
+
+/* Compare N wide characters of S1 and S2.  */
+#if @GNULIB_WMEMCMP@
+# if !@HAVE_WMEMCMP@
+_GL_FUNCDECL_SYS (wmemcmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n)
+                  _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wmemcmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wmemcmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemcmp
+# if HAVE_RAW_DECL_WMEMCMP
+_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
+                 "use gnulib module wmemcmp for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST.  */
+#if @GNULIB_WMEMCPY@
+# if !@HAVE_WMEMCPY@
+_GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wmemcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemcpy
+# if HAVE_RAW_DECL_WMEMCPY
+_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
+                 "use gnulib module wmemcpy for portability");
+# endif
+#endif
+
+
+/* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
+   overlapping memory areas.  */
+#if @GNULIB_WMEMMOVE@
+# if !@HAVE_WMEMMOVE@
+_GL_FUNCDECL_SYS (wmemmove, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemmove, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wmemmove);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemmove
+# if HAVE_RAW_DECL_WMEMMOVE
+_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
+                 "use gnulib module wmemmove for portability");
+# endif
+#endif
+
+
+/* Set N wide characters of S to C.  */
+#if @GNULIB_WMEMSET@
+# if !@HAVE_WMEMSET@
+_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+_GL_CXXALIASWARN (wmemset);
+#elif defined GNULIB_POSIXCHECK
+# undef wmemset
+# if HAVE_RAW_DECL_WMEMSET
+_GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
+                 "use gnulib module wmemset for portability");
+# endif
+#endif
+
+
+/* Return the number of wide characters in S.  */
+#if @GNULIB_WCSLEN@
+# if !@HAVE_WCSLEN@
+_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
+_GL_CXXALIASWARN (wcslen);
+#elif defined GNULIB_POSIXCHECK
+# undef wcslen
+# if HAVE_RAW_DECL_WCSLEN
+_GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
+                 "use gnulib module wcslen for portability");
+# endif
+#endif
+
+
+/* Return the number of wide characters in S, but at most MAXLEN.  */
+#if @GNULIB_WCSNLEN@
+# if !@HAVE_WCSNLEN@
+_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
+                                   _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
+_GL_CXXALIASWARN (wcsnlen);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsnlen
+# if HAVE_RAW_DECL_WCSNLEN
+_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
+                 "use gnulib module wcsnlen for portability");
+# endif
+#endif
+
+
+/* Copy SRC to DEST.  */
+#if @GNULIB_WCSCPY@
+# if !@HAVE_WCSCPY@
+_GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIASWARN (wcscpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscpy
+# if HAVE_RAW_DECL_WCSCPY
+_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
+                 "use gnulib module wcscpy for portability");
+# endif
+#endif
+
+
+/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST.  */
+#if @GNULIB_WCPCPY@
+# if !@HAVE_WCPCPY@
+_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIASWARN (wcpcpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcpcpy
+# if HAVE_RAW_DECL_WCPCPY
+_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
+                 "use gnulib module wcpcpy for portability");
+# endif
 #endif
 
 
-#ifdef __cplusplus
-}
+/* Copy no more than N wide characters of SRC to DEST.  */
+#if @GNULIB_WCSNCPY@
+# if !@HAVE_WCSNCPY@
+_GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wcsncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncpy
+# if HAVE_RAW_DECL_WCSNCPY
+_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
+                 "use gnulib module wcsncpy for portability");
+# endif
+#endif
+
+
+/* Copy no more than N characters of SRC to DEST, returning the address of
+   the last character written into DEST.  */
+#if @GNULIB_WCPNCPY@
+# if !@HAVE_WCPNCPY@
+_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wcpncpy);
+#elif defined GNULIB_POSIXCHECK
+# undef wcpncpy
+# if HAVE_RAW_DECL_WCPNCPY
+_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
+                 "use gnulib module wcpncpy for portability");
+# endif
+#endif
+
+
+/* Append SRC onto DEST.  */
+#if @GNULIB_WCSCAT@
+# if !@HAVE_WCSCAT@
+_GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
+# endif
+_GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIASWARN (wcscat);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscat
+# if HAVE_RAW_DECL_WCSCAT
+_GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
+                 "use gnulib module wcscat for portability");
+# endif
+#endif
+
+
+/* Append no more than N wide characters of SRC onto DEST.  */
+#if @GNULIB_WCSNCAT@
+# if !@HAVE_WCSNCAT@
+_GL_FUNCDECL_SYS (wcsncat, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsncat, wchar_t *,
+                  (wchar_t *dest, const wchar_t *src, size_t n));
+_GL_CXXALIASWARN (wcsncat);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncat
+# if HAVE_RAW_DECL_WCSNCAT
+_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
+                 "use gnulib module wcsncat for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2.  */
+#if @GNULIB_WCSCMP@
+# if !@HAVE_WCSCMP@
+_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
+                               _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_CXXALIASWARN (wcscmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscmp
+# if HAVE_RAW_DECL_WCSCMP
+_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
+                 "use gnulib module wcscmp for portability");
+# endif
+#endif
+
+
+/* Compare no more than N wide characters of S1 and S2.  */
+#if @GNULIB_WCSNCMP@
+# if !@HAVE_WCSNCMP@
+_GL_FUNCDECL_SYS (wcsncmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n)
+                  _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsncmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsncmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncmp
+# if HAVE_RAW_DECL_WCSNCMP
+_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
+                 "use gnulib module wcsncmp for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2, ignoring case.  */
+#if @GNULIB_WCSCASECMP@
+# if !@HAVE_WCSCASECMP@
+_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
+                                   _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_CXXALIASWARN (wcscasecmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscasecmp
+# if HAVE_RAW_DECL_WCSCASECMP
+_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
+                 "use gnulib module wcscasecmp for portability");
+# endif
 #endif
 
-#endif /* _GL_WCHAR_H */
-#endif /* _GL_WCHAR_H */
+
+/* Compare no more than N chars of S1 and S2, ignoring case.  */
+#if @GNULIB_WCSNCASECMP@
+# if !@HAVE_WCSNCASECMP@
+_GL_FUNCDECL_SYS (wcsncasecmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n)
+                  _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsncasecmp, int,
+                  (const wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsncasecmp);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsncasecmp
+# if HAVE_RAW_DECL_WCSNCASECMP
+_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
+                 "use gnulib module wcsncasecmp for portability");
+# endif
+#endif
+
+
+/* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
+   category of the current locale.  */
+#if @GNULIB_WCSCOLL@
+# if !@HAVE_WCSCOLL@
+_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
+# endif
+_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
+_GL_CXXALIASWARN (wcscoll);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscoll
+# if HAVE_RAW_DECL_WCSCOLL
+_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
+                 "use gnulib module wcscoll for portability");
+# endif
+#endif
+
+
+/* Transform S2 into array pointed to by S1 such that if wcscmp is applied
+   to two transformed strings the result is the as applying 'wcscoll' to the
+   original strings.  */
+#if @GNULIB_WCSXFRM@
+# if !@HAVE_WCSXFRM@
+_GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIASWARN (wcsxfrm);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsxfrm
+# if HAVE_RAW_DECL_WCSXFRM
+_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
+                 "use gnulib module wcsxfrm for portability");
+# endif
+#endif
+
+
+/* Duplicate S, returning an identical malloc'd string.  */
+#if @GNULIB_WCSDUP@
+# if !@HAVE_WCSDUP@
+_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+# endif
+_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+_GL_CXXALIASWARN (wcsdup);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsdup
+# if HAVE_RAW_DECL_WCSDUP
+_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
+                 "use gnulib module wcsdup for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence of WC in WCS.  */
+#if @GNULIB_WCSCHR@
+# if !@HAVE_WCSCHR@
+_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+                                     _GL_ATTRIBUTE_PURE);
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" {
+         const wchar_t * std::wcschr (const wchar_t *, wchar_t);
+         wchar_t * std::wcschr (wchar_t *, wchar_t);
+       }  */
+_GL_CXXALIAS_SYS_CAST2 (wcschr,
+                        wchar_t *, (const wchar_t *, wchar_t),
+                        const wchar_t *, (const wchar_t *, wchar_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
+_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
+# else
+_GL_CXXALIASWARN (wcschr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcschr
+# if HAVE_RAW_DECL_WCSCHR
+_GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
+                 "use gnulib module wcschr for portability");
+# endif
+#endif
+
+
+/* Find the last occurrence of WC in WCS.  */
+#if @GNULIB_WCSRCHR@
+# if !@HAVE_WCSRCHR@
+_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
+                                      _GL_ATTRIBUTE_PURE);
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" {
+         const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
+         wchar_t * std::wcsrchr (wchar_t *, wchar_t);
+       }  */
+_GL_CXXALIAS_SYS_CAST2 (wcsrchr,
+                        wchar_t *, (const wchar_t *, wchar_t),
+                        const wchar_t *, (const wchar_t *, wchar_t));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
+_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
+# else
+_GL_CXXALIASWARN (wcsrchr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsrchr
+# if HAVE_RAW_DECL_WCSRCHR
+_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
+                 "use gnulib module wcsrchr for portability");
+# endif
+#endif
+
+
+/* Return the length of the initial segmet of WCS which consists entirely
+   of wide characters not in REJECT.  */
+#if @GNULIB_WCSCSPN@
+# if !@HAVE_WCSCSPN@
+_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
+                                   _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
+_GL_CXXALIASWARN (wcscspn);
+#elif defined GNULIB_POSIXCHECK
+# undef wcscspn
+# if HAVE_RAW_DECL_WCSCSPN
+_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
+                 "use gnulib module wcscspn for portability");
+# endif
+#endif
+
+
+/* Return the length of the initial segmet of WCS which consists entirely
+   of wide characters in ACCEPT.  */
+#if @GNULIB_WCSSPN@
+# if !@HAVE_WCSSPN@
+_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
+                                  _GL_ATTRIBUTE_PURE);
+# endif
+_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
+_GL_CXXALIASWARN (wcsspn);
+#elif defined GNULIB_POSIXCHECK
+# undef wcsspn
+# if HAVE_RAW_DECL_WCSSPN
+_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
+                 "use gnulib module wcsspn for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence in WCS of any character in ACCEPT.  */
+#if @GNULIB_WCSPBRK@
+# if !@HAVE_WCSPBRK@
+_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
+                  (const wchar_t *wcs, const wchar_t *accept)
+                  _GL_ATTRIBUTE_PURE);
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" {
+         const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
+         wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
+       }  */
+_GL_CXXALIAS_SYS_CAST2 (wcspbrk,
+                        wchar_t *, (const wchar_t *, const wchar_t *),
+                        const wchar_t *, (const wchar_t *, const wchar_t *));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
+                   (wchar_t *wcs, const wchar_t *accept));
+_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
+                   (const wchar_t *wcs, const wchar_t *accept));
+# else
+_GL_CXXALIASWARN (wcspbrk);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcspbrk
+# if HAVE_RAW_DECL_WCSPBRK
+_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
+                 "use gnulib module wcspbrk for portability");
+# endif
+#endif
+
+
+/* Find the first occurrence of NEEDLE in HAYSTACK.  */
+#if @GNULIB_WCSSTR@
+# if !@HAVE_WCSSTR@
+_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
+                  (const wchar_t *haystack, const wchar_t *needle)
+                  _GL_ATTRIBUTE_PURE);
+# endif
+  /* On some systems, this function is defined as an overloaded function:
+       extern "C++" {
+         const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
+         wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
+       }  */
+_GL_CXXALIAS_SYS_CAST2 (wcsstr,
+                        wchar_t *, (const wchar_t *, const wchar_t *),
+                        const wchar_t *, (const wchar_t *, const wchar_t *));
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
+     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+_GL_CXXALIASWARN1 (wcsstr, wchar_t *,
+                   (wchar_t *haystack, const wchar_t *needle));
+_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
+                   (const wchar_t *haystack, const wchar_t *needle));
+# else
+_GL_CXXALIASWARN (wcsstr);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsstr
+# if HAVE_RAW_DECL_WCSSTR
+_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
+                 "use gnulib module wcsstr for portability");
+# endif
+#endif
+
+
+/* Divide WCS into tokens separated by characters in DELIM.  */
+#if @GNULIB_WCSTOK@
+# if !@HAVE_WCSTOK@
+_GL_FUNCDECL_SYS (wcstok, wchar_t *,
+                  (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
+# endif
+_GL_CXXALIAS_SYS (wcstok, wchar_t *,
+                  (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
+_GL_CXXALIASWARN (wcstok);
+#elif defined GNULIB_POSIXCHECK
+# undef wcstok
+# if HAVE_RAW_DECL_WCSTOK
+_GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
+                 "use gnulib module wcstok for portability");
+# endif
+#endif
+
+
+/* Determine number of column positions required for first N wide
+   characters (or fewer if S ends before this) in S.  */
+#if @GNULIB_WCSWIDTH@
+# if @REPLACE_WCSWIDTH@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcswidth
+#   define wcswidth rpl_wcswidth
+#  endif
+_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
+                                 _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
+# else
+#  if !@HAVE_WCSWIDTH@
+_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
+                                 _GL_ATTRIBUTE_PURE);
+#  endif
+_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
+# endif
+_GL_CXXALIASWARN (wcswidth);
+#elif defined GNULIB_POSIXCHECK
+# undef wcswidth
+# if HAVE_RAW_DECL_WCSWIDTH
+_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
+                 "use gnulib module wcswidth for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_WCHAR_H */
+#endif /* _@GUARD_PREFIX@_WCHAR_H */
 #endif
index 16981b6ac40af2d90e5621b9d00cf96aeed45ac1..aa018b17db2d020cb9dab77220ffb46239c0f899 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
 
-   Copyright (C) 2006-2010 Free Software Foundation, Inc.
+   Copyright (C) 2006-2012 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,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible and Paul Eggert.  */
 
  * wctrans_t, and wctype_t are not yet implemented.
  */
 
-#ifndef _GL_WCTYPE_H
+#ifndef _@GUARD_PREFIX@_WCTYPE_H
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
 #if @HAVE_WINT_T@
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.
 # @INCLUDE_NEXT@ @NEXT_WCTYPE_H@
 #endif
 
-#ifndef _GL_WCTYPE_H
-#define _GL_WCTYPE_H
+#ifndef _@GUARD_PREFIX@_WCTYPE_H
+#define _@GUARD_PREFIX@_WCTYPE_H
 
-/* Define wint_t.  (Also done in wchar.in.h.)  */
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+/* Solaris 2.6 <wctype.h> includes <widec.h> which includes <euc.h> which
+   #defines a number of identifiers in the application namespace.  Revert
+   these #defines.  */
+#ifdef __sun
+# undef multibyte
+# undef eucw1
+# undef eucw2
+# undef eucw3
+# undef scrw1
+# undef scrw2
+# undef scrw3
+#endif
+
+/* Define wint_t and WEOF.  (Also done in wchar.in.h.)  */
 #if !@HAVE_WINT_T@ && !defined wint_t
 # define wint_t int
 # ifndef WEOF
 #  define WEOF -1
 # endif
+#else
+/* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
+   This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
+   "unchanged by default argument promotions".  Override it.  */
+# if defined _MSC_VER
+#  if !GNULIB_defined_wint_t
+#   include <crtdefs.h>
+typedef unsigned int rpl_wint_t;
+#   undef wint_t
+#   define wint_t rpl_wint_t
+#   define GNULIB_defined_wint_t 1
+#  endif
+# endif
+# ifndef WEOF
+#  define WEOF ((wint_t) -1)
+# endif
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+
+#if !GNULIB_defined_wctype_functions
 
 /* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
    Linux libc5 has <wctype.h> and the functions but they are broken.
-   Assume all 12 functions are implemented the same way, or not at all.  */
-#if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
+   Assume all 11 functions (all isw* except iswblank) are implemented the
+   same way, or not at all.  */
+# if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
 
 /* IRIX 5.3 has macros but no functions, its isw* macros refer to an
    undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
    refer to system functions like _iswctype that are not in the
    standard C library.  Rather than try to get ancient buggy
    implementations like this to work, just disable them.  */
-# undef iswalnum
-# undef iswalpha
-# undef iswblank
-# undef iswcntrl
-# undef iswdigit
-# undef iswgraph
-# undef iswlower
-# undef iswprint
-# undef iswpunct
-# undef iswspace
-# undef iswupper
-# undef iswxdigit
-# undef towlower
-# undef towupper
+#  undef iswalnum
+#  undef iswalpha
+#  undef iswblank
+#  undef iswcntrl
+#  undef iswdigit
+#  undef iswgraph
+#  undef iswlower
+#  undef iswprint
+#  undef iswpunct
+#  undef iswspace
+#  undef iswupper
+#  undef iswxdigit
+#  undef towlower
+#  undef towupper
 
 /* Linux libc5 has <wctype.h> and the functions but they are broken.  */
-# if @REPLACE_ISWCNTRL@
-#  define iswalnum rpl_iswalnum
-#  define iswalpha rpl_iswalpha
-#  define iswblank rpl_iswblank
-#  define iswcntrl rpl_iswcntrl
-#  define iswdigit rpl_iswdigit
-#  define iswgraph rpl_iswgraph
-#  define iswlower rpl_iswlower
-#  define iswprint rpl_iswprint
-#  define iswpunct rpl_iswpunct
-#  define iswspace rpl_iswspace
-#  define iswupper rpl_iswupper
-#  define iswxdigit rpl_iswxdigit
-#  define towlower rpl_towlower
-#  define towupper rpl_towupper
-# endif
+#  if @REPLACE_ISWCNTRL@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define iswalnum rpl_iswalnum
+#    define iswalpha rpl_iswalpha
+#    define iswblank rpl_iswblank
+#    define iswcntrl rpl_iswcntrl
+#    define iswdigit rpl_iswdigit
+#    define iswgraph rpl_iswgraph
+#    define iswlower rpl_iswlower
+#    define iswprint rpl_iswprint
+#    define iswpunct rpl_iswpunct
+#    define iswspace rpl_iswspace
+#    define iswupper rpl_iswupper
+#    define iswxdigit rpl_iswxdigit
+#   endif
+#  endif
+#  if @REPLACE_TOWLOWER@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define towlower rpl_towlower
+#    define towupper rpl_towupper
+#   endif
+#  endif
 
 static inline int
-iswalnum (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswalnum
+#  else
+iswalnum
+#  endif
+         (wint_t wc)
 {
   return ((wc >= '0' && wc <= '9')
           || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z'));
 }
 
 static inline int
-iswalpha (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswalpha
+#  else
+iswalpha
+#  endif
+         (wint_t wc)
 {
   return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
 }
 
 static inline int
-iswblank (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswblank
+#  else
+iswblank
+#  endif
+         (wint_t wc)
 {
   return wc == ' ' || wc == '\t';
 }
 
 static inline int
-iswcntrl (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswcntrl
+#  else
+iswcntrl
+#  endif
+        (wint_t wc)
 {
   return (wc & ~0x1f) == 0 || wc == 0x7f;
 }
 
 static inline int
-iswdigit (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswdigit
+#  else
+iswdigit
+#  endif
+         (wint_t wc)
 {
   return wc >= '0' && wc <= '9';
 }
 
 static inline int
-iswgraph (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswgraph
+#  else
+iswgraph
+#  endif
+         (wint_t wc)
 {
   return wc >= '!' && wc <= '~';
 }
 
 static inline int
-iswlower (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswlower
+#  else
+iswlower
+#  endif
+         (wint_t wc)
 {
   return wc >= 'a' && wc <= 'z';
 }
 
 static inline int
-iswprint (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswprint
+#  else
+iswprint
+#  endif
+         (wint_t wc)
 {
   return wc >= ' ' && wc <= '~';
 }
 
 static inline int
-iswpunct (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswpunct
+#  else
+iswpunct
+#  endif
+         (wint_t wc)
 {
   return (wc >= '!' && wc <= '~'
           && !((wc >= '0' && wc <= '9')
@@ -169,40 +251,77 @@ iswpunct (wint_t wc)
 }
 
 static inline int
-iswspace (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswspace
+#  else
+iswspace
+#  endif
+         (wint_t wc)
 {
   return (wc == ' ' || wc == '\t'
           || wc == '\n' || wc == '\v' || wc == '\f' || wc == '\r');
 }
 
 static inline int
-iswupper (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswupper
+#  else
+iswupper
+#  endif
+         (wint_t wc)
 {
   return wc >= 'A' && wc <= 'Z';
 }
 
 static inline int
-iswxdigit (wint_t wc)
+#  if @REPLACE_ISWCNTRL@
+rpl_iswxdigit
+#  else
+iswxdigit
+#  endif
+          (wint_t wc)
 {
   return ((wc >= '0' && wc <= '9')
           || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F'));
 }
 
 static inline wint_t
-towlower (wint_t wc)
+#  if @REPLACE_TOWLOWER@
+rpl_towlower
+#  else
+towlower
+#  endif
+         (wint_t wc)
 {
   return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
 }
 
 static inline wint_t
-towupper (wint_t wc)
+#  if @REPLACE_TOWLOWER@
+rpl_towupper
+#  else
+towupper
+#  endif
+         (wint_t wc)
 {
   return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
 }
 
-#endif /* ! HAVE_ISWCNTRL || REPLACE_ISWCNTRL */
+# elif @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@)
+/* Only the iswblank function is missing.  */
+
+#  if @REPLACE_ISWBLANK@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define iswblank rpl_iswblank
+#   endif
+_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
+#  else
+_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
+#  endif
 
-#if defined __MINGW32__
+# endif
+
+# if defined __MINGW32__
 
 /* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
    The functions towlower and towupper are implemented in the MSVCRT library
@@ -222,20 +341,158 @@ rpl_towlower (wint_t wc)
 {
   return (wint_t) (wchar_t) towlower (wc);
 }
-# define towlower rpl_towlower
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define towlower rpl_towlower
+#  endif
 
 static inline wint_t
 rpl_towupper (wint_t wc)
 {
   return (wint_t) (wchar_t) towupper (wc);
 }
-# define towupper rpl_towupper
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define towupper rpl_towupper
+#  endif
 
-#endif /* __MINGW32__ */
+# endif /* __MINGW32__ */
 
-#ifdef __cplusplus
-}
+# define GNULIB_defined_wctype_functions 1
 #endif
 
-#endif /* _GL_WCTYPE_H */
-#endif /* _GL_WCTYPE_H */
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
+_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswlower, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswprint, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswspace, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
+_GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
+#endif
+_GL_CXXALIASWARN (iswalnum);
+_GL_CXXALIASWARN (iswalpha);
+_GL_CXXALIASWARN (iswcntrl);
+_GL_CXXALIASWARN (iswdigit);
+_GL_CXXALIASWARN (iswgraph);
+_GL_CXXALIASWARN (iswlower);
+_GL_CXXALIASWARN (iswprint);
+_GL_CXXALIASWARN (iswpunct);
+_GL_CXXALIASWARN (iswspace);
+_GL_CXXALIASWARN (iswupper);
+_GL_CXXALIASWARN (iswxdigit);
+
+#if @GNULIB_ISWBLANK@
+# if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@
+_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
+# else
+_GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
+# endif
+_GL_CXXALIASWARN (iswblank);
+#endif
+
+#if !@HAVE_WCTYPE_T@
+# if !GNULIB_defined_wctype_t
+typedef void * wctype_t;
+#  define GNULIB_defined_wctype_t 1
+# endif
+#endif
+
+/* Get a descriptor for a wide character property.  */
+#if @GNULIB_WCTYPE@
+# if !@HAVE_WCTYPE_T@
+_GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name));
+# endif
+_GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
+_GL_CXXALIASWARN (wctype);
+#elif defined GNULIB_POSIXCHECK
+# undef wctype
+# if HAVE_RAW_DECL_WCTYPE
+_GL_WARN_ON_USE (wctype, "wctype is unportable - "
+                 "use gnulib module wctype for portability");
+# endif
+#endif
+
+/* Test whether a wide character has a given property.
+   The argument WC must be either a wchar_t value or WEOF.
+   The argument DESC must have been returned by the wctype() function.  */
+#if @GNULIB_ISWCTYPE@
+# if !@HAVE_WCTYPE_T@
+_GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc));
+# endif
+_GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc));
+_GL_CXXALIASWARN (iswctype);
+#elif defined GNULIB_POSIXCHECK
+# undef iswctype
+# if HAVE_RAW_DECL_ISWCTYPE
+_GL_WARN_ON_USE (iswctype, "iswctype is unportable - "
+                 "use gnulib module iswctype for portability");
+# endif
+#endif
+
+#if @REPLACE_TOWLOWER@ || defined __MINGW32__
+_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
+_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
+#else
+_GL_CXXALIAS_SYS (towlower, wint_t, (wint_t wc));
+_GL_CXXALIAS_SYS (towupper, wint_t, (wint_t wc));
+#endif
+_GL_CXXALIASWARN (towlower);
+_GL_CXXALIASWARN (towupper);
+
+#if !@HAVE_WCTRANS_T@
+# if !GNULIB_defined_wctrans_t
+typedef void * wctrans_t;
+#  define GNULIB_defined_wctrans_t 1
+# endif
+#endif
+
+/* Get a descriptor for a wide character case conversion.  */
+#if @GNULIB_WCTRANS@
+# if !@HAVE_WCTRANS_T@
+_GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name));
+# endif
+_GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
+_GL_CXXALIASWARN (wctrans);
+#elif defined GNULIB_POSIXCHECK
+# undef wctrans
+# if HAVE_RAW_DECL_WCTRANS
+_GL_WARN_ON_USE (wctrans, "wctrans is unportable - "
+                 "use gnulib module wctrans for portability");
+# endif
+#endif
+
+/* Perform a given case conversion on a wide character.
+   The argument WC must be either a wchar_t value or WEOF.
+   The argument DESC must have been returned by the wctrans() function.  */
+#if @GNULIB_TOWCTRANS@
+# if !@HAVE_WCTRANS_T@
+_GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
+# endif
+_GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
+_GL_CXXALIASWARN (towctrans);
+#elif defined GNULIB_POSIXCHECK
+# undef towctrans
+# if HAVE_RAW_DECL_TOWCTRANS
+_GL_WARN_ON_USE (towctrans, "towctrans is unportable - "
+                 "use gnulib module towctrans for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_WCTYPE_H */
+#endif /* _@GUARD_PREFIX@_WCTYPE_H */
index 4b220403b062571131f279491f4bb522e0d2766d..e85d6dfb69f87e64059c7296fe181fe691355ebb 100644 (file)
@@ -1,7 +1,7 @@
 /* Report a memory allocation failure and exit.
 
-   Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2006, 2009, 2010
-   Free Software Foundation, Inc.
+   Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2012 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
@@ -33,7 +33,7 @@ xalloc_die (void)
 {
   error (exit_failure, 0, "%s", _("memory exhausted"));
 
-  /* The `noreturn' cannot be given to error, since it may return if
+  /* _Noreturn cannot be given to error, since it may return if
      its first argument is 0.  To help compilers understand the
      xalloc_die does not return, call abort.  Also, the abort is a
      safety feature if exit_failure is 0 (which shouldn't happen).  */
diff --git a/lib/xalloc-oversized.h b/lib/xalloc-oversized.h
new file mode 100644 (file)
index 0000000..6779755
--- /dev/null
@@ -0,0 +1,38 @@
+/* xalloc-oversized.h -- memory allocation size checking
+
+   Copyright (C) 1990-2000, 2003-2004, 2006-2012 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
+   the Free Software Foundation; either version 3 of the License, 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.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef XALLOC_OVERSIZED_H_
+# define XALLOC_OVERSIZED_H_
+
+# include <stddef.h>
+
+/* Return 1 if an array of N objects, each of size S, cannot exist due
+   to size arithmetic overflow.  S must be positive and N must be
+   nonnegative.  This is a macro, not an inline function, so that it
+   works correctly even when SIZE_MAX < N.
+
+   By gnulib convention, SIZE_MAX represents overflow in size
+   calculations, so the conservative dividend to use here is
+   SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value.
+   However, malloc (SIZE_MAX) fails on all known hosts where
+   sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for
+   exactly-SIZE_MAX allocations on such hosts; this avoids a test and
+   branch when S is known to be 1.  */
+# define xalloc_oversized(n, s) \
+    ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
+
+#endif /* !XALLOC_OVERSIZED_H_ */
index 6122cc58b05d87da38d9f11f9dbcd849113c5b31..6f5b87ee2dd8b79d3e6e37d93b3fe46b7ed3ddef 100644 (file)
@@ -1,8 +1,6 @@
 /* xalloc.h -- malloc with out-of-memory checking
 
-   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2003, 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-   Inc.
+   Copyright (C) 1990-2000, 2003-2004, 2006-2012 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
 
 # include <stddef.h>
 
+# include "xalloc-oversized.h"
 
 # ifdef __cplusplus
 extern "C" {
 # endif
 
 
-# ifndef __attribute__
-#  if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
-#   define __attribute__(x)
-#  endif
-# endif
-
-# ifndef ATTRIBUTE_NORETURN
-#  define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+# if __GNUC__ >= 3
+#  define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+#  define _GL_ATTRIBUTE_MALLOC
 # endif
 
-# ifndef ATTRIBUTE_MALLOC
-#  if __GNUC__ >= 3
-#   define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-#  else
-#   define ATTRIBUTE_MALLOC
-#  endif
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#  define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
+# else
+#  define _GL_ATTRIBUTE_ALLOC_SIZE(args)
 # endif
 
 /* This function is always triggered when memory is exhausted.
@@ -51,31 +44,21 @@ extern "C" {
    or by using gnulib's xalloc-die module.  This is the
    function to call when one wants the program to die because of a
    memory allocation failure.  */
-extern void xalloc_die (void) ATTRIBUTE_NORETURN;
-
-void *xmalloc (size_t s) ATTRIBUTE_MALLOC;
-void *xzalloc (size_t s) ATTRIBUTE_MALLOC;
-void *xcalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
-void *xrealloc (void *p, size_t s);
+extern _Noreturn void xalloc_die (void);
+
+void *xmalloc (size_t s)
+      _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1));
+void *xzalloc (size_t s)
+      _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1));
+void *xcalloc (size_t n, size_t s)
+      _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2));
+void *xrealloc (void *p, size_t s)
+      _GL_ATTRIBUTE_ALLOC_SIZE ((2));
 void *x2realloc (void *p, size_t *pn);
-void *xmemdup (void const *p, size_t s) ATTRIBUTE_MALLOC;
-char *xstrdup (char const *str) ATTRIBUTE_MALLOC;
-
-/* Return 1 if an array of N objects, each of size S, cannot exist due
-   to size arithmetic overflow.  S must be positive and N must be
-   nonnegative.  This is a macro, not an inline function, so that it
-   works correctly even when SIZE_MAX < N.
-
-   By gnulib convention, SIZE_MAX represents overflow in size
-   calculations, so the conservative dividend to use here is
-   SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value.
-   However, malloc (SIZE_MAX) fails on all known hosts where
-   sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for
-   exactly-SIZE_MAX allocations on such hosts; this avoids a test and
-   branch when S is known to be 1.  */
-# define xalloc_oversized(n, s) \
-    ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
-
+void *xmemdup (void const *p, size_t s)
+      _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((2));
+char *xstrdup (char const *str)
+      _GL_ATTRIBUTE_MALLOC;
 
 /* In the following macros, T must be an elementary or structure/union or
    typedef'ed type, or a pointer to such a type.  To apply one of the
@@ -106,10 +89,13 @@ char *xstrdup (char const *str) ATTRIBUTE_MALLOC;
 # if HAVE_INLINE
 #  define static_inline static inline
 # else
-void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
-void *xnrealloc (void *p, size_t n, size_t s);
+void *xnmalloc (size_t n, size_t s)
+      _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2));
+void *xnrealloc (void *p, size_t n, size_t s)
+      _GL_ATTRIBUTE_ALLOC_SIZE ((2, 3));
 void *x2nrealloc (void *p, size_t *pn, size_t s);
-char *xcharalloc (size_t n) ATTRIBUTE_MALLOC;
+char *xcharalloc (size_t n)
+      _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1));
 # endif
 
 # ifdef static_inline
@@ -117,7 +103,8 @@ char *xcharalloc (size_t n) ATTRIBUTE_MALLOC;
 /* Allocate an array of N objects, each with S bytes of memory,
    dynamically, with error checking.  S must be nonzero.  */
 
-static_inline void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
+static_inline void *xnmalloc (size_t n, size_t s)
+                    _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2));
 static_inline void *
 xnmalloc (size_t n, size_t s)
 {
@@ -129,6 +116,8 @@ xnmalloc (size_t n, size_t s)
 /* Change the size of an allocated block of memory P to an array of N
    objects each of S bytes, with error checking.  S must be nonzero.  */
 
+static_inline void *xnrealloc (void *p, size_t n, size_t s)
+                    _GL_ATTRIBUTE_ALLOC_SIZE ((2, 3));
 static_inline void *
 xnrealloc (void *p, size_t n, size_t s)
 {
@@ -203,9 +192,9 @@ x2nrealloc (void *p, size_t *pn, size_t s)
         {
           /* The approximate size to use for initial small allocation
              requests, when the invoking code specifies an old size of
-             zero.  64 bytes is the largest "small" request for the
-             GNU C library malloc.  */
-          enum { DEFAULT_MXFAST = 64 };
+             zero.  This is the largest "small" request for the GNU C
+             library malloc.  */
+          enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 };
 
           n = DEFAULT_MXFAST / s;
           n += !n;
@@ -229,7 +218,8 @@ x2nrealloc (void *p, size_t *pn, size_t s)
 /* Return a pointer to a new buffer of N bytes.  This is like xmalloc,
    except it returns char *.  */
 
-static_inline char *xcharalloc (size_t n) ATTRIBUTE_MALLOC;
+static_inline char *xcharalloc (size_t n)
+                    _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1));
 static_inline char *
 xcharalloc (size_t n)
 {
diff --git a/lib/xgetcwd.c b/lib/xgetcwd.c
deleted file mode 100644 (file)
index 8b78aa2..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* xgetcwd.c -- return current directory with unlimited length
-
-   Copyright (C) 2001, 2003-2004, 2006-2007, 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Written by Jim Meyering.  */
-
-#include <config.h>
-
-#include "xgetcwd.h"
-
-#include <errno.h>
-#include <unistd.h>
-
-#include "xalloc.h"
-
-/* Return the current directory, newly allocated.
-   Upon an out-of-memory error, call xalloc_die.
-   Upon any other type of error, return NULL.  */
-
-char *
-xgetcwd (void)
-{
-  char *cwd = getcwd (NULL, 0);
-  if (! cwd && errno == ENOMEM)
-    xalloc_die ();
-  return cwd;
-}
diff --git a/lib/xgetcwd.h b/lib/xgetcwd.h
deleted file mode 100644 (file)
index ad427e8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/* prototype for xgetcwd
-   Copyright (C) 1995, 2001, 2003, 2009-2010 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
-   the Free Software Foundation; either version 3 of the License, 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.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-extern char *xgetcwd (void);
index ecce5296903651062f662098c87dbc29cb0c7f2c..3b5f86cdca11571c5326d9833d3597413e3e4425 100644 (file)
@@ -1,8 +1,6 @@
 /* xmalloc.c -- malloc with out of memory checking
 
-   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010 Free Software
-   Foundation, Inc.
+   Copyright (C) 1990-2000, 2002-2006, 2008-2012 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
@@ -30,8 +28,8 @@
 
 /* 1 if calloc is known to be compatible with GNU calloc.  This
    matters if we are not also using the calloc module, which defines
-   HAVE_CALLOC and supports the GNU API even on non-GNU platforms.  */
-#if defined HAVE_CALLOC || defined __GLIBC__
+   HAVE_CALLOC_GNU and supports the GNU API even on non-GNU platforms.  */
+#if defined HAVE_CALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__)
 enum { HAVE_GNU_CALLOC = 1 };
 #else
 enum { HAVE_GNU_CALLOC = 0 };
@@ -54,8 +52,16 @@ xmalloc (size_t n)
 void *
 xrealloc (void *p, size_t n)
 {
+  if (!n && p)
+    {
+      /* The GNU and C99 realloc behaviors disagree here.  Act like
+         GNU, even if the underlying realloc is C99.  */
+      free (p);
+      return NULL;
+    }
+
   p = realloc (p, n);
-  if (!p && n != 0)
+  if (!p && n)
     xalloc_die ();
   return p;
 }
index e238635aede2957717957924a1e37dd9c75a3f1a..515327e97f7517362e60c8f6eb2d54e3a861167d 100644 (file)
@@ -1,8 +1,6 @@
-/* -*- buffer-read-only: t -*- vi: set ro: */
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* xsize.h -- Checked size_t computations.
 
-   Copyright (C) 2003, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008-2012 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,8 +13,7 @@
    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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef _XSIZE_H
 #define _XSIZE_H
index fb5ef3661167e33fd9fc4ad9245bd759ac35517d..f379cf87e8c44f951b962d974052fd2d1f1b747e 100644 (file)
@@ -1,6 +1,6 @@
 /* yesno.c -- read a yes/no response from stdin
 
-   Copyright (C) 1990, 1998, 2001, 2003-2010 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1998, 2001, 2003-2012 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
index 8be630091b4f0152da97ebfe0d4c25545c2f30db..af9639c41c340395ca8a4a6e5eb14be78c5b37b4 100644 (file)
@@ -1,5 +1,5 @@
 /* declare yesno
-   Copyright (C) 2004, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2009-2012 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
diff --git a/lzw.h b/lzw.h
index 69c479c49423f39737639499a1caea0f319407e5..7f7813419632e4a4ec2d82ab2eea9b92d0041d5a 100644 (file)
--- a/lzw.h
+++ b/lzw.h
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#if !defined(OF) && defined(lint)
-#  include "gzip.h"
-#endif
-
 #ifndef BITS
 #  define BITS 16
 #endif
@@ -50,5 +46,5 @@
 extern int maxbits;      /* max bits per code for LZW */
 extern int block_mode;   /* block compress mode -C compatible with 2.0 */
 
-extern int lzw    OF((int in, int out));
-extern int unlzw  OF((int in, int out));
+extern int lzw    (int in, int out);
+extern int unlzw  (int in, int out);
index 301469b31cef0ba55efc7c41e701ae5fa715834d..d978cb898cf3ce2771d98747e32045c041342fcd 100644 (file)
@@ -1,5 +1,5 @@
 # 00gnulib.m4 serial 2
-dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2012 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.
index f3ee34380cda13d5463e465bdb2c6d691169d449..656924be889bb37955e32a86810dc6666d2fa637 100644 (file)
@@ -1,5 +1,5 @@
-# alloca.m4 serial 9
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation,
+# alloca.m4 serial 14
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2012 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,10 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_ALLOCA],
 [
-  dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
-  AC_REQUIRE([AC_PROG_CPP])
-  AC_REQUIRE([AC_PROG_EGREP])
-
   AC_REQUIRE([AC_FUNC_ALLOCA])
   if test $ac_cv_func_alloca_works = no; then
     gl_PREREQ_ALLOCA
@@ -40,8 +36,86 @@ AC_DEFUN([gl_FUNC_ALLOCA],
     ALLOCA_H=alloca.h
   fi
   AC_SUBST([ALLOCA_H])
+  AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
 ])
 
 # Prerequisites of lib/alloca.c.
 # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
 AC_DEFUN([gl_PREREQ_ALLOCA], [:])
+
+# This works around a bug in autoconf <= 2.68.
+# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>.
+
+m4_version_prereq([2.69], [] ,[
+
+# This is taken from the following Autoconf patch:
+# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
+
+# _AC_LIBOBJ_ALLOCA
+# -----------------
+# Set up the LIBOBJ replacement of 'alloca'.  Well, not exactly
+# AC_LIBOBJ since we actually set the output variable 'ALLOCA'.
+# Nevertheless, for Automake, AC_LIBSOURCES it.
+m4_define([_AC_LIBOBJ_ALLOCA],
+[# The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble.  Some versions do not even contain alloca or
+# contain a buggy version.  If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+AC_LIBSOURCES(alloca.c)
+AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
+AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
+
+AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray,
+[AC_EGREP_CPP(webecray,
+[#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
+if test $ac_cv_os_cray = yes; then
+  for ac_func in _getb67 GETB67 getb67; do
+    AC_CHECK_FUNC($ac_func,
+                  [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
+                                      [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.])
+    break])
+  done
+fi
+
+AC_CACHE_CHECK([stack direction for C alloca],
+               [ac_cv_c_stack_direction],
+[AC_RUN_IFELSE([AC_LANG_SOURCE(
+[AC_INCLUDES_DEFAULT
+int
+find_stack_direction (int *addr, int depth)
+{
+  int dir, dummy = 0;
+  if (! addr)
+    addr = &dummy;
+  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+  return dir + dummy;
+}
+
+int
+main (int argc, char **argv)
+{
+  return find_stack_direction (0, argc + !argv + 20) < 0;
+}])],
+               [ac_cv_c_stack_direction=1],
+               [ac_cv_c_stack_direction=-1],
+               [ac_cv_c_stack_direction=0])])
+AH_VERBATIM([STACK_DIRECTION],
+[/* 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 runtime.
+        STACK_DIRECTION > 0 => grows toward higher addresses
+        STACK_DIRECTION < 0 => grows toward lower addresses
+        STACK_DIRECTION = 0 => direction of growth unknown */
+@%:@undef STACK_DIRECTION])dnl
+AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
+])# _AC_LIBOBJ_ALLOCA
+])
diff --git a/m4/asm-underscore.m4 b/m4/asm-underscore.m4
new file mode 100644 (file)
index 0000000..478aa03
--- /dev/null
@@ -0,0 +1,71 @@
+# asm-underscore.m4 serial 2
+dnl Copyright (C) 2010-2012 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.
+
+dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
+
+# gl_ASM_SYMBOL_PREFIX
+# Tests for the prefix of C symbols at the assembly language level and the
+# linker level. This prefix is either an underscore or empty. Defines the
+# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
+# a stringified variant of this prefix.
+
+AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
+[
+  dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
+  dnl 1. It works only for GCC.
+  dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
+  AC_REQUIRE([gl_C_ASM])
+  AC_CACHE_CHECK(
+    [whether C symbols are prefixed with underscore at the linker level],
+    [gl_cv_prog_as_underscore],
+    [cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" int foo (void);
+#endif
+int foo(void) { return 0; }
+EOF
+     # Look for the assembly language name in the .s file.
+     AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
+     if grep _foo conftest.$gl_asmext >/dev/null ; then
+       gl_cv_prog_as_underscore=yes
+     else
+       gl_cv_prog_as_underscore=no
+     fi
+     rm -f conftest*
+    ])
+  if test $gl_cv_prog_as_underscore = yes; then
+    USER_LABEL_PREFIX=_
+  else
+    USER_LABEL_PREFIX=
+  fi
+  AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
+    [Define to the prefix of C symbols at the assembler and linker level,
+     either an underscore or empty.])
+  ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
+  AC_SUBST([ASM_SYMBOL_PREFIX])
+])
+
+# gl_C_ASM
+# Determines how to produce an assembly language file from C source code.
+# Sets the variables:
+#   gl_asmext - the extension of assembly language output,
+#   gl_c_asm_opt - the C compiler option that produces assembly language output.
+
+AC_DEFUN([gl_C_ASM],
+[
+  AC_EGREP_CPP([MicrosoftCompiler],
+    [
+#ifdef _MSC_VER
+MicrosoftCompiler
+#endif
+    ],
+    [gl_asmext='asm'
+     gl_c_asm_opt='-c -Fa'
+    ],
+    [gl_asmext='s'
+     gl_c_asm_opt='-S'
+    ])
+])
index 22cffbd65ffbb1556e2d65eac373942b5ec762d4..00c5fe43cf3ae636f36dca1e468fa8eda294278d 100644 (file)
@@ -1,6 +1,6 @@
-# calloc.m4 serial 9
+# calloc.m4 serial 15
 
-# Copyright (C) 2004-2010 Free Software Foundation, Inc.
+# Copyright (C) 2004-2012 Free Software Foundation, Inc.
 # This file 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.
 
 # _AC_FUNC_CALLOC_IF([IF-WORKS], [IF-NOT])
 # -------------------------------------
-# If `calloc (0, 0)' is properly handled, run IF-WORKS, otherwise, IF-NOT.
+# If 'calloc (0, 0)' is properly handled, run IF-WORKS, otherwise, IF-NOT.
 AC_DEFUN([_AC_FUNC_CALLOC_IF],
-[AC_REQUIRE([AC_TYPE_SIZE_T])dnl
-AC_CACHE_CHECK([for GNU libc compatible calloc], [ac_cv_func_calloc_0_nonnull],
-[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
-                  [[exit (!calloc (0, 0) || calloc ((size_t) -1 / 8 + 1, 8));]])],
-               [ac_cv_func_calloc_0_nonnull=yes],
-               [ac_cv_func_calloc_0_nonnull=no],
-               [ac_cv_func_calloc_0_nonnull=no])])
-AS_IF([test $ac_cv_func_calloc_0_nonnull = yes], [$1], [$2])
+[
+  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CACHE_CHECK([for GNU libc compatible calloc],
+    [ac_cv_func_calloc_0_nonnull],
+    [AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM(
+          [AC_INCLUDES_DEFAULT],
+          [[int result = 0;
+            if (!calloc (0, 0))
+              result |= 1;
+            if (calloc ((size_t) -1 / 8 + 1, 8))
+              result |= 2;
+            return result;
+          ]])],
+       [ac_cv_func_calloc_0_nonnull=yes],
+       [ac_cv_func_calloc_0_nonnull=no],
+       [case "$host_os" in
+                  # Guess yes on glibc systems.
+          *-gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+                  # If we don't know, assume the worst.
+          *)      ac_cv_func_calloc_0_nonnull="guessing no" ;;
+        esac
+       ])])
+  case "$ac_cv_func_calloc_0_nonnull" in
+    *yes)
+      $1
+      ;;
+    *)
+      $2
+      ;;
+  esac
 ])# AC_FUNC_CALLOC
 
 
-# AC_FUNC_CALLOC
-# ---------------
-# Report whether `calloc (0, 0)' is properly handled, and replace calloc if
+# gl_FUNC_CALLOC_GNU
+# ------------------
+# Report whether 'calloc (0, 0)' is properly handled, and replace calloc if
 # needed.
-AC_DEFUN([AC_FUNC_CALLOC],
-[_AC_FUNC_CALLOC_IF(
-  [AC_DEFINE([HAVE_CALLOC], [1],
-             [Define to 1 if your system has a GNU libc compatible `calloc'
-              function, and to 0 otherwise.])],
-  [AC_DEFINE([HAVE_CALLOC], [0])
-   AC_LIBOBJ([calloc])
-   AC_DEFINE([calloc], [rpl_calloc],
-      [Define to rpl_calloc if the replacement function should be used.])])
-])# AC_FUNC_CALLOC
+AC_DEFUN([gl_FUNC_CALLOC_GNU],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  _AC_FUNC_CALLOC_IF(
+    [AC_DEFINE([HAVE_CALLOC_GNU], [1],
+               [Define to 1 if your system has a GNU libc compatible 'calloc'
+                function, and to 0 otherwise.])],
+    [AC_DEFINE([HAVE_CALLOC_GNU], [0])
+     REPLACE_CALLOC=1
+    ])
+])# gl_FUNC_CALLOC_GNU
 
 
 # gl_FUNC_CALLOC_POSIX
@@ -49,14 +74,12 @@ AC_DEFUN([AC_FUNC_CALLOC],
 # fails), and replace calloc if it is not.
 AC_DEFUN([gl_FUNC_CALLOC_POSIX],
 [
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
   if test $gl_cv_func_malloc_posix = yes; then
-    HAVE_CALLOC_POSIX=1
     AC_DEFINE([HAVE_CALLOC_POSIX], [1],
       [Define if the 'calloc' function is POSIX compliant.])
   else
-    AC_LIBOBJ([calloc])
-    HAVE_CALLOC_POSIX=0
+    REPLACE_CALLOC=1
   fi
-  AC_SUBST([HAVE_CALLOC_POSIX])
 ])
index 17fe727a6c96a2c3aca705a63f90296b1b2c5a28..6180891b5ec236354a078641ef9876f288343db8 100644 (file)
@@ -1,4 +1,4 @@
-#serial 11
+#serial 14
 
 # Use Gnulib's robust chdir function.
 # It can handle arbitrarily long directory names, which means
@@ -6,7 +6,7 @@
 # never fails with ENAMETOOLONG.
 # Arrange to compile chdir-long.c only on systems that define PATH_MAX.
 
-dnl Copyright (C) 2004-2007, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2007, 2009-2012 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.
@@ -15,21 +15,16 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_CHDIR_LONG],
 [
+  AC_REQUIRE([gl_PATHMAX_SNIPPET_PREREQ])
   AC_CACHE_CHECK([whether this system has an arbitrary file name length limit],
     gl_cv_have_arbitrary_file_name_length_limit,
     [AC_EGREP_CPP([have_arbitrary_file_name_length_limit],
-                  [#include <unistd.h>
-#include <limits.h>
-#if defined PATH_MAX || defined MAXPATHLEN
+                  gl_PATHMAX_SNIPPET[
+#ifdef PATH_MAX
 have_arbitrary_file_name_length_limit
 #endif],
     gl_cv_have_arbitrary_file_name_length_limit=yes,
     gl_cv_have_arbitrary_file_name_length_limit=no)])
-
-  if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then
-    AC_LIBOBJ([chdir-long])
-    gl_PREREQ_CHDIR_LONG
-  fi
 ])
 
 AC_DEFUN([gl_PREREQ_CHDIR_LONG],
diff --git a/m4/chown.m4 b/m4/chown.m4
deleted file mode 100644 (file)
index 0c32fa3..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-# serial 22
-# Determine whether we need the chown wrapper.
-
-dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2010 Free Software
-dnl 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.
-
-# chown should accept arguments of -1 for uid and gid, and it should
-# dereference symlinks.  If it doesn't, arrange to use the replacement
-# function.
-
-# From Jim Meyering.
-
-AC_DEFUN_ONCE([gl_FUNC_CHOWN],
-[
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  AC_REQUIRE([AC_TYPE_UID_T])
-  AC_REQUIRE([AC_FUNC_CHOWN])
-  AC_REQUIRE([gl_FUNC_CHOWN_FOLLOWS_SYMLINK])
-  AC_CHECK_FUNCS_ONCE([chown fchown])
-
-  dnl mingw lacks chown altogether.
-  if test $ac_cv_func_chown = no; then
-    HAVE_CHOWN=0
-    AC_LIBOBJ([chown])
-  else
-    dnl Some old systems treated chown like lchown.
-    if test $gl_cv_func_chown_follows_symlink = no; then
-      REPLACE_CHOWN=1
-      AC_LIBOBJ([chown])
-    fi
-
-    dnl Some old systems tried to use uid/gid -1 literally.
-    if test $ac_cv_func_chown_works = no; then
-      AC_DEFINE([CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE], [1],
-        [Define if chown is not POSIX compliant regarding IDs of -1.])
-      REPLACE_CHOWN=1
-      AC_LIBOBJ([chown])
-    fi
-
-    dnl Solaris 9 ignores trailing slash.
-    dnl FreeBSD 7.2 mishandles trailing slash on symlinks.
-    AC_CACHE_CHECK([whether chown honors trailing slash],
-      [gl_cv_func_chown_slash_works],
-      [touch conftest.file && rm -f conftest.link
-       AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-]], [[    if (symlink ("conftest.file", "conftest.link")) return 1;
-          if (chown ("conftest.link/", getuid (), getgid ()) == 0) return 2;
-        ]])],
-        [gl_cv_func_chown_slash_works=yes],
-        [gl_cv_func_chown_slash_works=no],
-        [gl_cv_func_chown_slash_works="guessing no"])
-      rm -f conftest.link conftest.file])
-    if test "$gl_cv_func_chown_slash_works" != yes; then
-      AC_DEFINE([CHOWN_TRAILING_SLASH_BUG], [1],
-        [Define to 1 if chown mishandles trailing slash.])
-      REPLACE_CHOWN=1
-      AC_LIBOBJ([chown])
-    fi
-
-    dnl OpenBSD fails to update ctime if ownership does not change.
-    AC_CACHE_CHECK([whether chown always updates ctime],
-      [gl_cv_func_chown_ctime_works],
-      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-]], [[    struct stat st1, st2;
-          if (close (creat ("conftest.file", 0600))) return 1;
-          if (stat ("conftest.file", &st1)) return 2;
-          sleep (1);
-          if (chown ("conftest.file", st1.st_uid, st1.st_gid)) return 3;
-          if (stat ("conftest.file", &st2)) return 4;
-          if (st2.st_ctime <= st1.st_ctime) return 5;
-        ]])],
-        [gl_cv_func_chown_ctime_works=yes],
-        [gl_cv_func_chown_ctime_works=no],
-        [gl_cv_func_chown_ctime_works="guessing no"])
-      rm -f conftest.file])
-    if test "$gl_cv_func_chown_ctime_works" != yes; then
-      AC_DEFINE([CHOWN_CHANGE_TIME_BUG], [1], [Define to 1 if chown fails
-        to change ctime when at least one argument was not -1.])
-      REPLACE_CHOWN=1
-      AC_LIBOBJ([chown])
-    fi
-
-    if test $REPLACE_CHOWN = 1 && test $ac_cv_func_fchown = no; then
-      AC_LIBOBJ([fchown-stub])
-    fi
-  fi
-])
-
-# Determine whether chown follows symlinks (it should).
-AC_DEFUN_ONCE([gl_FUNC_CHOWN_FOLLOWS_SYMLINK],
-[
-  AC_CACHE_CHECK(
-    [whether chown dereferences symlinks],
-    [gl_cv_func_chown_follows_symlink],
-    [
-      AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-
-        int
-        main ()
-        {
-          char const *dangling_symlink = "conftest.dangle";
-
-          unlink (dangling_symlink);
-          if (symlink ("conftest.no-such", dangling_symlink))
-            abort ();
-
-          /* Exit successfully on a conforming system,
-             i.e., where chown must fail with ENOENT.  */
-          exit ( ! (chown (dangling_symlink, getuid (), getgid ()) != 0
-                    && errno == ENOENT));
-        }
-        ]])],
-        [gl_cv_func_chown_follows_symlink=yes],
-        [gl_cv_func_chown_follows_symlink=no],
-        [gl_cv_func_chown_follows_symlink=yes]
-      )
-    ]
-  )
-
-  if test $gl_cv_func_chown_follows_symlink = no; then
-    AC_DEFINE([CHOWN_MODIFIES_SYMLINK], [1],
-      [Define if chown modifies symlinks.])
-  fi
-])
index 8be179db8730c7b0d015c2ab360f43a63989c4d5..0bec0ef860f0308335a7107d16f172d0374f7165 100644 (file)
@@ -1,5 +1,5 @@
 # clock_time.m4 serial 10
-dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2012 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.
index 40d999dc650f062c9b33c702521653e907f14049..be0c8a22979d631f26eecf514017b2e5138ccac3 100644 (file)
@@ -1,13 +1,11 @@
-#serial 3
-dnl Copyright (C) 2006-2007, 2009-2010 Free Software Foundation, Inc.
+#serial 4
+dnl Copyright (C) 2006-2007, 2009-2012 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.
 
+dnl Prerequisites of lib/close-stream.c.
 AC_DEFUN([gl_CLOSE_STREAM],
 [
-  AC_LIBOBJ([close-stream])
-
-  dnl Prerequisites of lib/close-stream.c.
   :
 ])
index 1ee3add9b998a2c33893357e6af73201842519a0..379e70d83e74930cc7ee0fa56afabf2b231c8d54 100644 (file)
@@ -1,26 +1,33 @@
-# close.m4 serial 5
-dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
+# close.m4 serial 8
+dnl Copyright (C) 2008-2012 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.
 
 AC_DEFUN([gl_FUNC_CLOSE],
 [
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([gl_MSVC_INVAL])
+  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+    REPLACE_CLOSE=1
+  fi
   m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
     gl_PREREQ_SYS_H_WINSOCK2
     if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
       dnl Even if the 'socket' module is not used here, another part of the
       dnl application may use it and pass file descriptors that refer to
       dnl sockets to the close() function. So enable the support for sockets.
-      gl_REPLACE_CLOSE
+      REPLACE_CLOSE=1
+    fi
+  ])
+  dnl Replace close() for supporting the gnulib-defined fchdir() function,
+  dnl to keep fchdir's bookkeeping up-to-date.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    if test $REPLACE_CLOSE = 0; then
+      gl_TEST_FCHDIR
+      if test $HAVE_FCHDIR = 0; then
+        REPLACE_CLOSE=1
+      fi
     fi
   ])
-])
-
-AC_DEFUN([gl_REPLACE_CLOSE],
-[
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  REPLACE_CLOSE=1
-  AC_LIBOBJ([close])
-  gl_REPLACE_FCLOSE
 ])
diff --git a/m4/closedir.m4 b/m4/closedir.m4
new file mode 100644 (file)
index 0000000..8a2fba4
--- /dev/null
@@ -0,0 +1,25 @@
+# closedir.m4 serial 2
+dnl Copyright (C) 2011-2012 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.
+
+AC_DEFUN([gl_FUNC_CLOSEDIR],
+[
+  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+  AC_CHECK_FUNCS([closedir])
+  if test $ac_cv_func_closedir = no; then
+    HAVE_CLOSEDIR=0
+  fi
+  dnl Replace closedir() for supporting the gnulib-defined fchdir() function,
+  dnl to keep fchdir's bookkeeping up-to-date.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    gl_TEST_FCHDIR
+    if test $HAVE_FCHDIR = 0; then
+      if test $HAVE_CLOSEDIR = 1; then
+        REPLACE_CLOSEDIR=1
+      fi
+    fi
+  ])
+])
index 8bcf7c054aee5edab822f8f3d2fa5183ad8d81a5..459e908fe9f61ce144d55f9286da92d12dbe9567 100644 (file)
@@ -1,13 +1,11 @@
-# closein.m4 serial 1
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# closein.m4 serial 2
+dnl Copyright (C) 2007, 2009-2012 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.
 
+dnl Prerequisites of lib/closein.c.
 AC_DEFUN([gl_CLOSEIN],
 [
-  AC_LIBOBJ([closein])
-
-  dnl Prerequisites of lib/closein.c.
   :
 ])
index 946944ecda8e65fa37c0ce8ea915d2fc8c0b8e23..71395c1a9c7113c91983ad323163a21656cb9850 100644 (file)
@@ -1,14 +1,12 @@
-# closeout.m4 serial 5
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2010 Free Software Foundation,
+# closeout.m4 serial 6
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2012 Free Software Foundation,
 dnl 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.
 
+dnl Prerequisites of lib/closeout.c.
 AC_DEFUN([gl_CLOSEOUT],
 [
-  AC_LIBOBJ([closeout])
-
-  dnl Prerequisites of lib/closeout.c.
   :
 ])
index a53c04260c0f5c1c347210fb7eb7e4ff63b41cb1..cf53d2416718889d8ffe8172fcb21cf62cca803e 100644 (file)
@@ -1,5 +1,5 @@
-# codeset.m4 serial 4 (gettext-0.18)
-dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc.
+# codeset.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2006, 2008-2012 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.
@@ -9,10 +9,12 @@ dnl From Bruno Haible.
 AC_DEFUN([AM_LANGINFO_CODESET],
 [
   AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
-    [AC_TRY_LINK([#include <langinfo.h>],
-      [char* cs = nl_langinfo(CODESET); return !cs;],
-      [am_cv_langinfo_codeset=yes],
-      [am_cv_langinfo_codeset=no])
+    [AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <langinfo.h>]],
+          [[char* cs = nl_langinfo(CODESET); return !cs;]])],
+       [am_cv_langinfo_codeset=yes],
+       [am_cv_langinfo_codeset=no])
     ])
   if test $am_cv_langinfo_codeset = yes; then
     AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
diff --git a/m4/configmake.m4 b/m4/configmake.m4
new file mode 100644 (file)
index 0000000..8c82371
--- /dev/null
@@ -0,0 +1,50 @@
+# configmake.m4 serial 1
+dnl Copyright (C) 2010-2012 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.
+
+# gl_CONFIGMAKE_PREP
+# ------------------
+# Guarantee all of the standard directory variables, even when used with
+# autoconf 2.59 (datarootdir wasn't supported until 2.59c) or automake
+# 1.9.6 (pkglibexecdir wasn't supported until 1.10b.).
+AC_DEFUN([gl_CONFIGMAKE_PREP],
+[
+  dnl Technically, datadir should default to datarootdir.  But if
+  dnl autoconf is too old to provide datarootdir, then reversing the
+  dnl definition is a reasonable compromise.  Only AC_SUBST a variable
+  dnl if it was not already defined earlier by autoconf.
+  if test "x$datarootdir" = x; then
+    AC_SUBST([datarootdir], ['${datadir}'])
+  fi
+  dnl Copy the approach used in autoconf 2.60.
+  if test "x$docdir" = x; then
+    AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
+      ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
+      ['${datarootdir}/doc/${PACKAGE}'])])
+  fi
+  dnl The remaining variables missing from autoconf 2.59 are easier.
+  if test "x$htmldir" = x; then
+    AC_SUBST([htmldir], ['${docdir}'])
+  fi
+  if test "x$dvidir" = x; then
+    AC_SUBST([dvidir], ['${docdir}'])
+  fi
+  if test "x$pdfdir" = x; then
+    AC_SUBST([pdfdir], ['${docdir}'])
+  fi
+  if test "x$psdir" = x; then
+    AC_SUBST([psdir], ['${docdir}'])
+  fi
+  if test "x$lispdir" = x; then
+    AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp'])
+  fi
+  if test "x$localedir" = x; then
+    AC_SUBST([localedir], ['${datarootdir}/locale'])
+  fi
+
+  dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
+  dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
+  AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}'])
+])
diff --git a/m4/d-ino.m4 b/m4/d-ino.m4
deleted file mode 100644 (file)
index b019ae5..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# serial 11
-
-dnl From Jim Meyering.
-dnl
-dnl Check whether struct dirent has a member named d_ino.
-dnl
-
-# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2010 Free Software
-# Foundation, Inc.
-
-# This file 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.
-
-AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
-  [AC_CACHE_CHECK([for d_ino member in directory struct],
-                  gl_cv_struct_dirent_d_ino,
-     [AC_RUN_IFELSE(
-        [AC_LANG_PROGRAM(
-           [[#include <sys/types.h>
-             #include <sys/stat.h>
-             #include <dirent.h>
-           ]],
-           [[DIR *dp = opendir (".");
-             struct dirent *e;
-             struct stat st;
-             if (! dp)
-               return 1;
-             e = readdir (dp);
-             return ! (e
-                       && stat (e->d_name, &st) == 0
-                       && e->d_ino == st.st_ino);]])],
-            [gl_cv_struct_dirent_d_ino=yes],
-            [gl_cv_struct_dirent_d_ino=no],
-            [gl_cv_struct_dirent_d_ino=no])])
-   if test $gl_cv_struct_dirent_d_ino = yes; then
-     AC_DEFINE([D_INO_IN_DIRENT], [1],
-       [Define if struct dirent has a member d_ino that actually works.])
-   fi
-  ]
-)
diff --git a/m4/dirent-safer.m4 b/m4/dirent-safer.m4
new file mode 100644 (file)
index 0000000..9801247
--- /dev/null
@@ -0,0 +1,10 @@
+#serial 2
+dnl Copyright (C) 2009-2012 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.
+
+AC_DEFUN([gl_DIRENT_SAFER],
+[
+  AC_CHECK_FUNCS_ONCE([fdopendir])
+])
index 6452dfe5edb5265a6986430eb0422b183741fa40..f6c0fa7ba33b7e6b10914a8388e867b4b697e396 100644 (file)
@@ -1,5 +1,5 @@
-# dirent_h.m4 serial 8
-dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
+# dirent_h.m4 serial 16
+dnl Copyright (C) 2008-2012 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.
@@ -14,35 +14,51 @@ AC_DEFUN([gl_DIRENT_H],
 
   dnl <dirent.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([dirent.h])
-])
+  if test $ac_cv_header_dirent_h = yes; then
+    HAVE_DIRENT_H=1
+  else
+    HAVE_DIRENT_H=0
+  fi
+  AC_SUBST([HAVE_DIRENT_H])
 
-dnl Unconditionally enables the replacement of <dirent.h>.
-AC_DEFUN([gl_REPLACE_DIRENT_H],
-[
-  dnl This is a no-op, because <dirent.h> is always overridden.
-  :
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <dirent.h>
+    ]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir])
 ])
 
 AC_DEFUN([gl_DIRENT_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_DIRENT_H_DEFAULTS],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
+  GNULIB_OPENDIR=0;     AC_SUBST([GNULIB_OPENDIR])
+  GNULIB_READDIR=0;     AC_SUBST([GNULIB_READDIR])
+  GNULIB_REWINDDIR=0;   AC_SUBST([GNULIB_REWINDDIR])
+  GNULIB_CLOSEDIR=0;    AC_SUBST([GNULIB_CLOSEDIR])
   GNULIB_DIRFD=0;       AC_SUBST([GNULIB_DIRFD])
   GNULIB_FDOPENDIR=0;   AC_SUBST([GNULIB_FDOPENDIR])
   GNULIB_SCANDIR=0;     AC_SUBST([GNULIB_SCANDIR])
   GNULIB_ALPHASORT=0;   AC_SUBST([GNULIB_ALPHASORT])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_OPENDIR=1;       AC_SUBST([HAVE_OPENDIR])
+  HAVE_READDIR=1;       AC_SUBST([HAVE_READDIR])
+  HAVE_REWINDDIR=1;     AC_SUBST([HAVE_REWINDDIR])
+  HAVE_CLOSEDIR=1;      AC_SUBST([HAVE_CLOSEDIR])
   HAVE_DECL_DIRFD=1;    AC_SUBST([HAVE_DECL_DIRFD])
+  HAVE_DECL_FDOPENDIR=1;AC_SUBST([HAVE_DECL_FDOPENDIR])
   HAVE_FDOPENDIR=1;     AC_SUBST([HAVE_FDOPENDIR])
   HAVE_SCANDIR=1;       AC_SUBST([HAVE_SCANDIR])
   HAVE_ALPHASORT=1;     AC_SUBST([HAVE_ALPHASORT])
+  REPLACE_OPENDIR=0;    AC_SUBST([REPLACE_OPENDIR])
   REPLACE_CLOSEDIR=0;   AC_SUBST([REPLACE_CLOSEDIR])
+  REPLACE_DIRFD=0;      AC_SUBST([REPLACE_DIRFD])
   REPLACE_FDOPENDIR=0;  AC_SUBST([REPLACE_FDOPENDIR])
-  REPLACE_OPENDIR=0;    AC_SUBST([REPLACE_OPENDIR])
 ])
index 7fefa2e483acfa164b4109829b0339dff123e2a3..fc475d78b9faf0c706c2cadab432b81ae0740274 100644 (file)
@@ -1,8 +1,8 @@
-# serial 17   -*- Autoconf -*-
+# serial 22   -*- Autoconf -*-
 
 dnl Find out how to get the file descriptor associated with an open DIR*.
 
-# Copyright (C) 2001-2006, 2008-2010 Free Software Foundation, Inc.
+# Copyright (C) 2001-2006, 2008-2012 Free Software Foundation, Inc.
 # This file 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.
@@ -12,19 +12,14 @@ dnl From Jim Meyering
 AC_DEFUN([gl_FUNC_DIRFD],
 [
   AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
-  gl_REPLACE_DIRENT_H
 
   dnl Persuade glibc <dirent.h> to declare dirfd().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
-  AC_REQUIRE([AC_PROG_CPP])
-  AC_REQUIRE([AC_PROG_EGREP])
-
   AC_CHECK_FUNCS([dirfd])
   AC_CHECK_DECLS([dirfd], , ,
-    [#include <sys/types.h>
-     #include <dirent.h>])
+    [[#include <sys/types.h>
+      #include <dirent.h>]])
   if test $ac_cv_have_decl_dirfd = no; then
     HAVE_DECL_DIRFD=0
   fi
@@ -40,44 +35,49 @@ AC_DEFUN([gl_FUNC_DIRFD],
        gl_cv_func_dirfd_macro=yes,
        gl_cv_func_dirfd_macro=no)])
 
-  # Use the replacement only if we have no function, macro,
-  # or declaration with that name.
-  if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$gl_cv_func_dirfd_macro \
-      = no,no,no; then
-    AC_REPLACE_FUNCS([dirfd])
-    AC_CACHE_CHECK(
-              [how to get the file descriptor associated with an open DIR*],
-                   gl_cv_sys_dir_fd_member_name,
-      [
-        dirfd_save_CFLAGS=$CFLAGS
-        for ac_expr in d_fd dd_fd; do
+  # Use the replacement only if we have no function or macro with that name.
+  if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no; then
+    if test $ac_cv_have_decl_dirfd = yes; then
+      # If the system declares dirfd already, let's declare rpl_dirfd instead.
+      REPLACE_DIRFD=1
+    fi
+  fi
+])
 
-          CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
-          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-             #include <sys/types.h>
-             #include <dirent.h>]],
-            [[DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;]])],
-            [dir_fd_found=yes]
-          )
-          CFLAGS=$dirfd_save_CFLAGS
-          test "$dir_fd_found" = yes && break
-        done
-        test "$dir_fd_found" = yes || ac_expr=no_such_member
+dnl Prerequisites of lib/dirfd.c.
+AC_DEFUN([gl_PREREQ_DIRFD],
+[
+  AC_CACHE_CHECK([how to get the file descriptor associated with an open DIR*],
+                 [gl_cv_sys_dir_fd_member_name],
+    [
+      dirfd_save_CFLAGS=$CFLAGS
+      for ac_expr in d_fd dd_fd; do
 
-        gl_cv_sys_dir_fd_member_name=$ac_expr
-      ]
-    )
-    if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
-      AC_DEFINE_UNQUOTED([DIR_FD_MEMBER_NAME],
-        $gl_cv_sys_dir_fd_member_name,
-        [the name of the file descriptor member of DIR])
-    fi
-    AH_VERBATIM(DIR_TO_FD,
-                [#ifdef DIR_FD_MEMBER_NAME
+        CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+           #include <sys/types.h>
+           #include <dirent.h>]],
+          [[DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;]])],
+          [dir_fd_found=yes]
+        )
+        CFLAGS=$dirfd_save_CFLAGS
+        test "$dir_fd_found" = yes && break
+      done
+      test "$dir_fd_found" = yes || ac_expr=no_such_member
+
+      gl_cv_sys_dir_fd_member_name=$ac_expr
+    ]
+  )
+  if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
+    AC_DEFINE_UNQUOTED([DIR_FD_MEMBER_NAME],
+      [$gl_cv_sys_dir_fd_member_name],
+      [the name of the file descriptor member of DIR])
+  fi
+  AH_VERBATIM([DIR_TO_FD],
+              [#ifdef DIR_FD_MEMBER_NAME
 # define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
 #else
 # define DIR_TO_FD(Dir_p) -1
 #endif
 ])
-  fi
 ])
index 576b5bead2ad304bae9abe1168759947ec80ce80..65639ec89e9598bbdf177c280c647fde5d913ebc 100644 (file)
@@ -1,5 +1,5 @@
-#serial 8   -*- autoconf -*-
-dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
+#serial 10   -*- autoconf -*-
+dnl Copyright (C) 2002-2006, 2009-2012 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.
@@ -7,18 +7,11 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_DIRNAME],
 [
   AC_REQUIRE([gl_DIRNAME_LGPL])
-  AC_LIBOBJ([basename])
-  AC_LIBOBJ([dirname])
 ])
 
 AC_DEFUN([gl_DIRNAME_LGPL],
 [
-  AC_LIBOBJ([basename-lgpl])
-  AC_LIBOBJ([dirname-lgpl])
-  AC_LIBOBJ([stripslash])
-
   dnl Prerequisites of lib/dirname.h.
-  AC_REQUIRE([gl_AC_DOS])
   AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
 
   dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c,
diff --git a/m4/dos.m4 b/m4/dos.m4
deleted file mode 100644 (file)
index 5660542..0000000
--- a/m4/dos.m4
+++ /dev/null
@@ -1,71 +0,0 @@
-#serial 11   -*- autoconf -*-
-
-# Define some macros required for proper operation of code in lib/*.c
-# on MSDOS/Windows systems.
-
-# Copyright (C) 2000-2001, 2004-2006, 2009-2010 Free Software Foundation, Inc.
-# This file 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.
-
-# From Jim Meyering.
-
-AC_DEFUN([gl_AC_DOS],
-  [
-    AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
-      [
-        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
-#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
-neither MSDOS nor Windows
-#endif]])],
-        [ac_cv_win_or_dos=yes],
-        [ac_cv_win_or_dos=no])
-      ])
-
-    if test x"$ac_cv_win_or_dos" = xyes; then
-      ac_fs_accepts_drive_letter_prefix=1
-      ac_fs_backslash_is_file_name_separator=1
-      AC_CACHE_CHECK([whether drive letter can start relative path],
-                     [ac_cv_drive_letter_can_be_relative],
-        [
-          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
-#if defined __CYGWIN__
-drive letters are always absolute
-#endif]])],
-          [ac_cv_drive_letter_can_be_relative=yes],
-          [ac_cv_drive_letter_can_be_relative=no])
-        ])
-      if test x"$ac_cv_drive_letter_can_be_relative" = xyes; then
-        ac_fs_drive_letter_can_be_relative=1
-      else
-        ac_fs_drive_letter_can_be_relative=0
-      fi
-    else
-      ac_fs_accepts_drive_letter_prefix=0
-      ac_fs_backslash_is_file_name_separator=0
-      ac_fs_drive_letter_can_be_relative=0
-    fi
-
-    AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
-      $ac_fs_accepts_drive_letter_prefix,
-      [Define on systems for which file names may have a so-called
-       `drive letter' prefix, define this to compute the length of that
-       prefix, including the colon.])
-
-    AH_VERBATIM(ISSLASH,
-    [#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-#else
-# define ISSLASH(C) ((C) == '/')
-#endif])
-
-    AC_DEFINE_UNQUOTED([FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
-      $ac_fs_backslash_is_file_name_separator,
-      [Define if the backslash character may also serve as a file name
-       component separator.])
-
-    AC_DEFINE_UNQUOTED([FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE],
-      $ac_fs_drive_letter_can_be_relative,
-      [Define if a drive letter prefix denotes a relative path if it is
-       not followed by a file name component separator.])
-  ])
index 66a79c0f217bcbd93b5a5e2323888c30b1598f8d..1e03751375bec2ff93378f50e3f4176150e90bcb 100644 (file)
@@ -1,5 +1,5 @@
 # double-slash-root.m4 serial 4   -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2012 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.
diff --git a/m4/dup.m4 b/m4/dup.m4
new file mode 100644 (file)
index 0000000..bec5880
--- /dev/null
+++ b/m4/dup.m4
@@ -0,0 +1,27 @@
+# dup.m4 serial 2
+dnl Copyright (C) 2011-2012 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.
+
+AC_DEFUN([gl_FUNC_DUP],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([gl_MSVC_INVAL])
+  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+    REPLACE_DUP=1
+  fi
+  dnl Replace dup() for supporting the gnulib-defined fchdir() function,
+  dnl to keep fchdir's bookkeeping up-to-date.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    gl_TEST_FCHDIR
+    if test $HAVE_FCHDIR = 0; then
+      REPLACE_DUP=1
+    fi
+  ])
+])
+
+# Prerequisites of lib/dup.c.
+AC_DEFUN([gl_PREREQ_DUP], [
+  AC_REQUIRE([AC_C_INLINE])
+])
index 998d66f83b1f3812227ac15199331d42d83b96ed..fc86e8085babcbd500bafb28599d77b80952a68e 100644 (file)
@@ -1,5 +1,5 @@
-#serial 10
-dnl Copyright (C) 2002, 2005, 2007, 2009-2010 Free Software Foundation, Inc.
+#serial 18
+dnl Copyright (C) 2002, 2005, 2007, 2009-2012 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.
@@ -8,51 +8,74 @@ AC_DEFUN([gl_FUNC_DUP2],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_CHECK_FUNCS_ONCE([dup2])
-  if test $ac_cv_func_dup2 = no; then
-    HAVE_DUP2=0
-    AC_LIBOBJ([dup2])
-  else
+  m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [
+    AC_CHECK_FUNCS_ONCE([dup2])
+    if test $ac_cv_func_dup2 = no; then
+      HAVE_DUP2=0
+    fi
+  ], [
+    AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
+  ])
+  if test $HAVE_DUP2 = 1; then
     AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
       [AC_RUN_IFELSE([
          AC_LANG_PROGRAM([[#include <unistd.h>
+#include <fcntl.h>
 #include <errno.h>]],
-           [if (dup2 (1, 1) == 0)
-              return 1;
+           [int result = 0;
+#ifdef FD_CLOEXEC
+            if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
+              result |= 1;
+#endif
+            if (dup2 (1, 1) == 0)
+              result |= 2;
+#ifdef FD_CLOEXEC
+            if (fcntl (1, F_GETFD) != FD_CLOEXEC)
+              result |= 4;
+#endif
             close (0);
             if (dup2 (0, 0) != -1)
-              return 2;
+              result |= 8;
             /* Many gnulib modules require POSIX conformance of EBADF.  */
-            if (dup2 (1, 1000000) == -1 && errno != EBADF)
-              return 3;
-            return 0;
+            if (dup2 (2, 1000000) == -1 && errno != EBADF)
+              result |= 16;
+            return result;
            ])
         ],
         [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
         [case "$host_os" in
            mingw*) # on this platform, dup2 always returns 0 for success
-             gl_cv_func_dup2_works=no;;
+             gl_cv_func_dup2_works="guessing no" ;;
            cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
-             gl_cv_func_dup2_works=no;;
+             gl_cv_func_dup2_works="guessing no" ;;
            linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a
                    # closed fd may yield -EBADF instead of -1 / errno=EBADF.
-             gl_cv_func_dup2_works=no;;
+             gl_cv_func_dup2_works="guessing no" ;;
            freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF.
-             gl_cv_func_dup2_works=no;;
-           *) gl_cv_func_dup2_works=yes;;
+             gl_cv_func_dup2_works="guessing no" ;;
+           haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
+             gl_cv_func_dup2_works="guessing no" ;;
+           *) gl_cv_func_dup2_works="guessing yes" ;;
          esac])
       ])
-    if test "$gl_cv_func_dup2_works" = no; then
-      gl_REPLACE_DUP2
-    fi
+    case "$gl_cv_func_dup2_works" in
+      *yes) ;;
+      *)
+        REPLACE_DUP2=1
+        ;;
+    esac
   fi
+  dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
+  dnl to keep fchdir's bookkeeping up-to-date.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    gl_TEST_FCHDIR
+    if test $HAVE_FCHDIR = 0; then
+      if test $HAVE_DUP2 = 1; then
+        REPLACE_DUP2=1
+      fi
+    fi
+  ])
 ])
 
-AC_DEFUN([gl_REPLACE_DUP2],
-[
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  if test $ac_cv_func_dup2 = yes; then
-    REPLACE_DUP2=1
-  fi
-  AC_LIBOBJ([dup2])
-])
+# Prerequisites of lib/dup2.c.
+AC_DEFUN([gl_PREREQ_DUP2], [])
index d02a039363dda9dbd4eaf43d40e9cdbccb699446..1e76ba270a6bbf54ec92490e349328af8879e373 100644 (file)
@@ -1,5 +1,5 @@
-# errno_h.m4 serial 6
-dnl Copyright (C) 2004, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+# errno_h.m4 serial 11
+dnl Copyright (C) 2004, 2006, 2008-2012 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.
@@ -10,6 +10,9 @@ AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
   AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
     AC_EGREP_CPP([booboo],[
 #include <errno.h>
+#if !defined ETXTBSY
+booboo
+#endif
 #if !defined ENOMSG
 booboo
 #endif
@@ -34,11 +37,26 @@ booboo
 #if !defined ENOTSUP
 booboo
 #endif
+#if !defined ENETRESET
+booboo
+#endif
+#if !defined ECONNABORTED
+booboo
+#endif
 #if !defined ESTALE
 booboo
 #endif
+#if !defined EDQUOT
+booboo
+#endif
 #if !defined ECANCELED
 booboo
+#endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
 #endif
       ],
       [gl_cv_header_errno_h_complete=no],
@@ -47,10 +65,11 @@ booboo
   if test $gl_cv_header_errno_h_complete = yes; then
     ERRNO_H=''
   else
-    gl_CHECK_NEXT_HEADERS([errno.h])
+    gl_NEXT_HEADERS([errno.h])
     ERRNO_H='errno.h'
   fi
   AC_SUBST([ERRNO_H])
+  AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"])
   gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
   gl_REPLACE_ERRNO_VALUE([ENOLINK])
   gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
index 9f1307a428e297d89b8ef96a9affe82dcf091384..5d9c70a4750aae6464ea079b9fd598105708df13 100644 (file)
@@ -1,6 +1,6 @@
-#serial 12
+#serial 14
 
-# Copyright (C) 1996-1998, 2001-2004, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 1996-1998, 2001-2004, 2009-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -8,9 +8,15 @@
 
 AC_DEFUN([gl_ERROR],
 [
-  AC_FUNC_ERROR_AT_LINE
-  dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
-  gl_PREREQ_ERROR
+  dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
+  dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
+  AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
+    [AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <error.h>]],
+          [[error_at_line (0, 0, "", 0, "an error occurred");]])],
+       [ac_cv_lib_error_at_line=yes],
+       [ac_cv_lib_error_at_line=no])])
 ])
 
 # Prerequisites of lib/error.c.
diff --git a/m4/exitfail.m4 b/m4/exitfail.m4
deleted file mode 100644 (file)
index 56e2ce0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# exitfail.m4 serial 6
-dnl Copyright (C) 2002, 2003, 2005, 2006, 2009, 2010 Free Software Foundation,
-dnl 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.
-
-AC_DEFUN([gl_EXITFAIL],
-[
-  AC_LIBOBJ([exitfail])
-
-  dnl No prerequisites of lib/exitfail.c.
-  :
-])
index 5d44d0e02b5de93fff9be3c477a15bb49920fe2d..0ae4ccfac936a5a792c900c0ce1912715d6faf14 100644 (file)
@@ -1,5 +1,5 @@
-# exponentd.m4 serial 1
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# exponentd.m4 serial 3
+dnl Copyright (C) 2007-2008, 2010-2012 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.
@@ -8,7 +8,8 @@ AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION],
   AC_CACHE_CHECK([where to find the exponent in a 'double'],
     [gl_cv_cc_double_expbit0],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <float.h>
 #include <stddef.h>
 #include <stdio.h>
@@ -71,7 +72,7 @@ int main ()
   fprintf (fp, "unknown");
   return (fclose (fp) != 0);
 }
-        ],
+        ]])],
         [gl_cv_cc_double_expbit0=`cat conftest.out`],
         [gl_cv_cc_double_expbit0="unknown"],
         [
@@ -79,7 +80,8 @@ int main ()
           dnl different sets of instructions: The older FPA instructions assume
           dnl that they are stored in big-endian word order, while the words
           dnl (like integer types) are stored in little-endian byte order.
-          dnl The newer VFP instructions assume little-endian order consistenly.
+          dnl The newer VFP instructions assume little-endian order
+          dnl consistently.
           AC_EGREP_CPP([mixed_endianness], [
 #if defined arm || defined __arm || defined __arm__
   mixed_endianness
index 4d8063fae739e03496c8040216e1e7f7f36cc4a7..94d11679fa7ea76d245075167505abef04137c15 100644 (file)
@@ -1,5 +1,5 @@
-# exponentf.m4 serial 1
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# exponentf.m4 serial 2
+dnl Copyright (C) 2007-2008, 2010-2012 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.
@@ -8,7 +8,8 @@ AC_DEFUN([gl_FLOAT_EXPONENT_LOCATION],
   AC_CACHE_CHECK([where to find the exponent in a 'float'],
     [gl_cv_cc_float_expbit0],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <float.h>
 #include <stddef.h>
 #include <stdio.h>
@@ -72,7 +73,7 @@ int main ()
   fprintf (fp, "unknown");
   return (fclose (fp) != 0);
 }
-        ],
+        ]])],
         [gl_cv_cc_float_expbit0=`cat conftest.out`],
         [gl_cv_cc_float_expbit0="unknown"],
         [gl_cv_cc_float_expbit0="word 0 bit 23"])
index a700d3ba60fd7657520f809e10e9dec44541f05c..a7cd13bc99fab38cd2435d1aaf4ced7305bff5fc 100644 (file)
@@ -1,5 +1,5 @@
-# exponentl.m4 serial 2
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# exponentl.m4 serial 3
+dnl Copyright (C) 2007-2012 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.
@@ -9,7 +9,8 @@ AC_DEFUN([gl_LONG_DOUBLE_EXPONENT_LOCATION],
   AC_CACHE_CHECK([where to find the exponent in a 'long double'],
     [gl_cv_cc_long_double_expbit0],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <float.h>
 #include <stddef.h>
 #include <stdio.h>
@@ -74,7 +75,7 @@ int main ()
   fprintf (fp, "unknown");
   return (fclose (fp) != 0);
 }
-        ],
+        ]])],
         [gl_cv_cc_long_double_expbit0=`cat conftest.out`],
         [gl_cv_cc_long_double_expbit0="unknown"],
         [
index 7d9458a8d65a0b085d93b695beaaa6685b824c18..0bfaef6f904ca5989ee7e18a7ffcc3bf732bbe23 100644 (file)
@@ -1,7 +1,7 @@
-# serial 9  -*- Autoconf -*-
+# serial 11  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc.
 # This file 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.
@@ -43,7 +43,7 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
   AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
   if test "$MINIX" = yes; then
     AC_DEFINE([_POSIX_SOURCE], [1],
-      [Define to 1 if you need to in order for `stat' and other
+      [Define to 1 if you need to in order for 'stat' and other
        things to work.])
     AC_DEFINE([_POSIX_1_SOURCE], [2],
       [Define to 2 if the system does not provide POSIX.1 features
@@ -67,6 +67,10 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
+/* Enable general extensions on MacOS X.  */
+#ifndef _DARWIN_C_SOURCE
+# undef _DARWIN_C_SOURCE
+#endif
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
@@ -95,6 +99,7 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
   test $ac_cv_safe_to_define___extensions__ = yes &&
     AC_DEFINE([__EXTENSIONS__])
   AC_DEFINE([_ALL_SOURCE])
+  AC_DEFINE([_DARWIN_C_SOURCE])
   AC_DEFINE([_GNU_SOURCE])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
   AC_DEFINE([_TANDEM_SOURCE])
index c05e9255577ca727ff4f5522c944cab98e318ae0..8af494c56300236b17c8aa4791af412888bcc487 100644 (file)
@@ -1,5 +1,5 @@
-# fchdir.m4 serial 13
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# fchdir.m4 serial 21
+dnl Copyright (C) 2006-2012 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.
@@ -8,10 +8,15 @@ AC_DEFUN([gl_FUNC_FCHDIR],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
-  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
-  AC_CHECK_FUNCS_ONCE([fchdir])
-  if test $ac_cv_func_fchdir = no; then
-    REPLACE_FCHDIR=1
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+  AC_CHECK_DECLS_ONCE([fchdir])
+  if test $ac_cv_have_decl_fchdir = no; then
+    HAVE_DECL_FCHDIR=0
+  fi
+
+  AC_REQUIRE([gl_TEST_FCHDIR])
+  if test $HAVE_FCHDIR = 0; then
     AC_LIBOBJ([fchdir])
     gl_PREREQ_FCHDIR
     AC_DEFINE([REPLACE_FCHDIR], [1],
@@ -19,27 +24,36 @@ AC_DEFUN([gl_FUNC_FCHDIR],
     dnl We must also replace anything that can manipulate a directory fd,
     dnl to keep our bookkeeping up-to-date.  We don't have to replace
     dnl fstatat, since no platform has fstatat but lacks fchdir.
-    REPLACE_OPENDIR=1
-    REPLACE_CLOSEDIR=1
-    REPLACE_DUP=1
-    gl_REPLACE_OPEN
-    gl_REPLACE_CLOSE
-    gl_REPLACE_DUP2
-    dnl dup3 is already unconditionally replaced
-    gl_REPLACE_FCNTL
-    gl_REPLACE_DIRENT_H
     AC_CACHE_CHECK([whether open can visit directories],
       [gl_cv_func_open_directory_works],
       [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h>
 ]], [return open(".", O_RDONLY) < 0;])],
         [gl_cv_func_open_directory_works=yes],
         [gl_cv_func_open_directory_works=no],
-        [gl_cv_func_open_directory_works="guessing no"])])
-    if test "$gl_cv_func_open_directory_works" != yes; then
-      AC_DEFINE([REPLACE_OPEN_DIRECTORY], [1], [Define to 1 if open() should
+        [case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_open_directory_works="guessing no" ;;
+         esac
+        ])])
+    case "$gl_cv_func_open_directory_works" in
+      *yes) ;;
+      *)
+        AC_DEFINE([REPLACE_OPEN_DIRECTORY], [1], [Define to 1 if open() should
 work around the inability to open a directory.])
-      REPLACE_FSTAT=1
-    fi
+        ;;
+    esac
+  fi
+])
+
+# Determine whether to use the overrides in lib/fchdir.c.
+AC_DEFUN([gl_TEST_FCHDIR],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_CHECK_FUNCS_ONCE([fchdir])
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
   fi
 ])
 
index 85de6294231a91ec24ee68257f48c3f8543c40d0..daad94fb3c04fbefff606d6b5da1dfd97bbf9996 100644 (file)
@@ -1,16 +1,20 @@
-# fclose.m4 serial 2
-dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
+# fclose.m4 serial 5
+dnl Copyright (C) 2008-2012 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.
 
 AC_DEFUN([gl_FUNC_FCLOSE],
-[
-])
-
-AC_DEFUN([gl_REPLACE_FCLOSE],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  REPLACE_FCLOSE=1
-  AC_LIBOBJ([fclose])
+
+  gl_FUNC_FFLUSH_STDIN
+  if test $gl_cv_func_fflush_stdin = no; then
+    REPLACE_FCLOSE=1
+  fi
+
+  AC_REQUIRE([gl_FUNC_CLOSE])
+  if test $REPLACE_CLOSE = 1; then
+    REPLACE_FCLOSE=1
+  fi
 ])
index 67167cbdab440897db2cf4839a7a34d61bf37ccf..9862741f3943c38cc2269b8a582c5c4294ddf942 100644 (file)
@@ -1,5 +1,5 @@
-# fcntl-o.m4 serial 1
-dnl Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
+# fcntl-o.m4 serial 4
+dnl Copyright (C) 2006, 2009-2012 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.
@@ -12,13 +12,26 @@ dnl Written by Paul Eggert.
 AC_DEFUN([gl_FCNTL_O_FLAGS],
 [
   dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
-  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+  dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
+  dnl AC_GNU_SOURCE.
+  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+    [AC_REQUIRE([AC_GNU_SOURCE])])
+
+  AC_CHECK_HEADERS_ONCE([unistd.h])
+  AC_CHECK_FUNCS_ONCE([symlink])
   AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
     [AC_RUN_IFELSE(
        [AC_LANG_PROGRAM(
           [[#include <sys/types.h>
            #include <sys/stat.h>
-           #include <unistd.h>
+           #if HAVE_UNISTD_H
+           # include <unistd.h>
+           #else /* on Windows with MSVC */
+           # include <io.h>
+           # include <stdlib.h>
+           # defined sleep(n) _sleep ((n) * 1000)
+           #endif
            #include <fcntl.h>
            #ifndef O_NOATIME
             #define O_NOATIME 0
@@ -33,34 +46,63 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
             };
           ]],
           [[
-            int status = !constants;
+            int result = !constants;
+            #if HAVE_SYMLINK
             {
               static char const sym[] = "conftest.sym";
-              if (symlink (".", sym) != 0
-                  || close (open (sym, O_RDONLY | O_NOFOLLOW)) == 0)
-                status |= 32;
+              if (symlink (".", sym) != 0)
+                result |= 2;
+              else
+                {
+                  int fd = open (sym, O_RDONLY | O_NOFOLLOW);
+                  if (fd >= 0)
+                    {
+                      close (fd);
+                      result |= 4;
+                    }
+                }
               unlink (sym);
             }
+            #endif
             {
               static char const file[] = "confdefs.h";
               int fd = open (file, O_RDONLY | O_NOATIME);
-              char c;
-              struct stat st0, st1;
-              if (fd < 0
-                  || fstat (fd, &st0) != 0
-                  || sleep (1) != 0
-                  || read (fd, &c, 1) != 1
-                  || close (fd) != 0
-                  || stat (file, &st1) != 0
-                  || st0.st_atime != st1.st_atime)
-                status |= 64;
+              if (fd < 0)
+                result |= 8;
+              else
+                {
+                  struct stat st0;
+                  if (fstat (fd, &st0) != 0)
+                    result |= 16;
+                  else
+                    {
+                      char c;
+                      sleep (1);
+                      if (read (fd, &c, 1) != 1)
+                        result |= 24;
+                      else
+                        {
+                          if (close (fd) != 0)
+                            result |= 32;
+                          else
+                            {
+                              struct stat st1;
+                              if (stat (file, &st1) != 0)
+                                result |= 40;
+                              else
+                                if (st0.st_atime != st1.st_atime)
+                                  result |= 64;
+                            }
+                        }
+                    }
+                }
             }
-            return status;]])],
+            return result;]])],
        [gl_cv_header_working_fcntl_h=yes],
        [case $? in #(
-        32) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+        4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
         64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
-        96) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+        68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
          *) gl_cv_header_working_fcntl_h='no';;
         esac],
        [gl_cv_header_working_fcntl_h=cross-compiling])])
index 1a739b093264a6161d2dc441b66a3c7e11fa16fe..c8cf480c5ff8f9f4440564c1ff9f7c77704b495c 100644 (file)
@@ -1,19 +1,16 @@
-#serial 7
-dnl Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
+#serial 9
+dnl Copyright (C) 2005-2007, 2009-2012 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.
 
 AC_DEFUN([gl_FCNTL_SAFER],
 [
-  AC_LIBOBJ([open-safer])
-  AC_LIBOBJ([creat-safer])
-  # Prerequisites of lib/open-safer.c.
+  dnl Prerequisites of lib/open-safer.c.
   AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T])
 ])
 
 AC_DEFUN([gl_OPENAT_SAFER],
 [
   AC_REQUIRE([gl_FCNTL_SAFER])
-  AC_LIBOBJ([openat-safer])
 ])
index fcb5f4471114d81b238c81083bc835a93a302d08..0631bd6f0da1ca8363e627a4aaa24f86cd32da0e 100644 (file)
@@ -1,5 +1,5 @@
-# fcntl.m4 serial 3
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# fcntl.m4 serial 5
+dnl Copyright (C) 2009-2012 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.
@@ -24,11 +24,16 @@ AC_DEFUN([gl_FUNC_FCNTL],
     gl_REPLACE_FCNTL
   else
     dnl cygwin 1.5.x F_DUPFD has wrong errno, and allows negative target
+    dnl haiku alpha 2 F_DUPFD has wrong errno
     AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly],
       [gl_cv_func_fcntl_f_dupfd_works],
       [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 #include <fcntl.h>
-]], [[return fcntl (0, F_DUPFD, -1) != -1;
+#include <errno.h>
+]], [[int result = 0;
+      if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
+      if (errno != EINVAL) result |= 2;
+      return result;
          ]])],
          [gl_cv_func_fcntl_f_dupfd_works=yes],
          [gl_cv_func_fcntl_f_dupfd_works=no],
@@ -68,6 +73,14 @@ choke me
       dnl No witness macro needed for this bug.
     fi
   fi
+  dnl Replace fcntl() for supporting the gnulib-defined fchdir() function,
+  dnl to keep fchdir's bookkeeping up-to-date.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    gl_TEST_FCHDIR
+    if test $HAVE_FCHDIR = 0; then
+      gl_REPLACE_FCNTL
+    fi
+  ])
 ])
 
 AC_DEFUN([gl_REPLACE_FCNTL],
@@ -79,5 +92,4 @@ AC_DEFUN([gl_REPLACE_FCNTL],
   else
     REPLACE_FCNTL=1
   fi
-  AC_LIBOBJ([fcntl])
 ])
index 048a9fcb9deee7e81092e90a2e074d9866e4e89f..cac28aeb28376da58286f5d17c5800220d5c0db2 100644 (file)
@@ -1,6 +1,6 @@
-# serial 9
+# serial 15
 # Configure fcntl.h.
-dnl Copyright (C) 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2007, 2009-2012 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.
@@ -11,25 +11,40 @@ AC_DEFUN([gl_FCNTL_H],
 [
   AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
   AC_REQUIRE([gl_FCNTL_O_FLAGS])
-  gl_CHECK_NEXT_HEADERS([fcntl.h])
+  gl_NEXT_HEADERS([fcntl.h])
+
+  dnl Ensure the type pid_t gets defined.
+  AC_REQUIRE([AC_TYPE_PID_T])
+
+  dnl Ensure the type mode_t gets defined.
+  AC_REQUIRE([AC_TYPE_MODE_T])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, if it is not common
+  dnl enough to be declared everywhere.
+  gl_WARN_ON_USE_PREPARE([[#include <fcntl.h>
+    ]], [fcntl openat])
 ])
 
 AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_FCNTL_H_DEFAULTS],
 [
-  GNULIB_FCNTL=0;   AC_SUBST([GNULIB_FCNTL])
-  GNULIB_OPEN=0;    AC_SUBST([GNULIB_OPEN])
-  GNULIB_OPENAT=0;  AC_SUBST([GNULIB_OPENAT])
+  GNULIB_FCNTL=0;        AC_SUBST([GNULIB_FCNTL])
+  GNULIB_NONBLOCKING=0;  AC_SUBST([GNULIB_NONBLOCKING])
+  GNULIB_OPEN=0;         AC_SUBST([GNULIB_OPEN])
+  GNULIB_OPENAT=0;       AC_SUBST([GNULIB_OPENAT])
   dnl Assume proper GNU behavior unless another module says otherwise.
-  HAVE_FCNTL=1;     AC_SUBST([HAVE_FCNTL])
-  HAVE_OPENAT=1;    AC_SUBST([HAVE_OPENAT])
-  REPLACE_FCNTL=0;  AC_SUBST([REPLACE_FCNTL])
-  REPLACE_OPEN=0;   AC_SUBST([REPLACE_OPEN])
-  REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT])
+  HAVE_FCNTL=1;          AC_SUBST([HAVE_FCNTL])
+  HAVE_OPENAT=1;         AC_SUBST([HAVE_OPENAT])
+  REPLACE_FCNTL=0;       AC_SUBST([REPLACE_FCNTL])
+  REPLACE_OPEN=0;        AC_SUBST([REPLACE_OPEN])
+  REPLACE_OPENAT=0;      AC_SUBST([REPLACE_OPENAT])
 ])
index 7282d4b063f187a215ae389370dac2f3c139cbde..f4db17ba98de153f4b7db302773edae3e362dbdd 100644 (file)
@@ -1,7 +1,7 @@
-# serial 3
+# serial 10
 # See if we need to provide fdopendir.
 
-dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2012 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.
@@ -10,12 +10,17 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_FDOPENDIR],
 [
+  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  dnl FreeBSD 7.3 has the function, but failed to declare it.
+  AC_CHECK_DECLS([fdopendir], [], [HAVE_DECL_FDOPENDIR=0], [[
+#include <dirent.h>
+    ]])
   AC_CHECK_FUNCS_ONCE([fdopendir])
   if test $ac_cv_func_fdopendir = no; then
-    AC_LIBOBJ([openat-proc])
-    AC_LIBOBJ([fdopendir])
-    gl_REPLACE_DIRENT_H
     HAVE_FDOPENDIR=0
   else
     AC_CACHE_CHECK([whether fdopendir works],
@@ -23,16 +28,34 @@ AC_DEFUN([gl_FUNC_FDOPENDIR],
       [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 #include <dirent.h>
 #include <fcntl.h>
-]], [int fd = open ("conftest.c", O_RDONLY);
-     if (fd < 0) return 2;
-     return !!fdopendir (fd);])],
+#include <unistd.h>
+#if !HAVE_DECL_FDOPENDIR
+extern
+# ifdef __cplusplus
+"C"
+# endif
+DIR *fdopendir (int);
+#endif
+]], [int result = 0;
+     int fd = open ("conftest.c", O_RDONLY);
+     if (fd < 0) result |= 1;
+     if (fdopendir (fd)) result |= 2;
+     if (close (fd)) result |= 4;
+     return result;])],
          [gl_cv_func_fdopendir_works=yes],
          [gl_cv_func_fdopendir_works=no],
-         [gl_cv_func_fdopendir_works="guessing no"])])
-    if test "$gl_cv_func_fdopendir_works" != yes; then
-      REPLACE_FDOPENDIR=1
-      gl_REPLACE_DIRENT_H
-      AC_LIBOBJ([fdopendir])
-    fi
+         [case "$host_os" in
+                    # Guess yes on glibc systems.
+            *-gnu*) gl_cv_func_fdopendir_works="guessing yes" ;;
+                    # If we don't know, assume the worst.
+            *)      gl_cv_func_fdopendir_works="guessing no" ;;
+          esac
+         ])])
+    case "$gl_cv_func_fdopendir_works" in
+      *yes) ;;
+      *)
+        REPLACE_FDOPENDIR=1
+        ;;
+    esac
   fi
 ])
index 56c0aedc8920ecd012c5266aa7acb3c438ce6825..13455d184a8d31d828dfbb8340eef6940ca0671d 100644 (file)
@@ -1,6 +1,6 @@
-# fflush.m4 serial 7
+# fflush.m4 serial 13
 
-# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# Copyright (C) 2007-2012 Free Software Foundation, Inc.
 # This file 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.
@@ -12,13 +12,30 @@ dnl unread input on seekable streams, rather than C99 undefined semantics.
 
 AC_DEFUN([gl_FUNC_FFLUSH],
 [
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  gl_FUNC_FFLUSH_STDIN
+  if test $gl_cv_func_fflush_stdin = no; then
+    REPLACE_FFLUSH=1
+  fi
+])
+
+dnl Determine whether fflush works on input streams.
+dnl Sets gl_cv_func_fflush_stdin.
+
+AC_DEFUN([gl_FUNC_FFLUSH_STDIN],
+[
+  AC_CHECK_HEADERS_ONCE([unistd.h])
   AC_CACHE_CHECK([whether fflush works on input streams],
     [gl_cv_func_fflush_stdin],
     [echo hello world > conftest.txt
      AC_RUN_IFELSE([AC_LANG_PROGRAM(
        [[
 #include <stdio.h>
-#include <unistd.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
        ]], [[FILE *f = fopen ("conftest.txt", "r");
          char buffer[10];
          int fd;
@@ -59,19 +76,6 @@ AC_DEFUN([gl_FUNC_FFLUSH],
       gl_cv_func_fflush_stdin=no])
      rm conftest.txt
     ])
-  if test $gl_cv_func_fflush_stdin = no; then
-    gl_REPLACE_FFLUSH
-  fi
-])
-
-AC_DEFUN([gl_REPLACE_FFLUSH],
-[
-  AC_LIBOBJ([fflush])
-  AC_LIBOBJ([fseeko])
-  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  REPLACE_FFLUSH=1
-  REPLACE_FSEEKO=1
-  gl_PREREQ_FFLUSH
 ])
 
 # Prerequisites of lib/fflush.c.
diff --git a/m4/filenamecat.m4 b/m4/filenamecat.m4
new file mode 100644 (file)
index 0000000..b552f12
--- /dev/null
@@ -0,0 +1,16 @@
+# filenamecat.m4 serial 11
+dnl Copyright (C) 2002-2006, 2009-2012 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.
+
+AC_DEFUN([gl_FILE_NAME_CONCAT],
+[
+  AC_REQUIRE([gl_FILE_NAME_CONCAT_LGPL])
+])
+
+AC_DEFUN([gl_FILE_NAME_CONCAT_LGPL],
+[
+  dnl Prerequisites of lib/filenamecat-lgpl.c.
+  AC_CHECK_FUNCS_ONCE([mempcpy])
+])
index a74a0d957f2ea89a010102dba7da48add2fccbfe..51c9c7b35c7836f0766881e9afc375778fb1f59f 100644 (file)
@@ -1,5 +1,5 @@
-# float_h.m4 serial 3
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# float_h.m4 serial 9
+dnl Copyright (C) 2007, 2009-2012 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.
@@ -9,11 +9,90 @@ AC_DEFUN([gl_FLOAT_H],
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST])
   FLOAT_H=
+  REPLACE_FLOAT_LDBL=0
   case "$host_os" in
-    beos* | openbsd*)
+    aix* | beos* | openbsd* | mirbsd* | irix*)
       FLOAT_H=float.h
-      gl_CHECK_NEXT_HEADERS([float.h])
+      ;;
+    freebsd*)
+      case "$host_cpu" in
+changequote(,)dnl
+        i[34567]86 )
+changequote([,])dnl
+          FLOAT_H=float.h
+          ;;
+        x86_64 )
+          # On x86_64 systems, the C compiler may still be generating
+          # 32-bit code.
+          AC_EGREP_CPP([yes],
+            [#if defined __LP64__ || defined __x86_64__ || defined __amd64__
+             yes
+             #endif],
+            [],
+            [FLOAT_H=float.h])
+          ;;
+      esac
+      ;;
+    linux*)
+      case "$host_cpu" in
+        powerpc*)
+          FLOAT_H=float.h
+          ;;
+      esac
+      ;;
+  esac
+  case "$host_os" in
+    aix* | freebsd* | linux*)
+      if test -n "$FLOAT_H"; then
+        REPLACE_FLOAT_LDBL=1
+      fi
       ;;
   esac
+
+  dnl Test against glibc-2.7 Linux/SPARC64 bug.
+  REPLACE_ITOLD=0
+  AC_CACHE_CHECK([whether conversion from 'int' to 'long double' works],
+    [gl_cv_func_itold_works],
+    [
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
+int i = -1;
+volatile long double ld;
+int main ()
+{
+  ld += i * 1.0L;
+  if (ld > 0)
+    return 1;
+  return 0;
+}]])],
+        [gl_cv_func_itold_works=yes],
+        [gl_cv_func_itold_works=no],
+        [case "$host" in
+           sparc*-*-linux*)
+             AC_EGREP_CPP([yes],
+               [#if defined __LP64__ || defined __arch64__
+                yes
+                #endif],
+               [gl_cv_func_itold_works="guessing no"],
+               [gl_cv_func_itold_works="guessing yes"])
+             ;;
+           *) gl_cv_func_itold_works="guessing yes" ;;
+         esac
+        ])
+    ])
+  case "$gl_cv_func_itold_works" in
+    *no)
+      REPLACE_ITOLD=1
+      dnl We add the workaround to <float.h> but also to <math.h>,
+      dnl to increase the chances that the fix function gets pulled in.
+      FLOAT_H=float.h
+      ;;
+  esac
+
+  if test -n "$FLOAT_H"; then
+    gl_NEXT_HEADERS([float.h])
+  fi
   AC_SUBST([FLOAT_H])
+  AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"])
+  AC_SUBST([REPLACE_ITOLD])
 ])
index 09ae7e3febe6c7c4058b829a220267bda12d9371..33a5c94c3a3732abfda755f55670c19a889e6bab 100644 (file)
@@ -1,6 +1,6 @@
-# serial 15
+# serial 19
 
-# Copyright (C) 2000-2001, 2004-2010 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2004-2012 Free Software Foundation, Inc.
 # This file 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.
@@ -24,60 +24,67 @@ AC_DEFUN([gl_FUNC_FPENDING],
 #     endif
 '
   AC_CHECK_DECLS([__fpending], , , $fp_headers)
-  if test $ac_cv_func___fpending = no; then
-    AC_CACHE_CHECK(
+])
+
+AC_DEFUN([gl_PREREQ_FPENDING],
+[
+  AC_CACHE_CHECK(
               [how to determine the number of pending output bytes on a stream],
-                   ac_cv_sys_pending_output_n_bytes,
-      [
-        for ac_expr in                                                    \
-                                                                          \
-            '# glibc2'                                                    \
-            'fp->_IO_write_ptr - fp->_IO_write_base'                      \
-                                                                          \
-            '# traditional Unix'                                          \
-            'fp->_ptr - fp->_base'                                        \
-                                                                          \
-            '# BSD'                                                       \
-            'fp->_p - fp->_bf._base'                                      \
-                                                                          \
-            '# SCO, Unixware'                                             \
-            '(fp->__ptr ? fp->__ptr - fp->__base : 0)'                    \
-                                                                          \
-            '# QNX'                                                       \
-            '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \
-                                                                          \
-            '# old glibc?'                                                \
-            'fp->__bufp - fp->__buffer'                                   \
-                                                                          \
-            '# old glibc iostream?'                                       \
-            'fp->_pptr - fp->_pbase'                                      \
-                                                                          \
-            '# emx+gcc'                                                   \
-            'fp->_ptr - fp->_buffer'                                      \
-                                                                          \
-            '# VMS'                                                       \
-            '(*fp)->_ptr - (*fp)->_base'                                  \
-                                                                          \
-            '# e.g., DGUX R4.11; the info is not available'               \
-            1                                                             \
-            ; do
+                 ac_cv_sys_pending_output_n_bytes,
+    [
+      for ac_expr in                                                    \
+                                                                        \
+          '# glibc2'                                                    \
+          'fp->_IO_write_ptr - fp->_IO_write_base'                      \
+                                                                        \
+          '# traditional Unix'                                          \
+          'fp->_ptr - fp->_base'                                        \
+                                                                        \
+          '# BSD'                                                       \
+          'fp->_p - fp->_bf._base'                                      \
+                                                                        \
+          '# SCO, Unixware'                                             \
+          '(fp->__ptr ? fp->__ptr - fp->__base : 0)'                    \
+                                                                        \
+          '# QNX'                                                       \
+          '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \
+                                                                        \
+          '# old glibc?'                                                \
+          'fp->__bufp - fp->__buffer'                                   \
+                                                                        \
+          '# old glibc iostream?'                                       \
+          'fp->_pptr - fp->_pbase'                                      \
+                                                                        \
+          '# emx+gcc'                                                   \
+          'fp->_ptr - fp->_buffer'                                      \
+                                                                        \
+          '# Minix'                                                     \
+          'fp->_ptr - fp->_buf'                                         \
+                                                                        \
+          '# Plan9'                                                     \
+          'fp->wp - fp->buf'                                            \
+                                                                        \
+          '# VMS'                                                       \
+          '(*fp)->_ptr - (*fp)->_base'                                  \
+                                                                        \
+          '# e.g., DGUX R4.11; the info is not available'               \
+          1                                                             \
+          ; do
 
-          # Skip each embedded comment.
-          case "$ac_expr" in '#'*) continue;; esac
+        # Skip each embedded comment.
+        case "$ac_expr" in '#'*) continue;; esac
 
-          AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
-            [[FILE *fp = stdin; (void) ($ac_expr);]])],
-            [fp_done=yes]
-          )
-          test "$fp_done" = yes && break
-        done
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
+          [[FILE *fp = stdin; (void) ($ac_expr);]])],
+          [fp_done=yes]
+        )
+        test "$fp_done" = yes && break
+      done
 
-        ac_cv_sys_pending_output_n_bytes=$ac_expr
-      ]
-    )
-    AC_DEFINE_UNQUOTED([PENDING_OUTPUT_N_BYTES],
-      $ac_cv_sys_pending_output_n_bytes,
-      [the number of pending output bytes on stream `fp'])
-    AC_LIBOBJ([fpending])
-  fi
+      ac_cv_sys_pending_output_n_bytes=$ac_expr
+    ]
+  )
+  AC_DEFINE_UNQUOTED([PENDING_OUTPUT_N_BYTES],
+    $ac_cv_sys_pending_output_n_bytes,
+    [the number of pending output bytes on stream 'fp'])
 ])
index 532802d7f6780bc9a417e1efbe689d1dd51965ad..82fd778325b40751ffa8ae9ebe0318ceea120756 100644 (file)
@@ -1,5 +1,5 @@
-# fpieee.m4 serial 1
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# fpieee.m4 serial 2
+dnl Copyright (C) 2007, 2009-2012 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.
@@ -36,9 +36,11 @@ AC_DEFUN([gl_FP_IEEE],
       # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM>
       if test -n "$GCC"; then
         # GCC has the option -mieee.
+        # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
         CPPFLAGS="$CPPFLAGS -mieee"
       else
-        # Compaq (ex-DEC) C has the option -ieee.
+        # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
+        # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
         CPPFLAGS="$CPPFLAGS -ieee"
       fi
       ;;
index 5b95b377863e9a92a6522f4c107d4be808509b7f..d083dab6e8ee5e5106e847eef34d333230352f16 100644 (file)
@@ -1,5 +1,5 @@
 # fprintf-posix.m4 serial 14
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2012 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.
index d97e89762e6375c02d9d9793f80dc3208570d16d..2049fe4e104a6be5182bd10f80590c7289b33bf7 100644 (file)
@@ -1,5 +1,5 @@
-# fpurge.m4 serial 6
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# fpurge.m4 serial 7
+dnl Copyright (C) 2007, 2009-2012 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.
@@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_FPURGE],
   AC_CHECK_FUNCS_ONCE([__fpurge])
   AC_CHECK_DECLS([fpurge], , , [[#include <stdio.h>]])
   if test "x$ac_cv_func_fpurge" = xyes; then
+    HAVE_FPURGE=1
     # Detect BSD bug.  Only cygwin 1.7 is known to be immune.
     AC_CACHE_CHECK([whether fpurge works], [gl_cv_func_fpurge_works],
       [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
@@ -34,10 +35,9 @@ AC_DEFUN([gl_FUNC_FPURGE],
       [gl_cv_func_fpurge_works='guessing no'])])
     if test "x$gl_cv_func_fpurge_works" != xyes; then
       REPLACE_FPURGE=1
-      AC_LIBOBJ([fpurge])
     fi
   else
-    AC_LIBOBJ([fpurge])
+    HAVE_FPURGE=0
   fi
   if test "x$ac_cv_have_decl_fpurge" = xno; then
     HAVE_DECL_FPURGE=0
index 051b95d3ab93a0d76da7313497ee504d4d658091..216adc9e577502ecefcccb3de89949d9afb5c0d9 100644 (file)
@@ -1,5 +1,5 @@
 # freading.m4 serial 1
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2012 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.
index 3a450f6561e98f118f893fb79f839e90674492c2..4162195e5372f4ff00461fcb7576e8ff987952f9 100644 (file)
@@ -1,5 +1,5 @@
-# frexp.m4 serial 7
-dnl Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# frexp.m4 serial 13
+dnl Copyright (C) 2007-2012 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.
@@ -7,25 +7,19 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_FREXP],
 [
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
+  AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM])
   FREXP_LIBM=
-  AC_CACHE_CHECK([whether frexp() can be used without linking with libm],
-    [gl_cv_func_frexp_no_libm],
-    [
-      AC_TRY_LINK([#include <math.h>
-                   double x;],
-                  [int e; return frexp (x, &e) > 0;],
-        [gl_cv_func_frexp_no_libm=yes],
-        [gl_cv_func_frexp_no_libm=no])
-    ])
   if test $gl_cv_func_frexp_no_libm = no; then
     AC_CACHE_CHECK([whether frexp() can be used with libm],
       [gl_cv_func_frexp_in_libm],
       [
         save_LIBS="$LIBS"
         LIBS="$LIBS -lm"
-        AC_TRY_LINK([#include <math.h>
-                     double x;],
-                    [int e; return frexp (x, &e) > 0;],
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[#include <math.h>
+               double x;]],
+             [[int e; return frexp (x, &e) > 0;]])],
           [gl_cv_func_frexp_in_libm=yes],
           [gl_cv_func_frexp_in_libm=no])
         LIBS="$save_LIBS"
@@ -50,8 +44,6 @@ AC_DEFUN([gl_FUNC_FREXP],
   if test $gl_func_frexp = yes; then
     AC_DEFINE([HAVE_FREXP], [1],
       [Define if the frexp() function is available and works.])
-  else
-    AC_LIBOBJ([frexp])
   fi
   AC_SUBST([FREXP_LIBM])
 ])
@@ -59,15 +51,7 @@ AC_DEFUN([gl_FUNC_FREXP],
 AC_DEFUN([gl_FUNC_FREXP_NO_LIBM],
 [
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
-  AC_CACHE_CHECK([whether frexp() can be used without linking with libm],
-    [gl_cv_func_frexp_no_libm],
-    [
-      AC_TRY_LINK([#include <math.h>
-                   double x;],
-                  [int e; return frexp (x, &e) > 0;],
-        [gl_cv_func_frexp_no_libm=yes],
-        [gl_cv_func_frexp_no_libm=no])
-    ])
+  AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM])
   if test $gl_cv_func_frexp_no_libm = yes; then
     gl_FUNC_FREXP_WORKS
     case "$gl_cv_func_frexp_works" in
@@ -82,31 +66,69 @@ AC_DEFUN([gl_FUNC_FREXP_NO_LIBM],
   if test $gl_func_frexp_no_libm = yes; then
     AC_DEFINE([HAVE_FREXP_IN_LIBC], [1],
       [Define if the frexp() function is available in libc.])
-  else
-    AC_LIBOBJ([frexp])
   fi
 ])
 
+dnl Test whether frexp() can be used without linking with libm.
+dnl Set gl_cv_func_frexp_no_libm to 'yes' or 'no' accordingly.
+AC_DEFUN([gl_CHECK_FREXP_NO_LIBM],
+[
+  AC_CACHE_CHECK([whether frexp() can be used without linking with libm],
+    [gl_cv_func_frexp_no_libm],
+    [
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <math.h>
+             double x;]],
+           [[int e; return frexp (x, &e) > 0;]])],
+        [gl_cv_func_frexp_no_libm=yes],
+        [gl_cv_func_frexp_no_libm=no])
+    ])
+])
+
 dnl Test whether frexp() works also on denormalized numbers (this fails e.g. on
 dnl NetBSD 3.0), on infinite numbers (this fails e.g. on IRIX 6.5 and mingw),
-dnl and on negative zero (this fails e.g. on NetBSD 4.99).
+dnl and on negative zero (this fails e.g. on NetBSD 4.99 and mingw).
 AC_DEFUN([gl_FUNC_FREXP_WORKS],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CHECK_FUNCS_ONCE([alarm])
   AC_CACHE_CHECK([whether frexp works], [gl_cv_func_frexp_works],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <float.h>
 #include <math.h>
 #include <string.h>
+#if HAVE_ALARM
+# include <unistd.h>
+#endif
+/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
+   ICC 10.0 has a bug when optimizing the expression -zero.
+   The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
+   to PowerPC on MacOS X 10.5.  */
+#if defined __hpux || defined __sgi || defined __ICC
+static double
+compute_minus_zero (void)
+{
+  return -DBL_MIN * DBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
+#else
+double minus_zero = -0.0;
+#endif
 int main()
 {
+  int result = 0;
   int i;
   volatile double x;
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
-   So we use -zero instead.  */
   double zero = 0.0;
+#if HAVE_ALARM
+  /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
+     number.  Let the test fail in this case.  */
+  alarm (5);
+#endif
   /* Test on denormalized numbers.  */
   for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
     ;
@@ -117,30 +139,32 @@ int main()
       /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
          On NetBSD: y = 0.75. Correct: y = 0.5.  */
       if (y != 0.5)
-        return 1;
+        result |= 1;
     }
   /* Test on infinite numbers.  */
-  x = 1.0 / 0.0;
+  x = 1.0 / zero;
   {
     int exp;
     double y = frexp (x, &exp);
     if (y != x)
-      return 1;
+      result |= 2;
   }
   /* Test on negative zero.  */
-  x = -zero;
+  x = minus_zero;
   {
     int exp;
     double y = frexp (x, &exp);
     if (memcmp (&y, &x, sizeof x))
-      return 1;
+      result |= 4;
   }
-  return 0;
-}], [gl_cv_func_frexp_works=yes], [gl_cv_func_frexp_works=no],
-      [case "$host_os" in
-         netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
-         *)                        gl_cv_func_frexp_works="guessing yes";;
-       esac
-      ])
+  return result;
+}]])],
+        [gl_cv_func_frexp_works=yes],
+        [gl_cv_func_frexp_works=no],
+        [case "$host_os" in
+           netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
+           *)                        gl_cv_func_frexp_works="guessing yes";;
+         esac
+        ])
     ])
 ])
index 0fbc893afb6828bf476fcf957a3075fb42adbfaf..9df87ab82f90f6682fd65ed7ffa5997c8ff8d550 100644 (file)
@@ -1,5 +1,5 @@
-# frexpl.m4 serial 9
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# frexpl.m4 serial 19
+dnl Copyright (C) 2007-2012 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.
@@ -7,55 +7,63 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_FREXPL],
 [
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
+  AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
+
+  dnl Persuade glibc <math.h> to declare frexpl().
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  dnl Check whether it's declared.
+  dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+  AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
+
   FREXPL_LIBM=
-  AC_CACHE_CHECK([whether frexpl() can be used without linking with libm],
-    [gl_cv_func_frexpl_no_libm],
-    [
-      AC_TRY_LINK([#include <math.h>
-                   long double x;],
-                  [int e; return frexpl (x, &e) > 0;],
-        [gl_cv_func_frexpl_no_libm=yes],
-        [gl_cv_func_frexpl_no_libm=no])
-    ])
-  if test $gl_cv_func_frexpl_no_libm = no; then
-    AC_CACHE_CHECK([whether frexpl() can be used with libm],
-      [gl_cv_func_frexpl_in_libm],
-      [
-        save_LIBS="$LIBS"
-        LIBS="$LIBS -lm"
-        AC_TRY_LINK([#include <math.h>
-                     long double x;],
-                    [int e; return frexpl (x, &e) > 0;],
-          [gl_cv_func_frexpl_in_libm=yes],
-          [gl_cv_func_frexpl_in_libm=no])
-        LIBS="$save_LIBS"
-      ])
-    if test $gl_cv_func_frexpl_in_libm = yes; then
-      FREXPL_LIBM=-lm
+  if test $HAVE_DECL_FREXPL = 1; then
+    gl_CHECK_FREXPL_NO_LIBM
+    if test $gl_cv_func_frexpl_no_libm = no; then
+      AC_CACHE_CHECK([whether frexpl() can be used with libm],
+        [gl_cv_func_frexpl_in_libm],
+        [
+          save_LIBS="$LIBS"
+          LIBS="$LIBS -lm"
+          AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM(
+               [[#include <math.h>
+                 long double x;]],
+               [[int e; return frexpl (x, &e) > 0;]])],
+            [gl_cv_func_frexpl_in_libm=yes],
+            [gl_cv_func_frexpl_in_libm=no])
+          LIBS="$save_LIBS"
+        ])
+      if test $gl_cv_func_frexpl_in_libm = yes; then
+        FREXPL_LIBM=-lm
+      fi
+    fi
+    if test $gl_cv_func_frexpl_no_libm = yes \
+       || test $gl_cv_func_frexpl_in_libm = yes; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS $FREXPL_LIBM"
+      gl_FUNC_FREXPL_WORKS
+      LIBS="$save_LIBS"
+      case "$gl_cv_func_frexpl_works" in
+        *yes) gl_func_frexpl=yes ;;
+        *)    gl_func_frexpl=no; REPLACE_FREXPL=1 ;;
+      esac
+    else
+      gl_func_frexpl=no
+    fi
+    if test $gl_func_frexpl = yes; then
+      AC_DEFINE([HAVE_FREXPL], [1],
+        [Define if the frexpl() function is available.])
     fi
   fi
-  if test $gl_cv_func_frexpl_no_libm = yes \
-     || test $gl_cv_func_frexpl_in_libm = yes; then
-    save_LIBS="$LIBS"
-    LIBS="$LIBS $FREXPL_LIBM"
-    gl_FUNC_FREXPL_WORKS
-    LIBS="$save_LIBS"
-    case "$gl_cv_func_frexpl_works" in
-      *yes) gl_func_frexpl=yes ;;
-      *)    gl_func_frexpl=no; REPLACE_FREXPL=1; FREXPL_LIBM= ;;
-    esac
-  else
-    gl_func_frexpl=no
-  fi
-  if test $gl_func_frexpl = yes; then
-    AC_DEFINE([HAVE_FREXPL], [1],
-      [Define if the frexpl() function is available.])
-    dnl Also check whether it's declared.
-    dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
-    AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>])
-  else
-    HAVE_DECL_FREXPL=0
-    AC_LIBOBJ([frexpl])
+  if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
+    dnl Find libraries needed to link lib/frexpl.c.
+    if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
+      AC_REQUIRE([gl_FUNC_FREXP])
+      FREXPL_LIBM="$FREXP_LIBM"
+    else
+      FREXPL_LIBM=
+    fi
   fi
   AC_SUBST([FREXPL_LIBM])
 ])
@@ -63,36 +71,45 @@ AC_DEFUN([gl_FUNC_FREXPL],
 AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM],
 [
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
+  AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
+  dnl Check whether it's declared.
+  dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+  AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
+  if test $HAVE_DECL_FREXPL = 1; then
+    gl_CHECK_FREXPL_NO_LIBM
+    if test $gl_cv_func_frexpl_no_libm = yes; then
+      gl_FUNC_FREXPL_WORKS
+      case "$gl_cv_func_frexpl_works" in
+        *yes) gl_func_frexpl_no_libm=yes ;;
+        *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
+      esac
+    else
+      gl_func_frexpl_no_libm=no
+      dnl Set REPLACE_FREXPL here because the system may have frexpl in libm.
+      REPLACE_FREXPL=1
+    fi
+    if test $gl_func_frexpl_no_libm = yes; then
+      AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1],
+        [Define if the frexpl() function is available in libc.])
+    fi
+  fi
+])
+
+dnl Test whether frexpl() can be used without linking with libm.
+dnl Set gl_cv_func_frexpl_no_libm to 'yes' or 'no' accordingly.
+AC_DEFUN([gl_CHECK_FREXPL_NO_LIBM],
+[
   AC_CACHE_CHECK([whether frexpl() can be used without linking with libm],
     [gl_cv_func_frexpl_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   long double x;],
-                  [int e; return frexpl (x, &e) > 0;],
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <math.h>
+             long double x;]],
+           [[int e; return frexpl (x, &e) > 0;]])],
         [gl_cv_func_frexpl_no_libm=yes],
         [gl_cv_func_frexpl_no_libm=no])
     ])
-  if test $gl_cv_func_frexpl_no_libm = yes; then
-    gl_FUNC_FREXPL_WORKS
-    case "$gl_cv_func_frexpl_works" in
-      *yes) gl_func_frexpl_no_libm=yes ;;
-      *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
-    esac
-  else
-    gl_func_frexpl_no_libm=no
-    dnl Set REPLACE_FREXPL here because the system may have frexpl in libm.
-    REPLACE_FREXPL=1
-  fi
-  if test $gl_func_frexpl_no_libm = yes; then
-    AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1],
-      [Define if the frexpl() function is available in libc.])
-    dnl Also check whether it's declared.
-    dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
-    AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>])
-  else
-    HAVE_DECL_FREXPL=0
-    AC_LIBOBJ([frexpl])
-  fi
 ])
 
 dnl Test whether frexpl() works on finite numbers (this fails on
@@ -105,7 +122,8 @@ AC_DEFUN([gl_FUNC_FREXPL_WORKS],
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether frexpl works], [gl_cv_func_frexpl_works],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <float.h>
 #include <math.h>
 /* Override the values of <float.h>, like done in float.in.h.  */
@@ -113,9 +131,28 @@ AC_DEFUN([gl_FUNC_FREXPL_WORKS],
 # undef LDBL_MIN_EXP
 # define LDBL_MIN_EXP    (-16381)
 #endif
-extern long double frexpl (long double, int *);
+#if defined __i386__ && defined __FreeBSD__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
+#endif
+#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+#endif
+#if defined __sgi && (LDBL_MANT_DIG >= 106)
+# if defined __GNUC__
+#  undef LDBL_MIN_EXP
+#  define LDBL_MIN_EXP DBL_MIN_EXP
+# endif
+#endif
+extern
+#ifdef __cplusplus
+"C"
+#endif
+long double frexpl (long double, int *);
 int main()
 {
+  int result = 0;
   volatile long double x;
   /* Test on finite numbers that fails on AIX 5.1.  */
   x = 16.0L;
@@ -123,7 +160,7 @@ int main()
     int exp = -9999;
     frexpl (x, &exp);
     if (exp != 5)
-      return 1;
+      result |= 1;
   }
   /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl
      function returns an invalid (incorrectly normalized) value: it returns
@@ -135,7 +172,7 @@ int main()
     int exp = -9999;
     long double y = frexpl (x, &exp);
     if (!(exp == 1 && y == 0.505L))
-      return 1;
+      result |= 2;
   }
   /* Test on large finite numbers.  This fails on BeOS at i = 16322, while
      LDBL_MAX_EXP = 16384.
@@ -148,7 +185,10 @@ int main()
         int exp = -9999;
         frexpl (x, &exp);
         if (exp != i)
-          return 1;
+          {
+            result |= 4;
+            break;
+          }
       }
   }
   /* Test on denormalized numbers.  */
@@ -163,7 +203,7 @@ int main()
         /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
            exp = -16382, y = 0.5.  On MacOS X 10.5: exp = -16384, y = 0.5.  */
         if (exp != LDBL_MIN_EXP - 1)
-          return 1;
+          result |= 8;
       }
   }
   /* Test on infinite numbers.  */
@@ -172,15 +212,20 @@ int main()
     int exp;
     long double y = frexpl (x, &exp);
     if (y != x)
-      return 1;
+      result |= 16;
   }
-  return 0;
-}], [gl_cv_func_frexpl_works=yes], [gl_cv_func_frexpl_works=no],
-      [case "$host_os" in
-         aix* | beos* | darwin* | irix* | mingw* | pw*)
-            gl_cv_func_frexpl_works="guessing no";;
-         *) gl_cv_func_frexpl_works="guessing yes";;
-       esac
-      ])
+  return result;
+}]])],
+        [gl_cv_func_frexpl_works=yes],
+        [gl_cv_func_frexpl_works=no],
+        [
+changequote(,)dnl
+         case "$host_os" in
+           aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
+              gl_cv_func_frexpl_works="guessing no";;
+           *) gl_cv_func_frexpl_works="guessing yes";;
+         esac
+changequote([,])dnl
+        ])
     ])
 ])
diff --git a/m4/fseek.m4 b/m4/fseek.m4
new file mode 100644 (file)
index 0000000..d9cd70a
--- /dev/null
@@ -0,0 +1,15 @@
+# fseek.m4 serial 4
+dnl Copyright (C) 2007, 2009-2012 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.
+
+AC_DEFUN([gl_FUNC_FSEEK],
+[
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_FSEEKO])
+  dnl When fseeko needs fixes, fseek needs them too.
+  if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
+    REPLACE_FSEEK=1
+  fi
+])
index 5f7f97729c067cdbaec9527fefd3cabe4020e9cc..1bb88c761303fe7afb2d31319e31c67f11ffbb42 100644 (file)
@@ -1,5 +1,5 @@
-# fseeko.m4 serial 7
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# fseeko.m4 serial 16
+dnl Copyright (C) 2007-2012 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.
@@ -7,8 +7,9 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_FSEEKO],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
+  AC_REQUIRE([gl_SYS_TYPES_H])
+  AC_REQUIRE([AC_PROG_CC])
 
   dnl Persuade glibc <stdio.h> to declare fseeko().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
@@ -19,17 +20,54 @@ AC_DEFUN([gl_FUNC_FSEEKO],
 ]], [fseeko (stdin, 0, 0);])],
         [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
     ])
-  if test $gl_cv_func_fseeko = no \
-      || test $gl_cv_var_stdin_large_offset = no; then
-    gl_REPLACE_FSEEKO
+
+  AC_CHECK_DECLS_ONCE([fseeko])
+  if test $ac_cv_have_decl_fseeko = no; then
+    HAVE_DECL_FSEEKO=0
   fi
+
+  if test $gl_cv_func_fseeko = no; then
+    HAVE_FSEEKO=0
+  else
+    if test $WINDOWS_64_BIT_OFF_T = 1; then
+      REPLACE_FSEEKO=1
+    fi
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FSEEKO=1
+    fi
+    m4_ifdef([gl_FUNC_FFLUSH_STDIN], [
+      gl_FUNC_FFLUSH_STDIN
+      if test $gl_cv_func_fflush_stdin = no; then
+        REPLACE_FSEEKO=1
+      fi
+    ])
+  fi
+])
+
+dnl Code shared by fseeko and ftello.  Determine if large files are supported,
+dnl but stdin does not start as a large file by default.
+AC_DEFUN([gl_STDIN_LARGE_OFFSET],
+  [
+    AC_CACHE_CHECK([whether stdin defaults to large file offsets],
+      [gl_cv_var_stdin_large_offset],
+      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
+[[#if defined __SL64 && defined __SCLE /* cygwin */
+  /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
+     fseeko/ftello needlessly fail.  This bug was fixed in 1.5.25, and
+     it is easier to do a version check than building a runtime test.  */
+# include <cygwin/version.h>
+# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
+  choke me
+# endif
+#endif]])],
+        [gl_cv_var_stdin_large_offset=yes],
+        [gl_cv_var_stdin_large_offset=no])])
 ])
 
-AC_DEFUN([gl_REPLACE_FSEEKO],
+# Prerequisites of lib/fseeko.c.
+AC_DEFUN([gl_PREREQ_FSEEKO],
 [
-  AC_LIBOBJ([fseeko])
-  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  REPLACE_FSEEKO=1
-  dnl If we are also using the fseek module, then fseek needs replacing, too.
-  m4_ifdef([gl_REPLACE_FSEEK], [gl_REPLACE_FSEEK])
+  dnl Native Windows has the function _fseeki64. mingw hides it, but mingw64
+  dnl makes it usable again.
+  AC_CHECK_FUNCS([_fseeki64])
 ])
diff --git a/m4/fstat.m4 b/m4/fstat.m4
new file mode 100644 (file)
index 0000000..3ab3297
--- /dev/null
@@ -0,0 +1,39 @@
+# fstat.m4 serial 3
+dnl Copyright (C) 2011-2012 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.
+
+AC_DEFUN([gl_FUNC_FSTAT],
+[
+  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+
+  AC_REQUIRE([gl_MSVC_INVAL])
+  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+    REPLACE_FSTAT=1
+  fi
+
+  AC_REQUIRE([gl_HEADER_SYS_STAT_H])
+  if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+    REPLACE_FSTAT=1
+  fi
+
+  dnl Replace fstat() for supporting the gnulib-defined open() on directories.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    gl_TEST_FCHDIR
+    if test $HAVE_FCHDIR = 0; then
+      case "$gl_cv_func_open_directory_works" in
+        *yes) ;;
+        *)
+          REPLACE_FSTAT=1
+          ;;
+      esac
+    fi
+  ])
+])
+
+# Prerequisites of lib/fstat.c.
+AC_DEFUN([gl_PREREQ_FSTAT],
+[
+  AC_REQUIRE([AC_C_INLINE])
+])
diff --git a/m4/ftell.m4 b/m4/ftell.m4
new file mode 100644 (file)
index 0000000..ed8d014
--- /dev/null
@@ -0,0 +1,15 @@
+# ftell.m4 serial 3
+dnl Copyright (C) 2007, 2009-2012 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.
+
+AC_DEFUN([gl_FUNC_FTELL],
+[
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_FTELLO])
+  dnl When ftello needs fixes, ftell needs them too.
+  if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
+    REPLACE_FTELL=1
+  fi
+])
index 2dff6ee9a83c7ed17cfc4ffa913951b6fbc51756..ab7b548eba3ec8f6b342f708350f0dd6f3dc5102 100644 (file)
@@ -1,5 +1,5 @@
-# ftello.m4 serial 5
-dnl Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# ftello.m4 serial 11
+dnl Copyright (C) 2007-2012 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.
@@ -9,24 +9,132 @@ AC_DEFUN([gl_FUNC_FTELLO],
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
+  AC_REQUIRE([gl_SYS_TYPES_H])
 
-  dnl Persuade glibc <stdio.h> to declare fseeko().
+  dnl Persuade glibc <stdio.h> to declare ftello().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
+  AC_CHECK_DECLS_ONCE([ftello])
+  if test $ac_cv_have_decl_ftello = no; then
+    HAVE_DECL_FTELLO=0
+  fi
+
   AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello],
     [
-      AC_TRY_LINK([#include <stdio.h>], [ftello (stdin);],
-        [gl_cv_func_ftello=yes], [gl_cv_func_ftello=no])
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <stdio.h>]],
+           [[ftello (stdin);]])],
+        [gl_cv_func_ftello=yes],
+        [gl_cv_func_ftello=no])
     ])
-  if test $gl_cv_func_ftello = no \
-      || test $gl_cv_var_stdin_large_offset = no; then
-    gl_REPLACE_FTELLO
+  if test $gl_cv_func_ftello = no; then
+    HAVE_FTELLO=0
+  else
+    if test $WINDOWS_64_BIT_OFF_T = 1; then
+      REPLACE_FTELLO=1
+    fi
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FTELLO=1
+    fi
+    if test $REPLACE_FTELLO = 0; then
+      dnl Detect bug on Solaris.
+      dnl ftell and ftello produce incorrect results after putc that followed a
+      dnl getc call that reached EOF on Solaris. This is because the _IOREAD
+      dnl flag does not get cleared in this case, even though _IOWRT gets set,
+      dnl and ftell and ftello look whether the _IOREAD flag is set.
+      AC_REQUIRE([AC_CANONICAL_HOST])
+      AC_CACHE_CHECK([whether ftello works],
+        [gl_cv_func_ftello_works],
+        [
+          dnl Initial guess, used when cross-compiling or when /dev/tty cannot
+          dnl be opened.
+changequote(,)dnl
+          case "$host_os" in
+                      # Guess no on Solaris.
+            solaris*) gl_cv_func_ftello_works="guessing no" ;;
+                      # Guess yes otherwise.
+            *)        gl_cv_func_ftello_works="guessing yes" ;;
+          esac
+changequote([,])dnl
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define TESTFILE "conftest.tmp"
+int
+main (void)
+{
+  FILE *fp;
+
+  /* Create a file with some contents.  */
+  fp = fopen (TESTFILE, "w");
+  if (fp == NULL)
+    return 70;
+  if (fwrite ("foogarsh", 1, 8, fp) < 8)
+    return 71;
+  if (fclose (fp))
+    return 72;
+
+  /* The file's contents is now "foogarsh".  */
+
+  /* Try writing after reading to EOF.  */
+  fp = fopen (TESTFILE, "r+");
+  if (fp == NULL)
+    return 73;
+  if (fseek (fp, -1, SEEK_END))
+    return 74;
+  if (!(getc (fp) == 'h'))
+    return 1;
+  if (!(getc (fp) == EOF))
+    return 2;
+  if (!(ftell (fp) == 8))
+    return 3;
+  if (!(ftell (fp) == 8))
+    return 4;
+  if (!(putc ('!', fp) == '!'))
+    return 5;
+  if (!(ftell (fp) == 9))
+    return 6;
+  if (!(fclose (fp) == 0))
+    return 7;
+  fp = fopen (TESTFILE, "r");
+  if (fp == NULL)
+    return 75;
+  {
+    char buf[10];
+    if (!(fread (buf, 1, 10, fp) == 9))
+      return 10;
+    if (!(memcmp (buf, "foogarsh!", 9) == 0))
+      return 11;
+  }
+  if (!(fclose (fp) == 0))
+    return 12;
+
+  /* The file's contents is now "foogarsh!".  */
+
+  return 0;
+}]])],
+            [gl_cv_func_ftello_works=yes],
+            [gl_cv_func_ftello_works=no], [:])
+        ])
+      case "$gl_cv_func_ftello_works" in
+        *yes) ;;
+        *)
+          REPLACE_FTELLO=1
+          AC_DEFINE([FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE], [1],
+            [Define to 1 if the system's ftello function has the Solaris bug.])
+          ;;
+      esac
+    fi
   fi
 ])
 
-AC_DEFUN([gl_REPLACE_FTELLO],
+# Prerequisites of lib/ftello.c.
+AC_DEFUN([gl_PREREQ_FTELLO],
 [
-  AC_LIBOBJ([ftello])
-  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  REPLACE_FTELLO=1
+  dnl Native Windows has the function _ftelli64. mingw hides it, but mingw64
+  dnl makes it usable again.
+  AC_CHECK_FUNCS([_ftelli64])
 ])
diff --git a/m4/getcwd-abort-bug.m4 b/m4/getcwd-abort-bug.m4
deleted file mode 100644 (file)
index 59c3daa..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-# serial 2
-# Determine whether getcwd aborts when the length of the working directory
-# name is unusually large.  Any length between 4k and 16k trigger the bug
-# when using glibc-2.4.90-9 or older.
-
-# Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
-# This file 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.
-
-# From Jim Meyering
-
-# gl_FUNC_GETCWD_ABORT_BUG([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
-AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG],
-[
-  AC_CHECK_DECLS_ONCE([getcwd])
-  AC_CHECK_FUNCS([getpagesize])
-  AC_CACHE_CHECK([whether getcwd aborts when 4k < cwd_length < 16k],
-    gl_cv_func_getcwd_abort_bug,
-    [# Remove any remnants of a previous test.
-     rm -rf confdir-14B---
-     # Arrange for deletion of the temporary directory this test creates.
-     ac_clean_files="$ac_clean_files confdir-14B---"
-     AC_RUN_IFELSE(
-       [AC_LANG_SOURCE(
-          [[
-#include <stdlib.h>
-#include <unistd.h>
-#include <limits.h>
-#include <string.h>
-#include <sys/stat.h>
-
-/* Don't get link errors because mkdir is redefined to rpl_mkdir.  */
-#undef mkdir
-
-#ifndef S_IRWXU
-# define S_IRWXU 0700
-#endif
-
-/* FIXME: skip the run-test altogether on systems without getpagesize.  */
-#if ! HAVE_GETPAGESIZE
-# define getpagesize() 0
-#endif
-
-/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
-   the 16kB pagesize on ia64 linux.  Those conditions make the code below
-   trigger a bug in glibc's getcwd implementation before 2.4.90-10.  */
-#define TARGET_LEN (5 * 1024)
-
-int
-main ()
-{
-  char const *dir_name = "confdir-14B---";
-  char *cwd;
-  size_t initial_cwd_len;
-  int fail = 0;
-  size_t desired_depth;
-  size_t d;
-
-  /* The bug is triggered when PATH_MAX < getpagesize (), so skip
-     this relative expensive and invasive test if that's not true.  */
-  if (getpagesize () <= PATH_MAX)
-    return 0;
-
-  cwd = getcwd (NULL, 0);
-  if (cwd == NULL)
-    return 0;
-
-  initial_cwd_len = strlen (cwd);
-  free (cwd);
-  desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
-                   / (1 + strlen (dir_name)));
-  for (d = 0; d < desired_depth; d++)
-    {
-      if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
-        {
-          fail = 3; /* Unable to construct deep hierarchy.  */
-          break;
-        }
-    }
-
-  /* If libc has the bug in question, this invocation of getcwd
-     results in a failed assertion.  */
-  cwd = getcwd (NULL, 0);
-  if (cwd == NULL)
-    fail = 4; /* getcwd failed.  This is ok, and expected.  */
-  free (cwd);
-
-  /* Call rmdir first, in case the above chdir failed.  */
-  rmdir (dir_name);
-  while (0 < d--)
-    {
-      if (chdir ("..") < 0)
-        break;
-      rmdir (dir_name);
-    }
-
-  return 0;
-}
-          ]])],
-    [gl_cv_func_getcwd_abort_bug=no],
-    [gl_cv_func_getcwd_abort_bug=yes],
-    [gl_cv_func_getcwd_abort_bug=yes])
-  ])
-  AS_IF([test $gl_cv_func_getcwd_abort_bug = yes], [$1], [$2])
-])
diff --git a/m4/getcwd-path-max.m4 b/m4/getcwd-path-max.m4
deleted file mode 100644 (file)
index ecf6192..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-# serial 14
-# Check for several getcwd bugs with long file names.
-# If so, arrange to compile the wrapper function.
-
-# This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20.
-# I've heard that this is due to a Linux kernel bug, and that it has
-# been fixed between 2.4.21-pre3 and 2.4.21-pre4.  */
-
-# Copyright (C) 2003-2007, 2009-2010 Free Software Foundation, Inc.
-# This file 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.
-
-# From Jim Meyering
-
-AC_DEFUN([gl_FUNC_GETCWD_PATH_MAX],
-[
-  AC_CHECK_DECLS_ONCE([getcwd])
-  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-  AC_CACHE_CHECK([whether getcwd handles long file names properly],
-    gl_cv_func_getcwd_path_max,
-    [# Arrange for deletion of the temporary directory this test creates.
-     ac_clean_files="$ac_clean_files confdir3"
-     AC_RUN_IFELSE(
-       [AC_LANG_SOURCE(
-          [[
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <limits.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-
-#ifndef AT_FDCWD
-# define AT_FDCWD 0
-#endif
-#ifdef ENAMETOOLONG
-# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
-#else
-# define is_ENAMETOOLONG(x) 0
-#endif
-
-/* Don't get link errors because mkdir is redefined to rpl_mkdir.  */
-#undef mkdir
-
-#ifndef S_IRWXU
-# define S_IRWXU 0700
-#endif
-
-/* The length of this name must be 8.  */
-#define DIR_NAME "confdir3"
-#define DIR_NAME_LEN 8
-#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
-
-/* The length of "../".  */
-#define DOTDOTSLASH_LEN 3
-
-/* Leftover bytes in the buffer, to work around library or OS bugs.  */
-#define BUF_SLOP 20
-
-int
-main ()
-{
-#ifndef PATH_MAX
-  /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
-     at least not on a local file system.  And if we were to start worrying
-     about remote file systems, we'd have to enable the wrapper function
-     all of the time, just to be safe.  That's not worth the cost.  */
-  exit (0);
-#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
-        - DIR_NAME_SIZE - BUF_SLOP) \
-       <= PATH_MAX)
-  /* FIXME: Assuming there's a system for which this is true,
-     this should be done in a compile test.  */
-  exit (0);
-#else
-  char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
-           + DIR_NAME_SIZE + BUF_SLOP];
-  char *cwd = getcwd (buf, PATH_MAX);
-  size_t initial_cwd_len;
-  size_t cwd_len;
-  int fail = 0;
-  size_t n_chdirs = 0;
-
-  if (cwd == NULL)
-    exit (1);
-
-  cwd_len = initial_cwd_len = strlen (cwd);
-
-  while (1)
-    {
-      size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
-      char *c = NULL;
-
-      cwd_len += DIR_NAME_SIZE;
-      /* If mkdir or chdir fails, it could be that this system cannot create
-         any file with an absolute name longer than PATH_MAX, such as cygwin.
-         If so, leave fail as 0, because the current working directory can't
-         be too long for getcwd if it can't even be created.  For other
-         errors, be pessimistic and consider that as a failure, too.  */
-      if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
-        {
-          if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
-            fail = 2;
-          break;
-        }
-
-      if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
-        {
-          c = getcwd (buf, PATH_MAX);
-          if (!c && errno == ENOENT)
-            {
-              fail = 1;
-              break;
-            }
-          if (c || ! (errno == ERANGE || is_ENAMETOOLONG (errno)))
-            {
-              fail = 2;
-              break;
-            }
-        }
-
-      if (dotdot_max <= cwd_len - initial_cwd_len)
-        {
-          if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
-            break;
-          c = getcwd (buf, cwd_len + 1);
-          if (!c)
-            {
-              if (! (errno == ERANGE || errno == ENOENT
-                     || is_ENAMETOOLONG (errno)))
-                {
-                  fail = 2;
-                  break;
-                }
-              if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
-                {
-                  fail = 1;
-                  break;
-                }
-            }
-        }
-
-      if (c && strlen (c) != cwd_len)
-        {
-          fail = 2;
-          break;
-        }
-      ++n_chdirs;
-    }
-
-  /* Leaving behind such a deep directory is not polite.
-     So clean up here, right away, even though the driving
-     shell script would also clean up.  */
-  {
-    size_t i;
-
-    /* Try rmdir first, in case the chdir failed.  */
-    rmdir (DIR_NAME);
-    for (i = 0; i <= n_chdirs; i++)
-      {
-        if (chdir ("..") < 0)
-          break;
-        if (rmdir (DIR_NAME) != 0)
-          break;
-      }
-  }
-
-  exit (fail);
-#endif
-}
-          ]])],
-    [gl_cv_func_getcwd_path_max=yes],
-    [case $? in
-     1) gl_cv_func_getcwd_path_max='no, but it is partly working';;
-     *) gl_cv_func_getcwd_path_max=no;;
-     esac],
-    [gl_cv_func_getcwd_path_max=no])
-  ])
-  case $gl_cv_func_getcwd_path_max in
-  no,*)
-    AC_DEFINE([HAVE_PARTLY_WORKING_GETCWD], [1],
-      [Define to 1 if getcwd works, except it sometimes fails when it shouldn't,
-       setting errno to ERANGE, ENAMETOOLONG, or ENOENT.  If __GETCWD_PREFIX
-       is not defined, it doesn't matter whether HAVE_PARTLY_WORKING_GETCWD
-       is defined.]);;
-  esac
-])
index df9c96869fd3646b7b0e27bf0af0a41915088feb..50b96c666c3429a514e2b15de36b75886cfa66d9 100644 (file)
 # getcwd.m4 - check for working getcwd that is compatible with glibc
 
-# Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
 # This file 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.
 
 # Written by Paul Eggert.
-# serial 2
+# serial 12
 
 AC_DEFUN([gl_FUNC_GETCWD_NULL],
   [
+   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+   AC_CHECK_HEADERS_ONCE([unistd.h])
    AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
      [gl_cv_func_getcwd_null],
      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#        include <unistd.h>
+#        if HAVE_UNISTD_H
+#         include <unistd.h>
+#        else /* on Windows with MSVC */
+#         include <direct.h>
+#        endif
 #        ifndef getcwd
          char *getcwd ();
 #        endif
 ]], [[
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* mingw cwd does not start with '/', but getcwd does allocate.  */
+/* mingw cwd does not start with '/', but getcwd does allocate.
+   However, mingw fails to honor non-zero size.  */
 #else
            if (chdir ("/") != 0)
              return 1;
            else
              {
                char *f = getcwd (NULL, 0);
-               return ! (f && f[0] == '/' && !f[1]);
+               if (! f)
+                 return 2;
+               if (f[0] != '/')
+                 return 3;
+               if (f[1] != '\0')
+                 return 4;
+               return 0;
              }
 #endif
          ]])],
         [gl_cv_func_getcwd_null=yes],
         [gl_cv_func_getcwd_null=no],
-        [[
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_getcwd_null="guessing yes";;
-                               # Guess yes on Cygwin.
-         cygwin*)              gl_cv_func_getcwd_null="guessing yes";;
-                               # Guess yes on mingw.
-         mingw*)               gl_cv_func_getcwd_null="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_getcwd_null="guessing no";;
-       esac
+        [[case "$host_os" in
+                     # Guess yes on glibc systems.
+            *-gnu*)  gl_cv_func_getcwd_null="guessing yes";;
+                     # Guess yes on Cygwin.
+            cygwin*) gl_cv_func_getcwd_null="guessing yes";;
+                     # If we don't know, assume the worst.
+            *)       gl_cv_func_getcwd_null="guessing no";;
+          esac
         ]])])
 ])
 
+AC_DEFUN([gl_FUNC_GETCWD_SIGNATURE],
+[
+  AC_CACHE_CHECK([for getcwd with POSIX signature],
+    [gl_cv_func_getcwd_posix_signature],
+    [AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM(
+         [[#include <unistd.h>]],
+         [[extern
+           #ifdef __cplusplus
+           "C"
+           #endif
+           char *getcwd (char *, size_t);
+         ]])
+      ],
+      [gl_cv_func_getcwd_posix_signature=yes],
+      [gl_cv_func_getcwd_posix_signature=no])
+   ])
+])
+
+dnl Guarantee that getcwd will malloc with a NULL first argument.  Assumes
+dnl that either the system getcwd is robust, or that calling code is okay
+dnl with spurious failures when run from a directory with an absolute name
+dnl larger than 4k bytes.
+dnl
+dnl Assumes that getcwd exists; if you are worried about obsolete
+dnl platforms that lacked getcwd(), then you need to use the GPL module.
+AC_DEFUN([gl_FUNC_GETCWD_LGPL],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_GETCWD_NULL])
+  AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE])
+
+  case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
+  *yes,yes) ;;
+  *)
+    dnl Minimal replacement lib/getcwd-lgpl.c.
+    REPLACE_GETCWD=1
+    ;;
+  esac
+])
+
+dnl Check for all known getcwd bugs; useful for a program likely to be
+dnl executed from an arbitrary location.
 AC_DEFUN([gl_FUNC_GETCWD],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([gl_FUNC_GETCWD_NULL])
+  AC_REQUIRE([gl_FUNC_GETCWD_SIGNATURE])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
   gl_abort_bug=no
-  case $gl_cv_func_getcwd_null,$host_os in
-  *,mingw*)
-    gl_cv_func_getcwd_path_max=yes;;
-  yes,*)
-    gl_FUNC_GETCWD_PATH_MAX
-    gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes]);;
+  case "$host_os" in
+    mingw*)
+      gl_cv_func_getcwd_path_max=yes
+      ;;
+    *)
+      gl_FUNC_GETCWD_PATH_MAX
+      case "$gl_cv_func_getcwd_null" in
+        *yes)
+          gl_FUNC_GETCWD_ABORT_BUG([gl_abort_bug=yes])
+          ;;
+      esac
+      ;;
+  esac
+  dnl Define HAVE_MINIMALLY_WORKING_GETCWD and HAVE_PARTLY_WORKING_GETCWD
+  dnl if appropriate.
+  case "$gl_cv_func_getcwd_path_max" in
+    "no, it has the AIX bug") ;;
+    *)
+      AC_DEFINE([HAVE_MINIMALLY_WORKING_GETCWD], [1],
+        [Define to 1 if getcwd minimally works, that is, its result can be
+         trusted when it succeeds.])
+      ;;
+  esac
+  case "$gl_cv_func_getcwd_path_max" in
+    "no, but it is partly working")
+      AC_DEFINE([HAVE_PARTLY_WORKING_GETCWD], [1],
+        [Define to 1 if getcwd works, except it sometimes fails when it
+         shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT.])
+      ;;
   esac
 
-  case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in
-  *yes,yes,no) ;;
-  *)
+  if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
+     || test $gl_cv_func_getcwd_posix_signature != yes \
+     || test "$gl_cv_func_getcwd_path_max" != yes \
+     || test $gl_abort_bug = yes; then
     REPLACE_GETCWD=1
-    AC_LIBOBJ([getcwd])
-    gl_PREREQ_GETCWD;;
-  esac
+  fi
 ])
 
-# Prerequisites of lib/getcwd.c.
+# Prerequisites of lib/getcwd.c, when full replacement is in effect.
 AC_DEFUN([gl_PREREQ_GETCWD],
 [
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
diff --git a/m4/getdtablesize.m4 b/m4/getdtablesize.m4
new file mode 100644 (file)
index 0000000..81488ba
--- /dev/null
@@ -0,0 +1,19 @@
+# getdtablesize.m4 serial 3
+dnl Copyright (C) 2008-2012 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.
+
+AC_DEFUN([gl_FUNC_GETDTABLESIZE],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_CHECK_FUNCS_ONCE([getdtablesize])
+  if test $ac_cv_func_getdtablesize != yes; then
+    HAVE_GETDTABLESIZE=0
+  fi
+])
+
+# Prerequisites of lib/getdtablesize.c.
+AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [
+  AC_REQUIRE([AC_C_INLINE])
+])
index a19805eaa4041a41462fd3001146e4dd70ad8f73..2aea89595eefe9422f12ba9ebd74e0bf4589abf4 100644 (file)
@@ -1,5 +1,5 @@
-# getopt.m4 serial 24
-dnl Copyright (C) 2002-2006, 2008-2010 Free Software Foundation, Inc.
+# getopt.m4 serial 39
+dnl Copyright (C) 2002-2006, 2008-2012 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.
@@ -9,10 +9,23 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
 [
   m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  gl_GETOPT_IFELSE([
-    gl_REPLACE_GETOPT
-  ],
-  [])
+  dnl Other modules can request the gnulib implementation of the getopt
+  dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
+  dnl argp.m4 does this.
+  m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
+    gl_GETOPT_IFELSE([], [])
+    REPLACE_GETOPT=1
+  ], [
+    REPLACE_GETOPT=0
+    gl_GETOPT_IFELSE([
+      REPLACE_GETOPT=1
+    ],
+    [])
+  ])
+  if test $REPLACE_GETOPT = 1; then
+    dnl Arrange for getopt.h to be created.
+    gl_GETOPT_SUBSTITUTE_HEADER
+  fi
 ])
 
 # Request a POSIX compliant getopt function with GNU extensions (such as
@@ -25,20 +38,6 @@ AC_DEFUN([gl_FUNC_GETOPT_GNU],
   AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
 ])
 
-# Request the gnulib implementation of the getopt functions unconditionally.
-# argp.m4 uses this.
-AC_DEFUN([gl_REPLACE_GETOPT],
-[
-  dnl Arrange for getopt.h to be created.
-  gl_GETOPT_SUBSTITUTE_HEADER
-  dnl Arrange for unistd.h to include getopt.h.
-  GNULIB_UNISTD_H_GETOPT=1
-  dnl Arrange to compile the getopt implementation.
-  AC_LIBOBJ([getopt])
-  AC_LIBOBJ([getopt1])
-  gl_PREREQ_GETOPT
-])
-
 # emacs' configure.in uses this.
 AC_DEFUN([gl_GETOPT_IFELSE],
 [
@@ -50,12 +49,12 @@ AC_DEFUN([gl_GETOPT_IFELSE],
 AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 [
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON
 
   dnl Persuade Solaris <unistd.h> to declare optarg, optind, opterr, optopt.
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
   gl_CHECK_NEXT_HEADERS([getopt.h])
-  AC_CHECK_HEADERS_ONCE([getopt.h])
   if test $ac_cv_header_getopt_h = yes; then
     HAVE_GETOPT_H=1
   else
@@ -75,56 +74,65 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
     AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
   fi
 
-  dnl BSD getopt_long uses an incompatible method to reset option processing.
-  dnl Existence of the variable, in and of itself, is not a reason to replace
-  dnl getopt, but knowledge of the variable is needed to determine how to
-  dnl reset and whether a reset reparses the environment.
-  if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
-    AC_CHECK_DECLS([optreset], [], [],
-      [[#include <getopt.h>]])
-  fi
-
   dnl mingw's getopt (in libmingwex.a) does weird things when the options
   dnl strings starts with '+' and it's not the first call.  Some internal state
   dnl is left over from earlier calls, and neither setting optind = 0 nor
   dnl setting optreset = 1 get rid of this internal state.
   dnl POSIX is silent on optind vs. optreset, so we allow either behavior.
+  dnl POSIX 2008 does not specify leading '+' behavior, but see
+  dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
+  dnl the next version of POSIX.  For now, we only guarantee leading '+'
+  dnl behavior with getopt-gnu.
   if test -z "$gl_replace_getopt"; then
     AC_CACHE_CHECK([whether getopt is POSIX compatible],
       [gl_cv_func_getopt_posix],
       [
-        dnl This test fails on mingw and succeeds on all other platforms.
+        dnl BSD getopt_long uses an incompatible method to reset option
+        dnl processing.  Existence of the optreset variable, in and of
+        dnl itself, is not a reason to replace getopt, but knowledge
+        dnl of the variable is needed to determine how to reset and
+        dnl whether a reset reparses the environment.  Solaris
+        dnl supports neither optreset nor optind=0, but keeps no state
+        dnl that needs a reset beyond setting optind=1; detect Solaris
+        dnl by getopt_clip.
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[#include <unistd.h>]],
+             [[int *p = &optreset; return optreset;]])],
+          [gl_optind_min=1],
+          [AC_COMPILE_IFELSE(
+             [AC_LANG_PROGRAM(
+                [[#include <getopt.h>]],
+                [[return !getopt_clip;]])],
+             [gl_optind_min=1],
+             [gl_optind_min=0])])
+
+        dnl This test fails on mingw and succeeds on many other platforms.
+        gl_save_CPPFLAGS=$CPPFLAGS
+        CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min"
         AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 
-#if !HAVE_DECL_OPTRESET
-# define OPTIND_MIN 0
-#else
-# define OPTIND_MIN 1
-#endif
-
 int
 main ()
 {
   {
-    int argc = 0;
-    char *argv[10];
+    static char program[] = "program";
+    static char a[] = "-a";
+    static char foo[] = "foo";
+    static char bar[] = "bar";
+    char *argv[] = { program, a, foo, bar, NULL };
     int c;
 
-    argv[argc++] = "program";
-    argv[argc++] = "-a";
-    argv[argc++] = "foo";
-    argv[argc++] = "bar";
-    argv[argc] = NULL;
     optind = OPTIND_MIN;
     opterr = 0;
 
-    c = getopt (argc, argv, "ab");
+    c = getopt (4, argv, "ab");
     if (!(c == 'a'))
       return 1;
-    c = getopt (argc, argv, "ab");
+    c = getopt (4, argv, "ab");
     if (!(c == -1))
       return 2;
     if (!(optind == 2))
@@ -132,22 +140,20 @@ main ()
   }
   /* Some internal state exists at this point.  */
   {
-    int argc = 0;
-    char *argv[10];
+    static char program[] = "program";
+    static char donald[] = "donald";
+    static char p[] = "-p";
+    static char billy[] = "billy";
+    static char duck[] = "duck";
+    static char a[] = "-a";
+    static char bar[] = "bar";
+    char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
     int c;
 
-    argv[argc++] = "program";
-    argv[argc++] = "donald";
-    argv[argc++] = "-p";
-    argv[argc++] = "billy";
-    argv[argc++] = "duck";
-    argv[argc++] = "-a";
-    argv[argc++] = "bar";
-    argv[argc] = NULL;
     optind = OPTIND_MIN;
     opterr = 0;
 
-    c = getopt (argc, argv, "+abp:q:");
+    c = getopt (7, argv, "+abp:q:");
     if (!(c == -1))
       return 4;
     if (!(strcmp (argv[0], "program") == 0))
@@ -167,16 +173,34 @@ main ()
     if (!(optind == 1))
       return 12;
   }
+  /* Detect MacOS 10.5, AIX 7.1 bug.  */
+  {
+    static char program[] = "program";
+    static char ab[] = "-ab";
+    char *argv[3] = { program, ab, NULL };
+    optind = OPTIND_MIN;
+    opterr = 0;
+    if (getopt (2, argv, "ab:") != 'a')
+      return 13;
+    if (getopt (2, argv, "ab:") != '?')
+      return 14;
+    if (optopt != 'b')
+      return 15;
+    if (optind != 2)
+      return 16;
+  }
 
   return 0;
 }
 ]])],
           [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
           [case "$host_os" in
-             mingw*) gl_cv_func_getopt_posix="guessing no";;
-             *)      gl_cv_func_getopt_posix="guessing yes";;
+             mingw*)         gl_cv_func_getopt_posix="guessing no";;
+             darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
+             *)              gl_cv_func_getopt_posix="guessing yes";;
            esac
           ])
+        CPPFLAGS=$gl_save_CPPFLAGS
       ])
     case "$gl_cv_func_getopt_posix" in
       *no) gl_replace_getopt=yes ;;
@@ -189,52 +213,94 @@ main ()
        # optstring is necessary for programs like m4 that have POSIX-mandated
        # semantics for supporting options interspersed with files.
        # Also, since getopt_long is a GNU extension, we require optind=0.
-       gl_had_POSIXLY_CORRECT=${POSIXLY_CORRECT:+yes}
+       # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
+       # so take care to revert to the correct (non-)export state.
+dnl GNU Coding Standards currently allow awk but not env; besides, env
+dnl is ambiguous with environment values that contain newlines.
+       gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
+       case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
+         xx) gl_had_POSIXLY_CORRECT=exported ;;
+         x)  gl_had_POSIXLY_CORRECT=yes      ;;
+         *)  gl_had_POSIXLY_CORRECT=         ;;
+       esac
        POSIXLY_CORRECT=1
        export POSIXLY_CORRECT
        AC_RUN_IFELSE(
         [AC_LANG_PROGRAM([[#include <getopt.h>
                            #include <stddef.h>
                            #include <string.h>
+           ]GL_NOCRASH[
            ]], [[
+             int result = 0;
+
+             nocrash_init();
+
              /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
                 and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
                 OSF/1 5.1, Solaris 10.  */
              {
-               char *myargv[3];
-               myargv[0] = "conftest";
-               myargv[1] = "-+";
-               myargv[2] = 0;
+               static char conftest[] = "conftest";
+               static char plus[] = "-+";
+               char *argv[3] = { conftest, plus, NULL };
                opterr = 0;
-               if (getopt (2, myargv, "+a") != '?')
-                 return 1;
+               if (getopt (2, argv, "+a") != '?')
+                 result |= 1;
              }
              /* This code succeeds on glibc 2.8, mingw,
                 and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
                 IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x.  */
              {
-               char *argv[] = { "program", "-p", "foo", "bar", NULL };
+               static char program[] = "program";
+               static char p[] = "-p";
+               static char foo[] = "foo";
+               static char bar[] = "bar";
+               char *argv[] = { program, p, foo, bar, NULL };
 
                optind = 1;
                if (getopt (4, argv, "p::") != 'p')
-                 return 2;
-               if (optarg != NULL)
-                 return 3;
-               if (getopt (4, argv, "p::") != -1)
-                 return 4;
-               if (optind != 2)
-                 return 5;
+                 result |= 2;
+               else if (optarg != NULL)
+                 result |= 4;
+               else if (getopt (4, argv, "p::") != -1)
+                 result |= 6;
+               else if (optind != 2)
+                 result |= 8;
              }
              /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0.  */
              {
-               char *argv[] = { "program", "foo", "-p", NULL };
+               static char program[] = "program";
+               static char foo[] = "foo";
+               static char p[] = "-p";
+               char *argv[] = { program, foo, p, NULL };
                optind = 0;
                if (getopt (3, argv, "-p") != 1)
-                 return 6;
-               if (getopt (3, argv, "-p") != 'p')
-                 return 7;
+                 result |= 16;
+               else if (getopt (3, argv, "-p") != 'p')
+                 result |= 32;
+             }
+             /* This code fails on glibc 2.11.  */
+             {
+               static char program[] = "program";
+               static char b[] = "-b";
+               static char a[] = "-a";
+               char *argv[] = { program, b, a, NULL };
+               optind = opterr = 0;
+               if (getopt (3, argv, "+:a:b") != 'b')
+                 result |= 64;
+               else if (getopt (3, argv, "+:a:b") != ':')
+                 result |= 64;
+             }
+             /* This code dumps core on glibc 2.14.  */
+             {
+               static char program[] = "program";
+               static char w[] = "-W";
+               static char dummy[] = "dummy";
+               char *argv[] = { program, w, dummy, NULL };
+               optind = opterr = 1;
+               if (getopt (3, argv, "W;") != 'W')
+                 result |= 128;
              }
-             return 0;
+             return result;
            ]])],
         [gl_cv_func_getopt_gnu=yes],
         [gl_cv_func_getopt_gnu=no],
@@ -245,9 +311,11 @@ main ()
            *)                   gl_cv_func_getopt_gnu=yes;;
          esac
         ])
-       if test "$gl_had_POSIXLY_CORRECT" != yes; then
-         AS_UNSET([POSIXLY_CORRECT])
-       fi
+       case $gl_had_POSIXLY_CORRECT in
+         exported) ;;
+         yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;;
+         *) AS_UNSET([POSIXLY_CORRECT]) ;;
+       esac
       ])
     if test "$gl_cv_func_getopt_gnu" = "no"; then
       gl_replace_getopt=yes
index 9e7fde4272f5f60d1e3942501fab0a9ab314c5f0..7d03d1253bf328b4b9c548c195a4bf47e5350bf3 100644 (file)
@@ -1,13 +1,11 @@
-# gettime.m4 serial 7
-dnl Copyright (C) 2002, 2004-2006, 2009-2010 Free Software Foundation, Inc.
+# gettime.m4 serial 8
+dnl Copyright (C) 2002, 2004-2006, 2009-2012 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.
 
 AC_DEFUN([gl_GETTIME],
 [
-  AC_LIBOBJ([gettime])
-
   dnl Prerequisites of lib/gettime.c.
   AC_REQUIRE([gl_CLOCK_TIME])
   AC_REQUIRE([gl_TIMESPEC])
index 735123e6dc19469bf09c47dbe6b261b4cc75fe94..eda97027a92d72e67bd87f99dcd2b66fa936c752 100644 (file)
@@ -1,6 +1,6 @@
-# serial 12
+# serial 20
 
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2012 Free Software Foundation, Inc.
 # This file 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.
@@ -11,33 +11,66 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_HEADER_SYS_TIME_H])
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
   AC_CHECK_FUNCS_ONCE([gettimeofday])
 
-  AC_CACHE_CHECK([for gettimeofday with POSIX signature],
-    [gl_cv_func_gettimeofday_posix_signature],
-    [AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-          [[#include <sys/time.h>
-            struct timeval c;
-          ]],
-          [[
-            int (*f) (struct timeval *restrict, void *restrict) = gettimeofday;
-            int x = f (&c, 0);
-            return !(x | c.tv_sec | c.tv_usec);
-          ]])],
-        [gl_cv_func_gettimeofday_posix_signature=yes],
-        [gl_cv_func_gettimeofday_posix_signature=no])])
-
-  gl_FUNC_GETTIMEOFDAY_CLOBBER
-
-  if test $gl_cv_func_gettimeofday_posix_signature != yes; then
-    REPLACE_GETTIMEOFDAY=1
-    SYS_TIME_H=sys/time.h
-    if test $gl_cv_func_gettimeofday_clobber != yes; then
-      AC_LIBOBJ([gettimeofday])
-      gl_PREREQ_GETTIMEOFDAY
+  gl_gettimeofday_timezone=void
+  if test $ac_cv_func_gettimeofday != yes; then
+    HAVE_GETTIMEOFDAY=0
+  else
+    gl_FUNC_GETTIMEOFDAY_CLOBBER
+    AC_CACHE_CHECK([for gettimeofday with POSIX signature],
+      [gl_cv_func_gettimeofday_posix_signature],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#include <sys/time.h>
+              struct timeval c;
+              int gettimeofday (struct timeval *restrict, void *restrict);
+            ]],
+            [[/* glibc uses struct timezone * rather than the POSIX void *
+                 if _GNU_SOURCE is defined.  However, since the only portable
+                 use of gettimeofday uses NULL as the second parameter, and
+                 since the glibc definition is actually more typesafe, it is
+                 not worth wrapping this to get a compliant signature.  */
+              int (*f) (struct timeval *restrict, void *restrict)
+                = gettimeofday;
+              int x = f (&c, 0);
+              return !(x | c.tv_sec | c.tv_usec);
+            ]])],
+          [gl_cv_func_gettimeofday_posix_signature=yes],
+          [AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM(
+              [[#include <sys/time.h>
+int gettimeofday (struct timeval *restrict, struct timezone *restrict);
+              ]])],
+            [gl_cv_func_gettimeofday_posix_signature=almost],
+            [gl_cv_func_gettimeofday_posix_signature=no])])])
+    if test $gl_cv_func_gettimeofday_posix_signature = almost; then
+      gl_gettimeofday_timezone='struct timezone'
+    elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
+      REPLACE_GETTIMEOFDAY=1
+    fi
+    dnl If we override 'struct timeval', we also have to override gettimeofday.
+    if test $REPLACE_STRUCT_TIMEVAL = 1; then
+      REPLACE_GETTIMEOFDAY=1
     fi
+    m4_ifdef([gl_FUNC_TZSET_CLOBBER], [
+      gl_FUNC_TZSET_CLOBBER
+      case "$gl_cv_func_tzset_clobber" in
+        *yes)
+          REPLACE_GETTIMEOFDAY=1
+          gl_GETTIMEOFDAY_REPLACE_LOCALTIME
+          AC_DEFINE([tzset], [rpl_tzset],
+            [Define to rpl_tzset if the wrapper function should be used.])
+          AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1],
+            [Define if tzset clobbers localtime's static buffer.])
+          ;;
+      esac
+    ])
   fi
+  AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone],
+    [Define this to 'void' or 'struct timezone' to match the system's
+     declaration of the second argument to gettimeofday.])
 ])
 
 
@@ -51,6 +84,7 @@ dnl the wrapper functions that work around the problem.
 AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
 [
  AC_REQUIRE([gl_HEADER_SYS_TIME_H])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
  AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
   [gl_cv_func_gettimeofday_clobber],
@@ -73,21 +107,26 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
         ]])],
      [gl_cv_func_gettimeofday_clobber=no],
      [gl_cv_func_gettimeofday_clobber=yes],
-     dnl When crosscompiling, assume it is broken.
-     [gl_cv_func_gettimeofday_clobber=yes])])
+     [# When cross-compiling:
+      case "$host_os" in
+                # Guess all is fine on glibc systems.
+        *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
+                # If we don't know, assume the worst.
+        *)      gl_cv_func_gettimeofday_clobber="guessing yes" ;;
+      esac
+     ])])
 
- if test $gl_cv_func_gettimeofday_clobber = yes; then
-   REPLACE_GETTIMEOFDAY=1
-   SYS_TIME_H=sys/time.h
-   gl_GETTIMEOFDAY_REPLACE_LOCALTIME
-   AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
-     [Define if gettimeofday clobbers the localtime buffer.])
- fi
+ case "$gl_cv_func_gettimeofday_clobber" in
+   *yes)
+     REPLACE_GETTIMEOFDAY=1
+     gl_GETTIMEOFDAY_REPLACE_LOCALTIME
+     AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
+       [Define if gettimeofday clobbers the localtime buffer.])
+     ;;
+ esac
 ])
 
 AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
-  AC_LIBOBJ([gettimeofday])
-  gl_PREREQ_GETTIMEOFDAY
   AC_DEFINE([gmtime], [rpl_gmtime],
     [Define to rpl_gmtime if the replacement function should be used.])
   AC_DEFINE([localtime], [rpl_localtime],
index 68ada9d4d5b844e3ff5be076ec1156c542f6630e..c938fb1a0c3ecf70a8ce142d7ca998b9624c2360 100644 (file)
@@ -1,23 +1,27 @@
-# glibc21.m4 serial 4
-dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc.
+# glibc21.m4 serial 5
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2012 Free Software Foundation,
+dnl 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.
 
-# Test for the GNU C Library, version 2.1 or newer.
+# Test for the GNU C Library, version 2.1 or newer, or uClibc.
 # From Bruno Haible.
 
 AC_DEFUN([gl_GLIBC21],
   [
-    AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer],
+    AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
       [ac_cv_gnu_library_2_1],
-      [AC_EGREP_CPP([Lucky GNU user],
+      [AC_EGREP_CPP([Lucky],
         [
 #include <features.h>
 #ifdef __GNU_LIBRARY__
  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
   Lucky GNU user
  #endif
+#endif
+#ifdef __UCLIBC__
+ Lucky user
 #endif
         ],
         [ac_cv_gnu_library_2_1=yes],
index 385ab3ff1d0cdd59f192bef6a6cbf646eab80ffc..e796f3c8858788f922f9a8d3212137bad68111e8 100644 (file)
@@ -1,6 +1,6 @@
 # Determine whether recent-enough GNU Make is being used.
 
-# Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index b7812a896217a250e8298125c6a087a588994340..d62b7677ab95b99c96f95419b147657766ab9627 100644 (file)
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 12
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 32
+dnl Copyright (C) 2007-2012 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.
@@ -12,6 +12,20 @@ AC_DEFUN([gl_COMMON], [
   AC_REQUIRE([gl_COMMON_BODY])
 ])
 AC_DEFUN([gl_COMMON_BODY], [
+  AH_VERBATIM([_Noreturn],
+[/* The _Noreturn keyword of C11.  */
+#if ! (defined _Noreturn \
+       || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+      || 0x5110 <= __SUNPRO_C)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# elif defined _MSC_VER && 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn
+# endif
+#endif
+])
   AH_VERBATIM([isoc99_inline],
 [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
    the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
@@ -34,15 +48,153 @@ AC_DEFUN([gl_COMMON_BODY], [
 /* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
    is a misnomer outside of parameter lists.  */
 #define _UNUSED_PARAMETER_ _GL_UNUSED
+
+/* The __pure__ attribute was added in gcc 2.96.  */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
+#endif
+
+/* The __const__ attribute was added in gcc 2.95.  */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+#else
+# define _GL_ATTRIBUTE_CONST /* empty */
+#endif
+])
+  dnl Preparation for running test programs:
+  dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+  dnl to /dev/tty, so they can be redirected to log files.  Such diagnostics
+  dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
+  LIBC_FATAL_STDERR_=1
+  export LIBC_FATAL_STDERR_
+])
+
+# gl_MODULE_INDICATOR_CONDITION
+# expands to a C preprocessor expression that evaluates to 1 or 0, depending
+# whether a gnulib module that has been requested shall be considered present
+# or not.
+m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
+# sets the shell variable that indicates the presence of the given module to
+# a C preprocessor expression that will evaluate to 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
+[
+  gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
+    [GNULIB_[]m4_translit([[$1]],
+                          [abcdefghijklmnopqrstuvwxyz./-],
+                          [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
+    [gl_MODULE_INDICATOR_CONDITION])
+])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable])
+# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION.
+# The shell variable's value is a C preprocessor expression that evaluates
+# to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX],
+[
+  m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1],
+    [
+     dnl Simplify the expression VALUE || 1 to 1.
+     $1=1
+    ],
+    [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1],
+                                             [gl_MODULE_INDICATOR_CONDITION])])
 ])
+
+# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition])
+# modifies the shell variable to include the given condition.  The shell
+# variable's value is a C preprocessor expression that evaluates to 0 or 1.
+AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR],
+[
+  dnl Simplify the expression 1 || CONDITION to 1.
+  if test "$[]$1" != 1; then
+    dnl Simplify the expression 0 || CONDITION to CONDITION.
+    if test "$[]$1" = 0; then
+      $1=$2
+    else
+      $1="($[]$1 || $2)"
+    fi
+  fi
 ])
 
 # gl_MODULE_INDICATOR([modulename])
-# defines a C macro indicating the presence of the given module.
+# defines a C macro indicating the presence of the given module
+# in a location where it can be used.
+#                                             |  Value  |   Value   |
+#                                             | in lib/ | in tests/ |
+# --------------------------------------------+---------+-----------+
+# Module present among main modules:          |    1    |     1     |
+# --------------------------------------------+---------+-----------+
+# Module present among tests-related modules: |    0    |     1     |
+# --------------------------------------------+---------+-----------+
+# Module not present at all:                  |    0    |     0     |
+# --------------------------------------------+---------+-----------+
 AC_DEFUN([gl_MODULE_INDICATOR],
 [
-  AC_DEFINE([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
-    [Define to 1 when using the gnulib module ]$1[.])
+  AC_DEFINE_UNQUOTED([GNULIB_]m4_translit([[$1]],
+      [abcdefghijklmnopqrstuvwxyz./-],
+      [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]),
+    [gl_MODULE_INDICATOR_CONDITION],
+    [Define to a C preprocessor expression that evaluates to 1 or 0,
+     depending whether the gnulib module $1 shall be considered present.])
+])
+
+# gl_MODULE_INDICATOR_FOR_TESTS([modulename])
+# defines a C macro indicating the presence of the given module
+# in lib or tests. This is useful to determine whether the module
+# should be tested.
+#                                             |  Value  |   Value   |
+#                                             | in lib/ | in tests/ |
+# --------------------------------------------+---------+-----------+
+# Module present among main modules:          |    1    |     1     |
+# --------------------------------------------+---------+-----------+
+# Module present among tests-related modules: |    1    |     1     |
+# --------------------------------------------+---------+-----------+
+# Module not present at all:                  |    0    |     0     |
+# --------------------------------------------+---------+-----------+
+AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
+[
+  AC_DEFINE([GNULIB_TEST_]m4_translit([[$1]],
+      [abcdefghijklmnopqrstuvwxyz./-],
+      [ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
+    [Define to 1 when the gnulib module $1 should be tested.])
+])
+
+# gl_ASSERT_NO_GNULIB_POSIXCHECK
+# asserts that there will never be a need to #define GNULIB_POSIXCHECK.
+# and thereby enables an optimization of configure and config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
+[
+  dnl Override gl_WARN_ON_USE_PREPARE.
+  dnl But hide this definition from 'aclocal'.
+  AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], [])
+])
+
+# gl_ASSERT_NO_GNULIB_TESTS
+# asserts that there will be no gnulib tests in the scope of the configure.ac
+# and thereby enables an optimization of config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS],
+[
+  dnl Override gl_MODULE_INDICATOR_FOR_TESTS.
+  AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [])
+])
+
+# Test whether <features.h> exists.
+# Set HAVE_FEATURES_H.
+AC_DEFUN([gl_FEATURES_H],
+[
+  AC_CHECK_HEADERS_ONCE([features.h])
+  if test $ac_cv_header_features_h = yes; then
+    HAVE_FEATURES_H=1
+  else
+    HAVE_FEATURES_H=0
+  fi
+  AC_SUBST([HAVE_FEATURES_H])
 ])
 
 # m4_foreach_w
@@ -60,10 +212,94 @@ m4_ifndef([AS_VAR_IF],
 [m4_define([AS_VAR_IF],
 [AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
 
+# gl_PROG_CC_C99
+# Modifies the value of the shell variable CC in an attempt to make $CC
+# understand ISO C99 source code.
+# This is like AC_PROG_CC_C99, except that
+# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60,
+# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
+#   <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>,
+#   but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
+#   <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>.
+# Remaining problems:
+# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
+#   to CC twice
+#   <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>.
+# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
+AC_DEFUN([gl_PROG_CC_C99],
+[
+  dnl Change that version number to the minimum Autoconf version that supports
+  dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls.
+  m4_version_prereq([9.0],
+    [AC_REQUIRE([AC_PROG_CC_C99])],
+    [AC_REQUIRE([AC_PROG_CC_STDC])])
+])
+
+# gl_PROG_AR_RANLIB
+# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler.
+# The user can set the variables AR, ARFLAGS, RANLIB if he wants to override
+# the values.
+AC_DEFUN([gl_PROG_AR_RANLIB],
+[
+  dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
+  dnl as "cc", and GCC as "gcc". They have different object file formats and
+  dnl library formats. In particular, the GNU binutils programs ar, ranlib
+  dnl produce libraries that work only with gcc, not with cc.
+  AC_REQUIRE([AC_PROG_CC])
+  AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
+    [
+      AC_EGREP_CPP([Amsterdam],
+        [
+#ifdef __ACK__
+Amsterdam
+#endif
+        ],
+        [gl_cv_c_amsterdam_compiler=yes],
+        [gl_cv_c_amsterdam_compiler=no])
+    ])
+  if test -z "$AR"; then
+    if test $gl_cv_c_amsterdam_compiler = yes; then
+      AR='cc -c.a'
+      if test -z "$ARFLAGS"; then
+        ARFLAGS='-o'
+      fi
+    else
+      dnl Use the Automake-documented default values for AR and ARFLAGS,
+      dnl but prefer ${host}-ar over ar (useful for cross-compiling).
+      AC_CHECK_TOOL([AR], [ar], [ar])
+      if test -z "$ARFLAGS"; then
+        ARFLAGS='cru'
+      fi
+    fi
+  else
+    if test -z "$ARFLAGS"; then
+      ARFLAGS='cru'
+    fi
+  fi
+  AC_SUBST([AR])
+  AC_SUBST([ARFLAGS])
+  if test -z "$RANLIB"; then
+    if test $gl_cv_c_amsterdam_compiler = yes; then
+      RANLIB=':'
+    else
+      dnl Use the ranlib program if it is available.
+      AC_PROG_RANLIB
+    fi
+  fi
+  AC_SUBST([RANLIB])
+])
+
 # AC_PROG_MKDIR_P
-# is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
-# Remove this macro when we can assume autoconf >= 2.60.
-m4_ifdef([AC_PROG_MKDIR_P], [], [
+# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
+# for interoperability with automake-1.9.6 from autoconf-2.62.
+# Remove this macro when we can assume autoconf >= 2.62 or
+# autoconf >= 2.60 && automake >= 1.10.
+m4_ifdef([AC_PROG_MKDIR_P], [
+  dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
+  m4_define([AC_PROG_MKDIR_P],
+    m4_defn([AC_PROG_MKDIR_P])[
+    AC_SUBST([MKDIR_P])])], [
+  dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P.
   AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
     [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
      MKDIR_P='$(mkdir_p)'
@@ -74,6 +310,7 @@ m4_ifdef([AC_PROG_MKDIR_P], [], [
 # so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
 # works.
 # This definition can be removed once autoconf >= 2.62 can be assumed.
+m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.62]),[-1],[
 AC_DEFUN([AC_C_RESTRICT],
 [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
   [ac_cv_c_restrict=no
@@ -111,6 +348,7 @@ AC_DEFUN([AC_C_RESTRICT],
    *)  AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
  esac
 ])
+])
 
 # gl_BIGENDIAN
 # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
index b84bfb657bd135980fae7b60796260f2d6824329..2bdcb3ef9eeb6a9cd434de23cfabdb4b34e233ec 100644 (file)
@@ -1,12 +1,22 @@
-# -*- buffer-read-only: t -*- vi: set ro:
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
+#
+# This file 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 3 of the License, or
+# (at your option) any later version.
+#
+# This file 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 file.  If not, see <http://www.gnu.org/licenses/>.
 #
-# This file is free software, distributed under the terms of the GNU
-# General Public License.  As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
+# As a special exception to the GNU General Public License,
+# this file may be distributed as part of a program that
+# contains a configuration script generated by Autoconf, under
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
@@ -14,7 +24,8 @@
 # This file represents the compiled summary of the specification in
 # gnulib-cache.m4. It lists the computed macro invocations that need
 # to be invoked from configure.ac.
-# In projects using CVS, this file can be treated like other built files.
+# In projects that use version control, this file can be treated like
+# other built files.
 
 
 # This macro should be invoked from ./configure.ac, in the section
@@ -26,12 +37,179 @@ AC_DEFUN([gl_EARLY],
   m4_pattern_allow([^gl_ES$])dnl a valid locale name
   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
-  AC_REQUIRE([AC_PROG_RANLIB])
+  AC_REQUIRE([gl_PROG_AR_RANLIB])
+  AC_REQUIRE([AM_PROG_CC_C_O])
+  # Code from module alloca-opt:
+  # Code from module announce-gen:
+  # Code from module at-internal:
+  # Code from module c-ctype:
+  # Code from module c-strcase:
+  # Code from module c-strcaseeq:
+  # Code from module calloc:
+  # Code from module calloc-gnu:
+  # Code from module calloc-posix:
+  # Code from module chdir:
+  # Code from module chdir-long:
+  # Code from module clock-time:
+  # Code from module cloexec:
+  # Code from module close:
+  # Code from module close-stream:
+  # Code from module closedir:
+  # Code from module closein:
+  # Code from module closeout:
+  # Code from module configmake:
+  # Code from module dirent:
+  # Code from module dirent-safer:
+  # Code from module dirfd:
+  # Code from module dirname-lgpl:
+  # Code from module do-release-commit-and-tag:
+  # Code from module dosname:
+  # Code from module double-slash-root:
+  # Code from module dup:
+  # Code from module dup2:
+  # Code from module errno:
+  # Code from module error:
+  # Code from module exitfail:
+  # Code from module extensions:
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  # Code from module fchdir:
+  # Code from module fclose:
+  # Code from module fcntl:
+  # Code from module fcntl-h:
+  # Code from module fcntl-safer:
+  # Code from module fd-hook:
+  # Code from module fdl:
+  # Code from module fdopendir:
+  # Code from module fflush:
   AC_REQUIRE([AC_FUNC_FSEEKO])
+  # Code from module filename:
+  # Code from module filenamecat-lgpl:
+  # Code from module float:
+  # Code from module fpending:
+  # Code from module fpieee:
   AC_REQUIRE([gl_FP_IEEE])
+  # Code from module fprintf-posix:
+  # Code from module fpucw:
+  # Code from module fpurge:
+  # Code from module freadahead:
+  # Code from module freading:
+  # Code from module frexp-nolibm:
+  # Code from module frexpl-nolibm:
+  # Code from module fseek:
+  # Code from module fseeko:
   AC_REQUIRE([AC_FUNC_FSEEKO])
+  # Code from module fseterr:
+  # Code from module fstat:
+  # Code from module ftell:
+  # Code from module ftello:
   AC_REQUIRE([AC_FUNC_FSEEKO])
+  # Code from module gendocs:
+  # Code from module getcwd-lgpl:
+  # Code from module getdtablesize:
+  # Code from module getopt-gnu:
+  # Code from module getopt-posix:
+  # Code from module gettext-h:
+  # Code from module gettime:
+  # Code from module gettimeofday:
+  # Code from module git-version-gen:
+  # Code from module gitlog-to-changelog:
+  # Code from module gnu-make:
+  # Code from module gnu-web-doc-update:
+  # Code from module gnumakefile:
+  # Code from module gnupload:
+  # Code from module havelib:
+  # Code from module ignore-value:
+  # Code from module include_next:
+  # Code from module inline:
+  # Code from module intprops:
+  # Code from module isnand-nolibm:
+  # Code from module isnanf-nolibm:
+  # Code from module isnanl-nolibm:
+  # Code from module largefile:
+  AC_REQUIRE([AC_SYS_LARGEFILE])
+  # Code from module lib-ignore:
+  # Code from module localcharset:
+  # Code from module lock:
+  # Code from module lseek:
+  # Code from module lstat:
+  # Code from module maintainer-makefile:
+  # Code from module malloc-gnu:
+  # Code from module malloc-posix:
+  # Code from module manywarnings:
+  # Code from module math:
+  # Code from module mbrtowc:
+  # Code from module mbsinit:
+  # Code from module memchr:
+  # Code from module mempcpy:
+  # Code from module memrchr:
+  # Code from module msvc-inval:
+  # Code from module msvc-nothrow:
+  # Code from module multiarch:
+  # Code from module nocrash:
+  # Code from module open:
+  # Code from module openat:
+  # Code from module openat-die:
+  # Code from module openat-h:
+  # Code from module opendir:
+  # Code from module pathmax:
+  # Code from module perror:
+  # Code from module printf-frexp:
+  # Code from module printf-frexpl:
+  # Code from module printf-posix:
+  # Code from module printf-safe:
+  # Code from module quotearg:
+  # Code from module quotearg-simple:
+  # Code from module readdir:
+  # Code from module readme-release:
+  # Code from module realloc-gnu:
+  # Code from module realloc-posix:
+  # Code from module save-cwd:
+  # Code from module savedir:
+  # Code from module signbit:
+  # Code from module size_max:
+  # Code from module snippet/_Noreturn:
+  # Code from module snippet/arg-nonnull:
+  # Code from module snippet/c++defs:
+  # Code from module snippet/unused-parameter:
+  # Code from module snippet/warn-on-use:
+  # Code from module ssize_t:
+  # Code from module stat:
+  # Code from module stat-time:
+  # Code from module stdbool:
+  # Code from module stddef:
+  # Code from module stdint:
+  # Code from module stdio:
+  # Code from module stdlib:
+  # Code from module strdup-posix:
+  # Code from module streq:
+  # Code from module strerror:
+  # Code from module strerror-override:
+  # Code from module strerror_r-posix:
+  # Code from module string:
+  # Code from module sys_stat:
+  # Code from module sys_time:
+  # Code from module sys_types:
+  # Code from module threadlib:
+  gl_THREADLIB_EARLY
+  # Code from module time:
+  # Code from module timespec:
+  # Code from module unistd:
+  # Code from module unistd-safer:
+  # Code from module update-copyright:
+  # Code from module useless-if-before-free:
+  # Code from module utimens:
+  # Code from module vasnprintf:
+  # Code from module vc-list-files:
+  # Code from module verify:
+  # Code from module vfprintf-posix:
+  # Code from module warnings:
+  # Code from module wchar:
+  # Code from module wctype-h:
+  # Code from module xalloc:
+  # Code from module xalloc-die:
+  # Code from module xalloc-oversized:
+  # Code from module xsize:
+  # Code from module yesno:
 ])
 
 # This macro should be invoked from ./configure.ac, in the section
@@ -42,6 +220,7 @@ AC_DEFUN([gl_INIT],
   gl_cond_libtool=false
   gl_libdeps=
   gl_ltlibdeps=
+  gl_m4_base='m4'
   m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
   m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
   m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
@@ -49,170 +228,411 @@ AC_DEFUN([gl_INIT],
   m4_pushdef([gl_LIBSOURCES_DIR], [])
   gl_COMMON
   gl_source_base='lib'
-  gl_FUNC_ALLOCA
-  AC_FUNC_CALLOC
-  gl_FUNC_CALLOC_POSIX
-  gl_STDLIB_MODULE_INDICATOR([calloc-posix])
-  gl_FUNC_CHDIR_LONG
-  gl_FUNC_CHOWN
-  gl_UNISTD_MODULE_INDICATOR([chown])
-  gl_CLOCK_TIME
-  gl_FUNC_CLOSE
-  gl_UNISTD_MODULE_INDICATOR([close])
-  gl_CLOSE_STREAM
-  gl_MODULE_INDICATOR([close-stream])
-  gl_CLOSEIN
-  gl_CLOSEOUT
-  gl_CHECK_TYPE_STRUCT_DIRENT_D_INO
-  gl_DIRENT_H
-  gl_FUNC_DIRFD
-  gl_DIRENT_MODULE_INDICATOR([dirfd])
-  gl_DIRNAME_LGPL
-  gl_DOUBLE_SLASH_ROOT
-  gl_FUNC_DUP2
-  gl_UNISTD_MODULE_INDICATOR([dup2])
-  gl_HEADER_ERRNO_H
-  gl_ERROR
-  m4_ifdef([AM_XGETTEXT_OPTION],
-    [AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
-     AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
-  gl_EXITFAIL
-  gl_FUNC_FCHDIR
-  gl_UNISTD_MODULE_INDICATOR([fchdir])
-  gl_FUNC_FCLOSE
-  gl_STDIO_MODULE_INDICATOR([fclose])
-  gl_FUNC_FCNTL
-  gl_FCNTL_MODULE_INDICATOR([fcntl])
-  gl_FCNTL_H
-  gl_FCNTL_SAFER
-  gl_MODULE_INDICATOR([fcntl-safer])
-  gl_FUNC_FDOPENDIR
-  gl_DIRENT_MODULE_INDICATOR([fdopendir])
-  gl_FUNC_FFLUSH
-  gl_STDIO_MODULE_INDICATOR([fflush])
-  gl_FLOAT_H
-  gl_FUNC_FPENDING
-  gl_FUNC_FPRINTF_POSIX
-  gl_STDIO_MODULE_INDICATOR([fprintf-posix])
-  gl_FUNC_FPURGE
-  gl_STDIO_MODULE_INDICATOR([fpurge])
-  gl_FUNC_FREADING
-  gl_FUNC_FREXP_NO_LIBM
-  gl_MATH_MODULE_INDICATOR([frexp])
-  gl_FUNC_FREXPL_NO_LIBM
-  gl_MATH_MODULE_INDICATOR([frexpl])
-  gl_FUNC_FSEEKO
-  gl_STDIO_MODULE_INDICATOR([fseeko])
-  gl_FUNC_FTELLO
-  gl_STDIO_MODULE_INDICATOR([ftello])
-  gl_FUNC_GETCWD
-  gl_UNISTD_MODULE_INDICATOR([getcwd])
-  gl_FUNC_GETOPT_GNU
-  gl_MODULE_INDICATOR([getopt-gnu])
-  gl_FUNC_GETOPT_POSIX
-  AC_SUBST([LIBINTL])
-  AC_SUBST([LTLIBINTL])
-  gl_GETTIME
-  gl_FUNC_GETTIMEOFDAY
-  gl_GNU_MAKE
-  # Autoconf 2.61a.99 and earlier don't support linking a file only
-  # in VPATH builds.  But since GNUmakefile is for maintainer use
-  # only, it does not matter if we skip the link with older autoconf.
-  # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
-  # builds, so use a shell variable to bypass this.
-  GNUmakefile=GNUmakefile
-  m4_if(m4_version_compare([2.61a.100],
-       m4_defn([m4_PACKAGE_VERSION])), [1], [],
-        [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
-       [GNUmakefile=$GNUmakefile])])
-  AC_REQUIRE([AC_C_INLINE])
-  gl_INLINE
-  gl_FUNC_ISNAND_NO_LIBM
-  gl_FUNC_ISNANF_NO_LIBM
-  gl_FUNC_ISNANL_NO_LIBM
-  gl_FUNC_LCHOWN
-  gl_UNISTD_MODULE_INDICATOR([lchown])
-  gl_LOCALCHARSET
-  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(top_builddir)/$gl_source_base\""
-  AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
-  gl_FUNC_LSEEK
-  gl_UNISTD_MODULE_INDICATOR([lseek])
-  gl_FUNC_LSTAT
-  gl_SYS_STAT_MODULE_INDICATOR([lstat])
-  AC_FUNC_MALLOC
-  AC_DEFINE([GNULIB_MALLOC_GNU], 1, [Define to indicate the 'malloc' module.])
-  gl_FUNC_MALLOC_POSIX
-  gl_STDLIB_MODULE_INDICATOR([malloc-posix])
-  gl_MATH_H
-  gl_FUNC_MBRTOWC
-  gl_WCHAR_MODULE_INDICATOR([mbrtowc])
-  gl_FUNC_MBSINIT
-  gl_WCHAR_MODULE_INDICATOR([mbsinit])
-  gl_FUNC_MEMCHR
-  gl_STRING_MODULE_INDICATOR([memchr])
-  gl_FUNC_MEMPCPY
-  gl_STRING_MODULE_INDICATOR([mempcpy])
-  gl_FUNC_MEMRCHR
-  gl_STRING_MODULE_INDICATOR([memrchr])
-  gl_FUNC_MKDIR
-  gl_MULTIARCH
-  gl_FUNC_OPEN
-  gl_MODULE_INDICATOR([open])
-  gl_FCNTL_MODULE_INDICATOR([open])
-  gl_FUNC_OPENAT
-  gl_FUNC_PERROR
-  gl_STRING_MODULE_INDICATOR([perror])
-  gl_FUNC_PRINTF_FREXP
-  gl_FUNC_PRINTF_FREXPL
-  gl_FUNC_PRINTF_POSIX
-  gl_STDIO_MODULE_INDICATOR([printf-posix])
-  m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes])
-  gl_QUOTEARG
-  AC_FUNC_REALLOC
-  AC_DEFINE([GNULIB_REALLOC_GNU], 1, [Define to indicate the 'realloc' module.])
-  gl_FUNC_REALLOC_POSIX
-  gl_STDLIB_MODULE_INDICATOR([realloc-posix])
-  gl_FUNC_RMDIR
-  gl_UNISTD_MODULE_INDICATOR([rmdir])
-  gl_SAVE_CWD
-  gl_SIGNBIT
-  gl_MATH_MODULE_INDICATOR([signbit])
-  gl_SIZE_MAX
-  gl_FUNC_STAT
-  gl_SYS_STAT_MODULE_INDICATOR([stat])
-  gl_STAT_TIME
-  gl_STAT_BIRTHTIME
-  AM_STDBOOL_H
-  gl_STDDEF_H
-  gl_STDINT_H
-  gl_STDIO_H
-  gl_STDLIB_H
-  gl_FUNC_STRDUP_POSIX
-  gl_STRING_MODULE_INDICATOR([strdup])
-  gl_FUNC_STRERROR
-  gl_STRING_MODULE_INDICATOR([strerror])
-  gl_HEADER_STRING_H
-  gl_HEADER_SYS_STAT_H
-  AC_PROG_MKDIR_P
-  gl_HEADER_SYS_TIME_H
-  AC_PROG_MKDIR_P
-  gl_HEADER_TIME_H
-  gl_TIMESPEC
-  gl_UNISTD_H
-  gl_UNISTD_SAFER
-  gl_FUNC_UNLINK
-  gl_UNISTD_MODULE_INDICATOR([unlink])
-  gl_UTIMENS
-  gl_FUNC_VASNPRINTF
-  gl_FUNC_VFPRINTF_POSIX
-  gl_STDIO_MODULE_INDICATOR([vfprintf-posix])
-  AC_SUBST([WARN_CFLAGS])
-  gl_WCHAR_H
-  gl_WCTYPE_H
-  gl_XALLOC
-  gl_XGETCWD
-  gl_XSIZE
-  gl_YESNO
+gl_FUNC_ALLOCA
+AC_LIBOBJ([openat-proc])
+gl_FUNC_CALLOC_GNU
+if test $REPLACE_CALLOC = 1; then
+  AC_LIBOBJ([calloc])
+fi
+gl_MODULE_INDICATOR([calloc-gnu])
+gl_FUNC_CALLOC_POSIX
+if test $REPLACE_CALLOC = 1; then
+  AC_LIBOBJ([calloc])
+fi
+gl_STDLIB_MODULE_INDICATOR([calloc-posix])
+gl_UNISTD_MODULE_INDICATOR([chdir])
+gl_FUNC_CHDIR_LONG
+if test $gl_cv_have_arbitrary_file_name_length_limit = yes; then
+  AC_LIBOBJ([chdir-long])
+  gl_PREREQ_CHDIR_LONG
+fi
+gl_CLOCK_TIME
+gl_MODULE_INDICATOR_FOR_TESTS([cloexec])
+gl_FUNC_CLOSE
+if test $REPLACE_CLOSE = 1; then
+  AC_LIBOBJ([close])
+fi
+gl_UNISTD_MODULE_INDICATOR([close])
+gl_CLOSE_STREAM
+gl_MODULE_INDICATOR([close-stream])
+gl_FUNC_CLOSEDIR
+if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
+  AC_LIBOBJ([closedir])
+fi
+gl_DIRENT_MODULE_INDICATOR([closedir])
+gl_CLOSEIN
+gl_CLOSEOUT
+gl_CONFIGMAKE_PREP
+gl_DIRENT_H
+gl_DIRENT_SAFER
+gl_MODULE_INDICATOR([dirent-safer])
+gl_FUNC_DIRFD
+if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no; then
+  AC_LIBOBJ([dirfd])
+  gl_PREREQ_DIRFD
+fi
+gl_DIRENT_MODULE_INDICATOR([dirfd])
+gl_DIRNAME_LGPL
+gl_DOUBLE_SLASH_ROOT
+gl_FUNC_DUP
+if test $REPLACE_DUP = 1; then
+  AC_LIBOBJ([dup])
+  gl_PREREQ_DUP
+fi
+gl_UNISTD_MODULE_INDICATOR([dup])
+gl_FUNC_DUP2
+if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
+  AC_LIBOBJ([dup2])
+  gl_PREREQ_DUP2
+fi
+gl_UNISTD_MODULE_INDICATOR([dup2])
+gl_HEADER_ERRNO_H
+gl_ERROR
+if test $ac_cv_lib_error_at_line = no; then
+  AC_LIBOBJ([error])
+  gl_PREREQ_ERROR
+fi
+m4_ifdef([AM_XGETTEXT_OPTION],
+  [AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
+   AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
+gl_FUNC_FCHDIR
+gl_UNISTD_MODULE_INDICATOR([fchdir])
+gl_FUNC_FCLOSE
+if test $REPLACE_FCLOSE = 1; then
+  AC_LIBOBJ([fclose])
+fi
+gl_STDIO_MODULE_INDICATOR([fclose])
+gl_FUNC_FCNTL
+if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
+  AC_LIBOBJ([fcntl])
+fi
+gl_FCNTL_MODULE_INDICATOR([fcntl])
+gl_FCNTL_H
+gl_FCNTL_SAFER
+gl_MODULE_INDICATOR([fcntl-safer])
+gl_FUNC_FDOPENDIR
+if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
+  AC_LIBOBJ([fdopendir])
+fi
+gl_DIRENT_MODULE_INDICATOR([fdopendir])
+gl_MODULE_INDICATOR([fdopendir])
+gl_FUNC_FFLUSH
+if test $REPLACE_FFLUSH = 1; then
+  AC_LIBOBJ([fflush])
+  gl_PREREQ_FFLUSH
+fi
+gl_MODULE_INDICATOR([fflush])
+gl_STDIO_MODULE_INDICATOR([fflush])
+gl_FILE_NAME_CONCAT_LGPL
+gl_FLOAT_H
+if test $REPLACE_FLOAT_LDBL = 1; then
+  AC_LIBOBJ([float])
+fi
+if test $REPLACE_ITOLD = 1; then
+  AC_LIBOBJ([itold])
+fi
+gl_FUNC_FPENDING
+if test $ac_cv_func___fpending = no; then
+  AC_LIBOBJ([fpending])
+  gl_PREREQ_FPENDING
+fi
+gl_FUNC_FPRINTF_POSIX
+gl_STDIO_MODULE_INDICATOR([fprintf-posix])
+gl_FUNC_FPURGE
+if test $HAVE_FPURGE = 0 || test $REPLACE_FPURGE = 1; then
+  AC_LIBOBJ([fpurge])
+fi
+gl_STDIO_MODULE_INDICATOR([fpurge])
+gl_FUNC_FREADING
+gl_FUNC_FREXP_NO_LIBM
+if test $gl_func_frexp_no_libm != yes; then
+  AC_LIBOBJ([frexp])
+fi
+gl_MATH_MODULE_INDICATOR([frexp])
+gl_FUNC_FREXPL_NO_LIBM
+if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then
+  AC_LIBOBJ([frexpl])
+fi
+gl_MATH_MODULE_INDICATOR([frexpl])
+gl_FUNC_FSEEK
+if test $REPLACE_FSEEK = 1; then
+  AC_LIBOBJ([fseek])
+fi
+gl_STDIO_MODULE_INDICATOR([fseek])
+gl_FUNC_FSEEKO
+if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
+  AC_LIBOBJ([fseeko])
+  gl_PREREQ_FSEEKO
+fi
+gl_STDIO_MODULE_INDICATOR([fseeko])
+gl_FUNC_FSTAT
+if test $REPLACE_FSTAT = 1; then
+  AC_LIBOBJ([fstat])
+  gl_PREREQ_FSTAT
+fi
+gl_SYS_STAT_MODULE_INDICATOR([fstat])
+gl_FUNC_FTELL
+if test $REPLACE_FTELL = 1; then
+  AC_LIBOBJ([ftell])
+fi
+gl_STDIO_MODULE_INDICATOR([ftell])
+gl_FUNC_FTELLO
+if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
+  AC_LIBOBJ([ftello])
+  gl_PREREQ_FTELLO
+fi
+gl_STDIO_MODULE_INDICATOR([ftello])
+gl_FUNC_GETCWD_LGPL
+if test $REPLACE_GETCWD = 1; then
+  AC_LIBOBJ([getcwd-lgpl])
+fi
+gl_UNISTD_MODULE_INDICATOR([getcwd])
+gl_FUNC_GETDTABLESIZE
+if test $HAVE_GETDTABLESIZE = 0; then
+  AC_LIBOBJ([getdtablesize])
+  gl_PREREQ_GETDTABLESIZE
+fi
+gl_UNISTD_MODULE_INDICATOR([getdtablesize])
+gl_FUNC_GETOPT_GNU
+if test $REPLACE_GETOPT = 1; then
+  AC_LIBOBJ([getopt])
+  AC_LIBOBJ([getopt1])
+  gl_PREREQ_GETOPT
+  dnl Arrange for unistd.h to include getopt.h.
+  GNULIB_GL_UNISTD_H_GETOPT=1
+fi
+AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
+gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
+gl_FUNC_GETOPT_POSIX
+if test $REPLACE_GETOPT = 1; then
+  AC_LIBOBJ([getopt])
+  AC_LIBOBJ([getopt1])
+  gl_PREREQ_GETOPT
+  dnl Arrange for unistd.h to include getopt.h.
+  GNULIB_GL_UNISTD_H_GETOPT=1
+fi
+AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
+AC_SUBST([LIBINTL])
+AC_SUBST([LTLIBINTL])
+gl_GETTIME
+gl_FUNC_GETTIMEOFDAY
+if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
+  AC_LIBOBJ([gettimeofday])
+  gl_PREREQ_GETTIMEOFDAY
+fi
+gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
+gl_GNU_MAKE
+# Autoconf 2.61a.99 and earlier don't support linking a file only
+# in VPATH builds.  But since GNUmakefile is for maintainer use
+# only, it does not matter if we skip the link with older autoconf.
+# Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
+# builds, so use a shell variable to bypass this.
+GNUmakefile=GNUmakefile
+m4_if(m4_version_compare([2.61a.100],
+        m4_defn([m4_PACKAGE_VERSION])), [1], [],
+      [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
+        [GNUmakefile=$GNUmakefile])])
+AC_REQUIRE([AC_C_INLINE])
+gl_INLINE
+gl_FUNC_ISNAND_NO_LIBM
+if test $gl_func_isnand_no_libm != yes; then
+  AC_LIBOBJ([isnand])
+  gl_PREREQ_ISNAND
+fi
+gl_FUNC_ISNANF_NO_LIBM
+if test $gl_func_isnanf_no_libm != yes; then
+  AC_LIBOBJ([isnanf])
+  gl_PREREQ_ISNANF
+fi
+gl_FUNC_ISNANL_NO_LIBM
+if test $gl_func_isnanl_no_libm != yes; then
+  AC_LIBOBJ([isnanl])
+  gl_PREREQ_ISNANL
+fi
+AC_REQUIRE([gl_LARGEFILE])
+gl_IGNORE_UNUSED_LIBRARIES
+gl_LOCALCHARSET
+LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
+gl_LOCK
+gl_FUNC_LSEEK
+if test $REPLACE_LSEEK = 1; then
+  AC_LIBOBJ([lseek])
+fi
+gl_UNISTD_MODULE_INDICATOR([lseek])
+gl_FUNC_LSTAT
+if test $REPLACE_LSTAT = 1; then
+  AC_LIBOBJ([lstat])
+  gl_PREREQ_LSTAT
+fi
+gl_SYS_STAT_MODULE_INDICATOR([lstat])
+AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
+  [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
+gl_FUNC_MALLOC_GNU
+if test $REPLACE_MALLOC = 1; then
+  AC_LIBOBJ([malloc])
+fi
+gl_MODULE_INDICATOR([malloc-gnu])
+gl_FUNC_MALLOC_POSIX
+if test $REPLACE_MALLOC = 1; then
+  AC_LIBOBJ([malloc])
+fi
+gl_STDLIB_MODULE_INDICATOR([malloc-posix])
+gl_MATH_H
+gl_FUNC_MBRTOWC
+if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
+  AC_LIBOBJ([mbrtowc])
+  gl_PREREQ_MBRTOWC
+fi
+gl_WCHAR_MODULE_INDICATOR([mbrtowc])
+gl_FUNC_MBSINIT
+if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
+  AC_LIBOBJ([mbsinit])
+  gl_PREREQ_MBSINIT
+fi
+gl_WCHAR_MODULE_INDICATOR([mbsinit])
+gl_FUNC_MEMCHR
+if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+  AC_LIBOBJ([memchr])
+  gl_PREREQ_MEMCHR
+fi
+gl_STRING_MODULE_INDICATOR([memchr])
+gl_FUNC_MEMPCPY
+if test $HAVE_MEMPCPY = 0; then
+  AC_LIBOBJ([mempcpy])
+  gl_PREREQ_MEMPCPY
+fi
+gl_STRING_MODULE_INDICATOR([mempcpy])
+gl_FUNC_MEMRCHR
+if test $ac_cv_func_memrchr = no; then
+  AC_LIBOBJ([memrchr])
+  gl_PREREQ_MEMRCHR
+fi
+gl_STRING_MODULE_INDICATOR([memrchr])
+gl_MSVC_INVAL
+if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+  AC_LIBOBJ([msvc-inval])
+fi
+gl_MSVC_NOTHROW
+if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+  AC_LIBOBJ([msvc-nothrow])
+fi
+gl_MULTIARCH
+gl_FUNC_OPEN
+if test $REPLACE_OPEN = 1; then
+  AC_LIBOBJ([open])
+  gl_PREREQ_OPEN
+fi
+gl_FCNTL_MODULE_INDICATOR([open])
+gl_FUNC_OPENAT
+if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
+  AC_LIBOBJ([openat])
+  gl_PREREQ_OPENAT
+fi
+gl_MODULE_INDICATOR([openat]) dnl for lib/getcwd.c
+gl_FCNTL_MODULE_INDICATOR([openat])
+gl_FUNC_OPENDIR
+if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
+  AC_LIBOBJ([opendir])
+fi
+gl_DIRENT_MODULE_INDICATOR([opendir])
+gl_PATHMAX
+gl_FUNC_PERROR
+if test $REPLACE_PERROR = 1; then
+  AC_LIBOBJ([perror])
+fi
+gl_STRING_MODULE_INDICATOR([perror])
+gl_FUNC_PRINTF_FREXP
+gl_FUNC_PRINTF_FREXPL
+gl_FUNC_PRINTF_POSIX
+gl_STDIO_MODULE_INDICATOR([printf-posix])
+m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes])
+gl_QUOTEARG
+gl_FUNC_READDIR
+if test $HAVE_READDIR = 0; then
+  AC_LIBOBJ([readdir])
+fi
+gl_DIRENT_MODULE_INDICATOR([readdir])
+gl_FUNC_REALLOC_GNU
+if test $REPLACE_REALLOC = 1; then
+  AC_LIBOBJ([realloc])
+fi
+gl_MODULE_INDICATOR([realloc-gnu])
+gl_FUNC_REALLOC_POSIX
+if test $REPLACE_REALLOC = 1; then
+  AC_LIBOBJ([realloc])
+fi
+gl_STDLIB_MODULE_INDICATOR([realloc-posix])
+gl_SAVE_CWD
+gl_SAVEDIR
+gl_SIGNBIT
+if test $REPLACE_SIGNBIT = 1; then
+  AC_LIBOBJ([signbitf])
+  AC_LIBOBJ([signbitd])
+  AC_LIBOBJ([signbitl])
+fi
+gl_MATH_MODULE_INDICATOR([signbit])
+gl_SIZE_MAX
+gt_TYPE_SSIZE_T
+gl_FUNC_STAT
+if test $REPLACE_STAT = 1; then
+  AC_LIBOBJ([stat])
+  gl_PREREQ_STAT
+fi
+gl_SYS_STAT_MODULE_INDICATOR([stat])
+gl_STAT_TIME
+gl_STAT_BIRTHTIME
+AM_STDBOOL_H
+gl_STDDEF_H
+gl_STDINT_H
+gl_STDIO_H
+gl_STDLIB_H
+gl_FUNC_STRDUP_POSIX
+if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
+  AC_LIBOBJ([strdup])
+  gl_PREREQ_STRDUP
+fi
+gl_STRING_MODULE_INDICATOR([strdup])
+gl_FUNC_STRERROR
+if test $REPLACE_STRERROR = 1; then
+  AC_LIBOBJ([strerror])
+fi
+gl_MODULE_INDICATOR([strerror])
+gl_STRING_MODULE_INDICATOR([strerror])
+AC_REQUIRE([gl_HEADER_ERRNO_H])
+AC_REQUIRE([gl_FUNC_STRERROR_0])
+if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
+  AC_LIBOBJ([strerror-override])
+  gl_PREREQ_SYS_H_WINSOCK2
+fi
+gl_FUNC_STRERROR_R
+if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
+  AC_LIBOBJ([strerror_r])
+  gl_PREREQ_STRERROR_R
+fi
+gl_STRING_MODULE_INDICATOR([strerror_r])
+gl_HEADER_STRING_H
+gl_HEADER_SYS_STAT_H
+AC_PROG_MKDIR_P
+gl_HEADER_SYS_TIME_H
+AC_PROG_MKDIR_P
+gl_SYS_TYPES_H
+AC_PROG_MKDIR_P
+gl_THREADLIB
+gl_HEADER_TIME_H
+gl_TIMESPEC
+gl_UNISTD_H
+gl_UNISTD_SAFER
+gl_UTIMENS
+gl_FUNC_VASNPRINTF
+gl_FUNC_VFPRINTF_POSIX
+gl_STDIO_MODULE_INDICATOR([vfprintf-posix])
+gl_WCHAR_H
+gl_WCTYPE_H
+gl_XALLOC
+gl_XSIZE
+gl_YESNO
+  # End of code from modules
   m4_ifval(gl_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
       for gl_file in ]gl_LIBSOURCES_LIST[ ; do
@@ -252,6 +672,13 @@ AC_DEFUN([gl_INIT],
   m4_pushdef([gltests_LIBSOURCES_DIR], [])
   gl_COMMON
   gl_source_base='tests'
+changequote(,)dnl
+  gltests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
+changequote([, ])dnl
+  AC_SUBST([gltests_WITNESS])
+  gl_module_indicator_condition=$gltests_WITNESS
+  m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
+  m4_popdef([gl_MODULE_INDICATOR_CONDITION])
   m4_ifval(gltests_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
       for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
@@ -346,43 +773,57 @@ AC_DEFUN([gltests_LIBSOURCES], [
 # gnulib-tool and may be removed by future gnulib-tool invocations.
 AC_DEFUN([gl_FILE_LIST], [
   build-aux/announce-gen
-  build-aux/arg-nonnull.h
+  build-aux/config.rpath
+  build-aux/do-release-commit-and-tag
   build-aux/gendocs.sh
   build-aux/git-version-gen
   build-aux/gitlog-to-changelog
   build-aux/gnu-web-doc-update
   build-aux/gnupload
-  build-aux/link-warning.h
+  build-aux/snippet/_Noreturn.h
+  build-aux/snippet/arg-nonnull.h
+  build-aux/snippet/c++defs.h
+  build-aux/snippet/unused-parameter.h
+  build-aux/snippet/warn-on-use.h
   build-aux/update-copyright
   build-aux/useless-if-before-free
   build-aux/vc-list-files
-  build-aux/warn-on-use.h
   doc/fdl.texi
   doc/gendocs_template
   lib/alloca.in.h
   lib/asnprintf.c
-  lib/at-func.c
   lib/basename-lgpl.c
+  lib/c-ctype.c
+  lib/c-ctype.h
+  lib/c-strcase.h
+  lib/c-strcasecmp.c
+  lib/c-strcaseeq.h
+  lib/c-strncasecmp.c
   lib/calloc.c
   lib/chdir-long.c
   lib/chdir-long.h
-  lib/chown.c
-  lib/close-hook.c
-  lib/close-hook.h
+  lib/cloexec.c
+  lib/cloexec.h
   lib/close-stream.c
   lib/close-stream.h
   lib/close.c
+  lib/closedir.c
   lib/closein.c
   lib/closein.h
   lib/closeout.c
   lib/closeout.h
   lib/config.charset
   lib/creat-safer.c
+  lib/dirent--.h
+  lib/dirent-private.h
+  lib/dirent-safer.h
   lib/dirent.in.h
   lib/dirfd.c
   lib/dirname-lgpl.c
   lib/dirname.h
+  lib/dosname.h
   lib/dup-safer.c
+  lib/dup.c
   lib/dup2.c
   lib/errno.in.h
   lib/error.c
@@ -390,18 +831,21 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/exitfail.c
   lib/exitfail.h
   lib/fchdir.c
-  lib/fchmodat.c
-  lib/fchown-stub.c
-  lib/fchownat.c
   lib/fclose.c
   lib/fcntl--.h
   lib/fcntl-safer.h
   lib/fcntl.c
   lib/fcntl.in.h
+  lib/fd-hook.c
+  lib/fd-hook.h
   lib/fd-safer.c
   lib/fdopendir.c
   lib/fflush.c
+  lib/filename.h
+  lib/filenamecat-lgpl.c
+  lib/filenamecat.h
   lib/float+.h
+  lib/float.c
   lib/float.in.h
   lib/fpending.c
   lib/fpending.h
@@ -414,12 +858,15 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/freading.h
   lib/frexp.c
   lib/frexpl.c
+  lib/fseek.c
   lib/fseeko.c
   lib/fseterr.c
   lib/fseterr.h
-  lib/fstatat.c
+  lib/fstat.c
+  lib/ftell.c
   lib/ftello.c
-  lib/getcwd.c
+  lib/getcwd-lgpl.c
+  lib/getdtablesize.c
   lib/getopt.c
   lib/getopt.in.h
   lib/getopt1.c
@@ -427,6 +874,9 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/gettext.h
   lib/gettime.c
   lib/gettimeofday.c
+  lib/glthread/lock.c
+  lib/glthread/lock.h
+  lib/glthread/threadlib.c
   lib/ignore-value.h
   lib/intprops.h
   lib/isnan.c
@@ -436,7 +886,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/isnanf.c
   lib/isnanl-nolibm.h
   lib/isnanl.c
-  lib/lchown.c
+  lib/itold.c
   lib/localcharset.c
   lib/localcharset.h
   lib/lseek.c
@@ -449,8 +899,10 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/memchr.valgrind
   lib/mempcpy.c
   lib/memrchr.c
-  lib/mkdir.c
-  lib/mkdirat.c
+  lib/msvc-inval.c
+  lib/msvc-inval.h
+  lib/msvc-nothrow.c
+  lib/msvc-nothrow.h
   lib/open-safer.c
   lib/open.c
   lib/openat-die.c
@@ -458,6 +910,9 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/openat-proc.c
   lib/openat.c
   lib/openat.h
+  lib/opendir-safer.c
+  lib/opendir.c
+  lib/pathmax.h
   lib/perror.c
   lib/pipe-safer.c
   lib/printf-args.c
@@ -469,15 +924,17 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/printf-parse.c
   lib/printf-parse.h
   lib/printf.c
+  lib/quote.h
   lib/quotearg.c
   lib/quotearg.h
+  lib/readdir.c
   lib/realloc.c
   lib/ref-add.sin
   lib/ref-del.sin
-  lib/rmdir.c
-  lib/same-inode.h
   lib/save-cwd.c
   lib/save-cwd.h
+  lib/savedir.c
+  lib/savedir.h
   lib/signbitd.c
   lib/signbitf.c
   lib/signbitl.c
@@ -488,23 +945,24 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/stddef.in.h
   lib/stdint.in.h
   lib/stdio-impl.h
-  lib/stdio-write.c
   lib/stdio.in.h
   lib/stdlib.in.h
   lib/strdup.c
   lib/streq.h
+  lib/strerror-override.c
+  lib/strerror-override.h
   lib/strerror.c
+  lib/strerror_r.c
   lib/string.in.h
   lib/stripslash.c
   lib/sys_stat.in.h
   lib/sys_time.in.h
+  lib/sys_types.in.h
   lib/time.in.h
   lib/timespec.h
   lib/unistd--.h
   lib/unistd-safer.h
   lib/unistd.in.h
-  lib/unlink.c
-  lib/unlinkat.c
   lib/utimens.c
   lib/utimens.h
   lib/vasnprintf.c
@@ -514,34 +972,34 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/wchar.in.h
   lib/wctype.in.h
   lib/xalloc-die.c
+  lib/xalloc-oversized.h
   lib/xalloc.h
-  lib/xgetcwd.c
-  lib/xgetcwd.h
   lib/xmalloc.c
   lib/xsize.h
   lib/yesno.c
   lib/yesno.h
   m4/00gnulib.m4
   m4/alloca.m4
+  m4/asm-underscore.m4
   m4/calloc.m4
   m4/chdir-long.m4
-  m4/chown.m4
   m4/clock_time.m4
   m4/close-stream.m4
   m4/close.m4
+  m4/closedir.m4
   m4/closein.m4
   m4/closeout.m4
   m4/codeset.m4
-  m4/d-ino.m4
+  m4/configmake.m4
+  m4/dirent-safer.m4
   m4/dirent_h.m4
   m4/dirfd.m4
   m4/dirname.m4
-  m4/dos.m4
   m4/double-slash-root.m4
+  m4/dup.m4
   m4/dup2.m4
   m4/errno_h.m4
   m4/error.m4
-  m4/exitfail.m4
   m4/exponentd.m4
   m4/exponentf.m4
   m4/exponentl.m4
@@ -554,6 +1012,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/fcntl_h.m4
   m4/fdopendir.m4
   m4/fflush.m4
+  m4/filenamecat.m4
   m4/float_h.m4
   m4/fpending.m4
   m4/fpieee.m4
@@ -562,11 +1021,13 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/freading.m4
   m4/frexp.m4
   m4/frexpl.m4
+  m4/fseek.m4
   m4/fseeko.m4
+  m4/fstat.m4
+  m4/ftell.m4
   m4/ftello.m4
-  m4/getcwd-abort-bug.m4
-  m4/getcwd-path-max.m4
   m4/getcwd.m4
+  m4/getdtablesize.m4
   m4/getopt.m4
   m4/gettime.m4
   m4/gettimeofday.m4
@@ -580,12 +1041,17 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/isnand.m4
   m4/isnanf.m4
   m4/isnanl.m4
-  m4/lchown.m4
+  m4/largefile.m4
   m4/ldexpl.m4
+  m4/lib-ignore.m4
+  m4/lib-ld.m4
+  m4/lib-link.m4
+  m4/lib-prefix.m4
   m4/localcharset.m4
   m4/locale-fr.m4
   m4/locale-ja.m4
   m4/locale-zh.m4
+  m4/lock.m4
   m4/longlong.m4
   m4/lseek.m4
   m4/lstat.m4
@@ -598,24 +1064,30 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/memchr.m4
   m4/mempcpy.m4
   m4/memrchr.m4
-  m4/mkdir.m4
   m4/mmap-anon.m4
   m4/mode_t.m4
+  m4/msvc-inval.m4
+  m4/msvc-nothrow.m4
   m4/multiarch.m4
   m4/nocrash.m4
+  m4/off_t.m4
   m4/open.m4
   m4/openat.m4
+  m4/opendir.m4
+  m4/pathmax.m4
   m4/perror.m4
   m4/printf-frexp.m4
   m4/printf-frexpl.m4
   m4/printf-posix-rpl.m4
   m4/printf.m4
   m4/quotearg.m4
+  m4/readdir.m4
   m4/realloc.m4
-  m4/rmdir.m4
   m4/save-cwd.m4
+  m4/savedir.m4
   m4/signbit.m4
   m4/size_max.m4
+  m4/ssize_t.m4
   m4/stat-time.m4
   m4/stat.m4
   m4/stdbool.m4
@@ -626,14 +1098,17 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/stdlib_h.m4
   m4/strdup.m4
   m4/strerror.m4
+  m4/strerror_r.m4
   m4/string_h.m4
+  m4/sys_socket_h.m4
   m4/sys_stat_h.m4
   m4/sys_time_h.m4
+  m4/sys_types_h.m4
+  m4/threadlib.m4
   m4/time_h.m4
   m4/timespec.m4
   m4/unistd-safer.m4
   m4/unistd_h.m4
-  m4/unlink.m4
   m4/utimbuf.m4
   m4/utimens.m4
   m4/utimes.m4
@@ -641,14 +1116,14 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/vfprintf-posix.m4
   m4/warn-on-use.m4
   m4/warnings.m4
-  m4/wchar.m4
+  m4/wchar_h.m4
   m4/wchar_t.m4
-  m4/wctype.m4
+  m4/wctype_h.m4
   m4/wint_t.m4
   m4/xalloc.m4
-  m4/xgetcwd.m4
   m4/xsize.m4
   m4/yesno.m4
   top/GNUmakefile
+  top/README-release
   top/maint.mk
 ])
index c7e0672f60c01b02fa96a2a4427907c69f483879..a60a2614dc841971ce82e960a5c9322dc0541efc 100644 (file)
@@ -1,5 +1,5 @@
-# include_next.m4 serial 14
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# include_next.m4 serial 23
+dnl Copyright (C) 2006-2012 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.
@@ -24,6 +24,13 @@ dnl does not warn about some things, and on some systems (Solaris and Interix)
 dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
 dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
 dnl of plain '__STDC__'.
+dnl
+dnl PRAGMA_COLUMNS can be used in files that override system header files, so
+dnl as to avoid compilation errors on HP NonStop systems when the gnulib file
+dnl is included by a system header file that does a "#pragma COLUMNS 80" (which
+dnl has the effect of truncating the lines of that file and all files that it
+dnl includes to 80 columns) and the gnulib file has lines longer than 80
+dnl columns.
 
 AC_DEFUN([gl_INCLUDE_NEXT],
 [
@@ -68,10 +75,11 @@ EOF
 EOF
      gl_save_CPPFLAGS="$CPPFLAGS"
      CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2"
-     AC_COMPILE_IFELSE([#include <conftest.h>],
+dnl We intentionally avoid using AC_LANG_SOURCE here.
+     AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
        [gl_cv_have_include_next=yes],
        [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
-        AC_COMPILE_IFELSE([#include <conftest.h>],
+        AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
           [gl_cv_have_include_next=buggy],
           [gl_cv_have_include_next=no])
        ])
@@ -97,6 +105,24 @@ EOF
   AC_SUBST([INCLUDE_NEXT])
   AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE])
   AC_SUBST([PRAGMA_SYSTEM_HEADER])
+  AC_CACHE_CHECK([whether system header files limit the line length],
+    [gl_cv_pragma_columns],
+    [dnl HP NonStop systems, which define __TANDEM, have this misfeature.
+     AC_EGREP_CPP([choke me],
+       [
+#ifdef __TANDEM
+choke me
+#endif
+       ],
+       [gl_cv_pragma_columns=yes],
+       [gl_cv_pragma_columns=no])
+    ])
+  if test $gl_cv_pragma_columns = yes; then
+    PRAGMA_COLUMNS="#pragma COLUMNS 10000"
+  else
+    PRAGMA_COLUMNS=
+  fi
+  AC_SUBST([PRAGMA_COLUMNS])
 ])
 
 # gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)
@@ -117,71 +143,128 @@ EOF
 # even if the compiler does not support include_next.
 # The three "///" are to pacify Sun C 5.8, which otherwise would say
 # "warning: #include of /usr/include/... may be non-portable".
-# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
+# Use '""', not '<>', so that the /// cannot be confused with a C99 comment.
 # Note: This macro assumes that the header file is not empty after
 # preprocessing, i.e. it does not only define preprocessor macros but also
 # provides some type/enum definitions or function/variable declarations.
+#
+# This macro also checks whether each header exists, by invoking
+# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument.
 AC_DEFUN([gl_CHECK_NEXT_HEADERS],
+[
+  gl_NEXT_HEADERS_INTERNAL([$1], [check])
+])
+
+# gl_NEXT_HEADERS(HEADER1 HEADER2 ...)
+# ------------------------------------
+# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist.
+# This is suitable for headers like <stddef.h> that are standardized by C89
+# and therefore can be assumed to exist.
+AC_DEFUN([gl_NEXT_HEADERS],
+[
+  gl_NEXT_HEADERS_INTERNAL([$1], [assume])
+])
+
+# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS.
+AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
 [
   AC_REQUIRE([gl_INCLUDE_NEXT])
   AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_CHECK_HEADERS_ONCE([$1])
 
+  m4_if([$2], [check],
+    [AC_CHECK_HEADERS_ONCE([$1])
+    ])
+
+dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
+dnl until we can assume autoconf 2.64 or newer.
   m4_foreach_w([gl_HEADER_NAME], [$1],
     [AS_VAR_PUSHDEF([gl_next_header],
                     [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
      if test $gl_cv_have_include_next = yes; then
-       AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+       AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
      else
        AC_CACHE_CHECK(
          [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
          m4_defn([gl_next_header]),
-         [AS_VAR_PUSHDEF([gl_header_exists],
-                         [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
-          if test AS_VAR_GET(gl_header_exists) = yes; then
-            AC_LANG_CONFTEST(
-              [AC_LANG_SOURCE(
-                 [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
-               )])
-            dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
-            dnl that contain only a #include of other header files and no
-            dnl non-comment tokens of their own. This leads to a failure to
-            dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
-            dnl and others. The workaround is to force preservation of comments
-            dnl through option -C. This ensures all necessary #line directives
-            dnl are present. GCC supports option -C as well.
-            case "$host_os" in
-              aix*) gl_absname_cpp="$ac_cpp -C" ;;
-              *)    gl_absname_cpp="$ac_cpp" ;;
-            esac
-            dnl eval is necessary to expand gl_absname_cpp.
-            dnl Ultrix and Pyramid sh refuse to redirect output of eval,
-            dnl so use subshell.
-            AS_VAR_SET([gl_next_header],
-              ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
-               sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
-                 s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
-                 s#^/[^/]#//&#
-                 p
-                 q
-               }'`'"'])
-          else
-            AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
-          fi
-          AS_VAR_POPDEF([gl_header_exists])])
+         [m4_if([$2], [check],
+            [AS_VAR_PUSHDEF([gl_header_exists],
+                            [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
+             if test AS_VAR_GET(gl_header_exists) = yes; then
+             AS_VAR_POPDEF([gl_header_exists])
+            ])
+               AC_LANG_CONFTEST(
+                 [AC_LANG_SOURCE(
+                    [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
+                  )])
+               dnl AIX "xlc -E" and "cc -E" omit #line directives for header
+               dnl files that contain only a #include of other header files and
+               dnl no non-comment tokens of their own. This leads to a failure
+               dnl to detect the absolute name of <dirent.h>, <signal.h>,
+               dnl <poll.h> and others. The workaround is to force preservation
+               dnl of comments through option -C. This ensures all necessary
+               dnl #line directives are present. GCC supports option -C as well.
+               case "$host_os" in
+                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
+                 *)    gl_absname_cpp="$ac_cpp" ;;
+               esac
+changequote(,)
+               case "$host_os" in
+                 mingw*)
+                   dnl For the sake of native Windows compilers (excluding gcc),
+                   dnl treat backslash as a directory separator, like /.
+                   dnl Actually, these compilers use a double-backslash as
+                   dnl directory separator, inside the
+                   dnl   # line "filename"
+                   dnl directives.
+                   gl_dirsep_regex='[/\\]'
+                   ;;
+                 *)
+                   gl_dirsep_regex='\/'
+                   ;;
+               esac
+               dnl A sed expression that turns a string into a basic regular
+               dnl expression, for use within "/.../".
+               gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+changequote([,])
+               gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \
+                                        | sed -e "$gl_make_literal_regex_sed"`
+               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+changequote(,)dnl
+                   s|^/[^/]|//&|
+changequote([,])dnl
+                   p
+                   q
+                 }'
+               dnl eval is necessary to expand gl_absname_cpp.
+               dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+               dnl so use subshell.
+               AS_VAR_SET(gl_next_header,
+                 ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+                      sed -n "$gl_absolute_header_sed"`'"'])
+          m4_if([$2], [check],
+            [else
+               AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
+             fi
+            ])
+         ])
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
-       [AS_VAR_GET([gl_next_header])])
+       [AS_VAR_GET(gl_next_header)])
      if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
        gl_next_as_first_directive='<'gl_HEADER_NAME'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
+       gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
        [$gl_next_as_first_directive])
      AS_VAR_POPDEF([gl_next_header])])
 ])
+
+# Autoconf 2.68 added warnings for our use of AC_COMPILE_IFELSE;
+# this fallback is safe for all earlier autoconf versions.
+m4_define_default([AC_LANG_DEFINES_PROVIDED])
index 4ef768de7243da810ce459cd24eaf3ca53bf264c..6fa997246c95bd1875b9e6ea79f84a5dbab0e44a 100644 (file)
@@ -1,5 +1,5 @@
 # inline.m4 serial 4
-dnl Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2012 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.
index 975caac50670d193a88577508de756a7aa17c560..c1a4a75d8367e17305d84eafeecffd91a1e963b6 100644 (file)
@@ -1,5 +1,5 @@
-# intmax_t.m4 serial 7
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2010 Free Software Foundation,
+# intmax_t.m4 serial 8
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2012 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Paul Eggert.
 
-AC_PREREQ([2.13])
+AC_PREREQ([2.53])
 
 # Define intmax_t to 'long' or 'long long'
 # if it is not already defined in <stdint.h> or <inttypes.h>.
@@ -38,7 +38,9 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
   AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
   AC_REQUIRE([gl_AC_HEADER_STDINT_H])
   AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t],
-    [AC_TRY_COMPILE([
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[
 #include <stddef.h>
 #include <stdlib.h>
 #if HAVE_STDINT_H_WITH_UINTMAX
@@ -47,7 +49,10 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
 #if HAVE_INTTYPES_H_WITH_UINTMAX
 #include <inttypes.h>
 #endif
-], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
+          ]],
+          [[intmax_t x = -1; return !x;]])],
+       [gt_cv_c_intmax_t=yes],
+       [gt_cv_c_intmax_t=no])])
   if test $gt_cv_c_intmax_t = yes; then
     AC_DEFINE([HAVE_INTMAX_T], [1],
       [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
index 782d77ed8b1e0629d7b5ac2938db0ef6010e61d6..91c7bca62df7c639397ca19561b525706d68689f 100644 (file)
@@ -1,5 +1,5 @@
-# inttypes_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
+# inttypes_h.m4 serial 10
+dnl Copyright (C) 1997-2004, 2006, 2008-2012 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.
@@ -12,12 +12,15 @@ dnl From Paul Eggert.
 AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
 [
   AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h],
-  [AC_TRY_COMPILE(
-    [#include <sys/types.h>
-#include <inttypes.h>],
-    [uintmax_t i = (uintmax_t) -1; return !i;],
-    [gl_cv_header_inttypes_h=yes],
-    [gl_cv_header_inttypes_h=no])])
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[
+#include <sys/types.h>
+#include <inttypes.h>
+          ]],
+          [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+       [gl_cv_header_inttypes_h=yes],
+       [gl_cv_header_inttypes_h=no])])
   if test $gl_cv_header_inttypes_h = yes; then
     AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1],
       [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
index cd916284dfcf0d2cb53436a466f4aed613fda461..54b64a452d8d06a49d284d116e525b1f8cdca71d 100644 (file)
@@ -1,5 +1,5 @@
-# isnand.m4 serial 6
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# isnand.m4 serial 11
+dnl Copyright (C) 2007-2012 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.
@@ -24,7 +24,6 @@ AC_DEFUN([gl_FUNC_ISNAND],
   else
     gl_func_isnand=no
     HAVE_ISNAND=0
-    gl_BUILD_ISNAND
   fi
   AC_SUBST([ISNAND_LIBM])
 ])
@@ -34,19 +33,17 @@ dnl Check how to get or define isnand() without linking with libm.
 AC_DEFUN([gl_FUNC_ISNAND_NO_LIBM],
 [
   gl_HAVE_ISNAND_NO_LIBM
+  gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
   if test $gl_cv_func_isnand_no_libm = yes; then
     AC_DEFINE([HAVE_ISNAND_IN_LIBC], [1],
       [Define if the isnan(double) function is available in libc.])
-  else
-    gl_BUILD_ISNAND
   fi
 ])
 
-dnl Pull in replacement isnand definition. It does not need -lm.
-AC_DEFUN([gl_BUILD_ISNAND],
+dnl Prerequisites of replacement isnand definition. It does not need -lm.
+AC_DEFUN([gl_PREREQ_ISNAND],
 [
-  AC_LIBOBJ([isnand])
-  gl_DOUBLE_EXPONENT_LOCATION
+  AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
 ])
 
 dnl Test whether isnand() can be used with libm.
@@ -58,16 +55,18 @@ AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM],
     [
       save_LIBS="$LIBS"
       LIBS="$LIBS -lm"
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnand
-                   # define isnand(x) __builtin_isnand ((double)(x))
-                   #elif defined isnan
-                   # undef isnand
-                   # define isnand(x) isnan ((double)(x))
-                   #endif
-                   double x;],
-                  [return isnand (x);],
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <math.h>
+             #if __GNUC__ >= 4
+             # undef isnand
+             # define isnand(x) __builtin_isnan ((double)(x))
+             #elif defined isnan
+             # undef isnand
+             # define isnand(x) isnan ((double)(x))
+             #endif
+             double x;]],
+           [[return isnand (x);]])],
         [gl_cv_func_isnand_in_libm=yes],
         [gl_cv_func_isnand_in_libm=no])
       LIBS="$save_LIBS"
@@ -79,16 +78,18 @@ AC_DEFUN([gl_HAVE_ISNAND_NO_LIBM],
   AC_CACHE_CHECK([whether isnan(double) can be used without linking with libm],
     [gl_cv_func_isnand_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnand
-                   # define isnand(x) __builtin_isnan ((double)(x))
-                   #else
-                   # undef isnand
-                   # define isnand(x) isnan ((double)(x))
-                   #endif
-                   double x;],
-                  [return isnand (x);],
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <math.h>
+             #if __GNUC__ >= 4
+             # undef isnand
+             # define isnand(x) __builtin_isnan ((double)(x))
+             #else
+             # undef isnand
+             # define isnand(x) isnan ((double)(x))
+             #endif
+             double x;]],
+           [[return isnand (x);]])],
         [gl_cv_func_isnand_no_libm=yes],
         [gl_cv_func_isnand_no_libm=no])
     ])
index 1509fb4432c78d8293e2b90e03fc539a95f809c3..97f638a93492bd5af60f2d12fb12e7d883f938a7 100644 (file)
@@ -1,5 +1,5 @@
-# isnanf.m4 serial 10
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# isnanf.m4 serial 14
+dnl Copyright (C) 2007-2012 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.
@@ -17,6 +17,7 @@ AC_DEFUN([gl_FUNC_ISNANF],
       ISNANF_LIBM=-lm
     fi
   fi
+  dnl The variable gl_func_isnanf set here is used by isnan.m4.
   if test $gl_cv_func_isnanf_no_libm = yes \
      || test $gl_cv_func_isnanf_in_libm = yes; then
     save_LIBS="$LIBS"
@@ -32,7 +33,6 @@ AC_DEFUN([gl_FUNC_ISNANF],
   fi
   if test $gl_func_isnanf != yes; then
     HAVE_ISNANF=0
-    gl_BUILD_ISNANF
   fi
   AC_SUBST([ISNANF_LIBM])
 ])
@@ -51,17 +51,17 @@ AC_DEFUN([gl_FUNC_ISNANF_NO_LIBM],
             *) false;;
           esac
         }; then
+    gl_func_isnanf_no_libm=yes
     AC_DEFINE([HAVE_ISNANF_IN_LIBC], [1],
       [Define if the isnan(float) function is available in libc.])
   else
-    gl_BUILD_ISNANF
+    gl_func_isnanf_no_libm=no
   fi
 ])
 
-dnl Pull in replacement isnanf definition. It does not need -lm.
-AC_DEFUN([gl_BUILD_ISNANF],
+dnl Prerequisites of replacement isnanf definition. It does not need -lm.
+AC_DEFUN([gl_PREREQ_ISNANF],
 [
-  AC_LIBOBJ([isnanf])
   gl_FLOAT_EXPONENT_LOCATION
 ])
 
@@ -71,16 +71,18 @@ AC_DEFUN([gl_HAVE_ISNANF_NO_LIBM],
   AC_CACHE_CHECK([whether isnan(float) can be used without linking with libm],
     [gl_cv_func_isnanf_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnanf
-                   # define isnanf(x) __builtin_isnanf ((float)(x))
-                   #elif defined isnan
-                   # undef isnanf
-                   # define isnanf(x) isnan ((float)(x))
-                   #endif
-                   float x;],
-                  [return isnanf (x);],
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <math.h>
+             #if __GNUC__ >= 4
+             # undef isnanf
+             # define isnanf(x) __builtin_isnanf ((float)(x))
+             #elif defined isnan
+             # undef isnanf
+             # define isnanf(x) isnan ((float)(x))
+             #endif
+             float x;]],
+           [[return isnanf (x);]])],
         [gl_cv_func_isnanf_no_libm=yes],
         [gl_cv_func_isnanf_no_libm=no])
     ])
@@ -94,16 +96,18 @@ AC_DEFUN([gl_HAVE_ISNANF_IN_LIBM],
     [
       save_LIBS="$LIBS"
       LIBS="$LIBS -lm"
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnanf
-                   # define isnanf(x) __builtin_isnanf ((float)(x))
-                   #elif defined isnan
-                   # undef isnanf
-                   # define isnanf(x) isnan ((float)(x))
-                   #endif
-                   float x;],
-                  [return isnanf (x);],
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <math.h>
+             #if __GNUC__ >= 4
+             # undef isnanf
+             # define isnanf(x) __builtin_isnanf ((float)(x))
+             #elif defined isnan
+             # undef isnanf
+             # define isnanf(x) isnan ((float)(x))
+             #endif
+             float x;]],
+           [[return isnanf (x);]])],
         [gl_cv_func_isnanf_in_libm=yes],
         [gl_cv_func_isnanf_in_libm=no])
       LIBS="$save_LIBS"
@@ -120,7 +124,8 @@ AC_DEFUN([gl_ISNANF_WORKS],
   AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION])
   AC_CACHE_CHECK([whether isnan(float) works], [gl_cv_func_isnanf_works],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <math.h>
 #if __GNUC__ >= 4
 # undef isnanf
@@ -145,13 +150,13 @@ NaN ()
 typedef union { unsigned int word[NWORDS]; float value; } memory_float;
 int main()
 {
-  memory_float m;
+  int result = 0;
 
   if (isnanf (1.0f / 0.0f))
-    return 1;
+    result |= 1;
 
   if (!isnanf (NaN ()))
-    return 1;
+    result |= 2;
 
 #if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
   /* The isnanf function should be immune against changes in the sign bit and
@@ -159,17 +164,21 @@ int main()
      a sign bit or a mantissa bit.  */
   if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0)
     {
+      memory_float m;
+
       m.value = NaN ();
       /* Set the bits below the exponent to 01111...111.  */
       m.word[0] &= -1U << FLT_EXPBIT0_BIT;
       m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1;
       if (!isnanf (m.value))
-        return 1;
+        result |= 4;
     }
 #endif
 
-  return 0;
-}], [gl_cv_func_isnanf_works=yes], [gl_cv_func_isnanf_works=no],
+  return result;
+}]])],
+        [gl_cv_func_isnanf_works=yes],
+        [gl_cv_func_isnanf_works=no],
         [case "$host_os" in
            irix* | solaris*) gl_cv_func_isnanf_works="guessing no";;
            *)                gl_cv_func_isnanf_works="guessing yes";;
index 25daecaedc3c24c0d4347a213b31dedd12aed0be..81469ab8c869f7eabeef604b303246a74bae1f77 100644 (file)
@@ -1,5 +1,5 @@
-# isnanl.m4 serial 12
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# isnanl.m4 serial 17
+dnl Copyright (C) 2007-2012 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.
@@ -15,6 +15,7 @@ AC_DEFUN([gl_FUNC_ISNANL],
       ISNANL_LIBM=-lm
     fi
   fi
+  dnl The variable gl_func_isnanl set here is used by isnan.m4.
   if test $gl_cv_func_isnanl_no_libm = yes \
      || test $gl_cv_func_isnanl_in_libm = yes; then
     save_LIBS="$LIBS"
@@ -30,7 +31,6 @@ AC_DEFUN([gl_FUNC_ISNANL],
   fi
   if test $gl_func_isnanl != yes; then
     HAVE_ISNANL=0
-    gl_BUILD_ISNANL
   fi
   AC_SUBST([ISNANL_LIBM])
 ])
@@ -49,16 +49,14 @@ AC_DEFUN([gl_FUNC_ISNANL_NO_LIBM],
   if test $gl_func_isnanl_no_libm = yes; then
     AC_DEFINE([HAVE_ISNANL_IN_LIBC], [1],
       [Define if the isnan(long double) function is available in libc.])
-  else
-    gl_BUILD_ISNANL
   fi
 ])
 
-dnl Pull in replacement isnanl definition. It does not need -lm.
-AC_DEFUN([gl_BUILD_ISNANL],
+dnl Prerequisites of replacement isnanl definition. It does not need -lm.
+AC_DEFUN([gl_PREREQ_ISNANL],
 [
-  AC_LIBOBJ([isnanl])
   gl_LONG_DOUBLE_EXPONENT_LOCATION
+  AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
 ])
 
 dnl Test whether isnanl() can be used without libm.
@@ -67,16 +65,18 @@ AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM],
   AC_CACHE_CHECK([whether isnan(long double) can be used without linking with libm],
     [gl_cv_func_isnanl_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnanl
-                   # define isnanl(x) __builtin_isnanl ((long double)(x))
-                   #elif defined isnan
-                   # undef isnanl
-                   # define isnanl(x) isnan ((long double)(x))
-                   #endif
-                   long double x;],
-                  [return isnanl (x);],
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <math.h>
+             #if __GNUC__ >= 4
+             # undef isnanl
+             # define isnanl(x) __builtin_isnanl ((long double)(x))
+             #elif defined isnan
+             # undef isnanl
+             # define isnanl(x) isnan ((long double)(x))
+             #endif
+             long double x;]],
+           [[return isnanl (x);]])],
         [gl_cv_func_isnanl_no_libm=yes],
         [gl_cv_func_isnanl_no_libm=no])
     ])
@@ -90,16 +90,18 @@ AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM],
     [
       save_LIBS="$LIBS"
       LIBS="$LIBS -lm"
-      AC_TRY_LINK([#include <math.h>
-                   #if __GNUC__ >= 4
-                   # undef isnanl
-                   # define isnanl(x) __builtin_isnanl ((long double)(x))
-                   #elif defined isnan
-                   # undef isnanl
-                   # define isnanl(x) isnan ((long double)(x))
-                   #endif
-                   long double x;],
-                  [return isnanl (x);],
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <math.h>
+             #if __GNUC__ >= 4
+             # undef isnanl
+             # define isnanl(x) __builtin_isnanl ((long double)(x))
+             #elif defined isnan
+             # undef isnanl
+             # define isnanl(x) isnan ((long double)(x))
+             #endif
+             long double x;]],
+           [[return isnanl (x);]])],
         [gl_cv_func_isnanl_in_libm=yes],
         [gl_cv_func_isnanl_in_libm=no])
       LIBS="$save_LIBS"
@@ -115,10 +117,12 @@ AC_DEFUN([gl_FUNC_ISNANL_WORKS],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([gl_BIGENDIAN])
+  AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether isnanl works], [gl_cv_func_isnanl_works],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <float.h>
 #include <limits.h>
 #include <math.h>
@@ -146,24 +150,28 @@ static long double NaNl ()
 #endif
 int main ()
 {
-  memory_long_double m;
-  unsigned int i;
+  int result = 0;
 
   if (!isnanl (NaNl ()))
-    return 1;
+    result |= 1;
+
+  {
+    memory_long_double m;
+    unsigned int i;
 
-  /* The isnanl function should be immune against changes in the sign bit and
-     in the mantissa bits.  The xor operation twiddles a bit that can only be
-     a sign bit or a mantissa bit (since the exponent never extends to
-     bit 31).  */
-  m.value = NaNl ();
-  m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-  for (i = 0; i < NWORDS; i++)
-    m.word[i] |= 1;
-  if (!isnanl (m.value))
-    return 1;
+    /* The isnanl function should be immune against changes in the sign bit and
+       in the mantissa bits.  The xor operation twiddles a bit that can only be
+       a sign bit or a mantissa bit (since the exponent never extends to
+       bit 31).  */
+    m.value = NaNl ();
+    m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
+    for (i = 0; i < NWORDS; i++)
+      m.word[i] |= 1;
+    if (!isnanl (m.value))
+      result |= 1;
+  }
 
-#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
+#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
 /* Representation of an 80-bit 'long double' as an initializer for a sequence
    of 'unsigned int' words.  */
 # ifdef WORDS_BIGENDIAN
@@ -180,14 +188,14 @@ int main ()
     static memory_long_double x =
       { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 2;
   }
   {
     /* Signalling NaN.  */
     static memory_long_double x =
       { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 2;
   }
   /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities,
      Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in
@@ -200,46 +208,48 @@ int main ()
     static memory_long_double x =
       { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 4;
   }
   { /* Pseudo-Infinity.  */
     static memory_long_double x =
       { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 8;
   }
   { /* Pseudo-Zero.  */
     static memory_long_double x =
       { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 16;
   }
   { /* Unnormalized number.  */
     static memory_long_double x =
       { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 32;
   }
   { /* Pseudo-Denormal.  */
     static memory_long_double x =
       { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
     if (!isnanl (x.value))
-      return 1;
+      result |= 64;
   }
 #endif
 
-  return 0;
-}], [gl_cv_func_isnanl_works=yes], [gl_cv_func_isnanl_works=no],
-      [case "$host_cpu" in
-                               # Guess no on ia64, x86_64, i386.
-         ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";;
-         *)
-           case "$host_os" in
-             netbsd*) gl_cv_func_isnanl_works="guessing no";;
-             *)       gl_cv_func_isnanl_works="guessing yes";;
-           esac
-           ;;
-       esac
-      ])
+  return result;
+}]])],
+        [gl_cv_func_isnanl_works=yes],
+        [gl_cv_func_isnanl_works=no],
+        [case "$host_cpu" in
+                                 # Guess no on ia64, x86_64, i386.
+           ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";;
+           *)
+             case "$host_os" in
+               netbsd*) gl_cv_func_isnanl_works="guessing no";;
+               *)       gl_cv_func_isnanl_works="guessing yes";;
+             esac
+             ;;
+         esac
+        ])
     ])
 ])
diff --git a/m4/largefile.m4 b/m4/largefile.m4
new file mode 100644 (file)
index 0000000..a159f4a
--- /dev/null
@@ -0,0 +1,149 @@
+# Enable large files on systems where this is not the default.
+
+# Copyright 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# This file 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.
+
+# The following implementation works around a problem in autoconf <= 2.68;
+# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5.
+m4_version_prereq([2.69], [] ,[
+
+# _AC_SYS_LARGEFILE_TEST_INCLUDES
+# -------------------------------
+m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
+[@%:@include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+                       && LARGE_OFF_T % 2147483647 == 1)
+                      ? 1 : -1]];[]dnl
+])
+
+
+# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
+#                              CACHE-VAR,
+#                              DESCRIPTION,
+#                              PROLOGUE, [FUNCTION-BODY])
+# --------------------------------------------------------
+m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
+[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
+[while :; do
+  m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+    [AC_LANG_PROGRAM([$5], [$6])],
+    [$3=no; break])
+  m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+    [AC_LANG_PROGRAM([@%:@define $1 $2
+$5], [$6])],
+    [$3=$2; break])
+  $3=unknown
+  break
+done])
+case $$3 in #(
+  no | unknown) ;;
+  *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);;
+esac
+rm -rf conftest*[]dnl
+])# _AC_SYS_LARGEFILE_MACRO_VALUE
+
+
+# AC_SYS_LARGEFILE
+# ----------------
+# By default, many hosts won't let programs access large files;
+# one must use special compiler options to get large-file access to work.
+# For more details about this brain damage please see:
+# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html
+AC_DEFUN([AC_SYS_LARGEFILE],
+[AC_ARG_ENABLE(largefile,
+               [  --disable-largefile     omit support for large files])
+if test "$enable_largefile" != no; then
+
+  AC_CACHE_CHECK([for special C compiler options needed for large files],
+    ac_cv_sys_largefile_CC,
+    [ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+         # IRIX 6.2 and later do not support large files by default,
+         # so use the C compiler's -n32 option if that helps.
+         AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
+         AC_COMPILE_IFELSE([], [break])
+         CC="$CC -n32"
+         AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
+         break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi])
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
+    ac_cv_sys_file_offset_bits,
+    [Number of bits in a file offset, on hosts where this is settable.],
+    [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
+      ac_cv_sys_large_files,
+      [Define for large files, on AIX-style hosts.],
+      [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+  fi
+
+  AH_VERBATIM([_DARWIN_USE_64_BIT_INODE],
+[/* Enable large inode numbers on Mac OS X.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif])
+fi
+])# AC_SYS_LARGEFILE
+
+])# m4_version_prereq 2.69
+
+# Enable large files on systems where this is implemented by Gnulib, not by the
+# system headers.
+# Set the variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE if Gnulib
+# overrides ensure that off_t or 'struct size.st_size' are 64-bit, respectively.
+AC_DEFUN([gl_LARGEFILE],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      dnl Native Windows.
+      dnl mingw64 defines off_t to a 64-bit type already, if
+      dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE.
+      AC_CACHE_CHECK([for 64-bit off_t], [gl_cv_type_off_t_64],
+        [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <sys/types.h>
+                int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
+              ]],
+              [[]])],
+           [gl_cv_type_off_t_64=yes], [gl_cv_type_off_t_64=no])
+        ])
+      if test $gl_cv_type_off_t_64 = no; then
+        WINDOWS_64_BIT_OFF_T=1
+      else
+        WINDOWS_64_BIT_OFF_T=0
+      fi
+      dnl But all native Windows platforms (including mingw64) have a 32-bit
+      dnl st_size member in 'struct stat'.
+      WINDOWS_64_BIT_ST_SIZE=1
+      ;;
+    *)
+      dnl Nothing to do on gnulib's side.
+      dnl A 64-bit off_t is
+      dnl   - already the default on MacOS X, FreeBSD, NetBSD, OpenBSD, IRIX,
+      dnl     OSF/1, Cygwin,
+      dnl   - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on
+      dnl     glibc, HP-UX, Solaris,
+      dnl   - enabled by _LARGE_FILES=1 (ensured by AC_SYS_LARGEFILE) on AIX,
+      dnl   - impossible to achieve on Minix 3.1.8.
+      WINDOWS_64_BIT_OFF_T=0
+      WINDOWS_64_BIT_ST_SIZE=0
+      ;;
+  esac
+])
diff --git a/m4/lchown.m4 b/m4/lchown.m4
deleted file mode 100644 (file)
index 646dd9f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# serial 15
-# Determine whether we need the lchown wrapper.
-
-dnl Copyright (C) 1998, 2001, 2003-2007, 2009-2010 Free Software Foundation,
-dnl 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.
-
-dnl From Jim Meyering.
-dnl Provide lchown on systems that lack it, and work around bugs
-dnl on systems that have it.
-
-AC_DEFUN([gl_FUNC_LCHOWN],
-[
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  AC_REQUIRE([gl_FUNC_CHOWN])
-  AC_CHECK_FUNCS_ONCE([lchmod])
-  AC_REPLACE_FUNCS([lchown])
-  if test $ac_cv_func_lchown = no; then
-    HAVE_LCHOWN=0
-  elif test "$gl_cv_func_chown_slash_works" != yes \
-      || test "$gl_cv_func_chown_ctime_works" != yes; then
-    dnl Trailing slash and ctime bugs in chown also occur in lchown.
-    AC_LIBOBJ([lchown])
-    REPLACE_LCHOWN=1
-  fi
-])
index bcc76b21bf6d6eda2c68e4600522ccbb1f0b7e62..11f20ca2a8dc6ea091f407466b93721916b8bc70 100644 (file)
@@ -1,5 +1,5 @@
-# ldexpl.m4 serial 4
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# ldexpl.m4 serial 15
+dnl Copyright (C) 2007-2012 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.
@@ -7,57 +7,83 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_LDEXPL],
 [
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
+  AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
+  AC_REQUIRE([gl_FUNC_ISNANL]) dnl for ISNANL_LIBM
+
+  dnl Persuade glibc <math.h> to declare ldexpl().
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  dnl Check whether it's declared.
+  dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
+  AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
+
   LDEXPL_LIBM=
+  if test $HAVE_DECL_LDEXPL = 1; then
+    gl_CHECK_LDEXPL_NO_LIBM
+    if test $gl_cv_func_ldexpl_no_libm = no; then
+      AC_CACHE_CHECK([whether ldexpl() can be used with libm],
+        [gl_cv_func_ldexpl_in_libm],
+        [
+          save_LIBS="$LIBS"
+          LIBS="$LIBS -lm"
+          AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM(
+               [[#include <math.h>
+                 long double x;]],
+               [[return ldexpl (x, -1) > 0;]])],
+            [gl_cv_func_ldexpl_in_libm=yes],
+            [gl_cv_func_ldexpl_in_libm=no])
+          LIBS="$save_LIBS"
+        ])
+      if test $gl_cv_func_ldexpl_in_libm = yes; then
+        LDEXPL_LIBM=-lm
+      fi
+    fi
+    if test $gl_cv_func_ldexpl_no_libm = yes \
+       || test $gl_cv_func_ldexpl_in_libm = yes; then
+      save_LIBS="$LIBS"
+      LIBS="$LIBS $LDEXPL_LIBM"
+      gl_FUNC_LDEXPL_WORKS
+      LIBS="$save_LIBS"
+      case "$gl_cv_func_ldexpl_works" in
+        *yes) gl_func_ldexpl=yes ;;
+        *)    gl_func_ldexpl=no; REPLACE_LDEXPL=1 ;;
+      esac
+    else
+      gl_func_ldexpl=no
+    fi
+    if test $gl_func_ldexpl = yes; then
+      AC_DEFINE([HAVE_LDEXPL], [1],
+        [Define if the ldexpl() function is available.])
+    fi
+  fi
+  if test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; then
+    dnl Find libraries needed to link lib/ldexpl.c.
+    if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
+      AC_REQUIRE([gl_FUNC_LDEXP])
+      LDEXPL_LIBM="$LDEXP_LIBM"
+    else
+      LDEXPL_LIBM="$ISNANL_LIBM"
+    fi
+  fi
+  AC_SUBST([LDEXPL_LIBM])
+])
+
+dnl Test whether ldexpl() can be used without linking with libm.
+dnl Set gl_cv_func_ldexpl_no_libm to 'yes' or 'no' accordingly.
+AC_DEFUN([gl_CHECK_LDEXPL_NO_LIBM],
+[
   AC_CACHE_CHECK([whether ldexpl() can be used without linking with libm],
     [gl_cv_func_ldexpl_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   long double x;],
-                  [return ldexpl (x, -1) > 0;],
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <math.h>
+             long double x;]],
+           [[return ldexpl (x, -1) > 0;]])],
         [gl_cv_func_ldexpl_no_libm=yes],
         [gl_cv_func_ldexpl_no_libm=no])
     ])
-  if test $gl_cv_func_ldexpl_no_libm = no; then
-    AC_CACHE_CHECK([whether ldexpl() can be used with libm],
-      [gl_cv_func_ldexpl_in_libm],
-      [
-        save_LIBS="$LIBS"
-        LIBS="$LIBS -lm"
-        AC_TRY_LINK([#include <math.h>
-                     long double x;],
-                    [return ldexpl (x, -1) > 0;],
-          [gl_cv_func_ldexpl_in_libm=yes],
-          [gl_cv_func_ldexpl_in_libm=no])
-        LIBS="$save_LIBS"
-      ])
-    if test $gl_cv_func_ldexpl_in_libm = yes; then
-      LDEXPL_LIBM=-lm
-    fi
-  fi
-  if test $gl_cv_func_ldexpl_no_libm = yes \
-     || test $gl_cv_func_ldexpl_in_libm = yes; then
-    save_LIBS="$LIBS"
-    LIBS="$LIBS $LDEXPL_LIBM"
-    gl_FUNC_LDEXPL_WORKS
-    LIBS="$save_LIBS"
-    case "$gl_cv_func_ldexpl_works" in
-      *yes) gl_func_ldexpl=yes ;;
-      *)    gl_func_ldexpl=no; REPLACE_LDEXPL=1; LDEXPL_LIBM= ;;
-    esac
-  else
-    gl_func_ldexpl=no
-  fi
-  if test $gl_func_ldexpl = yes; then
-    AC_DEFINE([HAVE_LDEXPL], [1],
-      [Define if the ldexpl() function is available.])
-    dnl Also check whether it's declared.
-    dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
-    AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [#include <math.h>])
-  else
-    HAVE_DECL_LDEXPL=0
-    AC_LIBOBJ([ldexpl])
-  fi
-  AC_SUBST([LDEXPL_LIBM])
 ])
 
 dnl Test whether ldexpl() works on finite numbers (this fails on AIX 5.1
@@ -68,21 +94,40 @@ AC_DEFUN([gl_FUNC_LDEXPL_WORKS],
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether ldexpl works], [gl_cv_func_ldexpl_works],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <math.h>
-extern long double ldexpl (long double, int);
+extern
+#ifdef __cplusplus
+"C"
+#endif
+long double ldexpl (long double, int);
 int main()
 {
-  volatile long double x1 = 1.0;
-  volatile long double y1 = ldexpl (x1, -1);
-  volatile long double x2 = 1.73205L;
-  volatile long double y2 = ldexpl (x2, 0);
-  return (y1 != 0.5L) || (y2 != x2);
-}], [gl_cv_func_ldexpl_works=yes], [gl_cv_func_ldexpl_works=no],
-      [case "$host_os" in
-         aix*) gl_cv_func_ldexpl_works="guessing no";;
-         *)    gl_cv_func_ldexpl_works="guessing yes";;
-       esac
-      ])
+  int result = 0;
+  {
+    volatile long double x = 1.0;
+    volatile long double y = ldexpl (x, -1);
+    if (y != 0.5L)
+      result |= 1;
+  }
+  {
+    volatile long double x = 1.73205L;
+    volatile long double y = ldexpl (x, 0);
+    if (y != x)
+      result |= 2;
+  }
+  return result;
+}]])],
+        [gl_cv_func_ldexpl_works=yes],
+        [gl_cv_func_ldexpl_works=no],
+        [
+changequote(,)dnl
+         case "$host_os" in
+           aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";;
+           *)               gl_cv_func_ldexpl_works="guessing yes";;
+         esac
+changequote([,])dnl
+        ])
     ])
 ])
diff --git a/m4/lib-ignore.m4 b/m4/lib-ignore.m4
new file mode 100644 (file)
index 0000000..292c469
--- /dev/null
@@ -0,0 +1,115 @@
+# If possible, ignore libraries that are not depended on.
+
+dnl Copyright (C) 2006, 2009-2012 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.
+
+dnl Written by Paul Eggert.
+
+# gl_IGNORE_UNUSED_LIBRARIES
+# --------------------------
+# Determines the option to be passed to the C/C++/Fortran compiler, so that it
+# omits unused libraries.
+# Example (on Solaris):
+# $ cc foo.c -lnsl; ldd ./a.out
+#         libnsl.so.1 =>   /lib/libnsl.so.1
+#         libc.so.1 =>     /lib/libc.so.1
+#         libmp.so.2 =>    /lib/libmp.so.2
+#         libmd.so.1 =>    /lib/libmd.so.1
+#         libscf.so.1 =>   /lib/libscf.so.1
+#         libdoor.so.1 =>  /lib/libdoor.so.1
+#         libuutil.so.1 =>         /lib/libuutil.so.1
+#         libgen.so.1 =>   /lib/libgen.so.1
+#         libm.so.2 =>     /lib/libm.so.2
+# $ cc foo.c -lnsl -Wl,-z,ignore; ldd ./a.out
+#         libc.so.1 =>     /lib/libc.so.1
+#         libm.so.2 =>     /lib/libm.so.2
+#
+# Note that the option works only for the C compiler, not for the C++
+# compiler:
+# - Sun C likes '-Wl,-z,ignore'.
+#   '-Qoption ld -z,ignore' is not accepted.
+#   '-z ignore' is accepted but has no effect.
+# - Sun C++ and Sun Fortran like '-Qoption ld -z,ignore'.
+#   '-Wl,-z,ignore' is not accepted.
+#   '-z ignore' is accepted but has no effect.
+#
+# Sets and substitutes a variable that depends on the current language:
+# - IGNORE_UNUSED_LIBRARIES_CFLAGS    for C
+# - IGNORE_UNUSED_LIBRARIES_CXXFLAGS  for C++
+# - IGNORE_UNUSED_LIBRARIES_FFLAGS    for Fortran
+#
+# Note that the option works only for direct invocation of the compiler, not
+# through libtool: When libtool is used to create a shared library, it will
+# honor and translate '-Wl,-z,ignore' to '-Qoption ld -z -Qoption ld ignore'
+# if needed, but it will drop a '-Qoption ld -z,ignore' on the command line.
+#
+AC_DEFUN([gl_IGNORE_UNUSED_LIBRARIES],
+[
+  AC_CACHE_CHECK([for []_AC_LANG[] compiler flag to ignore unused libraries],
+    [gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries],
+    [gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries=none
+     gl_saved_ldflags=$LDFLAGS
+     gl_saved_libs=$LIBS
+     # Link with -lm to detect binutils 2.16 bug with --as-needed; see
+     # <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00131.html>.
+     LIBS="$LIBS -lm"
+     # Use long option sequences like '-z ignore' to test for the feature,
+     # to forestall problems with linkers that have -z, -i, -g, -n, etc. flags.
+     # GCC + binutils likes '-Wl,--as-needed'.
+     # GCC + Solaris ld likes '-Wl,-z,ignore'.
+     # Sun C likes '-Wl,-z,ignore'. '-z ignore' is accepted but has no effect.
+     # Don't try bare '--as-needed'; nothing likes it and the HP-UX 11.11
+     # native cc issues annoying warnings and then ignores it,
+     # which would cause us to incorrectly conclude that it worked.
+     for gl_flags in _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS
+     do
+       LDFLAGS="$gl_flags $LDFLAGS"
+       AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+         [gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries=$gl_flags])
+       LDFLAGS=$gl_saved_ldflags
+       test "$gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries" != none &&
+         break
+     done
+     LIBS=$gl_saved_libs
+    ])
+  IGNORE_UNUSED_LIBRARIES_[]_AC_LANG_PREFIX[]FLAGS=
+  if test "$gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries" != none; then
+    IGNORE_UNUSED_LIBRARIES_[]_AC_LANG_PREFIX[]FLAGS="$gl_cv_prog_[]_AC_LANG_ABBREV[]_ignore_unused_libraries"
+  fi
+  AC_SUBST([IGNORE_UNUSED_LIBRARIES_]_AC_LANG_PREFIX[FLAGS])
+])
+
+# _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS
+# -----------------------------------
+# Expands to the language dependent options to be tried.
+AC_DEFUN([_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(C)
+# --------------------------------------
+m4_define([_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(C)],
+[ '-Wl,--as-needed' \
+  '-Wl,-z,ignore' \
+  '-z ignore'
+])
+
+# _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(C++)
+# ----------------------------------------
+m4_define([_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(C++)],
+[ '-Wl,--as-needed' \
+  '-Qoption ld -z,ignore' \
+  '-Wl,-z,ignore' \
+  '-z ignore'
+])
+
+# _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(Fortran 77)
+# -----------------------------------------------
+m4_copy([_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(C++)],
+        [_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(Fortran 77)])
+
+# _gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(Fortran)
+# --------------------------------------------
+m4_copy([_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(Fortran 77)],
+        [_gl_IGNORE_UNUSED_LIBRARIES_OPTIONS(Fortran)])
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
new file mode 100644 (file)
index 0000000..4e1374d
--- /dev/null
@@ -0,0 +1,109 @@
+# lib-ld.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 1996-2003, 2009-2012 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.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
+dnl with libtool.m4.
+
+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  acl_cv_prog_gnu_ld=yes ;;
+*)
+  acl_cv_prog_gnu_ld=no ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-1.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by GCC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]* | [A-Za-z]:[\\/]*)]
+      [re_direlt='/[^/][^/]*/\.\./']
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL([acl_cv_path_LD],
+[if test -z "$LD"; then
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      acl_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+      *GNU* | *'with BFD'*)
+        test "$with_gnu_ld" != no && break ;;
+      *)
+        test "$with_gnu_ld" != yes && break ;;
+      esac
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT([$LD])
+else
+  AC_MSG_RESULT([no])
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
+])
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
new file mode 100644 (file)
index 0000000..d11b4b4
--- /dev/null
@@ -0,0 +1,777 @@
+# lib-link.m4 serial 26 (gettext-0.18.2)
+dnl Copyright (C) 2001-2012 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.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.54])
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  pushdef([Name],[m4_translit([$1],[./+-], [____])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+    AC_LIB_LINKFLAGS_BODY([$1], [$2])
+    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
+  ])
+  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  AC_SUBST([LIB]NAME[_PREFIX])
+  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+  dnl results of this search when this library appears as a dependency.
+  HAVE_LIB[]NAME=yes
+  popdef([NAME])
+  popdef([Name])
+])
+
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. The missing-message
+dnl defaults to 'no' and may contain additional hints for the user.
+dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
+dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  pushdef([Name],[m4_translit([$1],[./+-], [____])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+
+  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed lib[]Name and not disabled its use
+  dnl via --without-lib[]Name-prefix, he wants to use it.
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+    ac_save_LIBS="$LIBS"
+    dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
+    dnl because these -l options might require -L options that are present in
+    dnl LIBS. -l options benefit only from the -L options listed before it.
+    dnl Otherwise, add it to the front of LIBS, because it may be a static
+    dnl library that depends on another static library that is present in LIBS.
+    dnl Static libraries benefit only from the static libraries listed after
+    dnl it.
+    case " $LIB[]NAME" in
+      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
+      *)       LIBS="$LIB[]NAME $LIBS" ;;
+    esac
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM([[$3]], [[$4]])],
+      [ac_cv_lib[]Name=yes],
+      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
+    LIBS="$ac_save_LIBS"
+  ])
+  if test "$ac_cv_lib[]Name" = yes; then
+    HAVE_LIB[]NAME=yes
+    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
+    AC_MSG_CHECKING([how to link with lib[]$1])
+    AC_MSG_RESULT([$LIB[]NAME])
+  else
+    HAVE_LIB[]NAME=no
+    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+    dnl $INC[]NAME either.
+    CPPFLAGS="$ac_save_CPPFLAGS"
+    LIB[]NAME=
+    LTLIB[]NAME=
+    LIB[]NAME[]_PREFIX=
+  fi
+  AC_SUBST([HAVE_LIB]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  AC_SUBST([LIB]NAME[_PREFIX])
+  popdef([NAME])
+  popdef([Name])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl   acl_libext,
+dnl   acl_shlibext,
+dnl   acl_libname_spec,
+dnl   acl_library_names_spec,
+dnl   acl_hardcode_libdir_flag_spec,
+dnl   acl_hardcode_libdir_separator,
+dnl   acl_hardcode_direct,
+dnl   acl_hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
+  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
+  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
+  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
+  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
+  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+  AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
+    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+    . ./conftest.sh
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
+  ])
+  wl="$acl_cv_wl"
+  acl_libext="$acl_cv_libext"
+  acl_shlibext="$acl_cv_shlibext"
+  acl_libname_spec="$acl_cv_libname_spec"
+  acl_library_names_spec="$acl_cv_library_names_spec"
+  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  acl_hardcode_direct="$acl_cv_hardcode_direct"
+  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+  dnl Determine whether the user wants rpath handling at all.
+  AC_ARG_ENABLE([rpath],
+    [  --disable-rpath         do not hardcode runtime library paths],
+    :, enable_rpath=yes)
+])
+
+dnl AC_LIB_FROMPACKAGE(name, package)
+dnl declares that libname comes from the given package. The configure file
+dnl will then not have a --with-libname-prefix option but a
+dnl --with-package-prefix option. Several libraries can come from the same
+dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
+dnl macro call that searches for libname.
+AC_DEFUN([AC_LIB_FROMPACKAGE],
+[
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+  define([acl_frompackage_]NAME, [$2])
+  popdef([NAME])
+  pushdef([PACK],[$2])
+  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+  define([acl_libsinpackage_]PACKUP,
+    m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
+  popdef([PACKUP])
+  popdef([PACK])
+])
+
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+  pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
+  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+  pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
+  dnl Autoconf >= 2.61 supports dots in --with options.
+  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_ARG_WITH(P_A_C_K[-prefix],
+[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
+  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+        if test "$acl_libdirstem2" != "$acl_libdirstem" \
+           && ! test -d "$withval/$acl_libdirstem"; then
+          additional_libdir="$withval/$acl_libdirstem2"
+        fi
+      fi
+    fi
+])
+  dnl Search the library and its dependencies in $additional_libdir and
+  dnl $LDFLAGS. Using breadth-first-seach.
+  LIB[]NAME=
+  LTLIB[]NAME=
+  INC[]NAME=
+  LIB[]NAME[]_PREFIX=
+  dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
+  dnl computed. So it has to be reset here.
+  HAVE_LIB[]NAME=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='$1 $2'
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+        dnl or AC_LIB_HAVE_LINKFLAGS call.
+        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+          else
+            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+            dnl that this library doesn't exist. So just drop it.
+            :
+          fi
+        else
+          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+          dnl and the already constructed $LIBNAME/$LTLIBNAME.
+          found_dir=
+          found_la=
+          found_so=
+          found_a=
+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
+          if test -n "$acl_shlibext"; then
+            shrext=".$acl_shlibext"             # typically: shrext=.so
+          else
+            shrext=
+          fi
+          if test $use_additional = yes; then
+            dir="$additional_libdir"
+            dnl The same code as in the loop below:
+            dnl First look for a shared library.
+            if test -n "$acl_shlibext"; then
+              if test -f "$dir/$libname$shrext"; then
+                found_dir="$dir"
+                found_so="$dir/$libname$shrext"
+              else
+                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                  ver=`(cd "$dir" && \
+                        for f in "$libname$shrext".*; do echo "$f"; done \
+                        | sed -e "s,^$libname$shrext\\\\.,," \
+                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                        | sed 1q ) 2>/dev/null`
+                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                    found_dir="$dir"
+                    found_so="$dir/$libname$shrext.$ver"
+                  fi
+                else
+                  eval library_names=\"$acl_library_names_spec\"
+                  for f in $library_names; do
+                    if test -f "$dir/$f"; then
+                      found_dir="$dir"
+                      found_so="$dir/$f"
+                      break
+                    fi
+                  done
+                fi
+              fi
+            fi
+            dnl Then look for a static library.
+            if test "X$found_dir" = "X"; then
+              if test -f "$dir/$libname.$acl_libext"; then
+                found_dir="$dir"
+                found_a="$dir/$libname.$acl_libext"
+              fi
+            fi
+            if test "X$found_dir" != "X"; then
+              if test -f "$dir/$libname.la"; then
+                found_la="$dir/$libname.la"
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIB[]NAME; do
+              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                  dnl First look for a shared library.
+                  if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                  dnl Then look for a static library.
+                  if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+            dnl Found the library.
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+              dnl Linking with a shared library. We attempt to hardcode its
+              dnl directory into the executable's runpath, unless it's the
+              dnl standard /usr/lib.
+              if test "$enable_rpath" = no \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+                dnl No hardcoding is needed.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+              else
+                dnl Use an explicit option to hardcode DIR into the resulting
+                dnl binary.
+                dnl Potentially add DIR to ltrpathdirs.
+                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                dnl The hardcoding into $LIBNAME is system dependent.
+                if test "$acl_hardcode_direct" = yes; then
+                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+                  dnl resulting binary.
+                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                else
+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+                    dnl Use an explicit option to hardcode DIR into the resulting
+                    dnl binary.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    dnl Potentially add DIR to rpathdirs.
+                    dnl The rpathdirs will be appended to $LIBNAME at the end.
+                    haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                    dnl Rely on "-L$found_dir".
+                    dnl But don't add it if it's already contained in the LDFLAGS
+                    dnl or the already constructed $LIBNAME
+                    haveit=
+                    for x in $LDFLAGS $LIB[]NAME; do
+                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+                    fi
+                    if test "$acl_hardcode_minus_L" != no; then
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    else
+                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
+                      dnl here, because this doesn't fit in flags passed to the
+                      dnl compiler. So give up. No hardcoding. This affects only
+                      dnl very old systems.
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                dnl Linking with a static library.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+              else
+                dnl We shouldn't come here, but anyway it's good to have a
+                dnl fallback.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+              fi
+            fi
+            dnl Assume the include files are nearby.
+            additional_includedir=
+            case "$found_dir" in
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                if test "$name" = '$1'; then
+                  LIB[]NAME[]_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem2 | */$acl_libdirstem2/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+                if test "$name" = '$1'; then
+                  LIB[]NAME[]_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+              dnl Potentially add $additional_includedir to $INCNAME.
+              dnl But don't add it
+              dnl   1. if it's the standard /usr/include,
+              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
+              dnl   3. if it's already present in $CPPFLAGS or the already
+              dnl      constructed $INCNAME,
+              dnl   4. if it doesn't exist as a directory.
+              if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INC[]NAME; do
+                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                      dnl Really add $additional_includedir to $INCNAME.
+                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+            dnl Look for dependencies.
+            if test -n "$found_la"; then
+              dnl Read the .la file. It defines the variables
+              dnl dlname, library_names, old_library, dependency_libs, current,
+              dnl age, revision, installed, dlopen, dlpreopen, libdir.
+              save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+              dnl We use only dependency_libs.
+              for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+                    dnl But don't add it
+                    dnl   1. if it's the standard /usr/lib,
+                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
+                    dnl   3. if it's already present in $LDFLAGS or the already
+                    dnl      constructed $LIBNAME,
+                    dnl   4. if it doesn't exist as a directory.
+                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LIBNAME.
+                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LTLIBNAME.
+                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                      dnl Potentially add DIR to rpathdirs.
+                      dnl The rpathdirs will be appended to $LIBNAME at the end.
+                      haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                      dnl Potentially add DIR to ltrpathdirs.
+                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                      haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                    dnl Handle this in the next round.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                    dnl Handle this in the next round. Throw away the .la's
+                    dnl directory; it is already contained in a preceding -L
+                    dnl option.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                    dnl Most likely an immediate library name.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+            dnl Didn't find the library; assume it is in the system directories
+            dnl known to the linker and runtime loader. (All the system
+            dnl directories known to the linker should also be known to the
+            dnl runtime loader, otherwise the system is severely misconfigured.)
+            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
+      dnl Weird platform: only the last -rpath option counts, the user must
+      dnl pass all path elements in one option. We can arrange that for a
+      dnl single library, but not when more than one $LIBNAMEs are used.
+      alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+      done
+      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
+      acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+    else
+      dnl The -rpath options are cumulative.
+      for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+    dnl When using libtool, the option that works for both libraries and
+    dnl executables is -R. The -R options are cumulative.
+    for found_dir in $ltrpathdirs; do
+      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+    done
+  fi
+  popdef([P_A_C_K])
+  popdef([PACKLIBS])
+  popdef([PACKUP])
+  popdef([PACK])
+  popdef([NAME])
+])
+
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+  for element in [$2]; do
+    haveit=
+    for x in $[$1]; do
+      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      [$1]="${[$1]}${[$1]:+ }$element"
+    fi
+  done
+])
+
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+  AC_REQUIRE([AC_LIB_RPATH])
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  $1=
+  if test "$enable_rpath" != no; then
+    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+      dnl Use an explicit option to hardcode directories into the resulting
+      dnl binary.
+      rpathdirs=
+      next=
+      for opt in $2; do
+        if test -n "$next"; then
+          dir="$next"
+          dnl No need to hardcode the standard /usr/lib.
+          if test "X$dir" != "X/usr/$acl_libdirstem" \
+             && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+            rpathdirs="$rpathdirs $dir"
+          fi
+          next=
+        else
+          case $opt in
+            -L) next=yes ;;
+            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+                 dnl No need to hardcode the standard /usr/lib.
+                 if test "X$dir" != "X/usr/$acl_libdirstem" \
+                    && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+                   rpathdirs="$rpathdirs $dir"
+                 fi
+                 next= ;;
+            *) next= ;;
+          esac
+        fi
+      done
+      if test "X$rpathdirs" != "X"; then
+        if test -n ""$3""; then
+          dnl libtool is used for linking. Use -R options.
+          for dir in $rpathdirs; do
+            $1="${$1}${$1:+ }-R$dir"
+          done
+        else
+          dnl The linker is used for linking directly.
+          if test -n "$acl_hardcode_libdir_separator"; then
+            dnl Weird platform: only the last -rpath option counts, the user
+            dnl must pass all path elements in one option.
+            alldirs=
+            for dir in $rpathdirs; do
+              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
+            done
+            acl_save_libdir="$libdir"
+            libdir="$alldirs"
+            eval flag=\"$acl_hardcode_libdir_flag_spec\"
+            libdir="$acl_save_libdir"
+            $1="$flag"
+          else
+            dnl The -rpath options are cumulative.
+            for dir in $rpathdirs; do
+              acl_save_libdir="$libdir"
+              libdir="$dir"
+              eval flag=\"$acl_hardcode_libdir_flag_spec\"
+              libdir="$acl_save_libdir"
+              $1="${$1}${$1:+ }$flag"
+            done
+          fi
+        fi
+      fi
+    fi
+  fi
+  AC_SUBST([$1])
+])
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
new file mode 100644 (file)
index 0000000..007aa05
--- /dev/null
@@ -0,0 +1,224 @@
+# lib-prefix.m4 serial 7 (gettext-0.18)
+dnl Copyright (C) 2001-2005, 2008-2012 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.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_LIB_ARG_WITH([lib-prefix],
+[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+  --without-lib-prefix    don't search for libraries in includedir and libdir],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+      fi
+    fi
+])
+  if test $use_additional = yes; then
+    dnl Potentially add $additional_includedir to $CPPFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/include,
+    dnl   2. if it's already present in $CPPFLAGS,
+    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_includedir" != "X/usr/include"; then
+      haveit=
+      for x in $CPPFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-I$additional_includedir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_includedir" = "X/usr/local/include"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_includedir"; then
+            dnl Really add $additional_includedir to $CPPFLAGS.
+            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+          fi
+        fi
+      fi
+    fi
+    dnl Potentially add $additional_libdir to $LDFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/lib,
+    dnl   2. if it's already present in $LDFLAGS,
+    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+      haveit=
+      for x in $LDFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-L$additional_libdir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux*) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_libdir"; then
+            dnl Really add $additional_libdir to $LDFLAGS.
+            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+          fi
+        fi
+      fi
+    fi
+  fi
+])
+
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+  dnl Unfortunately, prefix and exec_prefix get only finally determined
+  dnl at the end of configure.
+  if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  $1
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_PREPARE_MULTILIB creates
+dnl - a variable acl_libdirstem, containing the basename of the libdir, either
+dnl   "lib" or "lib64" or "lib/64",
+dnl - a variable acl_libdirstem2, as a secondary possible value for
+dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
+dnl   "lib/amd64".
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+  dnl There is no formal standard regarding lib and lib64.
+  dnl On glibc systems, the current practice is that on a system supporting
+  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
+  dnl the compiler's default mode by looking at the compiler's library search
+  dnl path. If at least one of its elements ends in /lib64 or points to a
+  dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
+  dnl Otherwise we use the default, namely "lib".
+  dnl On Solaris systems, the current practice is that on a system supporting
+  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+  dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
+  dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  acl_libdirstem=lib
+  acl_libdirstem2=
+  case "$host_os" in
+    solaris*)
+      dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+      dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
+      dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
+      dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
+      dnl symlink is missing, so we set acl_libdirstem2 too.
+      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
+        [AC_EGREP_CPP([sixtyfour bits], [
+#ifdef _LP64
+sixtyfour bits
+#endif
+           ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
+        ])
+      if test $gl_cv_solaris_64bit = yes; then
+        acl_libdirstem=lib/64
+        case "$host_cpu" in
+          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
+          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+        esac
+      fi
+      ;;
+    *)
+      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+      if test -n "$searchpath"; then
+        acl_save_IFS="${IFS=   }"; IFS=":"
+        for searchdir in $searchpath; do
+          if test -d "$searchdir"; then
+            case "$searchdir" in
+              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+              */../ | */.. )
+                # Better ignore directories of this form. They are misleading.
+                ;;
+              *) searchdir=`cd "$searchdir" && pwd`
+                 case "$searchdir" in
+                   */lib64 ) acl_libdirstem=lib64 ;;
+                 esac ;;
+            esac
+          fi
+        done
+        IFS="$acl_save_IFS"
+      fi
+      ;;
+  esac
+  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+])
index ee2e801bdd9a32ab89c007e1a128a174523cbe73..8010379b18a96b4b27750777d2a048cab94f8721 100644 (file)
@@ -1,5 +1,5 @@
 # localcharset.m4 serial 7
-dnl Copyright (C) 2002, 2004, 2006, 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2004, 2006, 2009-2012 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.
index 001f53906f5e1464ac84e7679704ad210a36b456..04d801f23e4c738da89017cee0e94fad96e64377 100644 (file)
@@ -1,5 +1,5 @@
-# locale-fr.m4 serial 11
-dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
+# locale-fr.m4 serial 16
+dnl Copyright (C) 2003, 2005-2012 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.
@@ -25,17 +25,30 @@ struct tm t;
 char buf[16];
 int main () {
   /* Check whether the given locale name is recognized by the system.  */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+     category of the locale to "C".  */
+  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+    return 1;
+#else
   if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
      On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
      succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
 #if HAVE_LANGINFO_CODESET
   {
     const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
       return 1;
   }
 #endif
@@ -50,46 +63,67 @@ int main () {
      one byte long. This excludes the UTF-8 encoding.  */
   t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
   if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
   /* Check whether the decimal separator is a comma.
      On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
      are nl_langinfo(RADIXCHAR) are both ".".  */
   if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
   return 0;
 }
 changequote([,])dnl
       ])])
     if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the usual locale name.
-      if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_fr=fr_FR
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_fr=fr_FR.ISO-8859-1
-        else
-          # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
-          if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr=fr_FR.ISO8859-1
+      case "$host_os" in
+        # Handle native Windows specially, because there setlocale() interprets
+        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+        # "fr" or "fra" as "French" or "French_France.1252",
+        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+        # "ja" as "Japanese" or "Japanese_Japan.932",
+        # and similar.
+        mingw*)
+          # Test for the native Windows locale name.
+          if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr=French_France.1252
           else
-            # Test for the HP-UX locale name.
-            if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-              gt_cv_locale_fr=fr_FR.iso88591
+            # None found.
+            gt_cv_locale_fr=none
+          fi
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # configure script would override the LC_ALL setting. Likewise for
+          # LC_CTYPE, which is also set at the beginning of the configure script.
+          # Test for the usual locale name.
+          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr=fr_FR
+          else
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_fr=fr_FR.ISO-8859-1
             else
-              # Test for the Solaris 7 locale name.
-              if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-                gt_cv_locale_fr=fr
+              # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name.
+              if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                gt_cv_locale_fr=fr_FR.ISO8859-1
               else
-                # None found.
-                gt_cv_locale_fr=none
+                # Test for the HP-UX locale name.
+                if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                  gt_cv_locale_fr=fr_FR.iso88591
+                else
+                  # Test for the Solaris 7 locale name.
+                  if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                    gt_cv_locale_fr=fr
+                  else
+                    # None found.
+                    gt_cv_locale_fr=none
+                  fi
+                fi
               fi
             fi
           fi
-        fi
-      fi
+          ;;
+      esac
     fi
     rm -fr conftest*
   ])
@@ -119,7 +153,17 @@ int main () {
      variables, and all locales use the UTF-8 encoding.  */
 #if !(defined __BEOS__ || defined __HAIKU__)
   /* Check whether the given locale name is recognized by the system.  */
+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+     category of the locale to "C".  */
+  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+    return 1;
+# else
   if (setlocale (LC_ALL, "") == NULL) return 1;
+# endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
@@ -147,36 +191,57 @@ int main () {
       || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
     return 1;
 #endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
   /* Check whether the decimal separator is a comma.
      On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
      are nl_langinfo(RADIXCHAR) are both ".".  */
   if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
   return 0;
 }
 changequote([,])dnl
       ])])
     if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the usual locale name.
-      if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_fr_utf8=fr_FR
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_fr_utf8=fr_FR.UTF-8
-        else
-          # Test for the Solaris 7 locale name.
-          if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr_utf8=fr.UTF-8
+      case "$host_os" in
+        # Handle native Windows specially, because there setlocale() interprets
+        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+        # "fr" or "fra" as "French" or "French_France.1252",
+        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+        # "ja" as "Japanese" or "Japanese_Japan.932",
+        # and similar.
+        mingw*)
+          # Test for the hypothetical native Windows locale name.
+          if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr_utf8=French_France.65001
           else
             # None found.
             gt_cv_locale_fr_utf8=none
           fi
-        fi
-      fi
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # configure script would override the LC_ALL setting. Likewise for
+          # LC_CTYPE, which is also set at the beginning of the configure script.
+          # Test for the usual locale name.
+          if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr_utf8=fr_FR
+          else
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_fr_utf8=fr_FR.UTF-8
+            else
+              # Test for the Solaris 7 locale name.
+              if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                gt_cv_locale_fr_utf8=fr.UTF-8
+              else
+                # None found.
+                gt_cv_locale_fr_utf8=none
+              fi
+            fi
+          fi
+          ;;
+      esac
     fi
     rm -fr conftest*
   ])
index 0eedaf149aab11a18940ce2cfe63398b6a895f01..201ac4e76a9326c7246f00c474b86811f7ba25a5 100644 (file)
@@ -1,5 +1,5 @@
-# locale-ja.m4 serial 7
-dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
+# locale-ja.m4 serial 11
+dnl Copyright (C) 2003, 2005-2012 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.
@@ -27,17 +27,30 @@ int main ()
 {
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+     category of the locale to "C".  */
+  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+    return 1;
+#else
   if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
      On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
      succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
 #if HAVE_LANGINFO_CODESET
   {
     const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
       return 1;
   }
 #endif
@@ -52,7 +65,7 @@ int main ()
   if (MB_CUR_MAX == 1)
     return 1;
   /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding.  */
+     This excludes the UTF-8 encoding (except on MirBSD).  */
   t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
   if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
   for (p = buf; *p != '\0'; p++)
@@ -63,42 +76,58 @@ int main ()
 changequote([,])dnl
       ])])
     if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the AIX locale name.
-      if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_ja=ja_JP
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_ja=ja_JP.EUC-JP
-        else
-          # Test for the HP-UX, OSF/1, NetBSD locale name.
-          if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_ja=ja_JP.eucJP
+      case "$host_os" in
+        # Handle native Windows specially, because there setlocale() interprets
+        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+        # "fr" or "fra" as "French" or "French_France.1252",
+        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+        # "ja" as "Japanese" or "Japanese_Japan.932",
+        # and similar.
+        mingw*)
+          # Note that on native Windows, the Japanese locale is
+          # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
+          # cannot use it here.
+          gt_cv_locale_ja=none
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # configure script would override the LC_ALL setting. Likewise for
+          # LC_CTYPE, which is also set at the beginning of the configure script.
+          # Test for the AIX locale name.
+          if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_ja=ja_JP
           else
-            # Test for the IRIX, FreeBSD locale name.
-            if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-              gt_cv_locale_ja=ja_JP.EUC
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_ja=ja_JP.EUC-JP
             else
-              # Test for the Solaris 7 locale name.
-              if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-                gt_cv_locale_ja=ja
+              # Test for the HP-UX, OSF/1, NetBSD locale name.
+              if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                gt_cv_locale_ja=ja_JP.eucJP
               else
-                # Special test for NetBSD 1.6.
-                if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
-                  gt_cv_locale_ja=ja_JP.eucJP
+                # Test for the IRIX, FreeBSD locale name.
+                if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                  gt_cv_locale_ja=ja_JP.EUC
                 else
-                  # None found.
-                  gt_cv_locale_ja=none
+                  # Test for the Solaris 7 locale name.
+                  if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                    gt_cv_locale_ja=ja
+                  else
+                    # Special test for NetBSD 1.6.
+                    if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then
+                      gt_cv_locale_ja=ja_JP.eucJP
+                    else
+                      # None found.
+                      gt_cv_locale_ja=none
+                    fi
+                  fi
                 fi
               fi
             fi
           fi
-        fi
-      fi
+          ;;
+      esac
     fi
     rm -fr conftest*
   ])
index 777fd1418eddfeff2087d1509723d7ffac40452d..0cf5adacc466df3627a1e2f894f319cd4321acb7 100644 (file)
@@ -1,5 +1,5 @@
-# locale-zh.m4 serial 6
-dnl Copyright (C) 2003, 2005-2010 Free Software Foundation, Inc.
+# locale-zh.m4 serial 11
+dnl Copyright (C) 2003, 2005-2012 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.
@@ -28,17 +28,30 @@ int main ()
 {
   const char *p;
   /* Check whether the given locale name is recognized by the system.  */
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
+     category of the locale to "C".  */
+  if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
+      || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+    return 1;
+#else
   if (setlocale (LC_ALL, "") == NULL) return 1;
+#endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On MacOS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET)
      is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
      On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
      succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
 #if HAVE_LANGINFO_CODESET
   {
     const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
       return 1;
   }
 #endif
@@ -49,7 +62,7 @@ int main ()
   if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
 #endif
   /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding.  */
+     This excludes the UTF-8 encoding (except on MirBSD).  */
   t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
   if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
   for (p = buf; *p != '\0'; p++)
@@ -64,22 +77,47 @@ int main ()
 changequote([,])dnl
       ])])
     if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
-      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
-      # configure script would override the LC_ALL setting. Likewise for
-      # LC_CTYPE, which is also set at the beginning of the configure script.
-      # Test for the locale name without encoding suffix.
-      if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_zh_CN=zh_CN
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_zh_CN=zh_CN.GB18030
-        else
-          # None found.
+      case "$host_os" in
+        # Handle native Windows specially, because there setlocale() interprets
+        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+        # "fr" or "fra" as "French" or "French_France.1252",
+        # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
+        # "ja" as "Japanese" or "Japanese_Japan.932",
+        # and similar.
+        mingw*)
+          # Test for the hypothetical native Windows locale name.
+          if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_zh_CN=Chinese_China.54936
+          else
+            # None found.
+            gt_cv_locale_zh_CN=none
+          fi
+          ;;
+        solaris2.8)
+          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
           gt_cv_locale_zh_CN=none
-        fi
-      fi
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+          # configure script would override the LC_ALL setting. Likewise for
+          # LC_CTYPE, which is also set at the beginning of the configure script.
+          # Test for the locale name without encoding suffix.
+          if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_zh_CN=zh_CN
+          else
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_zh_CN=zh_CN.GB18030
+            else
+              # None found.
+              gt_cv_locale_zh_CN=none
+            fi
+          fi
+          ;;
+      esac
     else
       # If there was a link error, due to mblen(), the system is so old that
       # it certainly doesn't have a chinese locale.
diff --git a/m4/lock.m4 b/m4/lock.m4
new file mode 100644 (file)
index 0000000..c0a6206
--- /dev/null
@@ -0,0 +1,41 @@
+# lock.m4 serial 11 (gettext-0.18.2)
+dnl Copyright (C) 2005-2012 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.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_LOCK],
+[
+  AC_REQUIRE([gl_THREADLIB])
+  if test "$gl_threads_api" = posix; then
+    # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
+    # pthread_rwlock_* functions.
+    AC_CHECK_TYPE([pthread_rwlock_t],
+      [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
+         [Define if the POSIX multithreading library has read/write locks.])],
+      [],
+      [#include <pthread.h>])
+    # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
+    AC_COMPILE_IFELSE([
+      AC_LANG_PROGRAM(
+        [[#include <pthread.h>]],
+        [[
+#if __FreeBSD__ == 4
+error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#else
+int x = (int)PTHREAD_MUTEX_RECURSIVE;
+return !x;
+#endif
+        ]])],
+      [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
+         [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
+  fi
+  gl_PREREQ_LOCK
+])
+
+# Prerequisites of lib/lock.c.
+AC_DEFUN([gl_PREREQ_LOCK], [
+  AC_REQUIRE([AC_C_INLINE])
+])
index cca3c1a90fa9d399493c7a7b9a885b4ca5270971..b9c65c756ee0665d1c45a35850d033eabf9bf753 100644 (file)
@@ -1,5 +1,5 @@
-# longlong.m4 serial 14
-dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc.
+# longlong.m4 serial 17
+dnl Copyright (C) 1999-2007, 2009-2012 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.
@@ -7,8 +7,8 @@ dnl with or without modifications, as long as this notice is preserved.
 dnl From Paul Eggert.
 
 # Define HAVE_LONG_LONG_INT if 'long long int' works.
-# This fixes a bug in Autoconf 2.61, but can be removed once we
-# assume 2.62 everywhere.
+# This fixes a bug in Autoconf 2.61, and can be faster
+# than what's in Autoconf 2.62 through 2.68.
 
 # Note: If the type 'long long int' exists but is only 32 bits large
 # (as on some very old compilers), HAVE_LONG_LONG_INT will not be
@@ -16,44 +16,48 @@ dnl From Paul Eggert.
 
 AC_DEFUN([AC_TYPE_LONG_LONG_INT],
 [
+  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
   AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
-    [AC_LINK_IFELSE(
-       [_AC_TYPE_LONG_LONG_SNIPPET],
-       [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
-        dnl If cross compiling, assume the bug isn't important, since
-        dnl nobody cross compiles for this platform as far as we know.
-        AC_RUN_IFELSE(
-          [AC_LANG_PROGRAM(
-             [[@%:@include <limits.h>
-               @%:@ifndef LLONG_MAX
-               @%:@ define HALF \
-                        (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-               @%:@ define LLONG_MAX (HALF - 1 + HALF)
-               @%:@endif]],
-             [[long long int n = 1;
-               int i;
-               for (i = 0; ; i++)
-                 {
-                   long long int m = n << i;
-                   if (m >> i != n)
-                     return 1;
-                   if (LLONG_MAX / 2 < m)
-                     break;
-                 }
-               return 0;]])],
-          [ac_cv_type_long_long_int=yes],
-          [ac_cv_type_long_long_int=no],
-          [ac_cv_type_long_long_int=yes])],
-       [ac_cv_type_long_long_int=no])])
+     [ac_cv_type_long_long_int=yes
+      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+        ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
+        if test $ac_cv_type_long_long_int = yes; then
+          dnl Catch a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
+          dnl If cross compiling, assume the bug is not important, since
+          dnl nobody cross compiles for this platform as far as we know.
+          AC_RUN_IFELSE(
+            [AC_LANG_PROGRAM(
+               [[@%:@include <limits.h>
+                 @%:@ifndef LLONG_MAX
+                 @%:@ define HALF \
+                          (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+                 @%:@ define LLONG_MAX (HALF - 1 + HALF)
+                 @%:@endif]],
+               [[long long int n = 1;
+                 int i;
+                 for (i = 0; ; i++)
+                   {
+                     long long int m = n << i;
+                     if (m >> i != n)
+                       return 1;
+                     if (LLONG_MAX / 2 < m)
+                       break;
+                   }
+                 return 0;]])],
+            [],
+            [ac_cv_type_long_long_int=no],
+            [:])
+        fi
+      fi])
   if test $ac_cv_type_long_long_int = yes; then
     AC_DEFINE([HAVE_LONG_LONG_INT], [1],
-      [Define to 1 if the system has the type `long long int'.])
+      [Define to 1 if the system has the type 'long long int'.])
   fi
 ])
 
 # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
-# This fixes a bug in Autoconf 2.61, but can be removed once we
-# assume 2.62 everywhere.
+# This fixes a bug in Autoconf 2.61, and can be faster
+# than what's in Autoconf 2.62 through 2.68.
 
 # Note: If the type 'unsigned long long int' exists but is only 32 bits
 # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
@@ -64,13 +68,16 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
 [
   AC_CACHE_CHECK([for unsigned long long int],
     [ac_cv_type_unsigned_long_long_int],
-    [AC_LINK_IFELSE(
-       [_AC_TYPE_LONG_LONG_SNIPPET],
-       [ac_cv_type_unsigned_long_long_int=yes],
-       [ac_cv_type_unsigned_long_long_int=no])])
+    [ac_cv_type_unsigned_long_long_int=yes
+     if test "x${ac_cv_prog_cc_c99-no}" = xno; then
+       AC_LINK_IFELSE(
+         [_AC_TYPE_LONG_LONG_SNIPPET],
+         [],
+         [ac_cv_type_unsigned_long_long_int=no])
+     fi])
   if test $ac_cv_type_unsigned_long_long_int = yes; then
     AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
-      [Define to 1 if the system has the type `unsigned long long int'.])
+      [Define to 1 if the system has the type 'unsigned long long int'.])
   fi
 ])
 
index f3084957c186bbac4bc6f4f398a15f5200add6a3..bdda7f659b3b515ed7df5fb9b050e5130c573b5d 100644 (file)
@@ -1,5 +1,5 @@
-# lseek.m4 serial 4
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# lseek.m4 serial 10
+dnl Copyright (C) 2007, 2009-2012 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.
@@ -7,44 +7,65 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_LSEEK],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+  AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([AC_PROG_CC])
+  AC_CHECK_HEADERS_ONCE([unistd.h])
   AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe],
-    [if test $cross_compiling = no; then
-       AC_LINK_IFELSE([
+    [case "$host_os" in
+       mingw*)
+         dnl Native Windows.
+         dnl The result of lseek (fd, (off_t)0, SEEK_CUR) or
+         dnl SetFilePointer(handle, 0, NULL, FILE_CURRENT)
+         dnl for a pipe depends on the environment: In a Cygwin 1.5
+         dnl environment it succeeds (wrong); in a Cygwin 1.7 environment
+         dnl it fails with a wrong errno value.
+         gl_cv_func_lseek_pipe=no
+         ;;
+       *)
+         if test $cross_compiling = no; then
+           AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h> /* for off_t */
 #include <stdio.h> /* for SEEK_CUR */
-#include <unistd.h>
-int main ()
-{
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
+]], [[
   /* Exit with success only if stdin is seekable.  */
   return lseek (0, (off_t)0, SEEK_CUR) < 0;
-}],
-         [if test -s conftest$ac_exeext \
-             && ./conftest$ac_exeext < conftest.$ac_ext \
-             && { echo hi | ./conftest$ac_exeext; test $? = 1; }; then
-            gl_cv_func_lseek_pipe=yes
-          else
-            gl_cv_func_lseek_pipe=no
-          fi],
-         [gl_cv_func_lseek_pipe=no])
-     else
-       AC_COMPILE_IFELSE([
-#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined __BEOS__
-/* mingw and BeOS mistakenly return 0 when trying to seek on pipes.  */
+]])],
+             [if test -s conftest$ac_exeext \
+                 && ./conftest$ac_exeext < conftest.$ac_ext \
+                 && test 1 = "`echo hi \
+                   | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
+                gl_cv_func_lseek_pipe=yes
+              else
+                gl_cv_func_lseek_pipe=no
+              fi
+             ],
+             [gl_cv_func_lseek_pipe=no])
+         else
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE([[
+#if defined __BEOS__
+/* BeOS mistakenly return 0 when trying to seek on pipes.  */
   Choke me.
-#endif],
-         [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
-     fi])
+#endif]])],
+             [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
+         fi
+         ;;
+     esac
+    ])
   if test $gl_cv_func_lseek_pipe = no; then
-    gl_REPLACE_LSEEK
+    REPLACE_LSEEK=1
+    AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
+      [Define to 1 if lseek does not detect pipes.])
   fi
-])
 
-AC_DEFUN([gl_REPLACE_LSEEK],
-[
-  AC_LIBOBJ([lseek])
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  REPLACE_LSEEK=1
-  AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
-            [Define to 1 if lseek does not detect pipes.])
+  AC_REQUIRE([gl_SYS_TYPES_H])
+  if test $WINDOWS_64_BIT_OFF_T = 1; then
+    REPLACE_LSEEK=1
+  fi
 ])
index 5dbd16e28ffe875a46d4696df5a4a164b32b929f..b7335bda1b22919415a2da966002487e194443cb 100644 (file)
@@ -1,6 +1,6 @@
-# serial 20
+# serial 25
 
-# Copyright (C) 1997-2001, 2003-2010 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,14 +15,63 @@ AC_DEFUN([gl_FUNC_LSTAT],
   dnl "#define lstat stat", and lstat.c is a no-op.
   AC_CHECK_FUNCS_ONCE([lstat])
   if test $ac_cv_func_lstat = yes; then
-    AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
-    if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
-      dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]).
-      REPLACE_LSTAT=1
-    fi
-    # Prerequisites of lib/lstat.c.
-    AC_REQUIRE([AC_C_INLINE])
+    AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+    case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+      *no)
+        REPLACE_LSTAT=1
+        ;;
+    esac
   else
     HAVE_LSTAT=0
   fi
 ])
+
+# Prerequisites of lib/lstat.c.
+AC_DEFUN([gl_PREREQ_LSTAT],
+[
+  AC_REQUIRE([AC_C_INLINE])
+  :
+])
+
+AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
+[
+  dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
+  dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
+  AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
+    [gl_cv_func_lstat_dereferences_slashed_symlink],
+    [rm -f conftest.sym conftest.file
+     echo >conftest.file
+     if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
+       AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM(
+            [AC_INCLUDES_DEFAULT],
+            [[struct stat sbuf;
+              /* Linux will dereference the symlink and fail, as required by
+                 POSIX.  That is better in the sense that it means we will not
+                 have to compile and use the lstat wrapper.  */
+              return lstat ("conftest.sym/", &sbuf) == 0;
+            ]])],
+         [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
+         [gl_cv_func_lstat_dereferences_slashed_symlink=no],
+         [case "$host_os" in
+                    # Guess yes on glibc systems.
+            *-gnu*) gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+                    # If we don't know, assume the worst.
+            *)      gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
+          esac
+         ])
+     else
+       # If the 'ln -s' command failed, then we probably don't even
+       # have an lstat function.
+       gl_cv_func_lstat_dereferences_slashed_symlink="guessing no"
+     fi
+     rm -f conftest.sym conftest.file
+    ])
+  case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+    *yes)
+      AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
+        [Define to 1 if 'lstat' dereferences a symlink specified
+         with a trailing slash.])
+      ;;
+  esac
+])
index 910ac92292c8c9b2840ad1e9c8cfcb8d9a867f4c..8fa48e93bc2cbcb29e6852ef85cdf9f60becad2c 100644 (file)
@@ -1,25 +1,78 @@
-# malloc.m4 serial 9
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# malloc.m4 serial 14
+dnl Copyright (C) 2007, 2009-2012 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.
 
+m4_version_prereq([2.70], [] ,[
+
+# This is taken from the following Autoconf patch:
+# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
+AC_DEFUN([_AC_FUNC_MALLOC_IF],
+[
+  AC_REQUIRE([AC_HEADER_STDC])dnl
+  AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+  AC_CHECK_HEADERS([stdlib.h])
+  AC_CACHE_CHECK([for GNU libc compatible malloc],
+    [ac_cv_func_malloc_0_nonnull],
+    [AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+            # include <stdlib.h>
+            #else
+            char *malloc ();
+            #endif
+          ]],
+          [[return ! malloc (0);]])
+       ],
+       [ac_cv_func_malloc_0_nonnull=yes],
+       [ac_cv_func_malloc_0_nonnull=no],
+       [case "$host_os" in
+          # Guess yes on platforms where we know the result.
+          *-gnu* | freebsd* | netbsd* | openbsd* \
+          | hpux* | solaris* | cygwin* | mingw*)
+            ac_cv_func_malloc_0_nonnull=yes ;;
+          # If we don't know, assume the worst.
+          *) ac_cv_func_malloc_0_nonnull=no ;;
+        esac
+       ])
+    ])
+  AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2])
+])# _AC_FUNC_MALLOC_IF
+
+])
+
+# gl_FUNC_MALLOC_GNU
+# ------------------
+# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if
+# it is not.
+AC_DEFUN([gl_FUNC_MALLOC_GNU],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  dnl _AC_FUNC_MALLOC_IF is defined in Autoconf.
+  _AC_FUNC_MALLOC_IF(
+    [AC_DEFINE([HAVE_MALLOC_GNU], [1],
+               [Define to 1 if your system has a GNU libc compatible 'malloc'
+                function, and to 0 otherwise.])],
+    [AC_DEFINE([HAVE_MALLOC_GNU], [0])
+     REPLACE_MALLOC=1
+    ])
+])
+
 # gl_FUNC_MALLOC_POSIX
 # --------------------
 # Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
 # fails), and replace malloc if it is not.
 AC_DEFUN([gl_FUNC_MALLOC_POSIX],
 [
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
   if test $gl_cv_func_malloc_posix = yes; then
-    HAVE_MALLOC_POSIX=1
     AC_DEFINE([HAVE_MALLOC_POSIX], [1],
       [Define if the 'malloc' function is POSIX compliant.])
   else
-    AC_LIBOBJ([malloc])
-    HAVE_MALLOC_POSIX=0
+    REPLACE_MALLOC=1
   fi
-  AC_SUBST([HAVE_MALLOC_POSIX])
 ])
 
 # Test whether malloc, realloc, calloc are POSIX compliant,
@@ -32,10 +85,14 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
       dnl It is too dangerous to try to allocate a large amount of memory:
       dnl some systems go to their knees when you do that. So assume that
       dnl all Unix implementations of the function are POSIX compliant.
-      AC_TRY_COMPILE([],
-        [#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-         choke me
-         #endif
-        ], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no])
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[]],
+           [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+             choke me
+             #endif
+            ]])],
+        [gl_cv_func_malloc_posix=yes],
+        [gl_cv_func_malloc_posix=no])
     ])
 ])
index 844a9ba2a07213fe89d135faef8448a225b618ce..864fc851982153d719fe4355912335f40dd5d5c8 100644 (file)
@@ -1,5 +1,5 @@
-# manywarnings.m4 serial 1
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# manywarnings.m4 serial 4
+dnl Copyright (C) 2008-2012 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.
@@ -30,79 +30,154 @@ AC_DEFUN([gl_MANYWARN_COMPLEMENT],
 
 # gl_MANYWARN_ALL_GCC(VARIABLE)
 # -----------------------------
-# Add all documented GCC (currently as per version 4.4) warning
-# parameters to variable VARIABLE.  Note that you need to test them
-# using gl_WARN_ADD if you want to make sure your gcc understands it.
+# Add all documented GCC warning parameters to variable VARIABLE.
+# Note that you need to test them using gl_WARN_ADD if you want to
+# make sure your gcc understands it.
 AC_DEFUN([gl_MANYWARN_ALL_GCC],
 [
- gl_manywarn_set=
- for gl_manywarn_item in \
-   -Wall \
-   -W \
-   -Wformat-y2k \
-   -Wformat-nonliteral \
-   -Wformat-security \
-   -Winit-self \
-   -Wmissing-include-dirs \
-   -Wswitch-default \
-   -Wswitch-enum \
-   -Wunused \
-   -Wunknown-pragmas \
-   -Wstrict-aliasing \
-   -Wstrict-overflow \
-   -Wsystem-headers \
-   -Wfloat-equal \
-   -Wtraditional \
-   -Wtraditional-conversion \
-   -Wdeclaration-after-statement \
-   -Wundef \
-   -Wshadow \
-   -Wunsafe-loop-optimizations \
-   -Wpointer-arith \
-   -Wbad-function-cast \
-   -Wc++-compat \
-   -Wcast-qual \
-   -Wcast-align \
-   -Wwrite-strings \
-   -Wconversion \
-   -Wsign-conversion \
-   -Wlogical-op \
-   -Waggregate-return \
-   -Wstrict-prototypes \
-   -Wold-style-definition \
-   -Wmissing-prototypes \
-   -Wmissing-declarations \
-   -Wmissing-noreturn \
-   -Wmissing-format-attribute \
-   -Wpacked \
-   -Wpadded \
-   -Wredundant-decls \
-   -Wnested-externs \
-   -Wunreachable-code \
-   -Winline \
-   -Winvalid-pch \
-   -Wlong-long \
-   -Wvla \
-   -Wvolatile-register-var \
-   -Wdisabled-optimization \
-   -Wstack-protector \
-   -Woverlength-strings \
-   -Wbuiltin-macro-redefined \
-   -Wmudflap \
-   -Wpacked-bitfield-compat \
-   -Wsync-nand \
-  ; do
+  dnl First, check if -Wno-missing-field-initializers is needed.
+  dnl -Wmissing-field-initializers is implied by -W, but that issues
+  dnl warnings with GCC version before 4.7, for the common idiom
+  dnl of initializing types on the stack to zero, using { 0, }
+  AC_REQUIRE([AC_PROG_CC])
+  if test -n "$GCC"; then
+
+    dnl First, check -W -Werror -Wno-missing-field-initializers is supported
+    dnl with the current $CC $CFLAGS $CPPFLAGS.
+    AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported])
+    AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[]], [[]])],
+        [gl_cv_cc_nomfi_supported=yes],
+        [gl_cv_cc_nomfi_supported=no])
+      CFLAGS="$gl_save_CFLAGS"])
+    AC_MSG_RESULT([$gl_cv_cc_nomfi_supported])
+
+    if test "$gl_cv_cc_nomfi_supported" = yes; then
+      dnl Now check whether -Wno-missing-field-initializers is needed
+      dnl for the { 0, } construct.
+      AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed])
+      AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [
+        gl_save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS -W -Werror"
+        AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[void f (void)
+               {
+                 typedef struct { int a; int b; } s_t;
+                 s_t s1 = { 0, };
+               }
+             ]],
+             [[]])],
+          [gl_cv_cc_nomfi_needed=no],
+          [gl_cv_cc_nomfi_needed=yes])
+        CFLAGS="$gl_save_CFLAGS"
+      ])
+      AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
+    fi
+  fi
+
+  gl_manywarn_set=
+  for gl_manywarn_item in \
+    -Wall \
+    -W \
+    -Wformat-y2k \
+    -Wformat-nonliteral \
+    -Wformat-security \
+    -Winit-self \
+    -Wmissing-include-dirs \
+    -Wswitch-default \
+    -Wswitch-enum \
+    -Wunused \
+    -Wunknown-pragmas \
+    -Wstrict-aliasing \
+    -Wstrict-overflow \
+    -Wsystem-headers \
+    -Wfloat-equal \
+    -Wtraditional \
+    -Wtraditional-conversion \
+    -Wdeclaration-after-statement \
+    -Wundef \
+    -Wshadow \
+    -Wunsafe-loop-optimizations \
+    -Wpointer-arith \
+    -Wbad-function-cast \
+    -Wc++-compat \
+    -Wcast-qual \
+    -Wcast-align \
+    -Wwrite-strings \
+    -Wconversion \
+    -Wsign-conversion \
+    -Wlogical-op \
+    -Waggregate-return \
+    -Wstrict-prototypes \
+    -Wold-style-definition \
+    -Wmissing-prototypes \
+    -Wmissing-declarations \
+    -Wmissing-noreturn \
+    -Wmissing-format-attribute \
+    -Wpacked \
+    -Wpadded \
+    -Wredundant-decls \
+    -Wnested-externs \
+    -Wunreachable-code \
+    -Winline \
+    -Winvalid-pch \
+    -Wlong-long \
+    -Wvla \
+    -Wvolatile-register-var \
+    -Wdisabled-optimization \
+    -Wstack-protector \
+    -Woverlength-strings \
+    -Wbuiltin-macro-redefined \
+    -Wmudflap \
+    -Wpacked-bitfield-compat \
+    -Wsync-nand \
+    ; do
     gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
   done
- # The following are not documented in the manual but are included in
- # output from gcc --help=warnings.
- for gl_manywarn_item in \
-   -Wattributes \
-   -Wcoverage-mismatch \
-   -Wmultichar \
-   -Wunused-macros \
-  ; do
+  # The following are not documented in the manual but are included in
+  # output from gcc --help=warnings.
+  for gl_manywarn_item in \
+    -Wattributes \
+    -Wcoverage-mismatch \
+    -Wunused-macros \
+    ; do
     gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
   done
+  # More warnings from gcc 4.6.2 --help=warnings.
+  for gl_manywarn_item in \
+    -Wabi \
+    -Wcpp \
+    -Wdeprecated \
+    -Wdeprecated-declarations \
+    -Wdiv-by-zero \
+    -Wdouble-promotion \
+    -Wendif-labels \
+    -Wextra \
+    -Wformat-contains-nul \
+    -Wformat-extra-args \
+    -Wformat-zero-length \
+    -Wformat=2 \
+    -Wmultichar \
+    -Wnormalized=nfc \
+    -Woverflow \
+    -Wpointer-to-int-cast \
+    -Wpragmas \
+    -Wsuggest-attribute=const \
+    -Wsuggest-attribute=noreturn \
+    -Wsuggest-attribute=pure \
+    -Wtrampolines \
+    ; do
+    gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
+  done
+
+  # Disable the missing-field-initializers warning if needed
+  if test "$gl_cv_cc_nomfi_needed" = yes; then
+    gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
+  fi
+
   $1=$gl_manywarn_set
 ])
index 1e4c4803c713bfbe6dee2b4490579f9c6c9d7cf3..90d248aeccf93a421b545e90523db95be01d1d36 100644 (file)
@@ -1,5 +1,5 @@
-# math_h.m4 serial 16
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# math_h.m4 serial 113
+dnl Copyright (C) 2007-2012 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.
@@ -35,88 +35,320 @@ AC_DEFUN([gl_MATH_H],
   if test $gl_cv_header_math_huge_val_works = no; then
     REPLACE_HUGE_VAL=1
   fi
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <math.h>]],
+    [acosf acosl asinf asinl atanf atanl
+     cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf
+     expf expl exp2 exp2f exp2l expm1 expm1f expm1l
+     fabsf fabsl floorf floorl fma fmaf fmal
+     fmod fmodf fmodl frexpf frexpl hypotf hypotl
+     ilogb ilogbf ilogbl
+     ldexpf ldexpl
+     log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
+     logb logbf logbl
+     modf modff modfl powf
+     remainder remainderf remainderl
+     rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl
+     tanf tanl tanhf trunc truncf truncl])
 ])
 
 AC_DEFUN([gl_MATH_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_MATH_H_DEFAULTS],
 [
-  GNULIB_ACOSL=0;    AC_SUBST([GNULIB_ACOSL])
-  GNULIB_ASINL=0;    AC_SUBST([GNULIB_ASINL])
-  GNULIB_ATANL=0;    AC_SUBST([GNULIB_ATANL])
-  GNULIB_CEILF=0;    AC_SUBST([GNULIB_CEILF])
-  GNULIB_CEILL=0;    AC_SUBST([GNULIB_CEILL])
-  GNULIB_COSL=0;     AC_SUBST([GNULIB_COSL])
-  GNULIB_EXPL=0;     AC_SUBST([GNULIB_EXPL])
-  GNULIB_FLOORF=0;   AC_SUBST([GNULIB_FLOORF])
-  GNULIB_FLOORL=0;   AC_SUBST([GNULIB_FLOORL])
-  GNULIB_FREXP=0;    AC_SUBST([GNULIB_FREXP])
-  GNULIB_FREXPL=0;   AC_SUBST([GNULIB_FREXPL])
-  GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE])
-  GNULIB_ISINF=0;    AC_SUBST([GNULIB_ISINF])
-  GNULIB_ISNAN=0;    AC_SUBST([GNULIB_ISNAN])
-  GNULIB_ISNANF=0;   AC_SUBST([GNULIB_ISNANF])
-  GNULIB_ISNAND=0;   AC_SUBST([GNULIB_ISNAND])
-  GNULIB_ISNANL=0;   AC_SUBST([GNULIB_ISNANL])
-  GNULIB_LDEXPL=0;   AC_SUBST([GNULIB_LDEXPL])
-  GNULIB_LOGL=0;     AC_SUBST([GNULIB_LOGL])
-  GNULIB_ROUND=0;    AC_SUBST([GNULIB_ROUND])
-  GNULIB_ROUNDF=0;   AC_SUBST([GNULIB_ROUNDF])
-  GNULIB_ROUNDL=0;   AC_SUBST([GNULIB_ROUNDL])
-  GNULIB_SIGNBIT=0;  AC_SUBST([GNULIB_SIGNBIT])
-  GNULIB_SINL=0;     AC_SUBST([GNULIB_SINL])
-  GNULIB_SQRTL=0;    AC_SUBST([GNULIB_SQRTL])
-  GNULIB_TANL=0;     AC_SUBST([GNULIB_TANL])
-  GNULIB_TRUNC=0;    AC_SUBST([GNULIB_TRUNC])
-  GNULIB_TRUNCF=0;   AC_SUBST([GNULIB_TRUNCF])
-  GNULIB_TRUNCL=0;   AC_SUBST([GNULIB_TRUNCL])
+  GNULIB_ACOSF=0;      AC_SUBST([GNULIB_ACOSF])
+  GNULIB_ACOSL=0;      AC_SUBST([GNULIB_ACOSL])
+  GNULIB_ASINF=0;      AC_SUBST([GNULIB_ASINF])
+  GNULIB_ASINL=0;      AC_SUBST([GNULIB_ASINL])
+  GNULIB_ATANF=0;      AC_SUBST([GNULIB_ATANF])
+  GNULIB_ATANL=0;      AC_SUBST([GNULIB_ATANL])
+  GNULIB_ATAN2F=0;     AC_SUBST([GNULIB_ATAN2F])
+  GNULIB_CBRT=0;       AC_SUBST([GNULIB_CBRT])
+  GNULIB_CBRTF=0;      AC_SUBST([GNULIB_CBRTF])
+  GNULIB_CBRTL=0;      AC_SUBST([GNULIB_CBRTL])
+  GNULIB_CEIL=0;       AC_SUBST([GNULIB_CEIL])
+  GNULIB_CEILF=0;      AC_SUBST([GNULIB_CEILF])
+  GNULIB_CEILL=0;      AC_SUBST([GNULIB_CEILL])
+  GNULIB_COPYSIGN=0;   AC_SUBST([GNULIB_COPYSIGN])
+  GNULIB_COPYSIGNF=0;  AC_SUBST([GNULIB_COPYSIGNF])
+  GNULIB_COPYSIGNL=0;  AC_SUBST([GNULIB_COPYSIGNL])
+  GNULIB_COSF=0;       AC_SUBST([GNULIB_COSF])
+  GNULIB_COSL=0;       AC_SUBST([GNULIB_COSL])
+  GNULIB_COSHF=0;      AC_SUBST([GNULIB_COSHF])
+  GNULIB_EXPF=0;       AC_SUBST([GNULIB_EXPF])
+  GNULIB_EXPL=0;       AC_SUBST([GNULIB_EXPL])
+  GNULIB_EXP2=0;       AC_SUBST([GNULIB_EXP2])
+  GNULIB_EXP2F=0;      AC_SUBST([GNULIB_EXP2F])
+  GNULIB_EXP2L=0;      AC_SUBST([GNULIB_EXP2L])
+  GNULIB_EXPM1=0;      AC_SUBST([GNULIB_EXPM1])
+  GNULIB_EXPM1F=0;     AC_SUBST([GNULIB_EXPM1F])
+  GNULIB_EXPM1L=0;     AC_SUBST([GNULIB_EXPM1L])
+  GNULIB_FABSF=0;      AC_SUBST([GNULIB_FABSF])
+  GNULIB_FABSL=0;      AC_SUBST([GNULIB_FABSL])
+  GNULIB_FLOOR=0;      AC_SUBST([GNULIB_FLOOR])
+  GNULIB_FLOORF=0;     AC_SUBST([GNULIB_FLOORF])
+  GNULIB_FLOORL=0;     AC_SUBST([GNULIB_FLOORL])
+  GNULIB_FMA=0;        AC_SUBST([GNULIB_FMA])
+  GNULIB_FMAF=0;       AC_SUBST([GNULIB_FMAF])
+  GNULIB_FMAL=0;       AC_SUBST([GNULIB_FMAL])
+  GNULIB_FMOD=0;       AC_SUBST([GNULIB_FMOD])
+  GNULIB_FMODF=0;      AC_SUBST([GNULIB_FMODF])
+  GNULIB_FMODL=0;      AC_SUBST([GNULIB_FMODL])
+  GNULIB_FREXPF=0;     AC_SUBST([GNULIB_FREXPF])
+  GNULIB_FREXP=0;      AC_SUBST([GNULIB_FREXP])
+  GNULIB_FREXPL=0;     AC_SUBST([GNULIB_FREXPL])
+  GNULIB_HYPOT=0;      AC_SUBST([GNULIB_HYPOT])
+  GNULIB_HYPOTF=0;     AC_SUBST([GNULIB_HYPOTF])
+  GNULIB_HYPOTL=0;     AC_SUBST([GNULIB_HYPOTL])
+  GNULIB_ILOGB=0;      AC_SUBST([GNULIB_ILOGB])
+  GNULIB_ILOGBF=0;     AC_SUBST([GNULIB_ILOGBF])
+  GNULIB_ILOGBL=0;     AC_SUBST([GNULIB_ILOGBL])
+  GNULIB_ISFINITE=0;   AC_SUBST([GNULIB_ISFINITE])
+  GNULIB_ISINF=0;      AC_SUBST([GNULIB_ISINF])
+  GNULIB_ISNAN=0;      AC_SUBST([GNULIB_ISNAN])
+  GNULIB_ISNANF=0;     AC_SUBST([GNULIB_ISNANF])
+  GNULIB_ISNAND=0;     AC_SUBST([GNULIB_ISNAND])
+  GNULIB_ISNANL=0;     AC_SUBST([GNULIB_ISNANL])
+  GNULIB_LDEXPF=0;     AC_SUBST([GNULIB_LDEXPF])
+  GNULIB_LDEXPL=0;     AC_SUBST([GNULIB_LDEXPL])
+  GNULIB_LOG=0;        AC_SUBST([GNULIB_LOG])
+  GNULIB_LOGF=0;       AC_SUBST([GNULIB_LOGF])
+  GNULIB_LOGL=0;       AC_SUBST([GNULIB_LOGL])
+  GNULIB_LOG10=0;      AC_SUBST([GNULIB_LOG10])
+  GNULIB_LOG10F=0;     AC_SUBST([GNULIB_LOG10F])
+  GNULIB_LOG10L=0;     AC_SUBST([GNULIB_LOG10L])
+  GNULIB_LOG1P=0;      AC_SUBST([GNULIB_LOG1P])
+  GNULIB_LOG1PF=0;     AC_SUBST([GNULIB_LOG1PF])
+  GNULIB_LOG1PL=0;     AC_SUBST([GNULIB_LOG1PL])
+  GNULIB_LOG2=0;       AC_SUBST([GNULIB_LOG2])
+  GNULIB_LOG2F=0;      AC_SUBST([GNULIB_LOG2F])
+  GNULIB_LOG2L=0;      AC_SUBST([GNULIB_LOG2L])
+  GNULIB_LOGB=0;       AC_SUBST([GNULIB_LOGB])
+  GNULIB_LOGBF=0;      AC_SUBST([GNULIB_LOGBF])
+  GNULIB_LOGBL=0;      AC_SUBST([GNULIB_LOGBL])
+  GNULIB_MODF=0;       AC_SUBST([GNULIB_MODF])
+  GNULIB_MODFF=0;      AC_SUBST([GNULIB_MODFF])
+  GNULIB_MODFL=0;      AC_SUBST([GNULIB_MODFL])
+  GNULIB_POWF=0;       AC_SUBST([GNULIB_POWF])
+  GNULIB_REMAINDER=0;  AC_SUBST([GNULIB_REMAINDER])
+  GNULIB_REMAINDERF=0; AC_SUBST([GNULIB_REMAINDERF])
+  GNULIB_REMAINDERL=0; AC_SUBST([GNULIB_REMAINDERL])
+  GNULIB_RINT=0;       AC_SUBST([GNULIB_RINT])
+  GNULIB_RINTF=0;      AC_SUBST([GNULIB_RINTF])
+  GNULIB_RINTL=0;      AC_SUBST([GNULIB_RINTL])
+  GNULIB_ROUND=0;      AC_SUBST([GNULIB_ROUND])
+  GNULIB_ROUNDF=0;     AC_SUBST([GNULIB_ROUNDF])
+  GNULIB_ROUNDL=0;     AC_SUBST([GNULIB_ROUNDL])
+  GNULIB_SIGNBIT=0;    AC_SUBST([GNULIB_SIGNBIT])
+  GNULIB_SINF=0;       AC_SUBST([GNULIB_SINF])
+  GNULIB_SINL=0;       AC_SUBST([GNULIB_SINL])
+  GNULIB_SINHF=0;      AC_SUBST([GNULIB_SINHF])
+  GNULIB_SQRTF=0;      AC_SUBST([GNULIB_SQRTF])
+  GNULIB_SQRTL=0;      AC_SUBST([GNULIB_SQRTL])
+  GNULIB_TANF=0;       AC_SUBST([GNULIB_TANF])
+  GNULIB_TANL=0;       AC_SUBST([GNULIB_TANL])
+  GNULIB_TANHF=0;      AC_SUBST([GNULIB_TANHF])
+  GNULIB_TRUNC=0;      AC_SUBST([GNULIB_TRUNC])
+  GNULIB_TRUNCF=0;     AC_SUBST([GNULIB_TRUNCF])
+  GNULIB_TRUNCL=0;     AC_SUBST([GNULIB_TRUNCL])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_ACOSF=1;                AC_SUBST([HAVE_ACOSF])
   HAVE_ACOSL=1;                AC_SUBST([HAVE_ACOSL])
+  HAVE_ASINF=1;                AC_SUBST([HAVE_ASINF])
   HAVE_ASINL=1;                AC_SUBST([HAVE_ASINL])
+  HAVE_ATANF=1;                AC_SUBST([HAVE_ATANF])
   HAVE_ATANL=1;                AC_SUBST([HAVE_ATANL])
+  HAVE_ATAN2F=1;               AC_SUBST([HAVE_ATAN2F])
+  HAVE_CBRT=1;                 AC_SUBST([HAVE_CBRT])
+  HAVE_CBRTF=1;                AC_SUBST([HAVE_CBRTF])
+  HAVE_CBRTL=1;                AC_SUBST([HAVE_CBRTL])
+  HAVE_COPYSIGN=1;             AC_SUBST([HAVE_COPYSIGN])
+  HAVE_COPYSIGNL=1;            AC_SUBST([HAVE_COPYSIGNL])
+  HAVE_COSF=1;                 AC_SUBST([HAVE_COSF])
   HAVE_COSL=1;                 AC_SUBST([HAVE_COSL])
+  HAVE_COSHF=1;                AC_SUBST([HAVE_COSHF])
+  HAVE_EXPF=1;                 AC_SUBST([HAVE_EXPF])
   HAVE_EXPL=1;                 AC_SUBST([HAVE_EXPL])
+  HAVE_EXPM1=1;                AC_SUBST([HAVE_EXPM1])
+  HAVE_EXPM1F=1;               AC_SUBST([HAVE_EXPM1F])
+  HAVE_FABSF=1;                AC_SUBST([HAVE_FABSF])
+  HAVE_FABSL=1;                AC_SUBST([HAVE_FABSL])
+  HAVE_FMA=1;                  AC_SUBST([HAVE_FMA])
+  HAVE_FMAF=1;                 AC_SUBST([HAVE_FMAF])
+  HAVE_FMAL=1;                 AC_SUBST([HAVE_FMAL])
+  HAVE_FMODF=1;                AC_SUBST([HAVE_FMODF])
+  HAVE_FMODL=1;                AC_SUBST([HAVE_FMODL])
+  HAVE_FREXPF=1;               AC_SUBST([HAVE_FREXPF])
+  HAVE_HYPOTF=1;               AC_SUBST([HAVE_HYPOTF])
+  HAVE_HYPOTL=1;               AC_SUBST([HAVE_HYPOTL])
+  HAVE_ILOGB=1;                AC_SUBST([HAVE_ILOGB])
+  HAVE_ILOGBF=1;               AC_SUBST([HAVE_ILOGBF])
+  HAVE_ILOGBL=1;               AC_SUBST([HAVE_ILOGBL])
   HAVE_ISNANF=1;               AC_SUBST([HAVE_ISNANF])
   HAVE_ISNAND=1;               AC_SUBST([HAVE_ISNAND])
   HAVE_ISNANL=1;               AC_SUBST([HAVE_ISNANL])
+  HAVE_LDEXPF=1;               AC_SUBST([HAVE_LDEXPF])
+  HAVE_LOGF=1;                 AC_SUBST([HAVE_LOGF])
   HAVE_LOGL=1;                 AC_SUBST([HAVE_LOGL])
+  HAVE_LOG10F=1;               AC_SUBST([HAVE_LOG10F])
+  HAVE_LOG10L=1;               AC_SUBST([HAVE_LOG10L])
+  HAVE_LOG1P=1;                AC_SUBST([HAVE_LOG1P])
+  HAVE_LOG1PF=1;               AC_SUBST([HAVE_LOG1PF])
+  HAVE_LOG1PL=1;               AC_SUBST([HAVE_LOG1PL])
+  HAVE_LOGBF=1;                AC_SUBST([HAVE_LOGBF])
+  HAVE_LOGBL=1;                AC_SUBST([HAVE_LOGBL])
+  HAVE_MODFF=1;                AC_SUBST([HAVE_MODFF])
+  HAVE_MODFL=1;                AC_SUBST([HAVE_MODFL])
+  HAVE_POWF=1;                 AC_SUBST([HAVE_POWF])
+  HAVE_REMAINDER=1;            AC_SUBST([HAVE_REMAINDER])
+  HAVE_REMAINDERF=1;           AC_SUBST([HAVE_REMAINDERF])
+  HAVE_RINT=1;                 AC_SUBST([HAVE_RINT])
+  HAVE_RINTL=1;                AC_SUBST([HAVE_RINTL])
+  HAVE_SINF=1;                 AC_SUBST([HAVE_SINF])
   HAVE_SINL=1;                 AC_SUBST([HAVE_SINL])
+  HAVE_SINHF=1;                AC_SUBST([HAVE_SINHF])
+  HAVE_SQRTF=1;                AC_SUBST([HAVE_SQRTF])
   HAVE_SQRTL=1;                AC_SUBST([HAVE_SQRTL])
+  HAVE_TANF=1;                 AC_SUBST([HAVE_TANF])
   HAVE_TANL=1;                 AC_SUBST([HAVE_TANL])
+  HAVE_TANHF=1;                AC_SUBST([HAVE_TANHF])
   HAVE_DECL_ACOSL=1;           AC_SUBST([HAVE_DECL_ACOSL])
   HAVE_DECL_ASINL=1;           AC_SUBST([HAVE_DECL_ASINL])
   HAVE_DECL_ATANL=1;           AC_SUBST([HAVE_DECL_ATANL])
+  HAVE_DECL_CBRTF=1;           AC_SUBST([HAVE_DECL_CBRTF])
+  HAVE_DECL_CBRTL=1;           AC_SUBST([HAVE_DECL_CBRTL])
+  HAVE_DECL_CEILF=1;           AC_SUBST([HAVE_DECL_CEILF])
+  HAVE_DECL_CEILL=1;           AC_SUBST([HAVE_DECL_CEILL])
+  HAVE_DECL_COPYSIGNF=1;       AC_SUBST([HAVE_DECL_COPYSIGNF])
   HAVE_DECL_COSL=1;            AC_SUBST([HAVE_DECL_COSL])
   HAVE_DECL_EXPL=1;            AC_SUBST([HAVE_DECL_EXPL])
+  HAVE_DECL_EXP2=1;            AC_SUBST([HAVE_DECL_EXP2])
+  HAVE_DECL_EXP2F=1;           AC_SUBST([HAVE_DECL_EXP2F])
+  HAVE_DECL_EXP2L=1;           AC_SUBST([HAVE_DECL_EXP2L])
+  HAVE_DECL_EXPM1L=1;          AC_SUBST([HAVE_DECL_EXPM1L])
+  HAVE_DECL_FLOORF=1;          AC_SUBST([HAVE_DECL_FLOORF])
+  HAVE_DECL_FLOORL=1;          AC_SUBST([HAVE_DECL_FLOORL])
   HAVE_DECL_FREXPL=1;          AC_SUBST([HAVE_DECL_FREXPL])
   HAVE_DECL_LDEXPL=1;          AC_SUBST([HAVE_DECL_LDEXPL])
   HAVE_DECL_LOGL=1;            AC_SUBST([HAVE_DECL_LOGL])
+  HAVE_DECL_LOG10L=1;          AC_SUBST([HAVE_DECL_LOG10L])
+  HAVE_DECL_LOG2=1;            AC_SUBST([HAVE_DECL_LOG2])
+  HAVE_DECL_LOG2F=1;           AC_SUBST([HAVE_DECL_LOG2F])
+  HAVE_DECL_LOG2L=1;           AC_SUBST([HAVE_DECL_LOG2L])
+  HAVE_DECL_LOGB=1;            AC_SUBST([HAVE_DECL_LOGB])
+  HAVE_DECL_REMAINDER=1;       AC_SUBST([HAVE_DECL_REMAINDER])
+  HAVE_DECL_REMAINDERL=1;      AC_SUBST([HAVE_DECL_REMAINDERL])
+  HAVE_DECL_RINTF=1;           AC_SUBST([HAVE_DECL_RINTF])
+  HAVE_DECL_ROUND=1;           AC_SUBST([HAVE_DECL_ROUND])
+  HAVE_DECL_ROUNDF=1;          AC_SUBST([HAVE_DECL_ROUNDF])
+  HAVE_DECL_ROUNDL=1;          AC_SUBST([HAVE_DECL_ROUNDL])
   HAVE_DECL_SINL=1;            AC_SUBST([HAVE_DECL_SINL])
   HAVE_DECL_SQRTL=1;           AC_SUBST([HAVE_DECL_SQRTL])
   HAVE_DECL_TANL=1;            AC_SUBST([HAVE_DECL_TANL])
   HAVE_DECL_TRUNC=1;           AC_SUBST([HAVE_DECL_TRUNC])
   HAVE_DECL_TRUNCF=1;          AC_SUBST([HAVE_DECL_TRUNCF])
+  HAVE_DECL_TRUNCL=1;          AC_SUBST([HAVE_DECL_TRUNCL])
+  REPLACE_CBRTF=0;             AC_SUBST([REPLACE_CBRTF])
+  REPLACE_CBRTL=0;             AC_SUBST([REPLACE_CBRTL])
+  REPLACE_CEIL=0;              AC_SUBST([REPLACE_CEIL])
   REPLACE_CEILF=0;             AC_SUBST([REPLACE_CEILF])
   REPLACE_CEILL=0;             AC_SUBST([REPLACE_CEILL])
+  REPLACE_EXPM1=0;             AC_SUBST([REPLACE_EXPM1])
+  REPLACE_EXPM1F=0;            AC_SUBST([REPLACE_EXPM1F])
+  REPLACE_EXP2=0;              AC_SUBST([REPLACE_EXP2])
+  REPLACE_EXP2L=0;             AC_SUBST([REPLACE_EXP2L])
+  REPLACE_FABSL=0;             AC_SUBST([REPLACE_FABSL])
+  REPLACE_FLOOR=0;             AC_SUBST([REPLACE_FLOOR])
   REPLACE_FLOORF=0;            AC_SUBST([REPLACE_FLOORF])
   REPLACE_FLOORL=0;            AC_SUBST([REPLACE_FLOORL])
+  REPLACE_FMA=0;               AC_SUBST([REPLACE_FMA])
+  REPLACE_FMAF=0;              AC_SUBST([REPLACE_FMAF])
+  REPLACE_FMAL=0;              AC_SUBST([REPLACE_FMAL])
+  REPLACE_FMOD=0;              AC_SUBST([REPLACE_FMOD])
+  REPLACE_FMODF=0;             AC_SUBST([REPLACE_FMODF])
+  REPLACE_FMODL=0;             AC_SUBST([REPLACE_FMODL])
+  REPLACE_FREXPF=0;            AC_SUBST([REPLACE_FREXPF])
   REPLACE_FREXP=0;             AC_SUBST([REPLACE_FREXP])
   REPLACE_FREXPL=0;            AC_SUBST([REPLACE_FREXPL])
   REPLACE_HUGE_VAL=0;          AC_SUBST([REPLACE_HUGE_VAL])
+  REPLACE_HYPOT=0;             AC_SUBST([REPLACE_HYPOT])
+  REPLACE_HYPOTF=0;            AC_SUBST([REPLACE_HYPOTF])
+  REPLACE_HYPOTL=0;            AC_SUBST([REPLACE_HYPOTL])
+  REPLACE_ILOGB=0;             AC_SUBST([REPLACE_ILOGB])
+  REPLACE_ILOGBF=0;            AC_SUBST([REPLACE_ILOGBF])
   REPLACE_ISFINITE=0;          AC_SUBST([REPLACE_ISFINITE])
   REPLACE_ISINF=0;             AC_SUBST([REPLACE_ISINF])
   REPLACE_ISNAN=0;             AC_SUBST([REPLACE_ISNAN])
   REPLACE_LDEXPL=0;            AC_SUBST([REPLACE_LDEXPL])
+  REPLACE_LOG=0;               AC_SUBST([REPLACE_LOG])
+  REPLACE_LOGF=0;              AC_SUBST([REPLACE_LOGF])
+  REPLACE_LOGL=0;              AC_SUBST([REPLACE_LOGL])
+  REPLACE_LOG10=0;             AC_SUBST([REPLACE_LOG10])
+  REPLACE_LOG10F=0;            AC_SUBST([REPLACE_LOG10F])
+  REPLACE_LOG10L=0;            AC_SUBST([REPLACE_LOG10L])
+  REPLACE_LOG1P=0;             AC_SUBST([REPLACE_LOG1P])
+  REPLACE_LOG1PF=0;            AC_SUBST([REPLACE_LOG1PF])
+  REPLACE_LOG1PL=0;            AC_SUBST([REPLACE_LOG1PL])
+  REPLACE_LOG2=0;              AC_SUBST([REPLACE_LOG2])
+  REPLACE_LOG2F=0;             AC_SUBST([REPLACE_LOG2F])
+  REPLACE_LOG2L=0;             AC_SUBST([REPLACE_LOG2L])
+  REPLACE_LOGB=0;              AC_SUBST([REPLACE_LOGB])
+  REPLACE_LOGBF=0;             AC_SUBST([REPLACE_LOGBF])
+  REPLACE_LOGBL=0;             AC_SUBST([REPLACE_LOGBL])
+  REPLACE_MODF=0;              AC_SUBST([REPLACE_MODF])
+  REPLACE_MODFF=0;             AC_SUBST([REPLACE_MODFF])
+  REPLACE_MODFL=0;             AC_SUBST([REPLACE_MODFL])
   REPLACE_NAN=0;               AC_SUBST([REPLACE_NAN])
+  REPLACE_REMAINDER=0;         AC_SUBST([REPLACE_REMAINDER])
+  REPLACE_REMAINDERF=0;        AC_SUBST([REPLACE_REMAINDERF])
+  REPLACE_REMAINDERL=0;        AC_SUBST([REPLACE_REMAINDERL])
   REPLACE_ROUND=0;             AC_SUBST([REPLACE_ROUND])
   REPLACE_ROUNDF=0;            AC_SUBST([REPLACE_ROUNDF])
   REPLACE_ROUNDL=0;            AC_SUBST([REPLACE_ROUNDL])
   REPLACE_SIGNBIT=0;           AC_SUBST([REPLACE_SIGNBIT])
   REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
+  REPLACE_SQRTL=0;             AC_SUBST([REPLACE_SQRTL])
+  REPLACE_TRUNC=0;             AC_SUBST([REPLACE_TRUNC])
+  REPLACE_TRUNCF=0;            AC_SUBST([REPLACE_TRUNCF])
   REPLACE_TRUNCL=0;            AC_SUBST([REPLACE_TRUNCL])
 ])
+
+# gl_LONG_DOUBLE_VS_DOUBLE
+# determines whether 'long double' and 'double' have the same representation.
+# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
+# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
+# The currently known platforms where this is the case are:
+# Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
+AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
+[
+  AC_CACHE_CHECK([whether long double and double are the same],
+    [gl_cv_long_double_equals_double],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[#include <float.h>]],
+          [[typedef int check[sizeof (long double) == sizeof (double)
+                              && LDBL_MANT_DIG == DBL_MANT_DIG
+                              && LDBL_MAX_EXP == DBL_MAX_EXP
+                              && LDBL_MIN_EXP == DBL_MIN_EXP
+                              ? 1 : -1];
+          ]])],
+       [gl_cv_long_double_equals_double=yes],
+       [gl_cv_long_double_equals_double=no])
+    ])
+  if test $gl_cv_long_double_equals_double = yes; then
+    AC_DEFINE([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE], [1],
+      [Define to 1 if 'long double' and 'double' have the same representation.])
+    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
+  else
+    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
+  fi
+  AC_SUBST([HAVE_SAME_LONG_DOUBLE_AS_DOUBLE])
+])
index 9ec93f561575d64d89959130279d6f90154bf0f3..8f829c8ea59b550d22bca5d66ab089218a4ce587 100644 (file)
@@ -1,5 +1,5 @@
-# mbrtowc.m4 serial 16
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2010 Free Software Foundation,
+# mbrtowc.m4 serial 25
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2012 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,43 +11,63 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
 
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   gl_MBSTATE_T_BROKEN
-  if test $REPLACE_MBSTATE_T = 1; then
-    REPLACE_MBRTOWC=1
-  fi
+
   AC_CHECK_FUNCS_ONCE([mbrtowc])
   if test $ac_cv_func_mbrtowc = no; then
     HAVE_MBRTOWC=0
-  fi
-  if test $HAVE_MBRTOWC != 0 && test $REPLACE_MBRTOWC != 1; then
-    gl_MBRTOWC_NULL_ARG
-    gl_MBRTOWC_RETVAL
-    gl_MBRTOWC_NUL_RETVAL
-    case "$gl_cv_func_mbrtowc_null_arg" in
-      *yes) ;;
-      *) AC_DEFINE([MBRTOWC_NULL_ARG_BUG], [1],
-           [Define if the mbrtowc function has the NULL string argument bug.])
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
-    case "$gl_cv_func_mbrtowc_retval" in
-      *yes) ;;
-      *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1],
-           [Define if the mbrtowc function returns a wrong return value.])
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
-    case "$gl_cv_func_mbrtowc_nul_retval" in
-      *yes) ;;
-      *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1],
-           [Define if the mbrtowc function does not return 0 for a NUL character.])
-         REPLACE_MBRTOWC=1
-         ;;
-    esac
-  fi
-  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
-    gl_REPLACE_WCHAR_H
-    AC_LIBOBJ([mbrtowc])
-    gl_PREREQ_MBRTOWC
+    AC_CHECK_DECLS([mbrtowc],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_mbrtowc = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> declares mbrtowc() although
+      dnl it does not have the function. Avoid a collision with gnulib's
+      dnl replacement.
+      REPLACE_MBRTOWC=1
+    fi
+  else
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_MBRTOWC=1
+    else
+      gl_MBRTOWC_NULL_ARG1
+      gl_MBRTOWC_NULL_ARG2
+      gl_MBRTOWC_RETVAL
+      gl_MBRTOWC_NUL_RETVAL
+      case "$gl_cv_func_mbrtowc_null_arg1" in
+        *yes) ;;
+        *) AC_DEFINE([MBRTOWC_NULL_ARG1_BUG], [1],
+             [Define if the mbrtowc function has the NULL pwc argument bug.])
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_null_arg2" in
+        *yes) ;;
+        *) AC_DEFINE([MBRTOWC_NULL_ARG2_BUG], [1],
+             [Define if the mbrtowc function has the NULL string argument bug.])
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_retval" in
+        *yes) ;;
+        *) AC_DEFINE([MBRTOWC_RETVAL_BUG], [1],
+             [Define if the mbrtowc function returns a wrong return value.])
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_nul_retval" in
+        *yes) ;;
+        *) AC_DEFINE([MBRTOWC_NUL_RETVAL_BUG], [1],
+             [Define if the mbrtowc function does not return 0 for a NUL character.])
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+    fi
   fi
 ])
 
@@ -79,9 +99,6 @@ AC_DEFUN([gl_MBSTATE_T_BROKEN],
   else
     REPLACE_MBSTATE_T=1
   fi
-  if test $REPLACE_MBSTATE_T = 1; then
-    gl_REPLACE_WCHAR_H
-  fi
 ])
 
 dnl Test whether mbrtowc puts the state into non-initial state when parsing an
@@ -100,16 +117,24 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
       dnl is present.
 changequote(,)dnl
       case "$host_os" in
-              # Guess no on AIX and OSF/1.
-        osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
-              # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+                     # Guess no on AIX and OSF/1.
+        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+                     # Guess yes otherwise.
+        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
       esac
 changequote([,])dnl
       if test $LOCALE_JA != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -125,7 +150,7 @@ int main ()
           return 1;
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrtowc_incomplete_state=yes],
           [gl_cv_func_mbrtowc_incomplete_state=no],
           [:])
@@ -155,10 +180,18 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_ZH_CN != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
 #include <locale.h>
 #include <stdlib.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -177,7 +210,7 @@ int main ()
         return 1;
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrtowc_sanitycheck=yes],
           [gl_cv_func_mbrtowc_sanitycheck=no],
           [:])
@@ -185,31 +218,109 @@ int main ()
     ])
 ])
 
+dnl Test whether mbrtowc supports a NULL pwc argument correctly.
+dnl Result is gl_cv_func_mbrtowc_null_arg1.
+
+AC_DEFUN([gl_MBRTOWC_NULL_ARG1],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([gt_LOCALE_FR_UTF8])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CACHE_CHECK([whether mbrtowc handles a NULL pwc argument],
+    [gl_cv_func_mbrtowc_null_arg1],
+    [
+      dnl Initial guess, used when cross-compiling or when no suitable locale
+      dnl is present.
+changequote(,)dnl
+      case "$host_os" in
+                  # Guess no on Solaris.
+        solaris*) gl_cv_func_mbrtowc_null_arg1="guessing no" ;;
+                  # Guess yes otherwise.
+        *)        gl_cv_func_mbrtowc_null_arg1="guessing yes" ;;
+      esac
+changequote([,])dnl
+      if test $LOCALE_FR_UTF8 != none; then
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int main ()
+{
+  int result = 0;
+
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      char input[] = "\303\237er";
+      mbstate_t state;
+      wchar_t wc;
+      size_t ret;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      wc = (wchar_t) 0xBADFACE;
+      ret = mbrtowc (&wc, input, 5, &state);
+      if (ret != 2)
+        result |= 1;
+      if (!mbsinit (&state))
+        result |= 2;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      ret = mbrtowc (NULL, input, 5, &state);
+      if (ret != 2) /* Solaris 7 fails here: ret is -1.  */
+        result |= 4;
+      if (!mbsinit (&state))
+        result |= 8;
+    }
+  return result;
+}]])],
+          [gl_cv_func_mbrtowc_null_arg1=yes],
+          [gl_cv_func_mbrtowc_null_arg1=no],
+          [:])
+      fi
+    ])
+])
+
 dnl Test whether mbrtowc supports a NULL string argument correctly.
-dnl Result is gl_cv_func_mbrtowc_null_arg.
+dnl Result is gl_cv_func_mbrtowc_null_arg2.
 
-AC_DEFUN([gl_MBRTOWC_NULL_ARG],
+AC_DEFUN([gl_MBRTOWC_NULL_ARG2],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([gt_LOCALE_FR_UTF8])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether mbrtowc handles a NULL string argument],
-    [gl_cv_func_mbrtowc_null_arg],
+    [gl_cv_func_mbrtowc_null_arg2],
     [
       dnl Initial guess, used when cross-compiling or when no suitable locale
       dnl is present.
 changequote(,)dnl
       case "$host_os" in
               # Guess no on OSF/1.
-        osf*) gl_cv_func_mbrtowc_null_arg="guessing no" ;;
+        osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
               # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_null_arg="guessing yes" ;;
+        *)    gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
       esac
 changequote([,])dnl
       if test $LOCALE_FR_UTF8 != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -227,7 +338,10 @@ int main ()
         return 1;
     }
   return 0;
-}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [:])
+}]])],
+          [gl_cv_func_mbrtowc_null_arg2=yes],
+          [gl_cv_func_mbrtowc_null_arg2=no],
+          [:])
       fi
     ])
 ])
@@ -242,7 +356,7 @@ AC_DEFUN([gl_MBRTOWC_RETVAL],
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([gt_LOCALE_FR_UTF8])
   AC_REQUIRE([gt_LOCALE_JA])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([AC_CANONICAL_HOST])
   AC_CACHE_CHECK([whether mbrtowc has a correct return value],
     [gl_cv_func_mbrtowc_retval],
     [
@@ -250,19 +364,30 @@ AC_DEFUN([gl_MBRTOWC_RETVAL],
       dnl is present.
 changequote(,)dnl
       case "$host_os" in
-                          # Guess no on HP-UX and Solaris.
-        hpux* | solaris*) gl_cv_func_mbrtowc_retval="guessing no" ;;
-                          # Guess yes otherwise.
-        *)                gl_cv_func_mbrtowc_retval="guessing yes" ;;
+                                   # Guess no on HP-UX, Solaris, native Windows.
+        hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;;
+                                   # Guess yes otherwise.
+        *)                         gl_cv_func_mbrtowc_retval="guessing yes" ;;
       esac
 changequote([,])dnl
-      if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none; then
-        AC_TRY_RUN([
+      if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
+         || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
+  int result = 0;
+  int found_some_locale = 0;
   /* This fails on Solaris.  */
   if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
     {
@@ -275,8 +400,9 @@ int main ()
         {
           input[1] = '\0';
           if (mbrtowc (&wc, input + 2, 5, &state) != 1)
-            return 1;
+            result |= 1;
         }
+      found_some_locale = 1;
     }
   /* This fails on HP-UX 11.11.  */
   if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
@@ -290,13 +416,63 @@ int main ()
         {
           input[1] = '\0';
           if (mbrtowc (&wc, input + 2, 5, &state) != 2)
-            return 1;
+            result |= 2;
         }
+      found_some_locale = 1;
     }
-  return 0;
-}],
+  /* This fails on native Windows.  */
+  if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+    {
+      char input[] = "<\223\372\226\173\214\352>"; /* "<日本語>" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+        {
+          input[3] = '\0';
+          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+            result |= 4;
+        }
+      found_some_locale = 1;
+    }
+  if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+    {
+      char input[] = "<\244\351\245\273\273\171>"; /* "<日本語>" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+        {
+          input[3] = '\0';
+          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+            result |= 8;
+        }
+      found_some_locale = 1;
+    }
+  if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+    {
+      char input[] = "<\310\325\261\276\325\132>"; /* "<日本語>" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 1, &state) == (size_t)(-2))
+        {
+          input[3] = '\0';
+          if (mbrtowc (&wc, input + 4, 4, &state) != 1)
+            result |= 16;
+        }
+      found_some_locale = 1;
+    }
+  return (found_some_locale ? result : 77);
+}]])],
           [gl_cv_func_mbrtowc_retval=yes],
-          [gl_cv_func_mbrtowc_retval=no],
+          [if test $? != 77; then
+             gl_cv_func_mbrtowc_retval=no
+           fi
+          ],
           [:])
       fi
     ])
@@ -324,9 +500,17 @@ changequote(,)dnl
       esac
 changequote([,])dnl
       if test $LOCALE_ZH_CN != none; then
-        AC_TRY_RUN([
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
 #include <locale.h>
 #include <string.h>
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
 #include <wchar.h>
 int main ()
 {
@@ -341,7 +525,7 @@ int main ()
         return 1;
     }
   return 0;
-}],
+}]])],
           [gl_cv_func_mbrtowc_nul_retval=yes],
           [gl_cv_func_mbrtowc_nul_retval=no],
           [:])
@@ -357,10 +541,8 @@ AC_DEFUN([gl_PREREQ_MBRTOWC], [
 
 dnl From Paul Eggert
 
-dnl This override of an autoconf macro can be removed when autoconf 2.60 or
-dnl newer can be assumed everywhere.
+dnl This is an override of an autoconf macro.
 
-m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.60]),[-1],[
 AC_DEFUN([AC_FUNC_MBRTOWC],
 [
   dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
@@ -368,7 +550,14 @@ AC_DEFUN([AC_FUNC_MBRTOWC],
     gl_cv_func_mbrtowc,
     [AC_LINK_IFELSE(
        [AC_LANG_PROGRAM(
-            [[#include <wchar.h>]],
+            [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+                 included before <wchar.h>.
+                 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+                 must be included before <wchar.h>.  */
+              #include <stddef.h>
+              #include <stdio.h>
+              #include <time.h>
+              #include <wchar.h>]],
             [[wchar_t wc;
               char const s[] = "";
               size_t n = 1;
@@ -381,4 +570,3 @@ AC_DEFUN([AC_FUNC_MBRTOWC],
       [Define to 1 if mbrtowc and mbstate_t are properly declared.])
   fi
 ])
-])
index 13907a516773e0dff5ae5dfac94ca7855a4ffdb2..da56c3d11b2a6b14ca5c7cf4213ef0cc3ecb5b3f 100644 (file)
@@ -1,5 +1,5 @@
-# mbsinit.m4 serial 3
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# mbsinit.m4 serial 8
+dnl Copyright (C) 2008, 2010-2012 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.
@@ -7,20 +7,41 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_MBSINIT],
 [
   AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST])
 
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   gl_MBSTATE_T_BROKEN
-  if test $REPLACE_MBSTATE_T = 1; then
-    REPLACE_MBSINIT=1
-  fi
+
   AC_CHECK_FUNCS_ONCE([mbsinit])
   if test $ac_cv_func_mbsinit = no; then
     HAVE_MBSINIT=0
-  fi
-  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
-    gl_REPLACE_WCHAR_H
-    AC_LIBOBJ([mbsinit])
-    gl_PREREQ_MBSINIT
+    AC_CHECK_DECLS([mbsinit],,, [[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_mbsinit = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although
+      dnl it does not have the function. Avoid a collision with gnulib's
+      dnl replacement.
+      REPLACE_MBSINIT=1
+    fi
+  else
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_MBSINIT=1
+    else
+      dnl On mingw, mbsinit() always returns 1, which is inappropriate for
+      dnl states produced by mbrtowc() for an incomplete multibyte character
+      dnl in multibyte locales.
+      case "$host_os" in
+        mingw*) REPLACE_MBSINIT=1 ;;
+      esac
+    fi
   fi
 ])
 
index 3e2df29f8aa13b71eb4038480ce3c85d25fdbb3c..61a8190ce757d506749da3dba92aed3bc8c5b758 100644 (file)
@@ -1,5 +1,5 @@
-# mbstate_t.m4 serial 12
-dnl Copyright (C) 2000-2002, 2008-2010 Free Software Foundation, Inc.
+# mbstate_t.m4 serial 13
+dnl Copyright (C) 2000-2002, 2008-2012 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.
@@ -20,7 +20,14 @@ AC_DEFUN([AC_TYPE_MBSTATE_T],
      [AC_COMPILE_IFELSE(
         [AC_LANG_PROGRAM(
            [AC_INCLUDES_DEFAULT[
-#           include <wchar.h>]],
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>]],
            [[mbstate_t x; return sizeof x;]])],
         [ac_cv_type_mbstate_t=yes],
         [ac_cv_type_mbstate_t=no])])
index 94596ef959a860c5dbba620109bb0341f99528e0..004029450f067a800a5e6bd3681803dc276a792f 100644 (file)
@@ -1,5 +1,5 @@
-# memchr.m4 serial 7
-dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc.
+# memchr.m4 serial 12
+dnl Copyright (C) 2002-2004, 2009-2012 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.
@@ -11,15 +11,16 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
   AC_CHECK_HEADERS_ONCE([sys/mman.h])
   AC_CHECK_FUNCS_ONCE([mprotect])
 
-  dnl These days, we assume memchr is present.  But just in case...
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  AC_REPLACE_FUNCS([memchr])
-  if test $ac_cv_func_memchr = no; then
-    gl_PREREQ_MEMCHR
-    REPLACE_MEMCHR=1
-  fi
-
-  if test $ac_cv_func_memchr = yes; then
+  m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [
+    dnl These days, we assume memchr is present.  But if support for old
+    dnl platforms is desired:
+    AC_CHECK_FUNCS_ONCE([memchr])
+    if test $ac_cv_func_memchr = no; then
+      HAVE_MEMCHR=0
+    fi
+  ])
+  if test $HAVE_MEMCHR = 1; then
     # Detect platform-specific bugs in some versions of glibc:
     # memchr should not dereference anything with length 0
     #   http://bugzilla.redhat.com/499689
@@ -40,6 +41,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
 # endif
 #endif
 ]], [[
+  int result = 0;
   char *fence = NULL;
 #if HAVE_SYS_MMAN_H && HAVE_MPROTECT
 # if HAVE_MAP_ANONYMOUS
@@ -63,19 +65,19 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
   if (fence)
     {
       if (memchr (fence, 0, 0))
-        return 1;
+        result |= 1;
       strcpy (fence - 9, "12345678");
       if (memchr (fence - 9, 0, 79) != fence - 1)
-        return 2;
+        result |= 2;
+      if (memchr (fence - 1, 0, 3) != fence - 1)
+        result |= 4;
     }
-  return 0;
+  return result;
 ]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no],
       [dnl Be pessimistic for now.
        gl_cv_func_memchr_works="guessing no"])])
     if test "$gl_cv_func_memchr_works" != yes; then
-      gl_PREREQ_MEMCHR
       REPLACE_MEMCHR=1
-      AC_LIBOBJ([memchr])
     fi
   fi
 ])
index 12df771e4c9937a3197eb151faffe30e98d9ffcb..c926941db438979081d5f1a6414207a78e95bb58 100644 (file)
@@ -1,5 +1,5 @@
-# mempcpy.m4 serial 10
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2010 Free Software Foundation,
+# mempcpy.m4 serial 11
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2012 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,10 +14,9 @@ AC_DEFUN([gl_FUNC_MEMPCPY],
   AC_REQUIRE([AC_C_RESTRICT])
 
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  AC_REPLACE_FUNCS([mempcpy])
+  AC_CHECK_FUNCS([mempcpy])
   if test $ac_cv_func_mempcpy = no; then
     HAVE_MEMPCPY=0
-    gl_PREREQ_MEMPCPY
   fi
 ])
 
index 57ed978a29f22744c175d2187f3b7aa9c6feaed6..3bcaf66889ea7b20fddcc3c9cd5407cc314f041b 100644 (file)
@@ -1,5 +1,5 @@
-# memrchr.m4 serial 9
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2010 Free Software Foundation,
+# memrchr.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2012 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -16,10 +16,7 @@ AC_DEFUN([gl_FUNC_MEMRCHR],
     HAVE_DECL_MEMRCHR=0
   fi
 
-  AC_REPLACE_FUNCS([memrchr])
-  if test $ac_cv_func_memrchr = no; then
-    gl_PREREQ_MEMRCHR
-  fi
+  AC_CHECK_FUNCS([memrchr])
 ])
 
 # Prerequisites of lib/memrchr.c.
diff --git a/m4/mkdir.m4 b/m4/mkdir.m4
deleted file mode 100644 (file)
index 87f5f21..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# serial 9
-
-# Copyright (C) 2001, 2003-2004, 2006, 2008-2010 Free Software Foundation, Inc.
-# This file 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.
-
-# On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
-# On others, mkdir ("foo/./", 0700) mistakenly succeeds.
-# On such systems, arrange to use a wrapper function.
-AC_DEFUN([gl_FUNC_MKDIR],
-[dnl
-  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
-  AC_CHECK_HEADERS_ONCE([unistd.h])
-  AC_CACHE_CHECK([whether mkdir handles trailing slash],
-    [gl_cv_func_mkdir_trailing_slash_works],
-    [rm -rf conftest.dir
-      AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#       include <sys/types.h>
-#       include <sys/stat.h>
-]], [return mkdir ("conftest.dir/", 0700);])],
-      [gl_cv_func_mkdir_trailing_slash_works=yes],
-      [gl_cv_func_mkdir_trailing_slash_works=no],
-      [gl_cv_func_mkdir_trailing_slash_works="guessing no"])
-    rm -rf conftest.dir
-    ]
-  )
-  if test "$gl_cv_func_mkdir_trailing_slash_works" != yes; then
-    REPLACE_MKDIR=1
-    AC_LIBOBJ([mkdir])
-  fi
-
-  AC_CACHE_CHECK([whether mkdir handles trailing dot],
-    [gl_cv_func_mkdir_trailing_dot_works],
-    [rm -rf conftest.dir
-      AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#       include <sys/types.h>
-#       include <sys/stat.h>
-]], [return !mkdir ("conftest.dir/./", 0700);])],
-      [gl_cv_func_mkdir_trailing_dot_works=yes],
-      [gl_cv_func_mkdir_trailing_dot_works=no],
-      [gl_cv_func_mkdir_trailing_dot_works="guessing no"])
-    rm -rf conftest.dir
-    ]
-  )
-  if test "$gl_cv_func_mkdir_trailing_dot_works" != yes; then
-    REPLACE_MKDIR=1
-    AC_LIBOBJ([mkdir])
-    AC_DEFINE([FUNC_MKDIR_DOT_BUG], [1], [Define to 1 if mkdir mistakenly
-      creates a directory given with a trailing dot component.])
-  fi
-])
index a6b7b9ac3b4954a5603f27408b2f5b3c3e90b61b..579323f15aba3accdd129201ab7258ad3548471d 100644 (file)
@@ -1,5 +1,5 @@
-# mmap-anon.m4 serial 8
-dnl Copyright (C) 2005, 2007, 2009-2010 Free Software Foundation, Inc.
+# mmap-anon.m4 serial 9
+dnl Copyright (C) 2005, 2007, 2009-2012 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.
@@ -15,10 +15,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_MMAP_ANON],
 [
-  dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
-  AC_REQUIRE([AC_PROG_CPP])
-  AC_REQUIRE([AC_PROG_EGREP])
-
   dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
@@ -31,18 +27,18 @@ AC_DEFUN([gl_FUNC_MMAP_ANON],
   gl_have_mmap_anonymous=no
   if test $gl_have_mmap = yes; then
     AC_MSG_CHECKING([for MAP_ANONYMOUS])
-    AC_EGREP_CPP([I cant identify this map.], [
+    AC_EGREP_CPP([I cannot identify this map], [
 #include <sys/mman.h>
 #ifdef MAP_ANONYMOUS
-    I cant identify this map.
+    I cannot identify this map
 #endif
 ],
       [gl_have_mmap_anonymous=yes])
     if test $gl_have_mmap_anonymous != yes; then
-      AC_EGREP_CPP([I cant identify this map.], [
+      AC_EGREP_CPP([I cannot identify this map], [
 #include <sys/mman.h>
 #ifdef MAP_ANON
-    I cant identify this map.
+    I cannot identify this map
 #endif
 ],
         [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON],
index 3178dfd3b8ce5e9b66a4a8dc2d56256a0e2bbd0e..40f612a61248f328f936069914c84cc40f24a0e6 100644 (file)
@@ -1,5 +1,5 @@
 # mode_t.m4 serial 2
-dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2012 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.
diff --git a/m4/msvc-inval.m4 b/m4/msvc-inval.m4
new file mode 100644 (file)
index 0000000..8db4617
--- /dev/null
@@ -0,0 +1,19 @@
+# msvc-inval.m4 serial 1
+dnl Copyright (C) 2011-2012 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.
+
+AC_DEFUN([gl_MSVC_INVAL],
+[
+  AC_CHECK_FUNCS_ONCE([_set_invalid_parameter_handler])
+  if test $ac_cv_func__set_invalid_parameter_handler = yes; then
+    HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
+    AC_DEFINE([HAVE_MSVC_INVALID_PARAMETER_HANDLER], [1],
+      [Define to 1 on MSVC platforms that have the "invalid parameter handler"
+       concept.])
+  else
+    HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
+  fi
+  AC_SUBST([HAVE_MSVC_INVALID_PARAMETER_HANDLER])
+])
diff --git a/m4/msvc-nothrow.m4 b/m4/msvc-nothrow.m4
new file mode 100644 (file)
index 0000000..0125050
--- /dev/null
@@ -0,0 +1,10 @@
+# msvc-nothrow.m4 serial 1
+dnl Copyright (C) 2011-2012 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.
+
+AC_DEFUN([gl_MSVC_NOTHROW],
+[
+  AC_REQUIRE([gl_MSVC_INVAL])
+])
index 389bd2bbaa6e73bbccc10e73f88c2ab079a24e0b..b424dce652babee407b5e842bb9ad7997047dcf8 100644 (file)
@@ -1,5 +1,5 @@
-# multiarch.m4 serial 5
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# multiarch.m4 serial 6
+dnl Copyright (C) 2008-2012 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.
@@ -16,8 +16,7 @@ dnl with or without modifications, as long as this notice is preserved.
 #                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
 #                 CPP="gcc -E" CXXCPP="g++ -E"
 #
-# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
-# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
+# Detect this situation and set APPLE_UNIVERSAL_BUILD accordingly.
 
 AC_DEFUN_ONCE([gl_MULTIARCH],
 [
@@ -55,8 +54,6 @@ AC_DEFUN_ONCE([gl_MULTIARCH],
      done
     ])
   if test $gl_cv_c_multiarch = yes; then
-    AC_DEFINE([AA_APPLE_UNIVERSAL_BUILD], [1],
-      [Define if the compiler is building for multiple architectures of Apple platforms at once.])
     APPLE_UNIVERSAL_BUILD=1
   else
     APPLE_UNIVERSAL_BUILD=0
index efbcfa6af837fb04179bda45880611045e32fcda..08ef825499a302264e6e302f4e7c2bb65dab90ab 100644 (file)
@@ -1,5 +1,5 @@
-# nocrash.m4 serial 2
-dnl Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+# nocrash.m4 serial 3
+dnl Copyright (C) 2005, 2009-2012 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.
@@ -79,6 +79,34 @@ nocrash_init (void)
     }
   }
 }
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Avoid a crash on native Windows.  */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+    {
+    case EXCEPTION_ACCESS_VIOLATION:
+    case EXCEPTION_IN_PAGE_ERROR:
+    case EXCEPTION_STACK_OVERFLOW:
+    case EXCEPTION_GUARD_PAGE:
+    case EXCEPTION_PRIV_INSTRUCTION:
+    case EXCEPTION_ILLEGAL_INSTRUCTION:
+    case EXCEPTION_DATATYPE_MISALIGNMENT:
+    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+      exit (1);
+    }
+  return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
 #else
 /* Avoid a crash on POSIX systems.  */
 #include <signal.h>
diff --git a/m4/off_t.m4 b/m4/off_t.m4
new file mode 100644 (file)
index 0000000..dfca2df
--- /dev/null
@@ -0,0 +1,18 @@
+# off_t.m4 serial 1
+dnl Copyright (C) 2012 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.
+
+dnl Check whether to override the 'off_t' type.
+dnl Set WINDOWS_64_BIT_OFF_T.
+
+AC_DEFUN([gl_TYPE_OFF_T],
+[
+  m4_ifdef([gl_LARGEFILE], [
+    AC_REQUIRE([gl_LARGEFILE])
+  ], [
+    WINDOWS_64_BIT_OFF_T=0
+  ])
+  AC_SUBST([WINDOWS_64_BIT_OFF_T])
+])
index d705b3a1eff807faf1fb50bc373fa1c4eceef7e8..c85971dc1ad795798bf4b597988e9a20212a2495 100644 (file)
@@ -1,5 +1,5 @@
-# open.m4 serial 8
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# open.m4 serial 13
+dnl Copyright (C) 2007-2012 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.
@@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_OPEN],
   AC_REQUIRE([AC_CANONICAL_HOST])
   case "$host_os" in
     mingw* | pw*)
-      gl_REPLACE_OPEN
+      REPLACE_OPEN=1
       ;;
     *)
       dnl open("foo/") should not create a file when the file name has a
@@ -22,25 +22,32 @@ AC_DEFUN([gl_FUNC_OPEN],
             touch conftest.tmp
             ln -s conftest.tmp conftest.lnk
           fi
-          AC_TRY_RUN([
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
 #include <fcntl.h>
 #if HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 int main ()
 {
+  int result = 0;
 #if HAVE_LSTAT
-  if (open ("conftest.lnk/", O_RDONLY) != -1) return 2;
+  if (open ("conftest.lnk/", O_RDONLY) != -1)
+    result |= 1;
 #endif
-  return open ("conftest.sl/", O_CREAT, 0600) >= 0;
-}], [gl_cv_func_open_slash=yes], [gl_cv_func_open_slash=no],
+  if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+    result |= 2;
+  return result;
+}]])],
+            [gl_cv_func_open_slash=yes],
+            [gl_cv_func_open_slash=no],
             [
 changequote(,)dnl
              case "$host_os" in
-               freebsd*)        gl_cv_func_open_slash="guessing no" ;;
-               solaris2.[0-9]*) gl_cv_func_open_slash="guessing no" ;;
-               hpux*)           gl_cv_func_open_slash="guessing no" ;;
-               *)               gl_cv_func_open_slash="guessing yes" ;;
+               freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+                 gl_cv_func_open_slash="guessing no" ;;
+               *)
+                 gl_cv_func_open_slash="guessing yes" ;;
              esac
 changequote([,])dnl
             ])
@@ -50,19 +57,30 @@ changequote([,])dnl
         *no)
           AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
             [Define to 1 if open() fails to recognize a trailing slash.])
-          gl_REPLACE_OPEN
+          REPLACE_OPEN=1
           ;;
       esac
       ;;
   esac
-])
-
-AC_DEFUN([gl_REPLACE_OPEN],
-[
-  AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
-  REPLACE_OPEN=1
-  AC_LIBOBJ([open])
-  gl_PREREQ_OPEN
+  dnl Replace open() for supporting the gnulib-defined fchdir() function,
+  dnl to keep fchdir's bookkeeping up-to-date.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    if test $REPLACE_OPEN = 0; then
+      gl_TEST_FCHDIR
+      if test $HAVE_FCHDIR = 0; then
+        REPLACE_OPEN=1
+      fi
+    fi
+  ])
+  dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag.
+  m4_ifdef([gl_NONBLOCKING_IO], [
+    if test $REPLACE_OPEN = 0; then
+      gl_NONBLOCKING_IO
+      if test $gl_cv_have_open_O_NONBLOCK != yes; then
+        REPLACE_OPEN=1
+      fi
+    fi
+  ])
 ])
 
 # Prerequisites of lib/open.c.
index 7975efb47e22ab04033a0ceccfb246eedb7af948..0040040b749668a76384dd8fd392bf513e0367c9 100644 (file)
@@ -1,7 +1,7 @@
-# serial 27
+# serial 44
 # See if we need to use our replacement for Solaris' openat et al functions.
 
-dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2012 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.
@@ -11,111 +11,24 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_OPENAT],
 [
   AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
-  GNULIB_OPENAT=1
-
-  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
-  GNULIB_FCHMODAT=1
-  GNULIB_FSTATAT=1
-  GNULIB_MKDIRAT=1
-
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  GNULIB_FCHOWNAT=1
-  GNULIB_UNLINKAT=1
-
-  AC_LIBOBJ([openat-proc])
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-  AC_CHECK_FUNCS_ONCE([lchmod])
-  AC_REPLACE_FUNCS([fchmodat fstatat mkdirat openat unlinkat])
-  AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
-  AC_REQUIRE([gl_FUNC_UNLINK])
-  case $ac_cv_func_openat+$ac_cv_func_lstat_dereferences_slashed_symlink in
-  yes+yes)
-    # GNU/Hurd has unlinkat, but it has the same bug as unlink.
-    if test $REPLACE_UNLINK = 1; then
-      AC_LIBOBJ([unlinkat])
-      REPLACE_UNLINKAT=1
-    fi ;;
+  AC_CHECK_FUNCS_ONCE([openat])
+  AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+  case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink in
+  yes+*yes)
+    ;;
   yes+*)
     # Solaris 9 has *at functions, but uniformly mishandles trailing
     # slash in all of them.
-    AC_LIBOBJ([openat])
     REPLACE_OPENAT=1
-    AC_LIBOBJ([fstatat])
-    REPLACE_FSTATAT=1
-    AC_LIBOBJ([unlinkat])
-    REPLACE_UNLINKAT=1
     ;;
   *)
     HAVE_OPENAT=0
-    HAVE_UNLINKAT=0 # No known system with unlinkat but not openat
-    HAVE_FSTATAT=0 # No known system with fstatat but not openat
-    gl_PREREQ_OPENAT;;
+    ;;
   esac
-  if test $ac_cv_func_fchmodat != yes; then
-    HAVE_FCHMODAT=0
-  fi
-  if test $ac_cv_func_mkdirat != yes; then
-    HAVE_MKDIRAT=0
-  fi
-  gl_FUNC_FCHOWNAT
-])
-
-# gl_FUNC_FCHOWNAT_DEREF_BUG([ACTION-IF-BUGGY[, ACTION-IF-NOT_BUGGY]])
-AC_DEFUN([gl_FUNC_FCHOWNAT_DEREF_BUG],
-[
-  AC_CACHE_CHECK([whether fchownat works with AT_SYMLINK_NOFOLLOW],
-    gl_cv_func_fchownat_nofollow_works,
-    [
-     gl_dangle=conftest.dangle
-     # Remove any remnants of a previous test.
-     rm -f $gl_dangle
-     # Arrange for deletion of the temporary file this test creates.
-     ac_clean_files="$ac_clean_files $gl_dangle"
-     ln -s conftest.no-such $gl_dangle
-     AC_RUN_IFELSE(
-       [AC_LANG_SOURCE(
-          [[
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
-int
-main ()
-{
-  return (fchownat (AT_FDCWD, "$gl_dangle", -1, getgid (),
-                    AT_SYMLINK_NOFOLLOW) != 0
-          && errno == ENOENT);
-}
-          ]])],
-    [gl_cv_func_fchownat_nofollow_works=yes],
-    [gl_cv_func_fchownat_nofollow_works=no],
-    [gl_cv_func_fchownat_nofollow_works=no],
-    )
-  ])
-  AS_IF([test $gl_cv_func_fchownat_nofollow_works = no], [$1], [$2])
-])
-
-# If we have the fchownat function, and it has the bug (in glibc-2.4)
-# that it dereferences symlinks even with AT_SYMLINK_NOFOLLOW, then
-# use the replacement function.
-# Also use the replacement function if fchownat is simply not available.
-AC_DEFUN([gl_FUNC_FCHOWNAT],
-[
-  AC_REQUIRE([gl_FUNC_CHOWN])
-  AC_CHECK_FUNC([fchownat],
-    [gl_FUNC_FCHOWNAT_DEREF_BUG([REPLACE_FCHOWNAT=1
-      AC_DEFINE([FCHOWNAT_NOFOLLOW_BUG], [1], [Define to 1 if your
-      platform has fchownat, but it cannot perform lchown tasks.])])],
-    [HAVE_FCHOWNAT=0])
-  if test $REPLACE_CHOWN = 1; then
-    REPLACE_FCHOWNAT=1
-  fi
-  if test $HAVE_FCHOWNAT = 0 || test $REPLACE_FCHOWNAT = 1; then
-    AC_LIBOBJ([fchownat])
-  fi
 ])
 
+# Prerequisites of lib/openat.c.
 AC_DEFUN([gl_PREREQ_OPENAT],
 [
   AC_REQUIRE([AC_C_INLINE])
diff --git a/m4/opendir.m4 b/m4/opendir.m4
new file mode 100644 (file)
index 0000000..08da440
--- /dev/null
@@ -0,0 +1,25 @@
+# opendir.m4 serial 2
+dnl Copyright (C) 2011-2012 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.
+
+AC_DEFUN([gl_FUNC_OPENDIR],
+[
+  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+  AC_CHECK_FUNCS([opendir])
+  if test $ac_cv_func_opendir = no; then
+    HAVE_OPENDIR=0
+  fi
+  dnl Replace opendir() for supporting the gnulib-defined fchdir() function,
+  dnl to keep fchdir's bookkeeping up-to-date.
+  m4_ifdef([gl_FUNC_FCHDIR], [
+    gl_TEST_FCHDIR
+    if test $HAVE_FCHDIR = 0; then
+      if test $HAVE_OPENDIR = 1; then
+        REPLACE_OPENDIR=1
+      fi
+    fi
+  ])
+])
diff --git a/m4/pathmax.m4 b/m4/pathmax.m4
new file mode 100644 (file)
index 0000000..0117861
--- /dev/null
@@ -0,0 +1,42 @@
+# pathmax.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2012 Free Software Foundation,
+dnl 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.
+
+AC_DEFUN([gl_PATHMAX],
+[
+  dnl Prerequisites of lib/pathmax.h.
+  AC_CHECK_HEADERS_ONCE([sys/param.h])
+])
+
+# Expands to a piece of C program that defines PATH_MAX in the same way as
+# "pathmax.h" will do.
+AC_DEFUN([gl_PATHMAX_SNIPPET], [[
+/* Arrange to define PATH_MAX, like "pathmax.h" does. */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <limits.h>
+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+#endif
+#if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+#endif
+#ifdef __hpux
+# undef PATH_MAX
+# define PATH_MAX 1024
+#endif
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# undef PATH_MAX
+# define PATH_MAX 260
+#endif
+]])
+
+# Prerequisites of gl_PATHMAX_SNIPPET.
+AC_DEFUN([gl_PATHMAX_SNIPPET_PREREQ],
+[
+  AC_CHECK_HEADERS_ONCE([unistd.h sys/param.h])
+])
index 350cd4203fa736cc32bc8fd2863e37ba6137a6a3..369a824e73f2a328795345bbc6a4c558e93d6dcc 100644 (file)
@@ -1,5 +1,5 @@
-# perror.m4 serial 1
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# perror.m4 serial 6
+dnl Copyright (C) 2008-2012 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.
@@ -8,10 +8,56 @@ AC_DEFUN([gl_FUNC_PERROR],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([gl_HEADER_ERRNO_H])
-  if test -n "$ERRNO_H"; then
+  AC_REQUIRE([gl_FUNC_STRERROR_R])
+  AC_REQUIRE([gl_FUNC_STRERROR_0])
+  dnl We intentionally do not check for the broader REPLACE_STRERROR_R,
+  dnl since on glibc systems, strerror_r is replaced only for signature
+  dnl issues, and perror is just fine.  Rather, we only want to
+  dnl replace perror if strerror_r was replaced for a content fix.
+  if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then
     dnl The system's perror() cannot know about the new errno values we add
-    dnl to <errno.h>. Replace it.
+    dnl to <errno.h>, or any fix for strerror(0). Replace it.
     REPLACE_PERROR=1
-    AC_LIBOBJ([perror])
   fi
+  case ${gl_cv_func_strerror_r_works-unset} in
+    unset|*yes)
+      AC_CACHE_CHECK([whether perror matches strerror],
+        [gl_cv_func_perror_works],
+        [AC_RUN_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <errno.h>
+                #include <stdio.h>
+                #include <stdlib.h>
+                #include <string.h>
+              ]],
+              [[char *str = strerror (-1);
+                if (!getenv("CONFTEST_OUTPUT")) return 0;
+                if (!str) str = "";
+                puts (str);
+                errno = -1;
+                perror ("");
+                return 0;
+              ]])],
+           [if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \
+               && cmp conftest.txt1 conftest.txt2 >/dev/null; then
+              gl_cv_func_perror_works=yes
+            else
+              gl_cv_func_perror_works=no
+            fi
+            rm -rf conftest.txt1 conftest.txt2],
+           [gl_cv_func_perror_works=no],
+           [dnl Guess no when cross-compiling.
+            gl_cv_func_perror_works="guessing no"
+           ])
+        ])
+      if test "$gl_cv_func_perror_works" != yes; then
+        REPLACE_PERROR=1
+      fi
+      ;;
+    *)
+      dnl The system's perror() probably inherits the bugs in the
+      dnl system's strerror_r(). Replace it.
+      REPLACE_PERROR=1
+      ;;
+  esac
 ])
index c42391a43d014ce0e3ca1db9d309572e5defd758..de5d641fe230a9b1a86a78ce98cf911dd6b17a0b 100644 (file)
@@ -1,5 +1,5 @@
-# printf-frexp.m4 serial 3
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# printf-frexp.m4 serial 5
+dnl Copyright (C) 2007, 2009-2012 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.
@@ -8,16 +8,7 @@ dnl Check how to define printf_frexp() without linking with libm.
 
 AC_DEFUN([gl_FUNC_PRINTF_FREXP],
 [
-  AC_CACHE_CHECK([whether frexp can be used without linking with libm],
-    [gl_cv_func_frexp_no_libm],
-    [
-      AC_TRY_LINK([#include <math.h>
-                   double x;
-                   int y;],
-                  [return frexp (x, &y) < 1;],
-        [gl_cv_func_frexp_no_libm=yes],
-        [gl_cv_func_frexp_no_libm=no])
-    ])
+  AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM])
   if test $gl_cv_func_frexp_no_libm = yes; then
     gl_FUNC_FREXP_WORKS
     case "$gl_cv_func_frexp_works" in
@@ -31,10 +22,12 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXP],
   AC_CACHE_CHECK([whether ldexp can be used without linking with libm],
     [gl_cv_func_ldexp_no_libm],
     [
-      AC_TRY_LINK([#include <math.h>
-                   double x;
-                   int y;],
-                  [return ldexp (x, y) < 1;],
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <math.h>
+             double x;
+             int y;]],
+           [[return ldexp (x, y) < 1;]])],
         [gl_cv_func_ldexp_no_libm=yes],
         [gl_cv_func_ldexp_no_libm=no])
     ])
index 14ffe1fc1a7d05a04b5007ed69c4f23bfe21cc7a..55dd6bc18e302e24b26b7a1dec0d8adc521a8f35 100644 (file)
@@ -1,5 +1,5 @@
-# printf-frexpl.m4 serial 6
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# printf-frexpl.m4 serial 9
+dnl Copyright (C) 2007, 2009-2012 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.
@@ -9,17 +9,10 @@ dnl Check how to define printf_frexpl() without linking with libm.
 AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
 [
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
+  AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
+
   dnl Subset of gl_FUNC_FREXPL_NO_LIBM.
-  AC_CACHE_CHECK([whether frexpl can be used without linking with libm],
-    [gl_cv_func_frexpl_no_libm],
-    [
-      AC_TRY_LINK([#include <math.h>
-                   long double x;
-                   int y;],
-                  [return frexpl (x, &y) < 1;],
-        [gl_cv_func_frexpl_no_libm=yes],
-        [gl_cv_func_frexpl_no_libm=no])
-    ])
+  gl_CHECK_FREXPL_NO_LIBM
   if test $gl_cv_func_frexpl_no_libm = yes; then
     gl_FUNC_FREXPL_WORKS
     case "$gl_cv_func_frexpl_works" in
@@ -36,19 +29,10 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
       [Define if the frexpl function is available in libc.])
     dnl Also check whether it's declared.
     dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
-    AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>])
+    AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
   fi
 
-  AC_CACHE_CHECK([whether ldexpl can be used without linking with libm],
-    [gl_cv_func_ldexpl_no_libm],
-    [
-      AC_TRY_LINK([#include <math.h>
-                   long double x;
-                   int y;],
-                  [return ldexpl (x, y) < 1;],
-        [gl_cv_func_ldexpl_no_libm=yes],
-        [gl_cv_func_ldexpl_no_libm=no])
-    ])
+  gl_CHECK_LDEXPL_NO_LIBM
   if test $gl_cv_func_ldexpl_no_libm = yes; then
     gl_FUNC_LDEXPL_WORKS
     case "$gl_cv_func_ldexpl_works" in
@@ -57,7 +41,7 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
           [Define if the ldexpl function is available in libc.])
         dnl Also check whether it's declared.
         dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
-        AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [#include <math.h>])
+        AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
         ;;
     esac
   fi
index 26124a1235ec7d536b0e31973f27714a965023d3..5bac0779bd60163024ab020a5b5ce493dabe36e9 100644 (file)
@@ -1,5 +1,5 @@
-# printf-posix-rpl.m4 serial 3
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# printf-posix-rpl.m4 serial 4
+dnl Copyright (C) 2007-2012 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.
@@ -15,6 +15,7 @@ AC_DEFUN([gl_FUNC_PRINTF_POSIX],
 AC_DEFUN([gl_REPLACE_PRINTF],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
   AC_LIBOBJ([printf])
   REPLACE_PRINTF=1
   AC_DEFINE([REPLACE_PRINTF_POSIX], [1],
index ebca5364c467d51f91324b50bb2b248b3cc725a0..d75aca0742a3bc3af53b55575f935d30a6497336 100644 (file)
@@ -1,5 +1,5 @@
-# printf.m4 serial 33
-dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
+# printf.m4 serial 48
+dnl Copyright (C) 2003, 2007-2012 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.
@@ -17,7 +17,8 @@ AC_DEFUN([gl_PRINTF_SIZES_C99],
   AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
     [gl_cv_func_printf_sizes_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
@@ -31,53 +32,56 @@ AC_DEFUN([gl_PRINTF_SIZES_C99],
 static char buf[100];
 int main ()
 {
+  int result = 0;
 #if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
   buf[0] = '\0';
   if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
       || strcmp (buf, "12345671 33") != 0)
-    return 1;
+    result |= 1;
 #endif
   buf[0] = '\0';
   if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
       || strcmp (buf, "12345672 33") != 0)
-    return 1;
+    result |= 2;
   buf[0] = '\0';
   if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
       || strcmp (buf, "12345673 33") != 0)
-    return 1;
+    result |= 4;
   buf[0] = '\0';
   if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
       || strcmp (buf, "1.5 33") != 0)
-    return 1;
-  return 0;
-}], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no],
-      [
+    result |= 8;
+  return result;
+}]])],
+        [gl_cv_func_printf_sizes_c99=yes],
+        [gl_cv_func_printf_sizes_c99=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on FreeBSD >= 5.
-         freebsd[1-4]*)        gl_cv_func_printf_sizes_c99="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
-         darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on OpenBSD >= 3.9.
-         openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
-                               gl_cv_func_printf_sizes_c99="guessing no";;
-         openbsd*)             gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on Solaris >= 2.10.
-         solaris2.[0-9]*)      gl_cv_func_printf_sizes_c99="guessing no";;
-         solaris*)             gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_printf_sizes_c99="guessing no";;
-         netbsd*)              gl_cv_func_printf_sizes_c99="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_sizes_c99="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_printf_sizes_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
+           darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_printf_sizes_c99="guessing no";;
+           openbsd*)             gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.10.
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_printf_sizes_c99="guessing no";;
+           netbsd*)              gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_sizes_c99="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -92,35 +96,39 @@ AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
   AC_CACHE_CHECK([whether printf supports 'long double' arguments],
     [gl_cv_func_printf_long_double],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[10000];
 int main ()
 {
+  int result = 0;
   buf[0] = '\0';
   if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.750000 33") != 0)
-    return 1;
+    result |= 1;
   buf[0] = '\0';
   if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.750000e+00 33") != 0)
-    return 1;
+    result |= 2;
   buf[0] = '\0';
   if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
       || strcmp (buf, "1.75 33") != 0)
-    return 1;
-  return 0;
-}], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no],
-      [
+    result |= 4;
+  return result;
+}]])],
+        [gl_cv_func_printf_long_double=yes],
+        [gl_cv_func_printf_long_double=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         beos*)        gl_cv_func_printf_long_double="guessing no";;
-         mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
-         *)            gl_cv_func_printf_long_double="guessing yes";;
-       esac
+         case "$host_os" in
+           beos*)        gl_cv_func_printf_long_double="guessing no";;
+           mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
+           *)            gl_cv_func_printf_long_double="guessing yes";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -136,7 +144,8 @@ AC_DEFUN([gl_PRINTF_INFINITE],
   AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
     [gl_cv_func_printf_infinite],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static int
@@ -168,65 +177,68 @@ static char buf[10000];
 static double zero = 0.0;
 int main ()
 {
-  if (sprintf (buf, "%f", 1.0 / 0.0) < 0
+  int result = 0;
+  if (sprintf (buf, "%f", 1.0 / zero) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%f", -1.0 / 0.0) < 0
+    result |= 1;
+  if (sprintf (buf, "%f", -1.0 / zero) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%f", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
-  if (sprintf (buf, "%e", 1.0 / 0.0) < 0
+    result |= 2;
+  if (sprintf (buf, "%e", 1.0 / zero) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%e", -1.0 / 0.0) < 0
+    result |= 4;
+  if (sprintf (buf, "%e", -1.0 / zero) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 4;
   if (sprintf (buf, "%e", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
-  if (sprintf (buf, "%g", 1.0 / 0.0) < 0
+    result |= 8;
+  if (sprintf (buf, "%g", 1.0 / zero) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%g", -1.0 / 0.0) < 0
+    result |= 16;
+  if (sprintf (buf, "%g", -1.0 / zero) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 16;
   if (sprintf (buf, "%g", zero / zero) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
+    result |= 32;
   /* This test fails on HP-UX 10.20.  */
   if (have_minus_zero ())
     if (sprintf (buf, "%g", - zero) < 0
         || strcmp (buf, "-0") != 0)
-    return 1;
-  return 0;
-}], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no],
-      [
+    result |= 64;
+  return result;
+}]])],
+        [gl_cv_func_printf_infinite=yes],
+        [gl_cv_func_printf_infinite=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on FreeBSD >= 6.
-         freebsd[1-5]*)        gl_cv_func_printf_infinite="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_printf_infinite="guessing no";;
-         darwin*)              gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on HP-UX >= 11.
-         hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
-         hpux*)                gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_printf_infinite="guessing no";;
-         netbsd*)              gl_cv_func_printf_infinite="guessing yes";;
-                               # Guess yes on BeOS.
-         beos*)                gl_cv_func_printf_infinite="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_infinite="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on FreeBSD >= 6.
+           freebsd[1-5]*)        gl_cv_func_printf_infinite="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_infinite="guessing no";;
+           darwin*)              gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on HP-UX >= 11.
+           hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
+           hpux*)                gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_printf_infinite="guessing no";;
+           netbsd*)              gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_printf_infinite="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_infinite="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -239,6 +251,7 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
   AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([gl_BIGENDIAN])
+  AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   dnl The user can set or unset the variable gl_printf_safe to indicate
   dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
@@ -252,7 +265,8 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
       AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments],
         [gl_cv_func_printf_infinite_long_double],
         [
-          AC_TRY_RUN([
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
 ]GL_NOCRASH[
 #include <float.h>
 #include <stdio.h>
@@ -279,35 +293,36 @@ static char buf[10000];
 static long double zeroL = 0.0L;
 int main ()
 {
+  int result = 0;
   nocrash_init();
-  if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0
+  if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0
+    result |= 1;
+  if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
-  if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0
+    result |= 1;
+  if (sprintf (buf, "%Le", 1.0L / zeroL) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0
+    result |= 1;
+  if (sprintf (buf, "%Le", -1.0L / zeroL) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Le", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
-  if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0
+    result |= 1;
+  if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0
       || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    return 1;
-  if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0
+    result |= 1;
+  if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0
       || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
       || !strisnan (buf, 0, strlen (buf)))
-    return 1;
-#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
+    result |= 1;
+#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
 /* Representation of an 80-bit 'long double' as an initializer for a sequence
    of 'unsigned int' words.  */
 # ifdef WORDS_BIGENDIAN
@@ -325,13 +340,13 @@ int main ()
       { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
   }
   {
     /* Signalling NaN.  */
@@ -339,113 +354,106 @@ int main ()
       { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 2;
   }
   { /* Pseudo-NaN.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 4;
   }
   { /* Pseudo-Infinity.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 8;
   }
   { /* Pseudo-Zero.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 16;
   }
   { /* Unnormalized number.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 32;
   }
   { /* Pseudo-Denormal.  */
     static union { unsigned int word[4]; long double value; } x =
       { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
     if (sprintf (buf, "%Lf", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
     if (sprintf (buf, "%Le", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
     if (sprintf (buf, "%Lg", x.value) < 0
         || !strisnan (buf, 0, strlen (buf)))
-      return 1;
+      result |= 64;
   }
 #endif
-  return 0;
-}],
-          [gl_cv_func_printf_infinite_long_double=yes],
-          [gl_cv_func_printf_infinite_long_double=no],
-          [
+  return result;
+}]])],
+            [gl_cv_func_printf_infinite_long_double=yes],
+            [gl_cv_func_printf_infinite_long_double=no],
+            [
 changequote(,)dnl
-           case "$host_cpu" in
-                                   # Guess no on ia64, x86_64, i386.
-             ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
-             *)
-               case "$host_os" in
-                                       # Guess yes on glibc systems.
-                 *-gnu*)               gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on FreeBSD >= 6.
-                 freebsd[1-5]*)        gl_cv_func_printf_infinite_long_double="guessing no";;
-                 freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on MacOS X >= 10.3.
-                 darwin[1-6].*)        gl_cv_func_printf_infinite_long_double="guessing no";;
-                 darwin*)              gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on HP-UX >= 11.
-                 hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
-                 hpux*)                gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # Guess yes on NetBSD >= 3.
-                 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                                       gl_cv_func_printf_infinite_long_double="guessing no";;
-                 netbsd*)              gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                       # If we don't know, assume the worst.
-                 *)                    gl_cv_func_printf_infinite_long_double="guessing no";;
-               esac
-               ;;
-           esac
+             case "$host_cpu" in
+                                     # Guess no on ia64, x86_64, i386.
+               ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
+               *)
+                 case "$host_os" in
+                                         # Guess yes on glibc systems.
+                   *-gnu*)               gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on FreeBSD >= 6.
+                   freebsd[1-5]*)        gl_cv_func_printf_infinite_long_double="guessing no";;
+                   freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on HP-UX >= 11.
+                   hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
+                   hpux*)                gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # If we don't know, assume the worst.
+                   *)                    gl_cv_func_printf_infinite_long_double="guessing no";;
+                 esac
+                 ;;
+             esac
 changequote([,])dnl
-          ])
+            ])
         ])
       ;;
     *)
@@ -466,43 +474,46 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
   AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
     [gl_cv_func_printf_directive_a],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
+static double zero = 0.0;
 int main ()
 {
+  int result = 0;
   if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
       || (strcmp (buf, "0x1.922p+1 33") != 0
           && strcmp (buf, "0x3.244p+0 33") != 0
           && strcmp (buf, "0x6.488p-1 33") != 0
           && strcmp (buf, "0xc.91p-2 33") != 0))
-    return 1;
+    result |= 1;
   if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
       || (strcmp (buf, "-0X1.922P+1 33") != 0
           && strcmp (buf, "-0X3.244P+0 33") != 0
           && strcmp (buf, "-0X6.488P-1 33") != 0
           && strcmp (buf, "-0XC.91P-2 33") != 0))
-    return 1;
+    result |= 2;
   /* This catches a FreeBSD 6.1 bug: it doesn't round.  */
   if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
       || (strcmp (buf, "0x1.83p+0 33") != 0
           && strcmp (buf, "0x3.05p-1 33") != 0
           && strcmp (buf, "0x6.0ap-2 33") != 0
           && strcmp (buf, "0xc.14p-3 33") != 0))
-    return 1;
+    result |= 4;
   /* This catches a FreeBSD 6.1 bug.  See
      <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
-  if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
+  if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
       || buf[0] == '0')
-    return 1;
+    result |= 8;
   /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug.  */
   if (sprintf (buf, "%.1a", 1.999) < 0
       || (strcmp (buf, "0x1.0p+1") != 0
           && strcmp (buf, "0x2.0p+0") != 0
           && strcmp (buf, "0x4.0p-1") != 0
           && strcmp (buf, "0x8.0p-2") != 0))
-    return 1;
+    result |= 16;
   /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
      glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
   if (sprintf (buf, "%.1La", 1.999L) < 0
@@ -510,28 +521,30 @@ int main ()
           && strcmp (buf, "0x2.0p+0") != 0
           && strcmp (buf, "0x4.0p-1") != 0
           && strcmp (buf, "0x8.0p-2") != 0))
-    return 1;
-  return 0;
-}], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no],
-      [
-       case "$host_os" in
-                               # Guess yes on glibc >= 2.5 systems.
-         *-gnu*)
-           AC_EGREP_CPP([BZ2908], [
-             #include <features.h>
-             #ifdef __GNU_LIBRARY__
-              #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
-               BZ2908
-              #endif
-             #endif
-             ],
-             [gl_cv_func_printf_directive_a="guessing yes"],
-             [gl_cv_func_printf_directive_a="guessing no"])
-           ;;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_directive_a="guessing no";;
-       esac
-      ])
+    result |= 32;
+  return result;
+}]])],
+        [gl_cv_func_printf_directive_a=yes],
+        [gl_cv_func_printf_directive_a=no],
+        [
+         case "$host_os" in
+                                 # Guess yes on glibc >= 2.5 systems.
+           *-gnu*)
+             AC_EGREP_CPP([BZ2908], [
+               #include <features.h>
+               #ifdef __GNU_LIBRARY__
+                #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__
+                 BZ2908
+                #endif
+               #endif
+               ],
+               [gl_cv_func_printf_directive_a="guessing yes"],
+               [gl_cv_func_printf_directive_a="guessing no"])
+             ;;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_directive_a="guessing no";;
+         esac
+        ])
     ])
 ])
 
@@ -546,43 +559,48 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
   AC_CACHE_CHECK([whether printf supports the 'F' directive],
     [gl_cv_func_printf_directive_f],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
+static double zero = 0.0;
 int main ()
 {
+  int result = 0;
   if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
       || strcmp (buf, "1234567.000000 33") != 0)
-    return 1;
-  if (sprintf (buf, "%F", 1.0 / 0.0) < 0
+    result |= 1;
+  if (sprintf (buf, "%F", 1.0 / zero) < 0
       || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
-    return 1;
+    result |= 2;
   /* This catches a Cygwin 1.5.x bug.  */
   if (sprintf (buf, "%.F", 1234.0) < 0
       || strcmp (buf, "1234") != 0)
-    return 1;
-  return 0;
-}], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no],
-      [
+    result |= 4;
+  return result;
+}]])],
+        [gl_cv_func_printf_directive_f=yes],
+        [gl_cv_func_printf_directive_f=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_printf_directive_f="guessing yes";;
-                               # Guess yes on FreeBSD >= 6.
-         freebsd[1-5]*)        gl_cv_func_printf_directive_f="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
-         darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
-                               # Guess yes on Solaris >= 2.10.
-         solaris2.[0-9]*)      gl_cv_func_printf_directive_f="guessing no";;
-         solaris*)             gl_cv_func_printf_directive_f="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_printf_directive_f="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on FreeBSD >= 6.
+           freebsd[1-5]*)        gl_cv_func_printf_directive_f="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
+           darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on Solaris >= 2.10.
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_printf_directive_f="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -597,14 +615,30 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
   AC_CACHE_CHECK([whether printf supports the 'n' directive],
     [gl_cv_func_printf_directive_n],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
+#ifdef _MSC_VER
+/* See page about "Parameter Validation" on msdn.microsoft.com.  */
+static void cdecl
+invalid_parameter_handler (const wchar_t *expression,
+                           const wchar_t *function,
+                           const wchar_t *file, unsigned int line,
+                           uintptr_t dummy)
+{
+  exit (1);
+}
+#endif
 static char fmtstring[10];
 static char buf[100];
 int main ()
 {
   int count = -1;
+#ifdef _MSC_VER
+  _set_invalid_parameter_handler (invalid_parameter_handler);
+#endif
   /* Copy the format string.  Some systems (glibc with _FORTIFY_SOURCE=2)
      support %n in format strings in read-only memory but not in writable
      memory.  */
@@ -614,14 +648,17 @@ int main ()
       || count != 4)
     return 1;
   return 0;
-}], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no],
-      [
+}]])],
+        [gl_cv_func_printf_directive_n=yes],
+        [gl_cv_func_printf_directive_n=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         *)     gl_cv_func_printf_directive_n="guessing yes";;
-       esac
+         case "$host_os" in
+           mingw*) gl_cv_func_printf_directive_n="guessing no";;
+           *)      gl_cv_func_printf_directive_n="guessing yes";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -639,7 +676,8 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
   AC_CACHE_CHECK([whether printf supports the 'ls' directive],
     [gl_cv_func_printf_directive_ls],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
@@ -651,6 +689,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
 #include <string.h>
 int main ()
 {
+  int result = 0;
   char buf[100];
   /* Test whether %ls works at all.
      This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
@@ -660,7 +699,7 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%ls", wstring) < 0
         || strcmp (buf, "abc") != 0)
-      return 1;
+      result |= 1;
   }
   /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
      assertion failure inside libc), but not on OpenBSD 4.0.  */
@@ -669,7 +708,7 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%ls", wstring) < 0
         || strcmp (buf, "a") != 0)
-      return 1;
+      result |= 2;
   }
   /* Test whether precisions in %ls are supported as specified in ISO C 99
      section 7.19.6.1:
@@ -684,22 +723,24 @@ int main ()
     buf[0] = '\0';
     if (sprintf (buf, "%.2ls", wstring) < 0
         || strcmp (buf, "ab") != 0)
-      return 1;
+      result |= 8;
   }
-  return 0;
-}], [gl_cv_func_printf_directive_ls=yes], [gl_cv_func_printf_directive_ls=no],
-      [
+  return result;
+}]])],
+        [gl_cv_func_printf_directive_ls=yes],
+        [gl_cv_func_printf_directive_ls=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         openbsd*)        gl_cv_func_printf_directive_ls="guessing no";;
-         irix*)           gl_cv_func_printf_directive_ls="guessing no";;
-         solaris*)        gl_cv_func_printf_directive_ls="guessing no";;
-         cygwin*)         gl_cv_func_printf_directive_ls="guessing no";;
-         beos* | haiku*)  gl_cv_func_printf_directive_ls="guessing no";;
-         *)               gl_cv_func_printf_directive_ls="guessing yes";;
-       esac
+         case "$host_os" in
+           openbsd*)        gl_cv_func_printf_directive_ls="guessing no";;
+           irix*)           gl_cv_func_printf_directive_ls="guessing no";;
+           solaris*)        gl_cv_func_printf_directive_ls="guessing no";;
+           cygwin*)         gl_cv_func_printf_directive_ls="guessing no";;
+           beos* | haiku*)  gl_cv_func_printf_directive_ls="guessing no";;
+           *)               gl_cv_func_printf_directive_ls="guessing yes";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -714,7 +755,8 @@ AC_DEFUN([gl_PRINTF_POSITIONS],
   AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
     [gl_cv_func_printf_positions],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 /* The string "%2$d %1$d", with dollar characters protected from the shell's
@@ -725,18 +767,20 @@ int main ()
 {
   sprintf (buf, format, 33, 55);
   return (strcmp (buf, "55 33") != 0);
-}], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no],
-      [
+}]])],
+        [gl_cv_func_printf_positions=yes],
+        [gl_cv_func_printf_positions=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
-                       gl_cv_func_printf_positions="guessing no";;
-         beos*)        gl_cv_func_printf_positions="guessing no";;
-         mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
-         *)            gl_cv_func_printf_positions="guessing yes";;
-       esac
+         case "$host_os" in
+           netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
+                         gl_cv_func_printf_positions="guessing no";;
+           beos*)        gl_cv_func_printf_positions="guessing no";;
+           mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
+           *)            gl_cv_func_printf_positions="guessing yes";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -751,7 +795,8 @@ AC_DEFUN([gl_PRINTF_FLAG_GROUPING],
   AC_CACHE_CHECK([whether printf supports the grouping flag],
     [gl_cv_func_printf_flag_grouping],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -761,17 +806,19 @@ int main ()
       || buf[strlen (buf) - 1] != '9')
     return 1;
   return 0;
-}], [gl_cv_func_printf_flag_grouping=yes], [gl_cv_func_printf_flag_grouping=no],
-      [
+}]])],
+        [gl_cv_func_printf_flag_grouping=yes],
+        [gl_cv_func_printf_flag_grouping=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         cygwin*)      gl_cv_func_printf_flag_grouping="guessing no";;
-         netbsd*)      gl_cv_func_printf_flag_grouping="guessing no";;
-         mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
-         *)            gl_cv_func_printf_flag_grouping="guessing yes";;
-       esac
+         case "$host_os" in
+           cygwin*)      gl_cv_func_printf_flag_grouping="guessing no";;
+           netbsd*)      gl_cv_func_printf_flag_grouping="guessing no";;
+           mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
+           *)            gl_cv_func_printf_flag_grouping="guessing yes";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -787,7 +834,8 @@ AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
   AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
     [gl_cv_func_printf_flag_leftadjust],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
@@ -798,7 +846,7 @@ int main ()
       || strcmp (buf, "ab  c") != 0)
     return 1;
   return 0;
-}],
+}]])],
         [gl_cv_func_printf_flag_leftadjust=yes],
         [gl_cv_func_printf_flag_leftadjust=no],
         [
@@ -828,37 +876,44 @@ AC_DEFUN([gl_PRINTF_FLAG_ZERO],
   AC_CACHE_CHECK([whether printf supports the zero flag correctly],
     [gl_cv_func_printf_flag_zero],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[100];
+static double zero = 0.0;
 int main ()
 {
-  if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0
+  if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0
       || (strcmp (buf, "       inf") != 0
           && strcmp (buf, "  infinity") != 0))
     return 1;
   return 0;
-}], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no],
-      [
+}]])],
+        [gl_cv_func_printf_flag_zero=yes],
+        [gl_cv_func_printf_flag_zero=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
-                 # Guess yes on BeOS.
-         beos*)  gl_cv_func_printf_flag_zero="guessing yes";;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_printf_flag_zero="guessing no";;
-       esac
+         case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
+                   # Guess yes on BeOS.
+           beos*)  gl_cv_func_printf_flag_zero="guessing yes";;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_printf_flag_zero="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
 dnl Test whether the *printf family of functions supports large precisions.
 dnl On mingw, precisions larger than 512 are treated like 512, in integer,
-dnl floating-point or pointer output. On BeOS, precisions larger than 1044
-dnl crash the program.
+dnl floating-point or pointer output. On Solaris 10/x86, precisions larger
+dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC,
+dnl precisions larger than 510 in floating-point output yield wrong results.
+dnl On AIX 7.1, precisions larger than 998 in floating-point output yield
+dnl wrong results. On BeOS, precisions larger than 1044 crash the program.
 dnl Result is gl_cv_func_printf_precision.
 
 AC_DEFUN([gl_PRINTF_PRECISION],
@@ -868,30 +923,43 @@ AC_DEFUN([gl_PRINTF_PRECISION],
   AC_CACHE_CHECK([whether printf supports large precisions],
     [gl_cv_func_printf_precision],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
 static char buf[5000];
 int main ()
 {
+  int result = 0;
 #ifdef __BEOS__
   /* On BeOS, this would crash and show a dialog box.  Avoid the crash.  */
   return 1;
 #endif
   if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
-    return 1;
-  return 0;
-}], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no],
-      [
+    result |= 1;
+  if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
+    result |= 2;
+  if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
+      || buf[0] != '1')
+    result |= 4;
+  if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5
+      || buf[0] != '1')
+    result |= 4;
+  return result;
+}]])],
+        [gl_cv_func_printf_precision=yes],
+        [gl_cv_func_printf_precision=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-         # Guess no only on native Win32 and BeOS systems.
-         mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
-         beos*)        gl_cv_func_printf_precision="guessing no" ;;
-         *)            gl_cv_func_printf_precision="guessing yes" ;;
-       esac
+         case "$host_os" in
+           # Guess no only on Solaris, native Windows, and BeOS systems.
+           solaris*)     gl_cv_func_printf_precision="guessing no" ;;
+           mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
+           beos*)        gl_cv_func_printf_precision="guessing no" ;;
+           *)            gl_cv_func_printf_precision="guessing yes" ;;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -1028,61 +1096,80 @@ AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([gl_SNPRINTF_PRESENCE])
   AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
     [gl_cv_func_snprintf_truncation_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+  va_list args;
+  int ret;
+  va_start (args, format);
+  ret = vsnprintf (buf, size, format, args);
+  va_end (args);
+  return ret;
+}
+#endif
 static char buf[100];
 int main ()
 {
   strcpy (buf, "ABCDEF");
-  snprintf (buf, 3, "%d %d", 4567, 89);
+  my_snprintf (buf, 3, "%d %d", 4567, 89);
   if (memcmp (buf, "45\0DEF", 6) != 0)
     return 1;
   return 0;
-}], [gl_cv_func_snprintf_truncation_c99=yes], [gl_cv_func_snprintf_truncation_c99=no],
-      [
+}]])],
+        [gl_cv_func_snprintf_truncation_c99=yes],
+        [gl_cv_func_snprintf_truncation_c99=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on FreeBSD >= 5.
-         freebsd[1-4]*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
-         darwin*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on OpenBSD >= 3.9.
-         openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
-                               gl_cv_func_snprintf_truncation_c99="guessing no";;
-         openbsd*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on Solaris >= 2.6.
-         solaris2.[0-5]*)      gl_cv_func_snprintf_truncation_c99="guessing no";;
-         solaris*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on AIX >= 4.
-         aix[1-3]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
-         aix*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on HP-UX >= 11.
-         hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
-         hpux*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on IRIX >= 6.5.
-         irix6.5)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on OSF/1 >= 5.
-         osf[3-4]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
-         osf*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_snprintf_truncation_c99="guessing no";;
-         netbsd*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # Guess yes on BeOS.
-         beos*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_snprintf_truncation_c99="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
+           darwin*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_snprintf_truncation_c99="guessing no";;
+           openbsd*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.6.
+           solaris2.[0-5] | solaris2.[0-5].*)
+                                 gl_cv_func_snprintf_truncation_c99="guessing no";;
+           solaris*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
+           aix*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on HP-UX >= 11.
+           hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+           hpux*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on IRIX >= 6.5.
+           irix6.5)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on OSF/1 >= 5.
+           osf[3-4]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
+           osf*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_snprintf_truncation_c99="guessing no";;
+           netbsd*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_snprintf_truncation_c99="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -1101,56 +1188,78 @@ dnl     }
 dnl     ---------------------------------------------------------------------
 dnl Result is gl_cv_func_snprintf_retval_c99.
 
-AC_DEFUN([gl_SNPRINTF_RETVAL_C99],
+AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([gl_SNPRINTF_PRESENCE])
   AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
     [gl_cv_func_snprintf_retval_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+  va_list args;
+  int ret;
+  va_start (args, format);
+  ret = vsnprintf (buf, size, format, args);
+  va_end (args);
+  return ret;
+}
+#endif
 static char buf[100];
 int main ()
 {
   strcpy (buf, "ABCDEF");
-  if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
+  if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7)
     return 1;
+  if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+    return 2;
+  if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+    return 3;
   return 0;
-}], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no],
-      [
+}]])],
+        [gl_cv_func_snprintf_retval_c99=yes],
+        [gl_cv_func_snprintf_retval_c99=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on FreeBSD >= 5.
-         freebsd[1-4]*)        gl_cv_func_snprintf_retval_c99="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
-         darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on OpenBSD >= 3.9.
-         openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
-                               gl_cv_func_snprintf_retval_c99="guessing no";;
-         openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on Solaris >= 2.6.
-         solaris2.[0-5]*)      gl_cv_func_snprintf_retval_c99="guessing no";;
-         solaris*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on AIX >= 4.
-         aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
-         aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_snprintf_retval_c99="guessing no";;
-         netbsd*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # Guess yes on BeOS.
-         beos*)                gl_cv_func_snprintf_retval_c99="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_snprintf_retval_c99="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_snprintf_retval_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
+           darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_snprintf_retval_c99="guessing no";;
+           openbsd*)             gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.10.
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           solaris*)             gl_cv_func_printf_sizes_c99="guessing no";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_snprintf_retval_c99="guessing no";;
+           aix*)                 gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_snprintf_retval_c99="guessing no";;
+           netbsd*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_snprintf_retval_c99="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -1162,12 +1271,28 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([gl_SNPRINTF_PRESENCE])
   AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
     [gl_cv_func_snprintf_directive_n],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+  va_list args;
+  int ret;
+  va_start (args, format);
+  ret = vsnprintf (buf, size, format, args);
+  va_end (args);
+  return ret;
+}
+#endif
 static char fmtstring[10];
 static char buf[100];
 int main ()
@@ -1177,44 +1302,47 @@ int main ()
      support %n in format strings in read-only memory but not in writable
      memory.  */
   strcpy (fmtstring, "%d %n");
-  snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
+  my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
   if (count != 6)
     return 1;
   return 0;
-}], [gl_cv_func_snprintf_directive_n=yes], [gl_cv_func_snprintf_directive_n=no],
-      [
+}]])],
+        [gl_cv_func_snprintf_directive_n=yes],
+        [gl_cv_func_snprintf_directive_n=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on FreeBSD >= 5.
-         freebsd[1-4]*)        gl_cv_func_snprintf_directive_n="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_snprintf_directive_n="guessing no";;
-         darwin*)              gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on Solaris >= 2.6.
-         solaris2.[0-5]*)      gl_cv_func_snprintf_directive_n="guessing no";;
-         solaris*)             gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on AIX >= 4.
-         aix[1-3]*)            gl_cv_func_snprintf_directive_n="guessing no";;
-         aix*)                 gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on IRIX >= 6.5.
-         irix6.5)              gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on OSF/1 >= 5.
-         osf[3-4]*)            gl_cv_func_snprintf_directive_n="guessing no";;
-         osf*)                 gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_snprintf_directive_n="guessing no";;
-         netbsd*)              gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # Guess yes on BeOS.
-         beos*)                gl_cv_func_snprintf_directive_n="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_snprintf_directive_n="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_snprintf_directive_n="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_snprintf_directive_n="guessing no";;
+           darwin*)              gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on Solaris >= 2.6.
+           solaris2.[0-5] | solaris2.[0-5].*)
+                                 gl_cv_func_snprintf_directive_n="guessing no";;
+           solaris*)             gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_snprintf_directive_n="guessing no";;
+           aix*)                 gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on IRIX >= 6.5.
+           irix6.5)              gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on OSF/1 >= 5.
+           osf[3-4]*)            gl_cv_func_snprintf_directive_n="guessing no";;
+           osf*)                 gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_snprintf_directive_n="guessing no";;
+           netbsd*)              gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_snprintf_directive_n="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -1226,20 +1354,36 @@ dnl Result is gl_cv_func_snprintf_size1.
 AC_DEFUN([gl_SNPRINTF_SIZE1],
 [
   AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([gl_SNPRINTF_PRESENCE])
   AC_CACHE_CHECK([whether snprintf respects a size of 1],
     [gl_cv_func_snprintf_size1],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdio.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+  va_list args;
+  int ret;
+  va_start (args, format);
+  ret = vsnprintf (buf, size, format, args);
+  va_end (args);
+  return ret;
+}
+#endif
 int main()
 {
   static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
-  snprintf (buf, 1, "%d", 12345);
+  my_snprintf (buf, 1, "%d", 12345);
   return buf[1] != 'E';
-}],
-      [gl_cv_func_snprintf_size1=yes],
-      [gl_cv_func_snprintf_size1=no],
-      [gl_cv_func_snprintf_size1="guessing yes"])
+}]])],
+        [gl_cv_func_snprintf_size1=yes],
+        [gl_cv_func_snprintf_size1=no],
+        [gl_cv_func_snprintf_size1="guessing yes"])
     ])
 ])
 
@@ -1286,7 +1430,8 @@ AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
   AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
     [gl_cv_func_vsnprintf_zerosize_c99],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stdarg.h>
 #include <stdio.h>
 static int my_snprintf (char *buf, int size, const char *format, ...)
@@ -1303,43 +1448,44 @@ int main()
   static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
   my_snprintf (buf, 0, "%d", 12345);
   return buf[0] != 'D';
-}],
-      [gl_cv_func_vsnprintf_zerosize_c99=yes],
-      [gl_cv_func_vsnprintf_zerosize_c99=no],
-      [
+}]])],
+        [gl_cv_func_vsnprintf_zerosize_c99=yes],
+        [gl_cv_func_vsnprintf_zerosize_c99=no],
+        [
 changequote(,)dnl
-       case "$host_os" in
-                               # Guess yes on glibc systems.
-         *-gnu*)               gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on FreeBSD >= 5.
-         freebsd[1-4]*)        gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-         freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on MacOS X >= 10.3.
-         darwin[1-6].*)        gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-         darwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on Cygwin.
-         cygwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on Solaris >= 2.6.
-         solaris2.[0-5]*)      gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-         solaris*)             gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on AIX >= 4.
-         aix[1-3]*)            gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-         aix*)                 gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on IRIX >= 6.5.
-         irix6.5)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on NetBSD >= 3.
-         netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                               gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-         netbsd*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on BeOS.
-         beos*)                gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # Guess yes on mingw.
-         mingw* | pw*)         gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                               # If we don't know, assume the worst.
-         *)                    gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
-       esac
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu*)               gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4]*)        gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on MacOS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+           darwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on Cygwin.
+           cygwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.6.
+           solaris2.[0-5] | solaris2.[0-5].*)
+                                 gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+           solaris*)             gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+           aix*)                 gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on IRIX >= 6.5.
+           irix6.5)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+           netbsd*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on mingw.
+           mingw* | pw*)         gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # If we don't know, assume the worst.
+           *)                    gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+         esac
 changequote([,])dnl
-      ])
+        ])
     ])
 ])
 
@@ -1393,24 +1539,31 @@ dnl                                  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
 dnl   glibc 2.5                      .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 dnl   glibc 2.3.6                    .  .  .  .  #  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 dnl   FreeBSD 5.4, 6.1               .  .  .  .  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
+dnl   MacOS X 10.5.8                 .  .  .  #  #  .  .  .  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   MacOS X 10.3.9                 .  .  .  .  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
 dnl   OpenBSD 3.9, 4.0               .  .  #  #  #  #  .  #  .  #  .  #  .  #  .  .  .  .  .  .
 dnl   Cygwin 1.7.0 (2009)            .  .  .  #  .  .  .  ?  .  .  .  .  .  ?  .  .  .  .  .  .
 dnl   Cygwin 1.5.25 (2008)           .  .  .  #  #  .  .  #  .  .  .  .  .  #  .  .  .  .  .  .
 dnl   Cygwin 1.5.19 (2006)           #  .  .  #  #  #  .  #  .  #  .  #  #  #  .  .  .  .  .  .
-dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
-dnl   Solaris 2.6 ... 9              #  .  #  #  #  #  .  #  .  .  .  #  .  .  .  .  .  .  .  .
+dnl   Solaris 11 2011-11             .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
+dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  #  .  .  .  .  .  .  .
+dnl   Solaris 2.6 ... 9              #  .  #  #  #  #  .  #  .  .  .  #  #  .  .  .  #  .  .  .
 dnl   Solaris 2.5.1                  #  .  #  #  #  #  .  #  .  .  .  #  .  .  #  #  #  #  #  #
+dnl   AIX 7.1                        .  .  #  #  #  .  .  .  .  .  .  #  #  .  .  .  .  .  .  .
 dnl   AIX 5.2                        .  .  #  #  #  .  .  .  .  .  .  #  .  .  .  .  .  .  .  .
-dnl   AIX 4.3.2, 5.1                 #  .  #  #  #  #  .  .  .  .  .  #  .  .  .  .  .  .  .  .
+dnl   AIX 4.3.2, 5.1                 #  .  #  #  #  #  .  .  .  .  .  #  .  .  .  .  #  .  .  .
 dnl   HP-UX 11.31                    .  .  .  .  #  .  .  .  .  .  .  #  .  .  .  .  #  #  .  .
 dnl   HP-UX 11.{00,11,23}            #  .  .  .  #  #  .  .  .  .  .  #  .  .  .  .  #  #  .  #
 dnl   HP-UX 10.20                    #  .  #  .  #  #  .  ?  .  .  #  #  .  .  .  .  #  #  ?  #
 dnl   IRIX 6.5                       #  .  #  #  #  #  .  #  .  .  .  #  .  .  .  .  #  .  .  .
 dnl   OSF/1 5.1                      #  .  #  #  #  #  .  .  .  .  .  #  .  .  .  .  #  .  .  #
 dnl   OSF/1 4.0d                     #  .  #  #  #  #  .  .  .  .  .  #  .  .  #  #  #  #  #  #
+dnl   NetBSD 5.0                     .  .  .  #  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
 dnl   NetBSD 4.0                     .  ?  ?  ?  ?  ?  .  ?  .  ?  ?  ?  ?  ?  .  .  .  ?  ?  ?
 dnl   NetBSD 3.0                     .  .  .  .  #  #  .  ?  #  #  ?  #  .  #  .  .  .  .  .  .
-dnl   Haiku                          .  .  .  #  #  #  .  #  .  .  .  .  .  ?  .  .  .  .  .  .
-dnl   BeOS                           #  #  .  #  #  #  .  ?  #  .  ?  .  #  ?  .  .  .  .  .  .
-dnl   mingw                          #  #  #  #  #  #  .  .  #  #  .  #  #  ?  .  #  #  #  .  .
+dnl   Haiku                          .  .  .  #  #  #  .  #  .  .  .  .  .  ?  .  .  ?  .  .  .
+dnl   BeOS                           #  #  .  #  #  #  .  ?  #  .  ?  .  #  ?  .  .  ?  .  .  .
+dnl   old mingw / msvcrt             #  #  #  #  #  #  .  .  #  #  .  #  #  ?  .  #  #  #  .  .
+dnl   MSVC 9                         #  #  #  #  #  #  #  .  #  #  .  #  #  ?  #  #  #  #  .  .
+dnl   mingw 2009-2011                .  #  .  #  .  .  .  .  #  #  .  .  .  ?  .  .  .  .  .  .
+dnl   mingw-w64 2011                 #  #  #  #  #  #  .  .  #  #  .  #  #  ?  .  #  #  #  .  .
index f72fd621f8cff4906d3a0c46b2535f5984093667..09c36bb26e09d2d51a4a568f7e0fb6a05c38d486 100644 (file)
@@ -1,10 +1,10 @@
-# quotearg.m4 serial 8
-dnl Copyright (C) 2002, 2004-2010 Free Software Foundation, Inc.
+# quotearg.m4 serial 9
+dnl Copyright (C) 2002, 2004-2012 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.
 
 AC_DEFUN([gl_QUOTEARG],
 [
-  AC_LIBOBJ([quotearg])
+  :
 ])
diff --git a/m4/readdir.m4 b/m4/readdir.m4
new file mode 100644 (file)
index 0000000..437ec08
--- /dev/null
@@ -0,0 +1,15 @@
+# readdir.m4 serial 1
+dnl Copyright (C) 2011-2012 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.
+
+AC_DEFUN([gl_FUNC_READDIR],
+[
+  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+  AC_CHECK_FUNCS([readdir])
+  if test $ac_cv_func_readdir = no; then
+    HAVE_READDIR=0
+  fi
+])
index dc30235c176cb5f7228dfbf091aaed3f96d8f9c6..954c2f0e58d1dceb8975c18adde991cd7e74ec51 100644 (file)
@@ -1,23 +1,76 @@
-# realloc.m4 serial 9
-dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# realloc.m4 serial 13
+dnl Copyright (C) 2007, 2009-2012 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.
 
+m4_version_prereq([2.70], [] ,[
+
+# This is taken from the following Autoconf patch:
+# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9
+AC_DEFUN([_AC_FUNC_REALLOC_IF],
+[
+  AC_REQUIRE([AC_HEADER_STDC])dnl
+  AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+  AC_CHECK_HEADERS([stdlib.h])
+  AC_CACHE_CHECK([for GNU libc compatible realloc],
+    [ac_cv_func_realloc_0_nonnull],
+    [AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+            # include <stdlib.h>
+            #else
+            char *realloc ();
+            #endif
+          ]],
+          [[return ! realloc (0, 0);]])
+       ],
+       [ac_cv_func_realloc_0_nonnull=yes],
+       [ac_cv_func_realloc_0_nonnull=no],
+       [case "$host_os" in
+          # Guess yes on platforms where we know the result.
+          *-gnu* | freebsd* | netbsd* | openbsd* \
+          | hpux* | solaris* | cygwin* | mingw*)
+            ac_cv_func_realloc_0_nonnull=yes ;;
+          # If we don't know, assume the worst.
+          *) ac_cv_func_realloc_0_nonnull=no ;;
+        esac
+       ])
+    ])
+  AS_IF([test $ac_cv_func_realloc_0_nonnull = yes], [$1], [$2])
+])# AC_FUNC_REALLOC
+
+])
+
+# gl_FUNC_REALLOC_GNU
+# -------------------
+# Test whether 'realloc (0, 0)' is handled like in GNU libc, and replace
+# realloc if it is not.
+AC_DEFUN([gl_FUNC_REALLOC_GNU],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  dnl _AC_FUNC_REALLOC_IF is defined in Autoconf.
+  _AC_FUNC_REALLOC_IF(
+    [AC_DEFINE([HAVE_REALLOC_GNU], [1],
+               [Define to 1 if your system has a GNU libc compatible 'realloc'
+                function, and to 0 otherwise.])],
+    [AC_DEFINE([HAVE_REALLOC_GNU], [0])
+     REPLACE_REALLOC=1
+    ])
+])# gl_FUNC_REALLOC_GNU
+
 # gl_FUNC_REALLOC_POSIX
 # ---------------------
 # Test whether 'realloc' is POSIX compliant (sets errno to ENOMEM when it
 # fails), and replace realloc if it is not.
 AC_DEFUN([gl_FUNC_REALLOC_POSIX],
 [
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
   if test $gl_cv_func_malloc_posix = yes; then
-    HAVE_REALLOC_POSIX=1
     AC_DEFINE([HAVE_REALLOC_POSIX], [1],
       [Define if the 'realloc' function is POSIX compliant.])
   else
-    AC_LIBOBJ([realloc])
-    HAVE_REALLOC_POSIX=0
+    REPLACE_REALLOC=1
   fi
-  AC_SUBST([HAVE_REALLOC_POSIX])
 ])
diff --git a/m4/rmdir.m4 b/m4/rmdir.m4
deleted file mode 100644 (file)
index 8d6bee8..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# rmdir.m4 serial 7
-dnl Copyright (C) 2002, 2005, 2009-2010 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.
-
-AC_DEFUN([gl_FUNC_RMDIR],
-[
-  AC_REQUIRE([gl_AC_DOS])
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  dnl FIXME: simplify this module in 2010 if no one reports a missing rmdir
-  AC_REPLACE_FUNCS([rmdir])
-  if test $ac_cv_func_rmdir = no; then
-    REPLACE_RMDIR=1
-    # If someone lacks rmdir, make configure fail, and request
-    # a bug report to inform us about it.
-    if test x"$SKIP_RMDIR_CHECK" != xyes; then
-      AC_MSG_FAILURE([Your system lacks the rmdir function.
-              Please report this, along with the output of "uname -a", to the
-              bug-coreutils@gnu.org mailing list.  To continue past this point,
-              rerun configure with SKIP_RMDIR_CHECK=yes.
-              E.g., ./configure SKIP_RMDIR_CHECK=yes])
-    fi
-  else
-    dnl Detect cygwin 1.5.x bug.
-    AC_CACHE_CHECK([whether rmdir works], [gl_cv_func_rmdir_works],
-      [mkdir conftest.dir
-       touch conftest.file
-       AC_RUN_IFELSE(
-         [AC_LANG_PROGRAM(
-           [[#include <stdio.h>
-             #include <errno.h>
-             #include <unistd.h>
-]], [[return !rmdir ("conftest.file/") || errno != ENOTDIR
-       || !rmdir ("conftest.dir/./");]])],
-         [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
-         [gl_cv_func_rmdir_works="guessing no"])
-       rm -rf conftest.dir conftest.file])
-    if test x"$gl_cv_func_rmdir_works" != xyes; then
-      REPLACE_RMDIR=1
-      AC_LIBOBJ([rmdir])
-    fi
-  fi
-])
index 06dd16be1bcdc11eb66ed8fc45d320aa909f9da1..30963402c43a67ed0dfb96e70325d6608792dcc0 100644 (file)
@@ -1,12 +1,11 @@
-# serial 9
-dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
+# serial 10
+dnl Copyright (C) 2002-2006, 2009-2012 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.
 
+dnl Prerequisites for lib/save-cwd.c.
 AC_DEFUN([gl_SAVE_CWD],
 [
-  AC_LIBOBJ([save-cwd])
-  dnl Prerequisites for lib/save-cwd.c.
   AC_CHECK_FUNCS_ONCE([fchdir])
 ])
diff --git a/m4/savedir.m4 b/m4/savedir.m4
new file mode 100644 (file)
index 0000000..486a1dd
--- /dev/null
@@ -0,0 +1,11 @@
+# savedir.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2012 Free Software Foundation,
+dnl 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.
+
+AC_DEFUN([gl_SAVEDIR],
+[
+  :
+])
index 2b10bb07f6fdeb58bc2bfa6543214a366cb6be8d..a1cf55b9f7c00c20149497433ae883f4a52d15d7 100644 (file)
@@ -1,6 +1,6 @@
 # Check for a working shell.
 
-# Copyright (C) 2000-2001, 2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2007, 2009-2012 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
 # the Free Software Foundation; either version 3, or (at your option)
@@ -25,52 +25,52 @@ AC_DEFUN([AC_PROG_SHELL],
   [AC_MSG_CHECKING([for a POSIX-compliant shell])
    AC_CACHE_VAL(ac_cv_path_shell,
      [ac_command='
-       # Test the noclobber option, using the portable POSIX.2 syntax.
-       set -C
-       rm -f conftest.c
-       >conftest.c || exit
-       >|conftest.c || exit
-       !>conftest.c || exit
-       # Test that $(...) works.
-       test "$(expr 3 + 4)" -eq 7 || exit
+        # Test the noclobber option, using the portable POSIX.2 syntax.
+        set -C
+        rm -f conftest.c
+        >conftest.c || exit
+        >|conftest.c || exit
+        !>conftest.c || exit
+        # Test that $(...) works.
+        test "$(expr 3 + 4)" -eq 7 || exit
       '
       ac_cv_path_shell=no
 
       case $SHELL in
       (/*)
-       rm -f conftest.c
-       if ("$SHELL" -c "$ac_command") 2>/dev/null; then
-         ac_cv_path_shell=$SHELL
-       fi
+        rm -f conftest.c
+        if ("$SHELL" -c "$ac_command") 2>/dev/null; then
+          ac_cv_path_shell=$SHELL
+        fi
       esac
 
       case $ac_cv_path_shell in
       (no)
-       # Prefer shells that are more likely to be installed in the
-       # same place on all hosts of this platform.  Therefore, prefer
-       # shells in /bin and /usr/bin to shells in the installer's
-       # PATH.  Also, loop through PATH first and then through
-       # shells, since less-"nice" shells in /bin and /usr/bin are
-       # more likely to be installed than "nicer" shells elsewhere.
-       as_save_IFS=$IFS; IFS=:
-       for as_dir in /bin /usr/bin $PATH
-       do
-         IFS=$as_save_IFS
-         case $as_dir in
-         (/*)
-           for ac_base in sh bash ksh sh5; do
-             rm -f conftest.c
-             if ("$as_dir/$ac_base" -c "$ac_command") 2>/dev/null; then
-               ac_cv_path_shell=$as_dir/$ac_base
-               break
-             fi
-           done
-           case $ac_cv_path_shell in
-           (/*) break
-           esac
-         esac
-       done
-       rm -f conftest.c
+        # Prefer shells that are more likely to be installed in the
+        # same place on all hosts of this platform.  Therefore, prefer
+        # shells in /bin and /usr/bin to shells in the installer's
+        # PATH.  Also, loop through PATH first and then through
+        # shells, since less-"nice" shells in /bin and /usr/bin are
+        # more likely to be installed than "nicer" shells elsewhere.
+        as_save_IFS=$IFS; IFS=:
+        for as_dir in /bin /usr/bin $PATH
+        do
+          IFS=$as_save_IFS
+          case $as_dir in
+          (/*)
+            for ac_base in sh bash ksh sh5; do
+              rm -f conftest.c
+              if ("$as_dir/$ac_base" -c "$ac_command") 2>/dev/null; then
+                ac_cv_path_shell=$as_dir/$ac_base
+                break
+              fi
+            done
+            case $ac_cv_path_shell in
+            (/*) break
+            esac
+          esac
+        done
+        rm -f conftest.c
       esac])
    AC_MSG_RESULT($ac_cv_path_shell)
    SHELL=$ac_cv_path_shell
index 56ff825f985c45e461150b80dd15b0949a57ab6a..e9877f68f570a8811e75b0e91bc5902a2af8983a 100644 (file)
@@ -1,5 +1,5 @@
-# signbit.m4 serial 6
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# signbit.m4 serial 12
+dnl Copyright (C) 2007-2012 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.
@@ -7,9 +7,11 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_SIGNBIT],
 [
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([for signbit macro], [gl_cv_func_signbit],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <math.h>
 /* If signbit is defined as a function, don't use it, since calling it for
    'float' or 'long double' arguments would involve conversions.
@@ -23,8 +25,16 @@ AC_DEFUN([gl_SIGNBIT],
 #endif
 #include <string.h>
 ]gl_SIGNBIT_TEST_PROGRAM
-, [gl_cv_func_signbit=yes], [gl_cv_func_signbit=no],
-        [gl_cv_func_signbit="guessing no"])
+])],
+        [gl_cv_func_signbit=yes],
+        [gl_cv_func_signbit=no],
+        [case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_signbit="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_signbit="guessing no" ;;
+         esac
+        ])
     ])
   dnl GCC 4.0 and newer provides three built-ins for signbit.
   dnl They can be used without warnings, also in C++, regardless of <math.h>.
@@ -32,7 +42,8 @@ AC_DEFUN([gl_SIGNBIT],
   dnl libc.
   AC_CACHE_CHECK([for signbit compiler built-ins], [gl_cv_func_signbit_gcc],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #if __GNUC__ >= 4
 # define signbit(x) \
    (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
@@ -43,84 +54,102 @@ AC_DEFUN([gl_SIGNBIT],
 #endif
 #include <string.h>
 ]gl_SIGNBIT_TEST_PROGRAM
-, [gl_cv_func_signbit_gcc=yes], [gl_cv_func_signbit_gcc=no],
-        [gl_cv_func_signbit_gcc="guessing no"])
+])],
+        [gl_cv_func_signbit_gcc=yes],
+        [gl_cv_func_signbit_gcc=no],
+        [case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_signbit_gcc="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_signbit_gcc="guessing no" ;;
+         esac
+        ])
     ])
   dnl Use the compiler built-ins whenever possible, because they are more
   dnl efficient than the system library functions (if they exist).
-  if test "$gl_cv_func_signbit_gcc" = yes; then
-    REPLACE_SIGNBIT_USING_GCC=1
-  else
-    if test "$gl_cv_func_signbit" != yes; then
-      REPLACE_SIGNBIT=1
-      AC_LIBOBJ([signbitf])
-      AC_LIBOBJ([signbitd])
-      AC_LIBOBJ([signbitl])
-      gl_FLOAT_SIGN_LOCATION
-      gl_DOUBLE_SIGN_LOCATION
-      gl_LONG_DOUBLE_SIGN_LOCATION
-      if test "$gl_cv_cc_float_signbit" = unknown; then
-        dnl Test whether copysignf() is declared.
-        AC_CHECK_DECLS([copysignf], , , [#include <math.h>])
-        if test "$ac_cv_have_decl_copysignf" = yes; then
-          dnl Test whether copysignf() can be used without libm.
-          AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
-            [gl_cv_func_copysignf_no_libm],
-            [
-              AC_TRY_LINK([#include <math.h>
-                           float x, y;],
-                          [return copysignf (x, y) < 0;],
-                [gl_cv_func_copysignf_no_libm=yes],
-                [gl_cv_func_copysignf_no_libm=no])
-            ])
-          if test $gl_cv_func_copysignf_no_libm = yes; then
-            AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
-              [Define if the copysignf function is declared in <math.h> and available in libc.])
+  case "$gl_cv_func_signbit_gcc" in
+    *yes)
+      REPLACE_SIGNBIT_USING_GCC=1
+      ;;
+    *)
+      case "$gl_cv_func_signbit" in
+        *yes) ;;
+        *)
+          dnl REPLACE_SIGNBIT=1 makes sure the signbit[fdl] functions get built.
+          REPLACE_SIGNBIT=1
+          gl_FLOAT_SIGN_LOCATION
+          gl_DOUBLE_SIGN_LOCATION
+          gl_LONG_DOUBLE_SIGN_LOCATION
+          if test "$gl_cv_cc_float_signbit" = unknown; then
+            dnl Test whether copysignf() is declared.
+            AC_CHECK_DECLS([copysignf], , , [[#include <math.h>]])
+            if test "$ac_cv_have_decl_copysignf" = yes; then
+              dnl Test whether copysignf() can be used without libm.
+              AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
+                [gl_cv_func_copysignf_no_libm],
+                [
+                  AC_LINK_IFELSE(
+                    [AC_LANG_PROGRAM(
+                       [[#include <math.h>
+                         float x, y;]],
+                       [[return copysignf (x, y) < 0;]])],
+                    [gl_cv_func_copysignf_no_libm=yes],
+                    [gl_cv_func_copysignf_no_libm=no])
+                ])
+              if test $gl_cv_func_copysignf_no_libm = yes; then
+                AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
+                  [Define if the copysignf function is declared in <math.h> and available in libc.])
+              fi
+            fi
           fi
-        fi
-      fi
-      if test "$gl_cv_cc_double_signbit" = unknown; then
-        dnl Test whether copysign() is declared.
-        AC_CHECK_DECLS([copysign], , , [#include <math.h>])
-        if test "$ac_cv_have_decl_copysign" = yes; then
-          dnl Test whether copysign() can be used without libm.
-          AC_CACHE_CHECK([whether copysign can be used without linking with libm],
-            [gl_cv_func_copysign_no_libm],
-            [
-              AC_TRY_LINK([#include <math.h>
-                           double x, y;],
-                          [return copysign (x, y) < 0;],
-                [gl_cv_func_copysign_no_libm=yes],
-                [gl_cv_func_copysign_no_libm=no])
-            ])
-          if test $gl_cv_func_copysign_no_libm = yes; then
-            AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
-              [Define if the copysign function is declared in <math.h> and available in libc.])
+          if test "$gl_cv_cc_double_signbit" = unknown; then
+            dnl Test whether copysign() is declared.
+            AC_CHECK_DECLS([copysign], , , [[#include <math.h>]])
+            if test "$ac_cv_have_decl_copysign" = yes; then
+              dnl Test whether copysign() can be used without libm.
+              AC_CACHE_CHECK([whether copysign can be used without linking with libm],
+                [gl_cv_func_copysign_no_libm],
+                [
+                  AC_LINK_IFELSE(
+                    [AC_LANG_PROGRAM(
+                       [[#include <math.h>
+                         double x, y;]],
+                       [[return copysign (x, y) < 0;]])],
+                    [gl_cv_func_copysign_no_libm=yes],
+                    [gl_cv_func_copysign_no_libm=no])
+                ])
+              if test $gl_cv_func_copysign_no_libm = yes; then
+                AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
+                  [Define if the copysign function is declared in <math.h> and available in libc.])
+              fi
+            fi
           fi
-        fi
-      fi
-      if test "$gl_cv_cc_long_double_signbit" = unknown; then
-        dnl Test whether copysignl() is declared.
-        AC_CHECK_DECLS([copysignl], , , [#include <math.h>])
-        if test "$ac_cv_have_decl_copysignl" = yes; then
-          dnl Test whether copysignl() can be used without libm.
-          AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
-            [gl_cv_func_copysignl_no_libm],
-            [
-              AC_TRY_LINK([#include <math.h>
-                           long double x, y;],
-                          [return copysignl (x, y) < 0;],
-                [gl_cv_func_copysignl_no_libm=yes],
-                [gl_cv_func_copysignl_no_libm=no])
-            ])
-          if test $gl_cv_func_copysignl_no_libm = yes; then
-            AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
-              [Define if the copysignl function is declared in <math.h> and available in libc.])
+          if test "$gl_cv_cc_long_double_signbit" = unknown; then
+            dnl Test whether copysignl() is declared.
+            AC_CHECK_DECLS([copysignl], , , [[#include <math.h>]])
+            if test "$ac_cv_have_decl_copysignl" = yes; then
+              dnl Test whether copysignl() can be used without libm.
+              AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
+                [gl_cv_func_copysignl_no_libm],
+                [
+                  AC_LINK_IFELSE(
+                    [AC_LANG_PROGRAM(
+                       [[#include <math.h>
+                         long double x, y;]],
+                       [[return copysignl (x, y) < 0;]])],
+                    [gl_cv_func_copysignl_no_libm=yes],
+                    [gl_cv_func_copysignl_no_libm=no])
+                ])
+              if test $gl_cv_func_copysignl_no_libm = yes; then
+                AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
+                  [Define if the copysignl function is declared in <math.h> and available in libc.])
+              fi
+            fi
           fi
-        fi
-      fi
-    fi
-  fi
+          ;;
+      esac
+      ;;
+  esac
 ])
 
 AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[
@@ -148,7 +177,8 @@ long double m0l = -LDBL_MIN * LDBL_MIN;
 #else
 long double m0l = -p0l;
 #endif
-  if (signbit (vf))
+  int result = 0;
+  if (signbit (vf)) /* link check */
     vf++;
   {
     float plus_inf = 1.0f / p0f;
@@ -159,9 +189,9 @@ long double m0l = -p0l;
           && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
           && !signbit (plus_inf)
           && signbit (minus_inf)))
-      return 1;
+      result |= 1;
   }
-  if (signbit (vd))
+  if (signbit (vd)) /* link check */
     vd++;
   {
     double plus_inf = 1.0 / p0d;
@@ -172,22 +202,27 @@ long double m0l = -p0l;
           && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
           && !signbit (plus_inf)
           && signbit (minus_inf)))
-      return 1;
+      result |= 2;
   }
-  if (signbit (vl))
+  if (signbit (vl)) /* link check */
     vl++;
   {
     long double plus_inf = 1.0L / p0l;
     long double minus_inf = -1.0L / p0l;
-    if (!(!signbit (255.0L)
-          && signbit (-255.0L)
-          && !signbit (p0l)
-          && (memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l))
-          && !signbit (plus_inf)
-          && signbit (minus_inf)))
-      return 1;
+    if (signbit (255.0L))
+      result |= 4;
+    if (!signbit (-255.0L))
+      result |= 4;
+    if (signbit (p0l))
+      result |= 8;
+    if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)))
+      result |= 16;
+    if (signbit (plus_inf))
+      result |= 32;
+    if (!signbit (minus_inf))
+      result |= 64;
   }
-  return 0;
+  return result;
 }
 ]])
 
@@ -211,7 +246,8 @@ AC_DEFUN([gl_FLOATTYPE_SIGN_LOCATION],
   AC_CACHE_CHECK([where to find the sign bit in a '$1'],
     [$2],
     [
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
 #include <stddef.h>
 #include <stdio.h>
 #define NWORDS \
@@ -236,7 +272,7 @@ int main ()
         {
           /* More than one bit difference.  */
           fprintf (fp, "unknown");
-          return 1;
+          return 2;
         }
       if (x)
         {
@@ -248,7 +284,7 @@ int main ()
     {
       /* No difference.  */
       fprintf (fp, "unknown");
-      return 1;
+      return 3;
     }
   /* Now m = plus.word[k] ^ ~minus.word[k].  */
   if (plus.word[k] & ~minus.word[k])
@@ -256,15 +292,17 @@ int main ()
       /* Oh? The sign bit is set in the positive and cleared in the negative
          numbers?  */
       fprintf (fp, "unknown");
-      return 1;
+      return 4;
     }
   for (i = 0; ; i++)
     if ((m >> i) & 1)
       break;
   fprintf (fp, "word %d bit %d", (int) k, (int) i);
-  return (fclose (fp) != 0);
+  if (fclose (fp) != 0)
+    return 5;
+  return 0;
 }
-        ],
+        ]])],
         [$2=`cat conftest.out`],
         [$2="unknown"],
         [
@@ -285,3 +323,43 @@ int main ()
       ;;
   esac
 ])
+
+# Expands to code that defines a function signbitf(float).
+# It extracts the sign bit of a non-NaN value.
+AC_DEFUN([gl_FLOAT_SIGNBIT_CODE],
+[
+  gl_FLOATTYPE_SIGNBIT_CODE([float], [f], [f])
+])
+
+# Expands to code that defines a function signbitd(double).
+# It extracts the sign bit of a non-NaN value.
+AC_DEFUN([gl_DOUBLE_SIGNBIT_CODE],
+[
+  gl_FLOATTYPE_SIGNBIT_CODE([double], [d], [])
+])
+
+# Expands to code that defines a function signbitl(long double).
+# It extracts the sign bit of a non-NaN value.
+AC_DEFUN([gl_LONG_DOUBLE_SIGNBIT_CODE],
+[
+  gl_FLOATTYPE_SIGNBIT_CODE([long double], [l], [L])
+])
+
+AC_DEFUN([gl_FLOATTYPE_SIGNBIT_CODE],
+[[
+static int
+signbit$2 ($1 value)
+{
+  typedef union { $1 f; unsigned char b[sizeof ($1)]; } float_union;
+  static float_union plus_one = { 1.0$3 };   /* unused bits are zero here */
+  static float_union minus_one = { -1.0$3 }; /* unused bits are zero here */
+  /* Compute the sign bit mask as the XOR of plus_one and minus_one.  */
+  float_union u;
+  unsigned int i;
+  u.f = value;
+  for (i = 0; i < sizeof ($1); i++)
+    if (u.b[i] & (plus_one.b[i] ^ minus_one.b[i]))
+      return 1;
+  return 0;
+}
+]])
index ce992db1f18336a0775f3bd98bdd12cdb7e4e70f..5a8162bc1eebb82c0555105941d3b97478af7c7c 100644 (file)
@@ -1,5 +1,5 @@
-# size_max.m4 serial 9
-dnl Copyright (C) 2003, 2005-2006, 2008-2010 Free Software Foundation, Inc.
+# size_max.m4 serial 10
+dnl Copyright (C) 2003, 2005-2006, 2008-2012 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.
@@ -34,10 +34,14 @@ Found it
         if test $fits_in_uint = 1; then
           dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
           dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
-          AC_TRY_COMPILE([#include <stddef.h>
-            extern size_t foo;
-            extern unsigned long foo;
-            ], [], [fits_in_uint=0])
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM(
+               [[#include <stddef.h>
+                 extern size_t foo;
+                 extern unsigned long foo;
+               ]],
+               [[]])],
+            [fits_in_uint=0])
         fi
         dnl We cannot use 'expr' to simplify this expression, because 'expr'
         dnl works only with 'long' integers in the host environment, while we
diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4
new file mode 100644 (file)
index 0000000..209d64c
--- /dev/null
@@ -0,0 +1,23 @@
+# ssize_t.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2001-2003, 2006, 2010-2012 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.
+
+dnl From Bruno Haible.
+dnl Test whether ssize_t is defined.
+
+AC_DEFUN([gt_TYPE_SSIZE_T],
+[
+  AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <sys/types.h>]],
+          [[int x = sizeof (ssize_t *) + sizeof (ssize_t);
+            return !x;]])],
+       [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])])
+  if test $gt_cv_ssize_t = no; then
+    AC_DEFINE([ssize_t], [int],
+              [Define as a signed type of the same size as size_t.])
+  fi
+])
index e653c4341ea1f45fd205649c0bad8e21058de7b8..2dbb1f3c7521addb3b5c51b73c5ba7c304f05d39 100644 (file)
@@ -1,6 +1,6 @@
 # Checks for stat-related time functions.
 
-# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2010 Free Software
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2012 Free Software
 # Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
index acd32d86a084ea6cbfcbd47bf1c3a756b94ccf61..a8b79f5bcbaad568ac3e245fc0f10a8426fcbe9c 100644 (file)
@@ -1,6 +1,6 @@
-# serial 4
+# serial 10
 
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,6 @@
 AC_DEFUN([gl_FUNC_STAT],
 [
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_REQUIRE([gl_AC_DOS])
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
   AC_CHECK_FUNCS_ONCE([lstat])
   dnl mingw is the only known platform where stat(".") and stat("./") differ
@@ -24,8 +23,9 @@ AC_DEFUN([gl_FUNC_STAT],
             mingw*) gl_cv_func_stat_dir_slash="guessing no";;
             *) gl_cv_func_stat_dir_slash="guessing yes";;
           esac])])
-  dnl Solaris 9 mistakenly succeeds on stat("file/")
-  dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/")
+  dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
+  dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
+  dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
   AC_CACHE_CHECK([whether stat handles trailing slashes on files],
       [gl_cv_func_stat_file_slash],
       [touch conftest.tmp
@@ -36,14 +36,24 @@ AC_DEFUN([gl_FUNC_STAT],
        AC_RUN_IFELSE(
          [AC_LANG_PROGRAM(
            [[#include <sys/stat.h>
-]], [[struct stat st;
-      if (!stat ("conftest.tmp/", &st)) return 1;
+]], [[int result = 0;
+      struct stat st;
+      if (!stat ("conftest.tmp/", &st))
+        result |= 1;
 #if HAVE_LSTAT
-      if (!stat ("conftest.lnk/", &st)) return 2;
+      if (!stat ("conftest.lnk/", &st))
+        result |= 2;
 #endif
+      return result;
            ]])],
          [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
-         [gl_cv_func_stat_file_slash="guessing no"])
+         [case "$host_os" in
+                    # Guess yes on glibc systems.
+            *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
+                    # If we don't know, assume the worst.
+            *)      gl_cv_func_stat_file_slash="guessing no" ;;
+          esac
+         ])
        rm -f conftest.tmp conftest.lnk])
   case $gl_cv_func_stat_dir_slash in
     *no) REPLACE_STAT=1
@@ -55,9 +65,11 @@ AC_DEFUN([gl_FUNC_STAT],
       AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
         help when passed a file name with a trailing slash]);;
   esac
-  if test $REPLACE_STAT = 1; then
-    AC_LIBOBJ([stat])
-    dnl Prerequisites of lib/stat.c.
-    AC_REQUIRE([AC_C_INLINE])
-  fi
+])
+
+# Prerequisites of lib/stat.c.
+AC_DEFUN([gl_PREREQ_STAT],
+[
+  AC_REQUIRE([AC_C_INLINE])
+  :
 ])
index 3d672d7476b217bdc8777d6759f1f3bc5c53343d..eabfa64579c2d7007ec404a146131053ee2fd407 100644 (file)
@@ -1,15 +1,17 @@
 # Check for stdbool.h that conforms to C99.
 
-dnl Copyright (C) 2002-2006, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2012 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.
 
+#serial 5
+
 # Prepare for substituting <stdbool.h> if it is not supported.
 
 AC_DEFUN([AM_STDBOOL_H],
 [
-  AC_REQUIRE([AC_HEADER_STDBOOL])
+  AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
 
   # Define two additional variables used in the Makefile substitution.
 
@@ -19,6 +21,7 @@ AC_DEFUN([AM_STDBOOL_H],
     STDBOOL_H='stdbool.h'
   fi
   AC_SUBST([STDBOOL_H])
+  AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"])
 
   if test "$ac_cv_type__Bool" = yes; then
     HAVE__BOOL=1
@@ -31,85 +34,67 @@ AC_DEFUN([AM_STDBOOL_H],
 # AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
 AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
 
-# This macro is only needed in autoconf <= 2.59.  Newer versions of autoconf
-# have this macro built-in.
+# This version of the macro is needed in autoconf <= 2.68.
 
-AC_DEFUN([AC_HEADER_STDBOOL],
+AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
   [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
      [ac_cv_header_stdbool_h],
-     [AC_TRY_COMPILE(
-        [
-          #include <stdbool.h>
-          #ifndef bool
-           "error: bool is not defined"
-          #endif
-          #ifndef false
-           "error: false is not defined"
-          #endif
-          #if false
-           "error: false is not 0"
-          #endif
-          #ifndef true
-           "error: true is not defined"
-          #endif
-          #if true != 1
-           "error: true is not 1"
-          #endif
-          #ifndef __bool_true_false_are_defined
-           "error: __bool_true_false_are_defined is not defined"
-          #endif
+     [AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[
+             #include <stdbool.h>
+             #ifndef bool
+              "error: bool is not defined"
+             #endif
+             #ifndef false
+              "error: false is not defined"
+             #endif
+             #if false
+              "error: false is not 0"
+             #endif
+             #ifndef true
+              "error: true is not defined"
+             #endif
+             #if true != 1
+              "error: true is not 1"
+             #endif
+             #ifndef __bool_true_false_are_defined
+              "error: __bool_true_false_are_defined is not defined"
+             #endif
 
-          struct s { _Bool s: 1; _Bool t; } s;
+             struct s { _Bool s: 1; _Bool t; } s;
 
-          char a[true == 1 ? 1 : -1];
-          char b[false == 0 ? 1 : -1];
-          char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-          char d[(bool) 0.5 == true ? 1 : -1];
-          bool e = &s;
-          char f[(_Bool) 0.0 == false ? 1 : -1];
-          char g[true];
-          char h[sizeof (_Bool)];
-          char i[sizeof s.t];
-          enum { j = false, k = true, l = false * true, m = true * 256 };
-          _Bool n[m];
-          char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-          char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-          #if defined __xlc__ || defined __GNUC__
-           /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-              reported by James Lemley on 2005-10-05; see
-              http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-              This test is not quite right, since xlc is allowed to
-              reject this program, as the initializer for xlcbug is
-              not one of the forms that C requires support for.
-              However, doing the test right would require a run-time
-              test, and that would make cross-compilation harder.
-              Let us hope that IBM fixes the xlc bug, and also adds
-              support for this kind of constant expression.  In the
-              meantime, this test will reject xlc, which is OK, since
-              our stdbool.h substitute should suffice.  We also test
-              this with GCC, where it should work, to detect more
-              quickly whether someone messes up the test in the
-              future.  */
-           char digs[] = "0123456789";
-           int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-          #endif
-          /* Catch a bug in an HP-UX C compiler.  See
-             http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-             http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-           */
-          _Bool q = true;
-          _Bool *pq = &q;
-        ],
-        [
-          *pq |= q;
-          *pq |= ! q;
-          /* Refer to every declared value, to avoid compiler optimizations.  */
-          return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-                  + !m + !n + !o + !p + !q + !pq);
-        ],
+             char a[true == 1 ? 1 : -1];
+             char b[false == 0 ? 1 : -1];
+             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+             char d[(bool) 0.5 == true ? 1 : -1];
+             /* See body of main program for 'e'.  */
+             char f[(_Bool) 0.0 == false ? 1 : -1];
+             char g[true];
+             char h[sizeof (_Bool)];
+             char i[sizeof s.t];
+             enum { j = false, k = true, l = false * true, m = true * 256 };
+             /* The following fails for
+                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+             _Bool n[m];
+             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+             char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+             /* Catch a bug in an HP-UX C compiler.  See
+                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+              */
+             _Bool q = true;
+             _Bool *pq = &q;
+           ]],
+           [[
+             bool e = &s;
+             *pq |= q;
+             *pq |= ! q;
+             /* Refer to every declared value, to avoid compiler optimizations.  */
+             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                     + !m + !n + !o + !p + !q + !pq);
+           ]])],
         [ac_cv_header_stdbool_h=yes],
         [ac_cv_header_stdbool_h=no])])
    AC_CHECK_TYPES([_Bool])
-   if test $ac_cv_header_stdbool_h = yes; then
-     AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.])
-   fi])
+])
index c8572de947dcd3fe6492189ec54b7811c4c9f4d0..cc116096093401ce22232c7ffe21c47051e33832 100644 (file)
@@ -1,6 +1,6 @@
 dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 1
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# stddef_h.m4 serial 4
+dnl Copyright (C) 2009-2012 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.
@@ -9,6 +9,7 @@ AC_DEFUN([gl_STDDEF_H],
 [
   AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
+  STDDEF_H=
   if test $gt_cv_c_wchar_t = no; then
     HAVE_WCHAR_T=0
     STDDEF_H=stddef.h
@@ -24,8 +25,10 @@ AC_DEFUN([gl_STDDEF_H],
     REPLACE_NULL=1
     STDDEF_H=stddef.h
   fi
+  AC_SUBST([STDDEF_H])
+  AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"])
   if test -n "$STDDEF_H"; then
-    gl_CHECK_NEXT_HEADERS([stddef.h])
+    gl_NEXT_HEADERS([stddef.h])
   fi
 ])
 
@@ -33,7 +36,7 @@ AC_DEFUN([gl_STDDEF_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
 ])
 
 AC_DEFUN([gl_STDDEF_H_DEFAULTS],
@@ -41,5 +44,4 @@ AC_DEFUN([gl_STDDEF_H_DEFAULTS],
   dnl Assume proper GNU behavior unless another module says otherwise.
   REPLACE_NULL=0;                AC_SUBST([REPLACE_NULL])
   HAVE_WCHAR_T=1;                AC_SUBST([HAVE_WCHAR_T])
-  STDDEF_H='';                   AC_SUBST([STDDEF_H])
 ])
index 1cc57e6e9608a820725378eb081e253c6e35806f..28d342ea233527ce1676208f176137f4104a1407 100644 (file)
@@ -1,5 +1,5 @@
-# stdint.m4 serial 34
-dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
+# stdint.m4 serial 43
+dnl Copyright (C) 2001-2012 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.
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 dnl From Paul Eggert and Bruno Haible.
 dnl Test whether <stdint.h> is supported or must be substituted.
 
-AC_DEFUN([gl_STDINT_H],
+AC_DEFUN_ONCE([gl_STDINT_H],
 [
   AC_PREREQ([2.59])dnl
 
@@ -27,6 +27,15 @@ AC_DEFUN([gl_STDINT_H],
   fi
   AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT])
 
+  dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does.
+  AC_CHECK_HEADERS_ONCE([wchar.h])
+  if test $ac_cv_header_wchar_h = yes; then
+    HAVE_WCHAR_H=1
+  else
+    HAVE_WCHAR_H=0
+  fi
+  AC_SUBST([HAVE_WCHAR_H])
+
   dnl Check for <inttypes.h>.
   dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
   if test $ac_cv_header_inttypes_h = yes; then
@@ -60,8 +69,6 @@ AC_DEFUN([gl_STDINT_H],
       [gl_cv_header_working_stdint_h=no
        AC_COMPILE_IFELSE([
          AC_LANG_PROGRAM([[
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
 #include <stdint.h>
 /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
@@ -145,9 +152,11 @@ uintmax_t j = UINTMAX_MAX;
 
 #include <limits.h> /* for CHAR_BIT */
 #define TYPE_MINIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
+  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
 #define TYPE_MAXIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
+  ((t) ((t) 0 < (t) -1 \
+        ? (t) -1 \
+        : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
 struct s {
   int check_PTRDIFF:
       PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
@@ -208,8 +217,6 @@ struct s {
           dnl This detects a bug on HP-UX 11.23/ia64.
           AC_RUN_IFELSE([
             AC_LANG_PROGRAM([[
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
 #include <stdint.h>
 ]
@@ -259,7 +266,7 @@ static const char *macro_values[] =
           || strncmp (value, "((int)"/*)*/, 6) == 0
           || strncmp (value, "((signed short)"/*)*/, 15) == 0
           || strncmp (value, "((signed char)"/*)*/, 14) == 0)
-        return 1;
+        return mv - macro_values + 1;
     }
   return 0;
 ]])],
@@ -290,14 +297,11 @@ static const char *macro_values[] =
     fi
     AC_SUBST([HAVE_SYS_BITYPES_H])
 
-    dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
-    dnl character support).
-    AC_CHECK_HEADERS_ONCE([wchar.h])
-
     gl_STDINT_TYPE_PROPERTIES
     STDINT_H=stdint.h
   fi
   AC_SUBST([STDINT_H])
+  AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"])
 ])
 
 dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
@@ -309,7 +313,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
   m4_foreach_w([gltype], [$1],
-    [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+    [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
        [Define to the number of bits in type ']gltype['.])])
   for gltype in $1 ; do
     AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}],
@@ -334,7 +338,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
     eval BITSIZEOF_${GLTYPE}=\$result
   done
   m4_foreach_w([gltype], [$1],
-    [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+    [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
 ])
 
 dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES)
@@ -347,7 +351,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
   m4_foreach_w([gltype], [$1],
-    [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+    [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
        [Define to 1 if ']gltype[' is a signed integer type.])])
   for gltype in $1 ; do
     AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed],
@@ -367,7 +371,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
     fi
   done
   m4_foreach_w([gltype], [$1],
-    [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+    [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
 ])
 
 dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES)
@@ -380,7 +384,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
   m4_foreach_w([gltype], [$1],
-    [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
+    [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
        [Define to l, ll, u, ul, ull, etc., as suitable for
         constants of type ']gltype['.])])
   for gltype in $1 ; do
@@ -419,7 +423,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
     AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result])
   done
   m4_foreach_w([gltype], [$1],
-    [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
+    [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
 ])
 
 dnl gl_STDINT_INCLUDES
@@ -458,6 +462,14 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
   fi
   gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
     [gl_STDINT_INCLUDES])
+
+  dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99
+  dnl requirement that wint_t is "unchanged by default argument promotions".
+  dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t.
+  dnl Set the variable BITSIZEOF_WINT_T accordingly.
+  if test $BITSIZEOF_WINT_T -lt 32; then
+    BITSIZEOF_WINT_T=32
+  fi
 ])
 
 dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
index b8e3c6cc711f17ab409131b9411ea51fe23d8d01..581de960492ff32cf7a2e2612c274f219c093b4f 100644 (file)
@@ -1,5 +1,5 @@
-# stdint_h.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc.
+# stdint_h.m4 serial 9
+dnl Copyright (C) 1997-2004, 2006, 2008-2012 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.
@@ -12,12 +12,13 @@ dnl From Paul Eggert.
 AC_DEFUN([gl_AC_HEADER_STDINT_H],
 [
   AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h],
-  [AC_TRY_COMPILE(
-    [#include <sys/types.h>
-#include <stdint.h>],
-    [uintmax_t i = (uintmax_t) -1; return !i;],
-    [gl_cv_header_stdint_h=yes],
-    [gl_cv_header_stdint_h=no])])
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <sys/types.h>
+            #include <stdint.h>]],
+          [[uintmax_t i = (uintmax_t) -1; return !i;]])],
+       [gl_cv_header_stdint_h=yes],
+       [gl_cv_header_stdint_h=no])])
   if test $gl_cv_header_stdint_h = yes; then
     AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1],
       [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
index be79896d5712a69383611f88f9d25125b0f95ce0..b03393b957b51c023204587495c83825e9770242 100644 (file)
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 23
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# stdio_h.m4 serial 41
+dnl Copyright (C) 2007-2012 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.
@@ -8,7 +8,30 @@ AC_DEFUN([gl_STDIO_H],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([AC_C_INLINE])
-  gl_CHECK_NEXT_HEADERS([stdio.h])
+  gl_NEXT_HEADERS([stdio.h])
+
+  dnl No need to create extra modules for these functions. Everyone who uses
+  dnl <stdio.h> likely needs them.
+  GNULIB_FSCANF=1
+  GNULIB_SCANF=1
+  GNULIB_FGETC=1
+  GNULIB_GETC=1
+  GNULIB_GETCHAR=1
+  GNULIB_FGETS=1
+  GNULIB_FREAD=1
+  dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c"
+  dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+  dnl also an optimization, to avoid performing a configure check whose result
+  dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+  dnl or GNULIB_NONBLOCKING redundant.
+  m4_ifdef([gl_NONBLOCKING_IO], [
+    gl_NONBLOCKING_IO
+    if test $gl_cv_have_nonblocking != yes; then
+      REPLACE_STDIO_READ_FUNCS=1
+      AC_LIBOBJ([stdio-read])
+    fi
+  ])
+
   dnl No need to create extra modules for these functions. Everyone who uses
   dnl <stdio.h> likely needs them.
   GNULIB_FPRINTF=1
@@ -21,9 +44,11 @@ AC_DEFUN([gl_STDIO_H],
   GNULIB_FPUTS=1
   GNULIB_PUTS=1
   GNULIB_FWRITE=1
-  dnl This ifdef is just an optimization, to avoid performing a configure
-  dnl check whose result is not used. It does not make the test of
-  dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
+  dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
+  dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+  dnl also an optimization, to avoid performing a configure check whose result
+  dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or
+  dnl GNULIB_SIGPIPE redundant.
   m4_ifdef([gl_SIGNAL_SIGPIPE], [
     gl_SIGNAL_SIGPIPE
     if test $gl_cv_header_signal_h_SIGPIPE != yes; then
@@ -31,42 +56,65 @@ AC_DEFUN([gl_STDIO_H],
       AC_LIBOBJ([stdio-write])
     fi
   ])
+  dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
+  dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+  dnl also an optimization, to avoid performing a configure check whose result
+  dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+  dnl or GNULIB_NONBLOCKING redundant.
+  m4_ifdef([gl_NONBLOCKING_IO], [
+    gl_NONBLOCKING_IO
+    if test $gl_cv_have_nonblocking != yes; then
+      REPLACE_STDIO_WRITE_FUNCS=1
+      AC_LIBOBJ([stdio-write])
+    fi
+  ])
 
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use, and which is not
-  dnl guaranteed by C89.
+  dnl guaranteed by both C89 and C11.
   gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
-    ]], [fseeko ftello])
+    ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen
+    renameat snprintf tmpfile vdprintf vsnprintf])
 ])
 
 AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_STDIO_H_DEFAULTS],
 [
   GNULIB_DPRINTF=0;              AC_SUBST([GNULIB_DPRINTF])
   GNULIB_FCLOSE=0;               AC_SUBST([GNULIB_FCLOSE])
+  GNULIB_FDOPEN=0;               AC_SUBST([GNULIB_FDOPEN])
   GNULIB_FFLUSH=0;               AC_SUBST([GNULIB_FFLUSH])
+  GNULIB_FGETC=0;                AC_SUBST([GNULIB_FGETC])
+  GNULIB_FGETS=0;                AC_SUBST([GNULIB_FGETS])
   GNULIB_FOPEN=0;                AC_SUBST([GNULIB_FOPEN])
   GNULIB_FPRINTF=0;              AC_SUBST([GNULIB_FPRINTF])
   GNULIB_FPRINTF_POSIX=0;        AC_SUBST([GNULIB_FPRINTF_POSIX])
   GNULIB_FPURGE=0;               AC_SUBST([GNULIB_FPURGE])
   GNULIB_FPUTC=0;                AC_SUBST([GNULIB_FPUTC])
   GNULIB_FPUTS=0;                AC_SUBST([GNULIB_FPUTS])
+  GNULIB_FREAD=0;                AC_SUBST([GNULIB_FREAD])
   GNULIB_FREOPEN=0;              AC_SUBST([GNULIB_FREOPEN])
+  GNULIB_FSCANF=0;               AC_SUBST([GNULIB_FSCANF])
   GNULIB_FSEEK=0;                AC_SUBST([GNULIB_FSEEK])
   GNULIB_FSEEKO=0;               AC_SUBST([GNULIB_FSEEKO])
   GNULIB_FTELL=0;                AC_SUBST([GNULIB_FTELL])
   GNULIB_FTELLO=0;               AC_SUBST([GNULIB_FTELLO])
   GNULIB_FWRITE=0;               AC_SUBST([GNULIB_FWRITE])
+  GNULIB_GETC=0;                 AC_SUBST([GNULIB_GETC])
+  GNULIB_GETCHAR=0;              AC_SUBST([GNULIB_GETCHAR])
   GNULIB_GETDELIM=0;             AC_SUBST([GNULIB_GETDELIM])
   GNULIB_GETLINE=0;              AC_SUBST([GNULIB_GETLINE])
   GNULIB_OBSTACK_PRINTF=0;       AC_SUBST([GNULIB_OBSTACK_PRINTF])
   GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
+  GNULIB_PCLOSE=0;               AC_SUBST([GNULIB_PCLOSE])
   GNULIB_PERROR=0;               AC_SUBST([GNULIB_PERROR])
   GNULIB_POPEN=0;                AC_SUBST([GNULIB_POPEN])
   GNULIB_PRINTF=0;               AC_SUBST([GNULIB_PRINTF])
@@ -77,10 +125,15 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
   GNULIB_REMOVE=0;               AC_SUBST([GNULIB_REMOVE])
   GNULIB_RENAME=0;               AC_SUBST([GNULIB_RENAME])
   GNULIB_RENAMEAT=0;             AC_SUBST([GNULIB_RENAMEAT])
+  GNULIB_SCANF=0;                AC_SUBST([GNULIB_SCANF])
   GNULIB_SNPRINTF=0;             AC_SUBST([GNULIB_SNPRINTF])
   GNULIB_SPRINTF_POSIX=0;        AC_SUBST([GNULIB_SPRINTF_POSIX])
+  GNULIB_STDIO_H_NONBLOCKING=0;  AC_SUBST([GNULIB_STDIO_H_NONBLOCKING])
   GNULIB_STDIO_H_SIGPIPE=0;      AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
+  GNULIB_TMPFILE=0;              AC_SUBST([GNULIB_TMPFILE])
   GNULIB_VASPRINTF=0;            AC_SUBST([GNULIB_VASPRINTF])
+  GNULIB_VFSCANF=0;              AC_SUBST([GNULIB_VFSCANF])
+  GNULIB_VSCANF=0;               AC_SUBST([GNULIB_VSCANF])
   GNULIB_VDPRINTF=0;             AC_SUBST([GNULIB_VDPRINTF])
   GNULIB_VFPRINTF=0;             AC_SUBST([GNULIB_VFPRINTF])
   GNULIB_VFPRINTF_POSIX=0;       AC_SUBST([GNULIB_VFPRINTF_POSIX])
@@ -90,17 +143,24 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
   GNULIB_VSPRINTF_POSIX=0;       AC_SUBST([GNULIB_VSPRINTF_POSIX])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DECL_FPURGE=1;            AC_SUBST([HAVE_DECL_FPURGE])
+  HAVE_DECL_FSEEKO=1;            AC_SUBST([HAVE_DECL_FSEEKO])
+  HAVE_DECL_FTELLO=1;            AC_SUBST([HAVE_DECL_FTELLO])
   HAVE_DECL_GETDELIM=1;          AC_SUBST([HAVE_DECL_GETDELIM])
   HAVE_DECL_GETLINE=1;           AC_SUBST([HAVE_DECL_GETLINE])
   HAVE_DECL_OBSTACK_PRINTF=1;    AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
   HAVE_DECL_SNPRINTF=1;          AC_SUBST([HAVE_DECL_SNPRINTF])
   HAVE_DECL_VSNPRINTF=1;         AC_SUBST([HAVE_DECL_VSNPRINTF])
   HAVE_DPRINTF=1;                AC_SUBST([HAVE_DPRINTF])
+  HAVE_FSEEKO=1;                 AC_SUBST([HAVE_FSEEKO])
+  HAVE_FTELLO=1;                 AC_SUBST([HAVE_FTELLO])
+  HAVE_PCLOSE=1;                 AC_SUBST([HAVE_PCLOSE])
+  HAVE_POPEN=1;                  AC_SUBST([HAVE_POPEN])
   HAVE_RENAMEAT=1;               AC_SUBST([HAVE_RENAMEAT])
   HAVE_VASPRINTF=1;              AC_SUBST([HAVE_VASPRINTF])
   HAVE_VDPRINTF=1;               AC_SUBST([HAVE_VDPRINTF])
   REPLACE_DPRINTF=0;             AC_SUBST([REPLACE_DPRINTF])
   REPLACE_FCLOSE=0;              AC_SUBST([REPLACE_FCLOSE])
+  REPLACE_FDOPEN=0;              AC_SUBST([REPLACE_FDOPEN])
   REPLACE_FFLUSH=0;              AC_SUBST([REPLACE_FFLUSH])
   REPLACE_FOPEN=0;               AC_SUBST([REPLACE_FOPEN])
   REPLACE_FPRINTF=0;             AC_SUBST([REPLACE_FPRINTF])
@@ -110,6 +170,7 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
   REPLACE_FSEEKO=0;              AC_SUBST([REPLACE_FSEEKO])
   REPLACE_FTELL=0;               AC_SUBST([REPLACE_FTELL])
   REPLACE_FTELLO=0;              AC_SUBST([REPLACE_FTELLO])
+  REPLACE_GETDELIM=0;            AC_SUBST([REPLACE_GETDELIM])
   REPLACE_GETLINE=0;             AC_SUBST([REPLACE_GETLINE])
   REPLACE_OBSTACK_PRINTF=0;      AC_SUBST([REPLACE_OBSTACK_PRINTF])
   REPLACE_PERROR=0;              AC_SUBST([REPLACE_PERROR])
@@ -120,7 +181,9 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
   REPLACE_RENAMEAT=0;            AC_SUBST([REPLACE_RENAMEAT])
   REPLACE_SNPRINTF=0;            AC_SUBST([REPLACE_SNPRINTF])
   REPLACE_SPRINTF=0;             AC_SUBST([REPLACE_SPRINTF])
+  REPLACE_STDIO_READ_FUNCS=0;    AC_SUBST([REPLACE_STDIO_READ_FUNCS])
   REPLACE_STDIO_WRITE_FUNCS=0;   AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
+  REPLACE_TMPFILE=0;             AC_SUBST([REPLACE_TMPFILE])
   REPLACE_VASPRINTF=0;           AC_SUBST([REPLACE_VASPRINTF])
   REPLACE_VDPRINTF=0;            AC_SUBST([REPLACE_VDPRINTF])
   REPLACE_VFPRINTF=0;            AC_SUBST([REPLACE_VFPRINTF])
@@ -128,23 +191,3 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
   REPLACE_VSNPRINTF=0;           AC_SUBST([REPLACE_VSNPRINTF])
   REPLACE_VSPRINTF=0;            AC_SUBST([REPLACE_VSPRINTF])
 ])
-
-dnl Code shared by fseeko and ftello.  Determine if large files are supported,
-dnl but stdin does not start as a large file by default.
-AC_DEFUN([gl_STDIN_LARGE_OFFSET],
-  [
-    AC_CACHE_CHECK([whether stdin defaults to large file offsets],
-      [gl_cv_var_stdin_large_offset],
-      [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
-[[#if defined __SL64 && defined __SCLE /* cygwin */
-  /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
-     fseeko/ftello needlessly fail.  This bug was fixed in 1.5.25, and
-     it is easier to do a version check than building a runtime test.  */
-# include <cygwin/version.h>
-# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
-  choke me
-# endif
-#endif]])],
-        [gl_cv_var_stdin_large_offset=yes],
-        [gl_cv_var_stdin_large_offset=no])])
-])
index cf41ec0fc0824fe58b7ccc21cf03233ed7837ba6..ab43728ace41a4ce331571421396fbbe8ce867cb 100644 (file)
@@ -1,5 +1,5 @@
-# stdlib_h.m4 serial 21
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 41
+dnl Copyright (C) 2007-2012 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.
@@ -7,44 +7,55 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_STDLIB_H],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
-  gl_CHECK_NEXT_HEADERS([stdlib.h])
-  AC_CHECK_HEADERS([random.h], [], [], [AC_INCLUDES_DEFAULT])
-  if test $ac_cv_header_random_h = yes; then
-    HAVE_RANDOM_H=1
-  else
-    HAVE_RANDOM_H=0
-  fi
-  AC_SUBST([HAVE_RANDOM_H])
-  AC_CHECK_TYPES([struct random_data],
-    [], [HAVE_STRUCT_RANDOM_DATA=0],
-    [[#include <stdlib.h>
-      #if HAVE_RANDOM_H
-      # include <random.h>
-      #endif
-    ]])
+  gl_NEXT_HEADERS([stdlib.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, and which is not
+  dnl guaranteed by C89.
+  gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
+#if HAVE_SYS_LOADAVG_H
+# include <sys/loadavg.h>
+#endif
+#if HAVE_RANDOM_H
+# include <random.h>
+#endif
+    ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
+    initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
+    posix_openpt ptsname ptsname_r random random_r realpath rpmatch
+    setenv setstate setstate_r srandom srandom_r
+    strtod strtoll strtoull unlockpt unsetenv])
 ])
 
 AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_STDLIB_H_DEFAULTS],
 [
+  GNULIB__EXIT=0;         AC_SUBST([GNULIB__EXIT])
   GNULIB_ATOLL=0;         AC_SUBST([GNULIB_ATOLL])
   GNULIB_CALLOC_POSIX=0;  AC_SUBST([GNULIB_CALLOC_POSIX])
   GNULIB_CANONICALIZE_FILE_NAME=0;  AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME])
   GNULIB_GETLOADAVG=0;    AC_SUBST([GNULIB_GETLOADAVG])
   GNULIB_GETSUBOPT=0;     AC_SUBST([GNULIB_GETSUBOPT])
+  GNULIB_GRANTPT=0;       AC_SUBST([GNULIB_GRANTPT])
   GNULIB_MALLOC_POSIX=0;  AC_SUBST([GNULIB_MALLOC_POSIX])
+  GNULIB_MBTOWC=0;        AC_SUBST([GNULIB_MBTOWC])
   GNULIB_MKDTEMP=0;       AC_SUBST([GNULIB_MKDTEMP])
   GNULIB_MKOSTEMP=0;      AC_SUBST([GNULIB_MKOSTEMP])
   GNULIB_MKOSTEMPS=0;     AC_SUBST([GNULIB_MKOSTEMPS])
   GNULIB_MKSTEMP=0;       AC_SUBST([GNULIB_MKSTEMP])
   GNULIB_MKSTEMPS=0;      AC_SUBST([GNULIB_MKSTEMPS])
+  GNULIB_POSIX_OPENPT=0;  AC_SUBST([GNULIB_POSIX_OPENPT])
+  GNULIB_PTSNAME=0;       AC_SUBST([GNULIB_PTSNAME])
+  GNULIB_PTSNAME_R=0;     AC_SUBST([GNULIB_PTSNAME_R])
   GNULIB_PUTENV=0;        AC_SUBST([GNULIB_PUTENV])
+  GNULIB_RANDOM=0;        AC_SUBST([GNULIB_RANDOM])
   GNULIB_RANDOM_R=0;      AC_SUBST([GNULIB_RANDOM_R])
   GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
   GNULIB_REALPATH=0;      AC_SUBST([GNULIB_REALPATH])
@@ -53,34 +64,51 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   GNULIB_STRTOD=0;        AC_SUBST([GNULIB_STRTOD])
   GNULIB_STRTOLL=0;       AC_SUBST([GNULIB_STRTOLL])
   GNULIB_STRTOULL=0;      AC_SUBST([GNULIB_STRTOULL])
+  GNULIB_SYSTEM_POSIX=0;  AC_SUBST([GNULIB_SYSTEM_POSIX])
+  GNULIB_UNLOCKPT=0;      AC_SUBST([GNULIB_UNLOCKPT])
   GNULIB_UNSETENV=0;      AC_SUBST([GNULIB_UNSETENV])
+  GNULIB_WCTOMB=0;        AC_SUBST([GNULIB_WCTOMB])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE__EXIT=1;              AC_SUBST([HAVE__EXIT])
   HAVE_ATOLL=1;              AC_SUBST([HAVE_ATOLL])
-  HAVE_CALLOC_POSIX=1;       AC_SUBST([HAVE_CALLOC_POSIX])
   HAVE_CANONICALIZE_FILE_NAME=1;  AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
   HAVE_DECL_GETLOADAVG=1;    AC_SUBST([HAVE_DECL_GETLOADAVG])
   HAVE_GETSUBOPT=1;          AC_SUBST([HAVE_GETSUBOPT])
-  HAVE_MALLOC_POSIX=1;       AC_SUBST([HAVE_MALLOC_POSIX])
+  HAVE_GRANTPT=1;            AC_SUBST([HAVE_GRANTPT])
   HAVE_MKDTEMP=1;            AC_SUBST([HAVE_MKDTEMP])
   HAVE_MKOSTEMP=1;           AC_SUBST([HAVE_MKOSTEMP])
   HAVE_MKOSTEMPS=1;          AC_SUBST([HAVE_MKOSTEMPS])
+  HAVE_MKSTEMP=1;            AC_SUBST([HAVE_MKSTEMP])
   HAVE_MKSTEMPS=1;           AC_SUBST([HAVE_MKSTEMPS])
+  HAVE_POSIX_OPENPT=1;       AC_SUBST([HAVE_POSIX_OPENPT])
+  HAVE_PTSNAME=1;            AC_SUBST([HAVE_PTSNAME])
+  HAVE_PTSNAME_R=1;          AC_SUBST([HAVE_PTSNAME_R])
+  HAVE_RANDOM=1;             AC_SUBST([HAVE_RANDOM])
+  HAVE_RANDOM_H=1;           AC_SUBST([HAVE_RANDOM_H])
   HAVE_RANDOM_R=1;           AC_SUBST([HAVE_RANDOM_R])
-  HAVE_REALLOC_POSIX=1;      AC_SUBST([HAVE_REALLOC_POSIX])
   HAVE_REALPATH=1;           AC_SUBST([HAVE_REALPATH])
   HAVE_RPMATCH=1;            AC_SUBST([HAVE_RPMATCH])
   HAVE_SETENV=1;             AC_SUBST([HAVE_SETENV])
+  HAVE_DECL_SETENV=1;        AC_SUBST([HAVE_DECL_SETENV])
   HAVE_STRTOD=1;             AC_SUBST([HAVE_STRTOD])
   HAVE_STRTOLL=1;            AC_SUBST([HAVE_STRTOLL])
   HAVE_STRTOULL=1;           AC_SUBST([HAVE_STRTOULL])
   HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
   HAVE_SYS_LOADAVG_H=0;      AC_SUBST([HAVE_SYS_LOADAVG_H])
-  HAVE_UNSETENV=1;           AC_SUBST([HAVE_UNSETENV])
+  HAVE_UNLOCKPT=1;           AC_SUBST([HAVE_UNLOCKPT])
+  HAVE_DECL_UNSETENV=1;      AC_SUBST([HAVE_DECL_UNSETENV])
+  REPLACE_CALLOC=0;          AC_SUBST([REPLACE_CALLOC])
   REPLACE_CANONICALIZE_FILE_NAME=0;  AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
+  REPLACE_MALLOC=0;          AC_SUBST([REPLACE_MALLOC])
+  REPLACE_MBTOWC=0;          AC_SUBST([REPLACE_MBTOWC])
   REPLACE_MKSTEMP=0;         AC_SUBST([REPLACE_MKSTEMP])
+  REPLACE_PTSNAME_R=0;       AC_SUBST([REPLACE_PTSNAME_R])
   REPLACE_PUTENV=0;          AC_SUBST([REPLACE_PUTENV])
+  REPLACE_RANDOM_R=0;        AC_SUBST([REPLACE_RANDOM_R])
+  REPLACE_REALLOC=0;         AC_SUBST([REPLACE_REALLOC])
   REPLACE_REALPATH=0;        AC_SUBST([REPLACE_REALPATH])
   REPLACE_SETENV=0;          AC_SUBST([REPLACE_SETENV])
   REPLACE_STRTOD=0;          AC_SUBST([REPLACE_STRTOD])
   REPLACE_UNSETENV=0;        AC_SUBST([REPLACE_UNSETENV])
+  REPLACE_WCTOMB=0;          AC_SUBST([REPLACE_WCTOMB])
 ])
index 3a3b07dd5d290dcb6104336b455163b92f48c581..db0c8c1db9e022965eee9ebda8d5f88b6044bc97 100644 (file)
@@ -1,6 +1,6 @@
-# strdup.m4 serial 11
+# strdup.m4 serial 13
 
-dnl Copyright (C) 2002-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2012 Free Software Foundation, Inc.
 
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,29 +9,27 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_STRDUP],
 [
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  AC_REPLACE_FUNCS([strdup])
+  AC_CHECK_FUNCS_ONCE([strdup])
   AC_CHECK_DECLS_ONCE([strdup])
   if test $ac_cv_have_decl_strdup = no; then
     HAVE_DECL_STRDUP=0
   fi
-  gl_PREREQ_STRDUP
 ])
 
 AC_DEFUN([gl_FUNC_STRDUP_POSIX],
 [
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
   AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
-  if test $gl_cv_func_malloc_posix != yes; then
-    REPLACE_STRDUP=1
-    AC_LIBOBJ([strdup])
-  else
-    AC_REPLACE_FUNCS([strdup])
+  AC_CHECK_FUNCS_ONCE([strdup])
+  if test $ac_cv_func_strdup = yes; then
+    if test $gl_cv_func_malloc_posix != yes; then
+      REPLACE_STRDUP=1
+    fi
   fi
   AC_CHECK_DECLS_ONCE([strdup])
   if test $ac_cv_have_decl_strdup = no; then
     HAVE_DECL_STRDUP=0
   fi
-  gl_PREREQ_STRDUP
 ])
 
 # Prerequisites of lib/strdup.c.
index 1649b2451133f93bfcf2d2d725f17499e5a0a3da..1c96e526daa95fc3e32413d4f2b6db1ce387761e 100644 (file)
@@ -1,68 +1,96 @@
-# strerror.m4 serial 9
-dnl Copyright (C) 2002, 2007-2010 Free Software Foundation, Inc.
+# strerror.m4 serial 17
+dnl Copyright (C) 2002, 2007-2012 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.
 
 AC_DEFUN([gl_FUNC_STRERROR],
-[
-  AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE])
-  if test $REPLACE_STRERROR = 1; then
-    AC_LIBOBJ([strerror])
-    AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR],
-      [Define this to 1 if strerror is broken.])
-  fi
-])
-
-# Like gl_FUNC_STRERROR, except prepare for separate compilation (no AC_LIBOBJ).
-AC_DEFUN([gl_FUNC_STRERROR_SEPARATE],
 [
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
   AC_REQUIRE([gl_HEADER_ERRNO_H])
-  if test -z "$ERRNO_H"; then
+  AC_REQUIRE([gl_FUNC_STRERROR_0])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+    AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
+  ])
+  if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
     AC_CACHE_CHECK([for working strerror function],
      [gl_cv_func_working_strerror],
      [AC_RUN_IFELSE(
         [AC_LANG_PROGRAM(
            [[#include <string.h>
            ]],
-           [[return !*strerror (-2);]])],
+           [[if (!*strerror (-2)) return 1;]])],
         [gl_cv_func_working_strerror=yes],
         [gl_cv_func_working_strerror=no],
-        [dnl Assume crossbuild works if it compiles.
-         AC_COMPILE_IFELSE(
-           [AC_LANG_PROGRAM(
-              [[#include <string.h>
-              ]],
-              [[return !*strerror (-2);]])],
-           [gl_cv_func_working_strerror=yes],
-           [gl_cv_func_working_strerror=no])
-      ])
+        [case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_working_strerror="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_working_strerror="guessing no" ;;
+         esac
+        ])
+    ])
+    case "$gl_cv_func_working_strerror" in
+      *yes) ;;
+      *)
+        dnl The system's strerror() fails to return a string for out-of-range
+        dnl integers. Replace it.
+        REPLACE_STRERROR=1
+        ;;
+    esac
+    m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+      dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's
+      dnl buffer, we must replace strerror.
+      case "$gl_cv_func_strerror_r_works" in
+        *no) REPLACE_STRERROR=1 ;;
+      esac
     ])
-    if test $gl_cv_func_working_strerror = no; then
-      dnl The system's strerror() fails to return a string for out-of-range
-      dnl integers. Replace it.
-      REPLACE_STRERROR=1
-    fi
   else
     dnl The system's strerror() cannot know about the new errno values we add
-    dnl to <errno.h>. Replace it.
+    dnl to <errno.h>, or any fix for strerror(0). Replace it.
     REPLACE_STRERROR=1
   fi
-  if test $REPLACE_STRERROR = 1; then
-    gl_PREREQ_STRERROR
-  fi
 ])
 
-# Prerequisites of lib/strerror.c.
-AC_DEFUN([gl_PREREQ_STRERROR], [
-  AC_CHECK_DECLS([strerror])
-  AC_CHECK_HEADERS_ONCE([sys/socket.h])
-  if test $ac_cv_header_sys_socket_h != yes; then
-    dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
-    dnl the check for those headers unconditional; yet cygwin reports
-    dnl that the headers are present but cannot be compiled (since on
-    dnl cygwin, all socket information should come from sys/socket.h).
-    AC_CHECK_HEADERS([winsock2.h])
-  fi
+dnl Detect if strerror(0) passes (that is, does not set errno, and does not
+dnl return a string that matches strerror(-1)).
+AC_DEFUN([gl_FUNC_STRERROR_0],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  REPLACE_STRERROR_0=0
+  AC_CACHE_CHECK([whether strerror(0) succeeds],
+   [gl_cv_func_strerror_0_works],
+   [AC_RUN_IFELSE(
+      [AC_LANG_PROGRAM(
+         [[#include <string.h>
+           #include <errno.h>
+         ]],
+         [[int result = 0;
+           char *str;
+           errno = 0;
+           str = strerror (0);
+           if (!*str) result |= 1;
+           if (errno) result |= 2;
+           if (strstr (str, "nknown") || strstr (str, "ndefined"))
+             result |= 4;
+           return result;]])],
+      [gl_cv_func_strerror_0_works=yes],
+      [gl_cv_func_strerror_0_works=no],
+      [case "$host_os" in
+                 # Guess yes on glibc systems.
+         *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+                 # If we don't know, assume the worst.
+         *)      gl_cv_func_strerror_0_works="guessing no" ;;
+       esac
+      ])
+  ])
+  case "$gl_cv_func_strerror_0_works" in
+    *yes) ;;
+    *)
+      REPLACE_STRERROR_0=1
+      AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0)
+        does not return a message implying success.])
+      ;;
+  esac
 ])
diff --git a/m4/strerror_r.m4 b/m4/strerror_r.m4
new file mode 100644 (file)
index 0000000..5bdf0ab
--- /dev/null
@@ -0,0 +1,173 @@
+# strerror_r.m4 serial 14
+dnl Copyright (C) 2002, 2007-2012 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.
+
+AC_DEFUN([gl_FUNC_STRERROR_R],
+[
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
+
+  dnl Persuade Solaris <string.h> to declare strerror_r().
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  dnl Some systems don't declare strerror_r() if _THREAD_SAFE and _REENTRANT
+  dnl are not defined.
+  AC_CHECK_DECLS_ONCE([strerror_r])
+  if test $ac_cv_have_decl_strerror_r = no; then
+    HAVE_DECL_STRERROR_R=0
+  fi
+
+  if test $ac_cv_func_strerror_r = yes; then
+    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+      if test $gl_cv_func_strerror_r_posix_signature = yes; then
+        case "$gl_cv_func_strerror_r_works" in
+          dnl The system's strerror_r has bugs.  Replace it.
+          *no) REPLACE_STRERROR_R=1 ;;
+        esac
+      else
+        dnl The system's strerror_r() has a wrong signature. Replace it.
+        REPLACE_STRERROR_R=1
+      fi
+    else
+      dnl The system's strerror_r() cannot know about the new errno values we
+      dnl add to <errno.h>, or any fix for strerror(0). Replace it.
+      REPLACE_STRERROR_R=1
+    fi
+  fi
+])
+
+# Prerequisites of lib/strerror_r.c.
+AC_DEFUN([gl_PREREQ_STRERROR_R], [
+  dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r.
+  AC_CHECK_FUNCS_ONCE([__xpg_strerror_r])
+  AC_CHECK_FUNCS_ONCE([catgets])
+  AC_CHECK_FUNCS_ONCE([snprintf])
+])
+
+# Detect if strerror_r works, but without affecting whether a replacement
+# strerror_r will be used.
+AC_DEFUN([gl_FUNC_STRERROR_R_WORKS],
+[
+  AC_REQUIRE([gl_HEADER_ERRNO_H])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([gl_FUNC_STRERROR_0])
+
+  AC_CHECK_FUNCS_ONCE([strerror_r])
+  if test $ac_cv_func_strerror_r = yes; then
+    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+      dnl The POSIX prototype is:  int strerror_r (int, char *, size_t);
+      dnl glibc, Cygwin:           char *strerror_r (int, char *, size_t);
+      dnl AIX 5.1, OSF/1 5.1:      int strerror_r (int, char *, int);
+      AC_CACHE_CHECK([for strerror_r with POSIX signature],
+        [gl_cv_func_strerror_r_posix_signature],
+        [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <string.h>
+                int strerror_r (int, char *, size_t);
+              ]],
+              [])],
+           [gl_cv_func_strerror_r_posix_signature=yes],
+           [gl_cv_func_strerror_r_posix_signature=no])
+        ])
+      if test $gl_cv_func_strerror_r_posix_signature = yes; then
+        dnl AIX 6.1 strerror_r fails by returning -1, not an error number.
+        dnl HP-UX 11.31 strerror_r always fails when the buffer length argument
+        dnl is less than 80.
+        dnl FreeBSD 8.s strerror_r claims failure on 0
+        dnl MacOS X 10.5 strerror_r treats 0 like -1
+        dnl Solaris 10 strerror_r corrupts errno on failure
+        AC_CACHE_CHECK([whether strerror_r works],
+          [gl_cv_func_strerror_r_works],
+          [AC_RUN_IFELSE(
+             [AC_LANG_PROGRAM(
+                [[#include <errno.h>
+                  #include <string.h>
+                ]],
+                [[int result = 0;
+                  char buf[79];
+                  if (strerror_r (EACCES, buf, 0) < 0)
+                    result |= 1;
+                  errno = 0;
+                  if (strerror_r (EACCES, buf, sizeof buf) != 0)
+                    result |= 2;
+                  strcpy (buf, "Unknown");
+                  if (strerror_r (0, buf, sizeof buf) != 0)
+                    result |= 4;
+                  if (errno)
+                    result |= 8;
+                  if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
+                    result |= 0x10;
+                  errno = 0;
+                  *buf = 0;
+                  if (strerror_r (-3, buf, sizeof buf) < 0)
+                    result |= 0x20;
+                  if (errno)
+                    result |= 0x40;
+                  if (!*buf)
+                    result |= 0x80;
+                  return result;
+                ]])],
+             [gl_cv_func_strerror_r_works=yes],
+             [gl_cv_func_strerror_r_works=no],
+             [
+changequote(,)dnl
+              case "$host_os" in
+                       # Guess no on AIX.
+                aix*)  gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess no on HP-UX.
+                hpux*) gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess no on BSD variants.
+                *bsd*)  gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess yes otherwise.
+                *)     gl_cv_func_strerror_r_works="guessing yes";;
+              esac
+changequote([,])dnl
+             ])
+          ])
+      else
+        dnl The system's strerror() has a wrong signature.
+        dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r.
+        AC_CHECK_FUNCS_ONCE([__xpg_strerror_r])
+        dnl In glibc < 2.14, __xpg_strerror_r does not populate buf on failure.
+        dnl In cygwin < 1.7.10, __xpg_strerror_r clobbers strerror's buffer.
+        if test $ac_cv_func___xpg_strerror_r = yes; then
+          AC_CACHE_CHECK([whether __xpg_strerror_r works],
+            [gl_cv_func_strerror_r_works],
+            [AC_RUN_IFELSE(
+               [AC_LANG_PROGRAM(
+                  [[#include <errno.h>
+                    #include <string.h>
+                    extern
+                    #ifdef __cplusplus
+                    "C"
+                    #endif
+                    int __xpg_strerror_r(int, char *, size_t);
+                  ]],
+                  [[int result = 0;
+                    char buf[256] = "^";
+                    char copy[256];
+                    char *str = strerror (-1);
+                    strcpy (copy, str);
+                    if (__xpg_strerror_r (-2, buf, 1) == 0)
+                      result |= 1;
+                    if (*buf)
+                      result |= 2;
+                    __xpg_strerror_r (-2, buf, 256);
+                    if (strcmp (str, copy))
+                      result |= 4;
+                    return result;
+                  ]])],
+               [gl_cv_func_strerror_r_works=yes],
+               [gl_cv_func_strerror_r_works=no],
+               [dnl Guess no on all platforms that have __xpg_strerror_r,
+                dnl at least until fixed glibc and cygwin are more common.
+                gl_cv_func_strerror_r_works="guessing no"
+               ])
+            ])
+        fi
+      fi
+    fi
+  fi
+])
index f2f64d1935a186d988a834ad5e396324a29344a4..5677e092d44b4d126f533db924d786ecced52770 100644 (file)
@@ -1,11 +1,11 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# Copyright (C) 2007-2012 Free Software Foundation, Inc.
 # This file 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.
 
-# serial 10
+# serial 21
 
 # Written by Paul Eggert.
 
@@ -20,18 +20,31 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  gl_CHECK_NEXT_HEADERS([string.h])
+  gl_NEXT_HEADERS([string.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, and which is not
+  dnl guaranteed by C89.
+  gl_WARN_ON_USE_PREPARE([[#include <string.h>
+    ]],
+    [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
+     strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
+     strerror_r strsignal strverscmp])
 ])
 
 AC_DEFUN([gl_STRING_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
 [
+  GNULIB_FFSL=0;        AC_SUBST([GNULIB_FFSL])
+  GNULIB_FFSLL=0;       AC_SUBST([GNULIB_FFSLL])
   GNULIB_MEMCHR=0;      AC_SUBST([GNULIB_MEMCHR])
   GNULIB_MEMMEM=0;      AC_SUBST([GNULIB_MEMMEM])
   GNULIB_MEMPCPY=0;     AC_SUBST([GNULIB_MEMPCPY])
@@ -41,6 +54,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   GNULIB_STPNCPY=0;     AC_SUBST([GNULIB_STPNCPY])
   GNULIB_STRCHRNUL=0;   AC_SUBST([GNULIB_STRCHRNUL])
   GNULIB_STRDUP=0;      AC_SUBST([GNULIB_STRDUP])
+  GNULIB_STRNCAT=0;     AC_SUBST([GNULIB_STRNCAT])
   GNULIB_STRNDUP=0;     AC_SUBST([GNULIB_STRNDUP])
   GNULIB_STRNLEN=0;     AC_SUBST([GNULIB_STRNLEN])
   GNULIB_STRPBRK=0;     AC_SUBST([GNULIB_STRPBRK])
@@ -63,10 +77,14 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   GNULIB_MBSSEP=0;      AC_SUBST([GNULIB_MBSSEP])
   GNULIB_MBSTOK_R=0;    AC_SUBST([GNULIB_MBSTOK_R])
   GNULIB_STRERROR=0;    AC_SUBST([GNULIB_STRERROR])
+  GNULIB_STRERROR_R=0;  AC_SUBST([GNULIB_STRERROR_R])
   GNULIB_STRSIGNAL=0;   AC_SUBST([GNULIB_STRSIGNAL])
   GNULIB_STRVERSCMP=0;  AC_SUBST([GNULIB_STRVERSCMP])
   HAVE_MBSLEN=0;        AC_SUBST([HAVE_MBSLEN])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_FFSL=1;                  AC_SUBST([HAVE_FFSL])
+  HAVE_FFSLL=1;                 AC_SUBST([HAVE_FFSLL])
+  HAVE_MEMCHR=1;                AC_SUBST([HAVE_MEMCHR])
   HAVE_DECL_MEMMEM=1;           AC_SUBST([HAVE_DECL_MEMMEM])
   HAVE_MEMPCPY=1;               AC_SUBST([HAVE_MEMPCPY])
   HAVE_DECL_MEMRCHR=1;          AC_SUBST([HAVE_DECL_MEMRCHR])
@@ -81,16 +99,21 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   HAVE_STRSEP=1;                AC_SUBST([HAVE_STRSEP])
   HAVE_STRCASESTR=1;            AC_SUBST([HAVE_STRCASESTR])
   HAVE_DECL_STRTOK_R=1;         AC_SUBST([HAVE_DECL_STRTOK_R])
-  HAVE_DECL_STRERROR=1;         AC_SUBST([HAVE_DECL_STRERROR])
+  HAVE_DECL_STRERROR_R=1;       AC_SUBST([HAVE_DECL_STRERROR_R])
   HAVE_DECL_STRSIGNAL=1;        AC_SUBST([HAVE_DECL_STRSIGNAL])
   HAVE_STRVERSCMP=1;            AC_SUBST([HAVE_STRVERSCMP])
   REPLACE_MEMCHR=0;             AC_SUBST([REPLACE_MEMCHR])
   REPLACE_MEMMEM=0;             AC_SUBST([REPLACE_MEMMEM])
+  REPLACE_STPNCPY=0;            AC_SUBST([REPLACE_STPNCPY])
   REPLACE_STRDUP=0;             AC_SUBST([REPLACE_STRDUP])
   REPLACE_STRSTR=0;             AC_SUBST([REPLACE_STRSTR])
   REPLACE_STRCASESTR=0;         AC_SUBST([REPLACE_STRCASESTR])
+  REPLACE_STRCHRNUL=0;          AC_SUBST([REPLACE_STRCHRNUL])
   REPLACE_STRERROR=0;           AC_SUBST([REPLACE_STRERROR])
+  REPLACE_STRERROR_R=0;         AC_SUBST([REPLACE_STRERROR_R])
+  REPLACE_STRNCAT=0;            AC_SUBST([REPLACE_STRNCAT])
   REPLACE_STRNDUP=0;            AC_SUBST([REPLACE_STRNDUP])
+  REPLACE_STRNLEN=0;            AC_SUBST([REPLACE_STRNLEN])
   REPLACE_STRSIGNAL=0;          AC_SUBST([REPLACE_STRSIGNAL])
   REPLACE_STRTOK_R=0;           AC_SUBST([REPLACE_STRTOK_R])
   UNDEFINE_STRTOK_R=0;          AC_SUBST([UNDEFINE_STRTOK_R])
diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
new file mode 100644 (file)
index 0000000..8d4e7e1
--- /dev/null
@@ -0,0 +1,177 @@
+# sys_socket_h.m4 serial 22
+dnl Copyright (C) 2005-2012 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.
+
+dnl From Simon Josefsson.
+
+AC_DEFUN([gl_HEADER_SYS_SOCKET],
+[
+  AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_C_INLINE])
+
+  dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
+  dnl old-style declarations (with return type 'int' instead of 'ssize_t')
+  dnl unless _POSIX_PII_SOCKET is defined.
+  case "$host_os" in
+    osf*)
+      AC_DEFINE([_POSIX_PII_SOCKET], [1],
+        [Define to 1 in order to get the POSIX compatible declarations
+         of socket functions.])
+      ;;
+  esac
+
+  AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
+    [gl_cv_header_sys_socket_h_selfcontained],
+    [
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
+        [gl_cv_header_sys_socket_h_selfcontained=yes],
+        [gl_cv_header_sys_socket_h_selfcontained=no])
+    ])
+  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+    dnl If the shutdown function exists, <sys/socket.h> should define
+    dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
+    AC_CHECK_FUNCS([shutdown])
+    if test $ac_cv_func_shutdown = yes; then
+      AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
+        [gl_cv_header_sys_socket_h_shut],
+        [
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
+               [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
+            [gl_cv_header_sys_socket_h_shut=yes],
+            [gl_cv_header_sys_socket_h_shut=no])
+        ])
+      if test $gl_cv_header_sys_socket_h_shut = no; then
+        SYS_SOCKET_H='sys/socket.h'
+      fi
+    fi
+  fi
+  # We need to check for ws2tcpip.h now.
+  gl_PREREQ_SYS_H_SOCKET
+  AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+  if test $ac_cv_type_struct_sockaddr_storage = no; then
+    HAVE_STRUCT_SOCKADDR_STORAGE=0
+  fi
+  if test $ac_cv_type_sa_family_t = no; then
+    HAVE_SA_FAMILY_T=0
+  fi
+  if test $ac_cv_type_struct_sockaddr_storage != no; then
+    AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
+      [],
+      [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0],
+      [#include <sys/types.h>
+       #ifdef HAVE_SYS_SOCKET_H
+       #include <sys/socket.h>
+       #endif
+       #ifdef HAVE_WS2TCPIP_H
+       #include <ws2tcpip.h>
+       #endif
+      ])
+  fi
+  if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
+     || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
+    SYS_SOCKET_H='sys/socket.h'
+  fi
+  gl_PREREQ_SYS_H_WINSOCK2
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* Some systems require prerequisite headers.  */
+#include <sys/types.h>
+#include <sys/socket.h>
+    ]], [socket connect accept bind getpeername getsockname getsockopt
+    listen recv send recvfrom sendto setsockopt shutdown accept4])
+])
+
+AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
+[
+  dnl Check prerequisites of the <sys/socket.h> replacement.
+  AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+  gl_CHECK_NEXT_HEADERS([sys/socket.h])
+  if test $ac_cv_header_sys_socket_h = yes; then
+    HAVE_SYS_SOCKET_H=1
+    HAVE_WS2TCPIP_H=0
+  else
+    HAVE_SYS_SOCKET_H=0
+    if test $ac_cv_header_ws2tcpip_h = yes; then
+      HAVE_WS2TCPIP_H=1
+    else
+      HAVE_WS2TCPIP_H=0
+    fi
+  fi
+  AC_SUBST([HAVE_SYS_SOCKET_H])
+  AC_SUBST([HAVE_WS2TCPIP_H])
+])
+
+# Common prerequisites of the <sys/socket.h> replacement and of the
+# <sys/select.h> replacement.
+# Sets and substitutes HAVE_WINSOCK2_H.
+AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
+[
+  m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+  m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])])
+  AC_CHECK_HEADERS_ONCE([sys/socket.h])
+  if test $ac_cv_header_sys_socket_h != yes; then
+    dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+    dnl the check for those headers unconditional; yet cygwin reports
+    dnl that the headers are present but cannot be compiled (since on
+    dnl cygwin, all socket information should come from sys/socket.h).
+    AC_CHECK_HEADERS([winsock2.h])
+  fi
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    HAVE_WINSOCK2_H=1
+    UNISTD_H_HAVE_WINSOCK2_H=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+  else
+    HAVE_WINSOCK2_H=0
+  fi
+  AC_SUBST([HAVE_WINSOCK2_H])
+])
+
+AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
+[
+  GNULIB_SOCKET=0;      AC_SUBST([GNULIB_SOCKET])
+  GNULIB_CONNECT=0;     AC_SUBST([GNULIB_CONNECT])
+  GNULIB_ACCEPT=0;      AC_SUBST([GNULIB_ACCEPT])
+  GNULIB_BIND=0;        AC_SUBST([GNULIB_BIND])
+  GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME])
+  GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME])
+  GNULIB_GETSOCKOPT=0;  AC_SUBST([GNULIB_GETSOCKOPT])
+  GNULIB_LISTEN=0;      AC_SUBST([GNULIB_LISTEN])
+  GNULIB_RECV=0;        AC_SUBST([GNULIB_RECV])
+  GNULIB_SEND=0;        AC_SUBST([GNULIB_SEND])
+  GNULIB_RECVFROM=0;    AC_SUBST([GNULIB_RECVFROM])
+  GNULIB_SENDTO=0;      AC_SUBST([GNULIB_SENDTO])
+  GNULIB_SETSOCKOPT=0;  AC_SUBST([GNULIB_SETSOCKOPT])
+  GNULIB_SHUTDOWN=0;    AC_SUBST([GNULIB_SHUTDOWN])
+  GNULIB_ACCEPT4=0;     AC_SUBST([GNULIB_ACCEPT4])
+  HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
+  HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
+                        AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY])
+  HAVE_SA_FAMILY_T=1;   AC_SUBST([HAVE_SA_FAMILY_T])
+  HAVE_ACCEPT4=1;       AC_SUBST([HAVE_ACCEPT4])
+])
index 4cec9cdfcc7465e40390623556d9d1e5d382b15c..f45dee1dc4dc35c88c5fdc900244d4f8343ddee2 100644 (file)
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 21   -*- Autoconf -*-
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 27   -*- Autoconf -*-
+dnl Copyright (C) 2006-2012 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.
@@ -19,6 +19,22 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
 
   gl_CHECK_NEXT_HEADERS([sys/stat.h])
 
+  dnl Ensure the type mode_t gets defined.
+  AC_REQUIRE([AC_TYPE_MODE_T])
+
+  dnl Whether to override 'struct stat'.
+  m4_ifdef([gl_LARGEFILE], [
+    AC_REQUIRE([gl_LARGEFILE])
+  ], [
+    WINDOWS_64_BIT_ST_SIZE=0
+  ])
+  AC_SUBST([WINDOWS_64_BIT_ST_SIZE])
+  if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+    AC_DEFINE([_GL_WINDOWS_64_BIT_ST_SIZE], [1],
+      [Define to 1 if Gnulib overrides 'struct stat' on Windows so that
+       struct stat.st_size becomes 64-bit.])
+  fi
+
   dnl Define types that are supposed to be defined in <sys/types.h> or
   dnl <sys/stat.h>.
   AC_CHECK_TYPE([nlink_t], [],
@@ -27,19 +43,27 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
     [#include <sys/types.h>
      #include <sys/stat.h>])
 
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
+    ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
+    mknod mknodat stat utimensat])
 ]) # gl_HEADER_SYS_STAT_H
 
 AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
   GNULIB_FCHMODAT=0;    AC_SUBST([GNULIB_FCHMODAT])
+  GNULIB_FSTAT=0;       AC_SUBST([GNULIB_FSTAT])
   GNULIB_FSTATAT=0;     AC_SUBST([GNULIB_FSTATAT])
   GNULIB_FUTIMENS=0;    AC_SUBST([GNULIB_FUTIMENS])
   GNULIB_LCHMOD=0;      AC_SUBST([GNULIB_LCHMOD])
index 9c16487957bc27ffd4ade8eba9943b1fb138df5d..26eaf8ea7f30d50c2fe300eab823e510f1dd4028 100644 (file)
@@ -1,7 +1,7 @@
 # Configure a replacement for <sys/time.h>.
-# serial 2
+# serial 8
 
-# Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
 # This file 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.
@@ -19,16 +19,17 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H],
 AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
   AC_CHECK_HEADERS_ONCE([sys/time.h])
   gl_CHECK_NEXT_HEADERS([sys/time.h])
 
-  if test $ac_cv_header_sys_time_h = yes; then
-    HAVE_SYS_TIME_H=1
-  else
+  if test $ac_cv_header_sys_time_h != yes; then
     HAVE_SYS_TIME_H=0
   fi
-  AC_SUBST([HAVE_SYS_TIME_H])
 
+  dnl On native Windows with MSVC, 'struct timeval' is defined in <winsock2.h>
+  dnl only. So include that header in the list.
+  gl_PREREQ_SYS_H_WINSOCK2
   AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
@@ -36,24 +37,70 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
              #include <sys/time.h>
             #endif
             #include <time.h>
+            #if HAVE_WINSOCK2_H
+            # include <winsock2.h>
+            #endif
           ]],
           [[static struct timeval x; x.tv_sec = x.tv_usec;]])],
        [gl_cv_sys_struct_timeval=yes],
-       [gl_cv_sys_struct_timeval=no])])
-  if test $gl_cv_sys_struct_timeval = yes; then
-    HAVE_STRUCT_TIMEVAL=1
-  else
+       [gl_cv_sys_struct_timeval=no])
+    ])
+  if test $gl_cv_sys_struct_timeval != yes; then
     HAVE_STRUCT_TIMEVAL=0
+  else
+    dnl On native Windows with a 64-bit 'time_t', 'struct timeval' is defined
+    dnl (in <sys/time.h> and <winsock2.h> for mingw64, in <winsock2.h> only
+    dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is
+    dnl smaller than the 'time_t' type mandated by POSIX.
+    AC_CACHE_CHECK([for correct struct timeval.tv_sec member],
+      [gl_cv_sys_struct_timeval_tv_sec],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#if HAVE_SYS_TIME_H
+               #include <sys/time.h>
+              #endif
+              #include <time.h>
+              #if HAVE_WINSOCK2_H
+              # include <winsock2.h>
+              #endif
+            ]],
+            [[static struct timeval x;
+              typedef int verify_tv_sec_type[sizeof (x.tv_sec) == sizeof (time_t) ? 1 : -1];
+            ]])],
+         [gl_cv_sys_struct_timeval_tv_sec=yes],
+         [gl_cv_sys_struct_timeval_tv_sec=no])
+      ])
+    if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
+      REPLACE_STRUCT_TIMEVAL=1
+    fi
   fi
-  AC_SUBST([HAVE_STRUCT_TIMEVAL])
 
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <time.h>
+    ]], [gettimeofday])
+])
+
+AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS],
+[
+  GNULIB_GETTIMEOFDAY=0;     AC_SUBST([GNULIB_GETTIMEOFDAY])
   dnl Assume POSIX behavior unless another module says otherwise.
-  REPLACE_GETTIMEOFDAY=0
-  AC_SUBST([REPLACE_GETTIMEOFDAY])
-  if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then
-    SYS_TIME_H=sys/time.h
-  else
-    SYS_TIME_H=
-  fi
-  AC_SUBST([SYS_TIME_H])
+  HAVE_GETTIMEOFDAY=1;       AC_SUBST([HAVE_GETTIMEOFDAY])
+  HAVE_STRUCT_TIMEVAL=1;     AC_SUBST([HAVE_STRUCT_TIMEVAL])
+  HAVE_SYS_TIME_H=1;         AC_SUBST([HAVE_SYS_TIME_H])
+  REPLACE_GETTIMEOFDAY=0;    AC_SUBST([REPLACE_GETTIMEOFDAY])
+  REPLACE_STRUCT_TIMEVAL=0;  AC_SUBST([REPLACE_STRUCT_TIMEVAL])
 ])
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4
new file mode 100644 (file)
index 0000000..f11eef2
--- /dev/null
@@ -0,0 +1,24 @@
+# sys_types_h.m4 serial 4
+dnl Copyright (C) 2011-2012 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.
+
+AC_DEFUN([gl_SYS_TYPES_H],
+[
+  AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
+  gl_NEXT_HEADERS([sys/types.h])
+
+  dnl Ensure the type pid_t gets defined.
+  AC_REQUIRE([AC_TYPE_PID_T])
+
+  dnl Ensure the type mode_t gets defined.
+  AC_REQUIRE([AC_TYPE_MODE_T])
+
+  dnl Whether to override the 'off_t' type.
+  AC_REQUIRE([gl_TYPE_OFF_T])
+])
+
+AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
+[
+])
diff --git a/m4/threadlib.m4 b/m4/threadlib.m4
new file mode 100644 (file)
index 0000000..9cedb67
--- /dev/null
@@ -0,0 +1,371 @@
+# threadlib.m4 serial 9 (gettext-0.18.2)
+dnl Copyright (C) 2005-2012 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.
+
+dnl From Bruno Haible.
+
+dnl gl_THREADLIB
+dnl ------------
+dnl Tests for a multithreading library to be used.
+dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
+dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
+dnl default is 'no', otherwise it is system dependent. In both cases, the user
+dnl can change the choice through the options --enable-threads=choice or
+dnl --disable-threads.
+dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
+dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
+dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
+dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
+dnl libtool).
+dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
+dnl programs that really need multithread functionality. The difference
+dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
+dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+
+AC_DEFUN([gl_THREADLIB_EARLY],
+[
+  AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
+])
+
+dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
+
+AC_DEFUN([gl_THREADLIB_EARLY_BODY],
+[
+  dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
+  dnl influences the result of the autoconf tests that test for *_unlocked
+  dnl declarations, on AIX 5 at least. Therefore it must come early.
+  AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
+  AC_BEFORE([$0], [gl_ARGP])dnl
+
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
+  dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
+  dnl AC_GNU_SOURCE.
+  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+    [AC_REQUIRE([AC_GNU_SOURCE])])
+  dnl Check for multithreading.
+  m4_ifdef([gl_THREADLIB_DEFAULT_NO],
+    [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
+    [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
+  AC_ARG_ENABLE([threads],
+AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
+    [gl_use_threads=$enableval],
+    [if test -n "$gl_use_threads_default"; then
+       gl_use_threads="$gl_use_threads_default"
+     else
+changequote(,)dnl
+       case "$host_os" in
+         dnl Disable multithreading by default on OSF/1, because it interferes
+         dnl with fork()/exec(): When msgexec is linked with -lpthread, its
+         dnl child process gets an endless segmentation fault inside execvp().
+         dnl Disable multithreading by default on Cygwin 1.5.x, because it has
+         dnl bugs that lead to endless loops or crashes. See
+         dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
+         osf*) gl_use_threads=no ;;
+         cygwin*)
+               case `uname -r` in
+                 1.[0-5].*) gl_use_threads=no ;;
+                 *)         gl_use_threads=yes ;;
+               esac
+               ;;
+         *)    gl_use_threads=yes ;;
+       esac
+changequote([,])dnl
+     fi
+    ])
+  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+    # For using <pthread.h>:
+    case "$host_os" in
+      osf*)
+        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+        # groks <pthread.h>. cc also understands the flag -pthread, but
+        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+        # 2. putting a flag into CPPFLAGS that has an effect on the linker
+        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
+        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+        ;;
+    esac
+    # Some systems optimize for single-threaded programs by default, and
+    # need special flags to disable these optimizations. For example, the
+    # definition of 'errno' in <errno.h>.
+    case "$host_os" in
+      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+    esac
+  fi
+])
+
+dnl The guts of gl_THREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_THREADLIB_BODY],
+[
+  AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
+  gl_threads_api=none
+  LIBTHREAD=
+  LTLIBTHREAD=
+  LIBMULTITHREAD=
+  LTLIBMULTITHREAD=
+  if test "$gl_use_threads" != no; then
+    dnl Check whether the compiler and linker support weak declarations.
+    AC_CACHE_CHECK([whether imported symbols can be declared weak],
+      [gl_cv_have_weak],
+      [gl_cv_have_weak=no
+       dnl First, test whether the compiler accepts it syntactically.
+       AC_LINK_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[extern void xyzzy ();
+#pragma weak xyzzy]],
+            [[xyzzy();]])],
+         [gl_cv_have_weak=maybe])
+       if test $gl_cv_have_weak = maybe; then
+         dnl Second, test whether it actually works. On Cygwin 1.7.2, with
+         dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
+         AC_RUN_IFELSE(
+           [AC_LANG_SOURCE([[
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+  return (fputs == NULL);
+}]])],
+           [gl_cv_have_weak=yes],
+           [gl_cv_have_weak=no],
+           [dnl When cross-compiling, assume that only ELF platforms support
+            dnl weak symbols.
+            AC_EGREP_CPP([Extensible Linking Format],
+              [#ifdef __ELF__
+               Extensible Linking Format
+               #endif
+              ],
+              [gl_cv_have_weak="guessing yes"],
+              [gl_cv_have_weak="guessing no"])
+           ])
+       fi
+      ])
+    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+      # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
+      AC_CHECK_HEADER([pthread.h],
+        [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
+      if test "$gl_have_pthread_h" = yes; then
+        # Other possible tests:
+        #   -lpthreads (FSU threads, PCthreads)
+        #   -lgthreads
+        gl_have_pthread=
+        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+        # the second one only in libpthread, and lock.c needs it.
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[#include <pthread.h>]],
+             [[pthread_mutex_lock((pthread_mutex_t*)0);
+               pthread_mutexattr_init((pthread_mutexattr_t*)0);]])],
+          [gl_have_pthread=yes])
+        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+        # since it is defined as a macro on OSF/1.)
+        if test -n "$gl_have_pthread"; then
+          # The program links fine without libpthread. But it may actually
+          # need to link with libpthread in order to create multiple threads.
+          AC_CHECK_LIB([pthread], [pthread_kill],
+            [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+             # On Solaris and HP-UX, most pthread functions exist also in libc.
+             # Therefore pthread_in_use() needs to actually try to create a
+             # thread: pthread_create from libc will fail, whereas
+             # pthread_create will actually create a thread.
+             case "$host_os" in
+               solaris* | hpux*)
+                 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+                   [Define if the pthread_in_use() detection is hard.])
+             esac
+            ])
+        else
+          # Some library is needed. Try libpthread and libc_r.
+          AC_CHECK_LIB([pthread], [pthread_kill],
+            [gl_have_pthread=yes
+             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
+             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
+          if test -z "$gl_have_pthread"; then
+            # For FreeBSD 4.
+            AC_CHECK_LIB([c_r], [pthread_kill],
+              [gl_have_pthread=yes
+               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
+               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
+          fi
+        fi
+        if test -n "$gl_have_pthread"; then
+          gl_threads_api=posix
+          AC_DEFINE([USE_POSIX_THREADS], [1],
+            [Define if the POSIX multithreading library can be used.])
+          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
+            if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+              AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
+                [Define if references to the POSIX multithreading library should be made weak.])
+              LIBTHREAD=
+              LTLIBTHREAD=
+            fi
+          fi
+        fi
+      fi
+    fi
+    if test -z "$gl_have_pthread"; then
+      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
+        gl_have_solaristhread=
+        gl_save_LIBS="$LIBS"
+        LIBS="$LIBS -lthread"
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[
+#include <thread.h>
+#include <synch.h>
+             ]],
+             [[thr_self();]])],
+          [gl_have_solaristhread=yes])
+        LIBS="$gl_save_LIBS"
+        if test -n "$gl_have_solaristhread"; then
+          gl_threads_api=solaris
+          LIBTHREAD=-lthread
+          LTLIBTHREAD=-lthread
+          LIBMULTITHREAD="$LIBTHREAD"
+          LTLIBMULTITHREAD="$LTLIBTHREAD"
+          AC_DEFINE([USE_SOLARIS_THREADS], [1],
+            [Define if the old Solaris multithreading library can be used.])
+          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+            AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
+              [Define if references to the old Solaris multithreading library should be made weak.])
+            LIBTHREAD=
+            LTLIBTHREAD=
+          fi
+        fi
+      fi
+    fi
+    if test "$gl_use_threads" = pth; then
+      gl_save_CPPFLAGS="$CPPFLAGS"
+      AC_LIB_LINKFLAGS([pth])
+      gl_have_pth=
+      gl_save_LIBS="$LIBS"
+      LIBS="$LIBS $LIBPTH"
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])],
+        [gl_have_pth=yes])
+      LIBS="$gl_save_LIBS"
+      if test -n "$gl_have_pth"; then
+        gl_threads_api=pth
+        LIBTHREAD="$LIBPTH"
+        LTLIBTHREAD="$LTLIBPTH"
+        LIBMULTITHREAD="$LIBTHREAD"
+        LTLIBMULTITHREAD="$LTLIBTHREAD"
+        AC_DEFINE([USE_PTH_THREADS], [1],
+          [Define if the GNU Pth multithreading library can be used.])
+        if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
+          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+            AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
+              [Define if references to the GNU Pth multithreading library should be made weak.])
+            LIBTHREAD=
+            LTLIBTHREAD=
+          fi
+        fi
+      else
+        CPPFLAGS="$gl_save_CPPFLAGS"
+      fi
+    fi
+    if test -z "$gl_have_pthread"; then
+      case "$gl_use_threads" in
+        yes | windows | win32) # The 'win32' is for backward compatibility.
+          if { case "$host_os" in
+                 mingw*) true;;
+                 *) false;;
+               esac
+             }; then
+            gl_threads_api=windows
+            AC_DEFINE([USE_WINDOWS_THREADS], [1],
+              [Define if the native Windows multithreading API can be used.])
+          fi
+          ;;
+      esac
+    fi
+  fi
+  AC_MSG_CHECKING([for multithread API to use])
+  AC_MSG_RESULT([$gl_threads_api])
+  AC_SUBST([LIBTHREAD])
+  AC_SUBST([LTLIBTHREAD])
+  AC_SUBST([LIBMULTITHREAD])
+  AC_SUBST([LTLIBMULTITHREAD])
+])
+
+AC_DEFUN([gl_THREADLIB],
+[
+  AC_REQUIRE([gl_THREADLIB_EARLY])
+  AC_REQUIRE([gl_THREADLIB_BODY])
+])
+
+
+dnl gl_DISABLE_THREADS
+dnl ------------------
+dnl Sets the gl_THREADLIB default so that threads are not used by default.
+dnl The user can still override it at installation time, by using the
+dnl configure option '--enable-threads'.
+
+AC_DEFUN([gl_DISABLE_THREADS], [
+  m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
+])
+
+
+dnl Survey of platforms:
+dnl
+dnl Platform          Available   Compiler    Supports   test-lock
+dnl                   flavours    option      weak       result
+dnl ---------------   ---------   ---------   --------   ---------
+dnl Linux 2.4/glibc   posix       -lpthread       Y      OK
+dnl
+dnl GNU Hurd/glibc    posix
+dnl
+dnl FreeBSD 5.3       posix       -lc_r           Y
+dnl                   posix       -lkse ?         Y
+dnl                   posix       -lpthread ?     Y
+dnl                   posix       -lthr           Y
+dnl
+dnl FreeBSD 5.2       posix       -lc_r           Y
+dnl                   posix       -lkse           Y
+dnl                   posix       -lthr           Y
+dnl
+dnl FreeBSD 4.0,4.10  posix       -lc_r           Y      OK
+dnl
+dnl NetBSD 1.6        --
+dnl
+dnl OpenBSD 3.4       posix       -lpthread       Y      OK
+dnl
+dnl MacOS X 10.[123]  posix       -lpthread       Y      OK
+dnl
+dnl Solaris 7,8,9     posix       -lpthread       Y      Sol 7,8: 0.0; Sol 9: OK
+dnl                   solaris     -lthread        Y      Sol 7,8: 0.0; Sol 9: OK
+dnl
+dnl HP-UX 11          posix       -lpthread       N (cc) OK
+dnl                                               Y (gcc)
+dnl
+dnl IRIX 6.5          posix       -lpthread       Y      0.5
+dnl
+dnl AIX 4.3,5.1       posix       -lpthread       N      AIX 4: 0.5; AIX 5: OK
+dnl
+dnl OSF/1 4.0,5.1     posix       -pthread (cc)   N      OK
+dnl                               -lpthread (gcc) Y
+dnl
+dnl Cygwin            posix       -lpthread       Y      OK
+dnl
+dnl Any of the above  pth         -lpth                  0.0
+dnl
+dnl Mingw             windows                     N      OK
+dnl
+dnl BeOS 5            --
+dnl
+dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
+dnl turned off:
+dnl   OK if all three tests terminate OK,
+dnl   0.5 if the first test terminates OK but the second one loops endlessly,
+dnl   0.0 if the first test already loops endlessly.
index c00bfae922c1fac4e9b9f0409a25c84c11068a5b..b88da764630ba64de67a27d3b4e976b277e2810d 100644 (file)
@@ -1,6 +1,8 @@
 # Configure a more-standard replacement for <time.h>.
 
-# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
+
+# serial 6
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -19,24 +21,12 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
-  gl_CHECK_NEXT_HEADERS([time.h])
+  gl_NEXT_HEADERS([time.h])
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
 ])
 
-AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
-[
-  dnl If another module says to replace or to not replace, do that.
-  dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
-  dnl this lets maintainers check for portability.
-  REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;  AC_SUBST([REPLACE_LOCALTIME_R])
-  REPLACE_MKTIME=GNULIB_PORTCHECK;       AC_SUBST([REPLACE_MKTIME])
-  REPLACE_NANOSLEEP=GNULIB_PORTCHECK;    AC_SUBST([REPLACE_NANOSLEEP])
-  REPLACE_STRPTIME=GNULIB_PORTCHECK;     AC_SUBST([REPLACE_STRPTIME])
-  REPLACE_TIMEGM=GNULIB_PORTCHECK;       AC_SUBST([REPLACE_TIMEGM])
-])
-
-dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
-dnl in time.h or sys/time.h.
+dnl Define HAVE_STRUCT_TIMESPEC if 'struct timespec' is declared
+dnl in time.h, sys/time.h, or pthread.h.
 
 AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
 [
@@ -53,6 +43,7 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
 
   TIME_H_DEFINES_STRUCT_TIMESPEC=0
   SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+  PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
   if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
     TIME_H_DEFINES_STRUCT_TIMESPEC=1
   else
@@ -67,8 +58,52 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
          [gl_cv_sys_struct_timespec_in_sys_time_h=no])])
     if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
       SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+    else
+      AC_CACHE_CHECK([for struct timespec in <pthread.h>],
+        [gl_cv_sys_struct_timespec_in_pthread_h],
+        [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <pthread.h>
+              ]],
+              [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+           [gl_cv_sys_struct_timespec_in_pthread_h=yes],
+           [gl_cv_sys_struct_timespec_in_pthread_h=no])])
+      if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+        PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+      fi
     fi
   fi
   AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC])
   AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC])
+  AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC])
+])
+
+AC_DEFUN([gl_TIME_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
+[
+  GNULIB_MKTIME=0;                       AC_SUBST([GNULIB_MKTIME])
+  GNULIB_NANOSLEEP=0;                    AC_SUBST([GNULIB_NANOSLEEP])
+  GNULIB_STRPTIME=0;                     AC_SUBST([GNULIB_STRPTIME])
+  GNULIB_TIMEGM=0;                       AC_SUBST([GNULIB_TIMEGM])
+  GNULIB_TIME_R=0;                       AC_SUBST([GNULIB_TIME_R])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_DECL_LOCALTIME_R=1;               AC_SUBST([HAVE_DECL_LOCALTIME_R])
+  HAVE_NANOSLEEP=1;                      AC_SUBST([HAVE_NANOSLEEP])
+  HAVE_STRPTIME=1;                       AC_SUBST([HAVE_STRPTIME])
+  HAVE_TIMEGM=1;                         AC_SUBST([HAVE_TIMEGM])
+  dnl If another module says to replace or to not replace, do that.
+  dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
+  dnl this lets maintainers check for portability.
+  REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;  AC_SUBST([REPLACE_LOCALTIME_R])
+  REPLACE_MKTIME=GNULIB_PORTCHECK;       AC_SUBST([REPLACE_MKTIME])
+  REPLACE_NANOSLEEP=GNULIB_PORTCHECK;    AC_SUBST([REPLACE_NANOSLEEP])
+  REPLACE_TIMEGM=GNULIB_PORTCHECK;       AC_SUBST([REPLACE_TIMEGM])
 ])
index 5dbaed74a048576ad23faf693344366abe1b9734..597b9c2d1aff9bfc3c2a0e7b78b29a525defaf55 100644 (file)
@@ -1,6 +1,6 @@
 #serial 14
 
-# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 74c3ce6012dba23a0210058a2ffe81cb444bf912..62e295bc80ede105cf6c9cd4a33e30b978963557 100644 (file)
@@ -1,5 +1,5 @@
-#serial 8
-dnl Copyright (C) 2002, 2005-2006, 2009-2010 Free Software Foundation, Inc.
+#serial 9
+dnl Copyright (C) 2002, 2005-2006, 2009-2012 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.
@@ -7,7 +7,4 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_UNISTD_SAFER],
 [
   AC_CHECK_FUNCS_ONCE([pipe])
-  AC_LIBOBJ([dup-safer])
-  AC_LIBOBJ([fd-safer])
-  AC_LIBOBJ([pipe-safer])
 ])
index aacec2b15b207c7e282b6fa3ec3259009d96be8e..7e7651b9d2e430b6303fe9e7be584361389c50a7 100644 (file)
@@ -1,5 +1,5 @@
-# unistd_h.m4 serial 38
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# unistd_h.m4 serial 65
+dnl Copyright (C) 2006-2012 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.
@@ -14,8 +14,6 @@ AC_DEFUN([gl_UNISTD_H],
   AC_REQUIRE([AC_C_INLINE])
 
   gl_CHECK_NEXT_HEADERS([unistd.h])
-
-  AC_CHECK_HEADERS_ONCE([unistd.h])
   if test $ac_cv_header_unistd_h = yes; then
     HAVE_UNISTD_H=1
   else
@@ -23,113 +21,162 @@ AC_DEFUN([gl_UNISTD_H],
   fi
   AC_SUBST([HAVE_UNISTD_H])
 
+  dnl Ensure the type pid_t gets defined.
+  AC_REQUIRE([AC_TYPE_PID_T])
+
+  dnl Determine WINDOWS_64_BIT_OFF_T.
+  AC_REQUIRE([gl_TYPE_OFF_T])
+
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
-  gl_WARN_ON_USE_PREPARE([[#include <unistd.h>
-/* Some systems declare environ in the wrong header.  */
-#ifndef __GLIBC__
+  gl_WARN_ON_USE_PREPARE([[
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+/* Some systems declare various items in the wrong headers.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <fcntl.h>
+# include <stdio.h>
 # include <stdlib.h>
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#  include <io.h>
+# endif
 #endif
-    ]], [environ])
+    ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat
+    fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups
+    gethostname getlogin getlogin_r getpagesize
+    getusershell setusershell endusershell
+    group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
+    readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r
+    unlink unlinkat usleep])
 ])
 
 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_UNISTD_H_DEFAULTS],
 [
-  GNULIB_CHOWN=0;            AC_SUBST([GNULIB_CHOWN])
-  GNULIB_CLOSE=0;            AC_SUBST([GNULIB_CLOSE])
-  GNULIB_DUP2=0;             AC_SUBST([GNULIB_DUP2])
-  GNULIB_DUP3=0;             AC_SUBST([GNULIB_DUP3])
-  GNULIB_ENVIRON=0;          AC_SUBST([GNULIB_ENVIRON])
-  GNULIB_EUIDACCESS=0;       AC_SUBST([GNULIB_EUIDACCESS])
-  GNULIB_FACCESSAT=0;        AC_SUBST([GNULIB_FACCESSAT])
-  GNULIB_FCHDIR=0;           AC_SUBST([GNULIB_FCHDIR])
-  GNULIB_FCHOWNAT=0;         AC_SUBST([GNULIB_FCHOWNAT])
-  GNULIB_FSYNC=0;            AC_SUBST([GNULIB_FSYNC])
-  GNULIB_FTRUNCATE=0;        AC_SUBST([GNULIB_FTRUNCATE])
-  GNULIB_GETCWD=0;           AC_SUBST([GNULIB_GETCWD])
-  GNULIB_GETDOMAINNAME=0;    AC_SUBST([GNULIB_GETDOMAINNAME])
-  GNULIB_GETDTABLESIZE=0;    AC_SUBST([GNULIB_GETDTABLESIZE])
-  GNULIB_GETGROUPS=0;        AC_SUBST([GNULIB_GETGROUPS])
-  GNULIB_GETHOSTNAME=0;      AC_SUBST([GNULIB_GETHOSTNAME])
-  GNULIB_GETLOGIN=0;         AC_SUBST([GNULIB_GETLOGIN])
-  GNULIB_GETLOGIN_R=0;       AC_SUBST([GNULIB_GETLOGIN_R])
-  GNULIB_GETPAGESIZE=0;      AC_SUBST([GNULIB_GETPAGESIZE])
-  GNULIB_GETUSERSHELL=0;     AC_SUBST([GNULIB_GETUSERSHELL])
-  GNULIB_LCHOWN=0;           AC_SUBST([GNULIB_LCHOWN])
-  GNULIB_LINK=0;             AC_SUBST([GNULIB_LINK])
-  GNULIB_LINKAT=0;           AC_SUBST([GNULIB_LINKAT])
-  GNULIB_LSEEK=0;            AC_SUBST([GNULIB_LSEEK])
-  GNULIB_PIPE2=0;            AC_SUBST([GNULIB_PIPE2])
-  GNULIB_PREAD=0;            AC_SUBST([GNULIB_PREAD])
-  GNULIB_READLINK=0;         AC_SUBST([GNULIB_READLINK])
-  GNULIB_READLINKAT=0;       AC_SUBST([GNULIB_READLINKAT])
-  GNULIB_RMDIR=0;            AC_SUBST([GNULIB_RMDIR])
-  GNULIB_SLEEP=0;            AC_SUBST([GNULIB_SLEEP])
-  GNULIB_SYMLINK=0;          AC_SUBST([GNULIB_SYMLINK])
-  GNULIB_SYMLINKAT=0;        AC_SUBST([GNULIB_SYMLINKAT])
-  GNULIB_UNISTD_H_GETOPT=0;  AC_SUBST([GNULIB_UNISTD_H_GETOPT])
-  GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
-  GNULIB_UNLINK=0;           AC_SUBST([GNULIB_UNLINK])
-  GNULIB_UNLINKAT=0;         AC_SUBST([GNULIB_UNLINKAT])
-  GNULIB_USLEEP=0;           AC_SUBST([GNULIB_USLEEP])
-  GNULIB_WRITE=0;            AC_SUBST([GNULIB_WRITE])
+  GNULIB_CHDIR=0;                AC_SUBST([GNULIB_CHDIR])
+  GNULIB_CHOWN=0;                AC_SUBST([GNULIB_CHOWN])
+  GNULIB_CLOSE=0;                AC_SUBST([GNULIB_CLOSE])
+  GNULIB_DUP=0;                  AC_SUBST([GNULIB_DUP])
+  GNULIB_DUP2=0;                 AC_SUBST([GNULIB_DUP2])
+  GNULIB_DUP3=0;                 AC_SUBST([GNULIB_DUP3])
+  GNULIB_ENVIRON=0;              AC_SUBST([GNULIB_ENVIRON])
+  GNULIB_EUIDACCESS=0;           AC_SUBST([GNULIB_EUIDACCESS])
+  GNULIB_FACCESSAT=0;            AC_SUBST([GNULIB_FACCESSAT])
+  GNULIB_FCHDIR=0;               AC_SUBST([GNULIB_FCHDIR])
+  GNULIB_FCHOWNAT=0;             AC_SUBST([GNULIB_FCHOWNAT])
+  GNULIB_FDATASYNC=0;            AC_SUBST([GNULIB_FDATASYNC])
+  GNULIB_FSYNC=0;                AC_SUBST([GNULIB_FSYNC])
+  GNULIB_FTRUNCATE=0;            AC_SUBST([GNULIB_FTRUNCATE])
+  GNULIB_GETCWD=0;               AC_SUBST([GNULIB_GETCWD])
+  GNULIB_GETDOMAINNAME=0;        AC_SUBST([GNULIB_GETDOMAINNAME])
+  GNULIB_GETDTABLESIZE=0;        AC_SUBST([GNULIB_GETDTABLESIZE])
+  GNULIB_GETGROUPS=0;            AC_SUBST([GNULIB_GETGROUPS])
+  GNULIB_GETHOSTNAME=0;          AC_SUBST([GNULIB_GETHOSTNAME])
+  GNULIB_GETLOGIN=0;             AC_SUBST([GNULIB_GETLOGIN])
+  GNULIB_GETLOGIN_R=0;           AC_SUBST([GNULIB_GETLOGIN_R])
+  GNULIB_GETPAGESIZE=0;          AC_SUBST([GNULIB_GETPAGESIZE])
+  GNULIB_GETUSERSHELL=0;         AC_SUBST([GNULIB_GETUSERSHELL])
+  GNULIB_GROUP_MEMBER=0;         AC_SUBST([GNULIB_GROUP_MEMBER])
+  GNULIB_ISATTY=0;               AC_SUBST([GNULIB_ISATTY])
+  GNULIB_LCHOWN=0;               AC_SUBST([GNULIB_LCHOWN])
+  GNULIB_LINK=0;                 AC_SUBST([GNULIB_LINK])
+  GNULIB_LINKAT=0;               AC_SUBST([GNULIB_LINKAT])
+  GNULIB_LSEEK=0;                AC_SUBST([GNULIB_LSEEK])
+  GNULIB_PIPE=0;                 AC_SUBST([GNULIB_PIPE])
+  GNULIB_PIPE2=0;                AC_SUBST([GNULIB_PIPE2])
+  GNULIB_PREAD=0;                AC_SUBST([GNULIB_PREAD])
+  GNULIB_PWRITE=0;               AC_SUBST([GNULIB_PWRITE])
+  GNULIB_READ=0;                 AC_SUBST([GNULIB_READ])
+  GNULIB_READLINK=0;             AC_SUBST([GNULIB_READLINK])
+  GNULIB_READLINKAT=0;           AC_SUBST([GNULIB_READLINKAT])
+  GNULIB_RMDIR=0;                AC_SUBST([GNULIB_RMDIR])
+  GNULIB_SETHOSTNAME=0;          AC_SUBST([GNULIB_SETHOSTNAME])
+  GNULIB_SLEEP=0;                AC_SUBST([GNULIB_SLEEP])
+  GNULIB_SYMLINK=0;              AC_SUBST([GNULIB_SYMLINK])
+  GNULIB_SYMLINKAT=0;            AC_SUBST([GNULIB_SYMLINKAT])
+  GNULIB_TTYNAME_R=0;            AC_SUBST([GNULIB_TTYNAME_R])
+  GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING])
+  GNULIB_UNISTD_H_SIGPIPE=0;     AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
+  GNULIB_UNLINK=0;               AC_SUBST([GNULIB_UNLINK])
+  GNULIB_UNLINKAT=0;             AC_SUBST([GNULIB_UNLINKAT])
+  GNULIB_USLEEP=0;               AC_SUBST([GNULIB_USLEEP])
+  GNULIB_WRITE=0;                AC_SUBST([GNULIB_WRITE])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_CHOWN=1;           AC_SUBST([HAVE_CHOWN])
   HAVE_DUP2=1;            AC_SUBST([HAVE_DUP2])
   HAVE_DUP3=1;            AC_SUBST([HAVE_DUP3])
   HAVE_EUIDACCESS=1;      AC_SUBST([HAVE_EUIDACCESS])
   HAVE_FACCESSAT=1;       AC_SUBST([HAVE_FACCESSAT])
+  HAVE_FCHDIR=1;          AC_SUBST([HAVE_FCHDIR])
   HAVE_FCHOWNAT=1;        AC_SUBST([HAVE_FCHOWNAT])
+  HAVE_FDATASYNC=1;       AC_SUBST([HAVE_FDATASYNC])
   HAVE_FSYNC=1;           AC_SUBST([HAVE_FSYNC])
   HAVE_FTRUNCATE=1;       AC_SUBST([HAVE_FTRUNCATE])
-  HAVE_GETDOMAINNAME=1;   AC_SUBST([HAVE_GETDOMAINNAME])
   HAVE_GETDTABLESIZE=1;   AC_SUBST([HAVE_GETDTABLESIZE])
   HAVE_GETGROUPS=1;       AC_SUBST([HAVE_GETGROUPS])
   HAVE_GETHOSTNAME=1;     AC_SUBST([HAVE_GETHOSTNAME])
   HAVE_GETLOGIN=1;        AC_SUBST([HAVE_GETLOGIN])
   HAVE_GETPAGESIZE=1;     AC_SUBST([HAVE_GETPAGESIZE])
-  HAVE_GETUSERSHELL=1;    AC_SUBST([HAVE_GETUSERSHELL])
+  HAVE_GROUP_MEMBER=1;    AC_SUBST([HAVE_GROUP_MEMBER])
   HAVE_LCHOWN=1;          AC_SUBST([HAVE_LCHOWN])
   HAVE_LINK=1;            AC_SUBST([HAVE_LINK])
   HAVE_LINKAT=1;          AC_SUBST([HAVE_LINKAT])
+  HAVE_PIPE=1;            AC_SUBST([HAVE_PIPE])
   HAVE_PIPE2=1;           AC_SUBST([HAVE_PIPE2])
   HAVE_PREAD=1;           AC_SUBST([HAVE_PREAD])
+  HAVE_PWRITE=1;          AC_SUBST([HAVE_PWRITE])
   HAVE_READLINK=1;        AC_SUBST([HAVE_READLINK])
   HAVE_READLINKAT=1;      AC_SUBST([HAVE_READLINKAT])
+  HAVE_SETHOSTNAME=1;     AC_SUBST([HAVE_SETHOSTNAME])
   HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
   HAVE_SYMLINK=1;         AC_SUBST([HAVE_SYMLINK])
   HAVE_SYMLINKAT=1;       AC_SUBST([HAVE_SYMLINKAT])
+  HAVE_UNLINKAT=1;        AC_SUBST([HAVE_UNLINKAT])
+  HAVE_USLEEP=1;          AC_SUBST([HAVE_USLEEP])
   HAVE_DECL_ENVIRON=1;    AC_SUBST([HAVE_DECL_ENVIRON])
+  HAVE_DECL_FCHDIR=1;     AC_SUBST([HAVE_DECL_FCHDIR])
+  HAVE_DECL_FDATASYNC=1;  AC_SUBST([HAVE_DECL_FDATASYNC])
+  HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
   HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
+  HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
+  HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
+  HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME])
+  HAVE_DECL_TTYNAME_R=1;  AC_SUBST([HAVE_DECL_TTYNAME_R])
   HAVE_OS_H=0;            AC_SUBST([HAVE_OS_H])
   HAVE_SYS_PARAM_H=0;     AC_SUBST([HAVE_SYS_PARAM_H])
-  HAVE_UNLINKAT=1;        AC_SUBST([HAVE_UNLINKAT])
-  HAVE_USLEEP=1;          AC_SUBST([HAVE_USLEEP])
   REPLACE_CHOWN=0;        AC_SUBST([REPLACE_CHOWN])
   REPLACE_CLOSE=0;        AC_SUBST([REPLACE_CLOSE])
   REPLACE_DUP=0;          AC_SUBST([REPLACE_DUP])
   REPLACE_DUP2=0;         AC_SUBST([REPLACE_DUP2])
-  REPLACE_FCHDIR=0;       AC_SUBST([REPLACE_FCHDIR])
   REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
+  REPLACE_FTRUNCATE=0;    AC_SUBST([REPLACE_FTRUNCATE])
   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
+  REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
+  REPLACE_GETLOGIN_R=0;   AC_SUBST([REPLACE_GETLOGIN_R])
   REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
   REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
+  REPLACE_ISATTY=0;       AC_SUBST([REPLACE_ISATTY])
   REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
   REPLACE_LINK=0;         AC_SUBST([REPLACE_LINK])
   REPLACE_LINKAT=0;       AC_SUBST([REPLACE_LINKAT])
   REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
   REPLACE_PREAD=0;        AC_SUBST([REPLACE_PREAD])
+  REPLACE_PWRITE=0;       AC_SUBST([REPLACE_PWRITE])
+  REPLACE_READ=0;         AC_SUBST([REPLACE_READ])
   REPLACE_READLINK=0;     AC_SUBST([REPLACE_READLINK])
   REPLACE_RMDIR=0;        AC_SUBST([REPLACE_RMDIR])
   REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
   REPLACE_SYMLINK=0;      AC_SUBST([REPLACE_SYMLINK])
+  REPLACE_TTYNAME_R=0;    AC_SUBST([REPLACE_TTYNAME_R])
   REPLACE_UNLINK=0;       AC_SUBST([REPLACE_UNLINK])
   REPLACE_UNLINKAT=0;     AC_SUBST([REPLACE_UNLINKAT])
   REPLACE_USLEEP=0;       AC_SUBST([REPLACE_USLEEP])
diff --git a/m4/unlink.m4 b/m4/unlink.m4
deleted file mode 100644 (file)
index c01d848..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-# unlink.m4 serial 3
-dnl Copyright (C) 2009, 2010 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.
-
-AC_DEFUN([gl_FUNC_UNLINK],
-[
-  AC_REQUIRE([gl_AC_DOS])
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  dnl Detect Solaris 9 and FreeBSD 7.2 bug.
-  AC_CACHE_CHECK([whether unlink honors trailing slashes],
-    [gl_cv_func_unlink_works],
-    [touch conftest.file
-     # Assume that if we have lstat, we can also check symlinks.
-     if test $ac_cv_func_lstat = yes; then
-       ln -s conftest.file conftest.lnk
-     fi
-     AC_RUN_IFELSE(
-       [AC_LANG_PROGRAM(
-         [[#include <unistd.h>
-           #include <errno.h>
-]], [[if (!unlink ("conftest.file/") || errno != ENOTDIR) return 1;
-#if HAVE_LSTAT
-      if (!unlink ("conftest.lnk/") || errno != ENOTDIR) return 2;
-#endif
-      ]])],
-      [gl_cv_func_unlink_works=yes], [gl_cv_func_unlink_works=no],
-      [gl_cv_func_unlink_works="guessing no"])
-     rm -f conftest.file conftest.lnk])
-  if test x"$gl_cv_func_unlink_works" != xyes; then
-    REPLACE_UNLINK=1
-    AC_LIBOBJ([unlink])
-  fi
-])
index 88a9f45fb1e493dd5c382c7ad5fd9621ddf2270e..25eb85b326e61655f01bc5a5a47893a64bb72ebc 100644 (file)
@@ -1,6 +1,6 @@
 # serial 9
 
-# Copyright (C) 1998-2001, 2003-2004, 2007, 2009-2010 Free Software Foundation,
+# Copyright (C) 1998-2001, 2003-2004, 2007, 2009-2012 Free Software Foundation,
 # Inc.
 #
 # This file is free software; the Free Software Foundation
@@ -9,7 +9,7 @@
 
 dnl From Jim Meyering
 
-dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
+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.
 
index 2baa2561035f528ad7eafd190abb4cd230ab0299..6a8b6ab78c0663337dffe55769b9ead38f86ce0d 100644 (file)
@@ -1,18 +1,17 @@
-dnl Copyright (C) 2003-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2012 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.
 
-dnl serial 4
+dnl serial 7
 
 AC_DEFUN([gl_UTIMENS],
 [
-  AC_LIBOBJ([utimens])
-
   dnl Prerequisites of lib/utimens.c.
   AC_REQUIRE([gl_FUNC_UTIMES])
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_UTIMBUF])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CHECK_FUNCS_ONCE([futimes futimesat futimens utimensat lutimes])
 
   if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
@@ -25,17 +24,27 @@ AC_DEFUN([gl_UTIMENS],
        AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 #include <stddef.h>
 #include <sys/times.h>
+#include <fcntl.h>
 ]], [[    int fd = open ("conftest.file", O_RDWR);
           if (fd < 0) return 1;
           if (futimesat (fd, NULL, NULL)) return 2;
         ]])],
         [gl_cv_func_futimesat_works=yes],
         [gl_cv_func_futimesat_works=no],
-        [gl_cv_func_futimesat_works="guessing no"])
+        [case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_futimesat_works="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_futimesat_works="guessing no" ;;
+         esac
+        ])
       rm -f conftest.file])
-    if test "$gl_cv_func_futimesat_works" != yes; then
-      AC_DEFINE([FUTIMESAT_NULL_BUG], [1],
-        [Define to 1 if futimesat mishandles a NULL file name.])
-    fi
+    case "$gl_cv_func_futimesat_works" in
+      *yes) ;;
+      *)
+        AC_DEFINE([FUTIMESAT_NULL_BUG], [1],
+          [Define to 1 if futimesat mishandles a NULL file name.])
+        ;;
+    esac
   fi
 ])
index e6d6f776499329fe76839f655ad97b1378320406..417103a7b72d5c14dfd5d55a9c3e9b6060ef697a 100644 (file)
@@ -1,7 +1,7 @@
 # Detect some bugs in glibc's implementation of utimes.
-# serial 2
+# serial 3
 
-dnl Copyright (C) 2003-2005, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2005, 2009-2012 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.
@@ -34,44 +34,96 @@ AC_DEFUN([gl_FUNC_UTIMES],
 #include <stdio.h>
 #include <utime.h>
 
+static int
+inorder (time_t a, time_t b, time_t c)
+{
+  return a <= b && b <= c;
+}
+
 int
 main ()
 {
-  static struct timeval timeval[2] = {{9, 10}, {999999, 999999}};
-  struct stat sbuf;
+  int result = 0;
   char const *file = "conftest.utimes";
-  FILE *f;
-  time_t now;
-  int fd;
+  static struct timeval timeval[2] = {{9, 10}, {999999, 999999}};
 
-  int ok = ((f = fopen (file, "w"))
-            && fclose (f) == 0
-            && utimes (file, timeval) == 0
-            && lstat (file, &sbuf) == 0
-            && sbuf.st_atime == timeval[0].tv_sec
-            && sbuf.st_mtime == timeval[1].tv_sec);
-  unlink (file);
-  if (!ok)
-    exit (1);
+  /* Test whether utimes() essentially works.  */
+  {
+    struct stat sbuf;
+    FILE *f = fopen (file, "w");
+    if (f == NULL)
+      result |= 1;
+    else if (fclose (f) != 0)
+      result |= 1;
+    else if (utimes (file, timeval) != 0)
+      result |= 2;
+    else if (lstat (file, &sbuf) != 0)
+      result |= 1;
+    else if (!(sbuf.st_atime == timeval[0].tv_sec
+               && sbuf.st_mtime == timeval[1].tv_sec))
+      result |= 4;
+    if (unlink (file) != 0)
+      result |= 1;
+  }
 
-  ok =
-    ((f = fopen (file, "w"))
-     && fclose (f) == 0
-     && time (&now) != (time_t)-1
-     && utimes (file, NULL) == 0
-     && lstat (file, &sbuf) == 0
-     && now - sbuf.st_atime <= 2
-     && now - sbuf.st_mtime <= 2);
-  unlink (file);
-  if (!ok)
-    exit (1);
+  /* Test whether utimes() with a NULL argument sets the file's timestamp
+     to the current time.  Use 'fstat' as well as 'time' to
+     determine the "current" time, to accommodate NFS file systems
+     if there is a time skew between the host and the NFS server.  */
+  {
+    int fd = open (file, O_WRONLY|O_CREAT, 0644);
+    if (fd < 0)
+      result |= 1;
+    else
+      {
+        time_t t0, t2;
+        struct stat st0, st1, st2;
+        if (time (&t0) == (time_t) -1)
+          result |= 1;
+        else if (fstat (fd, &st0) != 0)
+          result |= 1;
+        else if (utimes (file, timeval) != 0)
+          result |= 2;
+        else if (utimes (file, NULL) != 0)
+          result |= 8;
+        else if (fstat (fd, &st1) != 0)
+          result |= 1;
+        else if (write (fd, "\n", 1) != 1)
+          result |= 1;
+        else if (fstat (fd, &st2) != 0)
+          result |= 1;
+        else if (time (&t2) == (time_t) -1)
+          result |= 1;
+        else
+          {
+            int m_ok_POSIX = inorder (t0, st1.st_mtime, t2);
+            int m_ok_NFS = inorder (st0.st_mtime, st1.st_mtime, st2.st_mtime);
+            if (! (st1.st_atime == st1.st_mtime))
+              result |= 16;
+            if (! (m_ok_POSIX || m_ok_NFS))
+              result |= 32;
+          }
+        if (close (fd) != 0)
+          result |= 1;
+      }
+    if (unlink (file) != 0)
+      result |= 1;
+  }
 
-  ok = (0 <= (fd = open (file, O_WRONLY|O_CREAT, 0444))
-              && close (fd) == 0
-              && utimes (file, NULL) == 0);
-  unlink (file);
+  /* Test whether utimes() with a NULL argument works on read-only files.  */
+  {
+    int fd = open (file, O_WRONLY|O_CREAT, 0444);
+    if (fd < 0)
+      result |= 1;
+    else if (close (fd) != 0)
+      result |= 1;
+    else if (utimes (file, NULL) != 0)
+      result |= 64;
+    if (unlink (file) != 0)
+      result |= 1;
+  }
 
-  exit (!ok);
+  return result;
 }
   ]])],
        [gl_cv_func_working_utimes=yes],
index 50a20cca2346803576a53ad8e39d5950cc3fbc33..0ce11da13b5367e60b0b56d3d06576cb39e17f39 100644 (file)
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 29
-dnl Copyright (C) 2002-2004, 2006-2010 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 35
+dnl Copyright (C) 2002-2004, 2006-2012 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.
@@ -29,7 +29,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
   gl_PREREQ_ASNPRINTF
 ])
 
-# Prequisites of lib/printf-args.h, lib/printf-args.c.
+# Prerequisites of lib/printf-args.h, lib/printf-args.c.
 AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
 [
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
@@ -37,9 +37,10 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
   AC_REQUIRE([gt_TYPE_WINT_T])
 ])
 
-# Prequisites of lib/printf-parse.h, lib/printf-parse.c.
+# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
 AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
 [
+  AC_REQUIRE([gl_FEATURES_H])
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
@@ -54,6 +55,7 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
 # Prerequisites of lib/vasnprintf.c.
 AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
 [
+  AC_REQUIRE([AC_C_INLINE])
   AC_REQUIRE([AC_FUNC_ALLOCA])
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
@@ -61,7 +63,21 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
   AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
   dnl Use the _snprintf function only if it is declared (because on NetBSD it
   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
-  AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
+  AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]])
+  dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
+  dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE.
+  AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
+  dnl We can avoid a lot of code by assuming that snprintf's return value
+  dnl conforms to ISO C99. So check that.
+  AC_REQUIRE([gl_SNPRINTF_RETVAL_C99])
+  case "$gl_cv_func_snprintf_retval_c99" in
+    *yes)
+      AC_DEFINE([HAVE_SNPRINTF_RETVAL_C99], [1],
+        [Define if the return value of the snprintf function is the number of
+         of bytes (excluding the terminating NUL) that would have been produced
+         if the buffer had been large enough.])
+      ;;
+  esac
 ])
 
 # Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
index 6f35b2f3a45bf365ba54e21120fd8a9d4b59f549..441bd57cd2ecd1198806d6f1d1620ad83c89eaea 100644 (file)
@@ -1,5 +1,5 @@
 # vfprintf-posix.m4 serial 14
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2012 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.
index ab46422bab4769668f7b5b0a2747479257ea3c88..a77802eb916253122c9ecb714a5e490d4faab99b 100644 (file)
@@ -1,5 +1,5 @@
-# warn-on-use.m4 serial 1
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
+# warn-on-use.m4 serial 5
+dnl Copyright (C) 2010-2012 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.
@@ -18,8 +18,8 @@ dnl with or without modifications, as long as this notice is preserved.
 # some systems declare functions in the wrong header, then INCLUDES
 # should do likewise.
 #
-# If you assume C89, then it is generally safe to assume declarations
-# for functions declared in that standard (such as gets) without
+# It is generally safe to assume declarations for functions declared
+# in the intersection of C89 and C11 (such as printf) without
 # needing gl_WARN_ON_USE_PREPARE.
 AC_DEFUN([gl_WARN_ON_USE_PREPARE],
 [
@@ -27,16 +27,18 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
     [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
       [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
        undefining macros.])])dnl
+dnl FIXME: gl_Symbol must be used unquoted until we can assume
+dnl autoconf 2.64 or newer.
   for gl_func in m4_flatten([$2]); do
     AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
     AC_CACHE_CHECK([whether $gl_func is declared without a macro],
-      [gl_Symbol],
+      gl_Symbol,
       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1],
 [@%:@undef $gl_func
   (void) $gl_func;])],
-        [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])])
-     AS_VAR_IF([gl_Symbol], [yes],
-       [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
+        [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])])
+    AS_VAR_IF(gl_Symbol, [yes],
+      [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
        dnl shortcut - if the raw declaration exists, then set a cache
        dnl variable to allow skipping any later AC_CHECK_DECL efforts
        eval ac_cv_have_decl_$gl_func=yes])
index dad5c1f29c66aeebca880e65f9084fc4930a2e81..28b8294ef04d2bfe78415fae058e6bdbc7cda6c7 100644 (file)
@@ -1,5 +1,5 @@
-# warnings.m4 serial 2
-dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+# warnings.m4 serial 7
+dnl Copyright (C) 2008-2012 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.
@@ -14,23 +14,48 @@ m4_ifdef([AS_VAR_APPEND],
 [m4_define([gl_AS_VAR_APPEND],
 [AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])])
 
-# gl_WARN_ADD(PARAMETER, [VARIABLE = WARN_CFLAGS])
-# ------------------------------------------------
-# Adds parameter to WARN_CFLAGS if the compiler supports it.  For example,
-# gl_WARN_ADD([-Wparentheses]).
-AC_DEFUN([gl_WARN_ADD],
-[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_$1])dnl
-AC_CACHE_CHECK([whether compiler handles $1], [gl_Warn], [
-  save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="${CPPFLAGS} $1"
-  AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
-                    [AS_VAR_SET([gl_Warn], [yes])],
-                    [AS_VAR_SET([gl_Warn], [no])])
-  CPPFLAGS="$save_CPPFLAGS"
+
+# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED],
+#                       [PROGRAM = AC_LANG_PROGRAM()])
+# -----------------------------------------------------------------
+# Check if the compiler supports OPTION when compiling PROGRAM.
+#
+# FIXME: gl_Warn must be used unquoted until we can assume Autoconf
+# 2.64 or newer.
+AC_DEFUN([gl_COMPILER_OPTION_IF],
+[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
+AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
+  gl_save_compiler_FLAGS="$gl_Flags"
+  gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $1"])
+  AC_COMPILE_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
+                    [AS_VAR_SET(gl_Warn, [yes])],
+                    [AS_VAR_SET(gl_Warn, [no])])
+  gl_Flags="$gl_save_compiler_FLAGS"
 ])
-AS_VAR_PUSHDEF([gl_Flags], m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]))dnl
-AS_VAR_IF([gl_Warn], [yes], [gl_AS_VAR_APPEND([gl_Flags], [" $1"])])
+AS_VAR_IF(gl_Warn, [yes], [$2], [$3])
 AS_VAR_POPDEF([gl_Flags])dnl
 AS_VAR_POPDEF([gl_Warn])dnl
-m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl
 ])
+
+
+# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS],
+#             [PROGRAM = AC_LANG_PROGRAM()])
+# ---------------------------------------------
+# Adds parameter to WARN_CFLAGS if the compiler supports it when
+# compiling PROGRAM.  For example, gl_WARN_ADD([-Wparentheses]).
+#
+# If VARIABLE is a variable name, AC_SUBST it.
+AC_DEFUN([gl_WARN_ADD],
+[gl_COMPILER_OPTION_IF([$1],
+  [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
+  [],
+  [$3])
+m4_ifval([$2],
+         [AS_LITERAL_IF([$2], [AC_SUBST([$2])])],
+         [AC_SUBST([WARN_CFLAGS])])dnl
+])
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/m4/wchar.m4 b/m4/wchar.m4
deleted file mode 100644 (file)
index b2055f9..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-
-dnl Copyright (C) 2007-2010 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.
-
-dnl Written by Eric Blake.
-
-# wchar.m4 serial 30
-
-AC_DEFUN([gl_WCHAR_H],
-[
-  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
-  AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
-  dnl Prepare for creating substitute <wchar.h>.
-  dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
-  dnl character support).
-  dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
-  AC_CHECK_HEADERS_ONCE([wchar.h])
-  gl_CHECK_NEXT_HEADERS([wchar.h])
-  if test $ac_cv_header_wchar_h = yes; then
-    HAVE_WCHAR_H=1
-  else
-    HAVE_WCHAR_H=0
-  fi
-  AC_SUBST([HAVE_WCHAR_H])
-
-  AC_REQUIRE([gt_TYPE_WINT_T])
-  if test $gt_cv_c_wint_t = yes; then
-    HAVE_WINT_T=1
-  else
-    HAVE_WINT_T=0
-  fi
-  AC_SUBST([HAVE_WINT_T])
-])
-
-dnl Check whether <wchar.h> is usable at all.
-AC_DEFUN([gl_WCHAR_H_INLINE_OK],
-[
-  dnl Test whether <wchar.h> suffers due to the transition from '__inline' to
-  dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022>
-  dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
-  dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and
-  dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>.
-  AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly],
-    [gl_cv_header_wchar_h_correct_inline],
-    [gl_cv_header_wchar_h_correct_inline=yes
-     AC_LANG_CONFTEST([
-       AC_LANG_SOURCE([[#define wcstod renamed_wcstod
-#include <wchar.h>
-extern int zero (void);
-int main () { return zero(); }
-]])])
-     if AC_TRY_EVAL([ac_compile]); then
-       mv conftest.$ac_objext conftest1.$ac_objext
-       AC_LANG_CONFTEST([
-         AC_LANG_SOURCE([[#define wcstod renamed_wcstod
-#include <wchar.h>
-int zero (void) { return 0; }
-]])])
-       if AC_TRY_EVAL([ac_compile]); then
-         mv conftest.$ac_objext conftest2.$ac_objext
-         if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
-           :
-         else
-           gl_cv_header_wchar_h_correct_inline=no
-         fi
-       fi
-     fi
-     rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
-    ])
-  if test $gl_cv_header_wchar_h_correct_inline = no; then
-    AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
-This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
-C99 mode. You have four options:
-  - Add the flag -fgnu89-inline to CC and reconfigure, or
-  - Fix your include files, using parts of
-    <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
-  - Use a gcc version older than 4.3, or
-  - Don't use the flags -std=c99 or -std=gnu99.
-Configuration aborted.])
-  fi
-])
-
-dnl Unconditionally enables the replacement of <wchar.h>.
-AC_DEFUN([gl_REPLACE_WCHAR_H],
-[
-  dnl This is a no-op, because <wchar.h> is always overridden.
-  :
-])
-
-AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
-[
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
-  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
-])
-
-AC_DEFUN([gl_WCHAR_H_DEFAULTS],
-[
-  GNULIB_BTOWC=0;      AC_SUBST([GNULIB_BTOWC])
-  GNULIB_WCTOB=0;      AC_SUBST([GNULIB_WCTOB])
-  GNULIB_MBSINIT=0;    AC_SUBST([GNULIB_MBSINIT])
-  GNULIB_MBRTOWC=0;    AC_SUBST([GNULIB_MBRTOWC])
-  GNULIB_MBRLEN=0;     AC_SUBST([GNULIB_MBRLEN])
-  GNULIB_MBSRTOWCS=0;  AC_SUBST([GNULIB_MBSRTOWCS])
-  GNULIB_MBSNRTOWCS=0; AC_SUBST([GNULIB_MBSNRTOWCS])
-  GNULIB_WCRTOMB=0;    AC_SUBST([GNULIB_WCRTOMB])
-  GNULIB_WCSRTOMBS=0;  AC_SUBST([GNULIB_WCSRTOMBS])
-  GNULIB_WCSNRTOMBS=0; AC_SUBST([GNULIB_WCSNRTOMBS])
-  GNULIB_WCWIDTH=0;    AC_SUBST([GNULIB_WCWIDTH])
-  dnl Assume proper GNU behavior unless another module says otherwise.
-  HAVE_BTOWC=1;         AC_SUBST([HAVE_BTOWC])
-  HAVE_MBSINIT=1;       AC_SUBST([HAVE_MBSINIT])
-  HAVE_MBRTOWC=1;       AC_SUBST([HAVE_MBRTOWC])
-  HAVE_MBRLEN=1;        AC_SUBST([HAVE_MBRLEN])
-  HAVE_MBSRTOWCS=1;     AC_SUBST([HAVE_MBSRTOWCS])
-  HAVE_MBSNRTOWCS=1;    AC_SUBST([HAVE_MBSNRTOWCS])
-  HAVE_WCRTOMB=1;       AC_SUBST([HAVE_WCRTOMB])
-  HAVE_WCSRTOMBS=1;     AC_SUBST([HAVE_WCSRTOMBS])
-  HAVE_WCSNRTOMBS=1;    AC_SUBST([HAVE_WCSNRTOMBS])
-  HAVE_DECL_WCTOB=1;    AC_SUBST([HAVE_DECL_WCTOB])
-  HAVE_DECL_WCWIDTH=1;  AC_SUBST([HAVE_DECL_WCWIDTH])
-  REPLACE_MBSTATE_T=0;  AC_SUBST([REPLACE_MBSTATE_T])
-  REPLACE_BTOWC=0;      AC_SUBST([REPLACE_BTOWC])
-  REPLACE_WCTOB=0;      AC_SUBST([REPLACE_WCTOB])
-  REPLACE_MBSINIT=0;    AC_SUBST([REPLACE_MBSINIT])
-  REPLACE_MBRTOWC=0;    AC_SUBST([REPLACE_MBRTOWC])
-  REPLACE_MBRLEN=0;     AC_SUBST([REPLACE_MBRLEN])
-  REPLACE_MBSRTOWCS=0;  AC_SUBST([REPLACE_MBSRTOWCS])
-  REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS])
-  REPLACE_WCRTOMB=0;    AC_SUBST([REPLACE_WCRTOMB])
-  REPLACE_WCSRTOMBS=0;  AC_SUBST([REPLACE_WCSRTOMBS])
-  REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
-  REPLACE_WCWIDTH=0;    AC_SUBST([REPLACE_WCWIDTH])
-])
diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4
new file mode 100644 (file)
index 0000000..c7a8b2d
--- /dev/null
@@ -0,0 +1,225 @@
+dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
+
+dnl Copyright (C) 2007-2012 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.
+
+dnl Written by Eric Blake.
+
+# wchar_h.m4 serial 39
+
+AC_DEFUN([gl_WCHAR_H],
+[
+  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
+  dnl Prepare for creating substitute <wchar.h>.
+  dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
+  dnl character support).
+  dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
+  gl_CHECK_NEXT_HEADERS([wchar.h])
+  if test $ac_cv_header_wchar_h = yes; then
+    HAVE_WCHAR_H=1
+  else
+    HAVE_WCHAR_H=0
+  fi
+  AC_SUBST([HAVE_WCHAR_H])
+
+  AC_REQUIRE([gl_FEATURES_H])
+
+  AC_REQUIRE([gt_TYPE_WINT_T])
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
+  else
+    HAVE_WINT_T=0
+  fi
+  AC_SUBST([HAVE_WINT_T])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
+#include <wchar.h>
+    ]],
+    [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
+     wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset
+     wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp
+     wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr
+     wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth
+    ])
+])
+
+dnl Check whether <wchar.h> is usable at all.
+AC_DEFUN([gl_WCHAR_H_INLINE_OK],
+[
+  dnl Test whether <wchar.h> suffers due to the transition from '__inline' to
+  dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022>
+  dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
+  dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and
+  dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>.
+  AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly],
+    [gl_cv_header_wchar_h_correct_inline],
+    [gl_cv_header_wchar_h_correct_inline=yes
+     AC_LANG_CONFTEST([
+       AC_LANG_SOURCE([[#define wcstod renamed_wcstod
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+extern int zero (void);
+int main () { return zero(); }
+]])])
+     if AC_TRY_EVAL([ac_compile]); then
+       mv conftest.$ac_objext conftest1.$ac_objext
+       AC_LANG_CONFTEST([
+         AC_LANG_SOURCE([[#define wcstod renamed_wcstod
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+int zero (void) { return 0; }
+]])])
+       if AC_TRY_EVAL([ac_compile]); then
+         mv conftest.$ac_objext conftest2.$ac_objext
+         if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
+           :
+         else
+           gl_cv_header_wchar_h_correct_inline=no
+         fi
+       fi
+     fi
+     rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
+    ])
+  if test $gl_cv_header_wchar_h_correct_inline = no; then
+    AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
+This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
+C99 mode. You have four options:
+  - Add the flag -fgnu89-inline to CC and reconfigure, or
+  - Fix your include files, using parts of
+    <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
+  - Use a gcc version older than 4.3, or
+  - Don't use the flags -std=c99 or -std=gnu99.
+Configuration aborted.])
+  fi
+])
+
+AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_WCHAR_H_DEFAULTS],
+[
+  GNULIB_BTOWC=0;       AC_SUBST([GNULIB_BTOWC])
+  GNULIB_WCTOB=0;       AC_SUBST([GNULIB_WCTOB])
+  GNULIB_MBSINIT=0;     AC_SUBST([GNULIB_MBSINIT])
+  GNULIB_MBRTOWC=0;     AC_SUBST([GNULIB_MBRTOWC])
+  GNULIB_MBRLEN=0;      AC_SUBST([GNULIB_MBRLEN])
+  GNULIB_MBSRTOWCS=0;   AC_SUBST([GNULIB_MBSRTOWCS])
+  GNULIB_MBSNRTOWCS=0;  AC_SUBST([GNULIB_MBSNRTOWCS])
+  GNULIB_WCRTOMB=0;     AC_SUBST([GNULIB_WCRTOMB])
+  GNULIB_WCSRTOMBS=0;   AC_SUBST([GNULIB_WCSRTOMBS])
+  GNULIB_WCSNRTOMBS=0;  AC_SUBST([GNULIB_WCSNRTOMBS])
+  GNULIB_WCWIDTH=0;     AC_SUBST([GNULIB_WCWIDTH])
+  GNULIB_WMEMCHR=0;     AC_SUBST([GNULIB_WMEMCHR])
+  GNULIB_WMEMCMP=0;     AC_SUBST([GNULIB_WMEMCMP])
+  GNULIB_WMEMCPY=0;     AC_SUBST([GNULIB_WMEMCPY])
+  GNULIB_WMEMMOVE=0;    AC_SUBST([GNULIB_WMEMMOVE])
+  GNULIB_WMEMSET=0;     AC_SUBST([GNULIB_WMEMSET])
+  GNULIB_WCSLEN=0;      AC_SUBST([GNULIB_WCSLEN])
+  GNULIB_WCSNLEN=0;     AC_SUBST([GNULIB_WCSNLEN])
+  GNULIB_WCSCPY=0;      AC_SUBST([GNULIB_WCSCPY])
+  GNULIB_WCPCPY=0;      AC_SUBST([GNULIB_WCPCPY])
+  GNULIB_WCSNCPY=0;     AC_SUBST([GNULIB_WCSNCPY])
+  GNULIB_WCPNCPY=0;     AC_SUBST([GNULIB_WCPNCPY])
+  GNULIB_WCSCAT=0;      AC_SUBST([GNULIB_WCSCAT])
+  GNULIB_WCSNCAT=0;     AC_SUBST([GNULIB_WCSNCAT])
+  GNULIB_WCSCMP=0;      AC_SUBST([GNULIB_WCSCMP])
+  GNULIB_WCSNCMP=0;     AC_SUBST([GNULIB_WCSNCMP])
+  GNULIB_WCSCASECMP=0;  AC_SUBST([GNULIB_WCSCASECMP])
+  GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP])
+  GNULIB_WCSCOLL=0;     AC_SUBST([GNULIB_WCSCOLL])
+  GNULIB_WCSXFRM=0;     AC_SUBST([GNULIB_WCSXFRM])
+  GNULIB_WCSDUP=0;      AC_SUBST([GNULIB_WCSDUP])
+  GNULIB_WCSCHR=0;      AC_SUBST([GNULIB_WCSCHR])
+  GNULIB_WCSRCHR=0;     AC_SUBST([GNULIB_WCSRCHR])
+  GNULIB_WCSCSPN=0;     AC_SUBST([GNULIB_WCSCSPN])
+  GNULIB_WCSSPN=0;      AC_SUBST([GNULIB_WCSSPN])
+  GNULIB_WCSPBRK=0;     AC_SUBST([GNULIB_WCSPBRK])
+  GNULIB_WCSSTR=0;      AC_SUBST([GNULIB_WCSSTR])
+  GNULIB_WCSTOK=0;      AC_SUBST([GNULIB_WCSTOK])
+  GNULIB_WCSWIDTH=0;    AC_SUBST([GNULIB_WCSWIDTH])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_BTOWC=1;         AC_SUBST([HAVE_BTOWC])
+  HAVE_MBSINIT=1;       AC_SUBST([HAVE_MBSINIT])
+  HAVE_MBRTOWC=1;       AC_SUBST([HAVE_MBRTOWC])
+  HAVE_MBRLEN=1;        AC_SUBST([HAVE_MBRLEN])
+  HAVE_MBSRTOWCS=1;     AC_SUBST([HAVE_MBSRTOWCS])
+  HAVE_MBSNRTOWCS=1;    AC_SUBST([HAVE_MBSNRTOWCS])
+  HAVE_WCRTOMB=1;       AC_SUBST([HAVE_WCRTOMB])
+  HAVE_WCSRTOMBS=1;     AC_SUBST([HAVE_WCSRTOMBS])
+  HAVE_WCSNRTOMBS=1;    AC_SUBST([HAVE_WCSNRTOMBS])
+  HAVE_WMEMCHR=1;       AC_SUBST([HAVE_WMEMCHR])
+  HAVE_WMEMCMP=1;       AC_SUBST([HAVE_WMEMCMP])
+  HAVE_WMEMCPY=1;       AC_SUBST([HAVE_WMEMCPY])
+  HAVE_WMEMMOVE=1;      AC_SUBST([HAVE_WMEMMOVE])
+  HAVE_WMEMSET=1;       AC_SUBST([HAVE_WMEMSET])
+  HAVE_WCSLEN=1;        AC_SUBST([HAVE_WCSLEN])
+  HAVE_WCSNLEN=1;       AC_SUBST([HAVE_WCSNLEN])
+  HAVE_WCSCPY=1;        AC_SUBST([HAVE_WCSCPY])
+  HAVE_WCPCPY=1;        AC_SUBST([HAVE_WCPCPY])
+  HAVE_WCSNCPY=1;       AC_SUBST([HAVE_WCSNCPY])
+  HAVE_WCPNCPY=1;       AC_SUBST([HAVE_WCPNCPY])
+  HAVE_WCSCAT=1;        AC_SUBST([HAVE_WCSCAT])
+  HAVE_WCSNCAT=1;       AC_SUBST([HAVE_WCSNCAT])
+  HAVE_WCSCMP=1;        AC_SUBST([HAVE_WCSCMP])
+  HAVE_WCSNCMP=1;       AC_SUBST([HAVE_WCSNCMP])
+  HAVE_WCSCASECMP=1;    AC_SUBST([HAVE_WCSCASECMP])
+  HAVE_WCSNCASECMP=1;   AC_SUBST([HAVE_WCSNCASECMP])
+  HAVE_WCSCOLL=1;       AC_SUBST([HAVE_WCSCOLL])
+  HAVE_WCSXFRM=1;       AC_SUBST([HAVE_WCSXFRM])
+  HAVE_WCSDUP=1;        AC_SUBST([HAVE_WCSDUP])
+  HAVE_WCSCHR=1;        AC_SUBST([HAVE_WCSCHR])
+  HAVE_WCSRCHR=1;       AC_SUBST([HAVE_WCSRCHR])
+  HAVE_WCSCSPN=1;       AC_SUBST([HAVE_WCSCSPN])
+  HAVE_WCSSPN=1;        AC_SUBST([HAVE_WCSSPN])
+  HAVE_WCSPBRK=1;       AC_SUBST([HAVE_WCSPBRK])
+  HAVE_WCSSTR=1;        AC_SUBST([HAVE_WCSSTR])
+  HAVE_WCSTOK=1;        AC_SUBST([HAVE_WCSTOK])
+  HAVE_WCSWIDTH=1;      AC_SUBST([HAVE_WCSWIDTH])
+  HAVE_DECL_WCTOB=1;    AC_SUBST([HAVE_DECL_WCTOB])
+  HAVE_DECL_WCWIDTH=1;  AC_SUBST([HAVE_DECL_WCWIDTH])
+  REPLACE_MBSTATE_T=0;  AC_SUBST([REPLACE_MBSTATE_T])
+  REPLACE_BTOWC=0;      AC_SUBST([REPLACE_BTOWC])
+  REPLACE_WCTOB=0;      AC_SUBST([REPLACE_WCTOB])
+  REPLACE_MBSINIT=0;    AC_SUBST([REPLACE_MBSINIT])
+  REPLACE_MBRTOWC=0;    AC_SUBST([REPLACE_MBRTOWC])
+  REPLACE_MBRLEN=0;     AC_SUBST([REPLACE_MBRLEN])
+  REPLACE_MBSRTOWCS=0;  AC_SUBST([REPLACE_MBSRTOWCS])
+  REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS])
+  REPLACE_WCRTOMB=0;    AC_SUBST([REPLACE_WCRTOMB])
+  REPLACE_WCSRTOMBS=0;  AC_SUBST([REPLACE_WCSRTOMBS])
+  REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
+  REPLACE_WCWIDTH=0;    AC_SUBST([REPLACE_WCWIDTH])
+  REPLACE_WCSWIDTH=0;   AC_SUBST([REPLACE_WCSWIDTH])
+])
index ed804e664ba7933d42051ff3f240e82f9d787998..534735d8c6313f6dde9ab17dd5e3a320ca30a741 100644 (file)
@@ -1,5 +1,5 @@
-# wchar_t.m4 serial 3 (gettext-0.18)
-dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc.
+# wchar_t.m4 serial 4 (gettext-0.18.2)
+dnl Copyright (C) 2002-2003, 2008-2012 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.
@@ -11,9 +11,13 @@ dnl Prerequisite: AC_PROG_CC
 AC_DEFUN([gt_TYPE_WCHAR_T],
 [
   AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t],
-    [AC_TRY_COMPILE([#include <stddef.h>
-       wchar_t foo = (wchar_t)'\0';], ,
-       [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])])
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <stddef.h>
+            wchar_t foo = (wchar_t)'\0';]],
+          [[]])],
+       [gt_cv_c_wchar_t=yes],
+       [gt_cv_c_wchar_t=no])])
   if test $gt_cv_c_wchar_t = yes; then
     AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.])
   fi
diff --git a/m4/wctype.m4 b/m4/wctype.m4
deleted file mode 100644 (file)
index 7fa36a1..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-# wctype.m4 serial 4
-
-dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
-
-dnl Copyright (C) 2006-2010 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.
-
-dnl Written by Paul Eggert.
-
-AC_DEFUN([gl_WCTYPE_H],
-[
-  AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_CHECK_FUNCS_ONCE([iswcntrl])
-  if test $ac_cv_func_iswcntrl = yes; then
-    HAVE_ISWCNTRL=1
-  else
-    HAVE_ISWCNTRL=0
-  fi
-  AC_SUBST([HAVE_ISWCNTRL])
-  AC_CHECK_HEADERS_ONCE([wctype.h])
-  AC_REQUIRE([AC_C_INLINE])
-
-  AC_REQUIRE([gt_TYPE_WINT_T])
-  if test $gt_cv_c_wint_t = yes; then
-    HAVE_WINT_T=1
-  else
-    HAVE_WINT_T=0
-  fi
-  AC_SUBST([HAVE_WINT_T])
-
-  WCTYPE_H=wctype.h
-  if test $ac_cv_header_wctype_h = yes; then
-    if test $ac_cv_func_iswcntrl = yes; then
-      dnl Linux libc5 has an iswprint function that returns 0 for all arguments.
-      dnl The other functions are likely broken in the same way.
-      AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works],
-        [
-          AC_RUN_IFELSE([AC_LANG_SOURCE([[
-                            #include <stddef.h>
-                            #include <stdio.h>
-                            #include <time.h>
-                            #include <wchar.h>
-                            #include <wctype.h>
-                            int main () { return iswprint ('x') == 0; }]])],
-            [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
-            [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
-                          #if __GNU_LIBRARY__ == 1
-                          Linux libc5 i18n is broken.
-                          #endif]], [])],
-              [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no])
-            ])
-        ])
-      if test $gl_cv_func_iswcntrl_works = yes; then
-        case "$host_os" in
-          mingw*)
-            dnl On mingw, towlower and towupper return random high 16 bits.
-            ;;
-          *)
-            dnl iswcntrl works. towlower and towupper work as well.
-            WCTYPE_H=
-            ;;
-        esac
-      fi
-    fi
-    dnl Compute NEXT_WCTYPE_H even if WCTYPE_H is empty,
-    dnl for the benefit of builds from non-distclean directories.
-    gl_CHECK_NEXT_HEADERS([wctype.h])
-    HAVE_WCTYPE_H=1
-  else
-    HAVE_WCTYPE_H=0
-  fi
-  AC_SUBST([HAVE_WCTYPE_H])
-  AC_SUBST([WCTYPE_H])
-
-  if test "$gl_cv_func_iswcntrl_works" = no; then
-    REPLACE_ISWCNTRL=1
-  else
-    REPLACE_ISWCNTRL=0
-  fi
-  AC_SUBST([REPLACE_ISWCNTRL])
-])
diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4
new file mode 100644 (file)
index 0000000..4b19f64
--- /dev/null
@@ -0,0 +1,211 @@
+# wctype_h.m4 serial 17
+
+dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
+
+dnl Copyright (C) 2006-2012 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.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl_WCTYPE_H],
+[
+  AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CHECK_FUNCS_ONCE([iswcntrl])
+  if test $ac_cv_func_iswcntrl = yes; then
+    HAVE_ISWCNTRL=1
+  else
+    HAVE_ISWCNTRL=0
+  fi
+  AC_SUBST([HAVE_ISWCNTRL])
+
+  AC_REQUIRE([AC_C_INLINE])
+
+  AC_REQUIRE([gt_TYPE_WINT_T])
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
+  else
+    HAVE_WINT_T=0
+  fi
+  AC_SUBST([HAVE_WINT_T])
+
+  gl_CHECK_NEXT_HEADERS([wctype.h])
+  if test $ac_cv_header_wctype_h = yes; then
+    if test $ac_cv_func_iswcntrl = yes; then
+      dnl Linux libc5 has an iswprint function that returns 0 for all arguments.
+      dnl The other functions are likely broken in the same way.
+      AC_CACHE_CHECK([whether iswcntrl works], [gl_cv_func_iswcntrl_works],
+        [
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
+               /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+                  included before <wchar.h>.
+                  BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+                  must be included before <wchar.h>.  */
+               #include <stddef.h>
+               #include <stdio.h>
+               #include <time.h>
+               #include <wchar.h>
+               #include <wctype.h>
+               int main () { return iswprint ('x') == 0; }
+            ]])],
+            [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
+            [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+                          #if __GNU_LIBRARY__ == 1
+                          Linux libc5 i18n is broken.
+                          #endif]], [])],
+              [gl_cv_func_iswcntrl_works="guessing yes"],
+              [gl_cv_func_iswcntrl_works="guessing no"])
+            ])
+        ])
+    fi
+    HAVE_WCTYPE_H=1
+  else
+    HAVE_WCTYPE_H=0
+  fi
+  AC_SUBST([HAVE_WCTYPE_H])
+
+  case "$gl_cv_func_iswcntrl_works" in
+    *yes) REPLACE_ISWCNTRL=0 ;;
+    *)    REPLACE_ISWCNTRL=1 ;;
+  esac
+  AC_SUBST([REPLACE_ISWCNTRL])
+
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+    dnl Redefine all of iswcntrl, ..., iswxdigit in <wctype.h>.
+    :
+  fi
+
+  if test $REPLACE_ISWCNTRL = 1; then
+    REPLACE_TOWLOWER=1
+  else
+    AC_CHECK_FUNCS([towlower])
+    if test $ac_cv_func_towlower = yes; then
+      REPLACE_TOWLOWER=0
+    else
+      AC_CHECK_DECLS([towlower],,,
+        [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+             included before <wchar.h>.
+             BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+             must be included before <wchar.h>.  */
+          #include <stddef.h>
+          #include <stdio.h>
+          #include <time.h>
+          #include <wchar.h>
+          #if HAVE_WCTYPE_H
+          # include <wctype.h>
+          #endif
+        ]])
+      if test $ac_cv_have_decl_towlower = yes; then
+        dnl On Minix 3.1.8, the system's <wctype.h> declares towlower() and
+        dnl towupper() although it does not have the functions. Avoid a
+        dnl collision with gnulib's replacement.
+        REPLACE_TOWLOWER=1
+      else
+        REPLACE_TOWLOWER=0
+      fi
+    fi
+  fi
+  AC_SUBST([REPLACE_TOWLOWER])
+
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
+    dnl Redefine towlower, towupper in <wctype.h>.
+    :
+  fi
+
+  dnl We assume that the wctype() and iswctype() functions exist if and only
+  dnl if the type wctype_t is defined in <wchar.h> or in <wctype.h> if that
+  dnl exists.
+  dnl HP-UX 11.00 declares all these in <wchar.h> and lacks <wctype.h>.
+  AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+               included before <wchar.h>.
+               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+               must be included before <wchar.h>.  */
+            #include <stddef.h>
+            #include <stdio.h>
+            #include <time.h>
+            #include <wchar.h>
+            #if HAVE_WCTYPE_H
+            # include <wctype.h>
+            #endif
+            wctype_t a;
+          ]],
+          [[]])],
+       [gl_cv_type_wctype_t=yes],
+       [gl_cv_type_wctype_t=no])
+    ])
+  if test $gl_cv_type_wctype_t = no; then
+    HAVE_WCTYPE_T=0
+  fi
+
+  dnl We assume that the wctrans() and towctrans() functions exist if and only
+  dnl if the type wctrans_t is defined in <wctype.h>.
+  AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be
+               included before <wchar.h>.
+               BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h>
+               must be included before <wchar.h>.  */
+            #include <stddef.h>
+            #include <stdio.h>
+            #include <time.h>
+            #include <wchar.h>
+            #include <wctype.h>
+            wctrans_t a;
+          ]],
+          [[]])],
+       [gl_cv_type_wctrans_t=yes],
+       [gl_cv_type_wctrans_t=no])
+    ])
+  if test $gl_cv_type_wctrans_t = no; then
+    HAVE_WCTRANS_T=0
+  fi
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+#endif
+#include <wctype.h>
+    ]],
+    [wctype iswctype wctrans towctrans
+    ])
+])
+
+AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
+[
+  GNULIB_ISWBLANK=0;    AC_SUBST([GNULIB_ISWBLANK])
+  GNULIB_WCTYPE=0;      AC_SUBST([GNULIB_WCTYPE])
+  GNULIB_ISWCTYPE=0;    AC_SUBST([GNULIB_ISWCTYPE])
+  GNULIB_WCTRANS=0;     AC_SUBST([GNULIB_WCTRANS])
+  GNULIB_TOWCTRANS=0;   AC_SUBST([GNULIB_TOWCTRANS])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_ISWBLANK=1;      AC_SUBST([HAVE_ISWBLANK])
+  HAVE_WCTYPE_T=1;      AC_SUBST([HAVE_WCTYPE_T])
+  HAVE_WCTRANS_T=1;     AC_SUBST([HAVE_WCTRANS_T])
+  REPLACE_ISWBLANK=0;   AC_SUBST([REPLACE_ISWBLANK])
+])
index a6c7d15cb50a60c46df73caef95f0fd1a0034809..3260cce323591e9bf2846e377745cb0b83435129 100644 (file)
@@ -1,5 +1,5 @@
-# wint_t.m4 serial 4 (gettext-0.18)
-dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
+# wint_t.m4 serial 5 (gettext-0.18.2)
+dnl Copyright (C) 2003, 2007-2012 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.
@@ -11,7 +11,9 @@ dnl Prerequisite: AC_PROG_CC
 AC_DEFUN([gt_TYPE_WINT_T],
 [
   AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
-    [AC_TRY_COMPILE([
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
    <wchar.h>.
    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
@@ -20,8 +22,10 @@ AC_DEFUN([gt_TYPE_WINT_T],
 #include <stdio.h>
 #include <time.h>
 #include <wchar.h>
-       wint_t foo = (wchar_t)'\0';], ,
-       [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])])
+            wint_t foo = (wchar_t)'\0';]],
+          [[]])],
+       [gt_cv_c_wint_t=yes],
+       [gt_cv_c_wint_t=no])])
   if test $gt_cv_c_wint_t = yes; then
     AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.])
   fi
index 83247fe329c2225b18944d5e154661a0b4ea5d16..f47b649b5d625285c8992ca4afa2f9b37adaa884 100644 (file)
@@ -1,14 +1,11 @@
-# xalloc.m4 serial 16
-dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2009, 2010 Free Software
-dnl Foundation, Inc.
+# xalloc.m4 serial 17
+dnl Copyright (C) 2002-2006, 2009-2012 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.
 
 AC_DEFUN([gl_XALLOC],
 [
-  AC_LIBOBJ([xmalloc])
-
   gl_PREREQ_XALLOC
   gl_PREREQ_XMALLOC
 ])
diff --git a/m4/xgetcwd.m4 b/m4/xgetcwd.m4
deleted file mode 100644 (file)
index fd534f6..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#serial 6
-dnl Copyright (C) 2002-2006, 2009-2010 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.
-
-AC_DEFUN([gl_XGETCWD],
-[
-  AC_LIBOBJ([xgetcwd])
-
-  AC_REQUIRE([gl_FUNC_GETCWD])
-])
index b653693a3029cb835e98c0d02be9683926e26e00..b3b7feebfae3b993cbfad5fdf0c2d1c82a495b6f 100644 (file)
@@ -1,5 +1,5 @@
 # xsize.m4 serial 4
-dnl Copyright (C) 2003-2004, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2012 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.
index c1a20a55b924b0ca8a830ee0a4e2e80d3fd302d5..00749c469dbd3eaba784ba91f15fa245cbe12187 100644 (file)
@@ -1,5 +1,5 @@
-# yesno.m4 serial 5
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2010 Free Software Foundation,
+# yesno.m4 serial 6
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2012 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,8 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_YESNO],
 [
-  AC_LIBOBJ([yesno])
-
   dnl No prerequisites of lib/yesno.c.
   :
 ])
index 366d12ab44427789974cbb15176a1fd0374055a6..a1af711b1dbd91b59ff3bd8a56d901a2a4efad98 100644 (file)
--- a/maint.mk
+++ b/maint.mk
@@ -2,7 +2,7 @@
 # This Makefile fragment tries to be general-purpose enough to be
 # used by many projects via the gnulib maintainer-makefile module.
 
-## Copyright (C) 2001-2010 Free Software Foundation, Inc.
+## Copyright (C) 2001-2012 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
 # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
 ME := maint.mk
 
-# Override this in cfg.mk if you use a non-standard build-aux directory.
-build_aux ?= $(srcdir)/build-aux
+# Diagnostic for continued use of deprecated variable.
+# Remove in 2013
+ifneq ($(build_aux),)
+ $(error "$(ME): \
+set $$(_build-aux) relative to $$(srcdir) instead of $$(build_aux)")
+endif
 
 # Do not save the original name or timestamp in the .tar.gz file.
 # Use --rsyncable if available.
 gzip_rsyncable := \
-  $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable)
+  $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null \
+    && printf %s --rsyncable)
 GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
 
 GIT = git
 VC = $(GIT)
-VC-tag = git tag -s -m '$(VERSION)' -u '$(gpg_key_ID)'
 
-VC_LIST = $(build_aux)/vc-list-files -C $(srcdir)
+VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir)
 
 # You can override this variable in cfg.mk to set your own regexp
 # matching files to ignore.
 VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
 
+# This is to preprocess robustly the output of $(VC_LIST), so that even
+# when $(srcdir) is a pathological name like "....", the leading sed command
+# removes only the intended prefix.
+_dot_escaped_srcdir = $(subst .,\.,$(srcdir))
+
+# Post-process $(VC_LIST) output, prepending $(srcdir)/, but only
+# when $(srcdir) is not ".".
+ifeq ($(srcdir),.)
+_prepend_srcdir_prefix =
+else
+_prepend_srcdir_prefix = | sed 's|^|$(srcdir)/|'
+endif
+
+# In order to be able to consistently filter "."-relative names,
+# (i.e., with no $(srcdir) prefix), this definition is careful to
+# remove any $(srcdir) prefix, and to restore what it removes.
+_sc_excl = \
+  $(if $(exclude_file_name_regexp--$@),$(exclude_file_name_regexp--$@),^$$)
 VC_LIST_EXCEPT = \
-  $(VC_LIST) | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \
-              else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \
-       | grep -Ev -e '$(VC_LIST_ALWAYS_EXCLUDE_REGEX)'
+  $(VC_LIST) | sed 's|^$(_dot_escaped_srcdir)/||' \
+       | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \
+         else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \
+       | grep -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
+       $(_prepend_srcdir_prefix)
 
 ifeq ($(origin prev_version_file), undefined)
   prev_version_file = $(srcdir)/.prev-version
@@ -84,6 +108,12 @@ endif
 # Override this in cfg.mk if you are using a different format in your
 # NEWS file.
 today = $(shell date +%Y-%m-%d)
+
+# Select which lines of NEWS are searched for $(news-check-regexp).
+# This is a sed line number spec.  The default says that we search
+# lines 1..10 of NEWS for $(news-check-regexp).
+# If you want to search only line 3 or only lines 20-22, use "3" or "20,22".
+news-check-lines-spec ?= 1,10
 news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)'
 
 # Prevent programs like 'sort' from considering distinct strings to be equal.
@@ -96,88 +126,219 @@ export LC_ALL = C
 
 _cfg_mk := $(shell test -f $(srcdir)/cfg.mk && echo '$(srcdir)/cfg.mk')
 
-# Collect the names of rules starting with `sc_'.
+# Collect the names of rules starting with 'sc_'.
 syntax-check-rules := $(sort $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
                        $(srcdir)/$(ME) $(_cfg_mk)))
 .PHONY: $(syntax-check-rules)
 
-local-checks-available = \
-  $(syntax-check-rules)
+ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0)
+local-checks-available += $(syntax-check-rules)
+else
+local-checks-available += no-vc-detected
+no-vc-detected:
+       @echo "No version control files detected; skipping syntax check"
+endif
 .PHONY: $(local-checks-available)
 
 # Arrange to print the name of each syntax-checking rule just before running it.
 $(syntax-check-rules): %: %.m
-$(patsubst %, %.m, $(syntax-check-rules)):
+sc_m_rules_ = $(patsubst %, %.m, $(syntax-check-rules))
+.PHONY: $(sc_m_rules_)
+$(sc_m_rules_):
        @echo $(patsubst sc_%.m, %, $@)
-
-local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available))
+       @date +%s.%N > .sc-start-$(basename $@)
+
+# Compute and print the elapsed time for each syntax-check rule.
+sc_z_rules_ = $(patsubst %, %.z, $(syntax-check-rules))
+.PHONY: $(sc_z_rules_)
+$(sc_z_rules_): %.z: %
+       @end=$$(date +%s.%N);                                           \
+       start=$$(cat .sc-start-$*);                                     \
+       rm -f .sc-start-$*;                                             \
+       awk -v s=$$start -v e=$$end                                     \
+         'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null
+
+# The patsubst here is to replace each sc_% rule with its sc_%.z wrapper
+# that computes and prints elapsed time.
+local-check :=                                                         \
+  $(patsubst sc_%, sc_%.z,                                             \
+    $(filter-out $(local-checks-to-skip), $(local-checks-available)))
 
 syntax-check: $(local-check)
-#      @grep -nE '#  *include <(limits|std(def|arg|bool))\.h>'         \
-#          $$(find -type f -name '*.[chly]') &&                        \
-#        { echo '$(ME): found conditional include' 1>&2;               \
-#          exit 1; } || :
-
-#      grep -nE '^#  *include <(string|stdlib)\.h>'                    \
-#          $(srcdir)/{lib,src}/*.[chy] &&                              \
-#        { echo '$(ME): FIXME' 1>&2;                                   \
-#          exit 1; } || :
-# FIXME: don't allow `#include .strings\.h' anywhere
-
-# By default, _prohibit_regexp does not ignore case.
+
+# _sc_search_regexp
+#
+# This macro searches for a given construct in the selected files and
+# then takes some action.
+#
+# Parameters (shell variables):
+#
+#  prohibit | require
+#
+#     Regular expression (ERE) denoting either a forbidden construct
+#     or a required construct.  Those arguments are exclusive.
+#
+#  exclude
+#
+#     Regular expression (ERE) denoting lines to ignore that matched
+#     a prohibit construct.  For example, this can be used to exclude
+#     comments that mention why the nearby code uses an alternative
+#     construct instead of the simpler prohibited construct.
+#
+#  in_vc_files | in_files
+#
+#     grep-E-style regexp denoting the files to check.  If no files
+#     are specified the default are all the files that are under
+#     version control.
+#
+#  containing | non_containing
+#
+#     Select the files (non) containing strings matching this regexp.
+#     If both arguments are specified then CONTAINING takes
+#     precedence.
+#
+#  with_grep_options
+#
+#     Extra options for grep.
+#
+#  ignore_case
+#
+#     Ignore case.
+#
+#  halt
+#
+#     Message to display before to halting execution.
+#
+# Finally, you may exempt files based on an ERE matching file names.
+# For example, to exempt from the sc_space_tab check all files with the
+# .diff suffix, set this Make variable:
+#
+# exclude_file_name_regexp--sc_space_tab = \.diff$
+#
+# Note that while this functionality is mostly inherited via VC_LIST_EXCEPT,
+# when filtering by name via in_files, we explicitly filter out matching
+# names here as well.
+
+# Initialize each, so that envvar settings cannot interfere.
+export require =
+export prohibit =
+export exclude =
+export in_vc_files =
+export in_files =
+export containing =
+export non_containing =
+export halt =
+export with_grep_options =
+
+# By default, _sc_search_regexp does not ignore case.
 export ignore_case =
-_ignore_case = $$(test -n "$$ignore_case" && echo -i || :)
+_ignore_case = $$(test -n "$$ignore_case" && printf %s -i || :)
 
-# There are many rules below that prohibit constructs in this package.
-# If the offending construct can be matched with a grep-E-style regexp,
-# use this macro.  The shell variables "re" and "msg" must be defined.
-define _prohibit_regexp
-  dummy=; : so we do not need a semicolon before each use;             \
-  test "x$$re" != x || { echo '$(ME): re not defined' 1>&2; exit 1; }; \
-  test "x$$msg" != x || { echo '$(ME): msg not defined' 1>&2; exit 1; };\
-  grep $(_ignore_case) -nE "$$re" $$($(VC_LIST_EXCEPT)) &&             \
-    { echo '$(ME): '"$$msg" 1>&2; exit 1; } || :
+define _sc_say_and_exit
+   dummy=; : so we do not need a semicolon before each use;            \
+   { printf '%s\n' "$(ME): $$msg" 1>&2; exit 1; };
+endef
+
+define _sc_search_regexp
+   dummy=; : so we do not need a semicolon before each use;            \
+                                                                       \
+   : Check arguments;                                                  \
+   test -n "$$prohibit" && test -n "$$require"                         \
+     && { msg='Cannot specify both prohibit and require'               \
+          $(_sc_say_and_exit) } || :;                                  \
+   test -z "$$prohibit" && test -z "$$require"                         \
+     && { msg='Should specify either prohibit or require'              \
+          $(_sc_say_and_exit) } || :;                                  \
+   test -z "$$prohibit" && test -n "$$exclude"                         \
+     && { msg='Use of exclude requires a prohibit pattern'             \
+          $(_sc_say_and_exit) } || :;                                  \
+   test -n "$$in_vc_files" && test -n "$$in_files"                     \
+     && { msg='Cannot specify both in_vc_files and in_files'           \
+          $(_sc_say_and_exit) } || :;                                  \
+   test "x$$halt" != x                                                 \
+     || { msg='halt not defined' $(_sc_say_and_exit) };                        \
+                                                                       \
+   : Filter by file name;                                              \
+   if test -n "$$in_files"; then                                       \
+     files=$$(find $(srcdir) | grep -E "$$in_files"                    \
+              | grep -Ev '$(exclude_file_name_regexp--$@)');           \
+   else                                                                        \
+     files=$$($(VC_LIST_EXCEPT));                                      \
+     if test -n "$$in_vc_files"; then                                  \
+       files=$$(echo "$$files" | grep -E "$$in_vc_files");             \
+     fi;                                                               \
+   fi;                                                                 \
+                                                                       \
+   : Filter by content;                                                        \
+   test -n "$$files" && test -n "$$containing"                         \
+     && { files=$$(grep -l "$$containing" $$files); } || :;            \
+   test -n "$$files" && test -n "$$non_containing"                     \
+     && { files=$$(grep -vl "$$non_containing" $$files); } || :;       \
+                                                                       \
+   : Check for the construct;                                          \
+   if test -n "$$files"; then                                          \
+     if test -n "$$prohibit"; then                                     \
+       grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \
+         | grep -vE "$${exclude:-^$$}"                                 \
+         && { msg="$$halt" $(_sc_say_and_exit) } || :;                 \
+     else                                                              \
+       grep $$with_grep_options $(_ignore_case) -LE "$$require" $$files \
+           | grep .                                                    \
+         && { msg="$$halt" $(_sc_say_and_exit) } || :;                 \
+     fi                                                                        \
+   else :;                                                             \
+   fi || :;
 endef
 
 sc_avoid_if_before_free:
-       @$(build_aux)/useless-if-before-free                            \
+       @$(srcdir)/$(_build-aux)/useless-if-before-free                 \
                $(useless_free_options)                                 \
            $$($(VC_LIST_EXCEPT) | grep -v useless-if-before-free) &&   \
          { echo '$(ME): found useless "if" before "free" above' 1>&2;  \
            exit 1; } || :
 
 sc_cast_of_argument_to_free:
-       @re='\<free *\( *\(' msg='don'\''t cast free argument'          \
-         $(_prohibit_regexp)
+       @prohibit='\<free *\( *\(' halt="don't cast free argument"      \
+         $(_sc_search_regexp)
 
 sc_cast_of_x_alloc_return_value:
-       @re='\*\) *x(m|c|re)alloc\>'                                    \
-       msg='don'\''t cast x*alloc return value'                        \
-         $(_prohibit_regexp)
+       @prohibit='\*\) *x(m|c|re)alloc\>'                              \
+       halt="don't cast x*alloc return value"                          \
+         $(_sc_search_regexp)
 
 sc_cast_of_alloca_return_value:
-       @re='\*\) *alloca\>' msg='don'\''t cast alloca return value'    \
-         $(_prohibit_regexp)
+       @prohibit='\*\) *alloca\>'                                      \
+       halt="don't cast alloca return value"                           \
+         $(_sc_search_regexp)
 
 sc_space_tab:
-       @re='[ ]        ' msg='found SPACE-TAB sequence; remove the SPACE' \
-         $(_prohibit_regexp)
+       @prohibit='[ ]  '                                               \
+       halt='found SPACE-TAB sequence; remove the SPACE'               \
+         $(_sc_search_regexp)
 
-# Don't use *scanf or the old ato* functions in `real' code.
+# Don't use *scanf or the old ato* functions in "real" code.
 # They provide no error checking mechanism.
 # Instead, use strto* functions.
 sc_prohibit_atoi_atof:
-       @re='\<([fs]?scanf|ato([filq]|ll)) *\('                         \
-       msg='do not use *scan''f, ato''f, ato''i, ato''l, ato''ll or ato''q' \
-         $(_prohibit_regexp)
+       @prohibit='\<([fs]?scanf|ato([filq]|ll)) *\('                           \
+       halt='do not use *scan''f, ato''f, ato''i, ato''l, ato''ll or ato''q'   \
+         $(_sc_search_regexp)
 
 # Use STREQ rather than comparing strcmp == 0, or != 0.
+sp_ = strcmp *\(.+\)
 sc_prohibit_strcmp:
-       @grep -nE '! *str''cmp *\(|\<str''cmp *\([^)]+\) *=='           \
-           $$($(VC_LIST_EXCEPT))                                       \
-         | grep -vE ':# *define STREQ\(' &&                            \
-         { echo '$(ME): use STREQ in place of the above uses of str''cmp' \
-               1>&2; exit 1; } || :
+       @prohibit='! *strcmp *\(|\<$(sp_) *[!=]=|[!=]= *$(sp_)'         \
+       exclude=':# *define STRN?EQ\('                                  \
+       halt='$(ME): replace strcmp calls above with STREQ/STRNEQ'      \
+         $(_sc_search_regexp)
+
+# Really.  You don't want to use this function.
+# It may fail to NUL-terminate the destination,
+# and always NUL-pads out to the specified length.
+sc_prohibit_strncpy:
+       @prohibit='\<strncpy *\('                                       \
+       halt='do not use strncpy, period'                               \
+         $(_sc_search_regexp)
 
 # Pass EXIT_*, not number, to usage, exit, and error (when exiting)
 # Convert all uses automatically, via these two commands:
@@ -190,28 +351,29 @@ sc_prohibit_strcmp:
 #  | xargs --no-run-if-empty \
 #      perl -pi -e 's/(^|[^.])\b(exit ?)\(0\)/$1$2(EXIT_SUCCESS)/'
 sc_prohibit_magic_number_exit:
-       @re='(^|[^.])\<(usage|exit) ?\([0-9]|\<error ?\([1-9][0-9]*,'   \
-       msg='use EXIT_* values rather than magic number'                \
-         $(_prohibit_regexp)
+       @prohibit='(^|[^.])\<(usage|exit) ?\([0-9]|\<error ?\([1-9][0-9]*,'     \
+       halt='use EXIT_* values rather than magic number'                       \
+         $(_sc_search_regexp)
 
 # Using EXIT_SUCCESS as the first argument to error is misleading,
-# since when that parameter is 0, error does not exit.  Use `0' instead.
+# since when that parameter is 0, error does not exit.  Use '0' instead.
 sc_error_exit_success:
-       @grep -nE 'error \(EXIT_SUCCESS,'                               \
-           $$($(VC_LIST_EXCEPT) | grep -E '\.[chly]$$') &&             \
-         { echo '$(ME): found error (EXIT_SUCCESS' 1>&2; exit 1; } || :
+       @prohibit='error *\(EXIT_SUCCESS,'                              \
+       in_vc_files='\.[chly]$$'                                        \
+       halt='found error (EXIT_SUCCESS'                                \
+        $(_sc_search_regexp)
 
-# `FATAL:' should be fully upper-cased in error messages
-# `WARNING:' should be fully upper-cased, or fully lower-cased
+# "FATAL:" should be fully upper-cased in error messages
+# "WARNING:" should be fully upper-cased, or fully lower-cased
 sc_error_message_warn_fatal:
-       @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT))               \
+       @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))              \
            | grep -E '"Warning|"Fatal|"fatal' &&                       \
          { echo '$(ME): use FATAL, WARNING or warning' 1>&2;           \
            exit 1; } || :
 
 # Error messages should not start with a capital letter
 sc_error_message_uppercase:
-       @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT))               \
+       @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))              \
            | grep -E '"[A-Z]'                                          \
            | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' &&           \
          { echo '$(ME): found capitalized error message' 1>&2;         \
@@ -219,35 +381,32 @@ sc_error_message_uppercase:
 
 # Error messages should not end with a period
 sc_error_message_period:
-       @grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT))               \
+       @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))              \
            | grep -E '[^."]\."' &&                                     \
          { echo '$(ME): found error message ending in period' 1>&2;    \
            exit 1; } || :
 
 sc_file_system:
-       @re=file''system ignore_case=1                                  \
-       msg='found use of "file''system"; spell it "file system"'       \
-         $(_prohibit_regexp)
+       @prohibit=file''system                                          \
+       ignore_case=1                                                   \
+       halt='found use of "file''system"; spell it "file system"'      \
+         $(_sc_search_regexp)
 
 # Don't use cpp tests of this symbol.  All code assumes config.h is included.
 sc_prohibit_have_config_h:
-       @grep -n '^# *if.*HAVE''_CONFIG_H' $$($(VC_LIST_EXCEPT)) &&     \
-         { echo '$(ME): found use of HAVE''_CONFIG_H; remove'          \
-               1>&2; exit 1; } || :
+       @prohibit='^# *if.*HAVE''_CONFIG_H'                             \
+       halt='found use of HAVE''_CONFIG_H; remove'                     \
+         $(_sc_search_regexp)
 
 # Nearly all .c files must include <config.h>.  However, we also permit this
 # via inclusion of a package-specific header, if cfg.mk specified one.
 # config_h_header must be suitable for grep -E.
 config_h_header ?= <config\.h>
 sc_require_config_h:
-       @if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then       \
-         grep -EL '^# *include $(config_h_header)'                     \
-               $$($(VC_LIST_EXCEPT) | grep '\.c$$')                    \
-             | grep . &&                                               \
-         { echo '$(ME): the above files do not include <config.h>'     \
-               1>&2; exit 1; } || :;                                   \
-       else :;                                                         \
-       fi
+       @require='^# *include $(config_h_header)'                       \
+       in_vc_files='\.c$$'                                             \
+       halt='the above files do not include <config.h>'                \
+         $(_sc_search_regexp)
 
 # You must include <config.h> before including any other header file.
 # This can possibly be via a package-specific header, if given by cfg.mk.
@@ -266,15 +425,16 @@ sc_require_config_h_first:
        fi
 
 sc_prohibit_HAVE_MBRTOWC:
-       @re='\bHAVE_MBRTOWC\b' msg="do not use $$re; it is always defined" \
-         $(_prohibit_regexp)
+       @prohibit='\bHAVE_MBRTOWC\b'                                    \
+       halt="do not use $$prohibit; it is always defined"              \
+         $(_sc_search_regexp)
 
 # To use this "command" macro, you must first define two shell variables:
-# h: the header, enclosed in <> or ""
+# h: the header name, with no enclosing <> or ""
 # re: a regular expression that matches IFF something provided by $h is used.
-define _header_without_use
+define _sc_header_without_use
   dummy=; : so we do not need a semicolon before each use;             \
-  h_esc=`echo "$$h"|sed 's/\./\\\\./g'`;                               \
+  h_esc=`echo '[<"]'"$$h"'[">]'|sed 's/\./\\\\./g'`;                   \
   if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then             \
     files=$$(grep -l '^# *include '"$$h_esc"                           \
             $$($(VC_LIST_EXCEPT) | grep '\.c$$')) &&                   \
@@ -287,44 +447,50 @@ endef
 
 # Prohibit the inclusion of assert.h without an actual use of assert.
 sc_prohibit_assert_without_use:
-       @h='<assert.h>' re='\<assert *\(' $(_header_without_use)
+       @h='assert.h' re='\<assert *\(' $(_sc_header_without_use)
 
 # Prohibit the inclusion of close-stream.h without an actual use.
 sc_prohibit_close_stream_without_use:
-       @h='"close-stream.h"' re='\<close_stream *\(' $(_header_without_use)
+       @h='close-stream.h' re='\<close_stream *\(' $(_sc_header_without_use)
 
 # Prohibit the inclusion of getopt.h without an actual use.
 sc_prohibit_getopt_without_use:
-       @h='<getopt.h>' re='\<getopt(_long)? *\(' $(_header_without_use)
+       @h='getopt.h' re='\<getopt(_long)? *\(' $(_sc_header_without_use)
 
 # Don't include quotearg.h unless you use one of its functions.
 sc_prohibit_quotearg_without_use:
-       @h='"quotearg.h"' re='\<quotearg(_[^ ]+)? *\(' $(_header_without_use)
+       @h='quotearg.h' re='\<quotearg(_[^ ]+)? *\(' $(_sc_header_without_use)
 
 # Don't include quote.h unless you use one of its functions.
 sc_prohibit_quote_without_use:
-       @h='"quote.h"' re='\<quote(_n)? *\(' $(_header_without_use)
+       @h='quote.h' re='\<quote((_n)? *\(|_quoting_options\>)' \
+         $(_sc_header_without_use)
 
 # Don't include this header unless you use one of its functions.
 sc_prohibit_long_options_without_use:
-       @h='"long-options.h"' re='\<parse_long_options *\(' \
-         $(_header_without_use)
+       @h='long-options.h' re='\<parse_long_options *\(' \
+         $(_sc_header_without_use)
 
 # Don't include this header unless you use one of its functions.
 sc_prohibit_inttostr_without_use:
-       @h='"inttostr.h"' re='\<(off|[iu]max|uint)tostr *\(' \
-         $(_header_without_use)
+       @h='inttostr.h' re='\<(off|[iu]max|uint)tostr *\(' \
+         $(_sc_header_without_use)
+
+# Don't include this header unless you use one of its functions.
+sc_prohibit_ignore_value_without_use:
+       @h='ignore-value.h' re='\<ignore_(value|ptr) *\(' \
+         $(_sc_header_without_use)
 
 # Don't include this header unless you use one of its functions.
 sc_prohibit_error_without_use:
-       @h='"error.h"' \
+       @h='error.h' \
        re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
-         $(_header_without_use)
+         $(_sc_header_without_use)
 
 # Don't include xalloc.h unless you use one of its functions.
 # Consider these symbols:
 # perl -lne '/^# *define (\w+)\(/ and print $1' lib/xalloc.h|grep -v '^__';
-# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) \(/ and print $1' lib/xalloc.h
+# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/xalloc.h
 # Divide into two sets on case, and filter each through this:
 # | sort | perl -MRegexp::Assemble -le \
 #  'print Regexp::Assemble->new(file => "/dev/stdin")->as_string'|sed 's/\?://g'
@@ -340,39 +506,66 @@ sc_prohibit_error_without_use:
 _xa1 = x(((2n?)?re|char|n(re|m)|[cmz])alloc|alloc_(oversized|die)|(mem|str)dup)
 _xa2 = X([CZ]|N?M)ALLOC
 sc_prohibit_xalloc_without_use:
-       @h='"xalloc.h"' \
+       @h='xalloc.h' \
        re='\<($(_xa1)|$(_xa2)) *\('\
-         $(_header_without_use)
+         $(_sc_header_without_use)
+
+# Extract function names:
+# perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/hash.h
+_hash_re = \
+clear|delete|free|get_(first|next)|insert|lookup|print_statistics|reset_tuning
+_hash_fn = \<($(_hash_re)) *\(
+_hash_struct = (struct )?\<[Hh]ash_(table|tuning)\>
+sc_prohibit_hash_without_use:
+       @h='hash.h' \
+       re='$(_hash_fn)|$(_hash_struct)'\
+         $(_sc_header_without_use)
+
+sc_prohibit_cloexec_without_use:
+       @h='cloexec.h' re='\<(set_cloexec_flag|dup_cloexec) *\(' \
+         $(_sc_header_without_use)
+
+sc_prohibit_posixver_without_use:
+       @h='posixver.h' re='\<posix2_version *\(' $(_sc_header_without_use)
+
+sc_prohibit_same_without_use:
+       @h='same.h' re='\<same_name *\(' $(_sc_header_without_use)
+
+sc_prohibit_hash_pjw_without_use:
+       @h='hash-pjw.h' \
+       re='\<hash_pjw\>' \
+         $(_sc_header_without_use)
 
 sc_prohibit_safe_read_without_use:
-       @h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
-         $(_header_without_use)
+       @h='safe-read.h' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
+         $(_sc_header_without_use)
 
 sc_prohibit_argmatch_without_use:
-       @h='"argmatch.h"' \
-       re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<argmatch(_exit_fn|_(in)?valid) *\()' \
-         $(_header_without_use)
+       @h='argmatch.h' \
+       re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \
+         $(_sc_header_without_use)
 
 sc_prohibit_canonicalize_without_use:
-       @h='"canonicalize.h"' \
-       re='CAN_(EXISTING|ALL_BUT_LAST|MISSING)|canonicalize_(mode_t|filename_mode)' \
-         $(_header_without_use)
+       @h='canonicalize.h' \
+       re='CAN_(EXISTING|ALL_BUT_LAST|MISSING)|canonicalize_(mode_t|filename_mode|file_name)' \
+         $(_sc_header_without_use)
 
 sc_prohibit_root_dev_ino_without_use:
-       @h='"root-dev-ino.h"' \
+       @h='root-dev-ino.h' \
        re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
-         $(_header_without_use)
+         $(_sc_header_without_use)
 
 sc_prohibit_openat_without_use:
-       @h='"openat.h"' \
+       @h='openat.h' \
        re='\<(openat_(permissive|needs_fchdir|(save|restore)_fail)|l?(stat|ch(own|mod))at|(euid)?accessat)\>' \
-         $(_header_without_use)
+         $(_sc_header_without_use)
 
 # Prohibit the inclusion of c-ctype.h without an actual use.
 ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
 |isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
 sc_prohibit_c_ctype_without_use:
-       @h='[<"]c-ctype.h[">]' re='\<c_($(ctype_re)) *\(' $(_header_without_use)
+       @h='c-ctype.h' re='\<c_($(ctype_re)) *\(' \
+         $(_sc_header_without_use)
 
 _empty =
 _sp = $(_empty) $(_empty)
@@ -407,37 +600,104 @@ _sig_syms_re = $(subst $(_sp),|,$(strip $(_sig_names) $(_sig_types_and_consts)))
 
 # Prohibit the inclusion of signal.h without an actual use.
 sc_prohibit_signal_without_use:
-       @h='<signal.h>'                                                 \
+       @h='signal.h'                                                   \
        re='\<($(_sig_function_re)) *\(|\<($(_sig_syms_re))\>'          \
-         $(_header_without_use)
+         $(_sc_header_without_use)
+
+# Don't include stdio--.h unless you use one of its functions.
+sc_prohibit_stdio--_without_use:
+       @h='stdio--.h' re='\<((f(re)?|p)open|tmpfile) *\('              \
+         $(_sc_header_without_use)
+
+# Don't include stdio-safer.h unless you use one of its functions.
+sc_prohibit_stdio-safer_without_use:
+       @h='stdio-safer.h' re='\<((f(re)?|p)open|tmpfile)_safer *\('    \
+         $(_sc_header_without_use)
+
+# Prohibit the inclusion of strings.h without a sensible use.
+# Using the likes of bcmp, bcopy, bzero, index or rindex is not sensible.
+sc_prohibit_strings_without_use:
+       @h='strings.h'                                                  \
+       re='\<(strn?casecmp|ffs(ll)?)\>'                                \
+         $(_sc_header_without_use)
+
+# Get the list of symbol names with this:
+# perl -lne '/^# *define ([A-Z]\w+)\(/ and print $1' lib/intprops.h|fmt
+_intprops_names =                                                      \
+  TYPE_IS_INTEGER TYPE_TWOS_COMPLEMENT TYPE_ONES_COMPLEMENT            \
+  TYPE_SIGNED_MAGNITUDE TYPE_SIGNED TYPE_MINIMUM TYPE_MAXIMUM          \
+  INT_BITS_STRLEN_BOUND INT_STRLEN_BOUND INT_BUFSIZE_BOUND             \
+  INT_ADD_RANGE_OVERFLOW INT_SUBTRACT_RANGE_OVERFLOW                   \
+  INT_NEGATE_RANGE_OVERFLOW INT_MULTIPLY_RANGE_OVERFLOW                        \
+  INT_DIVIDE_RANGE_OVERFLOW INT_REMAINDER_RANGE_OVERFLOW               \
+  INT_LEFT_SHIFT_RANGE_OVERFLOW INT_ADD_OVERFLOW INT_SUBTRACT_OVERFLOW \
+  INT_NEGATE_OVERFLOW INT_MULTIPLY_OVERFLOW INT_DIVIDE_OVERFLOW                \
+  INT_REMAINDER_OVERFLOW INT_LEFT_SHIFT_OVERFLOW
+_intprops_syms_re = $(subst $(_sp),|,$(strip $(_intprops_names)))
+# Prohibit the inclusion of intprops.h without an actual use.
+sc_prohibit_intprops_without_use:
+       @h='intprops.h'                                                 \
+       re='\<($(_intprops_syms_re)) *\('                               \
+         $(_sc_header_without_use)
+
+_stddef_syms_re = NULL|offsetof|ptrdiff_t|size_t|wchar_t
+# Prohibit the inclusion of stddef.h without an actual use.
+sc_prohibit_stddef_without_use:
+       @h='stddef.h'                                                   \
+       re='\<($(_stddef_syms_re))\>'                                   \
+         $(_sc_header_without_use)
+
+_de1 = dirfd|(close|(fd)?open|read|rewind|seek|tell)dir(64)?(_r)?
+_de2 = (versionsort|struct dirent|getdirentries|alphasort|scandir(at)?)(64)?
+_de3 = MAXNAMLEN|DIR|ino_t|d_ino|d_fileno|d_namlen
+_dirent_syms_re = $(_de1)|$(_de2)|$(_de3)
+# Prohibit the inclusion of dirent.h without an actual use.
+sc_prohibit_dirent_without_use:
+       @h='dirent.h'                                                   \
+       re='\<($(_dirent_syms_re))\>'                                   \
+         $(_sc_header_without_use)
+
+# Prohibit the inclusion of verify.h without an actual use.
+sc_prohibit_verify_without_use:
+       @h='verify.h'                                                   \
+       re='\<(verify(true|expr)?|static_assert) *\('                   \
+         $(_sc_header_without_use)
+
+# Don't include xfreopen.h unless you use one of its functions.
+sc_prohibit_xfreopen_without_use:
+       @h='xfreopen.h' re='\<xfreopen *\(' $(_sc_header_without_use)
 
 sc_obsolete_symbols:
-       @re='\<(HAVE''_FCNTL_H|O''_NDELAY)\>'                           \
-       msg='do not use HAVE''_FCNTL_H or O'_NDELAY                     \
-         $(_prohibit_regexp)
+       @prohibit='\<(HAVE''_FCNTL_H|O''_NDELAY)\>'                     \
+       halt='do not use HAVE''_FCNTL_H or O'_NDELAY                    \
+         $(_sc_search_regexp)
 
 # FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
 
 # Each nonempty ChangeLog line must start with a year number, or a TAB.
 sc_changelog:
-       @if $(VC_LIST_EXCEPT) | grep -l '^ChangeLog$$' >/dev/null; then \
-         grep -n '^[^12        ]'                                      \
-           $$($(VC_LIST_EXCEPT) | grep '^ChangeLog$$') &&              \
-         { echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2;  \
-           exit 1; } || :;                                             \
-       fi
+       @prohibit='^[^12        ]'                                      \
+       in_vc_files='^ChangeLog$$'                                      \
+       halt='found unexpected prefix in a ChangeLog'                   \
+         $(_sc_search_regexp)
 
 # Ensure that each .c file containing a "main" function also
 # calls set_program_name.
 sc_program_name:
-       @if $(VC_LIST_EXCEPT) | grep -l '\.c$$' > /dev/null; then       \
-         files=$$(grep -l '^main *(' $$($(VC_LIST_EXCEPT) | grep '\.c$$')); \
-         grep -LE 'set_program_name *\(m?argv\[0\]\);' $$files         \
-             | grep . &&                                               \
-         { echo '$(ME): the above files do not call set_program_name'  \
-               1>&2; exit 1; } || :;                                   \
-       else :;                                                         \
-       fi
+       @require='set_program_name *\(m?argv\[0\]\);'                   \
+       in_vc_files='\.c$$'                                             \
+       containing='\<main *('                                          \
+       halt='the above files do not call set_program_name'             \
+         $(_sc_search_regexp)
+
+# Ensure that each .c file containing a "main" function also
+# calls bindtextdomain.
+sc_bindtextdomain:
+       @require='bindtextdomain *\('                                   \
+       in_vc_files='\.c$$'                                             \
+       containing='\<main *('                                          \
+       halt='the above files do not call bindtextdomain'               \
+         $(_sc_search_regexp)
 
 # Require that the final line of each test-lib.sh-using test be this one:
 # Exit $fail
@@ -458,76 +718,266 @@ sc_require_test_exit_idiom:
              exit 1; } || :;                                           \
        fi
 
-sc_the_the:
-       @re='\<the ''the\>'                                             \
-       ignore_case=1 msg='found use of "the ''the";'                   \
-         $(_prohibit_regexp)
-
 sc_trailing_blank:
-       @re='[   ]$$'                                                   \
-       msg='found trailing blank(s)'                                   \
-         $(_prohibit_regexp)
+       @prohibit='[     ]$$'                                           \
+       halt='found trailing blank(s)'                                  \
+         $(_sc_search_regexp)
 
 # Match lines like the following, but where there is only one space
 # between the options and the description:
 #   -D, --all-repeated[=delimit-method]  print all duplicate lines\n
 longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)?
 sc_two_space_separator_in_usage:
-       @grep -nE '^   *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$'         \
-           $$($(VC_LIST_EXCEPT)) &&                                    \
-         { echo "$(ME): help2man requires at least two spaces between"; \
-           echo "$(ME): an option and its description";                \
-               1>&2; exit 1; } || :
+       @prohibit='^   *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$'         \
+       halt='help2man requires at least two spaces between an option and its description'\
+         $(_sc_search_regexp)
+
+# A regexp matching function names like "error" that may be used
+# to emit translatable messages.
+_gl_translatable_diag_func_re ?= error
 
 # Look for diagnostics that aren't marked for translation.
 # This won't find any for which error's format string is on a separate line.
 sc_unmarked_diagnostics:
-       @grep -nE                                                       \
-           '\<error \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT))       \
-         | grep -v '_''(' &&                                           \
-         { echo '$(ME): found unmarked diagnostic(s)' 1>&2;            \
-           exit 1; } || :
+       @prohibit='\<$(_gl_translatable_diag_func_re) *\([^"]*"[^"]*[a-z]{3}' \
+       exclude='(_|ngettext ?)\('                                      \
+       halt='$(ME): found unmarked diagnostic(s)'                      \
+         $(_sc_search_regexp)
 
 # Avoid useless parentheses like those in this example:
 # #if defined (SYMBOL) || defined (SYM2)
 sc_useless_cpp_parens:
-       @grep -n '^# *if .*defined *(' $$($(VC_LIST_EXCEPT)) &&         \
-         { echo '$(ME): found useless parentheses in cpp directive'    \
-               1>&2; exit 1; } || :
+       @prohibit='^# *if .*defined *\('                                \
+       halt='found useless parentheses in cpp directive'               \
+         $(_sc_search_regexp)
+
+# List headers for which HAVE_HEADER_H is always true, assuming you are
+# using the appropriate gnulib module.  CAUTION: for each "unnecessary"
+# #if HAVE_HEADER_H that you remove, be sure that your project explicitly
+# requires the gnulib module that guarantees the usability of that header.
+gl_assured_headers_ = \
+  cd $(gnulib_dir)/lib && echo *.in.h|sed 's/\.in\.h//g'
+
+# Convert the list of names to upper case, and replace each space with "|".
+az_ = abcdefghijklmnopqrstuvwxyz
+AZ_ = ABCDEFGHIJKLMNOPQRSTUVWXYZ
+gl_header_upper_case_or_ =                                             \
+  $$($(gl_assured_headers_)                                            \
+    | tr $(az_)/.- $(AZ_)___                                           \
+    | tr -s ' ' '|'                                                    \
+    )
+sc_prohibit_always_true_header_tests:
+       @or=$(gl_header_upper_case_or_);                                \
+       re="HAVE_($$or)_H";                                             \
+       prohibit='\<'"$$re"'\>'                                         \
+       halt=$$(printf '%s\n'                                           \
+       'do not test the above HAVE_<header>_H symbol(s);'              \
+       '  with the corresponding gnulib module, they are always true') \
+         $(_sc_search_regexp)
+
+# ==================================================================
+gl_other_headers_ ?= \
+  intprops.h   \
+  openat.h     \
+  stat-macros.h
+
+# Perl -lne code to extract "significant" cpp-defined symbols from a
+# gnulib header file, eliminating a few common false-positives.
+# The exempted names below are defined only conditionally in gnulib,
+# and hence sometimes must/may be defined in application code.
+gl_extract_significant_defines_ = \
+  /^\# *define ([^_ (][^ (]*)(\s*\(|\s+\w+)/\
+    && $$2 !~ /(?:rpl_|_used_without_)/\
+    && $$1 !~ /^(?:NSIG|ENODATA)$$/\
+    && $$1 !~ /^(?:SA_RESETHAND|SA_RESTART)$$/\
+    and print $$1
+
+# Create a list of regular expressions matching the names
+# of macros that are guaranteed to be defined by parts of gnulib.
+define def_sym_regex
+       gen_h=$(gl_generated_headers_);                                 \
+       (cd $(gnulib_dir)/lib;                                          \
+         for f in *.in.h $(gl_other_headers_); do                      \
+           test -f $$f                                                 \
+             && perl -lne '$(gl_extract_significant_defines_)' $$f;    \
+         done;                                                         \
+       ) | sort -u                                                     \
+         | sed 's/^/^ *# *(define|undef)  */;s/$$/\\>/'
+endef
+
+# Don't define macros that we already get from gnulib header files.
+sc_prohibit_always-defined_macros:
+       @if test -d $(gnulib_dir); then                                 \
+         case $$(echo all: | grep -l -f - Makefile) in Makefile);; *)  \
+           echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \
+         esac;                                                         \
+         $(def_sym_regex) | grep -E -f - $$($(VC_LIST_EXCEPT))         \
+           && { echo '$(ME): define the above via some gnulib .h file' \
+                 1>&2;  exit 1; } || :;                                \
+       fi
+# ==================================================================
+
+# Prohibit checked in backup files.
+sc_prohibit_backup_files:
+       @$(VC_LIST) | grep '~$$' &&                             \
+         { echo '$(ME): found version controlled backup file' 1>&2;    \
+           exit 1; } || :
 
 # Require the latest GPL.
 sc_GPL_version:
-       @re='either ''version [^3]' msg='GPL vN, N!=3'                  \
-         $(_prohibit_regexp)
+       @prohibit='either ''version [^3]'                               \
+       halt='GPL vN, N!=3'                                             \
+         $(_sc_search_regexp)
 
 # Require the latest GFDL.  Two regexp, since some .texi files end up
 # line wrapping between 'Free Documentation License,' and 'Version'.
 _GFDL_regexp = (Free ''Documentation.*Version 1\.[^3]|Version 1\.[^3] or any)
 sc_GFDL_version:
-       @re='$(_GFDL_regexp)' msg='GFDL vN, N!=3'                       \
-         $(_prohibit_regexp)
+       @prohibit='$(_GFDL_regexp)'                                     \
+       halt='GFDL vN, N!=3'                                            \
+         $(_sc_search_regexp)
+
+# Don't use Texinfo's @acronym{}.
+# http://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00321.html
+texinfo_suffix_re_ ?= \.(txi|texi(nfo)?)$$
+sc_texinfo_acronym:
+       @prohibit='@acronym\{'                                          \
+       in_vc_files='$(texinfo_suffix_re_)'                             \
+       halt='found use of Texinfo @acronym{}'                          \
+         $(_sc_search_regexp)
 
 cvs_keywords = \
   Author|Date|Header|Id|Name|Locker|Log|RCSfile|Revision|Source|State
 
 sc_prohibit_cvs_keyword:
-       @re='\$$($(cvs_keywords))\$$'                                   \
-           msg='do not use CVS keyword expansion'                      \
-         $(_prohibit_regexp)
+       @prohibit='\$$($(cvs_keywords))\$$'                             \
+       halt='do not use CVS keyword expansion'                         \
+         $(_sc_search_regexp)
+
+# This Perl code is slightly obfuscated.  Not only is each "$" doubled
+# because it's in a Makefile, but the $$c's are comments;  we cannot
+# use "#" due to the way the script ends up concatenated onto one line.
+# It would be much more concise, and would produce better output (including
+# counts) if written as:
+#   perl -ln -0777 -e '/\n(\n+)$/ and print "$ARGV: ".length $1' ...
+# but that would be far less efficient, reading the entire contents
+# of each file, rather than just the last two bytes of each.
+# In addition, while the code below detects both blank lines and a missing
+# newline at EOF, the above detects only the former.
+#
+# This is a perl script that is expected to be the single-quoted argument
+# to a command-line "-le".  The remaining arguments are file names.
+# Print the name of each file that does not end in exactly one newline byte.
+# I.e., warn if there are blank lines (2 or more newlines), or if the
+# last byte is not a newline.  However, currently we don't complain
+# about any file that contains exactly one byte.
+# Exit nonzero if at least one such file is found, otherwise, exit 0.
+# Warn about, but otherwise ignore open failure.  Ignore seek/read failure.
+#
+# Use this if you want to remove trailing empty lines from selected files:
+#   perl -pi -0777 -e 's/\n\n+$/\n/' files...
+#
+require_exactly_one_NL_at_EOF_ =                                       \
+  foreach my $$f (@ARGV)                                               \
+    {                                                                  \
+      open F, "<", $$f or (warn "failed to open $$f: $$!\n"), next;    \
+      my $$p = sysseek (F, -2, 2);                                     \
+      my $$c = "seek failure probably means file has < 2 bytes; ignore"; \
+      my $$last_two_bytes;                                             \
+      defined $$p and $$p = sysread F, $$last_two_bytes, 2;            \
+      close F;                                                         \
+      $$c = "ignore read failure";                                     \
+      $$p && ($$last_two_bytes eq "\n\n"                               \
+              || substr ($$last_two_bytes,1) ne "\n")                  \
+          and (print $$f), $$fail=1;                                   \
+    }                                                                  \
+  END { exit defined $$fail }
+sc_prohibit_empty_lines_at_EOF:
+       @perl -le '$(require_exactly_one_NL_at_EOF_)' $$($(VC_LIST_EXCEPT)) \
+         || { echo '$(ME): empty line(s) or no newline at EOF'         \
+               1>&2; exit 1; } || :
 
 # Make sure we don't use st_blocks.  Use ST_NBLOCKS instead.
 # This is a bit of a kludge, since it prevents use of the string
 # even in comments, but for now it does the job with no false positives.
 sc_prohibit_stat_st_blocks:
-       @re='[.>]st_blocks' msg='do not use st_blocks; use ST_NBLOCKS'  \
-         $(_prohibit_regexp)
+       @prohibit='[.>]st_blocks'                                       \
+       halt='do not use st_blocks; use ST_NBLOCKS'                     \
+         $(_sc_search_regexp)
 
 # Make sure we don't define any S_IS* macros in src/*.c files.
 # They're already defined via gnulib's sys/stat.h replacement.
 sc_prohibit_S_IS_definition:
-       @re='^ *# *define  *S_IS'                                       \
-       msg='do not define S_IS* macros; include <sys/stat.h>'          \
-         $(_prohibit_regexp)
+       @prohibit='^ *# *define  *S_IS'                                 \
+       halt='do not define S_IS* macros; include <sys/stat.h>'         \
+         $(_sc_search_regexp)
+
+# Perl block to convert a match to FILE_NAME:LINENO:TEST,
+# that is shared by two definitions below.
+perl_filename_lineno_text_ =                                           \
+    -e '  {'                                                           \
+    -e '    $$n = ($$` =~ tr/\n/\n/ + 1);'                             \
+    -e '    ($$v = $$&) =~ s/\n/\\n/g;'                                        \
+    -e '    print "$$ARGV:$$n:$$v\n";'                                 \
+    -e '  }'
+
+prohibit_doubled_word_RE_ ?= \
+  /\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims
+prohibit_doubled_word_ =                                               \
+    -e 'while ($(prohibit_doubled_word_RE_))'                          \
+    $(perl_filename_lineno_text_)
+
+# Define this to a regular expression that matches
+# any filename:dd:match lines you want to ignore.
+# The default is to ignore no matches.
+ignore_doubled_word_match_RE_ ?= ^$$
+
+sc_prohibit_doubled_word:
+       @perl -n -0777 $(prohibit_doubled_word_) $$($(VC_LIST_EXCEPT))  \
+         | grep -vE '$(ignore_doubled_word_match_RE_)'                 \
+         | grep . && { echo '$(ME): doubled words' 1>&2; exit 1; } || :
+
+# A regular expression matching undesirable combinations of words like
+# "can not"; this matches them even when the two words appear on different
+# lines, but not when there is an intervening delimiter like "#" or "*".
+# Similarly undesirable, "See @xref{...}", since an @xref should start
+# a sentence.  Explicitly prohibit any prefix of "see" or "also".
+# Also prohibit a prefix matching "\w+ +".
+# @pxref gets the same see/also treatment and should be parenthesized;
+# presume it must *not* start a sentence.
+bad_xref_re_ ?= (?:[\w,:;] +|(?:see|also)\s+)\@xref\{
+bad_pxref_re_ ?= (?:[.!?]|(?:see|also))\s+\@pxref\{
+prohibit_undesirable_word_seq_RE_ ?=                                   \
+  /(?:\bcan\s+not\b|$(bad_xref_re_)|$(bad_pxref_re_))/gims
+prohibit_undesirable_word_seq_ =                                       \
+    -e 'while ($(prohibit_undesirable_word_seq_RE_))'                  \
+    $(perl_filename_lineno_text_)
+# Define this to a regular expression that matches
+# any filename:dd:match lines you want to ignore.
+# The default is to ignore no matches.
+ignore_undesirable_word_sequence_RE_ ?= ^$$
+
+sc_prohibit_undesirable_word_seq:
+       @perl -n -0777 $(prohibit_undesirable_word_seq_)                \
+            $$($(VC_LIST_EXCEPT))                                      \
+         | grep -vE '$(ignore_undesirable_word_sequence_RE_)' | grep . \
+         && { echo '$(ME): undesirable word sequence' >&2; exit 1; } || :
+
+_ptm1 = use "test C1 && test C2", not "test C1 -''a C2"
+_ptm2 = use "test C1 || test C2", not "test C1 -''o C2"
+# Using test's -a and -o operators is not portable.
+# We prefer test over [, since the latter is spelled [[ in configure.ac.
+sc_prohibit_test_minus_ao:
+       @prohibit='(\<test| \[+) .+ -[ao] '                             \
+       halt='$(_ptm1); $(_ptm2)'                                       \
+         $(_sc_search_regexp)
+
+# Avoid a test bashism.
+sc_prohibit_test_double_equal:
+       @prohibit='(\<test| \[+) .+ == '                                \
+       containing='#! */bin/[a-z]*sh'                                  \
+       halt='use "test x = x", not "test x =''= x"'                    \
+         $(_sc_search_regexp)
 
 # Each program that uses proper_name_utf8 must link with one of the
 # ICONV libraries.  Otherwise, some ICONV library must appear in LDADD.
@@ -555,15 +1005,15 @@ sc_proper_name_utf8_requires_ICONV:
 # Warn about "c0nst struct Foo const foo[]",
 # but not about "char const *const foo" or "#define const const".
 sc_redundant_const:
-       @re='\bconst\b[[:space:][:alnum:]]{2,}\bconst\b'                \
-       msg='redundant "const" in declarations'                         \
-         $(_prohibit_regexp)
+       @prohibit='\bconst\b[[:space:][:alnum:]]{2,}\bconst\b'          \
+       halt='redundant "const" in declarations'                        \
+         $(_sc_search_regexp)
 
 sc_const_long_option:
-       @grep '^ *static.*struct option ' $$($(VC_LIST_EXCEPT))         \
-         | grep -Ev 'const struct option|struct option const' && {     \
-             echo 1>&2 '$(ME): add "const" to the above declarations'; \
-             exit 1; } || :
+       @prohibit='^ *static.*struct option '                           \
+       exclude='const struct option|struct option const'               \
+       halt='$(ME): add "const" to the above declarations'             \
+         $(_sc_search_regexp)
 
 NEWS_hash =                                                            \
   $$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p'             \
@@ -589,21 +1039,28 @@ update-NEWS-hash: NEWS
 # Ensure that we use only the standard $(VAR) notation,
 # not @...@ in Makefile.am, now that we can rely on automake
 # to emit a definition for each substituted variable.
-# We use perl rather than "grep -nE ..." to exempt a single
-# use of an @...@-delimited variable name in src/Makefile.am.
+# However, there is still one case in which @VAR@ use is not just
+# legitimate, but actually required: when augmenting an automake-defined
+# variable with a prefix.  For example, gettext uses this:
+# MAKEINFO = env LANG= LC_MESSAGES= LC_ALL= LANGUAGE= @MAKEINFO@
+# otherwise, makeinfo would put German or French (current locale)
+# navigation hints in the otherwise-English documentation.
+#
 # Allow the package to add exceptions via a hook in cfg.mk;
 # for example, @PRAGMA_SYSTEM_HEADER@ can be permitted by
 # setting this to ' && !/PRAGMA_SYSTEM_HEADER/'.
 _makefile_at_at_check_exceptions ?=
 sc_makefile_at_at_check:
-       @perl -ne '/\@[A-Z_0-9]+\@/'$(_makefile_at_at_check_exceptions) \
+       @perl -ne '/\@\w+\@/'                                           \
+          -e ' && !/(\w+)\s+=.*\@\1\@$$/'                              \
+          -e ''$(_makefile_at_at_check_exceptions)                     \
          -e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}'    \
-           $$($(VC_LIST_EXCEPT) | grep -E '(^|/)Makefile\.am$$')       \
+           $$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \
          && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
 
 news-check: NEWS
-       if head $(srcdir)/NEWS | grep -E $(news-check-regexp)           \
-           >/dev/null; then                                            \
+       if sed -n $(news-check-lines-spec)p $<                          \
+           | grep -E $(news-check-regexp) >/dev/null; then             \
          :;                                                            \
        else                                                            \
          echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2;      \
@@ -611,29 +1068,30 @@ news-check: NEWS
        fi
 
 sc_makefile_TAB_only_indentation:
-       @grep -nE '^    [ ]{8}'                                         \
-           $$($(VC_LIST_EXCEPT) | grep -E 'akefile|\.mk$$')            \
-         && { echo '$(ME): found TAB-8-space indentation' 1>&2;        \
-              exit 1; } || :
+       @prohibit='^    [ ]{8}'                                         \
+       in_vc_files='akefile|\.mk$$'                                    \
+       halt='found TAB-8-space indentation'                            \
+         $(_sc_search_regexp)
 
 sc_m4_quote_check:
-       @grep -nE '(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]'              \
-           $$($(VC_LIST_EXCEPT) | grep -E '(^configure\.ac|\.m4)$$')   \
-         && { echo '$(ME): quote the first arg to AC_DEF*' 1>&2;       \
-              exit 1; } || :
+       @prohibit='(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]'              \
+       in_vc_files='(^configure\.ac|\.m4)$$'                           \
+       halt='quote the first arg to AC_DEF*'                           \
+         $(_sc_search_regexp)
 
 fix_po_file_diag = \
 'you have changed the set of files with translatable diagnostics;\n\
 apply the above patch\n'
 
 # Verify that all source files using _() are listed in po/POTFILES.in.
-po_file = po/POTFILES.in
+po_file ?= $(srcdir)/po/POTFILES.in
+generated_files ?= $(srcdir)/lib/*.[ch]
 sc_po_check:
        @if test -f $(po_file); then                                    \
          grep -E -v '^(#|$$)' $(po_file)                               \
            | grep -v '^src/false\.c$$' | sort > $@-1;                  \
          files=;                                                       \
-         for file in $$($(VC_LIST_EXCEPT)) lib/*.[ch]; do              \
+         for file in $$($(VC_LIST_EXCEPT)) $(generated_files); do      \
            test -r $$file || continue;                                 \
            case $$file in                                              \
              *.m4|*.mk) continue ;;                                    \
@@ -648,7 +1106,7 @@ sc_po_check:
            files="$$files $$file";                                     \
          done;                                                         \
          grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files          \
-           | sort -u > $@-2;                                           \
+           | sed 's|^$(_dot_escaped_srcdir)/||' | sort -u > $@-2;      \
          diff -u -L $(po_file) -L $(po_file) $@-1 $@-2                 \
            || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; };   \
          rm -f $@-1 $@-2;                                              \
@@ -656,50 +1114,113 @@ sc_po_check:
 
 # Sometimes it is useful to change the PATH environment variable
 # in Makefiles.  When doing so, it's better not to use the Unix-centric
-# path separator of `:', but rather the automake-provided `$(PATH_SEPARATOR)'.
-msg = '$(ME): Do not use `:'\'' above; use $$(PATH_SEPARATOR) instead'
+# path separator of ':', but rather the automake-provided '$(PATH_SEPARATOR)'.
+msg = '$(ME): Do not use ":" above; use $$(PATH_SEPARATOR) instead'
 sc_makefile_path_separator_check:
-       @grep -nE 'PATH[=].*:'                                          \
-           $$($(VC_LIST_EXCEPT) | grep -E 'akefile|\.mk$$')            \
-         && { echo $(msg) 1>&2; exit 1; } || :
-
-# Check that `make alpha' will not fail at the end of the process.
+       @prohibit='PATH[=].*:'                                          \
+       in_vc_files='akefile|\.mk$$'                                    \
+       halt=$(msg)                                                     \
+         $(_sc_search_regexp)
+
+# Check that 'make alpha' will not fail at the end of the process,
+# i.e., when pkg-M.N.tar.xz already exists (either in "." or in ../release)
+# and is read-only.
 writable-files:
-       if test -d $(release_archive_dir); then :; else                 \
-         for file in $(distdir).tar.gz                                 \
-                     $(release_archive_dir)/$(distdir).tar.gz; do      \
-           test -e $$file || continue;                                 \
-           test -w $$file                                              \
-             || { echo ERROR: $$file is not writable; fail=1; };       \
+       if test -d $(release_archive_dir); then                         \
+         for file in $(DIST_ARCHIVES); do                              \
+           for p in ./ $(release_archive_dir)/; do                     \
+             test -e $$p$$file || continue;                            \
+             test -w $$p$$file                                         \
+               || { echo ERROR: $$p$$file is not writable; fail=1; };  \
+           done;                                                       \
          done;                                                         \
          test "$$fail" && exit 1 || : ;                                \
+       else :;                                                         \
        fi
 
-v_etc_file = lib/version-etc.c
+v_etc_file = $(gnulib_dir)/lib/version-etc.c
 sample-test = tests/sample-test
 texi = doc/$(PACKAGE).texi
 # Make sure that the copyright date in $(v_etc_file) is up to date.
 # Do the same for the $(sample-test) and the main doc/.texi file.
 sc_copyright_check:
-       @if test -f $(v_etc_file); then                                 \
-         grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
-           >/dev/null                                                  \
-         || { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
-              exit 1; };                                               \
-       fi
-       @if test -f $(sample-test); then                                \
-         grep '# Copyright (C) '$$(date +%Y)' Free' $(sample-test)     \
-           >/dev/null                                                  \
-         || { echo 'out of date copyright in $(sample-test); update it' 1>&2; \
-              exit 1; };                                               \
-       fi
-       @if test -f $(texi); then                                       \
-         grep 'Copyright @copyright{} .*'$$(date +%Y)' Free' $(texi)   \
-           >/dev/null                                                  \
-         || { echo 'out of date copyright in $(texi); update it' 1>&2; \
-              exit 1; };                                               \
+       @require='enum { COPYRIGHT_YEAR = '$$(date +%Y)' };'            \
+       in_files=$(v_etc_file)                                          \
+       halt='out of date copyright in $(v_etc_file); update it'        \
+         $(_sc_search_regexp)
+       @require='# Copyright \(C\) '$$(date +%Y)' Free'                \
+       in_vc_files=$(sample-test)                                      \
+       halt='out of date copyright in $(sample-test); update it'       \
+         $(_sc_search_regexp)
+       @require='Copyright @copyright\{\} .*'$$(date +%Y)' Free'       \
+       in_vc_files=$(texi)                                             \
+       halt='out of date copyright in $(texi); update it'              \
+         $(_sc_search_regexp)
+
+# If tests/help-version exists and seems to be new enough, assume that its
+# use of init.sh and path_prepend_ is correct, and ensure that every other
+# use of init.sh is identical.
+# This is useful because help-version cross-checks prog --version
+# with $(VERSION), which verifies that its path_prepend_ invocation
+# sets PATH correctly.  This is an inexpensive way to ensure that
+# the other init.sh-using tests also get it right.
+_hv_file ?= $(srcdir)/tests/help-version
+_hv_regex_weak ?= ^ *\. .*/init\.sh"
+# Fix syntax-highlighters "
+_hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh"
+sc_cross_check_PATH_usage_in_tests:
+       @if test -f $(_hv_file); then                                   \
+         grep -l 'VERSION mismatch' $(_hv_file) >/dev/null             \
+           || { echo "$@: skipped: no such file: $(_hv_file)" 1>&2;    \
+                exit 0; };                                             \
+         grep -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null         \
+           || { echo "$@: $(_hv_file) lacks conforming use of init.sh" 1>&2; \
+                exit 1; };                                             \
+         good=$$(grep -E '$(_hv_regex_strong)' $(_hv_file));           \
+         grep -LFx "$$good"                                            \
+               $$(grep -lE '$(_hv_regex_weak)' $$($(VC_LIST_EXCEPT)))  \
+             | grep . &&                                               \
+           { echo "$(ME): the above files use path_prepend_ inconsistently" \
+               1>&2; exit 1; } || :;                                   \
        fi
 
+# BRE regex of file contents to identify a test script.
+_test_script_regex ?= \<init\.sh\>
+
+# In tests, use "compare expected actual", not the reverse.
+sc_prohibit_reversed_compare_failure:
+       @prohibit='\<compare [^ ]+ ([^ ]*exp|/dev/null)'                \
+       containing='$(_test_script_regex)'                              \
+       halt='reversed compare arguments'                               \
+         $(_sc_search_regexp)
+
+# #if HAVE_... will evaluate to false for any non numeric string.
+# That would be flagged by using -Wundef, however gnulib currently
+# tests many undefined macros, and so we can't enable that option.
+# So at least preclude common boolean strings as macro values.
+sc_Wundef_boolean:
+       @prohibit='^#define.*(yes|no|true|false)$$'                     \
+       in_files='$(CONFIG_INCLUDE)'                                    \
+       halt='Use 0 or 1 for macro values'                              \
+         $(_sc_search_regexp)
+
+# Even if you use pathmax.h to guarantee that PATH_MAX is defined, it might
+# not be constant, or might overflow a stack.  In general, use PATH_MAX as
+# a limit, not an array or alloca size.
+sc_prohibit_path_max_allocation:
+       @prohibit='(\balloca *\([^)]*|\[[^]]*)PATH_MAX'                 \
+       halt='Avoid stack allocations of size PATH_MAX'                 \
+         $(_sc_search_regexp)
+
+sc_vulnerable_makefile_CVE-2009-4029:
+       @prohibit='perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)' \
+       in_files=$$(find $(srcdir) -name Makefile.in)                   \
+       halt=$$(printf '%s\n'                                           \
+         'the above files are vulnerable; beware of running'           \
+         '  "make dist*" rules, and upgrade to fixed automake'         \
+         '  see http://bugzilla.redhat.com/542609 for details')        \
+         $(_sc_search_regexp)
+
 vc-diff-check:
        (unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || :
        if test -s vc-diffs; then                               \
@@ -719,20 +1240,39 @@ bootstrap-tools ?= autoconf,automake,gnulib
 # If it's not already specified, derive the GPG key ID from
 # the signed tag we've just applied to mark this release.
 gpg_key_ID ?= \
-  $$(git cat-file tag v$(VERSION) > .ann-sig \
-     && gpgv .ann-sig - < /dev/null 2>&1 \
-         | sed -n '/.*key ID \([0-9A-F]*\)/s//\1/p'; rm -f .ann-sig)
+  $$(git cat-file tag v$(VERSION) \
+     | gpgv --status-fd 1 --keyring /dev/null - - 2>/dev/null \
+     | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
+
+translation_project_ ?= coordinator@translationproject.org
+
+# Make info-gnu the default only for a stable release.
+ifeq ($(RELEASE_TYPE),stable)
+  announcement_Cc_ ?= $(translation_project_), $(PACKAGE_BUGREPORT)
+  announcement_mail_headers_ ?=                                                \
+    To: info-gnu@gnu.org                                               \
+    Cc: $(announcement_Cc_)                                            \
+    Mail-Followup-To: $(PACKAGE_BUGREPORT)
+else
+  announcement_Cc_ ?= $(translation_project_)
+  announcement_mail_headers_ ?=                                                \
+    To: $(PACKAGE_BUGREPORT)                                           \
+    Cc: $(announcement_Cc_)
+endif
 
 announcement: NEWS ChangeLog $(rel-files)
-       @$(build_aux)/announce-gen                                      \
+       @$(srcdir)/$(_build-aux)/announce-gen                           \
+           --mail-headers='$(announcement_mail_headers_)'              \
            --release-type=$(RELEASE_TYPE)                              \
            --package=$(PACKAGE)                                        \
            --prev=$(PREV_VERSION)                                      \
            --curr=$(VERSION)                                           \
            --gpg-key-id=$(gpg_key_ID)                                  \
+           --srcdir=$(srcdir)                                          \
            --news=$(srcdir)/NEWS                                       \
            --bootstrap-tools=$(bootstrap-tools)                        \
-           --gnulib-version=$(gnulib-version)                          \
+           $$(case ,$(bootstrap-tools), in (*,gnulib,*)                \
+              echo --gnulib-version=$(gnulib-version);; esac)          \
            --no-print-checksums                                        \
            $(addprefix --url-dir=, $(url_dir_list))
 
@@ -743,21 +1283,21 @@ announcement: NEWS ChangeLog $(rel-files)
 ftp-gnu = ftp://ftp.gnu.org/gnu
 www-gnu = http://www.gnu.org
 
+upload_dest_dir_ ?= $(PACKAGE)
 emit_upload_commands:
        @echo =====================================
        @echo =====================================
-       @echo "$(build_aux)/gnupload $(GNUPLOADFLAGS) \\"
-       @echo "    --to $(gnu_rel_host):$(PACKAGE) \\"
+       @echo "$(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS) \\"
+       @echo "    --to $(gnu_rel_host):$(upload_dest_dir_) \\"
        @echo "  $(rel-files)"
        @echo '# send the ~/announce-$(my_distdir) e-mail'
        @echo =====================================
        @echo =====================================
 
-noteworthy = * Noteworthy changes in release ?.? (????-??-??) [?]
 define emit-commit-log
-  printf '%s\n' 'post-release administrivia' '' \
-    '* NEWS: Add header line for next release.' \
-    '* .prev-version: Record previous version.' \
+  printf '%s\n' 'maint: post-release administrivia' ''                 \
+    '* NEWS: Add header line for next release.'                                \
+    '* .prev-version: Record previous version.'                                \
     '* cfg.mk (old_NEWS_hash): Auto-update.'
 endef
 
@@ -774,9 +1314,34 @@ no-submodule-changes:
          : ;                                                           \
        fi
 
+submodule-checks ?= no-submodule-changes public-submodule-commit
+
+# Ensure that each sub-module commit we're using is public.
+# Without this, it is too easy to tag and release code that
+# cannot be built from a fresh clone.
+.PHONY: public-submodule-commit
+public-submodule-commit:
+       $(AM_V_GEN)if test -d $(srcdir)/.git; then                      \
+         cd $(srcdir) &&                                               \
+         git submodule --quiet foreach test '$$(git rev-parse $$sha1)' \
+             = '$$(git merge-base origin $$sha1)'                      \
+           || { echo '$(ME): found non-public submodule commit' >&2;   \
+                exit 1; };                                             \
+       else                                                            \
+         : ;                                                           \
+       fi
+# This rule has a high enough utility/cost ratio that it should be a
+# dependent of "check" by default.  However, some of us do occasionally
+# commit a temporary change that deliberately points to a non-public
+# submodule commit, and want to be able to use rules like "make check".
+# In that case, run e.g., "make check gl_public_submodule_commit="
+# to disable this test.
+gl_public_submodule_commit ?= public-submodule-commit
+check: $(gl_public_submodule_commit)
+
 .PHONY: alpha beta stable
 ALL_RECURSIVE_TARGETS += alpha beta stable
-alpha beta stable: $(local-check) writable-files no-submodule-changes
+alpha beta stable: $(local-check) writable-files $(submodule-checks)
        test $@ = stable                                                \
          && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$'         \
               || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
@@ -784,35 +1349,41 @@ alpha beta stable: $(local-check) writable-files no-submodule-changes
        $(MAKE) vc-diff-check
        $(MAKE) news-check
        $(MAKE) distcheck
-       $(MAKE) dist XZ_OPT=-9ev
+       $(MAKE) dist
        $(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
        $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
 
 # Override this in cfg.mk if you follow different procedures.
 release-prep-hook ?= release-prep
 
+gl_noteworthy_news_ = * Noteworthy changes in release ?.? (????-??-??) [?]
 .PHONY: release-prep
 release-prep:
        case $$RELEASE_TYPE in alpha|beta|stable) ;; \
          *) echo "invalid RELEASE_TYPE: $$RELEASE_TYPE" 1>&2; exit 1;; esac
-       $(MAKE) -s announcement > ~/announce-$(my_distdir)
+       $(MAKE) --no-print-directory -s announcement > ~/announce-$(my_distdir)
        if test -d $(release_archive_dir); then                 \
          ln $(rel-files) $(release_archive_dir);               \
          chmod a-w $(rel-files);                               \
        fi
        echo $(VERSION) > $(prev_version_file)
        $(MAKE) update-NEWS-hash
-       perl -pi -e '$$. == 3 and print "$(noteworthy)\n\n\n"' NEWS
+       perl -pi -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' $(srcdir)/NEWS
        $(emit-commit-log) > .ci-msg
        $(VC) commit -F .ci-msg -a
        rm .ci-msg
 
+# Override this with e.g., -s $(srcdir)/some_other_name.texi
+# if the default $(PACKAGE)-derived name doesn't apply.
+gendocs_options_ ?=
+
 .PHONY: web-manual
 web-manual:
        @test -z "$(manual_title)" \
          && { echo define manual_title in cfg.mk 1>&2; exit 1; } || :
        @cd '$(srcdir)/doc'; \
-         $(SHELL) ../build-aux/gendocs.sh -o '$(abs_builddir)/doc/manual' \
+         $(SHELL) ../$(_build-aux)/gendocs.sh $(gendocs_options_) \
+            -o '$(abs_builddir)/doc/manual' \
             --email $(PACKAGE_BUGREPORT) $(PACKAGE) \
            "$(PACKAGE_NAME) - $(manual_title)"
        @echo " *** Upload the doc/manual directory to web-cvs."
@@ -852,12 +1423,14 @@ refresh-po:
        wget --no-verbose --directory-prefix $(PODIR) --no-directories --recursive --level 1 --accept .po --accept .po.1 $(POURL) && \
        echo 'en@boldquot' > $(PODIR)/LINGUAS && \
        echo 'en@quot' >> $(PODIR)/LINGUAS && \
-       ls $(PODIR)/*.po | sed 's/\.po//' | sed 's,$(PODIR)/,,' | sort >> $(PODIR)/LINGUAS
+       ls $(PODIR)/*.po | sed 's/\.po//;s,$(PODIR)/,,' | sort >> $(PODIR)/LINGUAS
 
+ # Running indent once is not idempotent, but running it twice is.
 INDENT_SOURCES ?= $(C_SOURCES)
 .PHONY: indent
 indent:
        indent $(INDENT_SOURCES)
+       indent $(INDENT_SOURCES)
 
 # If you want to set UPDATE_COPYRIGHT_* environment variables,
 # put the assignments in this variable.
@@ -874,4 +1447,104 @@ update-copyright-env ?=
 update-copyright:
        grep -l -w Copyright                                             \
          $$(export VC_LIST_EXCEPT_DEFAULT=COPYING && $(VC_LIST_EXCEPT)) \
-         | $(update-copyright-env) xargs $(build_aux)/$@
+         | $(update-copyright-env) xargs $(srcdir)/$(_build-aux)/$@
+
+# This tight_scope test is skipped with a warning if $(_gl_TS_headers) is not
+# overridden and $(_gl_TS_dir)/Makefile.am does not mention noinst_HEADERS.
+
+# NOTE: to override any _gl_TS_* default value, you must
+# define the variable(s) using "export" in cfg.mk.
+_gl_TS_dir ?= src
+
+ALL_RECURSIVE_TARGETS += sc_tight_scope
+sc_tight_scope: tight-scope.mk
+       @fail=0;                                                        \
+       if ! grep '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk        \
+               > /dev/null                                             \
+          && ! grep -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \
+               > /dev/null 2>&1; then                                  \
+           echo '$(ME): skipping $@';                                  \
+       else                                                            \
+           $(MAKE) -s -C $(_gl_TS_dir)                                 \
+               -f Makefile                                             \
+               -f $(abs_top_srcdir)/cfg.mk                             \
+               -f $(abs_top_builddir)/$<                               \
+             _gl_tight_scope                                           \
+               || fail=1;                                              \
+       fi;                                                             \
+       rm -f $<;                                                       \
+       exit $$fail
+
+tight-scope.mk: $(ME)
+       @rm -f $@ $@-t
+       @perl -ne '/^# TS-start/.../^# TS-end/ and print' $(srcdir)/$(ME) > $@-t
+       @chmod a=r $@-t && mv $@-t $@
+
+ifeq (a,b)
+# TS-start
+
+# Most functions should have static scope.
+# Any that don't must be marked with 'extern', but 'main'
+# and 'usage' are exceptions: they're always extern, but
+# do not need to be marked.  Symbols matching '__.*' are
+# reserved by the compiler, so are automatically excluded below.
+_gl_TS_unmarked_extern_functions ?= main usage
+_gl_TS_function_match ?= /^(?:$(_gl_TS_extern)) +.*?(\S+) *\(/
+
+# If your project uses a macro like "XTERN", then put
+# the following in cfg.mk to override this default:
+# export _gl_TS_extern = extern|XTERN
+_gl_TS_extern ?= extern
+
+# The second nm|grep checks for file-scope variables with 'extern' scope.
+# Without gnulib's progname module, you might put program_name here.
+# Symbols matching '__.*' are reserved by the compiler,
+# so are automatically excluded below.
+_gl_TS_unmarked_extern_vars ?=
+
+# NOTE: the _match variables are perl expressions -- not mere regular
+# expressions -- so that you can extend them to match other patterns
+# and easily extract matched variable names.
+# For example, if your project declares some global variables via
+# a macro like this: GLOBAL(type, var_name, initializer), then you
+# can override this definition to automatically extract those names:
+# export _gl_TS_var_match = \
+#   /^(?:$(_gl_TS_extern)) .*?\**(\w+)(\[.*?\])?;/ || /\bGLOBAL\(.*?,\s*(.*?),/
+_gl_TS_var_match ?= /^(?:$(_gl_TS_extern)) .*?(\w+)(\[.*?\])?;/
+
+# The names of object files in (or relative to) $(_gl_TS_dir).
+_gl_TS_obj_files ?= *.$(OBJEXT)
+
+# Files in which to search for the one-line style extern declarations.
+# $(_gl_TS_dir)-relative.
+_gl_TS_headers ?= $(noinst_HEADERS)
+
+.PHONY: _gl_tight_scope
+_gl_tight_scope: $(bin_PROGRAMS)
+       t=exceptions-$$$$;                                              \
+       trap 's=$$?; rm -f $$t; exit $$s' 0;                            \
+       for sig in 1 2 3 13 15; do                                      \
+         eval "trap 'v=`expr $$sig + 128`; (exit $$v); exit $$v' $$sig"; \
+       done;                                                           \
+       src=`for f in $(SOURCES); do                                    \
+              test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`;   \
+       hdr=`for f in $(_gl_TS_headers); do                             \
+              test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`;   \
+       ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_functions);  \
+         grep -h -A1 '^extern .*[^;]$$' $$src                          \
+           | grep -vE '^(extern |--)' | sed 's/ .*//';                 \
+         perl -lne                                                     \
+            '$(_gl_TS_function_match) and print "^$$1\$$"' $$hdr;      \
+       ) | sort -u > $$t;                                              \
+       nm -e $(_gl_TS_obj_files) | sed -n 's/.* T //p'|grep -Ev -f $$t \
+         && { echo the above functions should have static scope >&2;   \
+              exit 1; } || : ;                                         \
+       ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_vars);       \
+         perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"' $$hdr *.h \
+       ) | sort -u > $$t;                                              \
+       nm -e $(_gl_TS_obj_files) | sed -n 's/.* [BCDGRS] //p'          \
+            | sort -u | grep -Ev -f $$t                                        \
+         && { echo the above variables should have static scope >&2;   \
+              exit 1; } || :
+# TS-end
+endif
diff --git a/msdos/Makefile.bor b/msdos/Makefile.bor
deleted file mode 100644 (file)
index 1165b7c..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-# Makefile for gzip
-# Borland (Turbo) C++.
-# Warning: this file is not suitable for Turbo C 2.0. In this case, read
-# then invoke the file doturboc.bat.
-
-# To use, do "make -fmakefile.bor"
-
-# Turbo C++ 1.0 seems to have a buggy exit() function. You must add
-# to CFLAGS: -Dexit=_exit
-
-# WARNING: the small model is not supported. The compact model is used
-# here. If you want to use the large model, add -D__LARGE__ to ASFLAGS
-# Add -DSMALL_MEM to CFLAGS if you wish to reduce the memory
-# requirements. Add -DNO_ASM to CFLAGS and remove match.obj from OBJA if
-# you do not have tasm.
-
-# ------------- Turbo C++, Borland C++ -------------
-MODEL=-mc
-#CFLAGS=-w -w-eff -w-def -w-sig -w-cln -a -d -G -O -Z $(MODEL)
-CFLAGS=-O2 -Z $(MODEL)
-CC=bcc
-LD=bcc
-#   replace bcc with tcc for Turbo C++ 1.0
-LDFLAGS=$(MODEL)
-AS=tasm
-ASFLAGS=-ml -t -DDYN_ALLOC -DSS_NEQ_DS
-LIB = c:\bcc\lib
-
-# ------------- Common declarations:
-STRIP=rem
-#    If you don't have lzexe, get it (by ftp on wuarchive.wustl.edu
-#    in /mirrors/msdos/filutl/lzexe91e.zip). Then define:
-#STRIP=lzexe
-#    Or if you've registered PKLITE, then define:
-#STRIP=pklite
-#    This makes a big difference in .exe size (and possibly load time)
-
-O=.obj
-OBJA=match$(O) tailor$(O) $(LIB)\wildargs.obj
-
-# ------------- Used by install rule
-# set BIN to the directory you want to install the executables to
-BIN = c:\bin
-
-# variables
-OBJ1 = gzip$(O) zip$(O) deflate$(O) trees$(O) bits$(O) unzip$(O) inflate$(O) \
-       util$(O)
-OBJ2 = crypt$(O) lzw$(O) unlzw$(O) unpack$(O) unlzh$(O) getopt$(O) $(OBJA)
-
-all: gzip.exe
-
-gzip.obj: gzip.c gzip.h tailor.h crypt.h revision.h lzw.h
-       $(CC) -c $(CFLAGS) $*.c
-
-zip.obj: zip.c gzip.h tailor.h crypt.h
-       $(CC) -c $(CFLAGS) $*.c
-
-deflate.obj: deflate.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) $*.c
-
-trees.obj: trees.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) $*.c
-
-bits.obj: bits.c gzip.h tailor.h crypt.h
-       $(CC) -c $(CFLAGS) $*.c
-
-unzip.obj: unzip.c gzip.h tailor.h crypt.h
-       $(CC) -c $(CFLAGS) $*.c
-
-inflate.obj: inflate.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) $*.c
-
-util.obj: util.c gzip.h tailor.h crypt.h
-       $(CC) -c $(CFLAGS) $*.c
-
-crypt.obj: crypt.c gzip.h tailor.h crypt.h
-       $(CC) -c $(CFLAGS) $*.c
-
-lzw.obj: lzw.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) $*.c
-
-unlzw.obj: unlzw.c gzip.h tailor.h lzw.h
-       $(CC) -c $(CFLAGS) $*.c
-
-unpack.obj: unpack.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) $*.c
-
-unlzh.obj: unlzh.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) $*.c
-
-tailor.obj: msdos\tailor.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) msdos\$*.c
-
-getopt.obj: getopt.c getopt.h
-       $(CC) -c $(CFLAGS) $*.c
-
-match.obj:     msdos\match.asm
-       $(AS) $(ASFLAGS) msdos\match, match;
-
-# we must cut the command line to fit in the MS/DOS 128 byte limit:
-gzip.exe: $(OBJ1) $(OBJ2)
-       echo $(OBJ1) > gzip.rsp
-       echo $(OBJ2) >> gzip.rsp
-       $(LD) $(LDFLAGS) @gzip.rsp
-       del gzip.rsp
-       $(STRIP) gzip.exe
-# If you use Borland make, you can use instead:
-#      $(LD) $(LDFLAGS) @&&|
-#$**
-#|
-
-install: gzip.exe
-       copy /b gzip.exe $(BIN)
-       copy /b gzip.exe $(BIN)\gunzip.exe
-
-clean:
-       del *.obj
-       del *.exe
diff --git a/msdos/Makefile.djg b/msdos/Makefile.djg
deleted file mode 100644 (file)
index 30eb39c..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-# Makefile for gzip (GNU zip)    -*- Indented-Text -*-
-# Copyright (C) 1992-1993 Jean-loup Gailly and the Free Software Foundation
-# Modified for GNUish make/MS_SH200/DJGPP 1.09+ by Eric Backus
-
-# 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 3, 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.
-
-# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-#### Start of system configuration section. ####
-
-.SUFFIXES: .o
-LONGARGS = gcc:rm
-
-srcdir = .
-VPATH = .
-
-CC = gcc
-CPP = gcc -O -E
-
-INSTALL = install -c
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL) -m 644
-
-# tailor.h defines things for DJGPP so nothing is needed here
-DEFS =
-LIBS =
-
-# additional assembly sources for particular systems may be required.
-OBJA = match.o
-
-SEDCMD = 1d
-
-CFLAGS = -O2 -finline-functions -fomit-frame-pointer
-LDFLAGS = -s
-
-X=.exe
-# For OS/2 or MSDOS, use: X=.exe
-
-O=.o
-# For OS/2 or MSDOS, use: O=.obj
-
-prefix = /usr/local
-exec_prefix = $(prefix)
-
-bindir = $(exec_prefix)/bin
-datadir = $(prefix)/lib
-libdir = $(prefix)/lib
-infodir = $(prefix)/info
-
-# Extension (not including `.') for the installed manual page filenames.
-manext = 1
-# Where to install the manual pages.
-mandir = $(prefix)/man/man$(manext)
-
-#### End of system configuration section. ####
-
-SHELL = /bin/sh
-
-LOADLIBES = $(LIBS)
-
-TAR = tar
-
-SRCS = gzip.c zip.c deflate.c trees.c bits.c unzip.c inflate.c util.c crypt.c\
-       lzw.c unlzw.c unpack.c unlzh.c makecrc.c getopt.c match.S
-
-OBJ1 = gzip$(O) zip$(O) deflate$(O) trees$(O) bits$(O) unzip$(O) inflate$(O) \
-       util$(O)
-OBJ2 = crypt$(O) lzw$(O) unlzw$(O) unpack$(O) unlzh$(O) getopt$(O) $(OBJA)
-
-HDRS = gzip.h lzw.h tailor.h revision.h crypt.h getopt.h
-
-.c$O:
-       $(CC) -c $(DEFS) $(CFLAGS) $<
-
-#.PHONY: default all force test check
-
-default:  all
-all:   gzip$X zcmp zdiff zmore znew zforce gzexe
-force:
-
-install: all
-       for f in gzip$X zcmp zdiff zmore znew zforce gzexe; do \
-         $(INSTALL_PROGRAM) $${f} $(bindir)/$${f}; done
-       for f in gunzip$X zcat$X ; do \
-         rm -f $(bindir)/$${f}; ln $(bindir)/gzip$X $(bindir)/$${f}; done
-       -cd $(srcdir); \
-         for f in gzip gunzip zcat zcmp zmore znew zforce gzexe; do \
-         rm -f $(mandir)/$${f}.$(manext); \
-         $(INSTALL_DATA) $${f}.1 $(mandir)/$${f}.$(manext); done
-       -cd $(srcdir); for f in gzip.info* ; do $(INSTALL_DATA) $${f} \
-         $(infodir)/$${f}; done
-
-uninstall: force
-       -cd $(bindir); rm -f gzip$X gunzip$X zcat$X \
-         zcmp zdiff zmore znew zforce gzexe
-       -for f in gzip gunzip zcat zcmp zmore znew gzexe; do \
-         rm -f $(mandir)/$${f}.$(manext); done
-       -cd $(infodir); rm -f gzip.info*
-
-# install all files and replace compress (not recommended)
-install_compress: install
-       -test -f $(bindir)/compress.old || \
-         mv $(bindir)/compress$X $(bindir)/compress.old
-       ln $(bindir)/gzip$X $(bindir)/compress$X
-       rm -f $(bindir)/uncompress$X
-       ln $(bindir)/gzip$X $(bindir)/uncompress$X
-
-test: check
-check: all
-       ./gzip -5 < $(srcdir)/texinfo.tex > _gztest.z
-       # Either GNUish make or MS_SH has trouble with backquotes
-       #@if test `wc -c < _gztest.z` -ne 30890; then \
-       #   echo FAILED gzip test: incorrect size; rm -f _gztest*; exit 1; \
-       #   else :; fi
-       @echo Should be 30890:\\c
-       @wc -c < _gztest.z
-       rm -f _gztest
-       ./gzip -d _gztest.z
-       @if cmp _gztest $(srcdir)/texinfo.tex; then \
-          echo gzip test OK; \
-       else \
-          echo FAILED gzip test: incorrect decompress; \
-       fi
-       rm -f _gztest*
-
-TAGS: $(SRCS) $(HDRS)
-       cd $(srcdir); etags $(SRCS) $(HDRS)
-
-Makefile: Makefile.in ./config.status
-       ./config.status
-
-./config.status: configure
-       $(srcdir)/configure --srcdir=$(srcdir) --no-create
-
-configure: configure.in
-       @echo Warning: configure is out of date
-#      cd $(srcdir); autoconf
-
-clean:
-       rm -f *$O gzip$X gunzip$X zcat$X a.out core gzip
-       rm -f zcmp zdiff zmore znew zforce gzexe _gztest*
-       rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
-       rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
-
-mostlyclean: clean
-
-distclean: clean
-       rm -f Makefile config.status
-
-realclean: distclean
-       rm -f TAGS gzip.info*
-
-# Actual build-related targets
-
-gzip$X:        gzip
-       aout2exe gzip
-
-gzip:  $(OBJ1) $(OBJ2)
-       echo $(OBJ1) > gzip.rsp
-       echo $(OBJ2) $(LIBS) >> gzip.rsp
-       $(CC) $(LDFLAGS) -o $@ @gzip.rsp
-       del gzip.rsp
-
-gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O: gzip.h tailor.h
-util$O lzw$O unlzw$O unpack$O unlzh$O crypt$O: gzip.h tailor.h
-
-gzip$O unlzw$O: revision.h lzw.h
-
-bits$O unzip$O util$O zip$O: crypt.h
-
-gzip$O getopt$O: getopt.h
-
-match$O: match.S
-       $(CC) -c match.S
-
-zcmp: zcmp.in
-       sed "$(SEDCMD)" $(srcdir)/zcmp.in > zcmp
-       chmod 755 zcmp
-
-zdiff: zdiff.in
-       sed "$(SEDCMD)" $(srcdir)/zdiff.in > zdiff
-       chmod 755 zdiff
-
-zmore: zmore.in
-       sed "$(SEDCMD)" $(srcdir)/zmore.in > zmore
-       chmod 755 zmore
-
-znew: znew.in
-       sed "$(SEDCMD)" $(srcdir)/znew.in > znew
-       chmod 755 znew
-
-zforce: zforce.in
-       sed "$(SEDCMD)" $(srcdir)/zforce.in > zforce
-       chmod 755 zforce
-
-gzexe: gzexe.in
-       sed "$(SEDCMD)" $(srcdir)/gzexe.in > gzexe
-       chmod 755 gzexe
-
-gzip.info: gzip.texi
-       cd $(srcdir); makeinfo gzip.texi
-
-gzip.dvi: gzip.texi
-       cd $(srcdir); texi2dvi gzip.texi
-
-gzip.doc: gzip.1
-       cd $(srcdir); nroff -man gzip.1 | col -b | uniq > gzip.doc
-
-# Prevent GNU make v3 from overflowing arg limit on SysV.
-.NOEXPORT:
-
-# end of file
diff --git a/msdos/Makefile.msc b/msdos/Makefile.msc
deleted file mode 100644 (file)
index 6bebf18..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-# Makefile for gzip
-# Microsoft C 5.1 or 6.0.
-
-# To use, do "make makefile.msc"
-
-# WARNING: the small model is not supported. The compact model is used
-# here. If you want to use the large model, add -D__LARGE__ to ASFLAGS
-# Add -DSMALL_MEM to CFLAGS if you wish to reduce the memory
-# requirements. Add -DNO_ASM to CFLAGS and remove match.obj from OBJI if
-# you do not have masm.
-
-# ------------- Microsoft C 5.1 and later -------------
-MODEL=-AC
-FP=
-CFLAGS=-Ox -nologo $(MODEL)
-BFLAGS=-Oait -Gs -nologo $(MODEL)
-# BFLAGS are the 'bug workaround' flags.
-CC=cl
-LD=link
-LDFLAGS=/e/st:0x1000/noe
-#     If you use lzexe as recommended, remove /e from LDFLAGS
-AS=masm
-#     For MSC 6.0, use: AS=ml
-ASFLAGS=-ml -t
-# Add -DDYN_ALLOC to ASFLAGS if you have defined it in tailor.h or CFLAGS
-LIB = c:\c51\lib
-
-# ------------- Common declarations:
-STRIP=rem
-#    If you don't have lzexe, get it (by ftp on wuarchive.wustl.edu
-#    in /mirrors/msdos/filutl/lzexe91e.zip). Then define:
-#STRIP=lzexe
-#    Or if you've registered PKLITE, then define:
-#STRIP=pklite
-#    This makes a big difference in .exe size (and possibly load time)
-
-O=.obj
-OBJA=match$(O) $(LIB)\setargv$(O)
-
-# ------------- Used by install rule
-# set BIN to the directory you want to install the executables to
-BIN = c:\bin
-
-# variables
-OBJ1 = gzip$(O) zip$(O) deflate$(O) trees$(O) bits$(O) unzip$(O) inflate$(O) \
-       util$(O)
-OBJ2 = crypt$(O) lzw$(O) unlzw$(O) unpack$(O) unlzh$(O) getopt$(O) $(OBJA)
-
-gzip.obj: gzip.c gzip.h tailor.h crypt.h revision.h lzw.h
-       $(CC) -c $(CFLAGS) $*.c
-
-zip.obj: zip.c gzip.h tailor.h crypt.h
-       $(CC) -c $(CFLAGS) $*.c
-
-deflate.obj: deflate.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) $*.c
-
-trees.obj: trees.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) $*.c
-
-bits.obj: bits.c gzip.h tailor.h crypt.h
-       $(CC) -c $(CFLAGS) $*.c
-
-unzip.obj: unzip.c gzip.h tailor.h crypt.h
-       $(CC) -c $(CFLAGS) $*.c
-
-inflate.obj: inflate.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) $*.c
-
-util.obj: util.c gzip.h tailor.h crypt.h
-       $(CC) -c $(BFLAGS) $*.c
-
-crypt.obj: crypt.c gzip.h tailor.h crypt.h
-       $(CC) -c $(CFLAGS) $*.c
-
-lzw.obj: lzw.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) $*.c
-
-unlzw.obj: unlzw.c gzip.h tailor.h lzw.h
-       $(CC) -c $(CFLAGS) $*.c
-
-unpack.obj: unpack.c gzip.h tailor.h
-       $(CC) -c $(CFLAGS) $*.c
-
-unlzh.obj: unlzh.c gzip.h tailor.h
-       $(CC) -c $(BFLAGS) $*.c
-
-getopt.obj: getopt.c getopt.h
-       $(CC) -c $(CFLAGS) $*.c
-
-match.obj:     msdos\match.asm
-       $(AS) $(ASFLAGS) msdos\match, match;
-
-# we must cut the command line to fit in the MS/DOS 128 byte limit:
-gzip.exe: $(OBJ1) $(OBJ2)
-       echo $(OBJ1)+ > gzip.rsp
-       echo $(OBJ2); >> gzip.rsp
-       $(LD) $(LDFLAGS) @gzip.rsp
-       del gzip.rsp
-       $(STRIP) gzip.exe
-
-install: gzip.exe
-       copy /b gzip.exe $(BIN)
-       copy /b gzip.exe $(BIN)\gunzip.exe
-
-#clean:
-#      del *.obj
-#      del *.exe
diff --git a/msdos/doturboc.bat b/msdos/doturboc.bat
deleted file mode 100644 (file)
index d164ef8..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-: This file is a complement to gzip.prj for Turbo C 2.0 users.
-: To construct gzip, first transform all files to msdos CR LF format.
-: (Use utilities such as flip or do file transfers in ascii mode.)
-: Then invoke this file. Then enter Turbo C, set the
-: compilation model to compact, and the project file to gzip.prj.
-: Change the compilation flags if you wish (add SMALL_MEM
-: to reduce the memory requirements), and press F9...
-: WARNING: you must use the compact or large model in this version.
-: To use the large model, add -D__LARGE__ in the tasm command below.
-: To get the file wildargs.obj, do:
-:
-:   pkunpak \tcc\startup wildargs.obj
-:
-: pkunpak is available in wuarchive.wustl.edu:/mirrors/msdos/starter/pk361.exe
-:
-: After compiling gzip.exe, do: copy gzip.exe gunzip.exe
-:
-tasm -ml -DDYN_ALLOC -DSS_NEQ_DS msdos\match, match;
diff --git a/msdos/gzip.prj b/msdos/gzip.prj
deleted file mode 100644 (file)
index 1601d51..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-gzip.c       (gzip.h tailor.h crypt.h revision.h lzw.h)
-zip.c        (gzip.h tailor.h crypt.h)
-deflate.c    (gzip.h tailor.h)
-trees.c      (gzip.h tailor.h)
-bits.c       (gzip.h tailor.h crypt.h)
-unzip.c      (gzip.h tailor.h crypt.h)
-inflate.c    (gzip.h tailor.h)
-util.c       (gzip.h tailor.h crypt.h)
-crypt.c      (gzip.h tailor.h crypt.h)
-lzw.c        (gzip.h tailor.h)
-unlzw.c      (gzip.h tailor.h lzw.h)
-unpack.c     (gzip.h tailor.h)
-unlzh.c      (gzip.h tailor.h)
-msdos\tailor.c     (gzip.h tailor.h)
-getopt.c     (getopt.h)
-match.obj
-wildargs.obj
diff --git a/msdos/match.asm b/msdos/match.asm
deleted file mode 100644 (file)
index d3b31cd..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-; match.asm -- optional optimized asm version of longest match in deflate.c
-; Copyright (C) 1992-1993 Jean-loup Gailly
-; This is free software; you can redistribute it and/or modify it under the
-; terms of the GNU General Public License, see the file COPYING.
-;
-; Must be assembled with masm -ml. To be used only with C compact model
-; or large model. (For large model, assemble with -D__LARGE__).
-; This file is only optional. If you don't have masm or tasm, use the
-; C version (add -DNO_ASM to CFLAGS in makefile.msc and remove match.obj
-; from OBJI). If you have reduced WSIZE in zip.h, then change its value
-; below.
-;
-; Turbo C 2.0 does not support static allocation of more than 64K bytes per
-; file, and does not have SS == DS. So TC and BC++ users must use:
-;   tasm -ml -DDYN_ALLOC -DSS_NEQ_DS match;
-;
-; To simplify the code, the option -DDYN_ALLOC is supported for OS/2
-; only if the arrays are guaranteed to have zero offset (allocated by
-; halloc). We also require SS==DS. This is satisfied for MSC but not Turbo C.
-
-        name    match
-
-ifndef DYN_ALLOC
-        extrn   _prev         : word
-        extrn   _window       : byte
-        prev    equ  _prev    ; offset part
-        window  equ  _window
-endif
-
-_DATA    segment  word public 'DATA'
-        extrn   _nice_match   : word
-        extrn   _match_start  : word
-        extrn   _prev_length  : word
-        extrn   _good_match   : word
-        extrn   _strstart     : word
-        extrn   _max_chain_length : word
-ifdef DYN_ALLOC
-        extrn   _prev         : word
-        extrn   _window       : word
-        prev    equ 0         ; offset forced to zero
-        window  equ 0
-        window_seg equ _window[2]
-       window_off equ 0
-else
-       wseg    dw seg _window
-        window_seg equ wseg
-       window_off equ offset _window
-endif
-_DATA    ends
-
-DGROUP  group _DATA
-
-_TEXT   segment word public 'CODE'
-        assume  cs: _TEXT, ds: DGROUP
-
-       public _match_init
-        public _longest_match
-
-       MIN_MATCH     equ 3
-        MAX_MATCH     equ 258
-       WSIZE         equ 32768         ; keep in sync with zip.h !
-       MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1)
-       MAX_DIST      equ (WSIZE-MIN_LOOKAHEAD)
-
-prev_ptr    dw  seg _prev              ; pointer to the prev array
-ifdef SS_NEQ_DS
-    match_start dw  0                  ; copy of _match_start if SS != DS
-    nice_match  dw  0                  ; copy of _nice_match  if SS != DS
-endif
-
-; initialize or check the variables used in match.asm.
-
-ifdef __LARGE__
-_match_init proc far                   ; 'proc far' for large model
-else
-_match_init proc near                  ; 'proc near' for compact model
-endif
-ifdef SS_NEQ_DS
-        ma_start equ cs:match_start    ; does not work on OS/2
-        nice     equ cs:nice_match
-       mov     ax,_nice_match
-       mov     cs:nice_match,ax        ; ugly write to code, crash on OS/2
-else
-       assume ss: DGROUP
-        ma_start equ ss:_match_start
-        nice     equ ss:_nice_match
-        mov     ax,ds
-        mov     bx,ss
-        cmp     ax,bx                   ; SS == DS?
-        jne     error
-endif
-ifdef DYN_ALLOC
-       cmp     _prev[0],0              ; verify zero offset
-       jne     error
-       cmp     _window[0],0
-       jne     error
-  ifdef SS_NEQ_DS
-       mov     ax,_prev[2]             ; segment value
-       mov     cs:prev_ptr,ax          ; ugly write to code, crash on OS/2
-        prev_seg  equ cs:prev_ptr
-  else
-        prev_seg  equ ss:_prev[2]      ; works on OS/2 if SS == DS
-  endif
-else
-        prev_seg  equ cs:prev_ptr
-endif
-       ret
-ifdef __LARGE__
-       extrn   _exit : far             ; 'far' for large model
-else
-       extrn   _exit : near            ; 'near' for compact model
-endif
-error:  call    _exit
-
-_match_init endp
-
-; -----------------------------------------------------------------------
-; Set match_start to the longest match starting at the given string and
-; return its length. Matches shorter or equal to prev_length are discarded,
-; in which case the result is equal to prev_length and match_start is
-; garbage.
-; IN assertions: cur_match is the head of the hash chain for the current
-;   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
-
-; int longest_match(cur_match)
-
-ifdef __LARGE__
-_longest_match  proc far                ; 'proc far' for large model
-else
-_longest_match  proc near               ; 'proc near' for compact model
-endif
-        push    bp
-        mov     bp,sp
-        push    di
-       push    si
-       push    ds
-
-ifdef __LARGE__
-        cur_match    equ word ptr [bp+6] ; [bp+6] for large model
-else
-        cur_match    equ word ptr [bp+4] ; [bp+4] for compact model
-endif
-
-;       window      equ es:window (es:0 for DYN_ALLOC)
-;       prev        equ ds:prev
-;       match        equ es:si
-;       scan         equ es:di
-;       chain_length equ bp
-;       best_len     equ bx
-;       limit        equ dx
-
-       mov     si,cur_match            ; use bp before it is destroyed
-        mov     bp,_max_chain_length    ; chain_length = max_chain_length
-       mov     di,_strstart
-       mov     dx,di
-       sub     dx,MAX_DIST             ; limit = strstart-MAX_DIST
-       jae     limit_ok
-       sub     dx,dx                   ; limit = NIL
-limit_ok:
-        add     di,2+window_off         ; di = offset(window + strstart + 2)
-        mov     bx,_prev_length         ; best_len = prev_length
-       mov     es,window_seg
-        mov     ax,es:[bx+di-3]         ; ax = scan[best_len-1..best_len]
-        mov     cx,es:[di-2]            ; cx = scan[0..1]
-       cmp     bx,_good_match          ; do we have a good match already?
-        mov     ds,prev_seg                    ; (does not destroy the flags)
-        assume  ds: nothing
-        jb      do_scan                        ; good match?
-       shr     bp,1                    ; chain_length >>= 2
-       shr     bp,1
-        jmp     short do_scan
-
-        even                            ; align destination of branch
-long_loop:
-; at this point, ds:di == scan+2, ds:si == cur_match
-        mov     ax,[bx+di-3]            ; ax = scan[best_len-1..best_len]
-        mov     cx,[di-2]               ; cx = scan[0..1]
-        mov     ds,prev_seg                    ; reset ds to address the prev array
-short_loop:
-; at this point, di == scan+2, si = cur_match,
-; ax = scan[best_len-1..best_len] and cx = scan[0..1]
-if (WSIZE-32768)
-        and     si,WSIZE-1              ; not needed if WSIZE=32768
-endif
-        shl     si,1                    ; cur_match as word index
-        mov     si,prev[si]             ; cur_match = prev[cur_match]
-        cmp     si,dx                  ; cur_match <= limit ?
-        jbe     the_end
-        dec     bp                      ; --chain_length
-        jz      the_end
-do_scan:
-        cmp     ax,word ptr es:window[bx+si-1] ; check match at best_len-1
-        jne     short_loop
-        cmp     cx,word ptr es:window[si]      ; check min_match_length match
-        jne     short_loop
-
-        lea     si,window[si+2]         ; si = match
-        mov     ax,di                   ; ax = scan+2
-        mov     cx,es
-        mov     ds,cx                  ; ds = es = window
-        mov     cx,(MAX_MATCH-2)/2      ; scan for at most MAX_MATCH bytes
-        repe    cmpsw                   ; loop until mismatch
-        je      maxmatch                ; match of length MAX_MATCH?
-mismatch:
-        mov     cl,[di-2]               ; mismatch on first or second byte?
-        sub     cl,[si-2]               ; cl = 0 if first bytes equal
-        xchg    ax,di                   ; di = scan+2, ax = end of scan
-        sub     ax,di                   ; ax = len
-       sub     si,ax                   ; si = cur_match + 2 + offset(window)
-       sub     si,2+window_off         ; si = cur_match
-        sub     cl,1                    ; set carry if cl == 0 (can't use DEC)
-        adc     ax,0                    ; ax = carry ? len+1 : len
-        cmp     ax,bx                   ; len > best_len ?
-        jle     long_loop
-        mov     ma_start,si             ; match_start = cur_match
-        mov     bx,ax                   ; bx = best_len = len
-        cmp     ax,nice                 ; len >= nice_match ?
-        jl      long_loop
-the_end:
-       pop     ds
-        assume  ds: DGROUP
-ifdef SS_NEQ_DS
-       mov     ax,ma_start             ; garbage if no match found
-       mov     ds:_match_start,ax
-endif
-        pop     si
-        pop     di
-        pop     bp
-        mov     ax,bx                   ; result = ax = best_len
-        ret
-maxmatch:                               ; come here if maximum match
-        cmpsb                           ; increment si and di
-        jmp     mismatch                ; force match_length = MAX_LENGTH
-
-_longest_match  endp
-
-_TEXT   ends
-end
diff --git a/msdos/tailor.c b/msdos/tailor.c
deleted file mode 100644 (file)
index 83d86a6..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* tailor.c -- target dependent functions
- * Copyright (C) 1992-1993 Jean-loup Gailly
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License, see the file COPYING.
- */
-
-/* tailor.c is a bunch of non portable routines.
- * It should be kept to a minimum.
- */
-
-#include <config.h>
-#include "tailor.h"
-#include "gzip.h"
-
-#ifdef __TURBOC__
-
-/************************/
-/*  Function fcalloc()  */
-/************************/
-
-/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
- * and farmalloc(64K) returns a pointer with an offset of 8, so we
- * must fix the pointer. Warning: the pointer must be put back to its
- * original form in order to free it, use fcfree().
- * For MSC, use halloc instead of this function (see tailor.h).
- */
-static ush ptr_offset = 0;
-
-void * fcalloc(items, size)
-    unsigned items; /* number of items */
-    unsigned size;  /* item size */
-{
-    void * buf = farmalloc((ulg)items*size + 16L);
-    if (buf == NULL) return NULL;
-    /* Normalize the pointer to seg:0 */
-    if (ptr_offset == 0) {
-       ptr_offset = (ush)((uch*)buf-0);
-    } else if (ptr_offset != (ush)((uch*)buf-0)) {
-       error("inconsistent ptr_offset");
-    }
-    *((ush*)&buf+1) += (ptr_offset + 15) >> 4;
-    *(ush*)&buf = 0;
-    return buf;
-}
-
-void fcfree(ptr)
-    void *ptr; /* region allocated with fcalloc() */
-{
-    /* Put the pointer back to its original form: */
-    *((ush*)&ptr+1) -= (ptr_offset + 15) >> 4;
-    *(ush*)&ptr = ptr_offset;
-    farfree(ptr);
- }
-
-#endif /* __TURBOC__ */
diff --git a/nt/Makefile.nt b/nt/Makefile.nt
deleted file mode 100644 (file)
index 0a7604c..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-# Simple makefile for Windows NT
-# Written by Ron Cox <roncox@indirect.com>
-
-# This is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License, see the file COPYING.
-
-# This makefile is suitable for NTFS only. To build a gzip executable suitable
-# for a FAT file system, add -DNTFAT to DEFS.
-
-# To build debug version, define environment variable DEBUG, or include a
-# -DDEBUG on the commandline (i.e.: nmake -DDEBUG)
-
-.silent:
-
-!include <ntwin32.mak>
-
-#
-# Object files
-#
-OBJS = gzip.obj zip.obj deflate.obj trees.obj bits.obj unzip.obj inflate.obj \
-       util.obj crypt.obj lzw.obj unlzw.obj unpack.obj getopt.obj unlzh.obj
-
-DEFS =
-# for FAT support, set: DEFS = -DNTFAT
-
-#
-# How to build .obj's from .c's
-#
-.c.obj:
-       $(cc) $(DEFS) -Ox $(cflags) $(cvarsdll) $<
-
-#
-# Main target
-#
-all: gzip.exe
-
-#
-# Link target. setargv.obj is provided in the compiler library directory.
-#
-gzip.exe: $(OBJS)
-       $(link) $(linkdebug) $(conflags) -out:gzip.exe $(OBJS) setargv.obj \
-         $(conlibsdll)
-
-#
-# Dependencies
-#
-gzip.obj:      gzip.c gzip.h tailor.h
-zip.obj:       zip.c gzip.h tailor.h crypt.h
-deflate.obj:   deflate.c gzip.h tailor.h
-trees.obj:     trees.c gzip.h tailor.h
-bits.obj:      bits.c gzip.h tailor.h crypt.h
-unzip.obj:     unzip.c gzip.h tailor.h crypt.h
-inflate.obj:   inflate.c gzip.h tailor.h crypt.h
-util.obj:      util.c gzip.h tailor.h
-lzw.obj:       lzw.c gzip.h tailor.h
-unlzw.obj:     unlzw.c gzip.h tailor.h revision.h lzw.h
-unpack.obj:    unpack.c gzip.h tailor.h
-crypt.obj:     crypt.c gzip.h tailor.h
-unlzh.obj:     unlzh.c gzip.h tailor.h lzw.h
-
-
-clean:
-       -rm $(OBJS)
-
-clobber: clean
-       -rm gzip.exe
diff --git a/os2/Makefile.os2 b/os2/Makefile.os2
deleted file mode 100644 (file)
index e4afc2e..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-# Makefile for gzip (GNU zip), OS/2 version    -*- Indented-Text -*-
-# Written by Kai Uwe Rommel <rommel@informatik.tu-muenchen.de>
-
-# specialized version for OS/2
-
-default:
-       @echo "Enter $(MAKE) -f makefile.os2 target"
-       @echo "where target is one of:"
-       @echo "   msc mscdebug gcc gccdyn gccdebug"
-
-# compilation with emx 0.8f (gcc 2.3.3) or newer
-#
-# release version, statically linked C runtime
-gcc:
-       $(MAKE) -f Makefile.os2 all \
-       CC="gcc -Zomf -Zsys" O=".obj" S=".S" \
-       AS="gcc -Zomf -xassembler-with-cpp -c -o" \
-       CFLAGS="-O" LDFLAGS="gzip.def -s"
-#
-# release version, dynamically linked C runtime
-gccdyn:
-       $(MAKE) -f Makefile.os2 all \
-       CC="gcc -Zomf -Zmt" O=".obj" S=".S" \
-       AS="gcc -Zomf -xassembler-with-cpp -c -o" \
-       CFLAGS="-O" LDFLAGS="gzip.def -s"
-#
-# debugging version
-gccdebug:
-       $(MAKE) -f Makefile.os2 all \
-       CC="gcc -g" O=".o" S=".S" \
-       AS="gcc -g -xassembler-with-cpp -c -o" \
-       CFLAGS="" LDFLAGS="gzip.def"
-
-# compilation with MS C 6.00
-#
-# release version
-msc:
-       $(MAKE) -f Makefile.os2 all \
-       CC="cl -nologo -AC" O=".obj" S=".asm" \
-       AS="ml -nologo -Zm -Cp -c -Fo" \
-       CFLAGS=" -W1 -Zap -J -G2s -Ocegit" \
-       LDFLAGS="-Lp -F 2000 setargv.obj gzip16.def -link /noe"
-#
-# debugging version
-mscdebug:
-       $(MAKE) -f Makefile.os2 all \
-       CC="cl -nologo -AC -Zi" O=".obj" S=".asm" \
-       AS="ml -nologo -Zm -Zi -Cp -c -Fo" \
-       CFLAGS="-W1 -Zap -J -G2 -Od" \
-       LDFLAGS="-Lp -F 2000 setargv.obj gzip16.def -link /noe /exe"
-
-DEFS  = -DOS2 -DASMV
-
-OBJS = gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O util$O \
-       crypt$O lzw$O unlzw$O unpack$O unlzh$O getopt$O match$O
-
-.SUFFIXES: .c $O
-
-.c$O:
-       $(CC) $(CFLAGS) $(DEFS) -c $<
-
-all: gzip.exe gzip.info gzip.doc
-
-gzip.exe: $(OBJS)
-       $(CC) -o $@ $(OBJS) $(LDFLAGS)
-
-gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O: gzip.h tailor.h
-util$O lzw$O unlzw$O unpack$O unlzh$O crypt$O: gzip.h tailor.h
-
-gzip$O unlzw$O: revision.h lzw.h
-
-bits$O unzip$O util$O zip$O: crypt.h
-
-match$O: match$S
-       $(AS) $@ match$S
-
-gzip.info: gzip.texi gpl.texinfo
-       makeinfo gzip.texi
-
-gzip.doc: gzip.1
-       groff -man gzip.1 > $@
diff --git a/os2/gzip.def b/os2/gzip.def
deleted file mode 100644 (file)
index c7af3ea..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-NAME GZIP WINDOWCOMPAT
-DESCRIPTION 'GNU gzip file compression program'
-STACKSIZE 0x80000
diff --git a/os2/gzip16.def b/os2/gzip16.def
deleted file mode 100644 (file)
index 74c20d9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-NAME GZIP WINDOWCOMPAT NEWFILES
-DESCRIPTION 'GNU gzip file compression program'
diff --git a/primos/build.cpl b/primos/build.cpl
deleted file mode 100644 (file)
index 6d82fa0..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Gzip build file for Primos.
-/* author: Peter Eriksson, pen@lysator.liu.se
-/*
-type
-type 'Building GZIP for PRIMOS - Please Wait...'
-type
-&if ^ [exists *>PRIMOS>OBJ -dir] &then &do
-      type 'Creating *>PRIMOS>OBJ directory...'
-      type
-      create *>PRIMOS>OBJ
-   &end
-
-type 'Compiling...
-
-&set_var unit := 0
-
-/*
-&set_var cdefines  :=  -debug
-
-como *>primos>compile.como
-&do file &items [wild *>@@.c -single unit]
-  &set_var filebase := [before %file% .]
-  &if ^  [exists *>primos>obj>%filebase%.bin] &then &do
-  type 'Compiling "'%file%'"...'
-  ci *>%file% -binary *>primos>obj>=.bin %cdefines% -optionsfile *>primos>ci.opts
-  &end
-&end
-close -unit %unit%
-&set_var unit := 0
-
-&do file &items [wild *>primos>@@.c -single unit]
-  &set_var filebase := [before %file% .]
-  &if ^  [exists *>primos>obj>%filebase%.bin] &then &do
-  type 'Compiling "'%file%'"...'
-  ci *>primos>%file% -binary *>primos>obj>=.bin %cdefines% -optionsfile *>primos>ci.opts
-  &end
-&end
-como -end
-
-type
-type
-type 'Binding...'
-
-&set_var unit := 0
-&data bind
-  li ccmain
-  load *>primos>obj>gzip
-  load *>primos>obj>bits
-  load *>primos>obj>crypt
-  load *>primos>obj>deflate
-  load *>primos>obj>getopt
-  load *>primos>obj>inflate
-  load *>primos>obj>lzw
-  load *>primos>obj>makecrc
-  load *>primos>obj>primos
-  load *>primos>obj>trees
-  load *>primos>obj>unlzw
-  load *>primos>obj>unpack
-  load *>primos>obj>unlzh
-  load *>primos>obj>unzip
-  load *>primos>obj>util
-  load *>primos>obj>zip
-  li c_lib
-  li
-  dynt -all
-  nwc
-  nitr
-  ntw
-  compress
-  file *>primos>gzip.run
-&end
-
-type
-type
-type 'All done. (Hopefully). The executable should be in *>PRIMOS>GZIP.RUN'
-&return
diff --git a/primos/ci.opts b/primos/ci.opts
deleted file mode 100644 (file)
index bb4f9b3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
--define PRIMOS
--include *>PRIMOS>INCLUDE
--ignoreregister
--packbytes
--sof
-
diff --git a/primos/include/errno.h b/primos/include/errno.h
deleted file mode 100644 (file)
index ee89146..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
-** errno.h
-**
-** Emulation of the Unix errno.h header file for PRIMOS
-**
-** Author: Peter Eriksson <pen@lysator.liu.se>
-*/
-
-#ifndef __ERRNO_H__
-#define __ERRNO_H__
-
-#include <errd.h>
-
-#define ENOENT e$fntf
-
-#endif
-
diff --git a/primos/include/fcntl.h b/primos/include/fcntl.h
deleted file mode 100644 (file)
index 9e4b1dc..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-** fcntl.h
-**
-** Emulation of the Unix fcntl.h header file for PRIMOS
-**
-** Author: Peter Eriksson <pen@lysator.liu.se>
-*/
-
-#ifndef __FCNTL_H__
-#define __FCNTL_H__
-
-#define O_RDONLY 0
-#define O_WRONLY 1
-#define O_RDWR   2
-
-#define O_BINARY 0
-#define O_EXCL   0
-#define O_NDELAY 0
-#define O_CREAT  0
-#define O_TRUNC  0
-
-#endif
diff --git a/primos/include/stdlib.h b/primos/include/stdlib.h
deleted file mode 100644 (file)
index 49fbfc3..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
-** stdlib.h
-**
-** Emulation of the Unix stdlib.h header file for PRIMOS
-**
-** Author: Peter Eriksson <pen@lysator.liu.se>
-*/
-
-#ifndef __STDLIB_H__
-#define __STDLIB_H__
-
-extern char *malloc();
-extern char *calloc();
-
-#endif
-
diff --git a/primos/include/sysStat.h b/primos/include/sysStat.h
deleted file mode 100644 (file)
index 18690b2..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-** sys/stat.h
-**
-** Emulation of the Unix sys/stat.h header file for PRIMOS
-**
-** Author: Peter Eriksson <pen@lysator.liu.se>
-*/
-
-#ifndef __SYS_STAT_H__
-#define __SYS_STAT_H__
-
-
-#include <sys/types.h>
-
-struct stat {
-        /* First some PRIMOS standard entries */
-       off_t   st_size;
-       time_t  st_mtime;
-       short   st_type;        /* Primos file type */
-       short   st_rwlock;      /* Primos read/write lock */
-
-       /* Begin Unix compatibility - don't believe these entries! */
-       dev_t   st_dev;
-       ino_t   st_ino;
-       mode_t  st_mode;
-       short   st_nlink;
-       uid_t   st_uid;
-       gid_t   st_gid;
-       dev_t   st_rdev;
-       time_t  st_atime;
-       time_t  st_ctime;
-       long    st_blksize;
-       long    st_blocks;
-};
-
-#define        _IFMT           0170000 /* type of file */
-#define        _IFREG          0100000 /* regular */
-#define        _IFDIR          0040000 /* directory */
-
-/* Some stupid programs check if these are defined and then
-   believe these are supported in the OS - not so in PRIMOS ... */
-#ifndef __50SERIES
-#  define _IFCHR       0020000
-#  define _IFBLK       0060000
-#  define _IFLNK       0120000
-#  define _IFSOCK      0140000
-#  define _IFIFO       0010000
-#endif
-
-#define        S_ISUID         0004000
-#define        S_ISGID         0002000
-#define        S_ISVTX         0001000
-#define        S_IREAD         0000400
-#define        S_IWRITE        0000200
-#define        S_IEXEC         0000100
-
-#define        S_ENFMT         0002000
-
-#define        S_IFMT          _IFMT
-#define        S_IFREG         _IFREG
-#define        S_IFDIR         _IFDIR
-#ifndef __50SERIES
-#  define S_IFCHR      _IFCHR
-#  define S_IFBLK      _IFBLK
-#  define S_IFLNK      _IFLNK
-#  define S_IFSOCK     _IFSOCK
-#  define S_IFIFO      _IFIFO
-#endif
-
-#define        S_IRWXU         0000700
-#define        S_IRUSR         0000400
-#define        S_IWUSR         0000200
-#define        S_IXUSR         0000100
-#define        S_IRWXG         0000070
-#define        S_IRGRP         0000040
-#define        S_IWGRP         0000020
-#define        S_IXGRP         0000010
-#define        S_IRWXO         0000007
-#define        S_IROTH         0000004
-#define        S_IWOTH         0000002
-#define        S_IXOTH         0000001
-
-#define        S_ISREG(m)      (((m) & _IFMT) == _IFREG)
-#define        S_ISDIR(m)      (((m) & _IFMT) == _IFDIR)
-#ifndef __50SERIES
-#  define S_ISBLK(m)   (((m) & _IFMT) == _IFBLK)
-#  define S_ISCHR(m)   (((m) & _IFMT) == _IFCHR)
-#  define S_ISFIFO(m)  (((m) & _IFMT) == _IFIFO)
-#endif
-
-
-#endif
diff --git a/primos/include/sysTypes.h b/primos/include/sysTypes.h
deleted file mode 100644 (file)
index ec6c5b1..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-** sys/types.h
-**
-** Emulation of the Unix sys/types.h header file for PRIMOS
-**
-** Author: Peter Eriksson <pen@lysator.liu.se>
-*/
-
-#ifndef __SYS_TYPES_H__
-#define __SYS_TYPES_H__
-
-typedef long   size_t;
-typedef long   time_t;
-
-typedef long   off_t;
-typedef short  dev_t;
-typedef short  ino_t;
-typedef short  mode_t;
-typedef short  uid_t;
-typedef short  gid_t;
-
-typedef char   *caddr_t;
-
-#endif
-
diff --git a/primos/primos.c b/primos/primos.c
deleted file mode 100644 (file)
index 18e228b..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-** primos.c
-**
-** This file contains emulation routines for some common Unix functions
-**
-** Author: Peter Eriksson <pen@lysator.liu.se>
-*/
-
-#ifdef __50SERIES
-
-#include <config.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-
-uid_t  primos_uid = 42;
-gid_t  primos_gid = 42;
-mode_t primos_mode = 600;
-
-/* Dummy do-nothing routine for chmod() */
-int chmod(path, mode)
-  char *path;
-  int mode;
-{
-   return 0;
-}
-
-char *getenv(var)
-  char *var;
-{
-  char buf[256];
-  extern char *gvget();
-
-  buf[0] = '.';
-  strcpy(buf+1, var);
-
-  return gvget(buf);
-}
-
-
-unlink(path)
-  char *path;
-{
-  return delete(path);
-}
-
-int lstat(path, buf)
-  char *path;
-  struct stat *buf;
-{
-  return stat(path, buf);
-}
-
-int stat(path, buf)
-  char *path;
-  struct stat *buf;
-{
-  buf->st_dev     = 1;
-  buf->st_ino     = 1;
-  buf->st_nlink   = 1;
-  buf->st_uid     = primos_uid;
-  buf->st_gid     = primos_gid;
-  buf->st_rdev    = 1;
-  buf->st_blksize = 2048;
-
-  buf->st_rwlock = frwlock(path);
-  switch (buf->st_type = ftype(path))
-  {
-    case 0:
-    case 1:
-      /* Regular file (SAM or DAM) */
-      buf->st_size   = fsize(path);
-      buf->st_mtime  = fdtm(path);
-
-      buf->st_mode = S_IFREG|primos_mode;
-      break;
-
-    case 4:
-      buf->st_size = 0;
-      buf->st_mtime = fdtm(path);
-
-      buf->st_mode = S_IFDIR|primos_mode;
-      break;
-
-    case -1:
-      return -1;
-
-    default:
-      buf->st_mode = primos_mode;
-      buf->st_size = fsize(path);
-      buf->st_mtime = fdtm(path);
-  }
-
-  buf->st_blocks = (buf->st_size-1) / buf->st_blksize + 1;
-
-  /* Should be fixed to really fetch these values, but that
-   * would require calling some PRIMOS subroutines and I don't have
-   * a copy of the Primos Subroutine reference manuals here..
-   */
-  buf->st_atime = buf->st_mtime;
-  buf->st_ctime = buf->st_mtime;
-
-  return 0;
-}
-
-int fstat(fd, buf)
-  int fd;
-  struct stat *buf;
-{
-  char path[1025];
-
-  return stat(getname(fd, path), buf);
-}
-
-int ascii2pascii(c)
-  int c;
-{
-  return (c ? (c | 0x80) : '\0');
-}
-
-
-#endif /* __50SERIES */
diff --git a/primos/readme b/primos/readme
deleted file mode 100644 (file)
index 1867062..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-To build GZIP for PRIMOS you should just have to type:
-
-   r *>primos>build
-
-while standing in the directory above this PRIMOS subdirectory.
-
-If the files in these directories looks strange, then it might be
-because they are in normal ASCII. You'll need to convert them into
-PASCII before you will be able to build the GZIP executable.
-
-You can find a simple ASCII to PASCII converter via anonymous FTP
-from "ftp.lysator.liu.se" in the directory "pub/primos/run" as
-the file "topascii.run".
-
-You can reach me at a number of places in case there are any bugs
-in this port to report...
-
-   Email:
-
-      pen@signum.se        Signum is a company giving support for
-                           Free Software. Call/Mail us if you're
-                           interrested! (Phone: +46-13-21-46-00)
-
-      pen@lysator.liu.se   Lysator is a computer society at the
-                           Linkoping University in Sweden.
-
-Peter Eriksson, 25 May 1993
index 9825374bc69905b84e09c0a408f58c0730316d2f..6ce7955966c11d27629f0dc13866e9789ad35bd2 100644 (file)
@@ -1,6 +1,6 @@
 /* revision.h -- define the version number
 
-   Copyright (C) 1998-1999, 2001-2002, 2006, 2009-2010 Free Software
+   Copyright (C) 1998-1999, 2001-2002, 2006, 2009-2012 Free Software
    Foundation, Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly.
 
index 8492dc9c8ee75ae43acec483b15a4e558518badc..e20de49a35f43d51633b4f424c0f1c54f5ac288f 100644 (file)
@@ -20,35 +20,35 @@ int main(argc, argv)
     int n;
 
     if (argc < 1 || argc > 2) {
-       fprintf(stderr, "usage: %s [file[.gz]]\n", argv[0]);
-       exit(EXIT_FAILURE);
+        fprintf(stderr, "usage: %s [file[.gz]]\n", argv[0]);
+        exit(EXIT_FAILURE);
     }
     strcpy(cmd, "gzip -dc ");  /* use "gzip -c" for zwrite */
     if (argc == 2) {
-       strncat(cmd, argv[1], sizeof(cmd)-strlen(cmd));
+        strncat(cmd, argv[1], sizeof(cmd)-strlen(cmd));
     }
     infile = popen(cmd, "r");  /* use "w" for zwrite */
     if (infile == NULL) {
-       fprintf(stderr, "%s: popen('%s', 'r') failed\n", argv[0], cmd);
-       exit(EXIT_FAILURE);
+        fprintf(stderr, "%s: popen('%s', 'r') failed\n", argv[0], cmd);
+        exit(EXIT_FAILURE);
     }
     /* Read one byte using getc: */
     n = getc(infile);
     if (n == EOF) {
-       pclose(infile);
-       exit(EXIT_SUCCESS);
+        pclose(infile);
+        exit(EXIT_SUCCESS);
     }
     putchar(n);
 
     /* Read the rest using fread: */
     for (;;) {
-       n = fread(buf, 1, BUFSIZ, infile);
-       if (n <= 0) break;
-       fwrite(buf, 1, n, stdout);
+        n = fread(buf, 1, BUFSIZ, infile);
+        if (n <= 0) break;
+        fwrite(buf, 1, n, stdout);
     }
     if (pclose(infile) != 0) {
-       fprintf(stderr, "%s: pclose failed\n", argv[0]);
-       exit(EXIT_FAILURE);
+        fprintf(stderr, "%s: pclose failed\n", argv[0]);
+        exit(EXIT_FAILURE);
     }
     exit(EXIT_SUCCESS);
     return 0; /* just to make compiler happy */
index e408e2bc50bdd5c24ec823ad29a198125159508b..c5d30ad6794980050bd83b51014933d1807062e2 100755 (executable)
@@ -7,9 +7,9 @@ foreach $file (@ARGV) {
     read (FILE, $_, 8);
     ($magic, $method, $flags, $time) = unpack ("A2C2V", $_);
     if ($magic eq "\037\213") {
-       utime ($time, $time, $file);
+        utime ($time, $time, $file);
     }
     else {
-       warn "$file is not compressed with gzip!\n";
+        warn "$file is not compressed with gzip!\n";
     }
 }
index a7af35d46b9350046d4714172013e8712a934e62..4d6391562c4670a8a754b1b2a63d93c78cfdc5cf 100644 (file)
--- a/tailor.h
+++ b/tailor.h
@@ -1,6 +1,6 @@
 /* tailor.h -- target dependent definitions
 
-   Copyright (C) 1997-1999, 2002, 2006, 2009-2010 Free Software Foundation,
+   Copyright (C) 1997-1999, 2002, 2006, 2009-2012 Free Software Foundation,
    Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly
 
      /* DJGPP version 1.09+ on MS-DOS.
       * The DJGPP 1.09 stat() function must be upgraded before gzip will
       * fully work.
-      * No need for HAVE_DIRENT_H, since <unistd.h> defines POSIX_SOURCE which
-      * implies HAVE_DIRENT_H.
       */
 #    define near
 #  else
 #    define MAXSEG_64K
 #    ifdef __TURBOC__
 #      define off_t long
-#      ifdef __BORLANDC__
-#        define HAVE_DIRENT_H
-#      endif
 #      define HAVE_UTIME_H
 #    else /* MSC */
 #      define HAVE_SYS_UTIME_H
 #  endif
 #  ifdef __EMX__
 #    define HAVE_SYS_UTIME_H
-#    define HAVE_DIRENT_H
 #    define EXPAND(argc,argv) \
        {_response(&argc, &argv); _wildcard(&argc, &argv);}
 #  endif
 #  ifdef __BORLANDC__
-#    define HAVE_DIRENT_H
 #    define HAVE_UTIME_H
 #  endif
 #  ifdef __ZTC__
 #  define PATH_SEP2 ':'
 #  define SUFFIX_SEP ';'
 #  define NO_MULTIPLE_DOTS
+#  define NO_SIZE_CHECK
 #  define Z_SUFFIX "-gz"
 #  define RECORD_IO 1
 #  define casemap(c) tolow(c)
 #  define unlink delete
 #  ifdef VAXC
 #    include <unixio.h>
-#  else
-#    define HAVE_FCNTL_H
 #  endif
 #endif
 
 #  define OS_CODE  0x01
 #  define ASMV
 #  ifdef __GNUC__
-#    define HAVE_DIRENT_H
-#    define HAVE_FCNTL_H
-#    define HAVE_UNISTD_H
 #    define HAVE_CHOWN
 #    define HAVE_LSTAT
 #  else /* SASC */
 #    define direct dirent
      extern void _expand_args(int *argc, char ***argv);
 #    define EXPAND(argc,argv) _expand_args(&argc,&argv);
-#    undef  O_BINARY /* disable useless --ascii option */
 #  endif
 #endif
 
 #  endif
 #endif
 
-#ifdef __50SERIES /* Prime/PRIMOS */
-#  define PATH_SEP '>'
-#  define STDC_HEADERS
-#  define NO_STDIN_FSTAT
-#  define NO_SIZE_CHECK
-#  define RECORD_IO  1
-#  define casemap(c)  tolow(c) /* Force file names to lower case */
-#  define put_char(c) put_byte((c) & 0x7F)
-#  define get_char(c) ascii2pascii(get_byte())
-#  define OS_CODE  0x0F    /* temporary, subject to change */
-#  ifdef SIGTERM
-#    undef SIGTERM         /* We don't want a signal handler for SIGTERM */
-#  endif
-#endif
-
-#if defined(pyr) && !defined(NOMEMCPY) /* Pyramid */
-#  define NOMEMCPY /* problem with overlapping copies */
-#endif
-
 #ifdef TOPS20
 #  define OS_CODE  0x0a
 #endif
 
 
-       /* Common defaults */
+        /* Common defaults */
 
 #ifndef OS_CODE
 #  define OS_CODE  0x03  /* assume Unix */
 #ifndef OPEN
 #  define OPEN(name, flags, mode) open_safer (name, flags, mode)
 #endif
-
-#ifndef get_char
-#  define get_char() get_byte()
-#endif
-
-#ifndef put_char
-#  define put_char(c) put_byte(c)
-#endif
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644 (file)
index 0000000..3b6ec31
--- /dev/null
@@ -0,0 +1,89 @@
+## Process this file with automake to create Makefile.in
+# Copyright 2010-2012 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
+# the Free Software Foundation; either version 3, 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+TESTS =                                        \
+  helin-segv                           \
+  help-version                         \
+  hufts                                        \
+  memcpy-abuse                         \
+  mixed                                        \
+  null-suffix-clobber                  \
+  stdin                                        \
+  trailing-nul                         \
+  zdiff                                        \
+  zgrep-f                              \
+  zgrep-signal                         \
+  znew-k
+
+EXTRA_DIST =                           \
+  $(TESTS)                             \
+  init.cfg                             \
+  init.sh                              \
+  hufts-segv.gz
+
+built_programs = \
+  gzip         \
+  gunzip       \
+  gzexe                \
+  zcat         \
+  zcmp         \
+  zdiff                \
+  zegrep       \
+  zfgrep       \
+  zforce       \
+  zgrep                \
+  zless                \
+  zmore                \
+  znew
+
+TESTS_ENVIRONMENT =                            \
+  tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.;        \
+  TMPDIR=$$tmp__; export TMPDIR;               \
+  shell_or_perl_() {                           \
+    if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then                        \
+      if $(PERL) -e 'use warnings' > /dev/null 2>&1; then              \
+       grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=;   \
+        $(PERL) -w$$T_ -I$(srcdir) -MCoreutils                         \
+             -M"CuTmpdir qw($$f)" -- "$$1";    \
+      else                                     \
+       echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
+         "so skipping this test";              \
+       (exit 77);                              \
+      fi;                                      \
+    else                                       \
+      $(SHELL) "$$1";                          \
+    fi;                                                \
+  };                                           \
+  export                                       \
+  LC_ALL=C                                     \
+  VERSION=$(VERSION)                           \
+  abs_top_builddir='$(abs_top_builddir)'       \
+  abs_top_srcdir='$(abs_top_srcdir)'           \
+  abs_srcdir='$(abs_srcdir)'                   \
+  built_programs='$(built_programs)'           \
+  srcdir='$(srcdir)'                           \
+  top_srcdir='$(top_srcdir)'                   \
+  CC='$(CC)'                                   \
+  GZIP_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'` \
+  MAKE=$(MAKE)                                 \
+  PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)'     \
+  PACKAGE_VERSION=$(PACKAGE_VERSION)           \
+  PERL='$(PERL)'                               \
+  SHELL='$(SHELL)'                             \
+  PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH" \
+  ; 9>&2
+
+VERBOSE = yes
diff --git a/tests/Makefile.in b/tests/Makefile.in
new file mode 100644 (file)
index 0000000..fa344a4
--- /dev/null
@@ -0,0 +1,1916 @@
+# Makefile.in generated by automake 1.12a from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright 2010-2012 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
+# the Free Software Foundation; either version 3, 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = tests
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+       $(top_srcdir)/build-aux/test-driver
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
+       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/asm-underscore.m4 \
+       $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/chdir-long.m4 \
+       $(top_srcdir)/m4/clock_time.m4 \
+       $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \
+       $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closein.m4 \
+       $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
+       $(top_srcdir)/m4/configmake.m4 \
+       $(top_srcdir)/m4/dirent-safer.m4 $(top_srcdir)/m4/dirent_h.m4 \
+       $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
+       $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
+       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/errno_h.m4 \
+       $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exponentd.m4 \
+       $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \
+       $(top_srcdir)/m4/extensions.m4 $(top_srcdir)/m4/fchdir.m4 \
+       $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+       $(top_srcdir)/m4/fcntl-safer.m4 $(top_srcdir)/m4/fcntl.m4 \
+       $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopendir.m4 \
+       $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/filenamecat.m4 \
+       $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fpending.m4 \
+       $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fprintf-posix.m4 \
+       $(top_srcdir)/m4/fpurge.m4 $(top_srcdir)/m4/freading.m4 \
+       $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
+       $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
+       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/ftell.m4 \
+       $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/getcwd.m4 \
+       $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
+       $(top_srcdir)/m4/gettime.m4 $(top_srcdir)/m4/gettimeofday.m4 \
+       $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnu-make.m4 \
+       $(top_srcdir)/m4/gnulib-common.m4 \
+       $(top_srcdir)/m4/gnulib-comp.m4 \
+       $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \
+       $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes_h.m4 \
+       $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \
+       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/largefile.m4 \
+       $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/lib-ignore.m4 \
+       $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+       $(top_srcdir)/m4/lib-prefix.m4 \
+       $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
+       $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \
+       $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \
+       $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
+       $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/manywarnings.m4 \
+       $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mbrtowc.m4 \
+       $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+       $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/mempcpy.m4 \
+       $(top_srcdir)/m4/memrchr.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+       $(top_srcdir)/m4/mode_t.m4 $(top_srcdir)/m4/msvc-inval.m4 \
+       $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+       $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
+       $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/openat.m4 \
+       $(top_srcdir)/m4/opendir.m4 $(top_srcdir)/m4/pathmax.m4 \
+       $(top_srcdir)/m4/perror.m4 $(top_srcdir)/m4/printf-frexp.m4 \
+       $(top_srcdir)/m4/printf-frexpl.m4 \
+       $(top_srcdir)/m4/printf-posix-rpl.m4 \
+       $(top_srcdir)/m4/printf.m4 $(top_srcdir)/m4/quotearg.m4 \
+       $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/realloc.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \
+       $(top_srcdir)/m4/shell.m4 $(top_srcdir)/m4/signbit.m4 \
+       $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/ssize_t.m4 \
+       $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
+       $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
+       $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
+       $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
+       $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
+       $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \
+       $(top_srcdir)/m4/sys_socket_h.m4 \
+       $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
+       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/threadlib.m4 \
+       $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/timespec.m4 \
+       $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
+       $(top_srcdir)/m4/utimbuf.m4 $(top_srcdir)/m4/utimens.m4 \
+       $(top_srcdir)/m4/utimes.m4 $(top_srcdir)/m4/vasnprintf.m4 \
+       $(top_srcdir)/m4/vfprintf-posix.m4 \
+       $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \
+       $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \
+       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
+       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+       $(top_srcdir)/m4/yesno.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/lib/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red='\e[0;31m'; \
+    grn='\e[0;32m'; \
+    lgn='\e[1;32m'; \
+    blu='\e[1;34m'; \
+    mgn='\e[0;35m'; \
+    brg='\e[1m'; \
+    std='\e[m'; \
+  fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__recheck_rx = ^[    ]*:recheck:[    ]*
+am__global_test_result_rx = ^[         ]*:global-test-result:[         ]*
+am__copy_in_global_log_rx = ^[         ]*:copy-in-global-log:[         ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          if ((getline line2 < ($$0 ".log")) < 0) \
+           recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+          break; \
+        } \
+    }; \
+  if (recheck) \
+    print $$0; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[       ]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+      printf "\n"; \
+    }; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test.  Creates the
+# directory for the log if needed.  Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log.  Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup);                                     \
+$(am__vpath_adj_setup) $(am__vpath_adj)                        \
+$(am__tty_colors);                                     \
+srcdir=$(srcdir); export srcdir;                       \
+case "$@" in                                           \
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;   \
+    *) am__odir=.;;                                    \
+esac;                                                  \
+test "x$$am__odir" = x"." || test -d "$$am__odir"      \
+  || $(MKDIR_P) "$$am__odir" || exit $$?;              \
+if test -f "./$$f"; then dir=./;                       \
+elif test -f "$$f"; then dir=;                         \
+else dir="$(srcdir)/"; fi;                             \
+tst=$$dir$$f; log='$@';                                \
+if test -n '$(DISABLE_HARD_ERRORS)'; then              \
+  am__enable_hard_errors=no;                           \
+else                                                   \
+  am__enable_hard_errors=yes;                          \
+fi;                                                    \
+case " $(XFAIL_TESTS) " in                             \
+  *[\ \        ]$$f[\ \        ]* | *[\ \      ]$$dir$$f[\ \   ]*) \
+    am__expect_failure=yes;;                           \
+  *)                                                   \
+    am__expect_failure=no;;                            \
+esac;                                                  \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed).  The result is saved in the shell variable
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.test' and 'test-trs-basic.test'.
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+       $(TEST_LOG_FLAGS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+pkglibexecdir = @pkglibexecdir@
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASCPPFLAGS = @ASCPPFLAGS@
+ASCPPPOST = @ASCPPPOST@
+ASFLAGS_config = @ASFLAGS_config@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONFIG_INCLUDE = @CONFIG_INCLUDE@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXEEXT = @EXEEXT@
+FLOAT_H = @FLOAT_H@
+GETOPT_H = @GETOPT_H@
+GLIBC21 = @GLIBC21@
+GNULIB_ACOSF = @GNULIB_ACOSF@
+GNULIB_ACOSL = @GNULIB_ACOSL@
+GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
+GNULIB_ASINF = @GNULIB_ASINF@
+GNULIB_ASINL = @GNULIB_ASINL@
+GNULIB_ATAN2F = @GNULIB_ATAN2F@
+GNULIB_ATANF = @GNULIB_ATANF@
+GNULIB_ATANL = @GNULIB_ATANL@
+GNULIB_ATOLL = @GNULIB_ATOLL@
+GNULIB_BTOWC = @GNULIB_BTOWC@
+GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CBRT = @GNULIB_CBRT@
+GNULIB_CBRTF = @GNULIB_CBRTF@
+GNULIB_CBRTL = @GNULIB_CBRTL@
+GNULIB_CEIL = @GNULIB_CEIL@
+GNULIB_CEILF = @GNULIB_CEILF@
+GNULIB_CEILL = @GNULIB_CEILL@
+GNULIB_CHDIR = @GNULIB_CHDIR@
+GNULIB_CHOWN = @GNULIB_CHOWN@
+GNULIB_CLOSE = @GNULIB_CLOSE@
+GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
+GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
+GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
+GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
+GNULIB_COSF = @GNULIB_COSF@
+GNULIB_COSHF = @GNULIB_COSHF@
+GNULIB_COSL = @GNULIB_COSL@
+GNULIB_DIRFD = @GNULIB_DIRFD@
+GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
+GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
+GNULIB_ENVIRON = @GNULIB_ENVIRON@
+GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_EXP2 = @GNULIB_EXP2@
+GNULIB_EXP2F = @GNULIB_EXP2F@
+GNULIB_EXP2L = @GNULIB_EXP2L@
+GNULIB_EXPF = @GNULIB_EXPF@
+GNULIB_EXPL = @GNULIB_EXPL@
+GNULIB_EXPM1 = @GNULIB_EXPM1@
+GNULIB_EXPM1F = @GNULIB_EXPM1F@
+GNULIB_EXPM1L = @GNULIB_EXPM1L@
+GNULIB_FABSF = @GNULIB_FABSF@
+GNULIB_FABSL = @GNULIB_FABSL@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
+GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
+GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
+GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
+GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
+GNULIB_FLOOR = @GNULIB_FLOOR@
+GNULIB_FLOORF = @GNULIB_FLOORF@
+GNULIB_FLOORL = @GNULIB_FLOORL@
+GNULIB_FMA = @GNULIB_FMA@
+GNULIB_FMAF = @GNULIB_FMAF@
+GNULIB_FMAL = @GNULIB_FMAL@
+GNULIB_FMOD = @GNULIB_FMOD@
+GNULIB_FMODF = @GNULIB_FMODF@
+GNULIB_FMODL = @GNULIB_FMODL@
+GNULIB_FOPEN = @GNULIB_FOPEN@
+GNULIB_FPRINTF = @GNULIB_FPRINTF@
+GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
+GNULIB_FPURGE = @GNULIB_FPURGE@
+GNULIB_FPUTC = @GNULIB_FPUTC@
+GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
+GNULIB_FREOPEN = @GNULIB_FREOPEN@
+GNULIB_FREXP = @GNULIB_FREXP@
+GNULIB_FREXPF = @GNULIB_FREXPF@
+GNULIB_FREXPL = @GNULIB_FREXPL@
+GNULIB_FSCANF = @GNULIB_FSCANF@
+GNULIB_FSEEK = @GNULIB_FSEEK@
+GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
+GNULIB_FSYNC = @GNULIB_FSYNC@
+GNULIB_FTELL = @GNULIB_FTELL@
+GNULIB_FTELLO = @GNULIB_FTELLO@
+GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
+GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
+GNULIB_GETCWD = @GNULIB_GETCWD@
+GNULIB_GETDELIM = @GNULIB_GETDELIM@
+GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
+GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
+GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
+GNULIB_GETLINE = @GNULIB_GETLINE@
+GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
+GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
+GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
+GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_HYPOT = @GNULIB_HYPOT@
+GNULIB_HYPOTF = @GNULIB_HYPOTF@
+GNULIB_HYPOTL = @GNULIB_HYPOTL@
+GNULIB_ILOGB = @GNULIB_ILOGB@
+GNULIB_ILOGBF = @GNULIB_ILOGBF@
+GNULIB_ILOGBL = @GNULIB_ILOGBL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
+GNULIB_ISFINITE = @GNULIB_ISFINITE@
+GNULIB_ISINF = @GNULIB_ISINF@
+GNULIB_ISNAN = @GNULIB_ISNAN@
+GNULIB_ISNAND = @GNULIB_ISNAND@
+GNULIB_ISNANF = @GNULIB_ISNANF@
+GNULIB_ISNANL = @GNULIB_ISNANL@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
+GNULIB_LCHMOD = @GNULIB_LCHMOD@
+GNULIB_LCHOWN = @GNULIB_LCHOWN@
+GNULIB_LDEXPF = @GNULIB_LDEXPF@
+GNULIB_LDEXPL = @GNULIB_LDEXPL@
+GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOG = @GNULIB_LOG@
+GNULIB_LOG10 = @GNULIB_LOG10@
+GNULIB_LOG10F = @GNULIB_LOG10F@
+GNULIB_LOG10L = @GNULIB_LOG10L@
+GNULIB_LOG1P = @GNULIB_LOG1P@
+GNULIB_LOG1PF = @GNULIB_LOG1PF@
+GNULIB_LOG1PL = @GNULIB_LOG1PL@
+GNULIB_LOG2 = @GNULIB_LOG2@
+GNULIB_LOG2F = @GNULIB_LOG2F@
+GNULIB_LOG2L = @GNULIB_LOG2L@
+GNULIB_LOGB = @GNULIB_LOGB@
+GNULIB_LOGBF = @GNULIB_LOGBF@
+GNULIB_LOGBL = @GNULIB_LOGBL@
+GNULIB_LOGF = @GNULIB_LOGF@
+GNULIB_LOGL = @GNULIB_LOGL@
+GNULIB_LSEEK = @GNULIB_LSEEK@
+GNULIB_LSTAT = @GNULIB_LSTAT@
+GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
+GNULIB_MBRLEN = @GNULIB_MBRLEN@
+GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
+GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
+GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
+GNULIB_MBSCHR = @GNULIB_MBSCHR@
+GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
+GNULIB_MBSINIT = @GNULIB_MBSINIT@
+GNULIB_MBSLEN = @GNULIB_MBSLEN@
+GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
+GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
+GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
+GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
+GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
+GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
+GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
+GNULIB_MBSSEP = @GNULIB_MBSSEP@
+GNULIB_MBSSPN = @GNULIB_MBSSPN@
+GNULIB_MBSSTR = @GNULIB_MBSSTR@
+GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
+GNULIB_MEMCHR = @GNULIB_MEMCHR@
+GNULIB_MEMMEM = @GNULIB_MEMMEM@
+GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
+GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
+GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
+GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_MODF = @GNULIB_MODF@
+GNULIB_MODFF = @GNULIB_MODFF@
+GNULIB_MODFL = @GNULIB_MODFL@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
+GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
+GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
+GNULIB_OPEN = @GNULIB_OPEN@
+GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_OPENDIR = @GNULIB_OPENDIR@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
+GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_POWF = @GNULIB_POWF@
+GNULIB_PREAD = @GNULIB_PREAD@
+GNULIB_PRINTF = @GNULIB_PRINTF@
+GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
+GNULIB_PUTC = @GNULIB_PUTC@
+GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
+GNULIB_PUTENV = @GNULIB_PUTENV@
+GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
+GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
+GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
+GNULIB_READDIR = @GNULIB_READDIR@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
+GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_REMAINDER = @GNULIB_REMAINDER@
+GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
+GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
+GNULIB_RINT = @GNULIB_RINT@
+GNULIB_RINTF = @GNULIB_RINTF@
+GNULIB_RINTL = @GNULIB_RINTL@
+GNULIB_RMDIR = @GNULIB_RMDIR@
+GNULIB_ROUND = @GNULIB_ROUND@
+GNULIB_ROUNDF = @GNULIB_ROUNDF@
+GNULIB_ROUNDL = @GNULIB_ROUNDL@
+GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANDIR = @GNULIB_SCANDIR@
+GNULIB_SCANF = @GNULIB_SCANF@
+GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
+GNULIB_SINF = @GNULIB_SINF@
+GNULIB_SINHF = @GNULIB_SINHF@
+GNULIB_SINL = @GNULIB_SINL@
+GNULIB_SLEEP = @GNULIB_SLEEP@
+GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
+GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_SQRTF = @GNULIB_SQRTF@
+GNULIB_SQRTL = @GNULIB_SQRTL@
+GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
+GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
+GNULIB_STPCPY = @GNULIB_STPCPY@
+GNULIB_STPNCPY = @GNULIB_STPNCPY@
+GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
+GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
+GNULIB_STRDUP = @GNULIB_STRDUP@
+GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
+GNULIB_STRNDUP = @GNULIB_STRNDUP@
+GNULIB_STRNLEN = @GNULIB_STRNLEN@
+GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
+GNULIB_STRSEP = @GNULIB_STRSEP@
+GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
+GNULIB_STRSTR = @GNULIB_STRSTR@
+GNULIB_STRTOD = @GNULIB_STRTOD@
+GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_STRTOLL = @GNULIB_STRTOLL@
+GNULIB_STRTOULL = @GNULIB_STRTOULL@
+GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TANF = @GNULIB_TANF@
+GNULIB_TANHF = @GNULIB_TANHF@
+GNULIB_TANL = @GNULIB_TANL@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
+GNULIB_TRUNC = @GNULIB_TRUNC@
+GNULIB_TRUNCF = @GNULIB_TRUNCF@
+GNULIB_TRUNCL = @GNULIB_TRUNCL@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
+GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
+GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
+GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
+GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
+GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
+GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
+GNULIB_VPRINTF = @GNULIB_VPRINTF@
+GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
+GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
+GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
+GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
+GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
+GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
+GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
+GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
+GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
+GREP = @GREP@
+HAVE_ACOSF = @HAVE_ACOSF@
+HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ASINF = @HAVE_ASINF@
+HAVE_ASINL = @HAVE_ASINL@
+HAVE_ATAN2F = @HAVE_ATAN2F@
+HAVE_ATANF = @HAVE_ATANF@
+HAVE_ATANL = @HAVE_ATANL@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CBRT = @HAVE_CBRT@
+HAVE_CBRTF = @HAVE_CBRTF@
+HAVE_CBRTL = @HAVE_CBRTL@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
+HAVE_COPYSIGN = @HAVE_COPYSIGN@
+HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COSF = @HAVE_COSF@
+HAVE_COSHF = @HAVE_COSHF@
+HAVE_COSL = @HAVE_COSL@
+HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
+HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
+HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
+HAVE_DECL_CBRTF = @HAVE_DECL_CBRTF@
+HAVE_DECL_CBRTL = @HAVE_DECL_CBRTL@
+HAVE_DECL_CEILF = @HAVE_DECL_CEILF@
+HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
+HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
+HAVE_DECL_COSL = @HAVE_DECL_COSL@
+HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
+HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
+HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
+HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
+HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
+HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
+HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
+HAVE_DECL_LOG2 = @HAVE_DECL_LOG2@
+HAVE_DECL_LOG2F = @HAVE_DECL_LOG2F@
+HAVE_DECL_LOG2L = @HAVE_DECL_LOG2L@
+HAVE_DECL_LOGB = @HAVE_DECL_LOGB@
+HAVE_DECL_LOGL = @HAVE_DECL_LOGL@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_REMAINDER = @HAVE_DECL_REMAINDER@
+HAVE_DECL_REMAINDERL = @HAVE_DECL_REMAINDERL@
+HAVE_DECL_RINTF = @HAVE_DECL_RINTF@
+HAVE_DECL_ROUND = @HAVE_DECL_ROUND@
+HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
+HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SINL = @HAVE_DECL_SINL@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_TANL = @HAVE_DECL_TANL@
+HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
+HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DIRENT_H = @HAVE_DIRENT_H@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXPF = @HAVE_EXPF@
+HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPM1 = @HAVE_EXPM1@
+HAVE_EXPM1F = @HAVE_EXPM1F@
+HAVE_FABSF = @HAVE_FABSF@
+HAVE_FABSL = @HAVE_FABSL@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FDOPENDIR = @HAVE_FDOPENDIR@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FMA = @HAVE_FMA@
+HAVE_FMAF = @HAVE_FMAF@
+HAVE_FMAL = @HAVE_FMAL@
+HAVE_FMODF = @HAVE_FMODF@
+HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREXPF = @HAVE_FREXPF@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_HYPOTF = @HAVE_HYPOTF@
+HAVE_HYPOTL = @HAVE_HYPOTL@
+HAVE_ILOGB = @HAVE_ILOGB@
+HAVE_ILOGBF = @HAVE_ILOGBF@
+HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISNAND = @HAVE_ISNAND@
+HAVE_ISNANF = @HAVE_ISNANF@
+HAVE_ISNANL = @HAVE_ISNANL@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LDEXPF = @HAVE_LDEXPF@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_LOG10F = @HAVE_LOG10F@
+HAVE_LOG10L = @HAVE_LOG10L@
+HAVE_LOG1P = @HAVE_LOG1P@
+HAVE_LOG1PF = @HAVE_LOG1PF@
+HAVE_LOG1PL = @HAVE_LOG1PL@
+HAVE_LOGBF = @HAVE_LOGBF@
+HAVE_LOGBL = @HAVE_LOGBL@
+HAVE_LOGF = @HAVE_LOGF@
+HAVE_LOGL = @HAVE_LOGL@
+HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
+HAVE_LSTAT = @HAVE_LSTAT@
+HAVE_MBRLEN = @HAVE_MBRLEN@
+HAVE_MBRTOWC = @HAVE_MBRTOWC@
+HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
+HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
+HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
+HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MODFF = @HAVE_MODFF@
+HAVE_MODFL = @HAVE_MODFL@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OPENDIR = @HAVE_OPENDIR@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POWF = @HAVE_POWF@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READDIR = @HAVE_READDIR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_REMAINDER = @HAVE_REMAINDER@
+HAVE_REMAINDERF = @HAVE_REMAINDERF@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_REWINDDIR = @HAVE_REWINDDIR@
+HAVE_RINT = @HAVE_RINT@
+HAVE_RINTL = @HAVE_RINTL@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
+HAVE_SCANDIR = @HAVE_SCANDIR@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
+HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
+HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
+HAVE_SINF = @HAVE_SINF@
+HAVE_SINHF = @HAVE_SINHF@
+HAVE_SINL = @HAVE_SINL@
+HAVE_SLEEP = @HAVE_SLEEP@
+HAVE_SQRTF = @HAVE_SQRTF@
+HAVE_SQRTL = @HAVE_SQRTL@
+HAVE_STDINT_H = @HAVE_STDINT_H@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCASESTR = @HAVE_STRCASESTR@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOULL = @HAVE_STRTOULL@
+HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
+HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
+HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TANF = @HAVE_TANF@
+HAVE_TANHF = @HAVE_TANHF@
+HAVE_TANL = @HAVE_TANL@
+HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_UNISTD_H = @HAVE_UNISTD_H@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
+HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_VASPRINTF = @HAVE_VASPRINTF@
+HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
+HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+IGNORE_UNUSED_LIBRARIES_CFLAGS = @IGNORE_UNUSED_LIBRARIES_CFLAGS@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBGZIP_LIBDEPS = @LIBGZIP_LIBDEPS@
+LIBGZIP_LTLIBDEPS = @LIBGZIP_LTLIBDEPS@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
+LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_DIRENT_H = @NEXT_DIRENT_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
+NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
+NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
+RANLIB = @RANLIB@
+REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
+REPLACE_CBRTF = @REPLACE_CBRTF@
+REPLACE_CBRTL = @REPLACE_CBRTL@
+REPLACE_CEIL = @REPLACE_CEIL@
+REPLACE_CEILF = @REPLACE_CEILF@
+REPLACE_CEILL = @REPLACE_CEILL@
+REPLACE_CHOWN = @REPLACE_CHOWN@
+REPLACE_CLOSE = @REPLACE_CLOSE@
+REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
+REPLACE_DIRFD = @REPLACE_DIRFD@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_EXP2 = @REPLACE_EXP2@
+REPLACE_EXP2L = @REPLACE_EXP2L@
+REPLACE_EXPM1 = @REPLACE_EXPM1@
+REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FLOOR = @REPLACE_FLOOR@
+REPLACE_FLOORF = @REPLACE_FLOORF@
+REPLACE_FLOORL = @REPLACE_FLOORL@
+REPLACE_FMA = @REPLACE_FMA@
+REPLACE_FMAF = @REPLACE_FMAF@
+REPLACE_FMAL = @REPLACE_FMAL@
+REPLACE_FMOD = @REPLACE_FMOD@
+REPLACE_FMODF = @REPLACE_FMODF@
+REPLACE_FMODL = @REPLACE_FMODL@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FREXP = @REPLACE_FREXP@
+REPLACE_FREXPF = @REPLACE_FREXPF@
+REPLACE_FREXPL = @REPLACE_FREXPL@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
+REPLACE_HYPOT = @REPLACE_HYPOT@
+REPLACE_HYPOTF = @REPLACE_HYPOTF@
+REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ILOGB = @REPLACE_ILOGB@
+REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISFINITE = @REPLACE_ISFINITE@
+REPLACE_ISINF = @REPLACE_ISINF@
+REPLACE_ISNAN = @REPLACE_ISNAN@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
+REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ITOLD = @REPLACE_ITOLD@
+REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LDEXPL = @REPLACE_LDEXPL@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
+REPLACE_LOG = @REPLACE_LOG@
+REPLACE_LOG10 = @REPLACE_LOG10@
+REPLACE_LOG10F = @REPLACE_LOG10F@
+REPLACE_LOG10L = @REPLACE_LOG10L@
+REPLACE_LOG1P = @REPLACE_LOG1P@
+REPLACE_LOG1PF = @REPLACE_LOG1PF@
+REPLACE_LOG1PL = @REPLACE_LOG1PL@
+REPLACE_LOG2 = @REPLACE_LOG2@
+REPLACE_LOG2F = @REPLACE_LOG2F@
+REPLACE_LOG2L = @REPLACE_LOG2L@
+REPLACE_LOGB = @REPLACE_LOGB@
+REPLACE_LOGBF = @REPLACE_LOGBF@
+REPLACE_LOGBL = @REPLACE_LOGBL@
+REPLACE_LOGF = @REPLACE_LOGF@
+REPLACE_LOGL = @REPLACE_LOGL@
+REPLACE_LSEEK = @REPLACE_LSEEK@
+REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
+REPLACE_MBRLEN = @REPLACE_MBRLEN@
+REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
+REPLACE_MBSINIT = @REPLACE_MBSINIT@
+REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
+REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
+REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
+REPLACE_MEMCHR = @REPLACE_MEMCHR@
+REPLACE_MEMMEM = @REPLACE_MEMMEM@
+REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_MODF = @REPLACE_MODF@
+REPLACE_MODFF = @REPLACE_MODFF@
+REPLACE_MODFL = @REPLACE_MODFL@
+REPLACE_NAN = @REPLACE_NAN@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_OPENDIR = @REPLACE_OPENDIR@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
+REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
+REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMAINDER = @REPLACE_REMAINDER@
+REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
+REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_ROUND = @REPLACE_ROUND@
+REPLACE_ROUNDF = @REPLACE_ROUNDF@
+REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
+REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
+REPLACE_SLEEP = @REPLACE_SLEEP@
+REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
+REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_SQRTL = @REPLACE_SQRTL@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
+REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
+REPLACE_STRDUP = @REPLACE_STRDUP@
+REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCF = @REPLACE_TRUNCF@
+REPLACE_TRUNCL = @REPLACE_TRUNCL@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
+UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+lispdir = @lispdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+TESTS = \
+  helin-segv                           \
+  help-version                         \
+  hufts                                        \
+  memcpy-abuse                         \
+  mixed                                        \
+  null-suffix-clobber                  \
+  stdin                                        \
+  trailing-nul                         \
+  zdiff                                        \
+  zgrep-f                              \
+  zgrep-signal                         \
+  znew-k
+
+EXTRA_DIST = \
+  $(TESTS)                             \
+  init.cfg                             \
+  init.sh                              \
+  hufts-segv.gz
+
+built_programs = \
+  gzip         \
+  gunzip       \
+  gzexe                \
+  zcat         \
+  zcmp         \
+  zdiff                \
+  zegrep       \
+  zfgrep       \
+  zforce       \
+  zgrep                \
+  zless                \
+  zmore                \
+  znew
+
+TESTS_ENVIRONMENT = \
+  tmp__=$$TMPDIR; test -d "$$tmp__" || tmp__=.;        \
+  TMPDIR=$$tmp__; export TMPDIR;               \
+  shell_or_perl_() {                           \
+    if grep '^\#!/usr/bin/perl' "$$1" > /dev/null; then                        \
+      if $(PERL) -e 'use warnings' > /dev/null 2>&1; then              \
+       grep '^\#!/usr/bin/perl -T' "$$1" > /dev/null && T_=T || T_=;   \
+        $(PERL) -w$$T_ -I$(srcdir) -MCoreutils                         \
+             -M"CuTmpdir qw($$f)" -- "$$1";    \
+      else                                     \
+       echo 1>&2 "$$tst: configure did not find a usable version of Perl," \
+         "so skipping this test";              \
+       (exit 77);                              \
+      fi;                                      \
+    else                                       \
+      $(SHELL) "$$1";                          \
+    fi;                                                \
+  };                                           \
+  export                                       \
+  LC_ALL=C                                     \
+  VERSION=$(VERSION)                           \
+  abs_top_builddir='$(abs_top_builddir)'       \
+  abs_top_srcdir='$(abs_top_srcdir)'           \
+  abs_srcdir='$(abs_srcdir)'                   \
+  built_programs='$(built_programs)'           \
+  srcdir='$(srcdir)'                           \
+  top_srcdir='$(top_srcdir)'                   \
+  CC='$(CC)'                                   \
+  GZIP_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'` \
+  MAKE=$(MAKE)                                 \
+  PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)'     \
+  PACKAGE_VERSION=$(PACKAGE_VERSION)           \
+  PERL='$(PERL)'                               \
+  SHELL='$(SHELL)'                             \
+  PATH='$(abs_top_builddir)$(PATH_SEPARATOR)'"$$PATH" \
+  ; 9>&2
+
+VERBOSE = yes
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .log .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+cscope cscopelist:
+
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+       rm -f $< $@
+       $(MAKE) $(AM_MAKEFLAGS) $<
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+       @$(am__set_TESTS_bases); \
+       am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+       redo_bases=`for i in $$bases; do \
+                     am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+                   done`; \
+       if test -n "$$redo_bases"; then \
+         redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+         redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+         if $(am__make_dryrun); then :; else \
+           rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+         fi; \
+       fi; \
+       if test -n "$$am__remaking_logs"; then \
+         echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+              "recursion detected" >&2; \
+       else \
+         am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+       fi; \
+       if $(am__make_dryrun); then :; else \
+         st=0;  \
+         errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+         for i in $$redo_bases; do \
+           test -f $$i.trs && test -r $$i.trs \
+             || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+           test -f $$i.log && test -r $$i.log \
+             || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+         done; \
+         test $$st -eq 0 || exit 1; \
+       fi
+       @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+       ws='[   ]'; \
+       results=`for b in $$bases; do echo $$b.trs; done`; \
+       test -n "$$results" || results=/dev/null; \
+       all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+       pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+       fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+       skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+       xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+       xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+       error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+       if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+         success=true; \
+       else \
+         success=false; \
+       fi; \
+       br='==================='; br=$$br$$br$$br$$br; \
+       result_count () \
+       { \
+           if test x"$$1" = x"--maybe-color"; then \
+             maybe_colorize=yes; \
+           elif test x"$$1" = x"--no-color"; then \
+             maybe_colorize=no; \
+           else \
+             echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+           fi; \
+           shift; \
+           desc=$$1 count=$$2; \
+           if test $$maybe_colorize = yes && test $$count -gt 0; then \
+             color_start=$$3 color_end=$$std; \
+           else \
+             color_start= color_end=; \
+           fi; \
+           echo "$${color_start}# $$desc $$count$${color_end}"; \
+       }; \
+       create_testsuite_report () \
+       { \
+         result_count $$1 "TOTAL:" $$all   "$$brg"; \
+         result_count $$1 "PASS: " $$pass  "$$grn"; \
+         result_count $$1 "SKIP: " $$skip  "$$blu"; \
+         result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+         result_count $$1 "FAIL: " $$fail  "$$red"; \
+         result_count $$1 "XPASS:" $$xpass "$$red"; \
+         result_count $$1 "ERROR:" $$error "$$mgn"; \
+       }; \
+       {                                                               \
+         echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |       \
+           $(am__rst_title);                                           \
+         create_testsuite_report --no-color;                           \
+         echo;                                                         \
+         echo ".. contents:: :depth: 2";                               \
+         echo;                                                         \
+         for b in $$bases; do echo $$b; done                           \
+           | $(am__create_global_log);                                 \
+       } >$(TEST_SUITE_LOG).tmp || exit 1;                             \
+       mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);                     \
+       if $$success; then                                              \
+         col="$$grn";                                                  \
+        else                                                           \
+         col="$$red";                                                  \
+         test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);               \
+       fi;                                                             \
+       echo "$${col}$$br$${std}";                                      \
+       echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";   \
+       echo "$${col}$$br$${std}";                                      \
+       create_testsuite_report --maybe-color;                          \
+       echo "$$col$$br$$std";                                          \
+       if $$success; then :; else                                      \
+         echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";         \
+         if test -n "$(PACKAGE_BUGREPORT)"; then                       \
+           echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+         fi;                                                           \
+         echo "$$col$$br$$std";                                        \
+       fi;                                                             \
+       $$success || exit 1
+
+check-TESTS recheck:
+       @if test $@ != recheck; then \
+          list='$(RECHECK_LOGS)'; \
+          test -z "$$list" || rm -f $$list; \
+        fi
+       @if test $@ != recheck; then \
+          list='$(RECHECK_LOGS:.log=.trs)'; \
+          test -z "$$list" || rm -f $$list; \
+        fi
+       @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+       @$(am__set_TESTS_bases); \
+       if test $@ = recheck; then \
+         bases=`for i in $$bases; do echo $$i; done \
+                  | $(am__list_recheck_tests)` || exit 1; \
+       fi; \
+       log_list=`for i in $$bases; do echo $$i.log; done`; \
+       trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+       log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+       if test $@ != recheck || $(am__make_dryrun); then :; else \
+         test -z "$$log_list" || rm -f $$log_list; \
+         test -z "$$trs_list" || rm -f $$trs_list; \
+       fi; \
+       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"
+recheck: all 
+helin-segv.log: helin-segv
+       @p='helin-segv'; \
+       b='helin-segv'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+help-version.log: help-version
+       @p='help-version'; \
+       b='help-version'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+hufts.log: hufts
+       @p='hufts'; \
+       b='hufts'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+memcpy-abuse.log: memcpy-abuse
+       @p='memcpy-abuse'; \
+       b='memcpy-abuse'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+mixed.log: mixed
+       @p='mixed'; \
+       b='mixed'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+null-suffix-clobber.log: null-suffix-clobber
+       @p='null-suffix-clobber'; \
+       b='null-suffix-clobber'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+stdin.log: stdin
+       @p='stdin'; \
+       b='stdin'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+trailing-nul.log: trailing-nul
+       @p='trailing-nul'; \
+       b='trailing-nul'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+zdiff.log: zdiff
+       @p='zdiff'; \
+       b='zdiff'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+zgrep-f.log: zgrep-f
+       @p='zgrep-f'; \
+       b='zgrep-f'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+zgrep-signal.log: zgrep-signal
+       @p='zgrep-signal'; \
+       b='zgrep-signal'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+znew-k.log: znew-k
+       @p='znew-k'; \
+       b='znew-k'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+       @p='$<'; \
+       $(am__set_b); \
+       $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@      @p='$<'; \
+@am__EXEEXT_TRUE@      $(am__set_b); \
+@am__EXEEXT_TRUE@      $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@      --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@      $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@      "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+       -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+       -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+       -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+       distclean distclean-generic distdir dvi dvi-am html html-am \
+       info info-am install install-am install-data install-data-am \
+       install-dvi install-dvi-am install-exec install-exec-am \
+       install-html install-html-am install-info install-info-am \
+       install-man install-pdf install-pdf-am install-ps \
+       install-ps-am install-strip installcheck installcheck-am \
+       installdirs maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic pdf pdf-am ps ps-am recheck \
+       uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
index d6b14f6d167b55a496409407082934d62d53819b..20dfed1761d97e6c36bff6d746eb206eb8e7c1f6 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Before gzip-1.4, gzip -d would segfault on some inputs.
 
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2010-2012 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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # limit so don't run it by default.
 
-if test "$VERBOSE" = yes; then
-  set -x
-  gzip --version
-fi
-
-: ${srcdir=.}
-. "$srcdir/tests/init.sh"; path_prepend_ .
+. "${srcdir=.}/init.sh"; path_prepend_ ..
 
 # This test case was provided by Aki Helin.
-printf '\037\235\220\0\0\0\304' > helin.gz || framework_failure
-printf '\0\0' > exp || framework_failure
+printf '\037\235\220\0\0\0\304' > helin.gz || framework_failure_
+printf '\0\0' > exp || framework_failure_
 
 fail=0
 
 gzip -dc helin.gz > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
 
 Exit $fail
diff --git a/tests/help-version b/tests/help-version
new file mode 100755 (executable)
index 0000000..3c7229b
--- /dev/null
@@ -0,0 +1,269 @@
+#! /bin/sh
+# Make sure all these programs work properly
+# when invoked with --help or --version.
+
+# Copyright (C) 2000-2012 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
+# the Free Software Foundation, either version 3 of the License, 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Ensure that $SHELL is set to *some* value and exported.
+# This is required for dircolors, which would fail e.g., when
+# invoked via debuild (which removes SHELL from the environment).
+test "x$SHELL" = x && SHELL=/bin/sh
+export SHELL
+
+. "${srcdir=.}/init.sh"; path_prepend_ ..
+
+expected_failure_status_chroot=125
+expected_failure_status_env=125
+expected_failure_status_nice=125
+expected_failure_status_nohup=125
+expected_failure_status_stdbuf=125
+expected_failure_status_su=125
+expected_failure_status_timeout=125
+expected_failure_status_printenv=2
+expected_failure_status_tty=3
+expected_failure_status_sort=2
+expected_failure_status_expr=3
+expected_failure_status_lbracket=2
+expected_failure_status_dir=2
+expected_failure_status_ls=2
+expected_failure_status_vdir=2
+
+expected_failure_status_cmp=2
+expected_failure_status_zcmp=2
+expected_failure_status_sdiff=2
+expected_failure_status_diff3=2
+expected_failure_status_diff=2
+expected_failure_status_zdiff=2
+expected_failure_status_zgrep=2
+expected_failure_status_zegrep=2
+expected_failure_status_zfgrep=2
+
+expected_failure_status_grep=2
+expected_failure_status_egrep=2
+expected_failure_status_fgrep=2
+
+test "$built_programs" \
+  || fail_ "built_programs not specified!?!"
+
+test "$VERSION" \
+  || fail_ "set envvar VERSION; it is required for a PATH sanity-check"
+
+# Extract version from --version output of the first program
+for i in $built_programs; do
+  v=$(env $i --version | sed -n '1s/.* //p;q')
+  break
+done
+
+# Ensure that it matches $VERSION.
+test "x$v" = "x$VERSION" \
+  || fail_ "--version-\$VERSION mismatch"
+
+for lang in C fr da; do
+  for i in $built_programs; do
+
+    # Skip `test'; it doesn't accept --help or --version.
+    test $i = test && continue;
+
+    # false fails even when invoked with --help or --version.
+    if test $i = false; then
+      env LC_MESSAGES=$lang $i --help >/dev/null && fail=1
+      env LC_MESSAGES=$lang $i --version >/dev/null && fail=1
+      continue
+    fi
+
+    # The just-built install executable is always named `ginstall'.
+    test $i = install && i=ginstall
+
+    # Make sure they exit successfully, under normal conditions.
+    env $i --help    > h-$i     || fail=1
+    env $i --version >/dev/null || fail=1
+
+    # Make sure they mention the bug-reporting address in --help output.
+    grep "$PACKAGE_BUGREPORT" h-$i > /dev/null || fail=1
+    rm -f h-$i
+
+    # Make sure they fail upon `disk full' error.
+    if test -w /dev/full && test -c /dev/full; then
+      env $i --help    >/dev/full 2>/dev/null && fail=1
+      env $i --version >/dev/full 2>/dev/null && fail=1
+      status=$?
+      test $i = [ && prog=lbracket || prog=$i
+      eval "expected=\$expected_failure_status_$prog"
+      test x$expected = x && expected=1
+      if test $status = $expected; then
+        : # ok
+      else
+        fail=1
+        echo "*** $i: bad exit status \`$status' (expected $expected)," 1>&2
+        echo "  with --help or --version output redirected to /dev/full" 1>&2
+      fi
+    fi
+  done
+done
+
+bigZ_in=bigZ-in.Z
+zin=zin.gz
+zin2=zin2.gz
+
+tmp=tmp-$$
+tmp_in=in-$$
+tmp_in2=in2-$$
+tmp_dir=dir-$$
+tmp_out=out-$$
+mkdir $tmp || fail=1
+cd $tmp || fail=1
+
+comm_setup () { args="$tmp_in $tmp_in"; }
+csplit_setup () { args="$tmp_in //"; }
+cut_setup () { args='-f 1'; }
+join_setup () { args="$tmp_in $tmp_in"; }
+tr_setup () { args='a a'; }
+
+chmod_setup () { args="a+x $tmp_in"; }
+# Punt on these.
+chgrp_setup () { args=--version; }
+chown_setup () { args=--version; }
+mkfifo_setup () { args=--version; }
+mknod_setup () { args=--version; }
+# Punt on uptime, since it fails (e.g., failing to get boot time)
+# on some systems, and we shouldn't let that stop `make check'.
+uptime_setup () { args=--version; }
+
+# Create a file in the current directory, not in $TMPDIR.
+mktemp_setup () { args=mktemp.XXXX; }
+
+cmp_setup () { args="$tmp_in $tmp_in2"; }
+
+# Tell dd not to print the line with transfer rate and total.
+# The transfer rate would vary between runs.
+dd_setup () { args=status=noxfer; }
+
+zdiff_setup () { args="$zin $zin2"; }
+zcmp_setup () { args="$zin $zin2"; }
+zcat_setup () { args=$zin; }
+gunzip_setup () { args=$zin; }
+zmore_setup () { args=$zin; }
+zless_setup () { args=$zin; }
+znew_setup () { args=$bigZ_in; }
+zforce_setup () { args=$zin; }
+zgrep_setup () { args="z $zin"; }
+zegrep_setup () { args="z $zin"; }
+zfgrep_setup () { args="z $zin"; }
+gzexe_setup () { args=$tmp_in; }
+
+# We know that $tmp_in contains a "0"
+grep_setup () { args="0 $tmp_in"; }
+egrep_setup () { args="0 $tmp_in"; }
+fgrep_setup () { args="0 $tmp_in"; }
+
+diff_setup () { args="$tmp_in $tmp_in2"; }
+sdiff_setup () { args="$tmp_in $tmp_in2"; }
+diff3_setup () { args="$tmp_in $tmp_in2 $tmp_in2"; }
+cp_setup () { args="$tmp_in $tmp_in2"; }
+ln_setup () { args="$tmp_in ln-target"; }
+ginstall_setup () { args="$tmp_in $tmp_in2"; }
+mv_setup () { args="$tmp_in $tmp_in2"; }
+mkdir_setup () { args=$tmp_dir/subdir; }
+rmdir_setup () { args=$tmp_dir; }
+rm_setup () { args=$tmp_in; }
+shred_setup () { args=$tmp_in; }
+touch_setup () { args=$tmp_in2; }
+truncate_setup () { args="--reference=$tmp_in $tmp_in2"; }
+
+basename_setup () { args=$tmp_in; }
+dirname_setup () { args=$tmp_in; }
+expr_setup () { args=foo; }
+
+# Punt, in case GNU `id' hasn't been installed yet.
+groups_setup () { args=--version; }
+
+pathchk_setup () { args=$tmp_in; }
+yes_setup () { args=--version; }
+logname_setup () { args=--version; }
+nohup_setup () { args=--version; }
+printf_setup () { args=foo; }
+seq_setup () { args=10; }
+sleep_setup () { args=0; }
+su_setup () { args=--version; }
+stdbuf_setup () { args="-oL true"; }
+timeout_setup () { args=--version; }
+
+# I'd rather not run sync, since it spins up disks that I've
+# deliberately caused to spin down (but not unmounted).
+sync_setup () { args=--version; }
+
+test_setup () { args=foo; }
+
+# This is necessary in the unusual event that there is
+# no valid entry in /etc/mtab.
+df_setup () { args=/; }
+
+# This is necessary in the unusual event that getpwuid (getuid ()) fails.
+id_setup () { args=-u; }
+
+# Use env to avoid invoking built-in sleep of Solaris 11's /bin/sh.
+kill_setup () {
+  env sleep 10m &
+  args=$!
+}
+
+link_setup () { args="$tmp_in link-target"; }
+unlink_setup () { args=$tmp_in; }
+
+readlink_setup () {
+  ln -s . slink
+  args=slink;
+}
+
+stat_setup () { args=$tmp_in; }
+unlink_setup () { args=$tmp_in; }
+lbracket_setup () { args=": ]"; }
+
+# Ensure that each program "works" (exits successfully) when doing
+# something more than --help or --version.
+for i in $built_programs; do
+  # Skip these.
+  case $i in chroot|stty|tty|false|chcon|runcon) continue;; esac
+
+  rm -rf $tmp_in $tmp_in2 $tmp_dir $tmp_out $bigZ_in $zin $zin2
+  echo z |gzip > $zin
+  cp $zin $zin2
+  cp $zin $bigZ_in
+
+  # This is sort of kludgey: use numbers so this is valid input for factor,
+  # and two tokens so it's valid input for tsort.
+  echo 2147483647 0 > $tmp_in
+  # Make $tmp_in2 identical. Then, using $tmp_in and $tmp_in2 as arguments
+  # to the likes of cmp and diff makes them exit successfully.
+  cp $tmp_in $tmp_in2
+  mkdir $tmp_dir
+  # echo ================== $i
+  test $i = [ && prog=lbracket || prog=$i
+  if type ${prog}_setup > /dev/null 2>&1; then
+    ${prog}_setup
+  else
+    args=
+  fi
+  if env $i $args < $tmp_in > $tmp_out; then
+    : # ok
+  else
+    echo FAIL: $i
+    fail=1
+  fi
+  rm -rf $tmp_in $tmp_in2 $tmp_out $tmp_dir
+done
+
+Exit $fail
diff --git a/tests/hufts b/tests/hufts
new file mode 100755 (executable)
index 0000000..08fb565
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Exercise a bug whereby an invalid input could make gzip -d misbehave.
+
+# Copyright (C) 2009-2012 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
+# the Free Software Foundation, either version 3 of the License, 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# limit so don't run it by default.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ..
+
+printf '\n...: invalid compressed data--format violated\n' > exp \
+  || framework_failure_
+
+fail=0
+gzip -dc "$abs_srcdir/hufts-segv.gz" > out 2> err
+test $? = 1 || fail=1
+
+compare /dev/null out || fail=1
+
+sed 's/.*hufts-segv.gz: /...: /' err > k; mv k err || fail=1
+compare exp err || fail=1
+
+Exit $fail
diff --git a/tests/init.cfg b/tests/init.cfg
new file mode 100644 (file)
index 0000000..5adfc9b
--- /dev/null
@@ -0,0 +1,20 @@
+# This file is sourced by init.sh, *before* its initialization.
+
+# This goes hand in hand with the "exec 9>&2;" in Makefile.am's
+# TESTS_ENVIRONMENT definition.
+stderr_fileno_=9
+
+require_POSIX_grep_()
+{
+  # Ensure that grep's -f and -E options works.
+  # On Solaris 5.11, "grep -f" prints this:
+  #   grep: illegal option -- f
+  #   Usage: grep -hblcnsviw pattern file . . .
+  # Similar for grep -E.
+
+  : | grep -f /dev/null
+  test $? = 1 || skip_ 'your grep lacks support for -f -'
+
+  grep -E foo /dev/null
+  test $? = 1 || skip_ 'your grep lacks support for -E'
+}
index 979eb3c478afc94af52d1eb04737b85897672e2b..f525a7cab4c197d7ef80fcf9a6830e4b712df524 100644 (file)
@@ -1,6 +1,6 @@
 # source this file; set up for tests
 
-# Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 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
 # The typical skeleton of a test looks like this:
 #
 #   #!/bin/sh
-#   : ${srcdir=.}
-#   . "$srcdir/init.sh"; path_prepend_ .
+#   . "${srcdir=.}/init.sh"; path_prepend_ .
 #   Execute some commands.
 #   Note that these commands are executed in a subdirectory, therefore you
 #   need to prepend "../" to relative filenames in the build directory.
+#   Note that the "path_prepend_ ." is useful only if the body of your
+#   test invokes programs residing in the initial directory.
+#   For example, if the programs you want to test are in src/, and this test
+#   script is named tests/test-1, then you would use "path_prepend_ ../src",
+#   or perhaps export PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH"
+#   to all tests via automake's TESTS_ENVIRONMENT.
 #   Set the exit code 0 for success, 77 for skipped, or 1 or other for failure.
 #   Use the skip_ and fail_ functions to print a diagnostic and then exit
 #   with the corresponding exit code.
 #   4. Finally
 #   $ exit
 
+ME_=`expr "./$0" : '.*/\(.*\)$'`
+
 # We use a trap below for cleanup.  This requires us to go through
 # hoops to get the right exit status transported through the handler.
-# So use `Exit STATUS' instead of `exit STATUS' inside of the tests.
+# So use 'Exit STATUS' instead of 'exit STATUS' inside of the tests.
 # Turn off errexit here so that we don't trip the bug with OSF1/Tru64
 # sh inside this function.
 Exit () { set +e; (exit $1); exit $1; }
 
-fail_() { echo "$ME_: failed test: $@" 1>&2; Exit 1; }
-skip_() { echo "$ME_: skipped test: $@" 1>&2; Exit 77; }
+# Print warnings (e.g., about skipped and failed tests) to this file number.
+# Override by defining to say, 9, in init.cfg, and putting say,
+#   export ...ENVVAR_SETTINGS...; $(SHELL) 9>&2
+# in the definition of TESTS_ENVIRONMENT in your tests/Makefile.am file.
+# This is useful when using automake's parallel tests mode, to print
+# the reason for skip/failure to console, rather than to the .log files.
+: ${stderr_fileno_=2}
+
+# Note that correct expansion of "$*" depends on IFS starting with ' '.
+# Always write the full diagnostic to stderr.
+# When stderr_fileno_ is not 2, also emit the first line of the
+# diagnostic to that file descriptor.
+warn_ ()
+{
+  # If IFS does not start with ' ', set it and emit the warning in a subshell.
+  case $IFS in
+    ' '*) printf '%s\n' "$*" >&2
+          test $stderr_fileno_ = 2 \
+            || { printf '%s\n' "$*" | sed 1q >&$stderr_fileno_ ; } ;;
+    *) (IFS=' '; warn_ "$@");;
+  esac
+}
+fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
+skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
+fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; }
+framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; }
+
+# Sanitize this shell to POSIX mode, if possible.
+DUALCASE=1; export DUALCASE
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+    *posix*) set -o posix ;;
+  esac
+fi
+
+# We require $(...) support unconditionally.
+# We require a few additional shell features only when $EXEEXT is nonempty,
+# in order to support automatic $EXEEXT emulation:
+# - hyphen-containing alias names
+# - we prefer to use ${var#...} substitution, rather than having
+#   to work around lack of support for that feature.
+# The following code attempts to find a shell with support for these features.
+# If the current shell passes the test, we're done.  Otherwise, test other
+# shells until we find one that passes.  If one is found, re-exec it.
+# If no acceptable shell is found, skip the current test.
+#
+# The "...set -x; P=1 true 2>err..." test is to disqualify any shell that
+# emits "P=1" into err, as /bin/sh from SunOS 5.11 and OpenBSD 4.7 do.
+#
+# Use "9" to indicate success (rather than 0), in case some shell acts
+# like Solaris 10's /bin/sh but exits successfully instead of with status 2.
+
+# Eval this code in a subshell to determine a shell's suitability.
+# 10 - passes all tests; ok to use
+#  9 - ok, but enabling "set -x" corrupts app stderr; prefer higher score
+#  ? - not ok
+gl_shell_test_script_='
+test $(echo y) = y || exit 1
+score_=10
+if test "$VERBOSE" = yes; then
+  test -n "$( (exec 3>&1; set -x; P=1 true 2>&3) 2> /dev/null)" && score_=9
+fi
+test -z "$EXEEXT" && exit $score_
+shopt -s expand_aliases
+alias a-b="echo zoo"
+v=abx
+     test ${v%x} = ab \
+  && test ${v#a} = bx \
+  && test $(a-b) = zoo \
+  && exit $score_
+'
+
+if test "x$1" = "x--no-reexec"; then
+  shift
+else
+  # Assume a working shell.  Export to subshells (setup_ needs this).
+  gl_set_x_corrupts_stderr_=false
+  export gl_set_x_corrupts_stderr_
+
+  # Record the first marginally acceptable shell.
+  marginal_=
+
+  # Search for a shell that meets our requirements.
+  for re_shell_ in __current__ "${CONFIG_SHELL:-no_shell}" \
+      /bin/sh bash dash zsh pdksh fail
+  do
+    test "$re_shell_" = no_shell && continue
+
+    # If we've made it all the way to the sentinel, "fail" without
+    # finding even a marginal shell, skip this test.
+    if test "$re_shell_" = fail; then
+      test -z "$marginal_" && skip_ failed to find an adequate shell
+      re_shell_=$marginal_
+      break
+    fi
+
+    # When testing the current shell, simply "eval" the test code.
+    # Otherwise, run it via $re_shell_ -c ...
+    if test "$re_shell_" = __current__; then
+      # 'eval'ing this code makes Solaris 10's /bin/sh exit with
+      # $? set to 2.  It does not evaluate any of the code after the
+      # "unexpected" first '('.  Thus, we must run it in a subshell.
+      ( eval "$gl_shell_test_script_" ) > /dev/null 2>&1
+    else
+      "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null
+    fi
+
+    st_=$?
+
+    # $re_shell_ works just fine.  Use it.
+    if test $st_ = 10; then
+      gl_set_x_corrupts_stderr_=false
+      break
+    fi
+
+    # If this is our first marginally acceptable shell, remember it.
+    if test "$st_:$marginal_" = 9: ; then
+      marginal_="$re_shell_"
+      gl_set_x_corrupts_stderr_=true
+    fi
+  done
+
+  if test "$re_shell_" != __current__; then
+    # Found a usable shell.  Preserve -v and -x.
+    case $- in
+      *v*x* | *x*v*) opts_=-vx ;;
+      *v*) opts_=-v ;;
+      *x*) opts_=-x ;;
+      *) opts_= ;;
+    esac
+    exec "$re_shell_" $opts_ "$0" --no-reexec "$@"
+    echo "$ME_: exec failed" 1>&2
+    exit 127
+  fi
+fi
+
+# If this is bash, turn off all aliases.
+test -n "$BASH_VERSION" && unalias -a
+
+# Note that when supporting $EXEEXT (transparently mapping from PROG_NAME to
+# PROG_NAME.exe), we want to support hyphen-containing names like test-acos.
+# That is part of the shell-selection test above.  Why use aliases rather
+# than functions?  Because support for hyphen-containing aliases is more
+# widespread than that for hyphen-containing function names.
+test -n "$EXEEXT" && shopt -s expand_aliases
+
+# Enable glibc's malloc-perturbing option.
+# This is useful for exposing code that depends on the fact that
+# malloc-related functions often return memory that is mostly zeroed.
+# If you have the time and cycles, use valgrind to do an even better job.
+: ${MALLOC_PERTURB_=87}
+export MALLOC_PERTURB_
 
 # This is a stub function that is run upon trap (upon regular exit and
 # interrupt).  Override it with a per-test function, e.g., to unmount
 # a partition, or to undo any other global state changes.
-cleanup_() { :; }
+cleanup_ () { :; }
+
+# Emit a header similar to that from diff -u;  Print the simulated "diff"
+# command so that the order of arguments is clear.  Don't bother with @@ lines.
+emit_diff_u_header_ ()
+{
+  printf '%s\n' "diff -u $*" \
+    "--- $1    1970-01-01" \
+    "+++ $2    1970-01-01"
+}
+
+# Arrange not to let diff or cmp operate on /dev/null,
+# since on some systems (at least OSF/1 5.1), that doesn't work.
+# When there are not two arguments, or no argument is /dev/null, return 2.
+# When one argument is /dev/null and the other is not empty,
+# cat the nonempty file to stderr and return 1.
+# Otherwise, return 0.
+compare_dev_null_ ()
+{
+  test $# = 2 || return 2
+
+  if test "x$1" = x/dev/null; then
+    test -s "$2" || return 0
+    emit_diff_u_header_ "$@"; sed 's/^/+/' "$2"
+    return 1
+  fi
+
+  if test "x$2" = x/dev/null; then
+    test -s "$1" || return 0
+    emit_diff_u_header_ "$@"; sed 's/^/-/' "$1"
+    return 1
+  fi
 
-if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
-  compare() { diff -u "$@"; }
-elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
-  compare() { cmp -s "$@"; }
+  return 2
+}
+
+if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
+   && diff -u Makefile "$0" 2>/dev/null | grep '^[+]#!' >/dev/null; then
+  # diff accepts the -u option and does not (like AIX 7 'diff') produce an
+  # extra space on column 1 of every content line.
+  if test -z "$diff_out_"; then
+    compare_ () { diff -u "$@"; }
+  else
+    compare_ ()
+    {
+      if diff -u "$@" > diff.out; then
+        # No differences were found, but Solaris 'diff' produces output
+        # "No differences encountered". Hide this output.
+        rm -f diff.out
+        true
+      else
+        cat diff.out
+        rm -f diff.out
+        false
+      fi
+    }
+  fi
+elif diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then
+  if test -z "$diff_out_"; then
+    compare_ () { diff -c "$@"; }
+  else
+    compare_ ()
+    {
+      if diff -c "$@" > diff.out; then
+        # No differences were found, but AIX and HP-UX 'diff' produce output
+        # "No differences encountered" or "There are no differences between the
+        # files.". Hide this output.
+        rm -f diff.out
+        true
+      else
+        cat diff.out
+        rm -f diff.out
+        false
+      fi
+    }
+  fi
+elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
+  compare_ () { cmp -s "$@"; }
 else
-  compare() { cmp "$@"; }
+  compare() { cmp "$@"; }
 fi
 
+# Usage: compare EXPECTED ACTUAL
+#
+# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more.
+# Otherwise, propagate $? to caller: any diffs have already been printed.
+compare ()
+{
+  # This looks like it can be factored to use a simple "case $?"
+  # after unchecked compare_dev_null_ invocation, but that would
+  # fail in a "set -e" environment.
+  if compare_dev_null_ "$@"; then
+    return 0
+  else
+    case $? in
+      1) return 1;;
+      *) compare_ "$@";;
+    esac
+  fi
+}
+
 # An arbitrary prefix to help distinguish test directories.
-testdir_prefix_() { printf gt; }
+testdir_prefix_ () { printf gt; }
 
 # Run the user-overridable cleanup_ function, remove the temporary
 # directory and exit with the incoming value of $?.
-remove_tmp_()
+remove_tmp_ ()
 {
   __st=$?
   cleanup_
@@ -92,9 +345,66 @@ remove_tmp_()
   exit $__st
 }
 
+# Given a directory name, DIR, if every entry in it that matches *.exe
+# contains only the specified bytes (see the case stmt below), then print
+# a space-separated list of those names and return 0.  Otherwise, don't
+# print anything and return 1.  Naming constraints apply also to DIR.
+find_exe_basenames_ ()
+{
+  feb_dir_=$1
+  feb_fail_=0
+  feb_result_=
+  feb_sp_=
+  for feb_file_ in $feb_dir_/*.exe; do
+    # If there was no *.exe file, or there existed a file named "*.exe" that
+    # was deleted between the above glob expansion and the existence test
+    # below, just skip it.
+    test "x$feb_file_" = "x$feb_dir_/*.exe" && test ! -f "$feb_file_" \
+      && continue
+    # Exempt [.exe, since we can't create a function by that name, yet
+    # we can't invoke [ by PATH search anyways due to shell builtins.
+    test "x$feb_file_" = "x$feb_dir_/[.exe" && continue
+    case $feb_file_ in
+      *[!-a-zA-Z/0-9_.+]*) feb_fail_=1; break;;
+      *) # Remove leading file name components as well as the .exe suffix.
+         feb_file_=${feb_file_##*/}
+         feb_file_=${feb_file_%.exe}
+         feb_result_="$feb_result_$feb_sp_$feb_file_";;
+    esac
+    feb_sp_=' '
+  done
+  test $feb_fail_ = 0 && printf %s "$feb_result_"
+  return $feb_fail_
+}
+
+# Consider the files in directory, $1.
+# For each file name of the form PROG.exe, create an alias named
+# PROG that simply invokes PROG.exe, then return 0.  If any selected
+# file name or the directory name, $1, contains an unexpected character,
+# define no alias and return 1.
+create_exe_shims_ ()
+{
+  case $EXEEXT in
+    '') return 0 ;;
+    .exe) ;;
+    *) echo "$0: unexpected \$EXEEXT value: $EXEEXT" 1>&2; return 1 ;;
+  esac
+
+  base_names_=`find_exe_basenames_ $1` \
+    || { echo "$0 (exe_shim): skipping directory: $1" 1>&2; return 0; }
+
+  if test -n "$base_names_"; then
+    for base_ in $base_names_; do
+      alias "$base_"="$base_$EXEEXT"
+    done
+  fi
+
+  return 0
+}
+
 # Use this function to prepend to PATH an absolute name for each
-# specified, possibly-$initial_cwd_relative, directory.
-path_prepend_()
+# specified, possibly-$initial_cwd_-relative, directory.
+path_prepend_ ()
 {
   while test $# != 0; do
     path_dir_=$1
@@ -108,27 +418,50 @@ path_prepend_()
       *:*) fail_ "invalid path dir: '$abs_path_dir_'";;
     esac
     PATH="$abs_path_dir_:$PATH"
+
+    # Create an alias, FOO, for each FOO.exe in this directory.
+    create_exe_shims_ "$abs_path_dir_" \
+      || fail_ "something failed (above): $abs_path_dir_"
     shift
   done
   export PATH
 }
 
-setup_()
+setup_ ()
 {
-  test "$VERBOSE" = yes && set -x
+  if test "$VERBOSE" = yes; then
+    # Test whether set -x may cause the selected shell to corrupt an
+    # application's stderr.  Many do, including zsh-4.3.10 and the /bin/sh
+    # from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5.
+    # If enabling verbose output this way would cause trouble, simply
+    # issue a warning and refrain.
+    if $gl_set_x_corrupts_stderr_; then
+      warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr"
+    else
+      set -x
+    fi
+  fi
 
   initial_cwd_=$PWD
-  ME_=`expr "./$0" : '.*/\(.*\)$'`
+  fail=0
 
   pfx_=`testdir_prefix_`
   test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
     || fail_ "failed to create temporary directory in $initial_cwd_"
   cd "$test_dir_"
 
-  # This pair of trap statements ensures that the temporary directory,
-  # $test_dir_, is removed upon exit as well as upon catchable signal.
-  trap remove_tmp_ 0
-  trap 'Exit $?' 1 2 13 15
+  # As autoconf-generated configure scripts do, ensure that IFS
+  # is defined initially, so that saving and restoring $IFS works.
+  gl_init_sh_nl_='
+'
+  IFS=" ""     $gl_init_sh_nl_"
+
+  # This trap statement, along with a trap on 0 below, ensure that the
+  # temporary directory, $test_dir_, is removed upon exit as well as
+  # upon receipt of any of the listed signals.
+  for sig_ in 1 2 3 13 15; do
+    eval "trap 'Exit $(expr $sig_ + 128)' $sig_"
+  done
 }
 
 # Create a temporary directory, much like mktemp -d does.
@@ -147,7 +480,7 @@ setup_()
 #  - make only $MAX_TRIES_ attempts
 
 # Helper function.  Print $N pseudo-random bytes from a-zA-Z0-9.
-rand_bytes_()
+rand_bytes_ ()
 {
   n_=$1
 
@@ -159,7 +492,7 @@ rand_bytes_()
   if test -r "$dev_rand_"; then
     # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194.
     dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \
-      | tr -c $chars_ 01234567$chars_$chars_$chars_
+      | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
     return
   fi
 
@@ -176,14 +509,14 @@ rand_bytes_()
 
   echo "$data_" \
     | dd bs=1 skip=50 count=$n_ 2>/dev/null \
-    | tr -c $chars_ 01234567$chars_$chars_$chars_
+    | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
 }
 
-mktempd_()
+mktempd_ ()
 {
   case $# in
   2);;
-  *) fail_ "Usage: $ME DIR TEMPLATE";;
+  *) fail_ "Usage: mktempd_ DIR TEMPLATE";;
   esac
 
   destdir_=$1
@@ -200,13 +533,12 @@ mktempd_()
 
   case $template_ in
   *XXXX) ;;
-  *) fail_ "invalid template: $template_ (must have a suffix of at least 4 X's)";;
+  *) fail_ \
+       "invalid template: $template_ (must have a suffix of at least 4 X's)";;
   esac
 
-  fail=0
-
   # First, try to use mktemp.
-  d=`env -u TMPDIR mktemp -d -t -p "$destdir_" "$template_" 2>/dev/null` \
+  d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` \
     || fail=1
 
   # The resulting name must be in the specified directory.
@@ -253,3 +585,6 @@ test -f "$srcdir/init.cfg" \
   && . "$srcdir/init.cfg"
 
 setup_ "$@"
+# This trap is here, rather than in the setup_ function, because some
+# shells run the exit trap at shell function exit, rather than script exit.
+trap remove_tmp_ 0
index 8f2abd5488f90d55639fb50744ff42cdfe54825f..c585d1d8dc60ca7724dcdef843c93504fc4ef112 100755 (executable)
@@ -2,7 +2,7 @@
 # Before gzip-1.4, this the use of memcpy in inflate_codes could
 # mistakenly operate on overlapping regions.  Exercise that code.
 
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2010-2012 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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # limit so don't run it by default.
 
-if test "$VERBOSE" = yes; then
-  set -x
-  gzip --version
-fi
-
-: ${srcdir=.}
-. "$srcdir/tests/init.sh"; path_prepend_ .
+. "${srcdir=.}/init.sh"; path_prepend_ ..
 
 # The input must be larger than 32KiB and slightly
 # less uniform than e.g., all zeros.
-printf wxy%032767d 0 | tee in | gzip > in.gz || framework_failure
+printf wxy%032767d 0 | tee in | gzip > in.gz || framework_failure_
 
 fail=0
 
diff --git a/tests/mixed b/tests/mixed
new file mode 100755 (executable)
index 0000000..fbba860
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Ensure that gzip -cdf handles mixed compressed/not-compressed data
+# Before gzip-1.5, it would produce invalid output.
+
+# Copyright (C) 2010-2012 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
+# the Free Software Foundation, either version 3 of the License, 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# limit so don't run it by default.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ..
+
+printf 'xxx\nyyy\n'      > exp2 || framework_failure_
+printf 'aaa\nbbb\nccc\n' > exp3 || framework_failure_
+
+fail=0
+
+(echo xxx; echo yyy) > in || fail=1
+gzip -cdf < in > out || fail=1
+compare exp2 out || fail=1
+
+# Uncompressed input, followed by compressed data.
+# Currently fails, so skip it.
+# (echo xxx; echo yyy|gzip) > in || fail=1
+# gzip -cdf < in > out || fail=1
+# compare exp2 out || fail=1
+
+# Compressed input, followed by regular (not-compressed) data.
+(echo xxx|gzip; echo yyy) > in || fail=1
+gzip -cdf < in > out || fail=1
+compare exp2 out || fail=1
+
+(echo xxx|gzip; echo yyy|gzip) > in || fail=1
+gzip -cdf < in > out || fail=1
+compare exp2 out || fail=1
+
+in_str=0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-+=%
+for i in 0 1 2 3 4 5 6 7 8 9 a; do in_str="$in_str$in_str" ;done
+
+# Start with some small sizes.  $(seq 64)
+sizes=$(i=0; while :; do echo $i; test $i = 64 && break; i=$(expr $i + 1); done)
+
+# gzip's internal buffer size is 32KiB + 64 bytes:
+sizes="$sizes 32831 32832 32833"
+
+# 128KiB, +/- 1
+sizes="$sizes 131071 131072 131073"
+
+# Ensure that "gzip -cdf" acts like cat, for a range of small input files.
+i=0
+for i in $sizes; do
+  echo $i
+  printf %$i.${i}s $in_str > in
+  gzip -cdf < in > out
+  compare in out || fail=1
+done
+
+Exit $fail
diff --git a/tests/null-suffix-clobber b/tests/null-suffix-clobber
new file mode 100755 (executable)
index 0000000..9be8a62
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Before gzip-1.5, gzip -d -S '' k.gz would delete F.gz and not create "F"
+
+# Copyright (C) 2010-2012 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
+# the Free Software Foundation, either version 3 of the License, 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# limit so don't run it by default.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ..
+
+printf anything | gzip > F.gz || framework_failure_
+echo y > yes || framework_failure_
+echo "gzip: invalid suffix ''" > expected-err || framework_failure_
+
+fail=0
+
+gzip ---presume-input-tty -d -S '' F.gz < yes > out 2>err && fail=1
+
+compare /dev/null out || fail=1
+compare expected-err err || fail=1
+
+test -f F.gz || fail=1
+
+Exit $fail
diff --git a/tests/stdin b/tests/stdin
new file mode 100755 (executable)
index 0000000..ecaf1a7
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Ensure that gzip interprets "-" as stdin.
+
+# Copyright (C) 2009-2012 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
+# the Free Software Foundation, either version 3 of the License, 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# limit so don't run it by default.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ..
+
+printf a | gzip > in || framework_failure_
+printf aaa > exp || framework_failure_
+
+fail=0
+gzip -dc in - in < in > out 2>err || fail=1
+
+compare exp out || fail=1
+compare /dev/null err || fail=1
+
+Exit $fail
index 83805dffbb01d2384e0383ed41fd46fc1a020a67..536ffebb81907d3f037130e18f7273f9894e4b10 100755 (executable)
@@ -2,7 +2,7 @@
 # gzip accepts trailing NUL bytes; don't fail if there is exactly one.
 # Before gzip-1.4, this would fail.
 
-# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # limit so don't run it by default.
 
-if test "$VERBOSE" = yes; then
-  set -x
-  gzip --version
-fi
+. "${srcdir=.}/init.sh"; path_prepend_ ..
 
-: ${srcdir=.}
-. "$srcdir/tests/init.sh"; path_prepend_ .
-
-(echo 0 | gzip; printf '\0') > 0.gz || framework_failure
-(echo 00 | gzip; printf '\0\0') > 00.gz || framework_failure
-(echo 1 | gzip; printf '\1') > 1.gz || framework_failure
+(echo 0 | gzip; printf '\0') > 0.gz || framework_failure_
+(echo 00 | gzip; printf '\0\0') > 00.gz || framework_failure_
+(echo 1 | gzip; printf '\1') > 1.gz || framework_failure_
 
 fail=0
 
@@ -37,7 +31,7 @@ for i in 0 00 1; do
   test $ret -eq $i || fail=1
   test $ret = 1 && continue
   echo $i > exp || fail=1
-  compare $i exp || fail=1
+  compare exp $i || fail=1
 done
 
 Exit $fail
index da753c69bea2c93cb13a5bae728f7a514f31ffea..0816bdd20fe1103335fa0dffca19444b0493654f 100755 (executable)
@@ -2,7 +2,7 @@
 # Exercise zdiff with two compressed inputs.
 # Before gzip-1.4, this would fail.
 
-# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # limit so don't run it by default.
 
-if test "$VERBOSE" = yes; then
-  set -x
-  zdiff --version
-fi
+. "${srcdir=.}/init.sh"; path_prepend_ ..
 
-: ${srcdir=.}
-. "$srcdir/tests/init.sh"; path_prepend_ .
-
-echo a > a || framework_failure
-echo b > b || framework_failure
-gzip a b || framework_failure
+echo a > a || framework_failure_
+echo b > b || framework_failure_
+gzip a b || framework_failure_
 
 cat <<EOF > exp
 1c1
@@ -41,7 +35,7 @@ fail=0
 zdiff a.gz b.gz > out 2>&1
 test $? = 1 || fail=1
 
-compare out exp || fail=1
+compare exp out || fail=1
 
 rm -f out
 # expect success, for equal files
old mode 100644 (file)
new mode 100755 (executable)
index 5f4b7a0..c494706
@@ -2,7 +2,7 @@
 # Ensure that zgrep -f - works like grep -f -
 # Before gzip-1.4, it would fail.
 
-# Copyright (C) 2009-2010 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # limit so don't run it by default.
 
-if test "$VERBOSE" = yes; then
-  set -x
-  zgrep --version
-fi
+. "${srcdir=.}/init.sh"; path_prepend_ ..
 
-: ${srcdir=.}
-. "$srcdir/tests/init.sh"; path_prepend_ .
-
-echo needle > n || framework_failure
-echo needle > haystack || framework_failure
-gzip haystack || framework_failure
+require_POSIX_grep_
 
+echo needle > n || framework_failure_
+echo needle > haystack || framework_failure_
+gzip haystack || framework_failure_
 
 fail=0
 zgrep -f - haystack.gz < n > out 2>&1 || fail=1
 
 compare out n || fail=1
 
+# This failed with gzip 1.4.
+echo a-b | zgrep -e - > /dev/null || fail=1
+
 Exit $fail
diff --git a/tests/zgrep-signal b/tests/zgrep-signal
new file mode 100755 (executable)
index 0000000..8b4e8d0
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh
+# Check that zgrep is terminated gracefully by signal when
+# its grep/sed pipeline is terminated by a signal.
+
+# Copyright (C) 2010-2012 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
+# the Free Software Foundation, either version 3 of the License, 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# limit so don't run it by default.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ..
+
+echo a | gzip -c > f.gz || framework_failure_
+
+test "x$PERL" = x && PERL=perl
+("$PERL" -e 'use warnings') >/dev/null 2>&1 || skip_ "no suitable perl found"
+
+exec_with_SIGPIPE_SIG_DFL () {
+  program=${1?}
+  shift
+  args=
+  for arg; do
+    args="$args, '$arg'"
+  done
+  "$PERL" -e "\$SIG{PIPE} = 'DEFAULT'; exec '$program'$args"
+}
+
+write_to_dangling_pipe () {
+  exec 3>&1
+  (
+    exec_with_SIGPIPE_SIG_DFL "$@"
+    echo $? >&3
+  ) | : || framework_failure_
+}
+
+signal_status=$(write_to_dangling_pipe cat f.gz f.gz)
+test 128 -lt $signal_status ||
+  framework_failure_ 'signal handling busted on this host'
+
+fail=0
+
+st=$(write_to_dangling_pipe zgrep a f.gz f.gz)
+
+test $st = $signal_status || fail=1
+
+Exit $fail
diff --git a/tests/znew-k b/tests/znew-k
new file mode 100755 (executable)
index 0000000..0e60e94
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Check that znew -K works without compress(1).
+
+# Copyright (C) 2010-2012 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
+# the Free Software Foundation, either version 3 of the License, 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.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# limit so don't run it by default.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ..
+
+cat <<'EOF' >compress || framework_failure_
+#!/bin/sh
+echo >&2 'compress has been invoked'
+exit 1
+EOF
+chmod +x compress || framework_failure_
+
+# Note that the basename must have a length of 6 or greater.
+# Otherwise, "test -f $name" below would fail.
+name=123456.Z
+
+printf '%1012977s' ' ' | gzip -c > $name || framework_failure_
+
+fail=0
+
+znew -K $name || fail=1
+test -f $name || fail=1
+
+Exit $fail
diff --git a/trees.c b/trees.c
index 3896cf5541682ea7aee6514c6c5cc182aeff8fb2..a1a7737729161e80fc9adc27131b8688f15b1222 100644 (file)
--- a/trees.c
+++ b/trees.c
@@ -1,6 +1,6 @@
 /* trees.c -- output deflated data using Huffman coding
 
-   Copyright (C) 1997-1999, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-1999, 2009-2012 Free Software Foundation, Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly
 
    This program is free software; you can redistribute it and/or modify
@@ -286,8 +286,8 @@ local off_t compressed_len; /* total bit length of compressed file */
 local off_t input_len;      /* total byte length of input file */
 /* input_len is for debugging only since we can get it by other means. */
 
-ush *file_type;        /* pointer to UNKNOWN, BINARY or ASCII */
-int *file_method;      /* pointer to DEFLATE or STORE */
+static ush *file_type;        /* pointer to UNKNOWN, BINARY or ASCII */
+static int *file_method;      /* pointer to DEFLATE or STORE */
 
 #ifdef DEBUG
 extern off_t bits_sent;  /* bit length of the compressed data */
@@ -300,17 +300,17 @@ extern unsigned near strstart; /* window offset of current string */
  * Local (static) routines in this file.
  */
 
-local void init_block     OF((void));
-local void pqdownheap     OF((ct_data near *tree, int k));
-local void gen_bitlen     OF((tree_desc near *desc));
-local void gen_codes      OF((ct_data near *tree, int max_code));
-local void build_tree     OF((tree_desc near *desc));
-local void scan_tree      OF((ct_data near *tree, int max_code));
-local void send_tree      OF((ct_data near *tree, int max_code));
-local int  build_bl_tree  OF((void));
-local void send_all_trees OF((int lcodes, int dcodes, int blcodes));
-local void compress_block OF((ct_data near *ltree, ct_data near *dtree));
-local void set_file_type  OF((void));
+local void init_block     (void);
+local void pqdownheap     (ct_data near *tree, int k);
+local void gen_bitlen     (tree_desc near *desc);
+local void gen_codes      (ct_data near *tree, int max_code);
+local void build_tree     (tree_desc near *desc);
+local void scan_tree      (ct_data near *tree, int max_code);
+local void send_tree      (ct_data near *tree, int max_code);
+local int  build_bl_tree  (void);
+local void send_all_trees (int lcodes, int dcodes, int blcodes);
+local void compress_block (ct_data near *ltree, ct_data near *dtree);
+local void set_file_type  (void);
 
 
 #ifndef DEBUG
@@ -905,8 +905,8 @@ off_t flush_block(buf, stored_len, eof)
     if (stored_len <= opt_lenb && eof && compressed_len == 0L && seekable()) {
 #endif
         /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
-       if (!buf)
-         gzip_error ("block vanished");
+        if (!buf)
+          gzip_error ("block vanished");
 
         copy_block(buf, (unsigned)stored_len, 0); /* without header */
         compressed_len = stored_len << 3;
diff --git a/unlzh.c b/unlzh.c
index cda4ca351ab34f8fe16fe5b9fec7d380666b3b39..37084fe25dd4187bb1f0a43abb2816bd536b4a4f 100644 (file)
--- a/unlzh.c
+++ b/unlzh.c
 
 /* decode.c */
 
-local unsigned  decode  OF((unsigned count, uch buffer[]));
-local void decode_start OF((void));
+local unsigned  decode  (unsigned count, uch buffer[]);
+local void decode_start (void);
 
 /* huf.c */
-local void huf_decode_start OF((void));
-local unsigned decode_c     OF((void));
-local unsigned decode_p     OF((void));
-local void read_pt_len      OF((int nn, int nbit, int i_special));
-local void read_c_len       OF((void));
+local void huf_decode_start (void);
+local unsigned decode_c     (void);
+local unsigned decode_p     (void);
+local void read_pt_len      (int nn, int nbit, int i_special);
+local void read_c_len       (void);
 
 /* io.c */
-local void fillbuf      OF((int n));
-local unsigned getbits  OF((int n));
-local void init_getbits OF((void));
+local void fillbuf      (int n);
+local unsigned getbits  (int n);
+local void init_getbits (void);
 
 /* maketbl.c */
 
-local void make_table OF((int nchar, uch bitlen[],
-                         int tablebits, ush table[]));
+local void make_table (int nchar, uch bitlen[],
+                       int tablebits, ush table[]);
 
 
 #define DICBIT    13    /* 12(-lh4-) or 13(-lh5-) */
@@ -57,7 +57,7 @@ local void make_table OF((int nchar, uch bitlen[],
 /* huf.c */
 
 #define NC (UCHAR_MAX + MAXMATCH + 2 - THRESHOLD)
-       /* alphabet = {0, 1, 2, ..., NC - 1} */
+        /* alphabet = {0, 1, 2, ..., NC - 1} */
 #define CBIT 9  /* $\lfloor \log_2 NC \rfloor + 1$ */
 #define CODE_BIT  16  /* codeword length */
 
@@ -104,10 +104,10 @@ local void fillbuf(n)  /* Shift bitbuf n bits left, read n bits */
 {
     bitbuf <<= n;
     while (n > bitcount) {
-       bitbuf |= subbitbuf << (n -= bitcount);
-       subbitbuf = (unsigned)try_byte();
-       if ((int)subbitbuf == EOF) subbitbuf = 0;
-       bitcount = CHAR_BIT;
+        bitbuf |= subbitbuf << (n -= bitcount);
+        subbitbuf = (unsigned)try_byte();
+        if ((int)subbitbuf == EOF) subbitbuf = 0;
+        bitcount = CHAR_BIT;
     }
     bitbuf |= subbitbuf >> (bitcount -= n);
 }
@@ -128,7 +128,7 @@ local void init_getbits()
 }
 
 /***********************************************************
-       maketbl.c -- make table for decoding
+        maketbl.c -- make table for decoding
 ***********************************************************/
 
 local void make_table(nchar, bitlen, tablebits, table)
@@ -145,51 +145,51 @@ local void make_table(nchar, bitlen, tablebits, table)
 
     start[1] = 0;
     for (i = 1; i <= 16; i++)
-       start[i + 1] = start[i] + (count[i] << (16 - i));
+        start[i + 1] = start[i] + (count[i] << (16 - i));
     if ((start[17] & 0xffff) != 0)
       gzip_error ("Bad table\n");
 
     jutbits = 16 - tablebits;
     for (i = 1; i <= (unsigned)tablebits; i++) {
-       start[i] >>= jutbits;
-       weight[i] = (unsigned) 1 << (tablebits - i);
+        start[i] >>= jutbits;
+        weight[i] = (unsigned) 1 << (tablebits - i);
     }
     while (i <= 16) {
-       weight[i] = (unsigned) 1 << (16 - i);
-       i++;
+        weight[i] = (unsigned) 1 << (16 - i);
+        i++;
     }
 
     i = start[tablebits + 1] >> jutbits;
     if (i != 0) {
-       k = 1 << tablebits;
-       while (i != k) table[i++] = 0;
+        k = 1 << tablebits;
+        while (i != k) table[i++] = 0;
     }
 
     avail = nchar;
     mask = (unsigned) 1 << (15 - tablebits);
     for (ch = 0; ch < (unsigned)nchar; ch++) {
-       if ((len = bitlen[ch]) == 0) continue;
-       nextcode = start[len] + weight[len];
-       if (len <= (unsigned)tablebits) {
-           if ((unsigned) 1 << tablebits < nextcode)
-             gzip_error ("Bad table\n");
-           for (i = start[len]; i < nextcode; i++) table[i] = ch;
-       } else {
-           k = start[len];
-           p = &table[k >> jutbits];
-           i = len - tablebits;
-           while (i != 0) {
-               if (*p == 0) {
-                   right[avail] = left[avail] = 0;
-                   *p = avail++;
-               }
-               if (k & mask) p = &right[*p];
-               else          p = &left[*p];
-               k <<= 1;  i--;
-           }
-           *p = ch;
-       }
-       start[len] = nextcode;
+        if ((len = bitlen[ch]) == 0) continue;
+        nextcode = start[len] + weight[len];
+        if (len <= (unsigned)tablebits) {
+            if ((unsigned) 1 << tablebits < nextcode)
+              gzip_error ("Bad table\n");
+            for (i = start[len]; i < nextcode; i++) table[i] = ch;
+        } else {
+            k = start[len];
+            p = &table[k >> jutbits];
+            i = len - tablebits;
+            while (i != 0) {
+                if (*p == 0) {
+                    right[avail] = left[avail] = 0;
+                    *p = avail++;
+                }
+                if (k & mask) p = &right[*p];
+                else          p = &left[*p];
+                k <<= 1;  i--;
+            }
+            *p = ch;
+        }
+        start[len] = nextcode;
     }
 }
 
@@ -207,28 +207,28 @@ local void read_pt_len(nn, nbit, i_special)
 
     n = getbits(nbit);
     if (n == 0) {
-       c = getbits(nbit);
-       for (i = 0; i < nn; i++) pt_len[i] = 0;
-       for (i = 0; i < 256; i++) pt_table[i] = c;
+        c = getbits(nbit);
+        for (i = 0; i < nn; i++) pt_len[i] = 0;
+        for (i = 0; i < 256; i++) pt_table[i] = c;
     } else {
-       i = 0;
-       while (i < n) {
-           c = bitbuf >> (BITBUFSIZ - 3);
-           if (c == 7) {
-               mask = (unsigned) 1 << (BITBUFSIZ - 1 - 3);
-               while (mask & bitbuf) {  mask >>= 1;  c++;  }
-               if (16 < c)
-                 gzip_error ("Bad table\n");
-           }
-           fillbuf((c < 7) ? 3 : c - 3);
-           pt_len[i++] = c;
-           if (i == i_special) {
-               c = getbits(2);
-               while (--c >= 0) pt_len[i++] = 0;
-           }
-       }
-       while (i < nn) pt_len[i++] = 0;
-       make_table(nn, pt_len, 8, pt_table);
+        i = 0;
+        while (i < n) {
+            c = bitbuf >> (BITBUFSIZ - 3);
+            if (c == 7) {
+                mask = (unsigned) 1 << (BITBUFSIZ - 1 - 3);
+                while (mask & bitbuf) {  mask >>= 1;  c++;  }
+                if (16 < c)
+                  gzip_error ("Bad table\n");
+            }
+            fillbuf((c < 7) ? 3 : c - 3);
+            pt_len[i++] = c;
+            if (i == i_special) {
+                c = getbits(2);
+                while (--c >= 0) pt_len[i++] = 0;
+            }
+        }
+        while (i < nn) pt_len[i++] = 0;
+        make_table(nn, pt_len, 8, pt_table);
     }
 }
 
@@ -239,31 +239,31 @@ local void read_c_len()
 
     n = getbits(CBIT);
     if (n == 0) {
-       c = getbits(CBIT);
-       for (i = 0; i < NC; i++) c_len[i] = 0;
-       for (i = 0; i < 4096; i++) c_table[i] = c;
+        c = getbits(CBIT);
+        for (i = 0; i < NC; i++) c_len[i] = 0;
+        for (i = 0; i < 4096; i++) c_table[i] = c;
     } else {
-       i = 0;
-       while (i < n) {
-           c = pt_table[bitbuf >> (BITBUFSIZ - 8)];
-           if (c >= NT) {
-               mask = (unsigned) 1 << (BITBUFSIZ - 1 - 8);
-               do {
-                   if (bitbuf & mask) c = right[c];
-                   else               c = left [c];
-                   mask >>= 1;
-               } while (c >= NT);
-           }
-           fillbuf((int) pt_len[c]);
-           if (c <= 2) {
-               if      (c == 0) c = 1;
-               else if (c == 1) c = getbits(4) + 3;
-               else             c = getbits(CBIT) + 20;
-               while (--c >= 0) c_len[i++] = 0;
-           } else c_len[i++] = c - 2;
-       }
-       while (i < NC) c_len[i++] = 0;
-       make_table(NC, c_len, 12, c_table);
+        i = 0;
+        while (i < n) {
+            c = pt_table[bitbuf >> (BITBUFSIZ - 8)];
+            if (c >= NT) {
+                mask = (unsigned) 1 << (BITBUFSIZ - 1 - 8);
+                do {
+                    if (bitbuf & mask) c = right[c];
+                    else               c = left [c];
+                    mask >>= 1;
+                } while (c >= NT);
+            }
+            fillbuf((int) pt_len[c]);
+            if (c <= 2) {
+                if      (c == 0) c = 1;
+                else if (c == 1) c = getbits(4) + 3;
+                else             c = getbits(CBIT) + 20;
+                while (--c >= 0) c_len[i++] = 0;
+            } else c_len[i++] = c - 2;
+        }
+        while (i < NC) c_len[i++] = 0;
+        make_table(NC, c_len, 12, c_table);
     }
 }
 
@@ -272,23 +272,23 @@ local unsigned decode_c()
     unsigned j, mask;
 
     if (blocksize == 0) {
-       blocksize = getbits(16);
-       if (blocksize == 0) {
-           return NC; /* end of file */
-       }
-       read_pt_len(NT, TBIT, 3);
-       read_c_len();
-       read_pt_len(NP, PBIT, -1);
+        blocksize = getbits(16);
+        if (blocksize == 0) {
+            return NC; /* end of file */
+        }
+        read_pt_len(NT, TBIT, 3);
+        read_c_len();
+        read_pt_len(NP, PBIT, -1);
     }
     blocksize--;
     j = c_table[bitbuf >> (BITBUFSIZ - 12)];
     if (j >= NC) {
-       mask = (unsigned) 1 << (BITBUFSIZ - 1 - 12);
-       do {
-           if (bitbuf & mask) j = right[j];
-           else               j = left [j];
-           mask >>= 1;
-       } while (j >= NC);
+        mask = (unsigned) 1 << (BITBUFSIZ - 1 - 12);
+        do {
+            if (bitbuf & mask) j = right[j];
+            else               j = left [j];
+            mask >>= 1;
+        } while (j >= NC);
     }
     fillbuf((int) c_len[j]);
     return j;
@@ -300,12 +300,12 @@ local unsigned decode_p()
 
     j = pt_table[bitbuf >> (BITBUFSIZ - 8)];
     if (j >= NP) {
-       mask = (unsigned) 1 << (BITBUFSIZ - 1 - 8);
-       do {
-           if (bitbuf & mask) j = right[j];
-           else               j = left [j];
-           mask >>= 1;
-       } while (j >= NP);
+        mask = (unsigned) 1 << (BITBUFSIZ - 1 - 8);
+        do {
+            if (bitbuf & mask) j = right[j];
+            else               j = left [j];
+            mask >>= 1;
+        } while (j >= NP);
     }
     fillbuf((int) pt_len[j]);
     if (j != 0) j = ((unsigned) 1 << (j - 1)) + getbits((int) (j - 1));
@@ -350,28 +350,28 @@ local unsigned decode(count, buffer)
 
     r = 0;
     while (--j >= 0) {
-       buffer[r] = buffer[i];
-       i = (i + 1) & (DICSIZ - 1);
-       if (++r == count) return r;
+        buffer[r] = buffer[i];
+        i = (i + 1) & (DICSIZ - 1);
+        if (++r == count) return r;
     }
     for ( ; ; ) {
-       c = decode_c();
-       if (c == NC) {
-           done = 1;
-           return r;
-       }
-       if (c <= UCHAR_MAX) {
-           buffer[r] = c;
-           if (++r == count) return r;
-       } else {
-           j = c - (UCHAR_MAX + 1 - THRESHOLD);
-           i = (r - decode_p() - 1) & (DICSIZ - 1);
-           while (--j >= 0) {
-               buffer[r] = buffer[i];
-               i = (i + 1) & (DICSIZ - 1);
-               if (++r == count) return r;
-           }
-       }
+        c = decode_c();
+        if (c == NC) {
+            done = 1;
+            return r;
+        }
+        if (c <= UCHAR_MAX) {
+            buffer[r] = c;
+            if (++r == count) return r;
+        } else {
+            j = c - (UCHAR_MAX + 1 - THRESHOLD);
+            i = (r - decode_p() - 1) & (DICSIZ - 1);
+            while (--j >= 0) {
+                buffer[r] = buffer[i];
+                i = (i + 1) & (DICSIZ - 1);
+                if (++r == count) return r;
+            }
+        }
     }
 }
 
@@ -389,10 +389,10 @@ int unlzh(in, out)
 
     decode_start();
     while (!done) {
-       n = decode((unsigned) DICSIZ, window);
-       if (!test && n > 0) {
-           write_buf(out, (char*)window, n);
-       }
+        n = decode((unsigned) DICSIZ, window);
+        if (!test && n > 0) {
+            write_buf(out, (char*)window, n);
+        }
     }
     return OK;
 }
diff --git a/unlzw.c b/unlzw.c
index 8f8cbeee16fa007762ae842d76e1ad1398c6066b..63f941c6213533bf3140ce642bc16d5bfe3e02a9 100644 (file)
--- a/unlzw.c
+++ b/unlzw.c
@@ -121,19 +121,19 @@ union     bytes {
     long  word;
     struct {
 #if BYTEORDER == 4321
-       char_type       b1;
-       char_type       b2;
-       char_type       b3;
-       char_type       b4;
+        char_type      b1;
+        char_type      b2;
+        char_type      b3;
+        char_type      b4;
 #else
 #if BYTEORDER == 1234
-       char_type       b4;
-       char_type       b3;
-       char_type       b2;
-       char_type       b1;
+        char_type      b4;
+        char_type      b3;
+        char_type      b2;
+        char_type      b1;
 #else
 #      undef   BYTEORDER
-       int  dummy;
+        int  dummy;
 #endif
 #endif
     } bytes;
@@ -206,18 +206,18 @@ int unlzw(in, out)
     maxbits = get_byte();
     block_mode = maxbits & BLOCK_MODE;
     if ((maxbits & LZW_RESERVED) != 0) {
-       WARN((stderr, "\n%s: %s: warning, unknown flags 0x%x\n",
-             program_name, ifname, maxbits & LZW_RESERVED));
+        WARN((stderr, "\n%s: %s: warning, unknown flags 0x%x\n",
+              program_name, ifname, maxbits & LZW_RESERVED));
     }
     maxbits &= BIT_MASK;
     maxmaxcode = MAXCODE(maxbits);
 
     if (maxbits > BITS) {
-       fprintf(stderr,
-               "\n%s: %s: compressed with %d bits, can only handle %d bits\n",
-               program_name, ifname, maxbits, BITS);
-       exit_code = ERROR;
-       return ERROR;
+        fprintf(stderr,
+                "\n%s: %s: compressed with %d bits, can only handle %d bits\n",
+                program_name, ifname, maxbits, BITS);
+        exit_code = ERROR;
+        return ERROR;
     }
     rsize = insize;
     maxcode = MAXCODE(n_bits = INIT_BITS)-1;
@@ -232,141 +232,141 @@ int unlzw(in, out)
     clear_tab_prefixof(); /* Initialize the first 256 entries in the table. */
 
     for (code = 255 ; code >= 0 ; --code) {
-       tab_suffixof(code) = (char_type)code;
+        tab_suffixof(code) = (char_type)code;
     }
     do {
-       REG1 int i;
-       int  e;
-       int  o;
+        REG1 int i;
+        int  e;
+        int  o;
 
     resetbuf:
-       o = posbits >> 3;
-       e = o <= insize ? insize - o : 0;
-
-       for (i = 0 ; i < e ; ++i) {
-           inbuf[i] = inbuf[i+o];
-       }
-       insize = e;
-       posbits = 0;
-
-       if (insize < INBUF_EXTRA) {
-           rsize = read_buffer (in, (char *) inbuf + insize, INBUFSIZ);
-           if (rsize == -1) {
-               read_error();
-           }
-           insize += rsize;
-           bytes_in += (off_t)rsize;
-       }
-       inbits = ((rsize != 0) ? ((long)insize - insize%n_bits)<<3 :
-                 ((long)insize<<3)-(n_bits-1));
-
-       while (inbits > posbits) {
-           if (free_ent > maxcode) {
-               posbits = ((posbits-1) +
-                          ((n_bits<<3)-(posbits-1+(n_bits<<3))%(n_bits<<3)));
-               ++n_bits;
-               if (n_bits == maxbits) {
-                   maxcode = maxmaxcode;
-               } else {
-                   maxcode = MAXCODE(n_bits)-1;
-               }
-               bitmask = (1<<n_bits)-1;
-               goto resetbuf;
-           }
-           input(inbuf,posbits,code,n_bits,bitmask);
-           Tracev((stderr, "%d ", code));
-
-           if (oldcode == -1) {
-               if (256 <= code)
-                 gzip_error ("corrupt input.");
-               outbuf[outpos++] = (char_type)(finchar = (int)(oldcode=code));
-               continue;
-           }
-           if (code == CLEAR && block_mode) {
-               clear_tab_prefixof();
-               free_ent = FIRST - 1;
-               posbits = ((posbits-1) +
-                          ((n_bits<<3)-(posbits-1+(n_bits<<3))%(n_bits<<3)));
-               maxcode = MAXCODE(n_bits = INIT_BITS)-1;
-               bitmask = (1<<n_bits)-1;
-               goto resetbuf;
-           }
-           incode = code;
-           stackp = de_stack;
-
-           if (code >= free_ent) { /* Special case for KwKwK string. */
-               if (code > free_ent) {
+        o = posbits >> 3;
+        e = o <= insize ? insize - o : 0;
+
+        for (i = 0 ; i < e ; ++i) {
+            inbuf[i] = inbuf[i+o];
+        }
+        insize = e;
+        posbits = 0;
+
+        if (insize < INBUF_EXTRA) {
+            rsize = read_buffer (in, (char *) inbuf + insize, INBUFSIZ);
+            if (rsize == -1) {
+                read_error();
+            }
+            insize += rsize;
+            bytes_in += (off_t)rsize;
+        }
+        inbits = ((rsize != 0) ? ((long)insize - insize%n_bits)<<3 :
+                  ((long)insize<<3)-(n_bits-1));
+
+        while (inbits > posbits) {
+            if (free_ent > maxcode) {
+                posbits = ((posbits-1) +
+                           ((n_bits<<3)-(posbits-1+(n_bits<<3))%(n_bits<<3)));
+                ++n_bits;
+                if (n_bits == maxbits) {
+                    maxcode = maxmaxcode;
+                } else {
+                    maxcode = MAXCODE(n_bits)-1;
+                }
+                bitmask = (1<<n_bits)-1;
+                goto resetbuf;
+            }
+            input(inbuf,posbits,code,n_bits,bitmask);
+            Tracev((stderr, "%d ", code));
+
+            if (oldcode == -1) {
+                if (256 <= code)
+                  gzip_error ("corrupt input.");
+                outbuf[outpos++] = (char_type)(finchar = (int)(oldcode=code));
+                continue;
+            }
+            if (code == CLEAR && block_mode) {
+                clear_tab_prefixof();
+                free_ent = FIRST - 1;
+                posbits = ((posbits-1) +
+                           ((n_bits<<3)-(posbits-1+(n_bits<<3))%(n_bits<<3)));
+                maxcode = MAXCODE(n_bits = INIT_BITS)-1;
+                bitmask = (1<<n_bits)-1;
+                goto resetbuf;
+            }
+            incode = code;
+            stackp = de_stack;
+
+            if (code >= free_ent) { /* Special case for KwKwK string. */
+                if (code > free_ent) {
 #ifdef DEBUG
-                   char_type *p;
-
-                   posbits -= n_bits;
-                   p = &inbuf[posbits>>3];
-                   fprintf(stderr,
-                           "code:%ld free_ent:%ld n_bits:%d insize:%u\n",
-                           code, free_ent, n_bits, insize);
-                   fprintf(stderr,
-                           "posbits:%ld inbuf:%02X %02X %02X %02X %02X\n",
-                           posbits, p[-1],p[0],p[1],p[2],p[3]);
+                    char_type *p;
+
+                    posbits -= n_bits;
+                    p = &inbuf[posbits>>3];
+                    fprintf(stderr,
+                            "code:%ld free_ent:%ld n_bits:%d insize:%u\n",
+                            code, free_ent, n_bits, insize);
+                    fprintf(stderr,
+                            "posbits:%ld inbuf:%02X %02X %02X %02X %02X\n",
+                            posbits, p[-1],p[0],p[1],p[2],p[3]);
 #endif
-                   if (!test && outpos > 0) {
-                       write_buf(out, (char*)outbuf, outpos);
-                       bytes_out += (off_t)outpos;
-                   }
-                   gzip_error (to_stdout
-                               ? "corrupt input."
-                               : "corrupt input. Use zcat to recover some data.");
-               }
-               *--stackp = (char_type)finchar;
-               code = oldcode;
-           }
-
-           while ((cmp_code_int)code >= (cmp_code_int)256) {
-               /* Generate output characters in reverse order */
-               *--stackp = tab_suffixof(code);
-               code = tab_prefixof(code);
-           }
-           *--stackp = (char_type)(finchar = tab_suffixof(code));
-
-           /* And put them out in forward order */
-           {
-               REG1 int        i;
-
-               if (outpos+(i = (de_stack-stackp)) >= OUTBUFSIZ) {
-                   do {
-                       if (i > OUTBUFSIZ-outpos) i = OUTBUFSIZ-outpos;
-
-                       if (i > 0) {
-                           memcpy(outbuf+outpos, stackp, i);
-                           outpos += i;
-                       }
-                       if (outpos >= OUTBUFSIZ) {
-                           if (!test) {
-                               write_buf(out, (char*)outbuf, outpos);
-                               bytes_out += (off_t)outpos;
-                           }
-                           outpos = 0;
-                       }
-                       stackp+= i;
-                   } while ((i = (de_stack-stackp)) > 0);
-               } else {
-                   memcpy(outbuf+outpos, stackp, i);
-                   outpos += i;
-               }
-           }
-
-           if ((code = free_ent) < maxmaxcode) { /* Generate the new entry. */
-
-               tab_prefixof(code) = (unsigned short)oldcode;
-               tab_suffixof(code) = (char_type)finchar;
-               free_ent = code+1;
-           }
-           oldcode = incode;   /* Remember previous code.      */
-       }
+                    if (!test && outpos > 0) {
+                        write_buf(out, (char*)outbuf, outpos);
+                        bytes_out += (off_t)outpos;
+                    }
+                    gzip_error (to_stdout
+                                ? "corrupt input."
+                                : "corrupt input. Use zcat to recover some data.");
+                }
+                *--stackp = (char_type)finchar;
+                code = oldcode;
+            }
+
+            while ((cmp_code_int)code >= (cmp_code_int)256) {
+                /* Generate output characters in reverse order */
+                *--stackp = tab_suffixof(code);
+                code = tab_prefixof(code);
+            }
+            *--stackp =        (char_type)(finchar = tab_suffixof(code));
+
+            /* And put them out in forward order */
+            {
+                REG1 int       i;
+
+                if (outpos+(i = (de_stack-stackp)) >= OUTBUFSIZ) {
+                    do {
+                        if (i > OUTBUFSIZ-outpos) i = OUTBUFSIZ-outpos;
+
+                        if (i > 0) {
+                            memcpy(outbuf+outpos, stackp, i);
+                            outpos += i;
+                        }
+                        if (outpos >= OUTBUFSIZ) {
+                            if (!test) {
+                                write_buf(out, (char*)outbuf, outpos);
+                                bytes_out += (off_t)outpos;
+                            }
+                            outpos = 0;
+                        }
+                        stackp+= i;
+                    } while ((i = (de_stack-stackp)) > 0);
+                } else {
+                    memcpy(outbuf+outpos, stackp, i);
+                    outpos += i;
+                }
+            }
+
+            if ((code = free_ent) < maxmaxcode) { /* Generate the new entry. */
+
+                tab_prefixof(code) = (unsigned short)oldcode;
+                tab_suffixof(code) = (char_type)finchar;
+                free_ent = code+1;
+            }
+            oldcode = incode;  /* Remember previous code.      */
+        }
     } while (rsize != 0);
 
     if (!test && outpos > 0) {
-       write_buf(out, (char*)outbuf, outpos);
-       bytes_out += (off_t)outpos;
+        write_buf(out, (char*)outbuf, outpos);
+        bytes_out += (off_t)outpos;
     }
     return OK;
 }
index c34a9a4e001ff5644e8e36439af1c1410c9fea32..e450c0e79b26de2af0b435457ac33bfa02f14270 100644 (file)
--- a/unpack.c
+++ b/unpack.c
@@ -1,6 +1,6 @@
 /* unpack.c -- decompress files in pack format.
 
-   Copyright (C) 1997, 1999, 2006, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2006, 2009-2012 Free Software Foundation, Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly
 
    This program is free software; you can redistribute it and/or modify
@@ -20,7 +20,6 @@
 #include <config.h>
 #include "tailor.h"
 #include "gzip.h"
-#include "crypt.h"
 
 #define MIN(a,b) ((a) <= (b) ? (a) : (b))
 /* The arguments must not have side effects. */
@@ -95,8 +94,8 @@ local int valid;                  /* number of valid bits in bitbuf */
 
 /* Local functions */
 
-local void read_tree  OF((void));
-local void build_tree OF((void));
+local void read_tree  (void);
+local void build_tree (void);
 
 /* ===========================================================================
  * Read the Huffman tree.
@@ -114,23 +113,23 @@ local void read_tree()
 
     max_len = (int)get_byte(); /* maximum bit length of Huffman codes */
     if (max_len > MAX_BITLEN) {
-       gzip_error ("invalid compressed data -- Huffman code > 32 bits");
+        gzip_error ("invalid compressed data -- Huffman code > 32 bits");
     }
 
     /* Get the number of leaves at each bit length */
     n = 0;
     for (len = 1; len <= max_len; len++) {
-       leaves[len] = (int)get_byte();
-       if (max_leaves - (len == max_len) < leaves[len])
-         gzip_error ("too many leaves in Huffman tree");
-       max_leaves = (max_leaves - leaves[len] + 1) * 2 - 1;
-       n += leaves[len];
+        leaves[len] = (int)get_byte();
+        if (max_leaves - (len == max_len) < leaves[len])
+          gzip_error ("too many leaves in Huffman tree");
+        max_leaves = (max_leaves - leaves[len] + 1) * 2 - 1;
+        n += leaves[len];
     }
     if (LITERALS <= n) {
-       gzip_error ("too many leaves in Huffman tree");
+        gzip_error ("too many leaves in Huffman tree");
     }
     Trace((stderr, "orig_len %lu, max_len %d, leaves %d\n",
-          orig_len, max_len, n));
+           orig_len, max_len, n));
     /* There are at least 2 and at most 256 leaves of length max_len.
      * (Pack arbitrarily rejects empty files and files consisting of
      * a single byte even repeated.) To fit the last leaf count in a
@@ -143,12 +142,12 @@ local void read_tree()
     /* Now read the leaves themselves */
     base = 0;
     for (len = 1; len <= max_len; len++) {
-       /* Remember where the literals of this length start in literal[] : */
-       lit_base[len] = base;
-       /* And read the literals: */
-       for (n = leaves[len]; n > 0; n--) {
-           literal[base++] = (uch)get_byte();
-       }
+        /* Remember where the literals of this length start in literal[] : */
+        lit_base[len] = base;
+        /* And read the literals: */
+        for (n = leaves[len]; n > 0; n--) {
+            literal[base++] = (uch)get_byte();
+        }
     }
     leaves[max_len]++; /* Now include the EOB code in the Huffman tree */
 }
@@ -163,17 +162,17 @@ local void build_tree()
     uch *prefixp;  /* pointer in prefix_len */
 
     for (len = max_len; len >= 1; len--) {
-       /* The number of parent nodes at this level is half the total
-        * number of nodes at parent level:
-        */
-       nodes >>= 1;
-       parents[len] = nodes;
-       /* Update lit_base by the appropriate bias to skip the parent nodes
-        * (which are not represented in the literal array):
-        */
-       lit_base[len] -= nodes;
-       /* Restore nodes to be parents+leaves: */
-       nodes += leaves[len];
+        /* The number of parent nodes at this level is half the total
+         * number of nodes at parent level:
+         */
+        nodes >>= 1;
+        parents[len] = nodes;
+        /* Update lit_base by the appropriate bias to skip the parent nodes
+         * (which are not represented in the literal array):
+         */
+        lit_base[len] -= nodes;
+        /* Restore nodes to be parents+leaves: */
+        nodes += leaves[len];
     }
     /* Construct the prefix table, from shortest leaves to longest ones.
      * The shortest code is all ones, so we start at the end of the table.
@@ -181,8 +180,8 @@ local void build_tree()
     peek_bits = MIN(max_len, MAX_PEEK);
     prefixp = &prefix_len[1<<peek_bits];
     for (len = 1; len <= peek_bits; len++) {
-       int prefixes = leaves[len] << (peek_bits-len); /* may be 0 */
-       while (prefixes--) *--prefixp = (uch)len;
+        int prefixes = leaves[len] << (peek_bits-len); /* may be 0 */
+        while (prefixes--) *--prefixp = (uch)len;
     }
     /* The length of all other codes is unknown: */
     while (prefixp > prefix_len) *--prefixp = 0;
@@ -218,35 +217,35 @@ int unpack(in, out)
 
     /* Decode the input data: */
     for (;;) {
-       /* Since eob is the longest code and not shorter than max_len,
+        /* Since eob is the longest code and not shorter than max_len,
          * we can peek at max_len bits without having the risk of reading
          * beyond the end of file.
-        */
-       look_bits(peek, peek_bits, peek_mask);
-       len = prefix_len[peek];
-       if (len > 0) {
-           peek >>= peek_bits - len; /* discard the extra bits */
-       } else {
-           /* Code of more than peek_bits bits, we must traverse the tree */
-           ulg mask = peek_mask;
-           len = peek_bits;
-           do {
+         */
+        look_bits(peek, peek_bits, peek_mask);
+        len = prefix_len[peek];
+        if (len > 0) {
+            peek >>= peek_bits - len; /* discard the extra bits */
+        } else {
+            /* Code of more than peek_bits bits, we must traverse the tree */
+            ulg mask = peek_mask;
+            len = peek_bits;
+            do {
                 len++, mask = (mask<<1)+1;
-               look_bits(peek, len, mask);
-           } while (peek < (unsigned)parents[len]);
-           /* loop as long as peek is a parent node */
-       }
-       /* At this point, peek is the next complete code, of len bits */
-       if (peek == eob && len == max_len) break; /* end of file? */
-       put_ubyte(literal[peek+lit_base[len]]);
-       Tracev((stderr,"%02d %04x %c\n", len, peek,
-               literal[peek+lit_base[len]]));
-       skip_bits(len);
+                look_bits(peek, len, mask);
+            } while (peek < (unsigned)parents[len]);
+            /* loop as long as peek is a parent node */
+        }
+        /* At this point, peek is the next complete code, of len bits */
+        if (peek == eob && len == max_len) break; /* end of file? */
+        put_ubyte(literal[peek+lit_base[len]]);
+        Tracev((stderr,"%02d %04x %c\n", len, peek,
+                literal[peek+lit_base[len]]));
+        skip_bits(len);
     } /* for (;;) */
 
     flush_window();
     if (orig_len != (ulg)(bytes_out & 0xffffffff)) {
-       gzip_error ("invalid compressed data--length error");
+        gzip_error ("invalid compressed data--length error");
     }
     return OK;
 }
diff --git a/unzip.c b/unzip.c
index 55185a95c8974a81dff4a2e035df030e4d86e51f..400209616ababd60cefef3d09dc779f7f5a30351 100644 (file)
--- a/unzip.c
+++ b/unzip.c
@@ -1,6 +1,6 @@
 /* unzip.c -- decompress files in gzip or pkzip format.
 
-   Copyright (C) 1997-1999, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-1999, 2009-2012 Free Software Foundation, Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly
 
    This program is free software; you can redistribute it and/or modify
@@ -31,7 +31,6 @@
 #include <config.h>
 #include "tailor.h"
 #include "gzip.h"
-#include "crypt.h"
 
 /* PKZIP header definitions */
 #define LOCSIG 0x04034b50L      /* four-byte lead-in (lsb first) */
 
 /* Globals */
 
-int decrypt;        /* flag to turn on decryption */
-char *key;          /* not used--needed to link crypt.c */
-int pkzip = 0;      /* set for a pkzip file */
-int ext_header = 0; /* set if extended local header */
+static int decrypt;        /* flag to turn on decryption */
+static int pkzip = 0;      /* set for a pkzip file */
+static int ext_header = 0; /* set if extended local header */
 
 /* ===========================================================================
  * Check zip file and advance inptr to the start of the compressed data.
@@ -72,26 +70,26 @@ int check_zipfile(in)
     inptr += LOCHDR + SH(h + LOCFIL) + SH(h + LOCEXT);
 
     if (inptr > insize || LG(h) != LOCSIG) {
-       fprintf(stderr, "\n%s: %s: not a valid zip file\n",
-               program_name, ifname);
-       exit_code = ERROR;
-       return ERROR;
+        fprintf(stderr, "\n%s: %s: not a valid zip file\n",
+                program_name, ifname);
+        exit_code = ERROR;
+        return ERROR;
     }
     method = h[LOCHOW];
     if (method != STORED && method != DEFLATED) {
-       fprintf(stderr,
-               "\n%s: %s: first entry not deflated or stored -- use unzip\n",
-               program_name, ifname);
-       exit_code = ERROR;
-       return ERROR;
+        fprintf(stderr,
+                "\n%s: %s: first entry not deflated or stored -- use unzip\n",
+                program_name, ifname);
+        exit_code = ERROR;
+        return ERROR;
     }
 
     /* If entry encrypted, decrypt and validate encryption header */
     if ((decrypt = h[LOCFLG] & CRPFLG) != 0) {
-       fprintf(stderr, "\n%s: %s: encrypted file -- use unzip\n",
-               program_name, ifname);
-       exit_code = ERROR;
-       return ERROR;
+        fprintf(stderr, "\n%s: %s: encrypted file -- use unzip\n",
+                program_name, ifname);
+        exit_code = ERROR;
+        return ERROR;
     }
 
     /* Save flags for unzip() */
@@ -124,88 +122,88 @@ int unzip(in, out)
     updcrc(NULL, 0);           /* initialize crc */
 
     if (pkzip && !ext_header) {  /* crc and length at the end otherwise */
-       orig_crc = LG(inbuf + LOCCRC);
-       orig_len = LG(inbuf + LOCLEN);
+        orig_crc = LG(inbuf + LOCCRC);
+        orig_len = LG(inbuf + LOCLEN);
     }
 
     /* Decompress */
     if (method == DEFLATED)  {
 
-       int res = inflate();
+        int res = inflate();
 
-       if (res == 3) {
-           xalloc_die ();
-       } else if (res != 0) {
-           gzip_error ("invalid compressed data--format violated");
-       }
+        if (res == 3) {
+            xalloc_die ();
+        } else if (res != 0) {
+            gzip_error ("invalid compressed data--format violated");
+        }
 
     } else if (pkzip && method == STORED) {
 
-       register ulg n = LG(inbuf + LOCLEN);
+        register ulg n = LG(inbuf + LOCLEN);
 
-       if (n != LG(inbuf + LOCSIZ) - (decrypt ? RAND_HEAD_LEN : 0)) {
+        if (n != LG(inbuf + LOCSIZ) - (decrypt ? RAND_HEAD_LEN : 0)) {
 
-           fprintf(stderr, "len %ld, siz %ld\n", n, LG(inbuf + LOCSIZ));
-           gzip_error ("invalid compressed data--length mismatch");
-       }
-       while (n--) {
-           uch c = (uch)get_byte();
-           put_ubyte(c);
-       }
-       flush_window();
+            fprintf(stderr, "len %ld, siz %ld\n", n, LG(inbuf + LOCSIZ));
+            gzip_error ("invalid compressed data--length mismatch");
+        }
+        while (n--) {
+            uch c = (uch)get_byte();
+            put_ubyte(c);
+        }
+        flush_window();
     } else {
-       gzip_error ("internal error, invalid method");
+        gzip_error ("internal error, invalid method");
     }
 
     /* Get the crc and original length */
     if (!pkzip) {
         /* crc32  (see algorithm.doc)
-        * uncompressed input size modulo 2^32
+         * uncompressed input size modulo 2^32
          */
-       for (n = 0; n < 8; n++) {
-           buf[n] = (uch)get_byte(); /* may cause an error if EOF */
-       }
-       orig_crc = LG(buf);
-       orig_len = LG(buf+4);
+        for (n = 0; n < 8; n++) {
+            buf[n] = (uch)get_byte(); /* may cause an error if EOF */
+        }
+        orig_crc = LG(buf);
+        orig_len = LG(buf+4);
 
     } else if (ext_header) {  /* If extended header, check it */
-       /* signature - 4bytes: 0x50 0x4b 0x07 0x08
-        * CRC-32 value
+        /* signature - 4bytes: 0x50 0x4b 0x07 0x08
+         * CRC-32 value
          * compressed size 4-bytes
          * uncompressed size 4-bytes
-        */
-       for (n = 0; n < EXTHDR; n++) {
-           buf[n] = (uch)get_byte(); /* may cause an error if EOF */
-       }
-       orig_crc = LG(buf+4);
-       orig_len = LG(buf+12);
+         */
+        for (n = 0; n < EXTHDR; n++) {
+            buf[n] = (uch)get_byte(); /* may cause an error if EOF */
+        }
+        orig_crc = LG(buf+4);
+        orig_len = LG(buf+12);
     }
 
     /* Validate decompression */
     if (orig_crc != updcrc(outbuf, 0)) {
-       fprintf(stderr, "\n%s: %s: invalid compressed data--crc error\n",
-               program_name, ifname);
-       err = ERROR;
+        fprintf(stderr, "\n%s: %s: invalid compressed data--crc error\n",
+                program_name, ifname);
+        err = ERROR;
     }
     if (orig_len != (ulg)(bytes_out & 0xffffffff)) {
-       fprintf(stderr, "\n%s: %s: invalid compressed data--length error\n",
-               program_name, ifname);
-       err = ERROR;
+        fprintf(stderr, "\n%s: %s: invalid compressed data--length error\n",
+                program_name, ifname);
+        err = ERROR;
     }
 
     /* Check if there are more entries in a pkzip file */
     if (pkzip && inptr + 4 < insize && LG(inbuf+inptr) == LOCSIG) {
-       if (to_stdout) {
-           WARN((stderr,
-                 "%s: %s has more than one entry--rest ignored\n",
-                 program_name, ifname));
-       } else {
-           /* Don't destroy the input zip file */
-           fprintf(stderr,
-                   "%s: %s has more than one entry -- unchanged\n",
-                   program_name, ifname);
-           err = ERROR;
-       }
+        if (to_stdout) {
+            WARN((stderr,
+                  "%s: %s has more than one entry--rest ignored\n",
+                  program_name, ifname));
+        } else {
+            /* Don't destroy the input zip file */
+            fprintf(stderr,
+                    "%s: %s has more than one entry -- unchanged\n",
+                    program_name, ifname);
+            err = ERROR;
+        }
     }
     ext_header = pkzip = 0; /* for next file */
     if (err == OK) return OK;
diff --git a/util.c b/util.c
index f08c2c7d41419bec7f375f5b50c727045ee22ba1..46bc89d687edaa8e30f503184811e60459d98866 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1,6 +1,6 @@
 /* util.c -- utility functions for gzip support
 
-   Copyright (C) 1997-1999, 2001-2002, 2006, 2009-2010 Free Software
+   Copyright (C) 1997-1999, 2001-2002, 2006, 2009-2012 Free Software
    Foundation, Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly
 
 #include <errno.h>
 
 #include "gzip.h"
-#include "crypt.h"
 #include <xalloc.h>
 
 #ifndef CHAR_BIT
 #  define CHAR_BIT 8
 #endif
 
-static int write_buffer OF((int, voidp, unsigned int));
+static int write_buffer (int, voidp, unsigned int);
 
-extern ulg crc_32_tab[];   /* crc table, defined below */
+static const ulg crc_32_tab[];   /* crc table, defined below */
 
 /* ===========================================================================
  * Copy input to output unchanged: zcat == cat with --force.
- * IN assertion: insize bytes have already been read in inbuf.
+ * IN assertion: insize bytes have already been read in inbuf and inptr bytes
+ * already processed or copied.
  */
 int copy(in, out)
     int in, out;   /* input and output file descriptors */
 {
+    int got;
+
     errno = 0;
-    while (insize != 0 && (int)insize != -1) {
-       write_buf(out, (char*)inbuf, insize);
-       bytes_out += insize;
-       insize = read_buffer (in, (char *) inbuf, INBUFSIZ);
-    }
-    if ((int)insize == -1) {
-       read_error();
+    while (insize > inptr) {
+        write_buf(out, (char*)inbuf + inptr, insize - inptr);
+        bytes_out += insize - inptr;
+        got = read_buffer (in, (char *) inbuf, INBUFSIZ);
+        if (got == -1)
+            read_error();
+        bytes_in += got;
+        insize = (unsigned)got;
+        inptr = 0;
     }
-    bytes_in = bytes_out;
     return OK;
 }
 
@@ -76,9 +79,9 @@ ulg updcrc(s, n)
     static ulg crc = (ulg)0xffffffffL; /* shift register contents */
 
     if (s == NULL) {
-       c = 0xffffffffL;
+        c = 0xffffffffL;
     } else {
-       c = crc;
+        c = crc;
         if (n) do {
             c = crc_32_tab[((int)c ^ (*s++)) & 0xff] ^ (c >> 8);
         } while (--n);
@@ -108,20 +111,20 @@ int fill_inbuf(eof_ok)
     /* Read as much as possible */
     insize = 0;
     do {
-       len = read_buffer (ifd, (char *) inbuf + insize, INBUFSIZ - insize);
-       if (len == 0) break;
-       if (len == -1) {
-         read_error();
-         break;
-       }
-       insize += len;
+        len = read_buffer (ifd, (char *) inbuf + insize, INBUFSIZ - insize);
+        if (len == 0) break;
+        if (len == -1) {
+          read_error();
+          break;
+        }
+        insize += len;
     } while (insize < INBUFSIZ);
 
     if (insize == 0) {
-       if (eof_ok) return EOF;
-       flush_window();
-       errno = 0;
-       read_error();
+        if (eof_ok) return EOF;
+        flush_window();
+        errno = 0;
+        read_error();
     }
     bytes_in += (off_t)insize;
     inptr = 1;
@@ -176,7 +179,7 @@ void flush_window()
     updcrc(window, outcnt);
 
     if (!test) {
-       write_buf(ofd, (char *)window, outcnt);
+        write_buf(ofd, (char *)window, outcnt);
     }
     bytes_out += (off_t)outcnt;
     outcnt = 0;
@@ -194,11 +197,11 @@ void write_buf(fd, buf, cnt)
     unsigned  n;
 
     while ((n = write_buffer (fd, buf, cnt)) != cnt) {
-       if (n == (unsigned)(-1)) {
-           write_error();
-       }
-       cnt -= n;
-       buf = (voidp)((char*)buf+n);
+        if (n == (unsigned)(-1)) {
+            write_error();
+        }
+        cnt -= n;
+        buf = (voidp)((char*)buf+n);
     }
 }
 
@@ -252,10 +255,10 @@ int xunlink (filename)
     {
       int e = errno;
       if (chmod (filename, S_IWUSR) != 0)
-       {
-         errno = e;
-         return -1;
-       }
+        {
+          errno = e;
+          return -1;
+        }
 
       r = unlink (filename);
     }
@@ -308,15 +311,15 @@ char *add_envopt(
     env_val = xstrdup (env_val);
 
     for (p = env_val; *p; nargc++ ) {        /* move through env_val */
-       p += strspn(p, SEPARATOR);           /* skip leading separators */
-       if (*p == '\0') break;
+        p += strspn(p, SEPARATOR);          /* skip leading separators */
+        if (*p == '\0') break;
 
-       p += strcspn(p, SEPARATOR);          /* find end of word */
-       if (*p) *p++ = '\0';                 /* mark it */
+        p += strcspn(p, SEPARATOR);         /* find end of word */
+        if (*p) *p++ = '\0';                /* mark it */
     }
     if (nargc == 0) {
-       free(env_val);
-       return NULL;
+        free(env_val);
+        return NULL;
     }
     *argcp += nargc;
     /* Allocate the new argv array, with an extra element just in case
@@ -333,9 +336,9 @@ char *add_envopt(
 
     /* Then copy the environment args */
     for (p = env_val; nargc > 0; nargc--) {
-       p += strspn(p, SEPARATOR);           /* skip separators */
-       *(nargv++) = p;                      /* store start */
-       while (*p++) ;                       /* skip over word */
+        p += strspn(p, SEPARATOR);          /* skip separators */
+        *(nargv++) = p;                             /* store start */
+        while (*p++) ;                      /* skip over word */
     }
 
     /* Finally copy the old args and add a NULL (usual convention) */
@@ -371,10 +374,10 @@ void read_error()
     int e = errno;
     fprintf (stderr, "\n%s: ", program_name);
     if (e != 0) {
-       errno = e;
-       perror(ifname);
+        errno = e;
+        perror(ifname);
     } else {
-       fprintf(stderr, "%s: unexpected end of file\n", ifname);
+        fprintf(stderr, "%s: unexpected end of file\n", ifname);
     }
     abort_gzip();
 }
@@ -413,29 +416,29 @@ void fprint_off(file, offset, width)
 
     /* Don't negate offset here; it might overflow.  */
     if (offset < 0) {
-       do
-         *--p = '0' - offset % 10;
-       while ((offset /= 10) != 0);
+        do
+          *--p = '0' - offset % 10;
+        while ((offset /= 10) != 0);
 
-       *--p = '-';
+        *--p = '-';
     } else {
-       do
-         *--p = '0' + offset % 10;
-       while ((offset /= 10) != 0);
+        do
+          *--p = '0' + offset % 10;
+        while ((offset /= 10) != 0);
     }
 
     width -= buf + sizeof buf - p;
     while (0 < width--) {
-       putc (' ', file);
+        putc (' ', file);
     }
     for (;  p < buf + sizeof buf;  p++)
-       putc (*p, file);
+        putc (*p, file);
 }
 
 /* ========================================================================
  * Table of CRC-32's of all single-byte values (made by makecrc.c)
  */
-ulg crc_32_tab[] = {
+static const ulg crc_32_tab[] = {
   0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
   0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
   0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
diff --git a/vms/Makefile.gcc b/vms/Makefile.gcc
deleted file mode 100644 (file)
index d4f8e64..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-# Makefile for gzip (GNU zip)    -*- Indented-Text -*-
-# Copyright (C) 1992-1993 Jean-loup Gailly and the Free Software Foundation
-# VMS version made by Klaus Reimann <kr@cip.physik.uni-stuttgart.de>,
-# revised by Roland B Roberts <roberts@nsrl31.nsrl.rochester.edu>.
-# This version is for gcc.
-
-# After constructing gzip.exe with this Makefile, you should set up
-# symbols for gzip.exe.  Edit the example below, changing
-# "disk:[directory]" as appropriate.
-#
-# $ gzip   == "$disk:[directory]gzip.exe"
-# $ gunzip == "$disk:[directory]gunzip.exe"
-# $ zcat   == "$disk:[directory]zcat.exe"
-
-
-# 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 3, 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.
-
-# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-#### Start of system configuration section. ####
-
-CC = gcc
-LINK = link
-
-CFLAGS =
-# CFLAGS = /warning
-LDFLAGS =
-
-# Things you might add to DEFS
-# -DDIRENT              Use <dirent.h>  for recursion (-r)
-# -DSYSDIR              Use <sys/dir.h> for recursion (-r)
-# -DSYSNDIR             Use <sys/ndir.h> for recursion (-r)
-# -DNDIR                Use <ndir.h> for recursion (-r)
-# -DSTDC_HEADERS        Use <stdlib.h>
-# -DHAVE_UNISTD_H      Use <unistd.h>
-# -DNO_UTIME_H         Don't use <utime.h>
-# -DHAVE_SYSUTIME_H    Use <sys/utime.h>
-# -DNO_MEMORY_H         Don't use <memory.h>. Not needed if STDC_HEADERS.
-# -DNO_STRING_H         Use strings.h, not string.h. Not needed if STDC_HEADERS
-# -DRETSIGTYPE=int      Define this if signal handlers must return an int.
-# -DNO_SYMLINK          OS defines S_IFLNK but does not support symbolic links
-# -DNO_MULTIPLE_DOTS    System does not allow file names with multiple dots
-# -DNO_UTIME           System does not support setting file modification time
-# -DNO_CHOWN           System does not support setting file owner
-# -DNO_DIR             System does not support readdir()
-# -DPROTO              Force function prototypes even if __STDC__ not defined
-# -DASMV               Use asm version match.S
-# -DMSDOS              MSDOS specific
-# -DOS2                        OS/2 specific
-# -DVAXC               Vax/VMS with Vax C compiler
-# -DVMS                        Vax/VMS with gcc
-# -DDEBUG              Debug code
-# -DDYN_ALLOC          Use dynamic allocation of large data structures
-# -DMAXSEG_64K         Maximum array size is 64K (for 16 bit system)
-# -DRECORD_IO           read() and write() are rounded to record sizes.
-# -DNO_STDIN_FSTAT      fstat() is not available on stdin
-# -DNO_SIZE_CHECK       stat() does not give a reliable file size
-
-DEFS = /define=(VMS)
-LIBS = #@LIBS@
-
-X=.exe
-O=.obj
-
-# additional assembly sources for particular systems be required.
-OBJA = #@OBJA@
-
-#### End of system configuration section. ####
-
-OBJS = gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O util$O \
-       crypt$O lzw$O unlzw$O unpack$O unlzh$O getopt$O vms$O $(OBJA)
-
-# --- rules ---
-
-*$O:   *.c
-       $(CC) $* $(DEFS) $(CFLAGS)
-#      create sys$output
-#              $(CC) $* $(DEFS) $(CFLAGS)$
-
-default:  all
-
-all:   gzip$X #zcmp zdiff zmore znew
-
-gzip$X : $(OBJS) #Makefile
-  linkobjs:=$(OBJS)
-  Schleife:
-       p = f$locate(" ",linkobjs)
-       if p .lt. f$length(linkobjs)
-               then    linkobjs[p,1]:=","
-                       goto Schleife
-       endif
-  write sys$output "linking ''linkobjs'"
-  $(LINK) $(LDFLAGS) /exec=gzip$X  'linkobjs',sys$input/opt
-       GNU_CC:[000000]GCCLIB/LIB,SYS$LIBRARY:VAXCRTL/SHARE $
-
-#  Create a hard link.  To remove both files, use "make clean".  Using a hard
-#  link saves disk space, by the way.  Note, however, that copying a hard link
-#  copies the data, not just the link.  Therefore, set up the link in the
-#  directory in which the executable is to reside, or else rename (move) the
-#  executables into the directory.
-#
-  set file/enter=gunzip.exe gzip.exe
-  set file/enter=zcat.exe   gzip.exe
-
-
-clean:
-       set file/remove gunzip.exe;0
-       set file/remove zcat.exe;0
-       delete gzip.exe;0
-       delete *$O;0
-
-# Actual build-related targets
-
-gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O: gzip.h tailor.h
-util$O lzw$O unlzw$O unpack$O unlzh$O crypt$O: gzip.h tailor.h
-
-gzip$O unlzw$O: revision.h lzw.h
-
-bits$O unzip$O util$O zip$O: crypt.h
-
-gzip$O getopt$O: getopt.h
diff --git a/vms/Makefile.mms b/vms/Makefile.mms
deleted file mode 100644 (file)
index 075a11b..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-# Makefile for gzip (GNU zip)    -*- Indented-Text -*-
-# Copyright (C) 1992-1993 Jean-loup Gailly and the Free Software Foundation
-# VMS version made by Klaus Reimann <kr@cip.physik.uni-stuttgart.de>,
-# revised by Roland B Roberts <roberts@nsrl31.nsrl.rochester.edu>
-# and Karl-Jose Filler <pla_jfi@pki-nbg.philips.de>
-# This version is for VAXC with MMS.
-
-# After constructing gzip.exe with this Makefile, you should set up
-# symbols for gzip.exe.  Edit the example below, changing
-# "disk:[directory]" as appropriate.
-#
-# $ gzip   == "$disk:[directory]gzip.exe"
-# $ gunzip == "$disk:[directory]gunzip.exe"
-# $ zcat   == "$disk:[directory]zcat.exe"
-
-
-# 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 3, 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.
-
-# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-#### Start of system configuration section. ####
-
-CC = cc
-LINK = link
-
-CFLAGS =
-# CFLAGS = /warning
-LDFLAGS =
-
-# Things you might add to DEFS
-# -DDIRENT              Use <dirent.h>  for recursion (-r)
-# -DSYSDIR              Use <sys/dir.h> for recursion (-r)
-# -DSYSNDIR             Use <sys/ndir.h> for recursion (-r)
-# -DNDIR                Use <ndir.h> for recursion (-r)
-# -DSTDC_HEADERS        Use <stdlib.h>
-# -DHAVE_UNISTD_H      Use <unistd.h>
-# -DNO_UTIME_H         Don't use <utime.h>
-# -DHAVE_SYSUTIME_H    Use <sys/utime.h>
-# -DNO_MEMORY_H         Don't use <memory.h>. Not needed if STDC_HEADERS.
-# -DNO_STRING_H         Use strings.h, not string.h. Not needed if STDC_HEADERS
-# -DRETSIGTYPE=int      Define this if signal handlers must return an int.
-# -DNO_SYMLINK          OS defines S_IFLNK but does not support symbolic links
-# -DNO_MULTIPLE_DOTS    System does not allow file names with multiple dots
-# -DNO_UTIME           System does not support setting file modification time
-# -DNO_CHOWN           System does not support setting file owner
-# -DNO_DIR             System does not support readdir()
-# -DPROTO              Force function prototypes even if __STDC__ not defined
-# -DASMV               Use asm version match.S
-# -DMSDOS              MSDOS specific
-# -DOS2                        OS/2 specific
-# -DVAXC               Vax/VMS with Vax C compiler
-# -DVMS                        Vax/VMS with gcc
-# -DDEBUG              Debug code
-# -DDYN_ALLOC          Use dynamic allocation of large data structures
-# -DMAXSEG_64K         Maximum array size is 64K (for 16 bit system)
-# -DRECORD_IO           read() and write() are rounded to record sizes.
-# -DNO_STDIN_FSTAT      fstat() is not available on stdin
-# -DNO_SIZE_CHECK       stat() does not give a reliable file size
-
-# DEFS = /define=(VAXC)
-DEFS =
-LIBS =
-
-X=.exe
-O=.obj
-
-# additional assembly sources for particular systems be required.
-OBJA =
-
-#### End of system configuration section. ####
-
-OBJS = gzip.obj zip.obj deflate.obj trees.obj bits.obj unzip.obj inflate.obj \
-       util.obj crypt.obj lzw.obj unlzw.obj unpack.obj unlzh.obj getopt.obj \
-       vms.obj $(OBJA)
-
-# --- rules ---
-
-.c.obj :
-       define/user sys sys$library
-       $(CC) $* $(DEFS) $(CFLAGS)
-#      create sys.output
-#              $(CC) $* $(DEFS) $(CFLAGS)$
-
-gzip.exe : $(OBJS)
-       define lnk$library sys$share:vaxcrtl
-       $(LINK) $(LDFLAGS) /exec=gzip  $+
-#
-#  Create a hard link.  To remove both files, use "make clean".  Using a hard
-#  link saves disk space, by the way.  Note, however, that copying a hard link
-#  copies the data, not just the link.  Therefore, set up the link in the
-#  directory in which the executable is to reside, or else rename (move) the
-#  executables into the directory.
-#
-       set file/enter=gunzip.exe gzip.exe
-       set file/enter=zcat.exe   gzip.exe
-
-clean :
-       set file/remove gunzip.exe;0
-       set file/remove zcat.exe;0
-       delete gzip.exe;0
-       delete *.obj;0
-
-# Actual build-related targets
-
-gzip.obj zip.obj deflate.obj trees.obj bits.obj unzip.obj inflate.obj : gzip.h tailor.h
-util.obj lzw.obj unlzw.obj unpack.obj unlzh.obj crypt.obj : gzip.h tailor.h
-
-gzip.obj unlzw.obj : revision.h lzw.h
-
-bits.obj unzip.obj util.obj zip.obj : crypt.h
-
-gzip.obj getopt.obj : getopt.h
diff --git a/vms/Makefile.vms b/vms/Makefile.vms
deleted file mode 100644 (file)
index 1063f5b..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-# Makefile for gzip (GNU zip)    -*- Indented-Text -*-
-# Copyright (C) 1992-1993 Jean-loup Gailly and the Free Software Foundation
-# VMS version made by Klaus Reimann <kr@cip.physik.uni-stuttgart.de>,
-# revised by Roland B Roberts <roberts@nsrl31.nsrl.rochester.edu>.
-# This version is for VAXC. Tested with Todd Aven's MAKE/VMS.
-
-# After constructing gzip.exe with this Makefile, you should set up
-# symbols for gzip.exe.  Edit the example below, changing
-# "disk:[directory]" as appropriate.
-#
-# $ gzip   == "$disk:[directory]gzip.exe"
-# $ gunzip == "$disk:[directory]gunzip.exe"
-# $ zcat   == "$disk:[directory]zcat.exe"
-
-
-# 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 3, 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.
-
-# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-#### Start of system configuration section. ####
-
-CC = cc
-LINK = link
-
-CFLAGS =
-# CFLAGS = /warning
-LDFLAGS =
-
-# Things you might add to DEFS
-# -DDIRENT              Use <dirent.h>  for recursion (-r)
-# -DSYSDIR              Use <sys/dir.h> for recursion (-r)
-# -DSYSNDIR             Use <sys/ndir.h> for recursion (-r)
-# -DNDIR                Use <ndir.h> for recursion (-r)
-# -DSTDC_HEADERS        Use <stdlib.h>
-# -DHAVE_UNISTD_H      Use <unistd.h>
-# -DNO_UTIME_H         Don't use <utime.h>
-# -DHAVE_SYSUTIME_H    Use <sys/utime.h>
-# -DNO_MEMORY_H         Don't use <memory.h>. Not needed if STDC_HEADERS.
-# -DNO_STRING_H         Use strings.h, not string.h. Not needed if STDC_HEADERS
-# -DRETSIGTYPE=int      Define this if signal handlers must return an int.
-# -DNO_SYMLINK          OS defines S_IFLNK but does not support symbolic links
-# -DNO_MULTIPLE_DOTS    System does not allow file names with multiple dots
-# -DNO_UTIME           System does not support setting file modification time
-# -DNO_CHOWN           System does not support setting file owner
-# -DNO_DIR             System does not support readdir()
-# -DPROTO              Force function prototypes even if __STDC__ not defined
-# -DASMV               Use asm version match.S
-# -DMSDOS              MSDOS specific
-# -DOS2                        OS/2 specific
-# -DVAXC               Vax/VMS with Vax C compiler
-# -DVMS                        Vax/VMS with gcc
-# -DDEBUG              Debug code
-# -DDYN_ALLOC          Use dynamic allocation of large data structures
-# -DMAXSEG_64K         Maximum array size is 64K (for 16 bit system)
-# -DRECORD_IO           read() and write() are rounded to record sizes.
-# -DNO_STDIN_FSTAT      fstat() is not available on stdin
-# -DNO_SIZE_CHECK       stat() does not give a reliable file size
-
-# DEFS = /define=(VAXC)
-DEFS =
-LIBS =
-
-X=.exe
-O=.obj
-
-# additional assembly sources for particular systems be required.
-OBJA =
-
-#### End of system configuration section. ####
-
-OBJS = gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O util$O \
-       crypt$O lzw$O unlzw$O unpack$O unlzh$O getopt$O vms$O $(OBJA)
-
-# --- rules ---
-
-*$O:   *.c
-       define/user sys sys$library
-       $(CC) $* $(DEFS) $(CFLAGS)
-#      create sys$output
-#              $(CC) $* $(DEFS) $(CFLAGS)$
-
-default:  all
-
-all:   gzip$X #zcmp zdiff zmore znew
-
-gzip$X : $(OBJS) #Makefile
-  linkobjs:=$(OBJS)
-  Schleife:
-       p = f$locate(" ",linkobjs)
-       if p .lt. f$length(linkobjs)
-               then    linkobjs[p,1]:=","
-                       goto Schleife
-       endif
-  write sys$output "linking ''linkobjs'"
-  $(LINK) $(LDFLAGS) /exec=gzip$X  'linkobjs',sys$input/opt
-       SYS$LIBRARY:VAXCRTL/SHARE $
-#
-#  Create a hard link.  To remove both files, use "make clean".  Using a hard
-#  link saves disk space, by the way.  Note, however, that copying a hard link
-#  copies the data, not just the link.  Therefore, set up the link in the
-#  directory in which the executable is to reside, or else rename (move) the
-#  executables into the directory.
-#
-  set file/enter=gunzip.exe gzip.exe
-  set file/enter=zcat.exe   gzip.exe
-
-
-clean:
-       set file/remove gunzip.exe;0
-       set file/remove zcat.exe;0
-       delete gzip.exe;0
-       delete *$O;0
-
-# Actual build-related targets
-
-gzip$O zip$O deflate$O trees$O bits$O unzip$O inflate$O: gzip.h tailor.h
-util$O lzw$O unlzw$O unpack$O unlzh$O crypt$O: gzip.h tailor.h
-
-gzip$O unlzw$O: revision.h lzw.h
-
-bits$O unzip$O util$O zip$O: crypt.h
-
-gzip$O getopt$O: getopt.h
diff --git a/vms/Readme.vms b/vms/Readme.vms
deleted file mode 100644 (file)
index 6c5c18b..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-README file for gzip on VMS
-written by Klaus Reimann <kr@cip.physik.uni-stuttgart.de>
-
-Here is a list of the files in [.vms]:
-
-GZIP.HLP       ! Help-file, how to use gzip
-MAKEFILE.GCC   ! Description for (vms-)make,  using gcc
-MAKEFILE.MMS   ! Description for MMS-utility, using vaxc
-MAKEFILE.VMS   ! Description for (vms-)make,  using vaxc
-MAKEGZIP.COM   ! simple and robust DCL-Script, using vaxc
-README.VMS     ! this file, how to install gzip
-VMS.C          ! VMS-specific functions in gzip
-
-This file describe, how to compile and install the VMS-Port of gzip.
->>For restrictions or bugs due to the structure of the vms-file system
-refer to gzip.hlp.<<
-
-Installing gzip
-
-Since there are many makefiles there are many possibilities
-compiling and installing gzip. For most of them, it is important,
-that you start them from the SOURCE-Directory (that is where
-gzip.c is), not from the [.vms]-directory. Otherwise the compiler
-won't find the source-files.
-
-Using gcc saves disk-space, but needs longer to compile
-       VAXC     gzip.exe 95/96 Blocks
-       gcc2.3.3 gzip.exe 86/87 Blocks
-
-To install gzip one has to perform the following steps:
-  1. compile sources (*.c, [.vms]*.c)
-  2. link executable gzip.exe
-  3. Make entries gunzip.exe and zcat.exe to gzip.exe.
-     These are similar to hardlinks in UNIX
-     >>If You wish to do this by hand, see for example makegzip.com.<<
-     The Entries can't be simply deleted, use  'set file /remove' .
-
-  4. Rename executables (*.exe) to Your prefered exe-directory. If it is on
-     another Device, then you should only copy gzip.exe and do the
-     entries gunzip.exe and zcat.exe by hand (3.).
-
-  5. Setting up Symbols for the executables:
-     Place the following lines in Your login.com
-     Change "disk:[directory]" as appropriate.
-       $ gzip   == "$disk:[directory]gzip.exe"
-       $ gunzip == "$disk:[directory]gunzip.exe"
-       $ zcat   == "$disk:[directory]zcat.exe"
-  6. insert help-file gzip.hlp in any Help-library,
-     for example in sys$help:helplib.
-     this can be done by $lib sys$help:helplib/help gzip
-     (I did not try this command)
-
-Steps (4.)5. through 6 must be done by hand.
-Steps 1 through 3(4.) may be done by one of the makefiles:
-
-a) MAKEGZIP.COM
-This was crated from MAKEFILE.VMS and later on edited. It uses the
-VAXC-Compiler and does compiling, linking and making the entries.
-Usage:
-- change to the Source-Directory
-- copy vms.c
-       $copy [.vms]vms.c []
-- start compiling, linking, entries
-       $@[.vms]makegzip
-if everything is OK. then you get gzip.exe, gunzip.exe, zcat.exe
-continue at Step 4.
-
-b) MAKEFILE.VMS
-Makefile for a vms-make utility (NOT gnu-make).
-Is uses the VAXC-Compiler and has the Advantage over MAKEGZIP.COM
-that make checks dependencies. This is helpfull if You have to
-recompile several times, for example after editing the sources.
-- change to the Source-Directory
-- copy vms.c
-       $copy [.vms]vms.c []
-- start compiling, linking, entries
-       $make /input=[.vms]makefile.vms
-if everything is OK. then you get gzip.exe, gunzip.exe, zcat.exe
-Continue at Step 4.
-
-c) MAKEFILE.GCC
-Same as MAKEFILE.VMS, but uses gcc
-- Use $make /input=[.vms]makefile.gcc   instead of make ....
-
-d) MAKEFILE.MMS
-Makefile for the MMS-utility. Similar to MAKEFILE.VMS
-- Use $mms /description=[.vms]makefile.mms  instead of make ....
diff --git a/vms/gzip.hlp b/vms/gzip.hlp
deleted file mode 100644 (file)
index 0bee536..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-1 GZIP
-NAME
-     gzip, gunzip, zcat - compress or expand files
-
-SYNOPSIS
-     gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ]
-     gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ]
-     zcat [ -fhLV ] [ name ... ]
-
-2 DESCRIPTION
-     Gzip reduces the size of the named  files  using  Lempel-Ziv
-     coding  (LZ77).  Whenever possible, each file is replaced by
-     one with the extension .gz, while keeping the same ownership
-     modes,  access  and modification times.  (The default exten-
-     sion is -gz for VMS, z for MSDOS, OS/2 FAT, Windows  NT  FAT
-     and  Atari.) If no files are specified, or if a file name is
-     "-", the standard input is compressed to the  standard  out-
-     put.   Gzip will only attempt to compress regular files.
-
-     If the compressed file name is too long for its file system,
-     gzip truncates it.  Gzip attempts to truncate only the parts
-     of the file name longer than 3 characters.  (A part is  del-
-     imited  by  dots.) If the name consists of small parts only,
-     the longest parts are truncated. For example, if file  names
-     are  limited  to 14 characters, gzip.msdos.exe is compressed
-     to gzi.msd.exe.gz.  Names are not truncated on systems which
-     do not have a limit on file name length.
-
-     By default, gzip keeps the original file name and  timestamp
-     in  the  compressed  file. These are used when decompressing
-     the file with  the  -N  option.  This  is  useful  when  the
-     compressed  file  name  was truncated or when the time stamp
-     was not preserved after a file transfer.
-
-     Compressed files can be  restored  to  their  original  form
-     using  gzip -d or gunzip or zcat. If the original name saved
-     in the compressed file is not suitable for its file  system,
-     a  new  name is constructed from the original one to make it
-     legal.
-
-     gunzip takes a  list  of  files  on  its  command  line  and
-     replaces each file whose name ends with .gz, -gz, .z, -z, _z
-     or .Z and which begins with the correct magic number with an
-     uncompressed  file  without  the original extension.  gunzip
-     also recognizes the special  extensions  .tgz  and  .taz  as
-     shorthands   for  .tar.gz  and  .tar.Z  respectively.   When
-     compressing, gzip  uses  the  .tgz  extension  if  necessary
-     instead of truncating a file with a .tar extension.
-
-     gunzip can currently decompress files created by gzip,  zip,
-     compress,  compress  -H  or pack. The detection of the input
-     format is automatic.  When  using  the  first  two  formats,
-     gunzip  checks  a  32  bit  CRC. For pack, gunzip checks the
-     uncompressed length. The standard compress  format  was  not
-     designed  to  allow  consistency  checks.  However gunzip is
-     sometimes able to detect a bad .Z file. If you get an  error
-     when uncompressing a .Z file, do not assume that the .Z file
-     is correct simply because the standard uncompress  does  not
-     complain.  This generally means that the standard uncompress
-     does not check its input, and happily generates garbage out-
-     put.   The  SCO  compress -H format (lzh compression method)
-     does not include a CRC  but  also  allows  some  consistency
-     checks.
-
-     Files created by zip can be uncompressed  by  gzip  only  if
-     they  have  a  single member compressed with the 'deflation'
-     method. This feature is only intended to help conversion  of
-     tar.zip  files  to  the  tar.gz format. To extract zip files
-     with several members, use unzip instead of gunzip.
-
-     zcat is identical to gunzip -c. (On some systems,  zcat  may
-     be  installed  as  gzcat  to  preserve  the original link to
-     compress.) zcat uncompresses either a list of files  on  the
-     command   line   or   its  standard  input  and  writes  the
-     uncompressed data on standard output.  zcat will  uncompress
-     files that have the correct magic number whether they have a
-     .gz suffix or not.
-
-     Gzip uses the Lempel-Ziv algorithm used in  zip  and  PKZIP.
-     The  amount  of  compression obtained depends on the size of
-     the input and the distribution of common substrings.   Typi-
-     cally,  text  such  as  source code or English is reduced by
-     60-70%.  Compression is  generally  much  better  than  that
-     achieved  by  LZW  (as used in compress), Huffman coding (as
-     used in pack), or adaptive Huffman coding (compact).
-
-     Compression is always performed, even if the compressed file
-     is  slightly larger than the original. The worst case expan-
-     sion is a few bytes for the gzip file header, plus  5  bytes
-     every  32K  block, or an expansion ratio of 0.015% for large
-     files. Note that the  actual  number  of  used  disk  blocks
-     almost  never increases.  gzip preserves the mode, ownership
-     and timestamps of files when compressing or decompressing.
-
-2 OPTIONS
-     -a --ascii
-          Ascii text mode: convert end-of-lines using local  con-
-          ventions.  This  option  is supported only on some non-
-          Unix systems. For MSDOS, CR LF is converted to LF  when
-          compressing,   and  LF  is  converted  to  CR  LF  when
-          decompressing.
-
-     -c --stdout --to-stdout
-          Write output on standard output;  keep  original  files
-          unchanged.   If there are several input files, the out-
-          put consists of a sequence of independently  compressed
-          members.  To obtain better compression, concatenate all
-          input files before compressing them.
-
-     -d --decompress --uncompress
-          Decompress.
-
-     -f --force
-          Force compression or decompression even if the file has
-          multiple   links  or  the  corresponding  file  already
-          exists, or if the compressed data is read from or writ-
-          ten to a terminal. If the input data is not in a format
-          recognized by gzip, and if the option --stdout is  also
-          given,  copy the input data without change to the stan-
-          dard output: let zcat behave as cat. If -f is not given,
-          and when not running in the background, gzip prompts to
-          verify whether an existing file should be overwritten.
-
-     -h --help
-          Display a help screen and quit.
-
-     -l --list
-          For each compressed file, list the following fields:
-
-              compressed size: size of the compressed file
-              uncompressed size: size of the uncompressed file
-              ratio: compression ratio (0.0% if unknown)
-              uncompressed_name: name of the uncompressed file
-
-          The uncompressed size is given as -1 on VMS because it
-         it is not possible to seek reliably to the end of the
-          compressed file, where this size is stored.
-
-          In combination with the --verbose option, the following
-          fields are also displayed:
-
-              method: compression method
-              crc: the 32-bit CRC of the uncompressed data
-              date & time: time stamp for the uncompressed file
-
-          The  compression  methods   currently   supported   are
-          deflate, compress, lzh (SCO compress -H) and pack.  The
-          crc is given  as  ffffffff  on VMS for the reason given
-          above about the uncompressed size.
-
-         With --name, the uncompressed name,  date and time  are
-         those stored within the compress file if present.
-
-          With --verbose, the size totals and  compression  ratio
-          for  all files is also displayed, unless some sizes are
-          unknown. With --quiet, the title and totals  lines  are
-          not displayed.
-
-     -L --license
-          Display the gzip license and quit.
-
-     -n --no-name
-          When compressing, do not save the  original  file  name
-          and time stamp by default. (The original name is always
-          saved  if  the  name  had  to   be   truncated.)   When
-          decompressing, do not restore the original file name if
-          present  (remove  only  the  gzip   suffix   from   the
-          compressed  file  name) and do not restore the original
-          time stamp if present  (copy  it  from  the  compressed
-          file). This option is the default when decompressing.
-
-     -N --name
-          When compressing, always save the  original  file  name
-          and  time  stamp; this is the default. When decompress-
-          ing, restore the original file name and time  stamp  if
-          present.  This option is useful on systems which have a
-          limit on file name length or when the  time  stamp  has
-          been lost after a file transfer.
-
-     -q --quiet
-          Suppress all warnings.
-
-     -r --recursive
-          Travel the directory structure recursively. If  any  of
-          the file names specified on the command line are direc-
-          tories,  gzip  will  descend  into  the  directory  and
-          compress  all  the  files it finds there (or decompress
-          them in the case of gunzip ).
-
-     -S suf --suffix suf
-          Use suffix suf instead  of  -gz.   Any  suffix  can  be
-          given,  but  suffixes  other  than -z and -gz should be
-          avoided to avoid confusion when files  are  transferred
-          to   other.   A  null  suffix  forces  gunzip  to   try
-          decompression on all given files regardless of  suffix,
-          as in:
-
-              gunzip --suffix "" *.*
-
-          Previous versions of gzip used the -z suffix. This  was
-          changed to avoid a conflict with pack on Unix.
-
-     -t --test
-          Test. Check the compressed file integrity.
-
-     -v --verbose
-          Verbose. Display the name and percentage reduction  for
-          each file compressed or decompressed.
-
-     -V --version
-          Version. Display the  version  number  and  compilation
-          options then quit.
-
-     -# --fast --best
-          Regulate the speed of compression using  the  specified
-          digit  #,  where  -1  or  --fast  indicates the fastest
-          compression method (less compression) and -9 or  --best
-          indicates the slowest compression method (best compres-
-          sion).  The default compression level is -6  (that  is,
-          biased towards high compression at expense of speed).
-
-2 ENVIRONMENT
-     The environment variable GZIP_OPT can hold a set of  default
-     options  for  gzip.  These options are interpreted first and
-     can be overwritten by explicit command line  parameters. For
-     example:
-           define GZIP_OPT "-8 -v"
-
-2 SEE ALSO
-     compress, zip, unzip
-
-2 DIAGNOSTICS
-     Exit status is normally 0; if an error occurs,  exit  status
-     is 1. If a warning occurs, exit status is 2.
-
-     Usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...]
-             Invalid options were specified on the command line.
-     file: not in gzip format
-             The  file  specified  to   gunzip   has   not   been
-             compressed.
-     file: Corrupt input. Use zcat to recover some data.
-             The compressed file has been damaged. The data up to
-             the point of failure can be recovered using
-                   define /user sys$output file.recover
-                   zcat file
-     file: compressed with xx bits, can only handle yy bits
-             File was compressed (using LZW) by  a  program  that
-             could  deal  with more bits than the decompress code
-             on this machine.  Recompress  the  file  with  gzip,
-             which compresses better and uses less memory.
-     file: already has -gz suffix -- no change
-             The  file  is  assumed  to  be  already  compressed.
-             Rename the file and try again.
-     file already exists; do you wish to overwrite (y or n)?
-             Respond "y" if  you  want  the  output  file  to  be
-             replaced; "n" if not.
-     gunzip: corrupt input
-             A SIGSEGV violation was detected which usually means
-             that the input file has been corrupted.
-     xx.x%
-             Percentage  of  the  input  saved  by   compression.
-             (Relevant only for -v and -l.)
-     -- not a regular file or directory: ignored
-             When the input file is not a regular file or  direc-
-             tory, it is left unaltered.
-
-2 CAVEATS
-     On VMS:
-     - upper case options need quotes: gzip "-V".
-     - restoration of timestamps and version numbers is not supported
-     - If a compressed file already exists, gzip -f overwrites it, it
-       does not create a new version.
-     - multi-part gzip files are not supported.
-     - gunzip does not preserve the input file format. You can use a
-       separate utility to restore the original format.
-     - gunzip and zcat can be used only if you have created the
-       links to gzip as documented in makegzip.com.  Otherwise
-       you must use explicit parameters ("gzip -c" or "gzip -dc").
-     - gzip --list cannot give the uncompressed size and crc.
-
-     When writing compressed data to  a  tape,  it  is  generally
-     necessary  to pad the output with zeroes up to a block boun-
-     dary. When the data is read and the whole block is passed to
-     gunzip for decompression, gunzip detects that there is extra
-     trailing garbage after the compressed data and emits a warn-
-     ing  by  default.  You  have  to  use  the --quiet option to
-     suppress the warning. This option can be set in the GZIP_OPT
-     environment variable as in:
-         define GZIP_OPT "-q"
-
-2 BUGS
-     On VMS, files in VFC record format are not correctly handled by
-     the C runtime library (the linefeed character is suppressed).
-
-     In some rare cases, the --best option gives  worse  compres-
-     sion than the default compression level (-6). On some highly
-     redundant files, compress compresses better than gzip.
diff --git a/vms/makegzip.com b/vms/makegzip.com
deleted file mode 100644 (file)
index eec372c..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-$! Makefile for VMS
-$! DCL-Shell-language. Edit the symbols section at the end.
-$!
-$ On Control_Y Then Goto The_Exit
-$ On Error Then Goto The_Exit
-$ define/user sys sys$library
-$ cc gzip.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc zip.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc deflate.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc trees.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc bits.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc unzip.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc inflate.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc util.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc crypt.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc lzw.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc unlzw.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc unpack.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc unlzh.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc getopt.c /define=(VAXC)
-$ define/user sys sys$library
-$ cc vms.c /define=(VAXC)
-$ linkobjs:=gzip.obj zip.obj deflate.obj trees.obj bits.obj unzip.obj -
-   inflate.obj util.obj crypt.obj lzw.obj unlzw.obj unpack.obj unlzh.obj -
-   getopt.obj vms.obj
-$ Schleife:
-$ p = f$locate(" ",linkobjs)
-$ if p .lt. f$length(linkobjs)
-$ then linkobjs[p,1]:=","
-$ goto Schleife
-$ endif
-$ write sys$output "linking ''linkobjs'"
-$ link  /exec=gzip.exe  'linkobjs',sys$input/opt
-SYS$LIBRARY:VAXCRTL/SHARE
-$
-$ ! Create a hard link.  (To remove both files, delete the copy FIRST, then
-$ ! the original.  Otherwise, if original deleted first [copy says "no such
-$ ! file"], must use "set file/remove gunzip.exe;#" to get rid of the copy.
-$ ! Unlike in Unix, deleting the original ALWAYS destroys the data--but not
-$ ! the directory entry of the copy.)  Using a hard link saves disk space, by
-$ ! the way.  Note, however, that copying a hard link copies the data, not
-$ ! just the link.  Therefore, set up the link in the directory in which the
-$ ! executable is to reside, or else rename (move) the executables into the
-$ ! directory.
-$ !
-$ set file/enter=gunzip.exe gzip.exe
-$ set file/enter=zcat.exe   gzip.exe
-$
-$ ! Set up symbols for the gzip executable.  Edit the example below,
-$ ! changing "disk:[directory]" as appropriate.
-$ !
-$ gzip   == "$disk:[directory]gzip.exe"
-$ gunzip == "$disk:[directory]gunzip.exe"
-$ zcat   == "$disk:[directory]zcat.exe"
-$
-$The_Exit:
-$ Save_Status = $STATUS
-$ exit Save_Status
diff --git a/vms/vms.c b/vms/vms.c
deleted file mode 100644 (file)
index 3383ee9..0000000
--- a/vms/vms.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* vms.c -- target dependent functions for VMS
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License, see the file COPYING.
- *
- * This file was written by Karl-Jose Filler <pla_jfi@pki-nbg.philips.de>
- * and updated by Jean-loup Gailly.
- */
-
-#include <config.h>
-#include <stdio.h>
-
-static char **vms_argv = NULL;
-
-static int max_files = 10000;
-
-struct Str_desc {
-    int     length;
-    char    *addr;
-};
-
-vms_expand_args(old_argc, argv)
-    int *old_argc;
-    char **argv[];
-{
-    int            i;
-    int            new_argc = 0;
-    int            context, status;
-    char    buf[255], *p;
-
-    vms_argv = xmalloc((max_files+1)*sizeof(char*));
-
-    vms_argv[new_argc++] = **argv;
-
-    for (i=1; i < *old_argc; i++) {
-       if (*argv[0][i] == '-') {   /* switches */
-           if (new_argc < max_files) {
-               vms_argv[new_argc++] = argv[0][i];
-           }
-       } else {                    /* Files */
-           context = 0;
-           if (find_file_c(argv[0][i], buf, sizeof(buf), &context) & 1 != 1) {
-               /*
-                * Wrong file ?
-                * forward it to gzip
-                */
-               if (new_argc < max_files) {
-                   vms_argv[new_argc++] = argv[0][i];
-               }
-           } else {
-               p = xmalloc(strlen(buf)+1);
-               strcpy(p, buf);
-               if (new_argc < max_files) {
-                   vms_argv[new_argc++] = p;
-               }
-               while (find_file_c(argv[0][i], buf,
-                      sizeof(buf), &context) & 1 == 1) {
-                   p = xmalloc(strlen(buf)+1);
-                   strcpy(p, buf);
-                   if (new_argc < max_files) {
-                       vms_argv[new_argc++] = p;
-                   }
-               }
-           }
-       }
-    }
-    if (new_argc <= max_files) {
-       *old_argc = new_argc;
-       vms_argv[new_argc] = NULL;
-       *argv = vms_argv;
-    } else {
-       free(vms_argv); /* the expanded file names should also be freed ... */
-       vms_argv = NULL;
-       max_files = new_argc + 1;
-       vms_expand_args(old_argc, argv);
-    }
-}
-
-int find_file_c(in,out,out_len,context)
-    char *in;
-    char *out;
-    int   out_len;
-    int  *context;
-{
-    struct     Str_desc in_desc,out_desc;
-    int                status;
-    char       *p;
-
-    in_desc.addr = in;
-    in_desc.length = strlen(in);
-
-    out_desc.addr = out;
-    out_desc.length = out_len;
-
-    status = lib$find_file(&in_desc,&out_desc,context);
-
-    p   = out_desc.addr;
-    while(*p != ' ') {
-       p++;
-    }
-    *p = 0;
-
-    return status;
-}
diff --git a/zcat.in b/zcat.in
index 5b3dba16d8c1f9ef26e973c918dd328e0b7a4f0e..977f2d1f35d1025f063b5b3b43f1817e583cff20 100644 (file)
--- a/zcat.in
+++ b/zcat.in
@@ -24,7 +24,7 @@ esac
 PATH=$bindir:$PATH
 
 version="zcat (gzip) @VERSION@
-Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+Copyright (C) 2007, 2011-2012 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
diff --git a/zcmp.in b/zcmp.in
index d3fb95674990af0a74996345597af9439d3d14de..eab0ea4b1f1ebaf3677e843d654d4c09f51050e7 100644 (file)
--- a/zcmp.in
+++ b/zcmp.in
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Compare the uncompressed contents of compressed files, byte by byte.
 
-# Copyright (C) 2007 Free Software Foundation
+# Copyright (C) 2007, 2010-2012 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
@@ -24,7 +24,7 @@ esac
 PATH=$bindir:$PATH
 
 version="zcmp (gzip) @VERSION@
-Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
@@ -42,9 +42,10 @@ If a FILE is '-' or missing, read standard input.
 
 Report bugs to <bug-gzip@gnu.org>."
 
+st=0
 case $1 in
---help)    exec echo "$usage";;
---version) exec echo "$version";;
+--help)    echo "$usage" || st=2; exit $st;;
+--version) echo "$version" || st=2; exit $st;;
 esac
 
 exec zdiff --__cmp "$@"
index 9d3b4aed0a1bd842b84a1b7e71ba2fa987d367af..5ac8890c4f93508dfeace43a1cb10772ef963d5c 100644 (file)
--- a/zdiff.in
+++ b/zdiff.in
@@ -26,12 +26,12 @@ PATH=$bindir:$PATH
 
 case $1 in
   --__cmp) shift
-       prog=cmp;  cmp='${CMP-cmp}'  ;;
+        prog=cmp;  cmp='${CMP-cmp}'  ;;
   *)    prog=diff; cmp='${DIFF-diff}';;
 esac
 
 version="z$prog (gzip) @VERSION@
-Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+Copyright (C) 2009, 2011-2012 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
@@ -88,78 +88,78 @@ if test $# -eq 1; then
     exit 2;;
   esac
 elif test $# -eq 2; then
-       case "$1" in
-       *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
+        case "$1" in
+        *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
                 case "$2" in
-               *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
-                   if test "$1$2" = --; then
-                       gzip_status=$(
-                         exec 4>&1
-                         (gzip -cdfq - 4>&-; echo $? >&4) 3>&- |
-                           eval "$cmp" - - >&3
-                       )
-                   elif
-                       # Reject Solaris 8's buggy /bin/bash 2.03.
-                       echo X |
-                        (echo X | eval "$cmp" /dev/fd/5 - >/dev/null 2>&1) \
-                               5<&0
-                   then
-                       gzip_status=$(
-                         exec 4>&1
-                         (gzip -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- |
-                           ( (gzip -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- 5<&- </dev/null |
-                              eval "$cmp" /dev/fd/5 - >&3) 5<&0
-                       )
-                       cmp_status=$?
-                       case $gzip_status in
-                         *[1-9]*) gzip_status=1;;
-                         *) gzip_status=0;;
-                       esac
-                       (exit $cmp_status)
-                   else
-                       F=`expr "/$2" : '.*/\(.*\)[-.][zZtga]*$'` || F=$prog
-                       tmp=
-                       trap '
-                         test -n "$tmp" && rm -f "$tmp"
-                         (exit 2); exit 2
-                       ' HUP INT PIPE TERM 0
-                       if type mktemp >/dev/null 2>&1; then
-                         tmp=`mktemp -t -- "$F.XXXXXX"` || exit 2
-                       else
-                         set -C
-                         tmp=${TMPDIR-/tmp}/$F.$$
-                       fi
-                       gzip -cdfq -- "$2" > "$tmp" || exit 2
-                       gzip_status=$(
-                         exec 4>&1
-                         (gzip -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- |
-                           eval "$cmp" - '"$tmp"' >&3
-                       )
+                *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
+                    if test "$1$2" = --; then
+                        gzip_status=$(
+                          exec 4>&1
+                          (gzip -cdfq - 4>&-; echo $? >&4) 3>&- |
+                            eval "$cmp" - - >&3
+                        )
+                    elif
+                        # Reject Solaris 8's buggy /bin/bash 2.03.
+                        echo X |
+                         (echo X | eval "$cmp" /dev/fd/5 - >/dev/null 2>&1) \
+                                5<&0
+                    then
+                        gzip_status=$(
+                          exec 4>&1
+                          (gzip -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- |
+                            ( (gzip -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- 5<&- </dev/null |
+                               eval "$cmp" /dev/fd/5 - >&3) 5<&0
+                        )
                         cmp_status=$?
-                       rm -f "$tmp" || gzip_status=$?
-                       trap - HUP INT PIPE TERM 0
-                       (exit $cmp_status)
-                   fi;;
-               *)
-                   gzip_status=$(
-                     exec 4>&1
-                     (gzip -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- |
-                       eval "$cmp" - '"$2"' >&3
-                   );;
+                        case $gzip_status in
+                          *[1-9]*) gzip_status=1;;
+                          *) gzip_status=0;;
+                        esac
+                        (exit $cmp_status)
+                    else
+                        F=`expr "/$2" : '.*/\(.*\)[-.][zZtga]*$'` || F=$prog
+                        tmp=
+                        trap '
+                          test -n "$tmp" && rm -f "$tmp"
+                          (exit 2); exit 2
+                        ' HUP INT PIPE TERM 0
+                        if type mktemp >/dev/null 2>&1; then
+                          tmp=`mktemp -t -- "$F.XXXXXX"` || exit 2
+                        else
+                          set -C
+                          tmp=${TMPDIR-/tmp}/$F.$$
+                        fi
+                        gzip -cdfq -- "$2" > "$tmp" || exit 2
+                        gzip_status=$(
+                          exec 4>&1
+                          (gzip -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- |
+                            eval "$cmp" - '"$tmp"' >&3
+                        )
+                        cmp_status=$?
+                        rm -f "$tmp" || gzip_status=$?
+                        trap - HUP INT PIPE TERM 0
+                        (exit $cmp_status)
+                    fi;;
+                *)
+                    gzip_status=$(
+                      exec 4>&1
+                      (gzip -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- |
+                        eval "$cmp" - '"$2"' >&3
+                    );;
                 esac;;
         *)      case "$2" in
-               *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
-                       gzip_status=$(
-                         exec 4>&1
-                         (gzip -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- |
-                           eval "$cmp" '"$1"' - >&3
-                       );;
-               *)      eval "$cmp" '"$1"' '"$2"';;
+                *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
+                        gzip_status=$(
+                          exec 4>&1
+                          (gzip -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- |
+                            eval "$cmp" '"$1"' - >&3
+                        );;
+                *)     eval "$cmp" '"$1"' '"$2"';;
                 esac;;
-       esac
+        esac
 else
-       echo >&2 "$0: invalid number of operands; try \`$0 --help' for help"
-       exit 2
+        echo >&2 "$0: invalid number of operands; try \`$0 --help' for help"
+        exit 2
 fi
 
 cmp_status=$?
index b9e057d6fced3bb0e6b269cec288d17cbf29af09..927be5639f7c8e0c32e1d8be259757eefa006604 100644 (file)
--- a/zforce.in
+++ b/zforce.in
@@ -6,7 +6,7 @@
 # 12345678901234 is renamed to 12345678901.gz
 
 
-# Copyright (C) 2002, 2007 Free Software Foundation
+# Copyright (C) 2002, 2007, 2010 Free Software Foundation
 # Copyright (C) 1993 Jean-loup Gailly
 
 # This program is free software; you can redistribute it and/or modify
@@ -30,7 +30,7 @@ esac
 PATH=$bindir:$PATH; export PATH
 
 version="zforce (gzip) @VERSION@
-Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+Copyright (C) 2010-2012 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
@@ -44,7 +44,7 @@ not compress them twice.
 Report bugs to <bug-gzip@gnu.org>."
 
 if test $# = 0; then
-  echo "$usage"
+  echo >&2 "$0: invalid number of operands; try \`$0 --help' for help"
   exit 1
 fi
 
index a828bbc528ac3bb3fdf6f35e3c22c59fc26345bc..d09bfa7128cfa8d01c705caaf48c8fd3c223e085 100644 (file)
--- a/zgrep.in
+++ b/zgrep.in
@@ -3,7 +3,9 @@
 # zgrep -- a wrapper around a grep program that decompresses files as needed
 # Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
 
-# Copyright (C) 1998, 2001, 2002, 2006, 2007, 2009 Free Software Foundation
+# Copyright (C) 1998, 2001, 2002, 2006, 2007, 2009, 2010 Free Software
+# Foundation
+
 # Copyright (C) 1993 Jean-loup Gailly
 
 # This program is free software; you can redistribute it and/or modify
@@ -29,7 +31,7 @@ PATH=$bindir:$PATH
 grep='${GREP-grep}'
 
 version='zgrep (gzip) @VERSION@
-Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+Copyright (C) 2010-2012 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
@@ -45,14 +47,13 @@ OPTIONs are the same as for 'grep'.
 Report bugs to <bug-gzip@gnu.org>."
 
 # sed script to escape all ' for the shell, and then (to handle trailing
-# newlines correctly) turn trailing X on last line into '.
+# newlines correctly) append ' to the last line.
 escape='
   s/'\''/'\''\\'\'''\''/g
-  $s/X$/'\''/
+  $s/$/'\''/
 '
 operands=
 have_pat=0
-pat_on_stdin=0
 files_with_matches=0
 files_without_matches=0
 no_filename=0
@@ -64,20 +65,32 @@ while test $# -ne 0; do
   optarg=
 
   case $option in
-  (-[0123456789abcdhHiIKLlnoqrRsTuUvVwxyzZ]?*)
-    arg2=-\'$(expr "X${option}X" : 'X-.[0-9]*\(.*\)' | sed "$escape")
+  (-[0123456789EFGHIKLPRTUVZabchilnoqrsuvwxyz]?*)
+    arg2=-\'$(expr "X$option" : 'X-.[0-9]*\(.*\)' | sed "$escape")
     eval "set -- $arg2 "'${1+"$@"}'
     option=$(expr "X$option" : 'X\(-.[0-9]*\)');;
   (--binary-*=* | --[lm]a*=* | --reg*=*)
     ;;
-  (-[ABCDefm] | --binary-* | --file | --[lm]a* | --reg*)
+  (-[ABCDXdefm] | binary-* | --file | --[lm]a* | --reg*)
     case ${1?"$option option requires an argument"} in
     (*\'*)
-      optarg=" '"$(printf '%sX\n' "$1" | sed "$escape");;
+      optarg=" '"$(printf '%s\n' "$1" | sed "$escape");;
     (*)
       optarg=" '$1'";;
     esac
     shift;;
+  (-f?*\'*)
+    optarg=" '"$(expr "X$option" : 'X-f\(.*\)' | sed "$escape")
+    option=-f;;
+  (-f?*)
+    optarg=" '"$(expr "X$option" : 'X-f\(.*\)')\'
+    option=-f;;
+  (--file=*\'*)
+    optarg=" '"$(expr "X$option" : 'X--file=\(.*\)' | sed "$escape")
+    option=--file;;
+  (--file=*)
+    optarg=" '"$(expr "X$option" : 'X--file=\(.*\)')\'
+    option=--file;;
   (--)
     break;;
   (-?*)
@@ -85,7 +98,7 @@ while test $# -ne 0; do
   (*)
     case $option in
     (*\'*)
-      operands="$operands '"$(printf '%sX\n' "$option" | sed "$escape");;
+      operands="$operands '"$(printf '%s\n' "$option" | sed "$escape");;
     (*)
       operands="$operands '$option'";;
     esac
@@ -97,33 +110,18 @@ while test $# -ne 0; do
   (-[drRzZ] | --di* | --exc* | --inc* | --rec* | --nu*)
     printf >&2 '%s: %s: option not supported\n' "$0" "$option"
     exit 2;;
-  (-[ef]* | --file | --file=* | --reg*)
+  (-e* | --reg*)
+    have_pat=1;;
+  (-f | --file)
     # The pattern is coming from a file rather than the command-line.
     # If the file is actually stdin then we need to do a little
-    # magic, (since we use stdin to pass the gzip output to grep).
-    # So find a free fd and change the argument to then use this
-    # file descriptor for the pattern.
+    # magic, since we use stdin to pass the gzip output to grep.
+    # Turn the -f option into an -e option by copying the file's
+    # contents into OPTARG.
     case $optarg in
     (" '-'" | " '/dev/stdin'" | " '/dev/fd/0'")
-      pat_on_stdin=1
-      eval 'test -e .' 2>/dev/null \
-        && eval 'exists(){ test -e "$@"; }' \
-        || eval 'exists(){ test -r "$@" || test -w "$@"; }'
-      # Start search from 6 since the script already uses 3 and 5
-      fd=6
-      pat_fd=
-      while : ; do
-        if ! exists /proc/$$/fd/$fd; then
-          pat_fd=$fd
-          break;
-        fi
-        fd=$(expr $fd + 1)
-        if test $fd = 255; then
-          printf >&2 '%s: no free file descriptor\n' "$0"
-          exit 2
-        fi
-      done
-      optarg=/dev/fd/$pat_fd;
+      option=-e
+      optarg=" '"$(sed "$escape") || exit 2;;
     esac
     have_pat=1;;
   (--h | --he | --hel | --help)
@@ -138,7 +136,7 @@ while test $# -ne 0; do
     files_with_matches=1;;
   (-L | --files-witho*)
     files_without_matches=1;;
-  (--no-f*)
+  (-h | --no-f*)
     no_filename=1;;
   (-V | --v | --ve | --ver | --vers | --versi | --versio | --version)
     echo "$version" || exit 2
@@ -147,7 +145,7 @@ while test $# -ne 0; do
 
   case $option in
   (*\'?*)
-    option=\'$(expr "X${option}X" : 'X\(.*\)' | sed "$escape");;
+    option=\'$(printf '%s\n' "$option" | sed "$escape");;
   (*)
     option="'$option'";;
   esac
@@ -160,7 +158,7 @@ eval "set -- $operands "'${1+"$@"}'
 if test $have_pat -eq 0; then
   case ${1?"missing pattern; try \`$0 --help' for help"} in
   (*\'*)
-    grep="$grep -- '"$(printf '%sX\n' "$1" | sed "$escape");;
+    grep="$grep -- '"$(printf '%s\n' "$1" | sed "$escape");;
   (*)
     grep="$grep -- '$1'";;
   esac
@@ -179,45 +177,44 @@ do
   # Fail if gzip or grep (or sed) fails.
   gzip_status=$(
     exec 5>&1
-    if test $pat_on_stdin -eq 1; then
-      eval "exec $pat_fd<&0"
-    fi
     (gzip -cdfq -- "$i" 5>&-; echo $? >&5) 3>&- |
     if test $files_with_matches -eq 1; then
       eval "$grep" >/dev/null && { printf '%s\n' "$i" || exit 2; }
     elif test $files_without_matches -eq 1; then
       eval "$grep" >/dev/null || {
-       r=$?
-       if test $r -eq 1; then
-         printf '%s\n' "$i" || r=2
-       fi
-       exit $r
+        r=$?
+        if test $r -eq 1; then
+          printf '%s\n' "$i" || r=2
+        fi
+        exit $r
       }
     elif test $with_filename -eq 0 &&
-        { test $# -eq 1 || test $no_filename -eq 1; }; then
+         { test $# -eq 1 || test $no_filename -eq 1; }; then
       eval "$grep"
     else
       case $i in
       (*'
 '* | *'&'* | *'\'* | *'|'*)
         i=$(printf '%s\n' "$i" |
-           sed '
-             $!N
-             $s/[&\|]/\\&/g
-             $s/\n/\\n/g
-           ');;
+            sed '
+              $!N
+              $s/[&\|]/\\&/g
+              $s/\n/\\n/g
+            ');;
       esac
       sed_script="s|^|$i:|"
 
       # Fail if grep or sed fails.
       r=$(
-       exec 4>&1
-       (eval "$grep" 4>&-; echo $? >&4) 3>&- | sed "$sed_script" >&3 4>&-
-      ) || r=2
-      exit $r
+        exec 4>&1
+        (eval "$grep" 4>&-; echo $? >&4) 3>&- | sed "$sed_script" >&3 4>&-
+      ) && exit $r
+      r=$?
+      test 1 -lt $r && exit $r || exit 2
     fi >&3 5>&-
   )
   r=$?
+  test 128 -lt $r && exit $r
   test "$gzip_status" -eq 0 || test "$gzip_status" -eq 2 || r=2
   test $res -lt $r && res=$r
 done
diff --git a/zip.c b/zip.c
index 756c8fd042be9d715d7a1230648ea8ed5ab20cf0..90b614c70e60cacbd9d39756a316e35bc00fa773 100644 (file)
--- a/zip.c
+++ b/zip.c
@@ -1,6 +1,6 @@
 /* zip.c -- compress files to the gzip or pkzip format
 
-   Copyright (C) 1997-1999, 2006-2007, 2009-2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-1999, 2006-2007, 2009-2012 Free Software Foundation, Inc.
    Copyright (C) 1992-1993 Jean-loup Gailly
 
    This program is free software; you can redistribute it and/or modify
@@ -22,7 +22,6 @@
 
 #include "tailor.h"
 #include "gzip.h"
-#include "crypt.h"
 
 #include <unistd.h>
 #include <fcntl.h>
@@ -55,12 +54,12 @@ int zip(in, out)
     put_byte(DEFLATED);      /* compression method */
 
     if (save_orig_name) {
-       flags |= ORIG_NAME;
+        flags |= ORIG_NAME;
     }
     put_byte(flags);         /* general flags */
     stamp = (0 <= time_stamp.tv_sec && time_stamp.tv_sec <= 0xffffffff
-            ? (ulg) time_stamp.tv_sec
-            : (ulg) 0);
+             ? (ulg) time_stamp.tv_sec
+             : (ulg) 0);
     put_long (stamp);
 
     /* Write deflated file to zip file */
@@ -74,29 +73,29 @@ int zip(in, out)
     put_byte(OS_CODE);            /* OS identifier */
 
     if (save_orig_name) {
-       char *p = gzip_base_name (ifname); /* Don't save the directory part. */
-       do {
-           put_char(*p);
-       } while (*p++);
+        char *p = gzip_base_name (ifname); /* Don't save the directory part. */
+        do {
+            put_byte (*p);
+        } while (*p++);
     }
     header_bytes = (off_t)outcnt;
 
     (void)deflate();
 
-#if !defined(NO_SIZE_CHECK) && !defined(RECORD_IO)
+#ifndef NO_SIZE_CHECK
   /* Check input size (but not in VMS -- variable record lengths mess it up)
    * and not on MSDOS -- diet in TSR mode reports an incorrect file size)
    */
     if (ifile_size != -1L && bytes_in != ifile_size) {
-       fprintf(stderr, "%s: %s: file size changed while zipping\n",
-               program_name, ifname);
+        fprintf(stderr, "%s: %s: file size changed while zipping\n",
+                program_name, ifname);
     }
 #endif
 
     /* Write the crc and uncompressed size */
     put_long(crc);
     put_long((ulg)bytes_in);
-    header_bytes += 2*sizeof(long);
+    header_bytes += 2*4;
 
     flush_outbuf();
     return OK;
@@ -119,8 +118,8 @@ int file_read(buf, size)
     len = read_buffer (ifd, buf, size);
     if (len == 0) return (int)len;
     if (len == (unsigned)-1) {
-       read_error();
-       return EOF;
+        read_error();
+        return EOF;
     }
 
     crc = updcrc((uch*)buf, len);
index dbdcfbe156942685d47c85e28cb3b1b24f4b8b95..3f06da60ce764c3d2dc12c350a2b66f7fd00e3f2 100644 (file)
--- a/zless.in
+++ b/zless.in
@@ -23,7 +23,7 @@ esac
 PATH=$bindir:$PATH; export PATH
 
 version="zless (gzip) @VERSION@
-Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+Copyright (C) 2007, 2011-2012 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
@@ -53,5 +53,15 @@ if test "${LESSMETACHARS+set}" != set; then
   export LESSMETACHARS
 fi
 
-LESSOPEN="|gzip -cdfq -- %s"; export LESSOPEN
+less_version=`less -V` || exit
+case $less_version in
+'less 429
+'* | 'less '4[3-9][0-9]* | 'less '[5-9][0-9][0-9]* | 'less '[1-9][0-9][0-9][0-9]*)
+   use_input_pipe_on_stdin='-';;
+*) use_input_pipe_on_stdin='';;
+esac
+
+LESSOPEN="|${use_input_pipe_on_stdin}gzip -cdfq -- %s"
+export LESSOPEN
+
 exec less "$@"
index 64b144d840a540a0ff0f77865f13a378680f5e71..593f52c1ac394384dc45adca837b1d1e536fb4a3 100644 (file)
--- a/zmore.in
+++ b/zmore.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2001, 2002, 2007 Free Software Foundation
+# Copyright (C) 2001, 2002, 2007, 2010 Free Software Foundation
 # Copyright (C) 1992, 1993 Jean-loup Gailly
 
 # This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,7 @@ esac
 PATH=$bindir:$PATH; export PATH
 
 version="zmore (gzip) @VERSION@
-Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+Copyright (C) 2010-2012 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
@@ -57,36 +57,36 @@ fi
 
 if test $# = 0; then
     if test -t 0; then
-       echo "$usage"
+        echo >&2 "$0: invalid number of operands; try \`$0 --help' for help"
     else
-       gzip -cdfq | eval ${PAGER-more}
+        gzip -cdfq | eval ${PAGER-more}
     fi
 else
     FIRST=1
     for FILE
     do
-       case $FILE in
-       --h*) exec echo "$usage";;
-       --v*) exec echo "$version";;
-       esac
+        case $FILE in
+        --h*) exec echo "$usage";;
+        --v*) exec echo "$version";;
+        esac
 
-       < "$FILE" || continue
-       if test $FIRST -eq 0; then
-               echo $n1 "--More--(Next file: $FILE)$n2"
-               stty $cb -echo 2>/dev/null
-               ANS=`dd bs=1 count=1 2>/dev/null`
-               stty $ncb echo 2>/dev/null
-               echo " "
-               case "$ANS" in
-               [eq]) exit;;
-               esac
-       fi
-       if test "$ANS" != 's'; then
-               echo "------> $FILE <------"
-               gzip -cdfq -- "$FILE" | eval ${PAGER-more}
-       fi
-       if test -t 1; then
-               FIRST=0
-       fi
+        < "$FILE" || continue
+        if test $FIRST -eq 0; then
+                echo $n1 "--More--(Next file: $FILE)$n2"
+                stty $cb -echo 2>/dev/null
+                ANS=`dd bs=1 count=1 2>/dev/null`
+                stty $ncb echo 2>/dev/null
+                echo " "
+                case "$ANS" in
+                [eq]) exit;;
+                esac
+        fi
+        if test "$ANS" != 's'; then
+                echo "------> $FILE <------"
+                gzip -cdfq -- "$FILE" | eval ${PAGER-more}
+        fi
+        if test -t 1; then
+                FIRST=0
+        fi
     done
 fi
diff --git a/znew.1 b/znew.1
index 5cfb47246e3e96ced99a9cd1a1e58a7f8cc54dc2..dcdf84fdfa81e1ae997500a728d3dbed5acd5818 100644 (file)
--- a/znew.1
+++ b/znew.1
@@ -27,7 +27,8 @@ Use the slowest compression method (optimal compression).
 Use pipes for the conversion to reduce disk space usage.
 .TP
 .B \-K
-Keep a .Z file when it is smaller than the .gz file
+Keep a .Z file when it is smaller than the .gz file; implies
+.BR -t .
 .SH "SEE ALSO"
 gzip(1), zmore(1), zdiff(1), zgrep(1), zforce(1), gzexe(1), compress(1)
 .SH BUGS
diff --git a/znew.in b/znew.in
index c7cdfc83fcaec94b22447c5ba36b492aaf652723..bd8f34f61cc9450b5613765dc5869bad5de21c56 100644 (file)
--- a/znew.in
+++ b/znew.in
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 1998, 2002, 2004, 2007 Free Software Foundation
+# Copyright (C) 1998, 2002, 2004, 2007, 2010 Free Software Foundation
 # Copyright (C) 1993 Jean-loup Gailly
 
 # This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,7 @@ esac
 PATH=$bindir:$PATH; export PATH
 
 version="znew (gzip) @VERSION@
-Copyright (C) 2007, 2009-2010 Free Software Foundation, Inc.
+Copyright (C) 2010-2012 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
@@ -41,7 +41,7 @@ Options:
   -v     Verbose; display name and statistics for each file compressed.
   -9     Use the slowest compression method (optimal compression).
   -P     Use pipes for the conversion to reduce disk space usage.
-  -K     Keep a .Z file when it is smaller than the .gz file.
+  -K     Keep a .Z file when it is smaller than the .gz file; implies -t.
       --help     display this help and exit
       --version  output version information and exit
 
@@ -97,7 +97,7 @@ do
 done
 
 if test $# -eq 0; then
-  echo "$usage"
+  echo >&2 "$0: invalid number of operands; try \`$0 --help' for help"
   exit 1
 fi
 
@@ -106,7 +106,7 @@ case "$opt" in
   *t*) check=1; opt=`echo "$opt" | sed 's/t//g'`
 esac
 case "$opt" in
-  *K*) keep=1; opt=`echo "$opt" | sed 's/K//g'`
+  *K*) keep=1; check=1; opt=`echo "$opt" | sed 's/K//g'`
 esac
 case "$opt" in
   *P*) pipe=1; opt=`echo "$opt" | sed 's/P//g'`
@@ -133,9 +133,9 @@ for i do
   else
     if test $check -eq 1; then
       if cp -p "$n.Z" "$n.$$" 2> /dev/null || cp "$n.Z" "$n.$$"; then
-       :
+        :
       else
-       echo cannot backup "$n.Z"
+        echo cannot backup "$n.Z"
         res=1; continue
       fi
     fi
@@ -150,10 +150,10 @@ for i do
       :
     else
       if test $check -eq 1; then
-       mv "$n.$$" "$n.Z" && rm -f "$n"
+        mv "$n.$$" "$n.Z" && rm -f "$n"
         echo error while recompressing $n
       else
-       # compress $n  (might be dangerous if disk full)
+        # compress $n  (might be dangerous if disk full)
         echo error while recompressing $n, left uncompressed
       fi
       res=1; continue
@@ -161,13 +161,11 @@ for i do
   fi
   test $keep -eq 1 && new=`wc -c < "$n$ext"`
   if test $keep -eq 1 && test `expr \( $old + $block - 1 \) / $block` -lt \
-                             `expr \( $new + $block - 1 \) / $block`; then
+                              `expr \( $new + $block - 1 \) / $block`; then
     if test $pipe -eq 1; then
       rm -f "$n$ext"
-    elif test $check -eq 1; then
-      mv "$n.$$" "$n.Z" && rm -f "$n$ext"
     else
-      gzip -d "$n$ext" && compress "$n" && rm -f "$n$ext"
+      mv "$n.$$" "$n.Z" && rm -f "$n$ext"
     fi
     echo "$n.Z smaller than $n$ext -- unchanged"