New upstream version 1.10 upstream upstream/1.10
authorBdale Garbee <bdale@gag.com>
Tue, 25 Feb 2020 21:55:54 +0000 (14:55 -0700)
committerBdale Garbee <bdale@gag.com>
Tue, 25 Feb 2020 21:55:54 +0000 (14:55 -0700)
161 files changed:
.tarball-version
ChangeLog
Makefile.in
NEWS
aclocal.m4
build-aux/announce-gen
build-aux/compile
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
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/install-sh
build-aux/mdate-sh
build-aux/missing
build-aux/test-driver
build-aux/texinfo.tex
build-aux/update-copyright
build-aux/useless-if-before-free
build-aux/vc-list-files
cfg.mk
configure
configure.ac
doc/Makefile.in
doc/gzip.info
doc/gzip.texi
doc/stamp-vti
doc/version.texi
gunzip.in
gzexe.in
gzip.c
gzip.h
inflate.c
lib/Makefile.in
lib/_Noreturn.h
lib/assure.h
lib/config.hin
lib/dirname.h
lib/dosname.h
lib/dup2.c
lib/errno.in.h
lib/error.c
lib/fcntl.c
lib/fcntl.in.h
lib/fflush.c
lib/filename.h
lib/filenamecat-lgpl.c
lib/fpurge.c
lib/freading.c
lib/freading.h
lib/fseeko.c
lib/fseterr.c
lib/fstat.c
lib/fsync.c
lib/getdtablesize.c
lib/getopt.c
lib/getprogname.c
lib/gettext.h
lib/gettime.c
lib/gettimeofday.c
lib/glthread/lock.h
lib/gnulib.mk
lib/intprops.h
lib/limits.in.h
lib/localtime-buffer.c
lib/lseek.c
lib/malloca.c
lib/malloca.h
lib/malloca.valgrind [deleted file]
lib/math.in.h
lib/memrchr.c
lib/msvc-nothrow.h
lib/open.c
lib/pathmax.h
lib/printf-parse.c
lib/raise.c [new file with mode: 0644]
lib/sig-handler.c [new file with mode: 0644]
lib/sig-handler.h [new file with mode: 0644]
lib/sigaction.c [new file with mode: 0644]
lib/signal.in.h [new file with mode: 0644]
lib/sigprocmask.c [new file with mode: 0644]
lib/stat-time.h
lib/stat-w32.c
lib/stat.c
lib/stdio-impl.h
lib/stdio.in.h
lib/stdlib.in.h
lib/strerror_r.c
lib/sys_stat.in.h
lib/sys_types.in.h
lib/time.in.h
lib/timespec.h
lib/unistd.in.h
lib/utime.c
lib/utime.in.h
lib/utimens.c
lib/vasnprintf.c
lib/verify.h
lib/warn-on-use.h
lib/xalloc.h
m4/asm-underscore.m4
m4/errno_h.m4
m4/extensions.m4
m4/extern-inline.m4
m4/fchdir.m4
m4/fcntl-o.m4
m4/fseeko.m4
m4/getcwd.m4
m4/gettime.m4
m4/gnu-make.m4
m4/gnulib-common.m4
m4/gnulib-comp.m4
m4/host-cpu-c-abi.m4
m4/lib-link.m4
m4/lib-prefix.m4
m4/limits-h.m4
m4/longlong.m4
m4/lstat.m4
m4/malloc.m4
m4/manywarnings.m4
m4/nocrash.m4
m4/pathmax.m4
m4/printf.m4
m4/pthread_rwlock_rdlock.m4
m4/raise.m4 [new file with mode: 0644]
m4/rmdir.m4
m4/sigaction.m4 [new file with mode: 0644]
m4/signal_h.m4 [new file with mode: 0644]
m4/signalblocking.m4 [new file with mode: 0644]
m4/size_max.m4
m4/stat.m4
m4/stddef_h.m4
m4/stdint.m4
m4/stdio_h.m4
m4/stdlib_h.m4
m4/threadlib.m4
m4/unistd_h.m4
m4/unlink.m4
m4/utime_h.m4
m4/utimens.m4
m4/warnings.m4
m4/wchar_h.m4
maint.mk
tests/Makefile.am
tests/Makefile.in
tests/hufts
tests/init.sh
tests/reproducible [new file with mode: 0755]
trees.c
zcat.in
zdiff.in
zforce.in
zgrep.in
zip.c
zless.in
zmore.in
znew.in

index 2e0e38c63a62a412640833b517f8f2a46418cd27..c044b1a3269eb712509c550de8b5a4afb3b1ea0f 100644 (file)
@@ -1 +1 @@
-1.9
+1.10
index 545e057655e2d75d1430c39700c86da9bf60cb41..2e956c2fe6af67436b35a7ad6f9ca70ce9236816 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,152 @@
+2018-12-29  Jim Meyering  <meyering@fb.com>
+
+       version 1.10
+       * NEWS: Record release date.
+
+2018-12-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+       build: enable -Wunreachable-code
+       * configure.ac (nw): Remove -Wunreachable-code from the list of
+       disabled warnings, now that all offending statements have been removed.
+
+       maint: remove unreachable code
+       Problem reported by Oracle Developer Studio 12.6.
+       In the old days we needed a return statement at the end of
+       the gzip main function to pacify traditional 'lint', but
+       lint checkers nowadays are smarter.
+       * gzip.c (main):
+       * zip.c (file_read): Remove unreachable code.
+
+2018-12-23  Jim Meyering  <meyering@fb.com>
+
+       maint: use a slightly cleaner expression
+       * gzip.c (do_list): Simplify an expression:
+       - int positive_off_t_width = INT_BUFSIZE_BOUND (off_t) - 2;
+       + int positive_off_t_width = INT_STRLEN_BOUND (off_t) - 1;
+
+2018-12-22  Jim Meyering  <meyering@fb.com>
+
+       build: avoid build failure with --enable-gcc-warnings and latest gcc
+       * gzip.c (do_list): There was a loop to compute the maximum width
+       of a decimal positive off_t value. Replace it with assignment to a
+       constant.  Noticed because gcc 9.0.0 20181219 warned about its use
+       as a printf format-width value.
+       (OFF_T_MAX): Remove now-unused definition.
+
+2018-12-21  Jim Meyering  <meyering@fb.com>
+
+       maint: improve a comment
+       * trees.c (flush_block): Fix grammar/spelling in a comment.
+
+       maint: update gnulib to latest; also update bootstrap and init.sh
+
+       build: make the autoconf-2.63 requirement explicit
+       * configure.ac: AC_PREREQ: Require 2.63, not 2.59.
+       Autoconf-2.63 has been required for some time via gnulib.
+       This merely makes it explicit.
+
+2018-11-30  Paul Eggert  <eggert@cs.ucla.edu>
+
+       gzip: fix use of uninitialized memory
+       Problem reported by Hanno Böck (Bug#33501).
+       * NEWS: Mention this.
+       * inflate.c (inflate_dynamic): Return if code is invalid.
+       Fix by Mark Adler.
+       * tests/hufts: Add test case for the bug.
+
+2018-08-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * gzip.c (remove_output_file): Fix typo.
+
+       gzip: fix bug in signal-handling fix
+       Problem reported by Johannes Przybilla (Bug#32375#26).
+       * gzip.c (volatile_strcpy): Source is now pointer-to-volatile too.
+       (remove_output_file): Copy remove_ofname to a private nonvolatile
+       copy so that it can be passed to xunlink safely.
+
+2018-08-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix some theoretical races in signal handling
+       Problem reported by Johannes Przybilla (Bug#32375).
+       * NEWS: Mention this.
+       * bootstrap.conf (gnulib_modules): Add sigaction.
+       * gzip.c (SA_NOCLDSTOP, sigprocmask, sigset_t)
+       (siginterrupt) [!SA_NOCLDSTOP]: Remove; Gnulib not supplies these.
+       (remove_ofname): New var.
+       (volatile_strcpy): New function.
+       (create_outfile): Use it.
+       (install_signal_handlers, abort_gzip_signal): Assume sigaction.
+       (remove_output_file): New arg SIGNALS_ALREADY_BLOCKED.
+       All uses changed.  Avoid unnecessary (and racy) call
+       to sigprocmask if this new arg is set.
+       (abort_gzip_signal): Assume C89 or better for signal handler type.
+       * gzip.h (RETSIGTYPE): Remove.
+       * lib/.gitignore, m4/.gitignore:
+       Add files brought in by Gnulib sigaction module.  Sort.
+
+2018-08-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       gzip: port better to mingw again
+       Problem reported by Bdale Garbee (Bug#32305#8).
+       * gzip.c (do_chown): Use HAVE_FCHOWN || HAVE_CHOWN,
+       which is configured, instead of DO_CHOWN, which is not.
+
+2018-08-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       gzip: make the output more reproducible
+       Problem reported by Bernhard M. Wiedemann (Bug#32342).
+       * NEWS: Mention this.
+       * doc/gzip.texi (Overview, Invoking gzip): Document this.
+       * gzip.c (get_input_size_and_time): New function,
+       which implements the change.
+       (treat_stdin, treat_file): Use it.
+       * tests/reproducible: New test.
+       * tests/Makefile.am (TESTS): Add it.
+
+2018-07-29  Paul Eggert  <eggert@cs.ucla.edu>
+
+       gzip: port better to mingw
+       Problem reported by Bdale Garbee for Debian
+       * gzip.c (do_chown): Don't assume uid_t and gid_t.
+
+2018-07-01  Jim Meyering  <meyering@fb.com>
+
+       maint: update gnulib to latest; also update bootstrap and init.sh
+
+2018-06-30  Jim Meyering  <meyering@fb.com>
+
+       build: remove -Wformat-truncation=2 to avoid avoid false-positive
+       * configure.ac (GNULIB_WARN_CFLAGS): Add -Wformat-truncation=2,
+       to disable it when building gnulib with --enable-gcc-warnings.
+       This avoids what looks like a false positive from GCC 9:
+       strerror_r.c: In function 'rpl_strerror_r':
+       strerror_r.c:453:35: error: 'Unknown error ' directive output \
+        truncated writing 14 bytes into a region of size 2 \
+        [-Werror=format-truncation=]
+                snprintf (buf, buflen, "Unknown error %d", errnum);
+                                        ~~^~~~~~~~~~~~
+       In file included from /usr/include/stdio.h:862,
+                        from ./stdio.h:43,
+                        from strerror_r.c:29:
+       /usr/include/bits/stdio2.h:64:10: note: '__builtin___snprintf_chk' \
+         output between 16 and 26 bytes into a destination of size 2
+          return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
+
+2018-01-15  Paul Eggert  <eggert@cs.ucla.edu>
+
+       misc: update --version copyright
+       * gunzip.in, gzexe.in, gzip.c, zcat.in, zdiff.in, zforce.in, zgrep.in:
+       * zless.in, zmore.in, znew.in:
+       Update copyright year in --version output to 2018.
+       This part of the year-number update isn’t automated yet.
+
 2018-01-07  Jim Meyering  <meyering@fb.com>
 
+       maint: post-release administrivia
+       * NEWS: Add header line for next release.
+       * .prev-version: Record previous version.
+       * cfg.mk (old_NEWS_hash): Auto-update.
+
        version 1.9
        * NEWS: Record release date.
 
index b9d62a13172b07cf0d3abd16959ee8ef9bd51fc1..172999314ec8bbad198f40495ca9cc8728121e97 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15a from Makefile.am.
+# Makefile.in generated by automake 1.16a from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -169,18 +169,21 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
        $(top_srcdir)/m4/printf-posix-rpl.m4 \
        $(top_srcdir)/m4/printf.m4 \
        $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \
-       $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/realloc.m4 \
-       $(top_srcdir)/m4/rmdir.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/stdnoreturn.m4 \
-       $(top_srcdir)/m4/stpcpy.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/raise.m4 $(top_srcdir)/m4/readdir.m4 \
+       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/rmdir.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \
+       $(top_srcdir)/m4/shell.m4 $(top_srcdir)/m4/sigaction.m4 \
+       $(top_srcdir)/m4/signal_h.m4 \
+       $(top_srcdir)/m4/signalblocking.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/stdnoreturn.m4 $(top_srcdir)/m4/stpcpy.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 \
@@ -538,6 +541,7 @@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
 GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPASS = @GNULIB_GETPASS@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
 GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
@@ -639,6 +643,7 @@ GNULIB_POWF = @GNULIB_POWF@
 GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
 GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
 GNULIB_PUTC = @GNULIB_PUTC@
@@ -647,6 +652,7 @@ GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
 GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_QSORT_R = @GNULIB_QSORT_R@
+GNULIB_RAISE = @GNULIB_RAISE@
 GNULIB_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
@@ -677,7 +683,10 @@ GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
 GNULIB_SETENV = @GNULIB_SETENV@
 GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SIGACTION = @GNULIB_SIGACTION@
+GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
 GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
+GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
 GNULIB_SINF = @GNULIB_SINF@
 GNULIB_SINHF = @GNULIB_SINHF@
 GNULIB_SINL = @GNULIB_SINL@
@@ -872,6 +881,7 @@ 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_TRUNCATE = @HAVE_DECL_TRUNCATE@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
 HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
@@ -919,6 +929,7 @@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
 HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
 HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
@@ -979,12 +990,15 @@ HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
 HAVE_PTSNAME = @HAVE_PTSNAME@
 HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RAISE = @HAVE_RAISE@
 HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
@@ -1006,9 +1020,13 @@ HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
+HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
 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_SIGSET_T = @HAVE_SIGSET_T@
 HAVE_SINF = @HAVE_SINF@
 HAVE_SINHF = @HAVE_SINHF@
 HAVE_SINL = @HAVE_SINL@
@@ -1027,6 +1045,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
@@ -1043,7 +1062,7 @@ HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
-HAVE_TRUNCATE = @HAVE_TRUNCATE@
+HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
 HAVE_TZSET = @HAVE_TZSET@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
@@ -1093,8 +1112,6 @@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
 HAVE_WMEMSET = @HAVE_WMEMSET@
 HAVE__BOOL = @HAVE__BOOL@
 HAVE__EXIT = @HAVE__EXIT@
-HOST_CPU = @HOST_CPU@
-HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
 IGNORE_UNUSED_LIBRARIES_CFLAGS = @IGNORE_UNUSED_LIBRARIES_CFLAGS@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
@@ -1131,6 +1148,7 @@ 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_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
 NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_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@
@@ -1150,6 +1168,7 @@ NEXT_FLOAT_H = @NEXT_FLOAT_H@
 NEXT_GETOPT_H = @NEXT_GETOPT_H@
 NEXT_LIMITS_H = @NEXT_LIMITS_H@
 NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
 NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
@@ -1244,6 +1263,7 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_GMTIME = @REPLACE_GMTIME@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
@@ -1310,11 +1330,13 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
 REPLACE_PTSNAME = @REPLACE_PTSNAME@
 REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
 REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RAISE = @REPLACE_RAISE@
 REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
 REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
diff --git a/NEWS b/NEWS
index 3fb3ac49941484b73730207d305a51d06ea6eb67..72b41099737e6789511da63052a28807c7568953 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,26 @@
 GNU gzip NEWS                                    -*- outline -*-
 
+* Noteworthy changes in release 1.10 (2018-12-29) [stable]
+
+** Changes in behavior
+
+  Compressed gzip output no longer contains the current time as a
+  timestamp when the input is not a regular file.  Instead, the output
+  contains a null (zero) timestamp.  This makes gzip's behavior more
+  reproducible when used as part of a pipeline.  (As a reminder, even
+  regular files will use null timestamps after the year 2106, due to a
+  limitation in the gzip format.)
+
+** Bug fixes
+
+  A use of uninitialized memory on some malformed inputs has been fixed.
+  [bug present since the beginning]
+
+  A few theoretical race conditions in signal handers have been fixed.
+  These bugs most likely do not happen on practical platforms.
+  [bugs present since the beginning]
+
+
 * Noteworthy changes in release 1.9 (2018-01-07) [stable]
 
 ** Bug fixes
index 291ffab136cb5c15c8a86e675691132f47186d3e..0ef2e5d939a049c852a5f923d1f51acfed935385 100644 (file)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15a -*- Autoconf -*-
+# generated automatically by aclocal 1.16a -*- Autoconf -*-
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,8 +14,8 @@
 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69.193-8974],,
-[m4_warning([this file was generated for autoconf 2.69.193-8974.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69.197-b8fd7],,
+[m4_warning([this file was generated for autoconf 2.69.197-b8fd7.
 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'.])])
@@ -474,7 +474,7 @@ AC_DEFUN([AM_XGETTEXT_OPTION],
   XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
 ])
 
-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -486,10 +486,10 @@ AC_DEFUN([AM_XGETTEXT_OPTION],
 # 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.15a'
+[am__api_version='1.16'
 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.15a], [],
+m4_if([$1], [1.16a], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -505,14 +505,14 @@ 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.15a])dnl
+[AM_AUTOMAKE_VERSION([1.16a])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-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -564,7 +564,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -595,7 +595,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -786,7 +786,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -852,7 +852,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1049,7 +1049,7 @@ 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-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1070,7 +1070,7 @@ if test x"${install_sh+set}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2017 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1091,7 +1091,7 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1134,7 +1134,7 @@ AC_SUBST([am__quote])])
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1173,7 +1173,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1202,7 +1202,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1249,7 +1249,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1268,7 +1268,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1349,7 +1349,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1409,7 +1409,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1437,7 +1437,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1456,7 +1456,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2017 Free Software Foundation, Inc.
+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1689,12 +1689,16 @@ m4_include([m4/printf-frexpl.m4])
 m4_include([m4/printf-posix-rpl.m4])
 m4_include([m4/printf.m4])
 m4_include([m4/pthread_rwlock_rdlock.m4])
+m4_include([m4/raise.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/sigaction.m4])
+m4_include([m4/signal_h.m4])
+m4_include([m4/signalblocking.m4])
 m4_include([m4/signbit.m4])
 m4_include([m4/size_max.m4])
 m4_include([m4/ssize_t.m4])
index e56649030d58dd6af4f62101b8dec998d9f6b446..eeb9071a1598b45a3e5a3e0d8929485392cbd637 100755 (executable)
@@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
     if 0;
 # Generate a release announcement message.
 
-my $VERSION = '2017-09-13 06:45'; # UTC
+my $VERSION = '2018-03-07 03:46'; # 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
@@ -549,7 +549,7 @@ EOF
 ## perl-label-offset: -2
 ## perl-extra-newline-before-brace: t
 ## perl-merge-trailing-else: nil
-## eval: (add-hook 'write-file-hooks 'time-stamp)
+## eval: (add-hook 'before-save-hook 'time-stamp)
 ## time-stamp-start: "my $VERSION = '"
 ## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
 ## time-stamp-time-zone: "UTC0"
index f8e99f0fb6f111ab6cc6a48cff9ecd1b605c03f1..99e50524b3bade179355469777b4d664bcd5c964 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2017-09-16.17; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -340,7 +340,7 @@ exit $ret
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 588fe82a42aa7014df8c77615d9efb0cdd881506..28bec27b3079308ec442a2b93e5544a11861d969 100755 (executable)
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2018-01-01'
+timestamp='2018-12-07'
 
 # 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
@@ -84,8 +84,6 @@ if test $# != 0; then
   exit 1
 fi
 
-trap 'exit 1' 1 2 15
-
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 # compiler to aid in system detection is discouraged as it requires
 # temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,38 @@ trap 'exit 1' 1 2 15
 
 # Portable tmp directory creation inspired by the Autoconf team.
 
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-       for c in cc gcc c89 c99 ; do
-         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-            CC_FOR_BUILD="$c"; break ;
-         fi ;
-       done ;
-       if test x"$CC_FOR_BUILD" = x ; then
-         CC_FOR_BUILD=no_compiler_found ;
-       fi
-       ;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+    : "${TMPDIR=/tmp}"
+    # shellcheck disable=SC2039
+    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+       { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+       { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+       { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+    dummy=$tmp/dummy
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+       ,,)    echo "int x;" > "$dummy.c"
+              for driver in cc gcc c89 c99 ; do
+                  if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+                      CC_FOR_BUILD="$driver"
+                      break
+                  fi
+              done
+              if test x"$CC_FOR_BUILD" = x ; then
+                  CC_FOR_BUILD=no_compiler_found
+              fi
+              ;;
+       ,,*)   CC_FOR_BUILD=$CC ;;
+       ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+    esac
+}
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
        PATH=$PATH:/.attbin ; export PATH
 fi
 
@@ -132,14 +134,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
 Linux|GNU|GNU/*)
        # If the system lacks a compiler, then just pick glibc.
        # We could probably try harder.
        LIBC=gnu
 
-       eval $set_cc_for_build
-       cat <<-EOF > $dummy.c
+       set_cc_for_build
+       cat <<-EOF > "$dummy.c"
        #include <features.h>
        #if defined(__UCLIBC__)
        LIBC=uclibc
@@ -149,13 +151,20 @@ Linux|GNU|GNU/*)
        LIBC=gnu
        #endif
        EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+       # If ldd exists, use it to detect musl libc.
+       if command -v ldd >/dev/null && \
+               ldd --version 2>&1 | grep -q ^musl
+       then
+           LIBC=musl
+       fi
        ;;
 esac
 
 # Note: order is significant - the case branches are not exclusive.
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
        # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -169,30 +178,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # portion of the name.  We always set it to "unknown".
        sysctl="sysctl -n hw.machine_arch"
        UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
-           /sbin/$sysctl 2>/dev/null || \
-           /usr/sbin/$sysctl 2>/dev/null || \
+           "/sbin/$sysctl" 2>/dev/null || \
+           "/usr/sbin/$sysctl" 2>/dev/null || \
            echo unknown)`
-       case "${UNAME_MACHINE_ARCH}" in
+       case "$UNAME_MACHINE_ARCH" in
            armeb) machine=armeb-unknown ;;
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
            sh5el) machine=sh5le-unknown ;;
            earmv*)
-               arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
-               endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
-               machine=${arch}${endian}-unknown
+               arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+               endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+               machine="${arch}${endian}"-unknown
                ;;
-           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+           *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
        esac
        # The Operating System including object format, if it has switched
        # to ELF recently (or will in the future) and ABI.
-       case "${UNAME_MACHINE_ARCH}" in
+       case "$UNAME_MACHINE_ARCH" in
            earm*)
                os=netbsdelf
                ;;
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-               eval $set_cc_for_build
+               set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
                        | grep -q __ELF__
                then
@@ -208,10 +217,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                ;;
        esac
        # Determine ABI tags.
-       case "${UNAME_MACHINE_ARCH}" in
+       case "$UNAME_MACHINE_ARCH" in
            earm*)
                expr='s/^earmv[0-9]/-eabi/;s/eb$//'
-               abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+               abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
                ;;
        esac
        # The OS release
@@ -219,51 +228,51 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # thus, need a distinct triplet. However, they do not need
        # kernel version information, so it can be replaced with a
        # suitable tag, in the style of linux-gnu.
-       case "${UNAME_VERSION}" in
+       case "$UNAME_VERSION" in
            Debian*)
                release='-gnu'
                ;;
            *)
-               release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+               release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
                ;;
        esac
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-       echo "${machine}-${os}${release}${abi}"
+       echo "$machine-${os}${release}${abi-}"
        exit ;;
     *:Bitrig:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+       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}
+       echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
        exit ;;
     *:LibertyBSD:*:*)
        UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
        exit ;;
     *:MidnightBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-midnightbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
        exit ;;
     *:ekkoBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
        exit ;;
     *:SolidBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
        exit ;;
     macppc:MirBSD:*:*)
-       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+       echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
        exit ;;
     *:MirBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
        exit ;;
     *:Sortix:*:*)
-       echo ${UNAME_MACHINE}-unknown-sortix
+       echo "$UNAME_MACHINE"-unknown-sortix
        exit ;;
     *:Redox:*:*)
-       echo ${UNAME_MACHINE}-unknown-redox
+       echo "$UNAME_MACHINE"-unknown-redox
        exit ;;
     mips:OSF1:*.*)
         echo mips-dec-osf1
@@ -319,7 +328,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Tn.n version is a released field test version.
        # 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`
+       echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
        # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
        exitcode=$?
        trap '' 0
@@ -328,10 +337,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo m68k-unknown-sysv4
        exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-amigaos
+       echo "$UNAME_MACHINE"-unknown-amigaos
        exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-morphos
+       echo "$UNAME_MACHINE"-unknown-morphos
        exit ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
@@ -343,7 +352,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo powerpc-ibm-os400
        exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-       echo arm-acorn-riscix${UNAME_RELEASE}
+       echo arm-acorn-riscix"$UNAME_RELEASE"
        exit ;;
     arm*:riscos:*:*|arm*:RISCOS:*:*)
        echo arm-unknown-riscos
@@ -370,19 +379,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
            sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
     s390x:SunOS:*:*)
-       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
        exit ;;
     sun4H:SunOS:5.*:*)
-       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
        exit ;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-       echo i386-pc-auroraux${UNAME_RELEASE}
+       echo i386-pc-auroraux"$UNAME_RELEASE"
        exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-       eval $set_cc_for_build
+       set_cc_for_build
        SUN_ARCH=i386
        # If there is a compiler, see if it is configured for 64-bit objects.
        # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
@@ -395,13 +404,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                SUN_ARCH=x86_64
            fi
        fi
-       echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
        # it's likely to be more like Solaris than SunOS4.
-       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
@@ -410,25 +419,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                ;;
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
-       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
        exit ;;
     sun3*:SunOS:*:*)
-       echo m68k-sun-sunos${UNAME_RELEASE}
+       echo m68k-sun-sunos"$UNAME_RELEASE"
        exit ;;
     sun*:*:4.2BSD:*)
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-       test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
+       test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
        case "`/bin/arch`" in
            sun3)
-               echo m68k-sun-sunos${UNAME_RELEASE}
+               echo m68k-sun-sunos"$UNAME_RELEASE"
                ;;
            sun4)
-               echo sparc-sun-sunos${UNAME_RELEASE}
+               echo sparc-sun-sunos"$UNAME_RELEASE"
                ;;
        esac
        exit ;;
     aushp:SunOS:*:*)
-       echo sparc-auspex-sunos${UNAME_RELEASE}
+       echo sparc-auspex-sunos"$UNAME_RELEASE"
        exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -439,44 +448,44 @@ 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}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        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}
+       echo m68k-milan-mint"$UNAME_RELEASE"
        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-       echo m68k-hades-mint${UNAME_RELEASE}
+       echo m68k-hades-mint"$UNAME_RELEASE"
        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-       echo m68k-unknown-mint${UNAME_RELEASE}
+       echo m68k-unknown-mint"$UNAME_RELEASE"
        exit ;;
     m68k:machten:*:*)
-       echo m68k-apple-machten${UNAME_RELEASE}
+       echo m68k-apple-machten"$UNAME_RELEASE"
        exit ;;
     powerpc:machten:*:*)
-       echo powerpc-apple-machten${UNAME_RELEASE}
+       echo powerpc-apple-machten"$UNAME_RELEASE"
        exit ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
        exit ;;
     RISC*:ULTRIX:*:*)
-       echo mips-dec-ultrix${UNAME_RELEASE}
+       echo mips-dec-ultrix"$UNAME_RELEASE"
        exit ;;
     VAX*:ULTRIX*:*:*)
-       echo vax-dec-ultrix${UNAME_RELEASE}
+       echo vax-dec-ultrix"$UNAME_RELEASE"
        exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
-       echo clipper-intergraph-clix${UNAME_RELEASE}
+       echo clipper-intergraph-clix"$UNAME_RELEASE"
        exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       set_cc_for_build
+       sed 's/^        //' << EOF > "$dummy.c"
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
        int main (int argc, char *argv[]) {
@@ -497,11 +506,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
          exit (-1);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c &&
-         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-         SYSTEM_NAME=`$dummy $dummyarg` &&
+       $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+         dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+         SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
            { echo "$SYSTEM_NAME"; exit; }
-       echo mips-mips-riscos${UNAME_RELEASE}
+       echo mips-mips-riscos"$UNAME_RELEASE"
        exit ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
@@ -527,17 +536,17 @@ EOF
     AViiON:dgux:*:*)
        # DG/UX returns AViiON for all architectures
        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+       if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
        then
-           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+              [ "$TARGET_BINARY_INTERFACE"x = x ]
            then
-               echo m88k-dg-dgux${UNAME_RELEASE}
+               echo m88k-dg-dgux"$UNAME_RELEASE"
            else
-               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+               echo m88k-dg-dguxbcs"$UNAME_RELEASE"
            fi
        else
-           echo i586-dg-dgux${UNAME_RELEASE}
+           echo i586-dg-dgux"$UNAME_RELEASE"
        fi
        exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
@@ -554,7 +563,7 @@ EOF
        echo m68k-tektronix-bsd
        exit ;;
     *:IRIX*:*:*)
-       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
        exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
        echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
@@ -566,14 +575,14 @@ EOF
        if [ -x /usr/bin/oslevel ] ; then
                IBM_REV=`/usr/bin/oslevel`
        else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+               IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
-       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+       echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
        exit ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-               eval $set_cc_for_build
-               sed 's/^                //' << EOF >$dummy.c
+               set_cc_for_build
+               sed 's/^                //' << EOF > "$dummy.c"
                #include <sys/systemcfg.h>
 
                main()
@@ -584,7 +593,7 @@ EOF
                        exit(0);
                        }
 EOF
-               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
                then
                        echo "$SYSTEM_NAME"
                else
@@ -598,7 +607,7 @@ EOF
        exit ;;
     *: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
+       if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
        else
                IBM_ARCH=powerpc
@@ -607,9 +616,9 @@ EOF
                IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
                           awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
        else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+               IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
-       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
        exit ;;
     *:AIX:*:*)
        echo rs6000-ibm-aix
@@ -618,7 +627,7 @@ EOF
        echo romp-ibm-bsd4.4
        exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+       echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
        exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
        echo rs6000-bull-bosx
@@ -633,28 +642,28 @@ EOF
        echo m68k-hp-bsd4.4
        exit ;;
     9000/[34678]??:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       case "${UNAME_MACHINE}" in
+       HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+       case "$UNAME_MACHINE" in
            9000/31?)            HP_ARCH=m68000 ;;
            9000/[34]??)         HP_ARCH=m68k ;;
            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
+                   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
+                       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
                fi
-               if [ "${HP_ARCH}" = "" ]; then
-                   eval $set_cc_for_build
-                   sed 's/^            //' << EOF >$dummy.c
+               if [ "$HP_ARCH" = "" ]; then
+                   set_cc_for_build
+                   sed 's/^            //' << EOF > "$dummy.c"
 
                #define _HPUX_SOURCE
                #include <stdlib.h>
@@ -687,13 +696,13 @@ EOF
                    exit (0);
                }
 EOF
-                   (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+                   (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
                    test -z "$HP_ARCH" && HP_ARCH=hppa
                fi ;;
        esac
-       if [ ${HP_ARCH} = hppa2.0w ]
+       if [ "$HP_ARCH" = hppa2.0w ]
        then
-           eval $set_cc_for_build
+           set_cc_for_build
 
            # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
            # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
@@ -712,15 +721,15 @@ EOF
                HP_ARCH=hppa64
            fi
        fi
-       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
        exit ;;
     ia64:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       echo ia64-hp-hpux${HPUX_REV}
+       HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+       echo ia64-hp-hpux"$HPUX_REV"
        exit ;;
     3050*:HI-UX:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       set_cc_for_build
+       sed 's/^        //' << EOF > "$dummy.c"
        #include <unistd.h>
        int
        main ()
@@ -745,7 +754,7 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+       $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
                { echo "$SYSTEM_NAME"; exit; }
        echo unknown-hitachi-hiuxwe2
        exit ;;
@@ -766,9 +775,9 @@ EOF
        exit ;;
     i*86:OSF1:*:*)
        if [ -x /usr/sbin/sysversion ] ; then
-           echo ${UNAME_MACHINE}-unknown-osf1mk
+           echo "$UNAME_MACHINE"-unknown-osf1mk
        else
-           echo ${UNAME_MACHINE}-unknown-osf1
+           echo "$UNAME_MACHINE"-unknown-osf1
        fi
        exit ;;
     parisc*:Lites*:*:*)
@@ -793,109 +802,120 @@ EOF
        echo c4-convex-bsd
        exit ;;
     CRAY*Y-MP:*:*:*)
-       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*[A-Z]90:*:*:*)
-       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+       echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
              -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*TS:*:*:*)
-       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*T3E:*:*:*)
-       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*SV1:*:*:*)
-       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     *:UNICOS/mp:*:*)
-       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        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/ /_/'`
+       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/ /_/'`
+       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}
+       echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
        exit ;;
     sparc*:BSD/OS:*:*)
-       echo sparc-unknown-bsdi${UNAME_RELEASE}
+       echo sparc-unknown-bsdi"$UNAME_RELEASE"
        exit ;;
     *:BSD/OS:*:*)
-       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+       exit ;;
+    arm:FreeBSD:*:*)
+       UNAME_PROCESSOR=`uname -p`
+       set_cc_for_build
+       if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_PCS_VFP
+       then
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+       else
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+       fi
        exit ;;
     *:FreeBSD:*:*)
        UNAME_PROCESSOR=`/usr/bin/uname -p`
-       case ${UNAME_PROCESSOR} in
+       case "$UNAME_PROCESSOR" in
            amd64)
                UNAME_PROCESSOR=x86_64 ;;
            i386)
                UNAME_PROCESSOR=i586 ;;
        esac
-       echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
        exit ;;
     i*:CYGWIN*:*)
-       echo ${UNAME_MACHINE}-pc-cygwin
+       echo "$UNAME_MACHINE"-pc-cygwin
        exit ;;
     *:MINGW64*:*)
-       echo ${UNAME_MACHINE}-pc-mingw64
+       echo "$UNAME_MACHINE"-pc-mingw64
        exit ;;
     *:MINGW*:*)
-       echo ${UNAME_MACHINE}-pc-mingw32
+       echo "$UNAME_MACHINE"-pc-mingw32
        exit ;;
     *:MSYS*:*)
-       echo ${UNAME_MACHINE}-pc-msys
+       echo "$UNAME_MACHINE"-pc-msys
        exit ;;
     i*:PW*:*)
-       echo ${UNAME_MACHINE}-pc-pw32
+       echo "$UNAME_MACHINE"-pc-pw32
        exit ;;
     *:Interix*:*)
-       case ${UNAME_MACHINE} in
+       case "$UNAME_MACHINE" in
            x86)
-               echo i586-pc-interix${UNAME_RELEASE}
+               echo i586-pc-interix"$UNAME_RELEASE"
                exit ;;
            authenticamd | genuineintel | EM64T)
-               echo x86_64-unknown-interix${UNAME_RELEASE}
+               echo x86_64-unknown-interix"$UNAME_RELEASE"
                exit ;;
            IA64)
-               echo ia64-unknown-interix${UNAME_RELEASE}
+               echo ia64-unknown-interix"$UNAME_RELEASE"
                exit ;;
        esac ;;
     i*:UWIN*:*)
-       echo ${UNAME_MACHINE}-pc-uwin
+       echo "$UNAME_MACHINE"-pc-uwin
        exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-       echo x86_64-unknown-cygwin
+       echo x86_64-pc-cygwin
        exit ;;
     prep*:SunOS:5.*:*)
-       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
        exit ;;
     *:GNU:*:*)
        # the GNU system
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
        exit ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
-       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+       echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
        exit ;;
-    i*86:Minix:*:*)
-       echo ${UNAME_MACHINE}-pc-minix
+    *:Minix:*:*)
+       echo "$UNAME_MACHINE"-unknown-minix
        exit ;;
     aarch64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     aarch64_be:Linux:*:*)
        UNAME_MACHINE=aarch64_be
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -909,63 +929,63 @@ EOF
        esac
        objdump --private-headers /bin/sh | grep -q ld.so.1
        if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     arc:Linux:*:* | arceb:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     arm*:Linux:*:*)
-       eval $set_cc_for_build
+       set_cc_for_build
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
            | grep -q __ARM_EABI__
        then
-           echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+           echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        else
            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
                | grep -q __ARM_PCS_VFP
            then
-               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+               echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
            else
-               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+               echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
            fi
        fi
        exit ;;
     avr32*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     cris:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
        exit ;;
     crisv32:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
        exit ;;
     e2k:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     frv:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     hexagon:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     i*86:Linux:*:*)
-       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+       echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
        exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     k1om:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       set_cc_for_build
+       sed 's/^        //' << EOF > "$dummy.c"
        #undef CPU
        #undef ${UNAME_MACHINE}
        #undef ${UNAME_MACHINE}el
@@ -979,70 +999,70 @@ EOF
        #endif
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
+       test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
        ;;
     mips64el:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     openrisc*:Linux:*:*)
-       echo or1k-unknown-linux-${LIBC}
+       echo or1k-unknown-linux-"$LIBC"
        exit ;;
     or32:Linux:*:* | or1k*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     padre:Linux:*:*)
-       echo sparc-unknown-linux-${LIBC}
+       echo sparc-unknown-linux-"$LIBC"
        exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-${LIBC}
+       echo hppa64-unknown-linux-"$LIBC"
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
-         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
-         *)    echo hppa-unknown-linux-${LIBC} ;;
+         PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+         PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+         *)    echo hppa-unknown-linux-"$LIBC" ;;
        esac
        exit ;;
     ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-${LIBC}
+       echo powerpc64-unknown-linux-"$LIBC"
        exit ;;
     ppc:Linux:*:*)
-       echo powerpc-unknown-linux-${LIBC}
+       echo powerpc-unknown-linux-"$LIBC"
        exit ;;
     ppc64le:Linux:*:*)
-       echo powerpc64le-unknown-linux-${LIBC}
+       echo powerpc64le-unknown-linux-"$LIBC"
        exit ;;
     ppcle:Linux:*:*)
-       echo powerpcle-unknown-linux-${LIBC}
+       echo powerpcle-unknown-linux-"$LIBC"
        exit ;;
     riscv32:Linux:*:* | riscv64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+       echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     tile*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     vax:Linux:*:*)
-       echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+       echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
        exit ;;
     x86_64:Linux:*:*)
-       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+       echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
        exit ;;
     xtensa*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1056,34 +1076,34 @@ EOF
        # 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.
-       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+       echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
        exit ;;
     i*86:OS/2:*:*)
        # If we were able to find `uname', then EMX Unix compatibility
        # is probably installed.
-       echo ${UNAME_MACHINE}-pc-os2-emx
+       echo "$UNAME_MACHINE"-pc-os2-emx
        exit ;;
     i*86:XTS-300:*:STOP)
-       echo ${UNAME_MACHINE}-unknown-stop
+       echo "$UNAME_MACHINE"-unknown-stop
        exit ;;
     i*86:atheos:*:*)
-       echo ${UNAME_MACHINE}-unknown-atheos
+       echo "$UNAME_MACHINE"-unknown-atheos
        exit ;;
     i*86:syllable:*:*)
-       echo ${UNAME_MACHINE}-pc-syllable
+       echo "$UNAME_MACHINE"-pc-syllable
        exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-       echo i386-unknown-lynxos${UNAME_RELEASE}
+       echo i386-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     i*86:*DOS:*:*)
-       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       echo "$UNAME_MACHINE"-pc-msdosdjgpp
        exit ;;
     i*86:*:4.*:*)
-       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+       UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+               echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
        else
-               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+               echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
        fi
        exit ;;
     i*86:*:5:[678]*)
@@ -1093,12 +1113,12 @@ EOF
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
        esac
-       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+       echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
        exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+               echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1108,9 +1128,9 @@ EOF
                        && UNAME_MACHINE=i686
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
                        && UNAME_MACHINE=i686
-               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+               echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
        else
-               echo ${UNAME_MACHINE}-pc-sysv32
+               echo "$UNAME_MACHINE"-pc-sysv32
        fi
        exit ;;
     pc:*:*:*)
@@ -1130,9 +1150,9 @@ EOF
        exit ;;
     i860:*:4.*:*) # i860-SVR4
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+         echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
        else # Add other i860-SVR4 vendors below as they are discovered.
-         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+         echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
        fi
        exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1152,9 +1172,9 @@ EOF
        test -r /etc/.relid \
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+         && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+         && { 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; } ;;
@@ -1163,28 +1183,28 @@ EOF
        test -r /etc/.relid \
            && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+           && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-           && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+           && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+           && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-       echo m68k-unknown-lynxos${UNAME_RELEASE}
+       echo m68k-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
        exit ;;
     TSUNAMI:LynxOS:2.*:*)
-       echo sparc-unknown-lynxos${UNAME_RELEASE}
+       echo sparc-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     rs6000:LynxOS:2.*:*)
-       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       echo rs6000-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-       echo powerpc-unknown-lynxos${UNAME_RELEASE}
+       echo powerpc-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     SM[BE]S:UNIX_SV:*:*)
-       echo mips-dde-sysv${UNAME_RELEASE}
+       echo mips-dde-sysv"$UNAME_RELEASE"
        exit ;;
     RM*:ReliantUNIX-*:*:*)
        echo mips-sni-sysv4
@@ -1195,7 +1215,7 @@ EOF
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
-               echo ${UNAME_MACHINE}-sni-sysv4
+               echo "$UNAME_MACHINE"-sni-sysv4
        else
                echo ns32k-sni-sysv
        fi
@@ -1215,23 +1235,23 @@ EOF
        exit ;;
     i*86:VOS:*:*)
        # From Paul.Green@stratus.com.
-       echo ${UNAME_MACHINE}-stratus-vos
+       echo "$UNAME_MACHINE"-stratus-vos
        exit ;;
     *:VOS:*:*)
        # From Paul.Green@stratus.com.
        echo hppa1.1-stratus-vos
        exit ;;
     mc68*:A/UX:*:*)
-       echo m68k-apple-aux${UNAME_RELEASE}
+       echo m68k-apple-aux"$UNAME_RELEASE"
        exit ;;
     news*:NEWS-OS:6*:*)
        echo mips-sony-newsos6
        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 ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
@@ -1250,39 +1270,39 @@ EOF
        echo x86_64-unknown-haiku
        exit ;;
     SX-4:SUPER-UX:*:*)
-       echo sx4-nec-superux${UNAME_RELEASE}
+       echo sx4-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-5:SUPER-UX:*:*)
-       echo sx5-nec-superux${UNAME_RELEASE}
+       echo sx5-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-6:SUPER-UX:*:*)
-       echo sx6-nec-superux${UNAME_RELEASE}
+       echo sx6-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-7:SUPER-UX:*:*)
-       echo sx7-nec-superux${UNAME_RELEASE}
+       echo sx7-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-8:SUPER-UX:*:*)
-       echo sx8-nec-superux${UNAME_RELEASE}
+       echo sx8-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-8R:SUPER-UX:*:*)
-       echo sx8r-nec-superux${UNAME_RELEASE}
+       echo sx8r-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-ACE:SUPER-UX:*:*)
-       echo sxace-nec-superux${UNAME_RELEASE}
+       echo sxace-nec-superux"$UNAME_RELEASE"
        exit ;;
     Power*:Rhapsody:*:*)
-       echo powerpc-apple-rhapsody${UNAME_RELEASE}
+       echo powerpc-apple-rhapsody"$UNAME_RELEASE"
        exit ;;
     *:Rhapsody:*:*)
-       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
        exit ;;
     *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       eval $set_cc_for_build
+       set_cc_for_build
        if test "$UNAME_PROCESSOR" = unknown ; then
            UNAME_PROCESSOR=powerpc
        fi
-       if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+       if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
            if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
                if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
                       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
@@ -1310,7 +1330,7 @@ EOF
            # that Apple uses in portable devices.
            UNAME_PROCESSOR=x86_64
        fi
-       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+       echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
        exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
        UNAME_PROCESSOR=`uname -p`
@@ -1318,22 +1338,25 @@ EOF
                UNAME_PROCESSOR=i386
                UNAME_MACHINE=pc
        fi
-       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+       echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
        exit ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit ;;
     NEO-*:NONSTOP_KERNEL:*:*)
-       echo neo-tandem-nsk${UNAME_RELEASE}
+       echo neo-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     NSE-*:NONSTOP_KERNEL:*:*)
-       echo nse-tandem-nsk${UNAME_RELEASE}
+       echo nse-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     NSR-*:NONSTOP_KERNEL:*:*)
-       echo nsr-tandem-nsk${UNAME_RELEASE}
+       echo nsr-tandem-nsk"$UNAME_RELEASE"
+       exit ;;
+    NSV-*:NONSTOP_KERNEL:*:*)
+       echo nsv-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     NSX-*:NONSTOP_KERNEL:*:*)
-       echo nsx-tandem-nsk${UNAME_RELEASE}
+       echo nsx-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
@@ -1342,18 +1365,19 @@ EOF
        echo bs2000-siemens-sysv
        exit ;;
     DS/*:UNIX_System_V:*:*)
-       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
        exit ;;
     *:Plan9:*:*)
        # "uname -m" is not consistent, so use $cputype instead. 386
        # is converted to i386 for consistency with other x86
        # operating systems.
+       # shellcheck disable=SC2154
        if test "$cputype" = 386; then
            UNAME_MACHINE=i386
        else
            UNAME_MACHINE="$cputype"
        fi
-       echo ${UNAME_MACHINE}-unknown-plan9
+       echo "$UNAME_MACHINE"-unknown-plan9
        exit ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
@@ -1374,14 +1398,14 @@ 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/[-(].*//'`
+       echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
        exit ;;
     *:*VMS:*:*)
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
-       case "${UNAME_MACHINE}" in
+       case "$UNAME_MACHINE" in
            A*) echo alpha-dec-vms ; exit ;;
            I*) echo ia64-dec-vms ; exit ;;
            V*) echo vax-dec-vms ; exit ;;
@@ -1390,25 +1414,28 @@ EOF
        echo i386-pc-xenix
        exit ;;
     i*86:skyos:*:*)
-       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+       echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
        exit ;;
     i*86:rdos:*:*)
-       echo ${UNAME_MACHINE}-pc-rdos
+       echo "$UNAME_MACHINE"-pc-rdos
        exit ;;
     i*86:AROS:*:*)
-       echo ${UNAME_MACHINE}-pc-aros
+       echo "$UNAME_MACHINE"-pc-aros
        exit ;;
     x86_64:VMkernel:*:*)
-       echo ${UNAME_MACHINE}-unknown-esx
+       echo "$UNAME_MACHINE"-unknown-esx
        exit ;;
     amd64:Isilon\ OneFS:*:*)
        echo x86_64-unknown-onefs
        exit ;;
+    *:Unleashed:*:*)
+       echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
+       exit ;;
 esac
 
 echo "$0: unable to guess system type" >&2
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
     mips:Linux | mips64:Linux)
        # If we got here on MIPS GNU/Linux, output extra information.
        cat >&2 <<EOF
@@ -1450,16 +1477,16 @@ hostinfo               = `(hostinfo) 2>/dev/null`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM  = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
 EOF
 
 exit 1
 
 # Local variables:
-# eval: (add-hook 'write-file-functions 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
index f2632cd8a2be180cc957624e84044347eba9e263..a5081b8e0d1d3dff5c9a9fb1accf757c0c72cd90 100755 (executable)
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2018-01-01'
+timestamp='2018-12-16'
 
 # 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
@@ -89,12 +89,12 @@ while test $# -gt 0 ; do
     - )        # Use stdin as input.
        break ;;
     -* )
-       echo "$me: invalid option $1$help"
+       echo "$me: invalid option $1$help" >&2
        exit 1 ;;
 
     *local*)
        # First pass through any local machine types.
-       echo $1
+       echo "$1"
        exit ;;
 
     * )
@@ -110,1251 +110,1160 @@ case $# in
     exit 1;;
 esac
 
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# 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-android* | linux-dietlibc | linux-newlib* | \
-  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
-  kopensolaris*-gnu* | cloudabi*-eabi* | \
-  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 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
+# Split fields of configuration type
+IFS="-" read field1 field2 field3 field4 <<EOF
+$1
+EOF
 
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-       -sun*os*)
-               # Prevent following clause from handling this invalid input.
-               ;;
-       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis | -knuth | -cray | -microblaze*)
-               os=
-               basic_machine=$1
-               ;;
-       -bluegene*)
-               os=-cnk
-               ;;
-       -sim | -cisco | -oki | -wec | -winbond)
-               os=
-               basic_machine=$1
-               ;;
-       -scout)
-               ;;
-       -wrs)
-               os=-vxworks
-               basic_machine=$1
-               ;;
-       -chorusos*)
-               os=-chorusos
-               basic_machine=$1
-               ;;
-       -chorusrdb)
-               os=-chorusrdb
-               basic_machine=$1
-               ;;
-       -hiux*)
-               os=-hiuxwe2
-               ;;
-       -sco6)
-               os=-sco5v6
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco5)
-               os=-sco3.2v5
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco4)
-               os=-sco3.2v4
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2.[4-9]*)
-               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2v[4-9]*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco5v6*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco*)
-               os=-sco3.2v2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -udk*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -isc)
-               os=-isc2.2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -clix*)
-               basic_machine=clipper-intergraph
-               ;;
-       -isc*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -lynx*178)
-               os=-lynxos178
-               ;;
-       -lynx*5)
-               os=-lynxos5
+# Separate into logical components for further validation
+case $1 in
+       *-*-*-*-*)
+               echo Invalid configuration \`"$1"\': more than four components >&2
+               exit 1
                ;;
-       -lynx*)
-               os=-lynxos
+       *-*-*-*)
+               basic_machine=$field1-$field2
+               os=$field3-$field4
                ;;
-       -ptx*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+       *-*-*)
+               # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+               # parts
+               maybe_os=$field2-$field3
+               case $maybe_os in
+                       nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
+                       | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
+                       | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+                       | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+                       | storm-chaos* | os2-emx* | rtmk-nova*)
+                               basic_machine=$field1
+                               os=$maybe_os
+                               ;;
+                       android-linux)
+                               basic_machine=$field1-unknown
+                               os=linux-android
+                               ;;
+                       *)
+                               basic_machine=$field1-$field2
+                               os=$field3
+                               ;;
+               esac
                ;;
-       -psos*)
-               os=-psos
+       *-*)
+               # A lone config we happen to match not fitting any pattern
+               case $field1-$field2 in
+                       decstation-3100)
+                               basic_machine=mips-dec
+                               os=
+                               ;;
+                       *-*)
+                               # Second component is usually, but not always the OS
+                               case $field2 in
+                                       # Prevent following clause from handling this valid os
+                                       sun*os*)
+                                               basic_machine=$field1
+                                               os=$field2
+                                               ;;
+                                       # Manufacturers
+                                       dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+                                       | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+                                       | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+                                       | convergent* | ncr* | news | 32* | 3600* | 3100* \
+                                       | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+                                       | ultra | tti* | harris | dolphin | highlevel | gould \
+                                       | cbm | ns | masscomp | apple | axis | knuth | cray \
+                                       | microblaze* | sim | cisco \
+                                       | oki | wec | wrs | winbond)
+                                               basic_machine=$field1-$field2
+                                               os=
+                                               ;;
+                                       *)
+                                               basic_machine=$field1
+                                               os=$field2
+                                               ;;
+                               esac
+                       ;;
+               esac
                ;;
-       -mint | -mint[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
+       *)
+               # Convert single-component short-hands not valid as part of
+               # multi-component configurations.
+               case $field1 in
+                       386bsd)
+                               basic_machine=i386-pc
+                               os=bsd
+                               ;;
+                       a29khif)
+                               basic_machine=a29k-amd
+                               os=udi
+                               ;;
+                       adobe68k)
+                               basic_machine=m68010-adobe
+                               os=scout
+                               ;;
+                       alliant)
+                               basic_machine=fx80-alliant
+                               os=
+                               ;;
+                       altos | altos3068)
+                               basic_machine=m68k-altos
+                               os=
+                               ;;
+                       am29k)
+                               basic_machine=a29k-none
+                               os=bsd
+                               ;;
+                       amdahl)
+                               basic_machine=580-amdahl
+                               os=sysv
+                               ;;
+                       amiga)
+                               basic_machine=m68k-unknown
+                               os=
+                               ;;
+                       amigaos | amigados)
+                               basic_machine=m68k-unknown
+                               os=amigaos
+                               ;;
+                       amigaunix | amix)
+                               basic_machine=m68k-unknown
+                               os=sysv4
+                               ;;
+                       apollo68)
+                               basic_machine=m68k-apollo
+                               os=sysv
+                               ;;
+                       apollo68bsd)
+                               basic_machine=m68k-apollo
+                               os=bsd
+                               ;;
+                       aros)
+                               basic_machine=i386-pc
+                               os=aros
+                               ;;
+                       aux)
+                               basic_machine=m68k-apple
+                               os=aux
+                               ;;
+                       balance)
+                               basic_machine=ns32k-sequent
+                               os=dynix
+                               ;;
+                       blackfin)
+                               basic_machine=bfin-unknown
+                               os=linux
+                               ;;
+                       cegcc)
+                               basic_machine=arm-unknown
+                               os=cegcc
+                               ;;
+                       convex-c1)
+                               basic_machine=c1-convex
+                               os=bsd
+                               ;;
+                       convex-c2)
+                               basic_machine=c2-convex
+                               os=bsd
+                               ;;
+                       convex-c32)
+                               basic_machine=c32-convex
+                               os=bsd
+                               ;;
+                       convex-c34)
+                               basic_machine=c34-convex
+                               os=bsd
+                               ;;
+                       convex-c38)
+                               basic_machine=c38-convex
+                               os=bsd
+                               ;;
+                       cray)
+                               basic_machine=j90-cray
+                               os=unicos
+                               ;;
+                       crds | unos)
+                               basic_machine=m68k-crds
+                               os=
+                               ;;
+                       da30)
+                               basic_machine=m68k-da30
+                               os=
+                               ;;
+                       decstation | pmax | pmin | dec3100 | decstatn)
+                               basic_machine=mips-dec
+                               os=
+                               ;;
+                       delta88)
+                               basic_machine=m88k-motorola
+                               os=sysv3
+                               ;;
+                       dicos)
+                               basic_machine=i686-pc
+                               os=dicos
+                               ;;
+                       djgpp)
+                               basic_machine=i586-pc
+                               os=msdosdjgpp
+                               ;;
+                       ebmon29k)
+                               basic_machine=a29k-amd
+                               os=ebmon
+                               ;;
+                       es1800 | OSE68k | ose68k | ose | OSE)
+                               basic_machine=m68k-ericsson
+                               os=ose
+                               ;;
+                       gmicro)
+                               basic_machine=tron-gmicro
+                               os=sysv
+                               ;;
+                       go32)
+                               basic_machine=i386-pc
+                               os=go32
+                               ;;
+                       h8300hms)
+                               basic_machine=h8300-hitachi
+                               os=hms
+                               ;;
+                       h8300xray)
+                               basic_machine=h8300-hitachi
+                               os=xray
+                               ;;
+                       h8500hms)
+                               basic_machine=h8500-hitachi
+                               os=hms
+                               ;;
+                       harris)
+                               basic_machine=m88k-harris
+                               os=sysv3
+                               ;;
+                       hp300)
+                               basic_machine=m68k-hp
+                               ;;
+                       hp300bsd)
+                               basic_machine=m68k-hp
+                               os=bsd
+                               ;;
+                       hp300hpux)
+                               basic_machine=m68k-hp
+                               os=hpux
+                               ;;
+                       hppaosf)
+                               basic_machine=hppa1.1-hp
+                               os=osf
+                               ;;
+                       hppro)
+                               basic_machine=hppa1.1-hp
+                               os=proelf
+                               ;;
+                       i386mach)
+                               basic_machine=i386-mach
+                               os=mach
+                               ;;
+                       vsta)
+                               basic_machine=i386-pc
+                               os=vsta
+                               ;;
+                       isi68 | isi)
+                               basic_machine=m68k-isi
+                               os=sysv
+                               ;;
+                       m68knommu)
+                               basic_machine=m68k-unknown
+                               os=linux
+                               ;;
+                       magnum | m3230)
+                               basic_machine=mips-mips
+                               os=sysv
+                               ;;
+                       merlin)
+                               basic_machine=ns32k-utek
+                               os=sysv
+                               ;;
+                       mingw64)
+                               basic_machine=x86_64-pc
+                               os=mingw64
+                               ;;
+                       mingw32)
+                               basic_machine=i686-pc
+                               os=mingw32
+                               ;;
+                       mingw32ce)
+                               basic_machine=arm-unknown
+                               os=mingw32ce
+                               ;;
+                       monitor)
+                               basic_machine=m68k-rom68k
+                               os=coff
+                               ;;
+                       morphos)
+                               basic_machine=powerpc-unknown
+                               os=morphos
+                               ;;
+                       moxiebox)
+                               basic_machine=moxie-unknown
+                               os=moxiebox
+                               ;;
+                       msdos)
+                               basic_machine=i386-pc
+                               os=msdos
+                               ;;
+                       msys)
+                               basic_machine=i686-pc
+                               os=msys
+                               ;;
+                       mvs)
+                               basic_machine=i370-ibm
+                               os=mvs
+                               ;;
+                       nacl)
+                               basic_machine=le32-unknown
+                               os=nacl
+                               ;;
+                       ncr3000)
+                               basic_machine=i486-ncr
+                               os=sysv4
+                               ;;
+                       netbsd386)
+                               basic_machine=i386-pc
+                               os=netbsd
+                               ;;
+                       netwinder)
+                               basic_machine=armv4l-rebel
+                               os=linux
+                               ;;
+                       news | news700 | news800 | news900)
+                               basic_machine=m68k-sony
+                               os=newsos
+                               ;;
+                       news1000)
+                               basic_machine=m68030-sony
+                               os=newsos
+                               ;;
+                       necv70)
+                               basic_machine=v70-nec
+                               os=sysv
+                               ;;
+                       nh3000)
+                               basic_machine=m68k-harris
+                               os=cxux
+                               ;;
+                       nh[45]000)
+                               basic_machine=m88k-harris
+                               os=cxux
+                               ;;
+                       nindy960)
+                               basic_machine=i960-intel
+                               os=nindy
+                               ;;
+                       mon960)
+                               basic_machine=i960-intel
+                               os=mon960
+                               ;;
+                       nonstopux)
+                               basic_machine=mips-compaq
+                               os=nonstopux
+                               ;;
+                       os400)
+                               basic_machine=powerpc-ibm
+                               os=os400
+                               ;;
+                       OSE68000 | ose68000)
+                               basic_machine=m68000-ericsson
+                               os=ose
+                               ;;
+                       os68k)
+                               basic_machine=m68k-none
+                               os=os68k
+                               ;;
+                       paragon)
+                               basic_machine=i860-intel
+                               os=osf
+                               ;;
+                       parisc)
+                               basic_machine=hppa-unknown
+                               os=linux
+                               ;;
+                       pw32)
+                               basic_machine=i586-unknown
+                               os=pw32
+                               ;;
+                       rdos | rdos64)
+                               basic_machine=x86_64-pc
+                               os=rdos
+                               ;;
+                       rdos32)
+                               basic_machine=i386-pc
+                               os=rdos
+                               ;;
+                       rom68k)
+                               basic_machine=m68k-rom68k
+                               os=coff
+                               ;;
+                       sa29200)
+                               basic_machine=a29k-amd
+                               os=udi
+                               ;;
+                       sei)
+                               basic_machine=mips-sei
+                               os=seiux
+                               ;;
+                       sequent)
+                               basic_machine=i386-sequent
+                               os=
+                               ;;
+                       sps7)
+                               basic_machine=m68k-bull
+                               os=sysv2
+                               ;;
+                       st2000)
+                               basic_machine=m68k-tandem
+                               os=
+                               ;;
+                       stratus)
+                               basic_machine=i860-stratus
+                               os=sysv4
+                               ;;
+                       sun2)
+                               basic_machine=m68000-sun
+                               os=
+                               ;;
+                       sun2os3)
+                               basic_machine=m68000-sun
+                               os=sunos3
+                               ;;
+                       sun2os4)
+                               basic_machine=m68000-sun
+                               os=sunos4
+                               ;;
+                       sun3)
+                               basic_machine=m68k-sun
+                               os=
+                               ;;
+                       sun3os3)
+                               basic_machine=m68k-sun
+                               os=sunos3
+                               ;;
+                       sun3os4)
+                               basic_machine=m68k-sun
+                               os=sunos4
+                               ;;
+                       sun4)
+                               basic_machine=sparc-sun
+                               os=
+                               ;;
+                       sun4os3)
+                               basic_machine=sparc-sun
+                               os=sunos3
+                               ;;
+                       sun4os4)
+                               basic_machine=sparc-sun
+                               os=sunos4
+                               ;;
+                       sun4sol2)
+                               basic_machine=sparc-sun
+                               os=solaris2
+                               ;;
+                       sun386 | sun386i | roadrunner)
+                               basic_machine=i386-sun
+                               os=
+                               ;;
+                       sv1)
+                               basic_machine=sv1-cray
+                               os=unicos
+                               ;;
+                       symmetry)
+                               basic_machine=i386-sequent
+                               os=dynix
+                               ;;
+                       t3e)
+                               basic_machine=alphaev5-cray
+                               os=unicos
+                               ;;
+                       t90)
+                               basic_machine=t90-cray
+                               os=unicos
+                               ;;
+                       toad1)
+                               basic_machine=pdp10-xkl
+                               os=tops20
+                               ;;
+                       tpf)
+                               basic_machine=s390x-ibm
+                               os=tpf
+                               ;;
+                       udi29k)
+                               basic_machine=a29k-amd
+                               os=udi
+                               ;;
+                       ultra3)
+                               basic_machine=a29k-nyu
+                               os=sym1
+                               ;;
+                       v810 | necv810)
+                               basic_machine=v810-nec
+                               os=none
+                               ;;
+                       vaxv)
+                               basic_machine=vax-dec
+                               os=sysv
+                               ;;
+                       vms)
+                               basic_machine=vax-dec
+                               os=vms
+                               ;;
+                       vxworks960)
+                               basic_machine=i960-wrs
+                               os=vxworks
+                               ;;
+                       vxworks68)
+                               basic_machine=m68k-wrs
+                               os=vxworks
+                               ;;
+                       vxworks29k)
+                               basic_machine=a29k-wrs
+                               os=vxworks
+                               ;;
+                       xbox)
+                               basic_machine=i686-pc
+                               os=mingw32
+                               ;;
+                       ymp)
+                               basic_machine=ymp-cray
+                               os=unicos
+                               ;;
+                       *)
+                               basic_machine=$1
+                               os=
+                               ;;
+               esac
                ;;
 esac
 
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
 case $basic_machine in
-       # Recognize the basic CPU types without company name.
-       # 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 | arceb \
-       | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
-       | avr | avr32 \
-       | ba \
-       | be32 | be64 \
-       | bfin \
-       | c4x | c8051 | clipper \
-       | d10v | d30v | dlx | dsp16xx \
-       | e2k | epiphany \
-       | fido | fr30 | frv | ft32 \
-       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-       | hexagon \
-       | i370 | i860 | i960 | ia16 | ia64 \
-       | ip2k | iq2000 \
-       | k1om \
-       | le32 | le64 \
-       | lm32 \
-       | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
-       | mips | mipsbe | mipseb | mipsel | mipsle \
-       | mips16 \
-       | mips64 | mips64el \
-       | mips64octeon | mips64octeonel \
-       | mips64orion | mips64orionel \
-       | mips64r5900 | mips64r5900el \
-       | mips64vr | mips64vrel \
-       | mips64vr4100 | mips64vr4100el \
-       | mips64vr4300 | mips64vr4300el \
-       | mips64vr5000 | mips64vr5000el \
-       | mips64vr5900 | mips64vr5900el \
-       | mipsisa32 | mipsisa32el \
-       | mipsisa32r2 | mipsisa32r2el \
-       | mipsisa32r6 | mipsisa32r6el \
-       | mipsisa64 | mipsisa64el \
-       | mipsisa64r2 | mipsisa64r2el \
-       | mipsisa64r6 | mipsisa64r6el \
-       | mipsisa64sb1 | mipsisa64sb1el \
-       | mipsisa64sr71k | mipsisa64sr71kel \
-       | mipsr5900 | mipsr5900el \
-       | mipstx39 | mipstx39el \
-       | mn10200 | mn10300 \
-       | moxie \
-       | mt \
-       | msp430 \
-       | nds32 | nds32le | nds32be \
-       | nios | nios2 | nios2eb | nios2el \
-       | ns16k | ns32k \
-       | open8 | or1k | or1knd | or32 \
-       | pdp10 | pdp11 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle \
-       | pru \
-       | pyramid \
-       | riscv32 | riscv64 \
-       | rl78 | rx \
-       | score \
-       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-       | sh64 | sh64le \
-       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-       | spu \
-       | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-       | ubicom32 \
-       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-       | visium \
-       | wasm32 \
-       | x86 | xc16x | xstormy16 | xtensa \
-       | z8k | z80)
-               basic_machine=$basic_machine-unknown
-               ;;
-       c54x)
-               basic_machine=tic54x-unknown
-               ;;
-       c55x)
-               basic_machine=tic55x-unknown
-               ;;
-       c6x)
-               basic_machine=tic6x-unknown
-               ;;
-       leon|leon[3-9])
-               basic_machine=sparc-$basic_machine
-               ;;
-       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
-               basic_machine=$basic_machine-unknown
-               os=-none
+       # Here we handle the default manufacturer of certain CPU types.  It is in
+       # some cases the only manufacturer, in others, it is the most popular.
+       w89k)
+               cpu=hppa1.1
+               vendor=winbond
                ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+       op50n)
+               cpu=hppa1.1
+               vendor=oki
                ;;
-       ms1)
-               basic_machine=mt-unknown
+       op60c)
+               cpu=hppa1.1
+               vendor=oki
                ;;
-
-       strongarm | thumb | xscale)
-               basic_machine=arm-unknown
+       ibm*)
+               cpu=i370
+               vendor=ibm
                ;;
-       xgate)
-               basic_machine=$basic_machine-unknown
-               os=-none
+       orion105)
+               cpu=clipper
+               vendor=highlevel
                ;;
-       xscaleeb)
-               basic_machine=armeb-unknown
+       mac | mpw | mac-mpw)
+               cpu=m68k
+               vendor=apple
                ;;
-
-       xscaleel)
-               basic_machine=armel-unknown
+       pmac | pmac-mpw)
+               cpu=powerpc
+               vendor=apple
                ;;
 
-       # We use `pc' rather than `unknown'
-       # because (1) that's what they normally are, and
-       # (2) the word "unknown" tends to confuse beginning users.
-       i*86 | x86_64)
-         basic_machine=$basic_machine-pc
-         ;;
-       # Object if more than one company name word.
-       *-*-*)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-               exit 1
-               ;;
-       # 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-* | arceb-* \
-       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-       | avr-* | avr32-* \
-       | ba-* \
-       | be32-* | be64-* \
-       | bfin-* | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* \
-       | c8051-* | clipper-* | craynv-* | cydra-* \
-       | d10v-* | d30v-* | dlx-* \
-       | e2k-* | elxsi-* \
-       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-       | h8300-* | h8500-* \
-       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-       | hexagon-* \
-       | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
-       | ip2k-* | iq2000-* \
-       | k1om-* \
-       | le32-* | le64-* \
-       | lm32-* \
-       | m32c-* | m32r-* | m32rle-* \
-       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
-       | microblaze-* | microblazeel-* \
-       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-       | mips16-* \
-       | mips64-* | mips64el-* \
-       | mips64octeon-* | mips64octeonel-* \
-       | mips64orion-* | mips64orionel-* \
-       | mips64r5900-* | mips64r5900el-* \
-       | mips64vr-* | mips64vrel-* \
-       | mips64vr4100-* | mips64vr4100el-* \
-       | mips64vr4300-* | mips64vr4300el-* \
-       | mips64vr5000-* | mips64vr5000el-* \
-       | mips64vr5900-* | mips64vr5900el-* \
-       | mipsisa32-* | mipsisa32el-* \
-       | mipsisa32r2-* | mipsisa32r2el-* \
-       | mipsisa32r6-* | mipsisa32r6el-* \
-       | mipsisa64-* | mipsisa64el-* \
-       | mipsisa64r2-* | mipsisa64r2el-* \
-       | mipsisa64r6-* | mipsisa64r6el-* \
-       | mipsisa64sb1-* | mipsisa64sb1el-* \
-       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
-       | mipsr5900-* | mipsr5900el-* \
-       | mipstx39-* | mipstx39el-* \
-       | mmix-* \
-       | mt-* \
-       | msp430-* \
-       | nds32-* | nds32le-* | nds32be-* \
-       | nios-* | nios2-* | nios2eb-* | nios2el-* \
-       | none-* | np1-* | ns16k-* | ns32k-* \
-       | open8-* \
-       | or1k*-* \
-       | orion-* \
-       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-       | pru-* \
-       | pyramid-* \
-       | riscv32-* | riscv64-* \
-       | 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-* | sv1-* | sx*-* \
-       | tahoe-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-       | tile*-* \
-       | tron-* \
-       | ubicom32-* \
-       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-       | vax-* \
-       | visium-* \
-       | wasm32-* \
-       | we32k-* \
-       | x86-* | x86_64-* | xc16x-* | xps100-* \
-       | xstormy16-* | xtensa*-* \
-       | ymp-* \
-       | z8k-* | z80-*)
-               ;;
-       # Recognize the basic CPU types without company name, with glob match.
-       xtensa*)
-               basic_machine=$basic_machine-unknown
-               ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
-       386bsd)
-               basic_machine=i386-unknown
-               os=-bsd
-               ;;
        3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-               basic_machine=m68000-att
+               cpu=m68000
+               vendor=att
                ;;
        3b*)
-               basic_machine=we32k-att
-               ;;
-       a29khif)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       abacus)
-               basic_machine=abacus-unknown
-               ;;
-       adobe68k)
-               basic_machine=m68010-adobe
-               os=-scout
-               ;;
-       alliant | fx80)
-               basic_machine=fx80-alliant
-               ;;
-       altos | altos3068)
-               basic_machine=m68k-altos
-               ;;
-       am29k)
-               basic_machine=a29k-none
-               os=-bsd
-               ;;
-       amd64)
-               basic_machine=x86_64-pc
-               ;;
-       amd64-*)
-               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       amdahl)
-               basic_machine=580-amdahl
-               os=-sysv
-               ;;
-       amiga | amiga-*)
-               basic_machine=m68k-unknown
-               ;;
-       amigaos | amigados)
-               basic_machine=m68k-unknown
-               os=-amigaos
-               ;;
-       amigaunix | amix)
-               basic_machine=m68k-unknown
-               os=-sysv4
-               ;;
-       apollo68)
-               basic_machine=m68k-apollo
-               os=-sysv
-               ;;
-       apollo68bsd)
-               basic_machine=m68k-apollo
-               os=-bsd
-               ;;
-       aros)
-               basic_machine=i386-pc
-               os=-aros
-               ;;
-       asmjs)
-               basic_machine=asmjs-unknown
-               ;;
-       aux)
-               basic_machine=m68k-apple
-               os=-aux
-               ;;
-       balance)
-               basic_machine=ns32k-sequent
-               os=-dynix
-               ;;
-       blackfin)
-               basic_machine=bfin-unknown
-               os=-linux
-               ;;
-       blackfin-*)
-               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=-linux
+               cpu=we32k
+               vendor=att
                ;;
        bluegene*)
-               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)
-               basic_machine=arm-unknown
-               os=-cegcc
-               ;;
-       convex-c1)
-               basic_machine=c1-convex
-               os=-bsd
-               ;;
-       convex-c2)
-               basic_machine=c2-convex
-               os=-bsd
-               ;;
-       convex-c32)
-               basic_machine=c32-convex
-               os=-bsd
-               ;;
-       convex-c34)
-               basic_machine=c34-convex
-               os=-bsd
-               ;;
-       convex-c38)
-               basic_machine=c38-convex
-               os=-bsd
-               ;;
-       cray | j90)
-               basic_machine=j90-cray
-               os=-unicos
-               ;;
-       craynv)
-               basic_machine=craynv-cray
-               os=-unicosmp
-               ;;
-       cr16 | cr16-*)
-               basic_machine=cr16-unknown
-               os=-elf
-               ;;
-       crds | unos)
-               basic_machine=m68k-crds
-               ;;
-       crisv32 | crisv32-* | etraxfs*)
-               basic_machine=crisv32-axis
-               ;;
-       cris | cris-* | etrax*)
-               basic_machine=cris-axis
-               ;;
-       crx)
-               basic_machine=crx-unknown
-               os=-elf
-               ;;
-       da30 | da30-*)
-               basic_machine=m68k-da30
-               ;;
-       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-               basic_machine=mips-dec
+               cpu=powerpc
+               vendor=ibm
+               os=cnk
                ;;
        decsystem10* | dec10*)
-               basic_machine=pdp10-dec
-               os=-tops10
+               cpu=pdp10
+               vendor=dec
+               os=tops10
                ;;
        decsystem20* | dec20*)
-               basic_machine=pdp10-dec
-               os=-tops20
+               cpu=pdp10
+               vendor=dec
+               os=tops20
                ;;
        delta | 3300 | motorola-3300 | motorola-delta \
              | 3300-motorola | delta-motorola)
-               basic_machine=m68k-motorola
-               ;;
-       delta88)
-               basic_machine=m88k-motorola
-               os=-sysv3
-               ;;
-       dicos)
-               basic_machine=i686-pc
-               os=-dicos
-               ;;
-       djgpp)
-               basic_machine=i586-pc
-               os=-msdosdjgpp
-               ;;
-       dpx20 | dpx20-*)
-               basic_machine=rs6000-bull
-               os=-bosx
+               cpu=m68k
+               vendor=motorola
                ;;
        dpx2*)
-               basic_machine=m68k-bull
-               os=-sysv3
-               ;;
-       e500v[12])
-               basic_machine=powerpc-unknown
-               os=$os"spe"
-               ;;
-       e500v[12]-*)
-               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=$os"spe"
-               ;;
-       ebmon29k)
-               basic_machine=a29k-amd
-               os=-ebmon
-               ;;
-       elxsi)
-               basic_machine=elxsi-elxsi
-               os=-bsd
+               cpu=m68k
+               vendor=bull
+               os=sysv3
                ;;
        encore | umax | mmax)
-               basic_machine=ns32k-encore
+               cpu=ns32k
+               vendor=encore
                ;;
-       es1800 | OSE68k | ose68k | ose | OSE)
-               basic_machine=m68k-ericsson
-               os=-ose
+       elxsi)
+               cpu=elxsi
+               vendor=elxsi
+               os=${os:-bsd}
                ;;
        fx2800)
-               basic_machine=i860-alliant
+               cpu=i860
+               vendor=alliant
                ;;
        genix)
-               basic_machine=ns32k-ns
-               ;;
-       gmicro)
-               basic_machine=tron-gmicro
-               os=-sysv
-               ;;
-       go32)
-               basic_machine=i386-pc
-               os=-go32
+               cpu=ns32k
+               vendor=ns
                ;;
        h3050r* | hiux*)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       h8300hms)
-               basic_machine=h8300-hitachi
-               os=-hms
-               ;;
-       h8300xray)
-               basic_machine=h8300-hitachi
-               os=-xray
-               ;;
-       h8500hms)
-               basic_machine=h8500-hitachi
-               os=-hms
-               ;;
-       harris)
-               basic_machine=m88k-harris
-               os=-sysv3
-               ;;
-       hp300-*)
-               basic_machine=m68k-hp
-               ;;
-       hp300bsd)
-               basic_machine=m68k-hp
-               os=-bsd
-               ;;
-       hp300hpux)
-               basic_machine=m68k-hp
-               os=-hpux
+               cpu=hppa1.1
+               vendor=hitachi
+               os=hiuxwe2
                ;;
        hp3k9[0-9][0-9] | hp9[0-9][0-9])
-               basic_machine=hppa1.0-hp
+               cpu=hppa1.0
+               vendor=hp
                ;;
        hp9k2[0-9][0-9] | hp9k31[0-9])
-               basic_machine=m68000-hp
+               cpu=m68000
+               vendor=hp
                ;;
        hp9k3[2-9][0-9])
-               basic_machine=m68k-hp
+               cpu=m68k
+               vendor=hp
                ;;
        hp9k6[0-9][0-9] | hp6[0-9][0-9])
-               basic_machine=hppa1.0-hp
+               cpu=hppa1.0
+               vendor=hp
                ;;
        hp9k7[0-79][0-9] | hp7[0-79][0-9])
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k78[0-9] | hp78[0-9])
                # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
                # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[0-9][13679] | hp8[0-9][13679])
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[0-9][0-9] | hp8[0-9][0-9])
-               basic_machine=hppa1.0-hp
-               ;;
-       hppa-next)
-               os=-nextstep3
-               ;;
-       hppaosf)
-               basic_machine=hppa1.1-hp
-               os=-osf
-               ;;
-       hppro)
-               basic_machine=hppa1.1-hp
-               os=-proelf
-               ;;
-       i370-ibm* | ibm*)
-               basic_machine=i370-ibm
+               cpu=hppa1.0
+               vendor=hp
                ;;
        i*86v32)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv32
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv32
                ;;
        i*86v4*)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv4
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv4
                ;;
        i*86v)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=sysv
                ;;
        i*86sol2)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-solaris2
+               cpu=`echo "$1" | sed -e 's/86.*/86/'`
+               vendor=pc
+               os=solaris2
                ;;
-       i386mach)
-               basic_machine=i386-mach
-               os=-mach
-               ;;
-       i386-vsta | vsta)
-               basic_machine=i386-unknown
-               os=-vsta
+       j90 | j90-cray)
+               cpu=j90
+               vendor=cray
+               os=${os:-unicos}
                ;;
        iris | iris4d)
-               basic_machine=mips-sgi
+               cpu=mips
+               vendor=sgi
                case $os in
-                   -irix*)
+                   irix*)
                        ;;
                    *)
-                       os=-irix4
+                       os=irix4
                        ;;
                esac
                ;;
-       isi68 | isi)
-               basic_machine=m68k-isi
-               os=-sysv
-               ;;
-       leon-*|leon[3-9]-*)
-               basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
-               ;;
-       m68knommu)
-               basic_machine=m68k-unknown
-               os=-linux
-               ;;
-       m68knommu-*)
-               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=-linux
-               ;;
-       m88k-omron*)
-               basic_machine=m88k-omron
-               ;;
-       magnum | m3230)
-               basic_machine=mips-mips
-               os=-sysv
-               ;;
-       merlin)
-               basic_machine=ns32k-utek
-               os=-sysv
-               ;;
-       microblaze*)
-               basic_machine=microblaze-xilinx
-               ;;
-       mingw64)
-               basic_machine=x86_64-pc
-               os=-mingw64
-               ;;
-       mingw32)
-               basic_machine=i686-pc
-               os=-mingw32
-               ;;
-       mingw32ce)
-               basic_machine=arm-unknown
-               os=-mingw32ce
-               ;;
        miniframe)
-               basic_machine=m68000-convergent
-               ;;
-       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
-               ;;
-       mips3*-*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-               ;;
-       mips3*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-               ;;
-       monitor)
-               basic_machine=m68k-rom68k
-               os=-coff
-               ;;
-       morphos)
-               basic_machine=powerpc-unknown
-               os=-morphos
-               ;;
-       moxiebox)
-               basic_machine=moxie-unknown
-               os=-moxiebox
-               ;;
-       msdos)
-               basic_machine=i386-pc
-               os=-msdos
-               ;;
-       ms1-*)
-               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-               ;;
-       msys)
-               basic_machine=i686-pc
-               os=-msys
-               ;;
-       mvs)
-               basic_machine=i370-ibm
-               os=-mvs
+               cpu=m68000
+               vendor=convergent
                ;;
-       nacl)
-               basic_machine=le32-unknown
-               os=-nacl
-               ;;
-       ncr3000)
-               basic_machine=i486-ncr
-               os=-sysv4
-               ;;
-       netbsd386)
-               basic_machine=i386-unknown
-               os=-netbsd
-               ;;
-       netwinder)
-               basic_machine=armv4l-rebel
-               os=-linux
-               ;;
-       news | news700 | news800 | news900)
-               basic_machine=m68k-sony
-               os=-newsos
-               ;;
-       news1000)
-               basic_machine=m68030-sony
-               os=-newsos
+       *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               cpu=m68k
+               vendor=atari
+               os=mint
                ;;
        news-3600 | risc-news)
-               basic_machine=mips-sony
-               os=-newsos
-               ;;
-       necv70)
-               basic_machine=v70-nec
-               os=-sysv
+               cpu=mips
+               vendor=sony
+               os=newsos
                ;;
        next | m*-next)
-               basic_machine=m68k-next
+               cpu=m68k
+               vendor=next
                case $os in
-                   -nextstep* )
+                   nextstep* )
                        ;;
-                   -ns2*)
-                     os=-nextstep2
+                   ns2*)
+                     os=nextstep2
                        ;;
                    *)
-                     os=-nextstep3
+                     os=nextstep3
                        ;;
                esac
                ;;
-       nh3000)
-               basic_machine=m68k-harris
-               os=-cxux
-               ;;
-       nh[45]000)
-               basic_machine=m88k-harris
-               os=-cxux
-               ;;
-       nindy960)
-               basic_machine=i960-intel
-               os=-nindy
-               ;;
-       mon960)
-               basic_machine=i960-intel
-               os=-mon960
-               ;;
-       nonstopux)
-               basic_machine=mips-compaq
-               os=-nonstopux
-               ;;
        np1)
-               basic_machine=np1-gould
-               ;;
-       neo-tandem)
-               basic_machine=neo-tandem
-               ;;
-       nse-tandem)
-               basic_machine=nse-tandem
-               ;;
-       nsr-tandem)
-               basic_machine=nsr-tandem
-               ;;
-       nsx-tandem)
-               basic_machine=nsx-tandem
+               cpu=np1
+               vendor=gould
                ;;
        op50n-* | op60c-*)
-               basic_machine=hppa1.1-oki
-               os=-proelf
-               ;;
-       openrisc | openrisc-*)
-               basic_machine=or32-unknown
-               ;;
-       os400)
-               basic_machine=powerpc-ibm
-               os=-os400
-               ;;
-       OSE68000 | ose68000)
-               basic_machine=m68000-ericsson
-               os=-ose
-               ;;
-       os68k)
-               basic_machine=m68k-none
-               os=-os68k
+               cpu=hppa1.1
+               vendor=oki
+               os=proelf
                ;;
        pa-hitachi)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       paragon)
-               basic_machine=i860-intel
-               os=-osf
-               ;;
-       parisc)
-               basic_machine=hppa-unknown
-               os=-linux
-               ;;
-       parisc-*)
-               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=-linux
+               cpu=hppa1.1
+               vendor=hitachi
+               os=hiuxwe2
                ;;
        pbd)
-               basic_machine=sparc-tti
+               cpu=sparc
+               vendor=tti
                ;;
        pbb)
-               basic_machine=m68k-tti
+               cpu=m68k
+               vendor=tti
                ;;
-       pc532 | pc532-*)
-               basic_machine=ns32k-pc532
-               ;;
-       pc98)
-               basic_machine=i386-pc
-               ;;
-       pc98-*)
-               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentium | p5 | k5 | k6 | nexgen | viac3)
-               basic_machine=i586-pc
-               ;;
-       pentiumpro | p6 | 6x86 | athlon | athlon_*)
-               basic_machine=i686-pc
-               ;;
-       pentiumii | pentium2 | pentiumiii | pentium3)
-               basic_machine=i686-pc
-               ;;
-       pentium4)
-               basic_machine=i786-pc
-               ;;
-       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentiumpro-* | p6-* | 6x86-* | athlon-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentium4-*)
-               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+       pc532)
+               cpu=ns32k
+               vendor=pc532
                ;;
        pn)
-               basic_machine=pn-gould
-               ;;
-       power)  basic_machine=power-ibm
-               ;;
-       ppc | ppcbe)    basic_machine=powerpc-unknown
-               ;;
-       ppc-* | ppcbe-*)
-               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppcle | powerpclittle)
-               basic_machine=powerpcle-unknown
+               cpu=pn
+               vendor=gould
                ;;
-       ppcle-* | powerpclittle-*)
-               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64)  basic_machine=powerpc64-unknown
-               ;;
-       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64le | powerpc64little)
-               basic_machine=powerpc64le-unknown
-               ;;
-       ppc64le-* | powerpc64little-*)
-               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+       power)
+               cpu=power
+               vendor=ibm
                ;;
        ps2)
-               basic_machine=i386-ibm
-               ;;
-       pw32)
-               basic_machine=i586-unknown
-               os=-pw32
-               ;;
-       rdos | rdos64)
-               basic_machine=x86_64-pc
-               os=-rdos
-               ;;
-       rdos32)
-               basic_machine=i386-pc
-               os=-rdos
-               ;;
-       rom68k)
-               basic_machine=m68k-rom68k
-               os=-coff
+               cpu=i386
+               vendor=ibm
                ;;
        rm[46]00)
-               basic_machine=mips-siemens
+               cpu=mips
+               vendor=siemens
                ;;
        rtpc | rtpc-*)
-               basic_machine=romp-ibm
-               ;;
-       s390 | s390-*)
-               basic_machine=s390-ibm
-               ;;
-       s390x | s390x-*)
-               basic_machine=s390x-ibm
-               ;;
-       sa29200)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       sb1)
-               basic_machine=mipsisa64sb1-unknown
-               ;;
-       sb1el)
-               basic_machine=mipsisa64sb1el-unknown
+               cpu=romp
+               vendor=ibm
                ;;
        sde)
-               basic_machine=mipsisa32-sde
-               os=-elf
+               cpu=mipsisa32
+               vendor=sde
+               os=${os:-elf}
                ;;
-       sei)
-               basic_machine=mips-sei
-               os=-seiux
+       simso-wrs)
+               cpu=sparclite
+               vendor=wrs
+               os=vxworks
                ;;
-       sequent)
-               basic_machine=i386-sequent
+       tower | tower-32)
+               cpu=m68k
+               vendor=ncr
                ;;
-       sh)
-               basic_machine=sh-hitachi
-               os=-hms
+       vpp*|vx|vx-*)
+               cpu=f301
+               vendor=fujitsu
                ;;
-       sh5el)
-               basic_machine=sh5le-unknown
+       w65)
+               cpu=w65
+               vendor=wdc
                ;;
-       sh64)
-               basic_machine=sh64-unknown
+       w89k-*)
+               cpu=hppa1.1
+               vendor=winbond
+               os=proelf
                ;;
-       sparclite-wrs | simso-wrs)
-               basic_machine=sparclite-wrs
-               os=-vxworks
+       none)
+               cpu=none
+               vendor=none
                ;;
-       sps7)
-               basic_machine=m68k-bull
-               os=-sysv2
+       leon|leon[3-9])
+               cpu=sparc
+               vendor=$basic_machine
                ;;
-       spur)
-               basic_machine=spur-unknown
+       leon-*|leon[3-9]-*)
+               cpu=sparc
+               vendor=`echo "$basic_machine" | sed 's/-.*//'`
                ;;
-       st2000)
-               basic_machine=m68k-tandem
+
+       *-*)
+               IFS="-" read cpu vendor <<EOF
+$basic_machine
+EOF
                ;;
-       stratus)
-               basic_machine=i860-stratus
-               os=-sysv4
+       # We use `pc' rather than `unknown'
+       # because (1) that's what they normally are, and
+       # (2) the word "unknown" tends to confuse beginning users.
+       i*86 | x86_64)
+               cpu=$basic_machine
+               vendor=pc
                ;;
-       strongarm-* | thumb-*)
-               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+       # These rules are duplicated from below for sake of the special case above;
+       # i.e. things that normalized to x86 arches should also default to "pc"
+       pc98)
+               cpu=i386
+               vendor=pc
                ;;
-       sun2)
-               basic_machine=m68000-sun
+       x64 | amd64)
+               cpu=x86_64
+               vendor=pc
                ;;
-       sun2os3)
-               basic_machine=m68000-sun
-               os=-sunos3
+       # Recognize the basic CPU types without company name.
+       *)
+               cpu=$basic_machine
+               vendor=unknown
                ;;
-       sun2os4)
-               basic_machine=m68000-sun
-               os=-sunos4
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+       # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+       # some cases the only manufacturer, in others, it is the most popular.
+       craynv-unknown)
+               vendor=cray
+               os=${os:-unicosmp}
                ;;
-       sun3os3)
-               basic_machine=m68k-sun
-               os=-sunos3
+       c90-unknown | c90-cray)
+               vendor=cray
+               os=${os:-unicos}
                ;;
-       sun3os4)
-               basic_machine=m68k-sun
-               os=-sunos4
+       fx80-unknown)
+               vendor=alliant
                ;;
-       sun4os3)
-               basic_machine=sparc-sun
-               os=-sunos3
+       romp-unknown)
+               vendor=ibm
                ;;
-       sun4os4)
-               basic_machine=sparc-sun
-               os=-sunos4
+       mmix-unknown)
+               vendor=knuth
                ;;
-       sun4sol2)
-               basic_machine=sparc-sun
-               os=-solaris2
+       microblaze-unknown | microblazeel-unknown)
+               vendor=xilinx
                ;;
-       sun3 | sun3-*)
-               basic_machine=m68k-sun
+       rs6000-unknown)
+               vendor=ibm
                ;;
-       sun4)
-               basic_machine=sparc-sun
+       vax-unknown)
+               vendor=dec
                ;;
-       sun386 | sun386i | roadrunner)
-               basic_machine=i386-sun
+       pdp11-unknown)
+               vendor=dec
                ;;
-       sv1)
-               basic_machine=sv1-cray
-               os=-unicos
+       we32k-unknown)
+               vendor=att
                ;;
-       symmetry)
-               basic_machine=i386-sequent
-               os=-dynix
+       cydra-unknown)
+               vendor=cydrome
                ;;
-       t3e)
-               basic_machine=alphaev5-cray
-               os=-unicos
+       i370-ibm*)
+               vendor=ibm
                ;;
-       t90)
-               basic_machine=t90-cray
-               os=-unicos
+       orion-unknown)
+               vendor=highlevel
                ;;
-       tile*)
-               basic_machine=$basic_machine-unknown
-               os=-linux-gnu
+       xps-unknown | xps100-unknown)
+               cpu=xps100
+               vendor=honeywell
                ;;
-       tx39)
-               basic_machine=mipstx39-unknown
+
+       # Here we normalize CPU types with a missing or matching vendor
+       dpx20-unknown | dpx20-bull)
+               cpu=rs6000
+               vendor=bull
+               os=${os:-bosx}
                ;;
-       tx39el)
-               basic_machine=mipstx39el-unknown
+
+       # Here we normalize CPU types irrespective of the vendor
+       amd64-*)
+               cpu=x86_64
                ;;
-       toad1)
-               basic_machine=pdp10-xkl
-               os=-tops20
+       blackfin-*)
+               cpu=bfin
+               os=linux
                ;;
-       tower | tower-32)
-               basic_machine=m68k-ncr
+       c54x-*)
+               cpu=tic54x
                ;;
-       tpf)
-               basic_machine=s390x-ibm
-               os=-tpf
+       c55x-*)
+               cpu=tic55x
                ;;
-       udi29k)
-               basic_machine=a29k-amd
-               os=-udi
+       c6x-*)
+               cpu=tic6x
                ;;
-       ultra3)
-               basic_machine=a29k-nyu
-               os=-sym1
+       e500v[12]-*)
+               cpu=powerpc
+               os=$os"spe"
                ;;
-       v810 | necv810)
-               basic_machine=v810-nec
-               os=-none
+       mips3*-*)
+               cpu=mips64
                ;;
-       vaxv)
-               basic_machine=vax-dec
-               os=-sysv
+       ms1-*)
+               cpu=mt
                ;;
-       vms)
-               basic_machine=vax-dec
-               os=-vms
+       m68knommu-*)
+               cpu=m68k
+               os=linux
                ;;
-       vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
+       m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+               cpu=s12z
                ;;
-       vxworks960)
-               basic_machine=i960-wrs
-               os=-vxworks
+       openrisc-*)
+               cpu=or32
                ;;
-       vxworks68)
-               basic_machine=m68k-wrs
-               os=-vxworks
+       parisc-*)
+               cpu=hppa
+               os=linux
                ;;
-       vxworks29k)
-               basic_machine=a29k-wrs
-               os=-vxworks
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+               cpu=i586
                ;;
-       wasm32)
-               basic_machine=wasm32-unknown
+       pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+               cpu=i686
                ;;
-       w65*)
-               basic_machine=w65-wdc
-               os=-none
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+               cpu=i686
                ;;
-       w89k-*)
-               basic_machine=hppa1.1-winbond
-               os=-proelf
+       pentium4-*)
+               cpu=i786
                ;;
-       x64)
-               basic_machine=x86_64-pc
+       pc98-*)
+               cpu=i386
                ;;
-       xbox)
-               basic_machine=i686-pc
-               os=-mingw32
+       ppc-* | ppcbe-*)
+               cpu=powerpc
                ;;
-       xps | xps100)
-               basic_machine=xps100-honeywell
+       ppcle-* | powerpclittle-*)
+               cpu=powerpcle
                ;;
-       xscale-* | xscalee[bl]-*)
-               basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+       ppc64-*)
+               cpu=powerpc64
                ;;
-       ymp)
-               basic_machine=ymp-cray
-               os=-unicos
+       ppc64le-* | powerpc64little-*)
+               cpu=powerpc64le
                ;;
-       z8k-*-coff)
-               basic_machine=z8k-unknown
-               os=-sim
+       sb1-*)
+               cpu=mipsisa64sb1
                ;;
-       z80-*-coff)
-               basic_machine=z80-unknown
-               os=-sim
+       sb1el-*)
+               cpu=mipsisa64sb1el
                ;;
-       none)
-               basic_machine=none-none
-               os=-none
+       sh5e[lb]-*)
+               cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
                ;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-       w89k)
-               basic_machine=hppa1.1-winbond
+       spur-*)
+               cpu=spur
                ;;
-       op50n)
-               basic_machine=hppa1.1-oki
+       strongarm-* | thumb-*)
+               cpu=arm
                ;;
-       op60c)
-               basic_machine=hppa1.1-oki
+       tx39-*)
+               cpu=mipstx39
                ;;
-       romp)
-               basic_machine=romp-ibm
+       tx39el-*)
+               cpu=mipstx39el
                ;;
-       mmix)
-               basic_machine=mmix-knuth
+       x64-*)
+               cpu=x86_64
                ;;
-       rs6000)
-               basic_machine=rs6000-ibm
+       xscale-* | xscalee[bl]-*)
+               cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
                ;;
-       vax)
-               basic_machine=vax-dec
+
+       # Recognize the canonical CPU Types that limit and/or modify the
+       # company names they are paired with.
+       cr16-*)
+               os=${os:-elf}
                ;;
-       pdp10)
-               # there are many clones, so DEC is not a safe bet
-               basic_machine=pdp10-unknown
+       crisv32-* | etraxfs*-*)
+               cpu=crisv32
+               vendor=axis
                ;;
-       pdp11)
-               basic_machine=pdp11-dec
+       cris-* | etrax*-*)
+               cpu=cris
+               vendor=axis
                ;;
-       we32k)
-               basic_machine=we32k-att
+       crx-*)
+               os=${os:-elf}
                ;;
-       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-               basic_machine=sh-unknown
+       neo-tandem)
+               cpu=neo
+               vendor=tandem
                ;;
-       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-               basic_machine=sparc-sun
+       nse-tandem)
+               cpu=nse
+               vendor=tandem
                ;;
-       cydra)
-               basic_machine=cydra-cydrome
+       nsr-tandem)
+               cpu=nsr
+               vendor=tandem
                ;;
-       orion)
-               basic_machine=orion-highlevel
+       nsv-tandem)
+               cpu=nsv
+               vendor=tandem
                ;;
-       orion105)
-               basic_machine=clipper-highlevel
+       nsx-tandem)
+               cpu=nsx
+               vendor=tandem
                ;;
-       mac | mpw | mac-mpw)
-               basic_machine=m68k-apple
+       s390-*)
+               cpu=s390
+               vendor=ibm
                ;;
-       pmac | pmac-mpw)
-               basic_machine=powerpc-apple
+       s390x-*)
+               cpu=s390x
+               vendor=ibm
                ;;
-       *-unknown)
-               # Make sure to match an already-canonicalized machine name.
+       tile*-*)
+               os=${os:-linux-gnu}
                ;;
+
        *)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-               exit 1
+               # Recognize the canonical CPU types that are allowed with any
+               # company name.
+               case $cpu in
+                       1750a | 580 \
+                       | a29k \
+                       | aarch64 | aarch64_be \
+                       | abacus \
+                       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+                       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+                       | alphapca5[67] | alpha64pca5[67] \
+                       | am33_2.0 \
+                       | amdgcn \
+                       | arc | arceb \
+                       | arm  | arm[lb]e | arme[lb] | armv* \
+                       | avr | avr32 \
+                       | asmjs \
+                       | ba \
+                       | be32 | be64 \
+                       | bfin | bs2000 \
+                       | c[123]* | c30 | [cjt]90 | c4x \
+                       | c8051 | clipper | craynv | csky | cydra \
+                       | d10v | d30v | dlx | dsp16xx \
+                       | e2k | elxsi | epiphany \
+                       | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+                       | h8300 | h8500 \
+                       | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+                       | hexagon \
+                       | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+                       | ip2k | iq2000 \
+                       | k1om \
+                       | le32 | le64 \
+                       | lm32 \
+                       | m32c | m32r | m32rle \
+                       | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \
+                       | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \
+                       | m88110 | m88k | maxq | mb | mcore | mep | metag \
+                       | microblaze | microblazeel \
+                       | mips | mipsbe | mipseb | mipsel | mipsle \
+                       | mips16 \
+                       | mips64 | mips64el \
+                       | mips64octeon | mips64octeonel \
+                       | mips64orion | mips64orionel \
+                       | mips64r5900 | mips64r5900el \
+                       | mips64vr | mips64vrel \
+                       | mips64vr4100 | mips64vr4100el \
+                       | mips64vr4300 | mips64vr4300el \
+                       | mips64vr5000 | mips64vr5000el \
+                       | mips64vr5900 | mips64vr5900el \
+                       | mipsisa32 | mipsisa32el \
+                       | mipsisa32r2 | mipsisa32r2el \
+                       | mipsisa32r6 | mipsisa32r6el \
+                       | mipsisa64 | mipsisa64el \
+                       | mipsisa64r2 | mipsisa64r2el \
+                       | mipsisa64r6 | mipsisa64r6el \
+                       | mipsisa64sb1 | mipsisa64sb1el \
+                       | mipsisa64sr71k | mipsisa64sr71kel \
+                       | mipsr5900 | mipsr5900el \
+                       | mipstx39 | mipstx39el \
+                       | mmix \
+                       | mn10200 | mn10300 \
+                       | moxie \
+                       | mt \
+                       | msp430 \
+                       | nds32 | nds32le | nds32be \
+                       | nfp \
+                       | nios | nios2 | nios2eb | nios2el \
+                       | none | np1 | ns16k | ns32k \
+                       | open8 \
+                       | or1k* \
+                       | or32 \
+                       | orion \
+                       | pdp10 | pdp11 | pj | pjl | pn | power \
+                       | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+                       | pru \
+                       | pyramid \
+                       | riscv | riscv32 | riscv64 \
+                       | rl78 | romp | rs6000 | rx \
+                       | score \
+                       | sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+                       | sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+                       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+                       | sparclite \
+                       | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+                       | spu \
+                       | tahoe \
+                       | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+                       | tron \
+                       | ubicom32 \
+                       | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+                       | vax \
+                       | visium \
+                       | wasm32 \
+                       | we32k \
+                       | x86 | x86_64 | xc16x | xgate | xps100 \
+                       | xstormy16 | xtensa* \
+                       | ymp \
+                       | z8k | z80)
+                               ;;
+
+                       *)
+                               echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+                               exit 1
+                               ;;
+               esac
                ;;
 esac
 
 # Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-       *-digital*)
-               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+       digital*)
+               vendor=dec
                ;;
-       *-commodore*)
-               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+       commodore*)
+               vendor=cbm
                ;;
        *)
                ;;
@@ -1362,213 +1271,246 @@ esac
 
 # Decode manufacturer-specific aliases for certain operating systems.
 
-if [ x"$os" != x"" ]
+if [ x$os != x ]
 then
 case $os in
        # 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
+       # solaris* is a basic system type, with this one exception.
+       auroraux)
+               os=auroraux
                ;;
-       -solaris1 | -solaris1.*)
-               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+       bluegene*)
+               os=cnk
                ;;
-       -solaris)
-               os=-solaris2
+       solaris1 | solaris1.*)
+               os=`echo $os | sed -e 's|solaris1|sunos4|'`
                ;;
-       -svr4*)
-               os=-sysv4
+       solaris)
+               os=solaris2
                ;;
-       -unixware*)
-               os=-sysv4.2uw
+       unixware*)
+               os=sysv4.2uw
                ;;
-       -gnu/linux*)
+       gnu/linux*)
                os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
                ;;
+       # es1800 is here to avoid being matched by es* (a different OS)
+       es1800*)
+               os=ose
+               ;;
+       # Some version numbers need modification
+       chorusos*)
+               os=chorusos
+               ;;
+       isc)
+               os=isc2.2
+               ;;
+       sco6)
+               os=sco5v6
+               ;;
+       sco5)
+               os=sco3.2v5
+               ;;
+       sco4)
+               os=sco3.2v4
+               ;;
+       sco3.2.[4-9]*)
+               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               ;;
+       sco3.2v[4-9]* | sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               ;;
+       scout)
+               # Don't match below
+               ;;
+       sco*)
+               os=sco3.2v2
+               ;;
+       psos*)
+               os=psos
+               ;;
        # Now accept the basic system types.
        # The portable systems comes first.
        # Each alternative MUST end in a * to match a version number.
-       # -sysv* is not here because it comes later, after sysvr4.
-       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-             | -sym* | -kopensolaris* | -plan9* \
-             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* | -aros* | -cloudabi* | -sortix* \
-             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-             | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
-             | -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* | -glidix* \
-             | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
-             | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-             | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
-             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-             | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme*)
+       # sysv* is not here because it comes later, after sysvr4.
+       gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+            | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
+            | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+            | sym* | kopensolaris* | plan9* \
+            | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+            | aos* | aros* | cloudabi* | sortix* \
+            | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+            | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+            | knetbsd* | mirbsd* | netbsd* \
+            | bitrig* | openbsd* | solidbsd* | libertybsd* \
+            | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
+            | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+            | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+            | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
+            | chorusrdb* | cegcc* | glidix* \
+            | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+            | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
+            | linux-newlib* | linux-musl* | linux-uclibc* \
+            | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+            | interix* | uwin* | mks* | rhapsody* | darwin* \
+            | openstep* | oskit* | conix* | pw32* | nonstopux* \
+            | storm-chaos* | tops10* | tenex* | tops20* | its* \
+            | os2* | vos* | palmos* | uclinux* | nucleus* \
+            | morphos* | superux* | rtmk* | windiss* \
+            | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+            | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+            | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+            | midnightbsd* | amdhsa* | unleashed*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
-       -qnx*)
-               case $basic_machine in
-                   x86-* | i*86-*)
+       qnx*)
+               case $cpu in
+                   x86 | i*86)
                        ;;
                    *)
-                       os=-nto$os
+                       os=nto-$os
                        ;;
                esac
                ;;
-       -nto-qnx*)
+       hiux*)
+               os=hiuxwe2
                ;;
-       -nto*)
-               os=`echo $os | sed -e 's|nto|nto-qnx|'`
+       nto-qnx*)
                ;;
-       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+       nto*)
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
                ;;
-       -mac*)
-               os=`echo $os | sed -e 's|mac|macos|'`
+       sim | xray | os68k* | v88r* \
+           | windows* | osx | abug | netware* | os9* \
+           | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
                ;;
-       -linux-dietlibc)
-               os=-linux-dietlibc
+       linux-dietlibc)
+               os=linux-dietlibc
                ;;
-       -linux*)
+       linux*)
                os=`echo $os | sed -e 's|linux|linux-gnu|'`
                ;;
-       -sunos5*)
-               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+       lynx*178)
+               os=lynxos178
                ;;
-       -sunos6*)
-               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+       lynx*5)
+               os=lynxos5
                ;;
-       -opened*)
-               os=-openedition
+       lynx*)
+               os=lynxos
                ;;
-       -os400*)
-               os=-os400
+       mac*)
+               os=`echo "$os" | sed -e 's|mac|macos|'`
                ;;
-       -wince*)
-               os=-wince
+       opened*)
+               os=openedition
                ;;
-       -osfrose*)
-               os=-osfrose
+       os400*)
+               os=os400
                ;;
-       -osf*)
-               os=-osf
+       sunos5*)
+               os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
                ;;
-       -utek*)
-               os=-bsd
+       sunos6*)
+               os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
                ;;
-       -dynix*)
-               os=-bsd
+       wince*)
+               os=wince
                ;;
-       -acis*)
-               os=-aos
+       utek*)
+               os=bsd
                ;;
-       -atheos*)
-               os=-atheos
+       dynix*)
+               os=bsd
                ;;
-       -syllable*)
-               os=-syllable
+       acis*)
+               os=aos
                ;;
-       -386bsd)
-               os=-bsd
+       atheos*)
+               os=atheos
                ;;
-       -ctix* | -uts*)
-               os=-sysv
+       syllable*)
+               os=syllable
                ;;
-       -nova*)
-               os=-rtmk-nova
-               ;;
-       -ns2)
-               os=-nextstep2
+       386bsd)
+               os=bsd
                ;;
-       -nsk*)
-               os=-nsk
+       ctix* | uts*)
+               os=sysv
                ;;
-       # Preserve the version number of sinix5.
-       -sinix5.*)
-               os=`echo $os | sed -e 's|sinix|sysv|'`
+       nova*)
+               os=rtmk-nova
                ;;
-       -sinix*)
-               os=-sysv4
+       ns2)
+               os=nextstep2
                ;;
-       -tpf*)
-               os=-tpf
+       nsk*)
+               os=nsk
                ;;
-       -triton*)
-               os=-sysv3
+       # Preserve the version number of sinix5.
+       sinix5.*)
+               os=`echo $os | sed -e 's|sinix|sysv|'`
                ;;
-       -oss*)
-               os=-sysv3
+       sinix*)
+               os=sysv4
                ;;
-       -svr4)
-               os=-sysv4
+       tpf*)
+               os=tpf
                ;;
-       -svr3)
-               os=-sysv3
+       triton*)
+               os=sysv3
                ;;
-       -sysvr4)
-               os=-sysv4
+       oss*)
+               os=sysv3
                ;;
-       # This must come after -sysvr4.
-       -sysv*)
+       svr4*)
+               os=sysv4
                ;;
-       -ose*)
-               os=-ose
+       svr3)
+               os=sysv3
                ;;
-       -es1800*)
-               os=-ose
+       sysvr4)
+               os=sysv4
                ;;
-       -xenix)
-               os=-xenix
+       # This must come after sysvr4.
+       sysv*)
                ;;
-       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-               os=-mint
+       ose*)
+               os=ose
                ;;
-       -aros*)
-               os=-aros
+       *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+               os=mint
                ;;
-       -zvmoe)
-               os=-zvmoe
+       zvmoe)
+               os=zvmoe
                ;;
-       -dicos*)
-               os=-dicos
+       dicos*)
+               os=dicos
                ;;
-       -pikeos*)
+       pikeos*)
                # Until real need of OS specific support for
                # particular features comes up, bare metal
                # configurations are quite functional.
-               case $basic_machine in
+               case $cpu in
                    arm*)
-                       os=-eabi
+                       os=eabi
                        ;;
                    *)
-                       os=-elf
+                       os=elf
                        ;;
                esac
                ;;
-       -nacl*)
+       nacl*)
                ;;
-       -ios)
+       ios)
                ;;
-       -none)
+       none)
+               ;;
+       *-eabi)
                ;;
        *)
-               # Get rid of the `-' at the beginning of $os.
-               os=`echo $os | sed 's/[^-]*-//'`
-               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+               echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
                exit 1
                ;;
 esac
@@ -1584,264 +1526,265 @@ else
 # will signal an error saying that MANUFACTURER isn't an operating
 # system, and we'll never get to this point.
 
-case $basic_machine in
+case $cpu-$vendor in
        score-*)
-               os=-elf
+               os=elf
                ;;
        spu-*)
-               os=-elf
+               os=elf
                ;;
        *-acorn)
-               os=-riscix1.2
+               os=riscix1.2
                ;;
        arm*-rebel)
-               os=-linux
+               os=linux
                ;;
        arm*-semi)
-               os=-aout
+               os=aout
                ;;
        c4x-* | tic4x-*)
-               os=-coff
+               os=coff
                ;;
        c8051-*)
-               os=-elf
+               os=elf
+               ;;
+       clipper-intergraph)
+               os=clix
                ;;
        hexagon-*)
-               os=-elf
+               os=elf
                ;;
        tic54x-*)
-               os=-coff
+               os=coff
                ;;
        tic55x-*)
-               os=-coff
+               os=coff
                ;;
        tic6x-*)
-               os=-coff
+               os=coff
                ;;
        # This must come before the *-dec entry.
        pdp10-*)
-               os=-tops20
+               os=tops20
                ;;
        pdp11-*)
-               os=-none
+               os=none
                ;;
        *-dec | vax-*)
-               os=-ultrix4.2
+               os=ultrix4.2
                ;;
        m68*-apollo)
-               os=-domain
+               os=domain
                ;;
        i386-sun)
-               os=-sunos4.0.2
+               os=sunos4.0.2
                ;;
        m68000-sun)
-               os=-sunos3
+               os=sunos3
                ;;
        m68*-cisco)
-               os=-aout
+               os=aout
                ;;
        mep-*)
-               os=-elf
+               os=elf
                ;;
        mips*-cisco)
-               os=-elf
+               os=elf
                ;;
        mips*-*)
-               os=-elf
+               os=elf
                ;;
        or32-*)
-               os=-coff
+               os=coff
                ;;
        *-tti)  # must be before sparc entry or we get the wrong os.
-               os=-sysv3
+               os=sysv3
                ;;
        sparc-* | *-sun)
-               os=-sunos4.1.1
+               os=sunos4.1.1
                ;;
        pru-*)
-               os=-elf
+               os=elf
                ;;
        *-be)
-               os=-beos
-               ;;
-       *-haiku)
-               os=-haiku
+               os=beos
                ;;
        *-ibm)
-               os=-aix
+               os=aix
                ;;
        *-knuth)
-               os=-mmixware
+               os=mmixware
                ;;
        *-wec)
-               os=-proelf
+               os=proelf
                ;;
        *-winbond)
-               os=-proelf
+               os=proelf
                ;;
        *-oki)
-               os=-proelf
+               os=proelf
                ;;
        *-hp)
-               os=-hpux
+               os=hpux
                ;;
        *-hitachi)
-               os=-hiux
+               os=hiux
                ;;
        i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-               os=-sysv
+               os=sysv
                ;;
        *-cbm)
-               os=-amigaos
+               os=amigaos
                ;;
        *-dg)
-               os=-dgux
+               os=dgux
                ;;
        *-dolphin)
-               os=-sysv3
+               os=sysv3
                ;;
        m68k-ccur)
-               os=-rtu
+               os=rtu
                ;;
        m88k-omron*)
-               os=-luna
+               os=luna
                ;;
        *-next)
-               os=-nextstep
+               os=nextstep
                ;;
        *-sequent)
-               os=-ptx
+               os=ptx
                ;;
        *-crds)
-               os=-unos
+               os=unos
                ;;
        *-ns)
-               os=-genix
+               os=genix
                ;;
        i370-*)
-               os=-mvs
-               ;;
-       *-next)
-               os=-nextstep3
+               os=mvs
                ;;
        *-gould)
-               os=-sysv
+               os=sysv
                ;;
        *-highlevel)
-               os=-bsd
+               os=bsd
                ;;
        *-encore)
-               os=-bsd
+               os=bsd
                ;;
        *-sgi)
-               os=-irix
+               os=irix
                ;;
        *-siemens)
-               os=-sysv4
+               os=sysv4
                ;;
        *-masscomp)
-               os=-rtu
+               os=rtu
                ;;
        f30[01]-fujitsu | f700-fujitsu)
-               os=-uxpv
+               os=uxpv
                ;;
        *-rom68k)
-               os=-coff
+               os=coff
                ;;
        *-*bug)
-               os=-coff
+               os=coff
                ;;
        *-apple)
-               os=-macos
+               os=macos
                ;;
        *-atari*)
-               os=-mint
+               os=mint
+               ;;
+       *-wrs)
+               os=vxworks
                ;;
        *)
-               os=-none
+               os=none
                ;;
 esac
 fi
 
 # Here we handle the case where we know the os, and the CPU type, but not the
 # manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-       *-unknown)
+case $vendor in
+       unknown)
                case $os in
-                       -riscix*)
+                       riscix*)
                                vendor=acorn
                                ;;
-                       -sunos*)
+                       sunos*)
                                vendor=sun
                                ;;
-                       -cnk*|-aix*)
+                       cnk*|-aix*)
                                vendor=ibm
                                ;;
-                       -beos*)
+                       beos*)
                                vendor=be
                                ;;
-                       -hpux*)
+                       hpux*)
                                vendor=hp
                                ;;
-                       -mpeix*)
+                       mpeix*)
                                vendor=hp
                                ;;
-                       -hiux*)
+                       hiux*)
                                vendor=hitachi
                                ;;
-                       -unos*)
+                       unos*)
                                vendor=crds
                                ;;
-                       -dgux*)
+                       dgux*)
                                vendor=dg
                                ;;
-                       -luna*)
+                       luna*)
                                vendor=omron
                                ;;
-                       -genix*)
+                       genix*)
                                vendor=ns
                                ;;
-                       -mvs* | -opened*)
+                       clix*)
+                               vendor=intergraph
+                               ;;
+                       mvs* | opened*)
                                vendor=ibm
                                ;;
-                       -os400*)
+                       os400*)
                                vendor=ibm
                                ;;
-                       -ptx*)
+                       ptx*)
                                vendor=sequent
                                ;;
-                       -tpf*)
+                       tpf*)
                                vendor=ibm
                                ;;
-                       -vxsim* | -vxworks* | -windiss*)
+                       vxsim* | vxworks* | windiss*)
                                vendor=wrs
                                ;;
-                       -aux*)
+                       aux*)
                                vendor=apple
                                ;;
-                       -hms*)
+                       hms*)
                                vendor=hitachi
                                ;;
-                       -mpw* | -macos*)
+                       mpw* | macos*)
                                vendor=apple
                                ;;
-                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+                       *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
                                vendor=atari
                                ;;
-                       -vos*)
+                       vos*)
                                vendor=stratus
                                ;;
                esac
-               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
                ;;
 esac
 
-echo $basic_machine$os
+echo "$cpu-$vendor-$os"
 exit
 
 # Local variables:
-# eval: (add-hook 'write-file-functions 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
index 5ff3c6feb4ba8c9cacfae53687d24683becc3d34..65cbf7093a1e4c4a2da08ac8dcd725f8376c344c 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2017-09-16.17; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 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
@@ -783,7 +783,7 @@ exit 0
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 18b3942a575742ea9e4e01a7128d84f916e443f1..4472ff50d2a8dc2ffa38453d29221b47dc5f796c 100755 (executable)
@@ -3,7 +3,7 @@
 # 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=2017-09-13.06 # UTC
+VERSION=2018-03-07.03 # UTC
 
 # Note: this is a bash script (could be zsh or dash)
 
@@ -171,7 +171,7 @@ 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)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "VERSION="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 33277d3ac1a6c8520de171cf3e175d6cdb8f54e2..91c058dc76d0b5b9c7a3b467e892c2abc9b8938c 100755 (executable)
@@ -2,7 +2,7 @@
 # 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=2018-01-01.00
+scriptversion=2018-03-06.19
 
 # Copyright 2003-2018 Free Software Foundation, Inc.
 #
@@ -59,6 +59,7 @@ commonarg= # passed to all makeinfo/texi2html invcations.
 dirargs=   # passed to all tools (-I dir).
 dirs=      # -I directories.
 htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual"
+default_htmlarg=true
 infoarg=--no-split
 generate_ascii=true
 generate_html=true
@@ -163,7 +164,7 @@ while test $# -gt 0; do
     --common)    shift; commonarg=$1;;
     --docbook)   docbook=yes;;
     --email)     shift; EMAIL=$1;;
-    --html)      shift; htmlarg=$1;;
+    --html)      shift; default_htmlarg=false; htmlarg=$1;;
     --info)      shift; infoarg=$1;;
     --no-ascii)  generate_ascii=false;;
     --no-html)   generate_ascii=false;;
@@ -199,6 +200,11 @@ commonarg=" $dirargs $commonarg"
 # For most of the following, the base name is just $PACKAGE
 base=$PACKAGE
 
+if $default_htmlarg && test -n "$use_texi2html"; then
+  # The legacy texi2html doesn't support TOP_NODE_UP_URL
+  htmlarg="--css-ref=/software/gnulib/manual.css"
+fi
+
 if test -n "$srcfile"; then
   # but here, we use the basename of $srcfile
   base=`basename "$srcfile"`
@@ -497,7 +503,7 @@ $GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html"
 echo "Done, see $outdir/ subdirectory for new files."
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-end: "$"
index 8647b9e38cfa7e4f51bae31a6b79c6c7d6e39b03..6d073fcaddd827a396af4c52f1bf00bdd84a9f66 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2017-09-13.06; # UTC
+scriptversion=2018-03-07.03; # UTC
 
 # Copyright (C) 2007-2018 Free Software Foundation, Inc.
 #
@@ -219,7 +219,7 @@ fi
 printf %s "$v"
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index d8074aadabfe1f95a6a72b649534fe452678eccc..1e73f4214f799662bf1edce473e1cfe17a8fb6b7 100755 (executable)
@@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
     if 0;
 # Convert git log output to ChangeLog format.
 
-my $VERSION = '2017-09-13 06:45'; # UTC
+my $VERSION = '2018-03-07 03:47'; # 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
@@ -491,7 +491,7 @@ sub git_dir_option($)
 # Local Variables:
 # mode: perl
 # indent-tabs-mode: nil
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "my $VERSION = '"
 # time-stamp-format: "%:y-%02m-%02d %02H:%02M"
 # time-stamp-time-zone: "UTC0"
index 12566c3bfb3a72be6de16b1a675e218fa0386791..356c56154a4ede7823080fbab765c2ab39931802 100755 (executable)
@@ -2,7 +2,7 @@
 # Run this after each non-alpha release, to update the web documentation at
 # https://www.gnu.org/software/$pkg/manual/
 
-VERSION=2017-09-13.06; # UTC
+VERSION=2018-03-07.03; # UTC
 
 # Copyright (C) 2009-2018 Free Software Foundation, Inc.
 
@@ -202,7 +202,7 @@ $RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
 )
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "VERSION="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 90b8c4e6e637c3616ccee72e618056a8d12c9314..8f05700814f2ee30430d2fe8c5eeae5b9c881025 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Sign files and upload them.
 
-scriptversion=2017-09-13.06; # UTC
+scriptversion=2018-05-19.18; # UTC
 
 # Copyright (C) 2004-2018 Free Software Foundation, Inc.
 #
@@ -24,7 +24,30 @@ scriptversion=2017-09-13.06; # UTC
 
 set -e
 
-GPG='gpg --batch --no-tty'
+GPG=gpg
+# Choose the proper version of gpg, so as to avoid a
+# "gpg-agent is not available in this session" error
+# when gpg-agent is version 3 but gpg is still version 1.
+# FIXME-2020: remove, once all major distros ship gpg version 3 as /usr/bin/gpg
+gpg_agent_version=`(gpg-agent --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
+case "$gpg_agent_version" in
+  2.*)
+    gpg_version=`(gpg --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
+    case "$gpg_version" in
+      1.*)
+        if (type gpg2) >/dev/null 2>/dev/null; then
+          # gpg2 is present.
+          GPG=gpg2
+        else
+          # gpg2 is missing. Ubuntu users should install the package 'gnupg2'.
+          echo "WARNING: Using 'gpg', which is too old. You should install 'gpg2'." 1>&2
+        fi
+        ;;
+    esac
+    ;;
+esac
+
+GPG="${GPG} --batch --no-tty"
 conffile=.gnuploadrc
 to=
 dry_run=false
@@ -54,10 +77,10 @@ Options:
   --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
+  -n, --dry-run            do nothing, show what would have been done
                            (including the constructed directive file)
   --version                output version information and exit
-  --help                   print this help text and exit
+  -h, --help               print this help text 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.:
@@ -125,7 +148,7 @@ while test -n "$1"; do
   -*)
     collect_var=
     case $1 in
-    --help)
+    -h | --help)
       echo "$usage"
       exit $?
       ;;
@@ -171,7 +194,7 @@ while test -n "$1"; do
     --symlink)
       collect_var=symlink_files
       ;;
-    --dry-run|-n)
+    -n | --dry-run)
       dry_run=:
       ;;
     --version)
@@ -432,7 +455,7 @@ done
 exit 0
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index ac159ceda40d78bbd6606879377a1c7ca7adad1c..8175c640fe6288a75cc846567ea5506086f326f4 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2017-09-23.17; # UTC
+scriptversion=2018-03-11.20; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -332,34 +332,43 @@ do
             # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
             ;;
           *)
+            # Note that $RANDOM variable is not portable (e.g. dash);  Use it
+            # here however when possible just to lower collision chance.
             tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
 
+            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            # Because "mkdir -p" follows existing symlinks and we likely work
+            # directly in world-writeable /tmp, make sure that the '$tmpdir'
+            # directory is successfully created first before we actually test
+            # 'mkdir -p' feature.
             if (umask $mkdir_umask &&
-                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+                $mkdirprog $mkdir_mode "$tmpdir" &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
             then
               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-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"`
+                   test_tmpdir="$tmpdir/a"
+                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
                    case $ls_ld_tmpdir in
                      d????-?r-*) different_mode=700;;
                      d????-?--*) different_mode=755;;
                      *) false;;
                    esac &&
-                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
                      test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                    }
                  }
               then posix_mkdir=:
               fi
-              rmdir "$tmpdir/d" "$tmpdir"
+              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
             else
               # Remove any dirs left behind by ancient mkdir implementations.
-              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
             fi
             trap '' 0;;
         esac;;
@@ -501,7 +510,7 @@ do
 done
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 34de97554a83ab98dcc12ae485e219bcb047a80b..8c7a5901a0690aded843445b891b91f3fe8002df 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/sh
 # Get modification time of a file or directory and pretty-print it.
 
-scriptversion=2017-09-22.02; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1995-2017 Free Software Foundation, Inc.
+# Copyright (C) 1995-2018 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
@@ -220,7 +220,7 @@ echo $day $month $year
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 46d7c7e2308d7a9bc852af0ffcedf795df0ddc74..625aeb11897a2221d5cda1d55b6866d61d21f660 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2017-09-16.17; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -101,8 +101,8 @@ else
   exit $st
 fi
 
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
 gnu_software_URL=https://www.gnu.org/software
 
 program_details ()
@@ -207,7 +207,7 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
 exit $st
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 4783bd990d37356ca5363314d174584966888b89..b8521a482e2b79eaf6fbd7db6725d78091b47299 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # test-driver - basic testsuite driver script.
 
-scriptversion=2017-09-16.17; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 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
@@ -140,7 +140,7 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 1987c50ba264f7e82d8d17e3ee7b075ecc053e5e..5840aff4d7ce41d99b4e85ad3bb308b255c25afe 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{2017-12-26.21}
+\def\texinfoversion{2018-09-21.20}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
+% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
 % Free Software Foundation, Inc.
 %
 % This texinfo.tex file is free software: you can redistribute it and/or
@@ -1528,6 +1528,9 @@ output) for that.)}
       \startlink attr{/Border [0 0 0]}%
         user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
     \endgroup}
+  % \pdfgettoks - Surround page numbers in #1 with @pdflink.  #1 may
+  % be a simple number, or a list of numbers in the case of an index
+  % entry.
   \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
   \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
   \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
@@ -2235,6 +2238,20 @@ end
 \font\smallersy=cmsy8
 \def\smallerecsize{0800}
 
+% Fonts for math mode superscripts (7pt).
+\def\sevennominalsize{7pt}
+\setfont\sevenrm\rmshape{7}{1000}{OT1}
+\setfont\seventt\ttshape{10}{700}{OT1TT}
+\setfont\sevenbf\bfshape{10}{700}{OT1}
+\setfont\sevenit\itshape{7}{1000}{OT1IT}
+\setfont\sevensl\slshape{10}{700}{OT1}
+\setfont\sevensf\sfshape{10}{700}{OT1}
+\setfont\sevensc\scshape{10}{700}{OT1}
+\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
+\font\seveni=cmmi7
+\font\sevensy=cmsy7
+\def\sevenecsize{0700}
+
 % Fonts for title page (20.4pt):
 \def\titlenominalsize{20pt}
 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
@@ -2369,6 +2386,20 @@ end
 \font\smallersy=cmsy8
 \def\smallerecsize{0800}
 
+% Fonts for math mode superscripts (7pt).
+\def\sevennominalsize{7pt}
+\setfont\sevenrm\rmshape{7}{1000}{OT1}
+\setfont\seventt\ttshape{10}{700}{OT1TT}
+\setfont\sevenbf\bfshape{10}{700}{OT1}
+\setfont\sevenit\itshape{7}{1000}{OT1IT}
+\setfont\sevensl\slshape{10}{700}{OT1}
+\setfont\sevensf\sfshape{10}{700}{OT1}
+\setfont\sevensc\scshape{10}{700}{OT1}
+\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
+\font\seveni=cmmi7
+\font\sevensy=cmsy7
+\def\sevenecsize{0700}
+
 % Fonts for title page (20.4pt):
 \def\titlenominalsize{20pt}
 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
@@ -2503,13 +2534,20 @@ end
 
 
 % In order for the font changes to affect most math symbols and letters,
-% we have to define the \textfont of the standard families.  We don't
-% bother to reset \scriptfont and \scriptscriptfont; awaiting user need.
+% we have to define the \textfont of the standard families.
+% We don't bother to reset \scriptscriptfont; awaiting user need.
 %
 \def\resetmathfonts{%
   \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont
   \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont
   \textfont\ttfam=\ttfont \textfont\sffam=\sffont
+  %
+  % Fonts for superscript.  Note that the 7pt fonts are used regardless
+  % of the current font size.
+  \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy
+  \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl
+  \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt
+  \scriptfont\sffam=\sevensf
 }
 
 %
@@ -2519,6 +2557,9 @@ end
 % to also set the current \fam for math mode.  Our \STYLE (e.g., \rm)
 % commands hardwire \STYLEfont to set the current font.
 %
+% The fonts used for \ifont are for "math italics"  (\itfont is for italics
+% in regular text).  \syfont is also used in math mode only.
+%
 % Each font-changing command also sets the names \lsize (one size lower)
 % and \lllsize (three sizes lower).  These relative commands are used
 % in, e.g., the LaTeX logo and acronyms.
@@ -7963,6 +8004,7 @@ end
   \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
   \gdef\magicamp{\let&=\amprm}
 }
+\let\ampchar\&
 
 \newcount\parencount
 
@@ -11677,7 +11719,7 @@ directory should work if nowhere else does.}
 @markupsetuprqdefault
 
 @c Local variables:
-@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c eval: (add-hook 'before-save-hook 'time-stamp)
 @c page-delimiter: "^\\\\message\\|emacs-page"
 @c time-stamp-start: "def\\\\texinfoversion{"
 @c time-stamp-format: "%:y-%02m-%02d.%02H"
index 5b11e306cdcf5ee86db6e195063a567c5b542a90..f2fc97e368f05f062e2616fb3c7d6e2f6a4cd732 100755 (executable)
@@ -3,7 +3,7 @@ eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"'
     if 0;
 # Update an FSF copyright year list to include the current year.
 
-my $VERSION = '2017-09-13.06:45'; # UTC
+my $VERSION = '2018-03-07.03:47'; # UTC
 
 # Copyright (C) 2009-2018 Free Software Foundation, Inc.
 #
@@ -81,6 +81,7 @@ my $VERSION = '2017-09-13.06:45'; # UTC
 #        B. (c)
 #        C. @copyright{}
 #        D. &copy;
+#        E. Â©
 #
 #   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
@@ -124,7 +125,7 @@ use strict;
 use warnings;
 
 my $copyright_re = 'Copyright';
-my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|&copy;)';
+my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|&copy;|©)';
 my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
 $holder ||= 'Free Software Foundation, Inc.';
 my $prefix_max = 5;
@@ -263,10 +264,12 @@ else
     print STDERR "$ARGV: warning: copyright statement not found\n";
   }
 
+# Hey Emacs!
 # Local variables:
+# coding: utf-8
 # mode: perl
 # indent-tabs-mode: nil
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "my $VERSION = '"
 # time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
 # time-stamp-time-zone: "UTC0"
index 9325d075323cbcd16738f9d0dc64d1635e6b3730..2d4d13fca99e6726aa143dfb29ade14eaec23480 100755 (executable)
@@ -4,7 +4,7 @@ eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"'
 # Detect instances of "if (p) free (p);".
 # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
 
-my $VERSION = '2017-09-13 06:45'; # UTC
+my $VERSION = '2018-03-07 03:47'; # 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
@@ -202,7 +202,7 @@ EOF
 ## Local Variables:
 ## mode: perl
 ## indent-tabs-mode: nil
-## eval: (add-hook 'write-file-hooks 'time-stamp)
+## eval: (add-hook 'before-save-hook 'time-stamp)
 ## time-stamp-start: "my $VERSION = '"
 ## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
 ## time-stamp-time-zone: "UTC0"
index 567154d8dc5f1027b94acaef717be5fa9b80ad9a..12f191bc784858782413ccab701c2e3c8ba0e9bf 100755 (executable)
@@ -2,7 +2,7 @@
 # List version-controlled file names.
 
 # Print a version string.
-scriptversion=2017-09-13.06; # UTC
+scriptversion=2018-03-07.03; # UTC
 
 # Copyright (C) 2006-2018 Free Software Foundation, Inc.
 
@@ -105,7 +105,7 @@ do
 done
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
diff --git a/cfg.mk b/cfg.mk
index d889c46f90147655cebb7385926102292cc3af10..8ca64b48e78a7c7d7e4db8219496b1856df5f23f 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -35,7 +35,7 @@ bootstrap-tools = autoconf,automake,gnulib
 # Now that we have better tests, make this the default.
 export VERBOSE = yes
 
-old_NEWS_hash = 143a1e2047fa15579bd66c75c7d962ce
+old_NEWS_hash = be971f82131abd0bf8f988ec98ebc4e5
 
 sc_obs_header_regex = \
   \<(STDC_HEADERS|HAVE_(LIMITS|STRING|UNISTD|STDLIB)_H)\>
index 6e242d3ecc0532cf803f577d71cc18fa27c5adf1..cab3dafaf75a196c5538563b238d0fc8c90c78a4 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69.193-8974 for gzip 1.9.
+# Generated by GNU Autoconf 2.69.197-b8fd7 for gzip 1.10.
 #
 # Report bugs to <bug-gzip@gnu.org>.
 #
@@ -565,8 +565,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='gzip'
 PACKAGE_TARNAME='gzip'
-PACKAGE_VERSION='1.9'
-PACKAGE_STRING='gzip 1.9'
+PACKAGE_VERSION='1.10'
+PACKAGE_STRING='gzip 1.10'
 PACKAGE_BUGREPORT='bug-gzip@gnu.org'
 PACKAGE_URL=''
 
@@ -782,6 +782,24 @@ HAVE__BOOL
 GL_GENERATE_STDBOOL_H_FALSE
 GL_GENERATE_STDBOOL_H_TRUE
 STDBOOL_H
+NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H
+NEXT_SIGNAL_H
+REPLACE_RAISE
+REPLACE_PTHREAD_SIGMASK
+HAVE_SIGHANDLER_T
+HAVE_TYPE_VOLATILE_SIG_ATOMIC_T
+HAVE_STRUCT_SIGACTION_SA_SIGACTION
+HAVE_SIGACTION
+HAVE_SIGINFO_T
+HAVE_SIGSET_T
+HAVE_RAISE
+HAVE_PTHREAD_SIGMASK
+HAVE_POSIX_SIGNALBLOCKING
+GNULIB_SIGACTION
+GNULIB_SIGPROCMASK
+GNULIB_SIGNAL_H_SIGPIPE
+GNULIB_RAISE
+GNULIB_PTHREAD_SIGMASK
 ASM_SYMBOL_PREFIX
 UNDEFINE_STRTOK_R
 REPLACE_STRSIGNAL
@@ -874,8 +892,6 @@ LIMITS_H
 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H
 NEXT_LIMITS_H
 IGNORE_UNUSED_LIBRARIES_CFLAGS
-HOST_CPU_C_ABI
-HOST_CPU
 GNU_MAKE_FALSE
 GNU_MAKE_TRUE
 REPLACE_LOCALTIME
@@ -1416,6 +1432,7 @@ REPLACE_LINKAT
 REPLACE_LINK
 REPLACE_LCHOWN
 REPLACE_ISATTY
+REPLACE_GETPASS
 REPLACE_GETPAGESIZE
 REPLACE_GETGROUPS
 REPLACE_GETLOGIN_R
@@ -1432,6 +1449,7 @@ REPLACE_CHOWN
 HAVE_SYS_PARAM_H
 HAVE_OS_H
 HAVE_DECL_TTYNAME_R
+HAVE_DECL_TRUNCATE
 HAVE_DECL_SETHOSTNAME
 HAVE_DECL_GETUSERSHELL
 HAVE_DECL_GETPAGESIZE
@@ -1443,7 +1461,6 @@ HAVE_DECL_FCHDIR
 HAVE_DECL_ENVIRON
 HAVE_USLEEP
 HAVE_UNLINKAT
-HAVE_TRUNCATE
 HAVE_SYMLINKAT
 HAVE_SYMLINK
 HAVE_SLEEP
@@ -1458,6 +1475,7 @@ HAVE_LINKAT
 HAVE_LINK
 HAVE_LCHOWN
 HAVE_GROUP_MEMBER
+HAVE_GETPASS
 HAVE_GETPAGESIZE
 HAVE_GETLOGIN
 HAVE_GETHOSTNAME
@@ -1500,6 +1518,7 @@ GNULIB_LCHOWN
 GNULIB_ISATTY
 GNULIB_GROUP_MEMBER
 GNULIB_GETUSERSHELL
+GNULIB_GETPASS
 GNULIB_GETPAGESIZE
 GNULIB_GETLOGIN_R
 GNULIB_GETLOGIN
@@ -2281,7 +2300,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.9 to adapt to many kinds of systems.
+\`configure' configures gzip 1.10 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -2352,7 +2371,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of gzip 1.9:";;
+     short | recursive ) echo "Configuration of gzip 1.10:";;
    esac
   cat <<\_ACEOF
 
@@ -2457,8 +2476,8 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-gzip configure 1.9
-generated by GNU Autoconf 2.69.193-8974
+gzip configure 1.10
+generated by GNU Autoconf 2.69.197-b8fd7
 
 Copyright (C) 2017 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
@@ -2833,11 +2852,11 @@ else
   eval "$3=no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_c_werror_flag=$ac_save_werror_flag
 fi
 eval ac_res=\$$3
               { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 printf "%s\n" "$ac_res" >&6; }
-  ac_c_werror_flag=$ac_save_werror_flag
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_decl
@@ -3090,14 +3109,34 @@ printf "%s\n" "$ac_res" >&6; }
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_member
+ac_configure_args_raw=
+for ac_arg
+do
+  case $ac_arg in
+  *\'*)
+    ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  esac
+  as_fn_append ac_configure_args_raw " '$ac_arg'"
+done
+
+case $ac_configure_args_raw in
+  *$as_nl*)
+    ac_safe_unquote= ;;
+  *)
+    ac_unsafe_z='|&;<>()$`\\"*?[ ''    ' # This string ends in space, tab.
+    ac_unsafe_a="$ac_unsafe_z#~"
+    ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
+    ac_configure_args_raw=`      printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
+esac
+
 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.9, which was
-generated by GNU Autoconf 2.69.193-8974.  Invocation command line was
+It was created by gzip $as_me 1.10, which was
+generated by GNU Autoconf 2.69.197-b8fd7.  Invocation command line was
 
-  $ $0 $@
+  $ $0$ac_configure_args_raw
 
 _ACEOF
 exec 5>>config.log
@@ -3400,7 +3439,6 @@ as_fn_append ac_header_c_list " sys/cdefs.h sys_cdefs_h HAVE_SYS_CDEFS_H"
 as_fn_append ac_func_c_list " getprogname HAVE_GETPROGNAME"
 as_fn_append ac_func_c_list " getexecname HAVE_GETEXECNAME"
 as_fn_append ac_func_c_list " gettimeofday HAVE_GETTIMEOFDAY"
-as_fn_append ac_func_c_list " nanotime HAVE_NANOTIME"
 as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H"
 as_fn_append ac_header_c_list " limits.h limits_h HAVE_LIMITS_H"
 as_fn_append ac_func_c_list " lstat HAVE_LSTAT"
@@ -3410,6 +3448,9 @@ as_fn_append ac_func_c_list " mprotect HAVE_MPROTECT"
 as_fn_append ac_func_c_list " openat HAVE_OPENAT"
 as_fn_append ac_func_c_list " __xpg_strerror_r HAVE___XPG_STRERROR_R"
 gl_printf_safe=yes
+as_fn_append ac_func_c_list " sigaction HAVE_SIGACTION"
+as_fn_append ac_func_c_list " sigaltstack HAVE_SIGALTSTACK"
+as_fn_append ac_func_c_list " siginterrupt HAVE_SIGINTERRUPT"
 as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H"
 as_fn_append ac_func_c_list " strdup HAVE_STRDUP"
 as_fn_append ac_func_c_list " catgets HAVE_CATGETS"
@@ -3429,7 +3470,6 @@ as_fn_append ac_header_c_list " time.h time_h HAVE_TIME_H"
 as_fn_append ac_func_c_list " chown HAVE_CHOWN"
 as_fn_append ac_func_c_list " fchmod HAVE_FCHMOD"
 as_fn_append ac_func_c_list " fchown HAVE_FCHOWN"
-as_fn_append ac_func_c_list " siginterrupt HAVE_SIGINTERRUPT"
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
@@ -3533,7 +3573,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.15a'
+am__api_version='1.16'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -4047,7 +4087,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='gzip'
- VERSION='1.9'
+ VERSION='1.10'
 
 
 printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -6468,6 +6508,8 @@ printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; }
   test $ac_cv_should_define__xopen_source = yes &&
     printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h
 
+  printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h
+
 
 
 
@@ -7332,7 +7374,6 @@ printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h
   # Code from module gnumakefile:
   # Code from module gnupload:
   # Code from module havelib:
-  # Code from module host-cpu-c-abi:
   # Code from module ignore-value:
   # Code from module include_next:
   # Code from module intprops:
@@ -7372,6 +7413,7 @@ printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h
   # Code from module printf-frexpl:
   # Code from module printf-posix:
   # Code from module printf-safe:
+  # Code from module raise:
   # Code from module readdir:
   # Code from module readme-release:
   # Code from module realloc-gnu:
@@ -7379,7 +7421,10 @@ printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h
   # Code from module rmdir:
   # Code from module save-cwd:
   # Code from module savedir:
+  # Code from module sigaction:
+  # Code from module signal-h:
   # Code from module signbit:
+  # Code from module sigprocmask:
   # Code from module size_max:
   # Code from module snippet/_Noreturn:
   # Code from module snippet/arg-nonnull:
@@ -7747,7 +7792,7 @@ else
 int
 main (void)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
              choke me
              #endif
 
@@ -7790,6 +7835,7 @@ printf "%s\n" "$gl_cv_func_malloc_posix" >&6; }
   GNULIB_GETLOGIN=0;
   GNULIB_GETLOGIN_R=0;
   GNULIB_GETPAGESIZE=0;
+  GNULIB_GETPASS=0;
   GNULIB_GETUSERSHELL=0;
   GNULIB_GROUP_MEMBER=0;
   GNULIB_ISATTY=0;
@@ -7832,6 +7878,7 @@ printf "%s\n" "$gl_cv_func_malloc_posix" >&6; }
   HAVE_GETHOSTNAME=1;
   HAVE_GETLOGIN=1;
   HAVE_GETPAGESIZE=1;
+  HAVE_GETPASS=1;
   HAVE_GROUP_MEMBER=1;
   HAVE_LCHOWN=1;
   HAVE_LINK=1;
@@ -7846,7 +7893,6 @@ printf "%s\n" "$gl_cv_func_malloc_posix" >&6; }
   HAVE_SLEEP=1;
   HAVE_SYMLINK=1;
   HAVE_SYMLINKAT=1;
-  HAVE_TRUNCATE=1;
   HAVE_UNLINKAT=1;
   HAVE_USLEEP=1;
   HAVE_DECL_ENVIRON=1;
@@ -7858,6 +7904,7 @@ printf "%s\n" "$gl_cv_func_malloc_posix" >&6; }
   HAVE_DECL_GETPAGESIZE=1;
   HAVE_DECL_GETUSERSHELL=1;
   HAVE_DECL_SETHOSTNAME=1;
+  HAVE_DECL_TRUNCATE=1;
   HAVE_DECL_TTYNAME_R=1;
   HAVE_OS_H=0;
   HAVE_SYS_PARAM_H=0;
@@ -7874,6 +7921,7 @@ printf "%s\n" "$gl_cv_func_malloc_posix" >&6; }
   REPLACE_GETLOGIN_R=0;
   REPLACE_GETGROUPS=0;
   REPLACE_GETPAGESIZE=0;
+  REPLACE_GETPASS=0;
   REPLACE_ISATTY=0;
   REPLACE_LCHOWN=0;
   REPLACE_LINK=0;
@@ -9838,7 +9886,7 @@ nocrash_init (void)
     }
   }
 }
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
 /* Avoid a crash on native Windows.  */
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
@@ -10816,7 +10864,7 @@ nocrash_init (void)
     }
   }
 }
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
 /* Avoid a crash on native Windows.  */
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
@@ -12727,6 +12775,9 @@ else
      if test "$cross_compiling" = yes
 then :
   case "$host_os" in
+          linux-* | linux)
+            # Guess yes on Linux systems.
+            gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
           *-gnu* | gnu*)
             # Guess yes on glibc systems.
             gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
@@ -12989,7 +13040,7 @@ int
 main (void)
 {
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* mingw cwd does not start with '/', but getcwd does allocate.
    However, mingw fails to honor non-zero size.  */
 #else
@@ -13468,7 +13519,7 @@ nocrash_init (void)
     }
   }
 }
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
 /* Avoid a crash on native Windows.  */
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
@@ -13694,7 +13745,6 @@ printf "%s\n" "$gl_cv_func_getopt_long_gnu" >&6; }
 :
 
 
-
   GNULIB_GETTIMEOFDAY=0;
     HAVE_GETTIMEOFDAY=1;
   HAVE_STRUCT_TIMEVAL=1;
@@ -13714,17 +13764,17 @@ else
      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 bar (int [$ac_kw]); /* Catch GCC bug 14050.  */
-          int bar (int ip[$ac_kw]) { return ip[0]; }
+           int foo (int_ptr $ac_kw ip) { return ip[0]; }
+           int bar (int [$ac_kw]); /* Catch GCC bug 14050.  */
+           int bar (int ip[$ac_kw]) { return ip[0]; }
 
 int
 main (void)
 {
 int s[1];
-          int *$ac_kw t = s;
-          t[0] = 0;
-          return foo (t) + bar (t);
+           int *$ac_kw t = s;
+           t[0] = 0;
+           return foo (t) + bar (t);
 
   ;
   return 0;
@@ -13981,355 +14031,6 @@ printf "%s\n" "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
   REPLACE_LOCALTIME=0;
 
 
-  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 -rf conftest*
-
-
-
-
-
-  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host CPU and C ABI" >&5
-printf %s "checking host CPU and C ABI... " >&6; }
-if test ${gl_cv_host_cpu_c_abi+y}
-then :
-  printf %s "(cached) " >&6
-else
-  case "$host_cpu" in
-
-       i[4567]86 )
-         gl_cv_host_cpu_c_abi=i386
-         ;;
-
-       x86_64 )
-         # On x86_64 systems, the C compiler may be generating code in one of
-         # these ABIs:
-         # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
-         # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
-         #   with native Windows (mingw, MSVC).
-         # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
-         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if (defined __x86_64__ || defined __amd64__ \
-                     || defined _M_X64 || defined _M_AMD64)
-                 int ok;
-                #else
-                 error fail
-                #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined __ILP32__ || defined _ILP32
-                    int ok;
-                   #else
-                    error fail
-                   #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  gl_cv_host_cpu_c_abi=x86_64-x32
-else
-  gl_cv_host_cpu_c_abi=x86_64
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  gl_cv_host_cpu_c_abi=i386
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         ;;
-
-       alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
-         gl_cv_host_cpu_c_abi=alpha
-         ;;
-
-       arm* | aarch64 )
-         # Assume arm with EABI.
-         # On arm64 systems, the C compiler may be generating code in one of
-         # these ABIs:
-         # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
-         # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
-         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __aarch64__
-                 int ok;
-                #else
-                 error fail
-                #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined __ILP32__ || defined _ILP32
-                   int ok;
-                  #else
-                   error fail
-                  #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  gl_cv_host_cpu_c_abi=arm64-ilp32
-else
-  gl_cv_host_cpu_c_abi=arm64
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  # Don't distinguish little-endian and big-endian arm, since they
-            # don't require different machine code for simple operations and
-            # since the user can distinguish them through the preprocessor
-            # defines __ARMEL__ vs. __ARMEB__.
-            # But distinguish arm which passes floating-point arguments and
-            # return values in integer registers (r0, r1, ...) - this is
-            # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
-            # passes them in float registers (s0, s1, ...) and double registers
-            # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
-            # sets the preprocessor defines __ARM_PCS (for the first case) and
-            # __ARM_PCS_VFP (for the second case), but older GCC does not.
-            echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
-            # Look for a reference to the register d0 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=$?
-  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null 2>&1
-            if LC_ALL=C grep -E 'd0,' conftest.$gl_asmext >/dev/null; then
-              gl_cv_host_cpu_c_abi=armhf
-            else
-              gl_cv_host_cpu_c_abi=arm
-            fi
-            rm -f conftest*
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         ;;
-
-       hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
-         # On hppa, the C compiler may be generating 32-bit code or 64-bit
-         # code. In the latter case, it defines _LP64 and __LP64__.
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __LP64__
-                 int ok;
-                #else
-                 error fail
-                #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  gl_cv_host_cpu_c_abi=hppa64
-else
-  gl_cv_host_cpu_c_abi=hppa
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         ;;
-
-       ia64* )
-         # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
-         # 32-bit code. In the latter case, it defines _ILP32.
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef _ILP32
-                 int ok;
-                #else
-                 error fail
-                #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  gl_cv_host_cpu_c_abi=ia64-ilp32
-else
-  gl_cv_host_cpu_c_abi=ia64
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         ;;
-
-       mips* )
-         # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
-         # at 32.
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
-                 int ok;
-                #else
-                 error fail
-                #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  gl_cv_host_cpu_c_abi=mips64
-else
-  # In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
-            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
-            # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
-            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if (_MIPS_SIM == _ABIN32)
-                    int ok;
-                   #else
-                    error fail
-                   #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  gl_cv_host_cpu_c_abi=mipsn32
-else
-  gl_cv_host_cpu_c_abi=mips
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         ;;
-
-       powerpc* )
-         # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
-         # No need to distinguish them here; the caller may distinguish
-         # them based on the OS.
-         # On powerpc64 systems, the C compiler may still be generating
-         # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
-         # be generating 64-bit code.
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined __powerpc64__ || defined _ARCH_PPC64
-                 int ok;
-                #else
-                 error fail
-                #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  # On powerpc64, there are two ABIs on Linux: The AIX compatible
-            # one and the ELFv2 one. The latter defines _CALL_ELF=2.
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined _CALL_ELF && _CALL_ELF == 2
-                    int ok;
-                   #else
-                    error fail
-                   #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  gl_cv_host_cpu_c_abi=powerpc64-elfv2
-else
-  gl_cv_host_cpu_c_abi=powerpc64
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-else
-  gl_cv_host_cpu_c_abi=powerpc
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         ;;
-
-       rs6000 )
-         gl_cv_host_cpu_c_abi=powerpc
-         ;;
-
-       s390* )
-         # On s390x, the C compiler may be generating 64-bit (= s390x) code
-         # or 31-bit (= s390) code.
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined __LP64__ || defined __s390x__
-                  int ok;
-                #else
-                  error fail
-                #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  gl_cv_host_cpu_c_abi=s390x
-else
-  gl_cv_host_cpu_c_abi=s390
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         ;;
-
-       sparc | sparc64 )
-         # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
-         # C compiler still generates 32-bit code.
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined __sparcv9 || defined __arch64__
-                 int ok;
-                #else
-                 error fail
-                #endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
-  gl_cv_host_cpu_c_abi=sparc64
-else
-  gl_cv_host_cpu_c_abi=sparc
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         ;;
-
-       *)
-         gl_cv_host_cpu_c_abi="$host_cpu"
-         ;;
-     esac
-
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi" >&5
-printf "%s\n" "$gl_cv_host_cpu_c_abi" >&6; }
-
-    HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
-  HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
-
-
-
-  # This was
-  #   AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
-  #   AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
-  # earlier, but KAI C++ 3.2d doesn't like this.
-  sed -e 's/-/_/g' >> confdefs.h <<EOF
-#ifndef __${HOST_CPU}__
-#define __${HOST_CPU}__ 1
-#endif
-#ifndef __${HOST_CPU_C_ABI}__
-#define __${HOST_CPU_C_ABI}__ 1
-#endif
-EOF
-
-
-
-
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
 printf %s "checking where to find the exponent in a 'float'... " >&6; }
 if test ${gl_cv_cc_float_expbit0+y}
@@ -14519,8 +14220,8 @@ printf "%s\n" "$gl_cv_next_limits_h" >&6; }
 
 
 
-  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5
-printf %s "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5
+printf %s "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; }
 if test ${gl_cv_header_limits_width+y}
 then :
   printf %s "(cached) " >&6
@@ -14528,10 +14229,13 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
-                           #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
-                          #endif
-                          #include <limits.h>
-                          int ullw = ULLONG_WIDTH;
+             #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+            #endif
+            #include <limits.h>
+            long long llm = LLONG_MAX;
+            int wb = WORD_BIT;
+            int ullw = ULLONG_WIDTH;
+
 int
 main (void)
 {
 
 
 
-
-    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5
-printf %s "checking for the common suffixes of directories in the library search path... " >&6; }
-if test ${acl_cv_libdirstems+y}
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5
+printf %s "checking 32-bit host C ABI... " >&6; }
+if test ${gl_cv_host_cpu_c_abi_32bit+y}
 then :
   printf %s "(cached) " >&6
 else
-  acl_libdirstem=lib
-     acl_libdirstem2=
-     case "$host_os" in
-       solaris*)
-                                                      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
+  if test -n "$gl_cv_host_cpu_c_abi"; then
+       case "$gl_cv_host_cpu_c_abi" in
+         i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+           gl_cv_host_cpu_c_abi_32bit=yes ;;
+         *)
+           gl_cv_host_cpu_c_abi_32bit=no ;;
+       esac
+     else
+       case "$host_cpu" in
+
+         i[4567]86 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         x86_64 )
+           # On x86_64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+           # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+           #   with native Windows (mingw, MSVC).
+           # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if (defined __x86_64__ || defined __amd64__ \
+                       || defined _M_X64 || defined _M_AMD64) \
+                      && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         arm* | aarch64 )
+           # Assume arm with EABI.
+           # On arm64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+           # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+           # On hppa, the C compiler may be generating 32-bit code or 64-bit
+           # code. In the latter case, it defines _LP64 and __LP64__.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __LP64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         ia64* )
+           # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+           # 32-bit code. In the latter case, it defines _ILP32.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=yes
+else
+  gl_cv_host_cpu_c_abi_32bit=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         mips* )
+           # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+           # at 32.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         powerpc* )
+           # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+           # No need to distinguish them here; the caller may distinguish
+           # them based on the OS.
+           # On powerpc64 systems, the C compiler may still be generating
+           # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+           # be generating 64-bit code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __powerpc64__ || defined _ARCH_PPC64
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         rs6000 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         riscv32 | riscv64 )
+           # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+           # Size of 'long' and 'void *':
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         s390* )
+           # On s390x, the C compiler may be generating 64-bit (= s390x) code
+           # or 31-bit (= s390) code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__ || defined __s390x__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         sparc | sparc64 )
+           # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+           # C compiler still generates 32-bit code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __sparcv9 || defined __arch64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         *)
+           gl_cv_host_cpu_c_abi_32bit=no
+           ;;
+       esac
+     fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5
+printf "%s\n" "$gl_cv_host_cpu_c_abi_32bit" >&6; }
+
+  HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+
+
+
+
+
+  case "$host_os" in
+    solaris*)
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
 printf %s "checking for 64-bit host... " >&6; }
 if test ${gl_cv_solaris_64bit+y}
 then :
@@ -14822,10 +14761,10 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef _LP64
-                    int ok;
-                   #else
-                    error fail
-                   #endif
+                 int ok;
+                #else
+                 error fail
+                #endif
 
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"
@@ -14838,8 +14777,20 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5
-printf "%s\n" "$gl_cv_solaris_64bit" >&6; }
-         if test $gl_cv_solaris_64bit = yes; then
+printf "%s\n" "$gl_cv_solaris_64bit" >&6; };;
+  esac
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5
+printf %s "checking for the common suffixes of directories in the library search path... " >&6; }
+if test ${acl_cv_libdirstems+y}
+then :
+  printf %s "(cached) " >&6
+else
+  acl_libdirstem=lib
+     acl_libdirstem2=
+     case "$host_os" in
+       solaris*)
+                                                      if test $gl_cv_solaris_64bit = yes; then
            acl_libdirstem=lib/64
            case "$host_cpu" in
              sparc*)        acl_libdirstem2=lib/sparcv9 ;;
@@ -14848,37 +14799,33 @@ printf "%s\n" "$gl_cv_solaris_64bit" >&6; }
          fi
          ;;
        *)
-                           case "$gl_cv_host_cpu_c_abi" in
-           i386 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | s390 | sparc)
-             ;;
-           *) # x86_64 | arm64 | hppa64 | ia64 | mips64 | powerpc64* | s390x | sparc64 | ...
-                                                    searchpath=`(if test -f /usr/bin/gcc \
-                             && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \
-                            LC_ALL=C /usr/bin/gcc -print-search-dirs; \
-                          else \
-                            LC_ALL=C $CC -print-search-dirs; \
-                          fi) 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
+                           if test "$HOST_CPU_C_ABI_32BIT" != yes; then
+                                            searchpath=`(if test -f /usr/bin/gcc \
+                           && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \
+                          LC_ALL=C /usr/bin/gcc -print-search-dirs; \
+                        else \
+                          LC_ALL=C $CC -print-search-dirs; \
+                        fi) 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
+         fi
          ;;
      esac
      test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
 fi
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
 printf "%s\n" "$gl_cv_have_weak" >&6; }
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker supports --as-needed" >&5
+printf %s "checking whether the linker supports --as-needed... " >&6; }
+if test ${gl_cv_linker_have_as_needed+y}
+then :
+  printf %s "(cached) " >&6
+else
+  if test -n "$GCC"; then
+         gl_saved_ldflags="$LDFLAGS"
+         LDFLAGS="$gl_saved_ldflags -Wl,--as-needed -Wl,--no-as-needed"
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_linker_have_as_needed=yes
+else
+  gl_cv_linker_have_as_needed=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+         LDFLAGS="$gl_saved_ldflags"
+       else
+         gl_cv_linker_have_as_needed=no
+       fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_linker_have_as_needed" >&5
+printf "%s\n" "$gl_cv_linker_have_as_needed" >&6; }
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker supports --push-state" >&5
+printf %s "checking whether the linker supports --push-state... " >&6; }
+if test ${gl_cv_linker_have_push_state+y}
+then :
+  printf %s "(cached) " >&6
+else
+  if test -n "$GCC"; then
+         gl_saved_ldflags="$LDFLAGS"
+         LDFLAGS="$gl_saved_ldflags -Wl,--push-state -Wl,--pop-state"
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_linker_have_push_state=yes
+else
+  gl_cv_linker_have_push_state=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+         LDFLAGS="$gl_saved_ldflags"
+       else
+         gl_cv_linker_have_push_state=no
+       fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_linker_have_push_state" >&5
+printf "%s\n" "$gl_cv_linker_have_push_state" >&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.
@@ -15195,6 +15214,28 @@ printf "%s\n" "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
 
               LIBTHREAD=
               LTLIBTHREAD=
+                                                                      case "$LIBMULTITHREAD" in
+                "") ;;
+                -pthread)
+                  if test $gl_cv_linker_have_as_needed = yes; then
+                    if test $gl_cv_linker_have_push_state = yes; then
+                      LIBMULTITHREAD="$LIBMULTITHREAD -Wl,--push-state -Wl,--no-as-needed -lpthread -Wl,--pop-state"
+                    else
+                      LIBMULTITHREAD="$LIBMULTITHREAD -Wl,--no-as-needed -lpthread"
+                    fi
+                  fi
+                  ;;
+                *)
+                  if test $gl_cv_linker_have_as_needed = yes; then
+                    if test $gl_cv_linker_have_push_state = yes; then
+                      LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
+                    else
+                      LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
+                    fi
+                  fi
+                  ;;
+              esac
+              # TODO: May need to modify LTLIBMULTITHREAD similarly.
             fi
           fi
         fi
@@ -15241,6 +15282,14 @@ printf "%s\n" "#define USE_SOLARIS_THREADS_WEAK 1" >>confdefs.h
 
             LIBTHREAD=
             LTLIBTHREAD=
+                                                            if test $gl_cv_linker_have_as_needed = yes; then
+              if test $gl_cv_linker_have_push_state = yes; then
+                LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
+              else
+                LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
+              fi
+            fi
+            # TODO: May need to modify LTLIBMULTITHREAD similarly.
           fi
         fi
       fi
@@ -15265,7 +15314,6 @@ else
 
 
 
-
     use_additional=yes
 
   acl_save_prefix="$prefix"
@@ -15304,7 +15352,7 @@ then :
         additional_includedir="$withval/include"
         additional_libdir="$withval/$acl_libdirstem"
         if test "$acl_libdirstem2" != "$acl_libdirstem" \
-           && ! test -d "$withval/$acl_libdirstem"; then
+           && test ! -d "$withval/$acl_libdirstem"; then
           additional_libdir="$withval/$acl_libdirstem2"
         fi
       fi
@@ -15720,7 +15768,6 @@ fi
 
 
 
-
     ac_cv_libpth_libs="$LIBPTH"
     ac_cv_libpth_ltlibs="$LTLIBPTH"
     ac_cv_libpth_cppflags="$INCPTH"
@@ -15800,6 +15847,14 @@ printf "%s\n" "#define USE_PTH_THREADS_WEAK 1" >>confdefs.h
 
             LIBTHREAD=
             LTLIBTHREAD=
+                                                            if test $gl_cv_linker_have_as_needed = yes; then
+              if test $gl_cv_linker_have_push_state = yes; then
+                LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
+              else
+                LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
+              fi
+            fi
+            # TODO: May need to modify LTLIBMULTITHREAD similarly.
           fi
         fi
       else
@@ -16867,6 +16922,30 @@ printf "%s\n" "#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 -rf conftest*
+
+
+
+
 
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C symbols are prefixed with underscore at the linker level" >&5
 printf %s "checking whether C symbols are prefixed with underscore at the linker level... " >&6; }
@@ -16887,7 +16966,7 @@ EOF
   ac_status=$?
   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; } >/dev/null 2>&1
-     if LC_ALL=C grep -E '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' conftest.$gl_asmext >/dev/null; then
+     if LC_ALL=C $EGREP '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' conftest.$gl_asmext >/dev/null; then
        gl_cv_prog_as_underscore=yes
      else
        gl_cv_prog_as_underscore=no
@@ -16908,6 +16987,83 @@ printf "%s\n" "#define USER_LABEL_PREFIX $USER_LABEL_PREFIX" >>confdefs.h
   ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
 
 
+
+  GNULIB_PTHREAD_SIGMASK=0;
+  GNULIB_RAISE=0;
+  GNULIB_SIGNAL_H_SIGPIPE=0;
+  GNULIB_SIGPROCMASK=0;
+  GNULIB_SIGACTION=0;
+    HAVE_POSIX_SIGNALBLOCKING=1;
+  HAVE_PTHREAD_SIGMASK=1;
+  HAVE_RAISE=1;
+  HAVE_SIGSET_T=1;
+  HAVE_SIGINFO_T=1;
+  HAVE_SIGACTION=1;
+  HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
+
+  HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
+
+  HAVE_SIGHANDLER_T=1;
+  REPLACE_PTHREAD_SIGMASK=0;
+  REPLACE_RAISE=0;
+
+
+  ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
+      #include <signal.h>
+      /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.  */
+      #include <sys/types.h>
+
+"
+if test "x$ac_cv_type_sigset_t" = xyes
+then :
+
+printf "%s\n" "#define HAVE_SIGSET_T 1" >>confdefs.h
+
+gl_cv_type_sigset_t=yes
+else
+  gl_cv_type_sigset_t=no
+fi
+
+  if test $gl_cv_type_sigset_t != yes; then
+    HAVE_SIGSET_T=0
+  fi
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
+printf %s "checking for uid_t in sys/types.h... " >&6; }
+if test ${ac_cv_type_uid_t+y}
+then :
+  printf %s "(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 -rf conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
+printf "%s\n" "$ac_cv_type_uid_t" >&6; }
+if test $ac_cv_type_uid_t = no; then
+
+printf "%s\n" "#define uid_t int" >>confdefs.h
+
+
+printf "%s\n" "#define gid_t int" >>confdefs.h
+
+fi
+
+:
+
+
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
 printf %s "checking for stdbool.h that conforms to C99... " >&6; }
 if test ${ac_cv_header_stdbool_h+y}
@@ -17858,7 +18014,9 @@ printf "%s\n" "$ac_res" >&6; }
       ;;
   esac
 
-    LIMITS_H=limits.h
+
+
+  LIMITS_H='limits.h'
    if test -n "$LIMITS_H"; then
   GL_GENERATE_LIMITS_H_TRUE=
   GL_GENERATE_LIMITS_H_FALSE='#'
@@ -17872,6 +18030,7 @@ fi
 
 
 
+
    if test -n "$STDINT_H"; then
   GL_GENERATE_STDINT_H_TRUE=
   GL_GENERATE_STDINT_H_FALSE='#'
@@ -18482,7 +18641,8 @@ int main () { return zero(); }
 _ACEOF
                               save_ac_compile="$ac_compile"
      ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
-     if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+     if echo '#include "conftest.c"' >conftest1.c &&
+        { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
@@ -18503,7 +18663,8 @@ int zero (void) { return 0; }
 
 _ACEOF
               ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
-       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+       if echo '#include "conftest.c"' >conftest2.c &&
+          { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
@@ -18516,7 +18677,7 @@ _ACEOF
        fi
      fi
      ac_compile="$save_ac_compile"
-     rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
+     rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext
 
 fi
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
@@ -18868,7 +19029,7 @@ else
 # undef PATH_MAX
 # define PATH_MAX 1024
 #endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # undef PATH_MAX
 # define PATH_MAX 260
 #endif
@@ -19782,12 +19943,14 @@ else
   if test "$cross_compiling" = yes
 then :
   case "$host_os" in
-                          # Guess yes on glibc systems.
-           *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
-                          # Guess no on native Windows.
-           mingw*)        gl_cv_func_open_directory_works="guessing no" ;;
-                          # If we don't know, assume the worst.
-           *)             gl_cv_func_open_directory_works="guessing no" ;;
+                            # Guess yes on Linux systems.
+           linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
+                            # Guess yes on glibc systems.
+           *-gnu* | gnu*)   gl_cv_func_open_directory_works="guessing yes" ;;
+                            # Guess no on native Windows.
+           mingw*)          gl_cv_func_open_directory_works="guessing no" ;;
+                            # If we don't know, assume the worst.
+           *)               gl_cv_func_open_directory_works="guessing no" ;;
          esac
 
 else
@@ -21951,6 +22114,18 @@ then :
 
 fi
 
+  if test $ac_cv_func__fseeki64 = yes; then
+    ac_fn_c_check_decl "$LINENO" "_fseeki64" "ac_cv_have_decl__fseeki64" "$ac_includes_default"
+if test "x$ac_cv_have_decl__fseeki64" = xyes
+then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+printf "%s\n" "#define HAVE_DECL__FSEEKI64 $ac_have_decl" >>confdefs.h
+
+  fi
 
   fi
 
@@ -22901,7 +23076,7 @@ printf "%s\n" "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
 
 
 
-   if ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then
+   if LC_ALL=C ${MAKE-make} --version 2>/dev/null | sed -e '2,$d' | grep GNU >/dev/null; then
   GNU_MAKE_TRUE=
   GNU_MAKE_FALSE='#'
 else
@@ -22920,7 +23095,6 @@ fi
 
 
 
-
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
 printf %s "checking whether isnan(double) can be used without linking with libm... " >&6; }
 if test ${gl_cv_func_isnand_no_libm+y}
 
 
 
-  if test $gl_cv_func_vfprintf_posix = no; then
+  if test $gl_cv_func_vfprintf_posix = no; then
+
+
+
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS printf.$ac_objext"
+
+  REPLACE_PRINTF=1
+
+printf "%s\n" "#define REPLACE_PRINTF_POSIX 1" >>confdefs.h
+
+  :
+
+  fi
+
+
+
+
+
+
+          GNULIB_PRINTF_POSIX=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PRINTF_POSIX 1" >>confdefs.h
+
+
+
+
+
+
+
+  ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise"
+if test "x$ac_cv_func_raise" = xyes
+then :
+  printf "%s\n" "#define HAVE_RAISE 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_raise = no; then
+    HAVE_RAISE=0
+  else
+
+
+      if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+        REPLACE_RAISE=1
+      fi
+
 
 
 
 
+  if test $gl_cv_type_sigset_t = yes; then
+    ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask"
+if test "x$ac_cv_func_sigprocmask" = xyes
+then :
+  gl_cv_func_sigprocmask=1
+fi
 
+  fi
+  if test -z "$gl_cv_func_sigprocmask"; then
+    HAVE_POSIX_SIGNALBLOCKING=0
+  fi
 
+      if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+        :
+      fi
 
+  fi
 
+  if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then
 
 
 
-  gl_LIBOBJS="$gl_LIBOBJS printf.$ac_objext"
 
-  REPLACE_PRINTF=1
 
-printf "%s\n" "#define REPLACE_PRINTF_POSIX 1" >>confdefs.h
 
-  :
 
-  fi
 
+  gl_LIBOBJS="$gl_LIBOBJS raise.$ac_objext"
 
+    :
+  fi
 
 
 
 
-          GNULIB_PRINTF_POSIX=1
 
+          GNULIB_RAISE=1
 
 
 
 
-printf "%s\n" "#define GNULIB_TEST_PRINTF_POSIX 1" >>confdefs.h
 
+printf "%s\n" "#define GNULIB_TEST_RAISE 1" >>confdefs.h
 
 
 
@@ -25595,12 +25838,14 @@ else
      if test "$cross_compiling" = yes
 then :
   case "$host_os" in
-                         # Guess yes on glibc systems.
-          *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
-                         # Guess no on native Windows.
-          mingw*)        gl_cv_func_rmdir_works="guessing no" ;;
-                         # If we don't know, assume the worst.
-          *)             gl_cv_func_rmdir_works="guessing no" ;;
+                           # Guess yes on Linux systems.
+          linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
+                           # Guess yes on glibc systems.
+          *-gnu* | gnu*)   gl_cv_func_rmdir_works="guessing yes" ;;
+                           # Guess no on native Windows.
+          mingw*)          gl_cv_func_rmdir_works="guessing no" ;;
+                           # If we don't know, assume the worst.
+          *)               gl_cv_func_rmdir_works="guessing no" ;;
         esac
 
 else
@@ -25686,6 +25931,185 @@ printf "%s\n" "#define GNULIB_TEST_RMDIR 1" >>confdefs.h
 
 
 
+
+  if test $ac_cv_func_sigaction = yes; then
+    ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include <signal.h>
+"
+if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1" >>confdefs.h
+
+
+fi
+
+    if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then
+      HAVE_STRUCT_SIGACTION_SA_SIGACTION=0
+    fi
+  else
+    HAVE_SIGACTION=0
+  fi
+
+  if test $HAVE_SIGACTION = 0; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS sigaction.$ac_objext"
+
+
+
+
+
+
+
+  ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" "
+#include <signal.h>
+
+"
+if test "x$ac_cv_type_siginfo_t" = xyes
+then :
+
+printf "%s\n" "#define HAVE_SIGINFO_T 1" >>confdefs.h
+
+
+fi
+
+  if test $ac_cv_type_siginfo_t = no; then
+    HAVE_SIGINFO_T=0
+  fi
+
+  fi
+
+
+
+
+
+          GNULIB_SIGACTION=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SIGACTION 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_signal_h='<'signal.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
+printf %s "checking absolute name of <signal.h>... " >&6; }
+if test ${gl_cv_next_signal_h+y}
+then :
+  printf %s "(cached) " >&6
+else
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <signal.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 'signal.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_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_signal_h
+           gl_cv_next_signal_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
+printf "%s\n" "$gl_cv_next_signal_h" >&6; }
+     fi
+     NEXT_SIGNAL_H=$gl_cv_next_signal_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='<'signal.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_signal_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
+
+
+
+
+
+# AIX declares sig_atomic_t to already include volatile, and C89 compilers
+# then choke on 'volatile sig_atomic_t'.  C99 requires that it compile.
+  ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
+#include <signal.h>
+
+"
+if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes
+then :
+
+else
+  HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
+fi
+
+
+
+
+
+
+
+  ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
+#include <signal.h>
+
+"
+if test "x$ac_cv_type_sighandler_t" = xyes
+then :
+
+else
+  HAVE_SIGHANDLER_T=0
+fi
+
+
+
+
+
+
      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for signbit macro" >&5
 printf %s "checking for signbit macro... " >&6; }
 if test ${gl_cv_func_signbit+y}
@@ -26467,6 +26891,49 @@ printf "%s\n" "#define GNULIB_TEST_SIGNBIT 1" >>confdefs.h
 
 
 
+
+
+  if test $gl_cv_type_sigset_t = yes; then
+    ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask"
+if test "x$ac_cv_func_sigprocmask" = xyes
+then :
+  gl_cv_func_sigprocmask=1
+fi
+
+  fi
+  if test -z "$gl_cv_func_sigprocmask"; then
+    HAVE_POSIX_SIGNALBLOCKING=0
+  fi
+
+  if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+
+
+
+
+
+
+
+
+  gl_LIBOBJS="$gl_LIBOBJS sigprocmask.$ac_objext"
+
+    :
+  fi
+
+
+
+
+
+          GNULIB_SIGPROCMASK=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SIGPROCMASK 1" >>confdefs.h
+
+
+
+
   ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
 if test "x$ac_cv_header_stdint_h" = xyes
 then :
@@ -26617,10 +27084,12 @@ else
          if test "$cross_compiling" = yes
 then :
   case "$host_os" in
-                             # Guess yes on glibc systems.
-              *-gnu* | 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" ;;
+                               # Guess yes on Linux systems.
+              linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
+                               # Guess yes on glibc systems.
+              *-gnu* | 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
 
 else
 
 
   STDDEF_H=
-  ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h>
 
-"
-if test "x$ac_cv_type_max_align_t" = xyes
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
+printf %s "checking for good max_align_t... " >&6; }
+if test ${gl_cv_type_max_align_t+y}
 then :
+  printf %s "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stddef.h>
+            unsigned int s = sizeof (max_align_t);
+            #if defined __GNUC__ || defined __IBM__ALIGNOF__
+            int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
+            int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
+            #endif
+
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_type_max_align_t=yes
 else
-  HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h
+  gl_cv_type_max_align_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
+printf "%s\n" "$gl_cv_type_max_align_t" >&6; }
+  if test $gl_cv_type_max_align_t = no; then
+    HAVE_MAX_ALIGN_T=0
+    STDDEF_H=stddef.h
+  fi
 
   if test $gt_cv_c_wchar_t = no; then
     HAVE_WCHAR_T=0
     STDDEF_H=stddef.h
   fi
+
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
 printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; }
 if test ${gl_cv_decl_null_works+y}
@@ -26934,6 +27434,7 @@ printf "%s\n" "$gl_cv_decl_null_works" >&6; }
     STDDEF_H=stddef.h
   fi
 
+
    if test -n "$STDDEF_H"; then
   GL_GENERATE_STDDEF_H_TRUE=
   GL_GENERATE_STDDEF_H_FALSE='#'
@@ -27111,7 +27612,7 @@ else
        /* For non-mingw systems, compilation will trivially succeed.
           For mingw, compilation will succeed for older mingw (system
           printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
-       #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \
+       #if (defined _WIN32 && ! defined __CYGWIN__) && \
          (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
        extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
        #endif
@@ -27847,12 +28348,14 @@ else
      if test "$cross_compiling" = yes
 then :
   case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
-                 # Guess no on native Windows.
-         mingw*) gl_cv_func_unlink_honors_slashes="guessing no" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_unlink_honors_slashes="guessing no" ;;
+                          # Guess yes on Linux systems.
+         linux-* | linux) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
+                          # Guess yes on glibc systems.
+         *-gnu*)          gl_cv_func_unlink_honors_slashes="guessing yes" ;;
+                          # Guess no on native Windows.
+         mingw*)          gl_cv_func_unlink_honors_slashes="guessing no" ;;
+                          # If we don't know, assume the worst.
+         *)               gl_cv_func_unlink_honors_slashes="guessing no" ;;
        esac
 
 else
@@ -28125,6 +28628,7 @@ printf "%s\n" "#define GNULIB_TEST_UTIME 1" >>confdefs.h
 
 
 
+
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_utime_h='<'utime.h'>'
      else
@@ -28204,14 +28708,19 @@ printf "%s\n" "$gl_cv_next_utime_h" >&6; }
 
 
   UTIME_H=''
-  if test $ac_cv_header_utime_h != yes; then
-        UTIME_H=utime.h
-  else
-    case "$host_os" in
-      mingw*)         UTIME_H=utime.h
-        ;;
-    esac
-  fi
+     if false; then
+              UTIME_H=utime.h
+     else
+       if test $ac_cv_header_utime_h != yes; then
+                  UTIME_H=utime.h
+       else
+         case "$host_os" in
+           mingw*)              UTIME_H=utime.h
+             ;;
+         esac
+       fi
+     fi
+
 
    if test -n "$UTIME_H"; then
   GL_GENERATE_UTIME_H_TRUE=
@@ -28240,10 +28749,12 @@ else
        if test "$cross_compiling" = yes
 then :
   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" ;;
+                            # Guess yes on Linux systems.
+           linux-* | linux) gl_cv_func_futimesat_works="guessing yes" ;;
+                            # 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
@@ -28995,7 +29506,6 @@ fi
   nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
   nw="$nw -Wsign-conversion"        # Too many warnings for now
   nw="$nw -Wtraditional-conversion" # Too many warnings for now
-  nw="$nw -Wunreachable-code"       # Too many warnings for now
   nw="$nw -Wpadded"                 # Our structs are not padded
   nw="$nw -Wredundant-decls"        # openat.h declares e.g., mkdirat
   nw="$nw -Wlogical-op"             # any use of fwrite provokes this
@@ -29034,14 +29544,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
             { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5
 printf %s "checking whether -Wno-missing-field-initializers is supported... " >&6; }
-    if test ${gl_cv_cc_nomfi_supported+y}
+if test ${gl_cv_cc_nomfi_supported+y}
 then :
   printf %s "(cached) " >&6
 else
-
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -29059,30 +29568,29 @@ else
   gl_cv_cc_nomfi_supported=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-      CFLAGS="$gl_save_CFLAGS"
-fi
+       CFLAGS="$gl_save_CFLAGS"
 
-    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5
 printf "%s\n" "$gl_cv_cc_nomfi_supported" >&6; }
 
     if test "$gl_cv_cc_nomfi_supported" = yes; then
                   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5
 printf %s "checking whether -Wno-missing-field-initializers is needed... " >&6; }
-      if test ${gl_cv_cc_nomfi_needed+y}
+if test ${gl_cv_cc_nomfi_needed+y}
 then :
   printf %s "(cached) " >&6
 else
-
-        gl_save_CFLAGS="$CFLAGS"
-        CFLAGS="$CFLAGS -W -Werror"
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  gl_save_CFLAGS="$CFLAGS"
+         CFLAGS="$CFLAGS -W -Werror"
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 int f (void)
-               {
-                 typedef struct { int a; int b; } s_t;
-                 s_t s1 = { 0, };
-                 return s1.b;
-               }
+                {
+                  typedef struct { int a; int b; } s_t;
+                  s_t s1 = { 0, };
+                  return s1.b;
+                }
 
 int
 main (void)
@@ -29099,24 +29607,22 @@ else
   gl_cv_cc_nomfi_needed=yes
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        CFLAGS="$gl_save_CFLAGS"
+         CFLAGS="$gl_save_CFLAGS"
 
 fi
-
-      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5
 printf "%s\n" "$gl_cv_cc_nomfi_needed" >&6; }
     fi
 
                 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5
 printf %s "checking whether -Wuninitialized is supported... " >&6; }
-    if test ${gl_cv_cc_uninitialized_supported+y}
+if test ${gl_cv_cc_uninitialized_supported+y}
 then :
   printf %s "(cached) " >&6
 else
-
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -Werror -Wuninitialized"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -Werror -Wuninitialized"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -29134,10 +29640,10 @@ else
   gl_cv_cc_uninitialized_supported=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-      CFLAGS="$gl_save_CFLAGS"
-fi
+       CFLAGS="$gl_save_CFLAGS"
 
-    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5
 printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
 
   fi
@@ -29146,18 +29652,17 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
   # To compare this list to your installed GCC's, run this Bash command:
   #
   # comm -3 \
-  #  <(sed -n 's/^  *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
-  #  <(gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort |
-  #      grep -v -x -F -f <(
-  #         awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec))
+  #  <((sed -n 's/^  *\(-[^ 0-9][^ ]*\) .*/\1/p' manywarnings.m4; \
+  #     awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec) | sort) \
+  #  <(LC_ALL=C gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort)
 
   gl_manywarn_set=
   for gl_manywarn_item in -fno-common \
     -W \
-    -Wabi \
     -Waddress \
     -Waggressive-loop-optimizations \
     -Wall \
+    -Wattribute-alias \
     -Wattributes \
     -Wbad-function-cast \
     -Wbool-compare \
@@ -29165,8 +29670,9 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
     -Wbuiltin-declaration-mismatch \
     -Wbuiltin-macro-redefined \
     -Wcast-align \
+    -Wcast-align=strict \
+    -Wcast-function-type \
     -Wchar-subscripts \
-    -Wchkp \
     -Wclobbered \
     -Wcomment \
     -Wcomments \
@@ -29200,6 +29706,7 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
     -Wframe-address \
     -Wfree-nonheap-object \
     -Whsa \
+    -Wif-not-aligned \
     -Wignored-attributes \
     -Wignored-qualifiers \
     -Wimplicit \
@@ -29213,7 +29720,6 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
     -Wint-to-pointer-cast \
     -Winvalid-memory-model \
     -Winvalid-pch \
-    -Wjump-misses-init \
     -Wlogical-not-parentheses \
     -Wlogical-op \
     -Wmain \
@@ -29221,6 +29727,7 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
     -Wmemset-elt-size \
     -Wmemset-transposed-args \
     -Wmisleading-indentation \
+    -Wmissing-attributes \
     -Wmissing-braces \
     -Wmissing-declarations \
     -Wmissing-field-initializers \
@@ -29228,6 +29735,7 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
     -Wmissing-parameter-type \
     -Wmissing-prototypes \
     -Wmultichar \
+    -Wmultistatement-macros \
     -Wnarrowing \
     -Wnested-externs \
     -Wnonnull \
@@ -29242,6 +29750,7 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
     -Woverride-init \
     -Wpacked \
     -Wpacked-bitfield-compat \
+    -Wpacked-not-aligned \
     -Wparentheses \
     -Wpointer-arith \
     -Wpointer-compare \
@@ -29259,20 +29768,23 @@ printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
     -Wshift-count-overflow \
     -Wshift-negative-value \
     -Wsizeof-array-argument \
+    -Wsizeof-pointer-div \
     -Wsizeof-pointer-memaccess \
     -Wstack-protector \
     -Wstrict-aliasing \
     -Wstrict-overflow \
     -Wstrict-prototypes \
+    -Wstringop-truncation \
+    -Wsuggest-attribute=cold \
     -Wsuggest-attribute=const \
     -Wsuggest-attribute=format \
+    -Wsuggest-attribute=malloc \
     -Wsuggest-attribute=noreturn \
     -Wsuggest-attribute=pure \
     -Wsuggest-final-methods \
     -Wsuggest-final-types \
     -Wswitch \
     -Wswitch-bool \
-    -Wswitch-default \
     -Wswitch-unreachable \
     -Wsync-nand \
     -Wsystem-headers \
@@ -29852,6 +30364,7 @@ printf "%s\n" "#define GNULIB_PORTCHECK 1" >>confdefs.h
   # Remove the following and save the result in GNULIB_WARN_CFLAGS.
   nw=
   nw="$nw -Wstrict-overflow"
+  nw="$nw -Wformat-truncation=2"
   nw="$nw -Wuninitialized"
   nw="$nw -Wunused-macros"
   nw="$nw -Wmissing-prototypes"
@@ -30121,7 +30634,6 @@ fi
 
 
 
-
 ac_header_dirent=no
 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
   as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
@@ -30937,8 +31449,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.9, which was
-generated by GNU Autoconf 2.69.193-8974.  Invocation command line was
+This file was extended by gzip $as_me 1.10, which was
+generated by GNU Autoconf 2.69.197-b8fd7.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -31004,11 +31516,13 @@ $config_commands
 Report bugs to <bug-gzip@gnu.org>."
 
 _ACEOF
+ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
+ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`printf "%s\n" "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-gzip config.status 1.9
-configured by $0, generated by GNU Autoconf 2.69.193-8974,
+gzip config.status 1.10
+configured by $0, generated by GNU Autoconf 2.69.197-b8fd7,
   with options \\"\$ac_cs_config\\"
 
 Copyright (C) 2017 Free Software Foundation, Inc.
index 1f05a7e27e27c5e26f4f23a1d65aebfe314ef605..7fe58ac24d13de5f8e041b184b99aadf41b0e9e0 100644 (file)
@@ -19,7 +19,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 
-AC_PREREQ([2.60])
+AC_PREREQ([2.63])
 AC_INIT([gzip],
         m4_esyscmd([build-aux/git-version-gen .tarball-version]),
         [bug-gzip@gnu.org])
@@ -110,7 +110,6 @@ if test "$gl_gcc_warnings" = yes; then
   nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
   nw="$nw -Wsign-conversion"        # Too many warnings for now
   nw="$nw -Wtraditional-conversion" # Too many warnings for now
-  nw="$nw -Wunreachable-code"       # Too many warnings for now
   nw="$nw -Wpadded"                 # Our structs are not padded
   nw="$nw -Wredundant-decls"        # openat.h declares e.g., mkdirat
   nw="$nw -Wlogical-op"             # any use of fwrite provokes this
@@ -177,6 +176,7 @@ if test "$gl_gcc_warnings" = yes; then
   # Remove the following and save the result in GNULIB_WARN_CFLAGS.
   nw=
   nw="$nw -Wstrict-overflow"
+  nw="$nw -Wformat-truncation=2"
   nw="$nw -Wuninitialized"
   nw="$nw -Wunused-macros"
   nw="$nw -Wmissing-prototypes"
index e7b4b6135da2272588cecd51d02c249935cef057..6401c34fad8c9889bf2ca437ca26e0b5a2abd470 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15a from Makefile.am.
+# Makefile.in generated by automake 1.16a from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -164,18 +164,21 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
        $(top_srcdir)/m4/printf-posix-rpl.m4 \
        $(top_srcdir)/m4/printf.m4 \
        $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \
-       $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/realloc.m4 \
-       $(top_srcdir)/m4/rmdir.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/stdnoreturn.m4 \
-       $(top_srcdir)/m4/stpcpy.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/raise.m4 $(top_srcdir)/m4/readdir.m4 \
+       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/rmdir.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \
+       $(top_srcdir)/m4/shell.m4 $(top_srcdir)/m4/sigaction.m4 \
+       $(top_srcdir)/m4/signal_h.m4 \
+       $(top_srcdir)/m4/signalblocking.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/stdnoreturn.m4 $(top_srcdir)/m4/stpcpy.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 \
@@ -441,6 +444,7 @@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
 GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPASS = @GNULIB_GETPASS@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
 GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
@@ -542,6 +546,7 @@ GNULIB_POWF = @GNULIB_POWF@
 GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
 GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
 GNULIB_PUTC = @GNULIB_PUTC@
@@ -550,6 +555,7 @@ GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
 GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_QSORT_R = @GNULIB_QSORT_R@
+GNULIB_RAISE = @GNULIB_RAISE@
 GNULIB_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
@@ -580,7 +586,10 @@ GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
 GNULIB_SETENV = @GNULIB_SETENV@
 GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SIGACTION = @GNULIB_SIGACTION@
+GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
 GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
+GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
 GNULIB_SINF = @GNULIB_SINF@
 GNULIB_SINHF = @GNULIB_SINHF@
 GNULIB_SINL = @GNULIB_SINL@
@@ -775,6 +784,7 @@ 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_TRUNCATE = @HAVE_DECL_TRUNCATE@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
 HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
@@ -822,6 +832,7 @@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
 HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
 HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
@@ -882,12 +893,15 @@ HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
 HAVE_PTSNAME = @HAVE_PTSNAME@
 HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RAISE = @HAVE_RAISE@
 HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
@@ -909,9 +923,13 @@ HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
+HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
 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_SIGSET_T = @HAVE_SIGSET_T@
 HAVE_SINF = @HAVE_SINF@
 HAVE_SINHF = @HAVE_SINHF@
 HAVE_SINL = @HAVE_SINL@
@@ -930,6 +948,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
@@ -946,7 +965,7 @@ HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
-HAVE_TRUNCATE = @HAVE_TRUNCATE@
+HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
 HAVE_TZSET = @HAVE_TZSET@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
@@ -996,8 +1015,6 @@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
 HAVE_WMEMSET = @HAVE_WMEMSET@
 HAVE__BOOL = @HAVE__BOOL@
 HAVE__EXIT = @HAVE__EXIT@
-HOST_CPU = @HOST_CPU@
-HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
 IGNORE_UNUSED_LIBRARIES_CFLAGS = @IGNORE_UNUSED_LIBRARIES_CFLAGS@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
@@ -1034,6 +1051,7 @@ 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_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
 NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_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@
@@ -1053,6 +1071,7 @@ NEXT_FLOAT_H = @NEXT_FLOAT_H@
 NEXT_GETOPT_H = @NEXT_GETOPT_H@
 NEXT_LIMITS_H = @NEXT_LIMITS_H@
 NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
 NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
@@ -1147,6 +1166,7 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_GMTIME = @REPLACE_GMTIME@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
@@ -1213,11 +1233,13 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
 REPLACE_PTSNAME = @REPLACE_PTSNAME@
 REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
 REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RAISE = @REPLACE_RAISE@
 REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
 REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
index 69f373b07c76ee70e4fef92857a194edeae3f9e1..d0f64058ac60780750aabb0f6f5188a19faaf8e2 100644 (file)
@@ -1,6 +1,6 @@
-This is gzip.info, produced by makeinfo version 6.3 from gzip.texi.
+This is gzip.info, produced by makeinfo version 6.5 from gzip.texi.
 
-This manual is for GNU Gzip (version 1.9, 7 January 2018), and documents
+This manual is for GNU Gzip (version 1.10, 7 August 2018), and documents
 commands for compressing and decompressing data.
 
    Copyright Â© 1998-1999, 2001-2002, 2006-2007, 2009-2018 Free Software
@@ -36,7 +36,7 @@ File: gzip.info,  Node: Top,  Next: Overview,  Up: (dir)
 GNU Gzip: General file (de)compression
 **************************************
 
-This manual is for GNU Gzip (version 1.9, 7 January 2018), and documents
+This manual is for GNU Gzip (version 1.10, 7 August 2018), and documents
 commands for compressing and decompressing data.
 
    Copyright Â© 1998-1999, 2001-2002, 2006-2007, 2009-2018 Free Software
@@ -86,16 +86,19 @@ 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 timestamp was not preserved after a file transfer.  However,
-due to limitations in the current â€˜gzip’ file format, fractional seconds
-are discarded.  Also, timestamps must fall within the range 1970-01-01
-00:00:01 through 2106-02-07 06:28:15 UTC, and hosts whose operating
-systems use 32-bit timestamps are further restricted to timestamps no
-later than 2038-01-19 03:14:07 UTC.  The upper bounds assume the typical
-case where leap seconds are ignored.
+   By default, â€˜gzip’ keeps the original file name in the compressed
+file.  This can be useful when decompressing the file with â€˜-N’ if the
+compressed file name was truncated after a file transfer.
+
+   If the original is a regular file, â€˜gzip’ by default keeps its
+timestamp in the compressed file.  This can be useful when decompressing
+the file with â€˜-N’ if the timestamp was not preserved after a file
+transfer.  However, due to limitations in the current â€˜gzip’ file
+format, fractional seconds are discarded.  Also, timestamps must fall
+within the range 1970-01-01 00:00:01 through 2106-02-07 06:28:15 UTC,
+and hosts whose operating systems use 32-bit timestamps are further
+restricted to timestamps no later than 2038-01-19 03:14:07 UTC.  The
+upper bounds assume the typical case where leap seconds are ignored.
 
    Compressed files can be restored to their original form using â€˜gzip
 -d’ or â€˜gunzip’ or â€˜zcat’.  If the original name saved in the compressed
@@ -311,11 +314,12 @@ The format for running the â€˜gzip’ program is:
 
 â€˜--name’
 â€˜-N’
-     When compressing, always save the original file name and timestamp;
-     this is the default.  When decompressing, restore the original file
-     name and timestamp if present.  This option is useful on systems
-     which have a limit on file name length or when the timestamp has
-     been lost after a file transfer.
+     When compressing, always save the original file name, and save the
+     original timestamp if the original is a regular file; this is the
+     default.  When decompressing, restore the original file name and
+     timestamp if present.  This option is useful on systems which have
+     a limit on file name length or when the timestamp has been lost
+     after a file transfer.
 
 â€˜--quiet’
 â€˜-q’
@@ -986,14 +990,14 @@ Appendix B Concept index
 Tag Table:
 Node: Top\7f1472
 Node: Overview\7f2701
-Node: Sample\7f8164
-Node: Invoking gzip\7f10308
-Node: Advanced usage\7f16590
-Node: Environment\7f18221
-Node: Tapes\7f19082
-Node: Problems\7f19640
-Node: GNU Free Documentation License\7f20126
-Node: Concept index\7f45480
+Node: Sample\7f8309
+Node: Invoking gzip\7f10453
+Node: Advanced usage\7f16793
+Node: Environment\7f18424
+Node: Tapes\7f19285
+Node: Problems\7f19843
+Node: GNU Free Documentation License\7f20329
+Node: Concept index\7f45683
 \1f
 End Tag Table
 
index 195bab80512da89255d7fe40daa4b1907342f835..a7037aceca16e49e4a3bfec39f4f0d18bb924043 100644 (file)
@@ -98,11 +98,16 @@ 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, @command{gzip} keeps the original file name and timestamp in
-the compressed file.  These are used when decompressing the file with the
-@option{-N} option.  This is useful when the compressed file name was
-truncated or when the timestamp was not preserved after a file
-transfer.  However, due to limitations in the current @command{gzip} file
+By default, @command{gzip} keeps the original file name in the
+compressed file.  This can be useful when decompressing the file with
+@option{-N} if the compressed file name was truncated after a file
+transfer.
+
+If the original is a regular file, @command{gzip} by default keeps its
+timestamp in the compressed file.  This can be useful when
+decompressing the file with @option{-N} if the timestamp was not
+preserved after a file transfer.
+However, due to limitations in the current @command{gzip} file
 format, fractional seconds are discarded.  Also, timestamps must fall
 within the range 1970-01-01 00:00:01 through 2106-02-07 06:28:15
 @abbr{UTC}, and hosts whose operating systems use 32-bit timestamps
@@ -344,7 +349,8 @@ is the default when decompressing.
 
 @item --name
 @itemx -N
-When compressing, always save the original file name and timestamp; this
+When compressing, always save the original file name, and save
+the original timestamp if the original is a regular file; this
 is the default.  When decompressing, restore the original file name and
 timestamp if present.  This option is useful on systems which have
 a limit on file name length or when the timestamp has been lost after
index ab47c4c82e6016c37b1e5b87575c41da9f34820b..52180cc4b9f90d6e5e909e3f255855978170f12f 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 7 January 2018
-@set UPDATED-MONTH January 2018
-@set EDITION 1.9
-@set VERSION 1.9
+@set UPDATED 7 August 2018
+@set UPDATED-MONTH August 2018
+@set EDITION 1.10
+@set VERSION 1.10
index ab47c4c82e6016c37b1e5b87575c41da9f34820b..52180cc4b9f90d6e5e909e3f255855978170f12f 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 7 January 2018
-@set UPDATED-MONTH January 2018
-@set EDITION 1.9
-@set VERSION 1.9
+@set UPDATED 7 August 2018
+@set UPDATED-MONTH August 2018
+@set EDITION 1.10
+@set VERSION 1.10
index f1d03489e7560b6ffa855e05494b572ad491805e..e43848c1ca664d664d720ef2d39abe282f4d138b 100644 (file)
--- a/gunzip.in
+++ b/gunzip.in
@@ -18,7 +18,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 version="gunzip (gzip) @VERSION@
-Copyright (C) 2007, 2011-2017 Free Software Foundation, Inc.
+Copyright (C) 2007, 2011-2018 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
index 6c6118389b7140680f33a21a001ab9137acdaee9..3076b6808ba2ec22070da32c6b3963f711921931 100644 (file)
--- a/gzexe.in
+++ b/gzexe.in
@@ -37,7 +37,7 @@ nl='
 IFS=" $tab$nl"
 
 version='gzexe (gzip) @VERSION@
-Copyright (C) 2007, 2011-2017 Free Software Foundation, Inc.
+Copyright (C) 2007, 2011-2018 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
diff --git a/gzip.c b/gzip.c
index 7652f66cfda0a3a84ef1fde8b11a3367f34411db..9751c5e7cc121210be0909131b6924af82f1629d 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -29,7 +29,7 @@
  */
 
 static char const *const license_msg[] = {
-"Copyright (C) 2017 Free Software Foundation, Inc.",
+"Copyright (C) 2018 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 <https://www.gnu.org/licenses/gpl.html>.",
@@ -115,21 +115,6 @@ static char const *const license_msg[] = {
   off_t lseek (int fd, off_t offset, int whence);
 #endif
 
-#ifndef OFF_T_MAX
-# define OFF_T_MAX TYPE_MAXIMUM (off_t)
-#endif
-
-/* Use SA_NOCLDSTOP as a proxy for whether the sigaction machinery is
-   present.  */
-#ifndef SA_NOCLDSTOP
-# define SA_NOCLDSTOP 0
-# define sigprocmask(how, set, oset) /* empty */
-# define sigset_t int
-# if ! HAVE_SIGINTERRUPT
-#  define siginterrupt(sig, flag) /* empty */
-# endif
-#endif
-
 #ifndef HAVE_WORKING_O_NOFOLLOW
 # define HAVE_WORKING_O_NOFOLLOW 0
 #endif
@@ -211,8 +196,10 @@ static sigset_t caught_signals;
    suppresses a "Broken Pipe" message with some shells.  */
 static int volatile exiting_signal;
 
-/* If nonnegative, close this file descriptor and unlink ofname on error.  */
+/* If nonnegative, close this file descriptor and unlink remove_ofname
+   on error.  */
 static int volatile remove_ofname_fd = -1;
+static char volatile remove_ofname[MAX_PATH_LEN];
 
 static bool stdin_was_read;
 
@@ -323,8 +310,8 @@ 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);
+static void remove_output_file (bool);
+static void abort_gzip_signal (int);
 local noreturn void do_exit (int exitcode);
 static void finish_out (void);
       int main          (int argc, char **argv);
@@ -692,7 +679,6 @@ int main (int argc, char **argv)
         && errno != EBADF)
       write_error ();
     do_exit(exit_code);
-    return exit_code; /* just to avoid lint warning */
 }
 
 /* Return nonzero when at end of file on input.  */
@@ -714,6 +700,25 @@ input_eof ()
   return 0;
 }
 
+static void
+get_input_size_and_time (void)
+{
+  ifile_size = -1;
+  time_stamp.tv_nsec = -1;
+
+  /* Record the input file's size and timestamp only if it is a
+     regular file.  Doing this for the timestamp helps to keep gzip's
+     output more reproducible when it is used as part of a
+     pipeline.  */
+
+  if (S_ISREG (istat.st_mode))
+    {
+      ifile_size = istat.st_size;
+      if (!no_time || list)
+        time_stamp = get_stat_mtime (&istat);
+    }
+}
+
 /* ========================================================================
  * Compress or decompress stdin
  */
@@ -761,15 +766,8 @@ local void treat_stdin()
         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)
-      {
-        if (S_ISREG (istat.st_mode))
-          time_stamp = get_stat_mtime (&istat);
-        else
-          gettime (&time_stamp);
-      }
+
+    get_input_size_and_time ();
 
     clear_bufs(); /* clear input and output buffers */
     to_stdout = 1;
@@ -941,10 +939,7 @@ local void treat_file(iname)
           }
       }
 
-    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);
+    get_input_size_and_time ();
 
     /* Generate output file name. For -r and (-t or -l), skip files
      * without a valid gzip suffix (check done in make_ofname).
@@ -1053,7 +1048,7 @@ local void treat_file(iname)
 
     if (method == -1) {
         if (!to_stdout)
-          remove_output_file ();
+          remove_output_file (false);
         return;
     }
 
@@ -1073,6 +1068,13 @@ local void treat_file(iname)
     }
 }
 
+static void
+volatile_strcpy (char volatile *dst, char const volatile *src)
+{
+  while ((*dst++ = *src++))
+    continue;
+}
+
 /* ========================================================================
  * Create the output file. Return OK or ERROR.
  * Try several times if necessary to avoid truncating the z_suffix. For
@@ -1106,6 +1108,8 @@ local int create_outfile()
       int open_errno;
       sigset_t oldset;
 
+      volatile_strcpy (remove_ofname, ofname);
+
       sigprocmask (SIG_BLOCK, &caught_signals, &oldset);
       remove_ofname_fd = ofd = openat (atfd, base, flags, S_IRUSR | S_IWUSR);
       open_errno = errno;
@@ -1728,12 +1732,7 @@ local void do_list(ifd, method)
         "lzh  ",  /* 3 */
         "", "", "", "", /* 4 to 7 reserved */
         "defla"}; /* 8 */
-    int positive_off_t_width = 1;
-    off_t o;
-
-    for (o = OFF_T_MAX;  9 < o;  o /= 10) {
-        positive_off_t_width++;
-    }
+    int positive_off_t_width = INT_STRLEN_BOUND (off_t) - 1;
 
     if (first_time && method >= 0) {
         first_time = 0;
@@ -1914,17 +1913,20 @@ local int check_ofname()
    the file and NAME its name.  Change it to user UID and to group GID.
    If UID or GID is -1, though, do not change the corresponding user
    or group.  */
+#if ! (HAVE_FCHOWN || HAVE_CHOWN)
+/* The types uid_t and gid_t do not exist on mingw, so don't assume them.  */
+# define do_chown(fd, name, uid, gid) ((void) 0)
+#else
 static void
 do_chown (int fd, char const *name, uid_t uid, gid_t gid)
 {
-#ifndef NO_CHOWN
 # if HAVE_FCHOWN
   ignore_value (fchown (fd, uid, gid));
 # else
   ignore_value (chown (name, uid, gid));
 # endif
-#endif
 }
+#endif
 
 /* ========================================================================
  * Copy modes, times, ownership from input file to output file.
@@ -2049,8 +2051,6 @@ install_signal_handlers ()
 {
   int nsigs = sizeof handled_sig / sizeof handled_sig[0];
   int i;
-
-#if SA_NOCLDSTOP
   struct sigaction act;
 
   sigemptyset (&caught_signals);
@@ -2072,16 +2072,6 @@ install_signal_handlers ()
           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);
-      }
-#endif
 }
 
 /* ========================================================================
@@ -2121,42 +2111,43 @@ finish_out (void)
  * Close and unlink the output file.
  */
 static void
-remove_output_file ()
+remove_output_file (bool signals_already_blocked)
 {
   int fd;
   sigset_t oldset;
 
-  sigprocmask (SIG_BLOCK, &caught_signals, &oldset);
+  if (!signals_already_blocked)
+    sigprocmask (SIG_BLOCK, &caught_signals, &oldset);
   fd = remove_ofname_fd;
   if (0 <= fd)
     {
+      char fname[MAX_PATH_LEN];
       remove_ofname_fd = -1;
       close (fd);
-      xunlink (ofname);
+      volatile_strcpy (fname, remove_ofname);
+      xunlink (fname);
     }
-  sigprocmask (SIG_SETMASK, &oldset, NULL);
+  if (!signals_already_blocked)
+    sigprocmask (SIG_SETMASK, &oldset, NULL);
 }
 
 /* ========================================================================
  * Error handler.
  */
 void
-abort_gzip ()
+abort_gzip (void)
 {
-   remove_output_file ();
+   remove_output_file (false);
    do_exit(ERROR);
 }
 
 /* ========================================================================
  * Signal handler.
  */
-static RETSIGTYPE
-abort_gzip_signal (sig)
-     int sig;
+static void
+abort_gzip_signal (int sig)
 {
-  if (! SA_NOCLDSTOP)
-    signal (sig, SIG_IGN);
-   remove_output_file ();
+   remove_output_file (true);
    if (sig == exiting_signal)
      _exit (WARNING);
    signal (sig, SIG_DFL);
diff --git a/gzip.h b/gzip.h
index 249933797a82614ce56ec87e0a147b6bb73c68be..329c9a517f1e789c61d2aea4de84c68cc77ffedf 100644 (file)
--- a/gzip.h
+++ b/gzip.h
 #include <stdnoreturn.h>
 #define memzero(s, n) memset ((voidp)(s), 0, (n))
 
-#ifndef RETSIGTYPE
-#  define RETSIGTYPE void
-#endif
-
 #define local static
 
 typedef unsigned char  uch;
index d372685ae995102255010a612a3b156c7aa0b752..bcafcf1a12368ce294aedd17eb30897561f023f6 100644 (file)
--- a/inflate.c
+++ b/inflate.c
@@ -799,6 +799,12 @@ inflate_dynamic(void)
     NEEDBITS((unsigned)bl)
     j = (td = tl + ((unsigned)b & m))->b;
     DUMPBITS(j)
+    if (td->e == 99)
+      {
+        /* Invalid code.  */
+        huft_free (tl);
+        return 2;
+      }
     j = td->v.n;
     if (j < 16)                 /* length of code in bits (0..15) */
       ll[i++] = l = j;          /* save last length in l */
index a6982392cb5d773ac9dcacd69f2f3320b1d8af8b..ea6efb79badfb87f4023f910aabd5fe9062775f6 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15a from Makefile.am.
+# Makefile.in generated by automake 1.16a from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --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 dirname-lgpl dosname fclose fcntl fcntl-safer fdatasync fdl fdopendir fprintf-posix fsync getopt-gnu git-version-gen gitlog-to-changelog gnu-make gnu-web-doc-update gnumakefile gnupload ignore-value intprops largefile lib-ignore lstat maintainer-makefile malloc-gnu manywarnings openat-safer perror printf-posix readme-release realloc-gnu savedir stat-time stdnoreturn sys_stat time unistd-safer unlinkat update-copyright utimens verify xalloc year2038 yesno
+# Reproduce by:
+# gnulib-tool --import --local-dir=gl \
+#  --lib=libgzip \
+#  --source-base=lib \
+#  --m4-base=m4 \
+#  --doc-base=doc \
+#  --tests-base=tests \
+#  --aux-dir=build-aux \
+#  --makefile-name=gnulib.mk \
+#  --no-conditional-dependencies \
+#  --no-libtool \
+#  --macro-prefix=gl \
+#  --avoid=getline \
+#  --avoid=rpmatch \
+#  announce-gen \
+#  calloc \
+#  close \
+#  dirname-lgpl \
+#  dosname \
+#  fclose \
+#  fcntl \
+#  fcntl-safer \
+#  fdatasync \
+#  fdl \
+#  fdopendir \
+#  fprintf-posix \
+#  fsync \
+#  getopt-gnu \
+#  git-version-gen \
+#  gitlog-to-changelog \
+#  gnu-make \
+#  gnu-web-doc-update \
+#  gnumakefile \
+#  gnupload \
+#  ignore-value \
+#  intprops \
+#  largefile \
+#  lib-ignore \
+#  lstat \
+#  maintainer-makefile \
+#  malloc-gnu \
+#  manywarnings \
+#  openat-safer \
+#  perror \
+#  printf-posix \
+#  readme-release \
+#  realloc-gnu \
+#  savedir \
+#  sigaction \
+#  stat-time \
+#  stdnoreturn \
+#  sys_stat \
+#  time \
+#  unistd-safer \
+#  unlinkat \
+#  update-copyright \
+#  utimens \
+#  verify \
+#  xalloc \
+#  year2038 \
+#  yesno
 
 VPATH = @srcdir@
 am__is_gnu_make = { \
@@ -187,18 +247,21 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
        $(top_srcdir)/m4/printf-posix-rpl.m4 \
        $(top_srcdir)/m4/printf.m4 \
        $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \
-       $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/realloc.m4 \
-       $(top_srcdir)/m4/rmdir.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/stdnoreturn.m4 \
-       $(top_srcdir)/m4/stpcpy.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/raise.m4 $(top_srcdir)/m4/readdir.m4 \
+       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/rmdir.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \
+       $(top_srcdir)/m4/shell.m4 $(top_srcdir)/m4/sigaction.m4 \
+       $(top_srcdir)/m4/signal_h.m4 \
+       $(top_srcdir)/m4/signalblocking.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/stdnoreturn.m4 $(top_srcdir)/m4/stpcpy.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 \
@@ -237,12 +300,12 @@ am_libgzip_a_OBJECTS = cloexec.$(OBJEXT) opendir-safer.$(OBJEXT) \
        glthread/lock.$(OBJEXT) malloca.$(OBJEXT) math.$(OBJEXT) \
        openat-die.$(OBJEXT) openat-safer.$(OBJEXT) \
        printf-frexp.$(OBJEXT) printf-frexpl.$(OBJEXT) \
-       save-cwd.$(OBJEXT) savedir.$(OBJEXT) stat-time.$(OBJEXT) \
-       statat.$(OBJEXT) glthread/threadlib.$(OBJEXT) \
-       timespec.$(OBJEXT) unistd.$(OBJEXT) dup-safer.$(OBJEXT) \
-       fd-safer.$(OBJEXT) pipe-safer.$(OBJEXT) utimens.$(OBJEXT) \
-       xmalloc.$(OBJEXT) xalloc-die.$(OBJEXT) xsize.$(OBJEXT) \
-       yesno.$(OBJEXT)
+       save-cwd.$(OBJEXT) savedir.$(OBJEXT) sig-handler.$(OBJEXT) \
+       stat-time.$(OBJEXT) statat.$(OBJEXT) \
+       glthread/threadlib.$(OBJEXT) timespec.$(OBJEXT) \
+       unistd.$(OBJEXT) dup-safer.$(OBJEXT) fd-safer.$(OBJEXT) \
+       pipe-safer.$(OBJEXT) utimens.$(OBJEXT) xmalloc.$(OBJEXT) \
+       xalloc-die.$(OBJEXT) xsize.$(OBJEXT) yesno.$(OBJEXT)
 libgzip_a_OBJECTS = $(am_libgzip_a_OBJECTS)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -298,11 +361,13 @@ am__depfiles_remade = $(DEPDIR)/match.Po ./$(DEPDIR)/asnprintf.Po \
        ./$(DEPDIR)/perror.Po ./$(DEPDIR)/pipe-safer.Po \
        ./$(DEPDIR)/printf-args.Po ./$(DEPDIR)/printf-frexp.Po \
        ./$(DEPDIR)/printf-frexpl.Po ./$(DEPDIR)/printf-parse.Po \
-       ./$(DEPDIR)/printf.Po ./$(DEPDIR)/readdir.Po \
-       ./$(DEPDIR)/realloc.Po ./$(DEPDIR)/rmdir.Po \
-       ./$(DEPDIR)/save-cwd.Po ./$(DEPDIR)/savedir.Po \
-       ./$(DEPDIR)/signbitd.Po ./$(DEPDIR)/signbitf.Po \
-       ./$(DEPDIR)/signbitl.Po ./$(DEPDIR)/stat-time.Po \
+       ./$(DEPDIR)/printf.Po ./$(DEPDIR)/raise.Po \
+       ./$(DEPDIR)/readdir.Po ./$(DEPDIR)/realloc.Po \
+       ./$(DEPDIR)/rmdir.Po ./$(DEPDIR)/save-cwd.Po \
+       ./$(DEPDIR)/savedir.Po ./$(DEPDIR)/sig-handler.Po \
+       ./$(DEPDIR)/sigaction.Po ./$(DEPDIR)/signbitd.Po \
+       ./$(DEPDIR)/signbitf.Po ./$(DEPDIR)/signbitl.Po \
+       ./$(DEPDIR)/sigprocmask.Po ./$(DEPDIR)/stat-time.Po \
        ./$(DEPDIR)/stat-w32.Po ./$(DEPDIR)/stat.Po \
        ./$(DEPDIR)/statat.Po ./$(DEPDIR)/stpcpy.Po \
        ./$(DEPDIR)/strdup.Po ./$(DEPDIR)/strerror-override.Po \
@@ -508,6 +573,7 @@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
 GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPASS = @GNULIB_GETPASS@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
 GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
@@ -609,6 +675,7 @@ GNULIB_POWF = @GNULIB_POWF@
 GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
 GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
 GNULIB_PUTC = @GNULIB_PUTC@
@@ -617,6 +684,7 @@ GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
 GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_QSORT_R = @GNULIB_QSORT_R@
+GNULIB_RAISE = @GNULIB_RAISE@
 GNULIB_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
@@ -647,7 +715,10 @@ GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
 GNULIB_SETENV = @GNULIB_SETENV@
 GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SIGACTION = @GNULIB_SIGACTION@
+GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
 GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
+GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
 GNULIB_SINF = @GNULIB_SINF@
 GNULIB_SINHF = @GNULIB_SINHF@
 GNULIB_SINL = @GNULIB_SINL@
@@ -842,6 +913,7 @@ 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_TRUNCATE = @HAVE_DECL_TRUNCATE@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
 HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
@@ -889,6 +961,7 @@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
 HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
 HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
@@ -949,12 +1022,15 @@ HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
 HAVE_PTSNAME = @HAVE_PTSNAME@
 HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RAISE = @HAVE_RAISE@
 HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
@@ -976,9 +1052,13 @@ HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
+HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
 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_SIGSET_T = @HAVE_SIGSET_T@
 HAVE_SINF = @HAVE_SINF@
 HAVE_SINHF = @HAVE_SINHF@
 HAVE_SINL = @HAVE_SINL@
@@ -997,6 +1077,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
@@ -1013,7 +1094,7 @@ HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
-HAVE_TRUNCATE = @HAVE_TRUNCATE@
+HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
 HAVE_TZSET = @HAVE_TZSET@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
@@ -1063,8 +1144,6 @@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
 HAVE_WMEMSET = @HAVE_WMEMSET@
 HAVE__BOOL = @HAVE__BOOL@
 HAVE__EXIT = @HAVE__EXIT@
-HOST_CPU = @HOST_CPU@
-HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
 IGNORE_UNUSED_LIBRARIES_CFLAGS = @IGNORE_UNUSED_LIBRARIES_CFLAGS@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
@@ -1101,6 +1180,7 @@ 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_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
 NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_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@
@@ -1120,6 +1200,7 @@ NEXT_FLOAT_H = @NEXT_FLOAT_H@
 NEXT_GETOPT_H = @NEXT_GETOPT_H@
 NEXT_LIMITS_H = @NEXT_LIMITS_H@
 NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
 NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
@@ -1214,6 +1295,7 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_GMTIME = @REPLACE_GMTIME@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
@@ -1280,11 +1362,13 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
 REPLACE_PTSNAME = @REPLACE_PTSNAME@
 REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
 REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RAISE = @REPLACE_RAISE@
 REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
 REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
@@ -1446,10 +1530,10 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AM_CFLAGS = $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
 BUILT_SOURCES = $(ALLOCA_H) dirent.h $(ERRNO_H) fcntl.h $(FLOAT_H) \
-       $(GETOPT_H) $(GETOPT_CDEFS_H) $(LIMITS_H) math.h $(STDBOOL_H) \
-       $(STDDEF_H) $(STDINT_H) stdio.h stdlib.h $(STDNORETURN_H) \
-       string.h sys/stat.h sys/time.h sys/types.h time.h unistd.h \
-       $(UTIME_H) wchar.h
+       $(GETOPT_H) $(GETOPT_CDEFS_H) $(LIMITS_H) math.h signal.h \
+       $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h stdlib.h \
+       $(STDNORETURN_H) string.h sys/stat.h sys/time.h sys/types.h \
+       time.h unistd.h $(UTIME_H) wchar.h
 CLEANFILES = 
 
 #if GNU_MAKE
@@ -1485,13 +1569,14 @@ EXTRA_DIST = alloca.in.h $(top_srcdir)/build-aux/announce-gen assure.h \
        isnanf-nolibm.h isnanf.c float+.h isnan.c isnanl-nolibm.h \
        isnanl.c limits.in.h localtime-buffer.c localtime-buffer.h \
        lseek.c lstat.c $(top_srcdir)/maint.mk malloc.c malloc.c \
-       malloca.h malloca.valgrind math.in.h memchr.c memchr.valgrind \
-       mempcpy.c memrchr.c msvc-inval.c msvc-inval.h msvc-nothrow.c \
+       malloca.h math.in.h memchr.c memchr.valgrind mempcpy.c \
+       memrchr.c msvc-inval.c msvc-inval.h msvc-nothrow.c \
        msvc-nothrow.h open.c openat.c openat.h fcntl--.h \
        fcntl-safer.h dirent-private.h opendir.c pathmax.h perror.c \
-       printf-frexp.h printf-frexp.c printf-frexpl.h printf.c \
+       printf-frexp.h printf-frexp.c printf-frexpl.h printf.c raise.c \
        dirent-private.h readdir.c realloc.c realloc.c rmdir.c \
-       save-cwd.h savedir.h float+.h signbitd.c signbitf.c signbitl.c \
+       save-cwd.h savedir.h sig-handler.h sigaction.c signal.in.h \
+       float+.h signbitd.c signbitf.c signbitl.c sigprocmask.c \
        _Noreturn.h arg-nonnull.h c++defs.h unused-parameter.h \
        warn-on-use.h stat-w32.c stat-w32.h stat.c stat-time.h \
        stdbool.in.h stddef.in.h stdint.in.h stdio.in.h stdlib.in.h \
@@ -1510,12 +1595,13 @@ MOSTLYCLEANDIRS = sys
 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 getopt-cdefs.h getopt-cdefs.h-t \
-       limits.h limits.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 stdnoreturn.h stdnoreturn.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 \
-       utime.h utime.h-t wchar.h wchar.h-t _match.S _match.i match_.s
+       limits.h limits.h-t math.h math.h-t signal.h signal.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 stdnoreturn.h \
+       stdnoreturn.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 utime.h utime.h-t wchar.h \
+       wchar.h-t _match.S _match.i match_.s
 SUFFIXES = 
 # No GNU Make output.
 noinst_LIBRARIES = libgzip.a
@@ -1525,10 +1611,10 @@ libgzip_a_SOURCES = cloexec.c opendir-safer.c dirname-lgpl.c \
        filenamecat-lgpl.c freading.c getprogname.h getprogname.c \
        gettext.h gettime.c glthread/lock.h glthread/lock.c malloca.c \
        math.c openat-die.c openat-safer.c printf-frexp.c \
-       printf-frexpl.c save-cwd.c savedir.c size_max.h stat-time.c \
-       statat.c glthread/threadlib.c timespec.c unistd.c dup-safer.c \
-       fd-safer.c pipe-safer.c utimens.c xmalloc.c xalloc-die.c \
-       xsize.h xsize.c yesno.c
+       printf-frexpl.c save-cwd.c savedir.c sig-handler.c size_max.h \
+       stat-time.c statat.c glthread/threadlib.c timespec.c unistd.c \
+       dup-safer.c fd-safer.c pipe-safer.c utimens.c xmalloc.c \
+       xalloc-die.c xsize.h xsize.c yesno.c
 libgzip_a_LIBADD = $(gl_LIBOBJS) $(LIBOBJS)
 libgzip_a_DEPENDENCIES = $(gl_LIBOBJS) $(LIBOBJS)
 EXTRA_libgzip_a_SOURCES = openat-proc.c calloc.c calloc.c chdir-long.c \
@@ -1541,11 +1627,12 @@ EXTRA_libgzip_a_SOURCES = openat-proc.c calloc.c calloc.c chdir-long.c \
        isnanf.c isnan.c isnanl.c localtime-buffer.c lseek.c lstat.c \
        malloc.c malloc.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 rmdir.c \
-       signbitd.c signbitf.c signbitl.c stat-w32.c stat.c stpcpy.c \
-       strdup.c strerror.c strerror-override.c strerror_r.c unlink.c \
-       at-func.c unlinkat.c utime.c asnprintf.c printf-args.c \
-       printf-parse.c vasnprintf.c vfprintf.c
+       printf-frexp.c printf.c raise.c readdir.c realloc.c realloc.c \
+       rmdir.c sigaction.c signbitd.c signbitf.c signbitl.c \
+       sigprocmask.c stat-w32.c stat.c stpcpy.c strdup.c strerror.c \
+       strerror-override.c strerror_r.c unlink.c at-func.c unlinkat.c \
+       utime.c asnprintf.c printf-args.c printf-parse.c vasnprintf.c \
+       vfprintf.c
 
 # Use this preprocessor expression to decide whether #include_next works.
 # Do not rely on a 'configure'-time test for this, since the expression
@@ -1732,14 +1819,18 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-frexpl.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raise.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/realloc.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/save-cwd.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/savedir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig-handler.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitd.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitf.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat-time.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat-w32.Po@am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ # am--include-marker
@@ -1998,14 +2089,18 @@ distclean: distclean-am
        -rm -f ./$(DEPDIR)/printf-frexpl.Po
        -rm -f ./$(DEPDIR)/printf-parse.Po
        -rm -f ./$(DEPDIR)/printf.Po
+       -rm -f ./$(DEPDIR)/raise.Po
        -rm -f ./$(DEPDIR)/readdir.Po
        -rm -f ./$(DEPDIR)/realloc.Po
        -rm -f ./$(DEPDIR)/rmdir.Po
        -rm -f ./$(DEPDIR)/save-cwd.Po
        -rm -f ./$(DEPDIR)/savedir.Po
+       -rm -f ./$(DEPDIR)/sig-handler.Po
+       -rm -f ./$(DEPDIR)/sigaction.Po
        -rm -f ./$(DEPDIR)/signbitd.Po
        -rm -f ./$(DEPDIR)/signbitf.Po
        -rm -f ./$(DEPDIR)/signbitl.Po
+       -rm -f ./$(DEPDIR)/sigprocmask.Po
        -rm -f ./$(DEPDIR)/stat-time.Po
        -rm -f ./$(DEPDIR)/stat-w32.Po
        -rm -f ./$(DEPDIR)/stat.Po
@@ -2155,14 +2250,18 @@ maintainer-clean: maintainer-clean-am
        -rm -f ./$(DEPDIR)/printf-frexpl.Po
        -rm -f ./$(DEPDIR)/printf-parse.Po
        -rm -f ./$(DEPDIR)/printf.Po
+       -rm -f ./$(DEPDIR)/raise.Po
        -rm -f ./$(DEPDIR)/readdir.Po
        -rm -f ./$(DEPDIR)/realloc.Po
        -rm -f ./$(DEPDIR)/rmdir.Po
        -rm -f ./$(DEPDIR)/save-cwd.Po
        -rm -f ./$(DEPDIR)/savedir.Po
+       -rm -f ./$(DEPDIR)/sig-handler.Po
+       -rm -f ./$(DEPDIR)/sigaction.Po
        -rm -f ./$(DEPDIR)/signbitd.Po
        -rm -f ./$(DEPDIR)/signbitf.Po
        -rm -f ./$(DEPDIR)/signbitl.Po
+       -rm -f ./$(DEPDIR)/sigprocmask.Po
        -rm -f ./$(DEPDIR)/stat-time.Po
        -rm -f ./$(DEPDIR)/stat-w32.Po
        -rm -f ./$(DEPDIR)/stat.Po
@@ -2341,7 +2440,7 @@ fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_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 $(top_builddir)/config.status
+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|@''GUARD_PREFIX''@|GL|g' \
@@ -2669,6 +2768,39 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
        } > $@-t && \
        mv $@-t $@
 
+# We need the following in order to create <signal.h> when the system
+# doesn't have a complete one.
+signal.h: signal.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|@''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_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
+             -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GNULIB_PTHREAD_SIGMASK)/g' \
+             -e 's/@''GNULIB_RAISE''@/$(GNULIB_RAISE)/g' \
+             -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
+             -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \
+             -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \
+             -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \
+             -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \
+             -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \
+             -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \
+             -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \
+             -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \
+             -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
+             -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \
+             -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \
+             -e 's|@''REPLACE_RAISE''@|$(REPLACE_RAISE)|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)/signal.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+
 # We need the following in order to create <stdbool.h> when the system
 # doesn't have one that works.
 @GL_GENERATE_STDBOOL_H_TRUE@stdbool.h: stdbool.in.h $(top_builddir)/config.status
@@ -3240,6 +3372,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -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_GETPASS''@/$(GNULIB_GETPASS)/g' \
              -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
              -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
              -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
@@ -3283,6 +3416,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
+             -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \
              -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
              -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
              -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
@@ -3297,7 +3431,6 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
              -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
              -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
-             -e 's|@''HAVE_TRUNCATE''@|$(HAVE_TRUNCATE)|g' \
              -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
              -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
@@ -3309,6 +3442,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -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_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|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' \
@@ -3326,6 +3460,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -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_GETPASS''@|$(REPLACE_GETPASS)|g' \
              -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
              -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
@@ -3356,7 +3491,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
 
 # We need the following in order to create <utime.h> when the system
 # doesn't have one that works with the given compiler.
-@GL_GENERATE_UTIME_H_TRUE@utime.h: utime.in.h $(top_builddir)/config.status
+@GL_GENERATE_UTIME_H_TRUE@utime.h: utime.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
 @GL_GENERATE_UTIME_H_TRUE@     $(AM_V_GEN)rm -f $@-t $@ && \
 @GL_GENERATE_UTIME_H_TRUE@     { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
 @GL_GENERATE_UTIME_H_TRUE@       sed -e 's|@''GUARD_PREFIX''@|GL|g' \
index c44ad89b7c09315601bfb48467992f9fff797093..94fdfaf0220f98b42c569d0f9040ee6df3306ce4 100644 (file)
@@ -1,8 +1,12 @@
-#if !defined _Noreturn && __STDC_VERSION__ < 201112
-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
-      || 0x5110 <= __SUNPRO_C)
+#ifndef _Noreturn
+# if 201103 <= (defined __cplusplus ? __cplusplus : 0)
+#  define _Noreturn [[noreturn]]
+# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+        || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))
+   /* _Noreturn works as-is.  */
+# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
 #  define _Noreturn __attribute__ ((__noreturn__))
-# elif 1200 <= _MSC_VER
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
 #  define _Noreturn __declspec (noreturn)
 # else
 #  define _Noreturn
index de6c38db6afe472c25d3b41413c7f5f59c6fd9a1..1cc600ab0acca3aea353dc9c054d37c02dc14191 100644 (file)
@@ -23,7 +23,7 @@
 #include <assert.h>
 
 /* Check E's value at runtime, and report an error and abort if not.
-   However, do nothng if NDEBUG is defined.
+   However, do nothing if NDEBUG is defined.
 
    Unlike standard 'assert', this macro always compiles E even when NDEBUG
    is defined, so as to catch typos and avoid some GCC warnings.  */
index 6c89fde5bef1df8a8d2b0270b1352c4edd3df2f4..1470aca88fa504916c5c4769b1ad5a3210d8467f 100644 (file)
@@ -1,80 +1,5 @@
 /* lib/config.hin.  Generated from configure.ac by autoheader.  */
 
-/* CPU and C ABI indicator */
-#ifndef __i386__
-#undef __i386__
-#endif
-#ifndef __x86_64_x32__
-#undef __x86_64_x32__
-#endif
-#ifndef __x86_64__
-#undef __x86_64__
-#endif
-#ifndef __alpha__
-#undef __alpha__
-#endif
-#ifndef __arm__
-#undef __arm__
-#endif
-#ifndef __armhf__
-#undef __armhf__
-#endif
-#ifndef __arm64_ilp32__
-#undef __arm64_ilp32__
-#endif
-#ifndef __arm64__
-#undef __arm64__
-#endif
-#ifndef __hppa__
-#undef __hppa__
-#endif
-#ifndef __hppa64__
-#undef __hppa64__
-#endif
-#ifndef __ia64_ilp32__
-#undef __ia64_ilp32__
-#endif
-#ifndef __ia64__
-#undef __ia64__
-#endif
-#ifndef __m68k__
-#undef __m68k__
-#endif
-#ifndef __mips__
-#undef __mips__
-#endif
-#ifndef __mipsn32__
-#undef __mipsn32__
-#endif
-#ifndef __mips64__
-#undef __mips64__
-#endif
-#ifndef __powerpc__
-#undef __powerpc__
-#endif
-#ifndef __powerpc64__
-#undef __powerpc64__
-#endif
-#ifndef __powerpc64_elfv2__
-#undef __powerpc64_elfv2__
-#endif
-#ifndef __s390__
-#undef __s390__
-#endif
-#ifndef __s390x__
-#undef __s390x__
-#endif
-#ifndef __sh__
-#undef __sh__
-#endif
-#ifndef __sparc__
-#undef __sparc__
-#endif
-#ifndef __sparc64__
-#undef __sparc64__
-#endif
-
-
 /* Define if building universal (internal helper macro) */
 #undef AC_APPLE_UNIVERSAL_BUILD
 
 /* Define to 1 when the gnulib module printf-posix should be tested. */
 #undef GNULIB_TEST_PRINTF_POSIX
 
+/* Define to 1 when the gnulib module raise should be tested. */
+#undef GNULIB_TEST_RAISE
+
 /* Define to 1 when the gnulib module readdir should be tested. */
 #undef GNULIB_TEST_READDIR
 
 /* Define to 1 when the gnulib module rmdir should be tested. */
 #undef GNULIB_TEST_RMDIR
 
+/* Define to 1 when the gnulib module sigaction should be tested. */
+#undef GNULIB_TEST_SIGACTION
+
 /* Define to 1 when the gnulib module signbit should be tested. */
 #undef GNULIB_TEST_SIGNBIT
 
+/* Define to 1 when the gnulib module sigprocmask should be tested. */
+#undef GNULIB_TEST_SIGPROCMASK
+
 /* Define to 1 when the gnulib module stat should be tested. */
 #undef GNULIB_TEST_STAT
 
    don't. */
 #undef HAVE_DECL_STRERROR_R
 
+/* Define to 1 if you have the declaration of `_fseeki64', and to 0 if you
+   don't. */
+#undef HAVE_DECL__FSEEKI64
+
 /* Define to 1 if you have the declaration of `_snprintf', and to 0 if you
    don't. */
 #undef HAVE_DECL__SNPRINTF
    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 <ndir.h> header file, and it defines `DIR'. */
 #undef HAVE_NDIR_H
 
    reader. */
 #undef HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
 
+/* Define to 1 if you have the `raise' function. */
+#undef HAVE_RAISE
+
 /* Define to 1 if you have the `readdir' function. */
 #undef HAVE_READDIR
 
 /* Define to 1 if you have the `setdtablesize' function. */
 #undef HAVE_SETDTABLESIZE
 
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
+/* Define to 1 if you have the `sigaltstack' function. */
+#undef HAVE_SIGALTSTACK
+
+/* Define to 1 if the system has the type `siginfo_t'. */
+#undef HAVE_SIGINFO_T
+
 /* Define to 1 if you have the `siginterrupt' function. */
 #undef HAVE_SIGINTERRUPT
 
 /* Define to 1 if 'wint_t' is a signed integer type. */
 #undef HAVE_SIGNED_WINT_T
 
+/* Define to 1 if the system has the type `sigset_t'. */
+#undef HAVE_SIGSET_T
+
 /* Define to 1 if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
 /* Define to 1 if you have the `strnlen' function. */
 #undef HAVE_STRNLEN
 
+/* Define to 1 if `sa_sigaction' is a member of `struct sigaction'. */
+#undef HAVE_STRUCT_SIGACTION_SA_SIGACTION
+
 /* Define to 1 if `st_atimensec' is a member of `struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_ATIMENSEC
 
 #ifndef _XOPEN_SOURCE
 # undef _XOPEN_SOURCE
 #endif
+/* Enable X/Open compliant socket functions that do not require linking
+   with -lxnet on HP-UX 11.11.  */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# undef _HPUX_ALT_XOPEN_SOCKET_API
+#endif
 /* Enable general extensions on Solaris.  */
 #ifndef __EXTENSIONS__
 # undef __EXTENSIONS__
 #undef _NETBSD_SOURCE
 
 /* 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)
+#ifndef _Noreturn
+# if 201103 <= (defined __cplusplus ? __cplusplus : 0)
+#  define _Noreturn [[noreturn]]
+# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+        || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))
+   /* _Noreturn works as-is.  */
+# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
 #  define _Noreturn __attribute__ ((__noreturn__))
-# elif defined _MSC_VER && 1200 <= _MSC_VER
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
 #  define _Noreturn __declspec (noreturn)
 # else
 #  define _Noreturn
    if isdigit is mistakenly implemented via a static inline function,
    a program containing an extern inline function that calls isdigit
    may not work since the C standard prohibits extern inline functions
-   from calling static functions.  This bug is known to occur on:
+   from calling static functions (ISO C 99 section 6.7.4.(3).
+   This bug is known to occur on:
 
      OS X 10.8 and earlier; see:
      https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
 
    OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
    for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
-   Assume DragonFly and FreeBSD will be similar.  */
+   Assume DragonFly and FreeBSD will be similar.
+
+   GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+   inline semantics, unless -fgnu89-inline is used.  It defines a macro
+   __GNUC_STDC_INLINE__ to indicate this situation or a macro
+   __GNUC_GNU_INLINE__ to indicate the opposite situation.
+   GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
+   semantics but warns, unless -fgnu89-inline is used:
+     warning: C99 inline functions are not supported; using GNU89
+     warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
+   It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
+ */
 #if (((defined __APPLE__ && defined __MACH__) \
       || defined __DragonFly__ || defined __FreeBSD__) \
      && (defined __header_inline \
 # define _GL_INLINE_HEADER_END
 #endif
 
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
 /* Define to long or long long if <stdint.h> and <inttypes.h> don't define. */
 #undef intmax_t
 
 /* Define as a signed type of the same size as size_t. */
 #undef ssize_t
 
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
 /* Define as a marker that can be attached to declarations that might not
     be used.  This helps to reduce warnings, such as from
     GCC -Wunused-parameter.  */
 # define _GL_ATTRIBUTE_CONST /* empty */
 #endif
 
+/* The __malloc__ attribute was added in gcc 3.  */
+#if 3 <= __GNUC__
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+#else
+# define _GL_ATTRIBUTE_MALLOC /* empty */
+#endif
+
index 69aeb8682da46329a5affb03476a1f47840b3dd6..8b5111168d7018858a9b0f416a1c66b832d42080 100644 (file)
@@ -36,7 +36,7 @@ extern "C" {
 #endif
 
 # if GNULIB_DIRNAME
-char *base_name (char const *file);
+char *base_name (char const *file) _GL_ATTRIBUTE_MALLOC;
 char *dir_name (char const *file);
 # endif
 
index 66486d5209d0a8ff93a7018fb583b1580f71c7d5..fef3b6daa1ffe446259dcb442c349735dbeaca57 100644 (file)
@@ -20,9 +20,8 @@
 #ifndef _DOSNAME_H
 #define _DOSNAME_H
 
-#if (defined _WIN32 || defined __WIN32__ ||     \
-     defined __MSDOS__ || defined __CYGWIN__ || \
-     defined __EMX__ || defined __DJGPP__)
+#if (defined _WIN32 || defined __CYGWIN__ \
+     || defined __EMX__ || defined __MSDOS__ || 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'  \
index c8b49b25e474ad83e84850f2375681379ab1ccd3..c7d176728d4ba110fdc9cbf983f6df433d09e116 100644 (file)
@@ -29,7 +29,7 @@
 
 # undef dup2
 
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 
 /* Get declarations of the native Windows API functions.  */
 #  define WIN32_LEAN_AND_MEAN
index 8d2f3074faba8a46ffe589c196d578f57c0ba1af..b95c4e9ce769877ed71ef91f2eb0f02a4fc7125a 100644 (file)
@@ -30,7 +30,7 @@
 
 
 /* On native Windows platforms, many macros are not defined.  */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 
 /* These are the same values as defined by MSVC 10, for interoperability.  */
 
        interoperability.  */
 #   define EOWNERDEAD      58
 #   define ENOTRECOVERABLE 59
-#  elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#  elif 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
index 81788c7b96e7e35b3b8815721b80867c2526156d..adc873391cb49e164297fd1d9f16ca0aedcf1e60 100644 (file)
@@ -93,7 +93,7 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
 # include <fcntl.h>
 # include <unistd.h>
 
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 /* Get declarations of the native Windows API functions.  */
 #  define WIN32_LEAN_AND_MEAN
 #  include <windows.h>
@@ -131,7 +131,7 @@ int strerror_r (int errnum, char *buf, size_t buflen);
 static int
 is_open (int fd)
 {
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if 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
index b8cb271f55ca8cc450b5f9fdfd91b8e34226b8cd..74e0f5d39104944053162e20b4e9a4157f6b1eb2 100644 (file)
 #include <stdarg.h>
 #include <unistd.h>
 
-#if !HAVE_FCNTL
-# define rpl_fcntl fcntl
+#ifdef __KLIBC__
+# define INCL_DOS
+# include <os2.h>
 #endif
-#undef fcntl
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Get declarations of the native Windows API functions.  */
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
@@ -166,93 +166,18 @@ dupfd (int oldfd, int newfd, int flags)
 }
 #endif /* W32 */
 
+/* Forward declarations, because we '#undef fcntl' in the middle of this
+   compilation unit.  */
+/* Our implementation of fcntl (fd, F_DUPFD, target).  */
+static int rpl_fcntl_DUPFD (int fd, int target);
+/* Our implementation of fcntl (fd, F_DUPFD_CLOEXEC, target).  */
+static int rpl_fcntl_DUPFD_CLOEXEC (int fd, int target);
 #ifdef __KLIBC__
-
-# define INCL_DOS
-# include <os2.h>
-
-static int
-klibc_fcntl (int fd, int action, /* arg */...)
-{
-  va_list arg_ptr;
-  int arg;
-  struct stat sbuf;
-  int result = -1;
-
-  va_start (arg_ptr, action);
-  arg = va_arg (arg_ptr, int);
-  result = fcntl (fd, action, arg);
-  /* EPERM for F_DUPFD, ENOTSUP for others */
-  if (result == -1 && (errno == EPERM || errno == ENOTSUP)
-      && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
-  {
-    ULONG ulMode;
-
-    switch (action)
-      {
-      case F_DUPFD:
-        /* Find available fd */
-        while (fcntl (arg, F_GETFL) != -1 || errno != EBADF)
-          arg++;
-
-        result = dup2 (fd, arg);
-        break;
-
-      /* Using underlying APIs is right ? */
-      case F_GETFD:
-        if (DosQueryFHState (fd, &ulMode))
-          break;
-
-        result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0;
-        break;
-
-      case F_SETFD:
-        if (arg & ~FD_CLOEXEC)
-          break;
-
-        if (DosQueryFHState (fd, &ulMode))
-          break;
-
-        if (arg & FD_CLOEXEC)
-          ulMode |= OPEN_FLAGS_NOINHERIT;
-        else
-          ulMode &= ~OPEN_FLAGS_NOINHERIT;
-
-        /* Filter supported flags.  */
-        ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR
-                   | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT);
-
-        if (DosSetFHState (fd, ulMode))
-          break;
-
-        result = 0;
-        break;
-
-      case F_GETFL:
-        result = 0;
-        break;
-
-      case F_SETFL:
-        if (arg != 0)
-          break;
-
-        result = 0;
-        break;
-
-      default :
-        errno = EINVAL;
-        break;
-      }
-  }
-
-  va_end (arg_ptr);
-
-  return result;
-}
-
-# define fcntl klibc_fcntl
+/* Adds support for fcntl on directories.  */
+static int klibc_fcntl (int fd, int action, /* arg */...);
 #endif
 
+
 /* Perform the specified ACTION on the file descriptor FD, possibly
    using the argument ARG further described below.  This replacement
    handles the following actions, and forwards all others on to the
@@ -273,110 +198,35 @@ klibc_fcntl (int fd, int action, /* arg */...)
    return -1 and set errno.  */
 
 int
-rpl_fcntl (int fd, int action, /* arg */...)
+fcntl (int fd, int action, /* arg */...)
+#undef fcntl
+#ifdef __KLIBC__
+# define fcntl klibc_fcntl
+#endif
 {
   va_list arg;
   int result = -1;
   va_start (arg, action);
   switch (action)
     {
-
-#if !HAVE_FCNTL
     case F_DUPFD:
       {
         int target = va_arg (arg, int);
-        result = dupfd (fd, target, 0);
+        result = rpl_fcntl_DUPFD (fd, target);
         break;
       }
-#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
-    case F_DUPFD:
-      {
-        int target = va_arg (arg, int);
-        /* Detect invalid target; needed for cygwin 1.5.x.  */
-        if (target < 0 || getdtablesize () <= target)
-          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);
-# endif
-          }
-        break;
-      } /* F_DUPFD */
-#endif /* FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR */
 
     case F_DUPFD_CLOEXEC:
       {
         int target = va_arg (arg, int);
-
-#if !HAVE_FCNTL
-        result = dupfd (fd, target, O_CLOEXEC);
-        break;
-#else /* HAVE_FCNTL */
-        /* Try the system call first, if the headers claim it exists
-           (that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we
-           may be running with a glibc that has the macro but with an
-           older kernel that does not support it.  Cache the
-           information on whether the system call really works, but
-           avoid caching failure if the corresponding F_DUPFD fails
-           for any reason.  0 = unknown, 1 = yes, -1 = no.  */
-        static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0;
-        if (0 <= have_dupfd_cloexec)
-          {
-            result = fcntl (fd, action, target);
-            if (0 <= result || errno != EINVAL)
-              {
-                have_dupfd_cloexec = 1;
-# if REPLACE_FCHDIR
-                if (0 <= result)
-                  result = _gl_register_dup (fd, result);
-# endif
-              }
-            else
-              {
-                result = rpl_fcntl (fd, F_DUPFD, target);
-                if (result < 0)
-                  break;
-                have_dupfd_cloexec = -1;
-              }
-          }
-        else
-          result = rpl_fcntl (fd, F_DUPFD, target);
-        if (0 <= result && have_dupfd_cloexec == -1)
-          {
-            int flags = fcntl (result, F_GETFD);
-            if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1)
-              {
-                int saved_errno = errno;
-                close (result);
-                errno = saved_errno;
-                result = -1;
-              }
-          }
+        result = rpl_fcntl_DUPFD_CLOEXEC (fd, target);
         break;
-#endif /* HAVE_FCNTL */
-      } /* F_DUPFD_CLOEXEC */
+      }
 
 #if !HAVE_FCNTL
     case F_GETFD:
       {
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
         HANDLE handle = (HANDLE) _get_osfhandle (fd);
         DWORD flags;
         if (handle == INVALID_HANDLE_VALUE
@@ -405,8 +255,183 @@ rpl_fcntl (int fd, int action, /* arg */...)
     default:
       {
 #if HAVE_FCNTL
-        void *p = va_arg (arg, void *);
-        result = fcntl (fd, action, p);
+        switch (action)
+          {
+          #ifdef F_BARRIERFSYNC                  /* macOS */
+          case F_BARRIERFSYNC:
+          #endif
+          #ifdef F_CHKCLEAN                      /* macOS */
+          case F_CHKCLEAN:
+          #endif
+          #ifdef F_CLOSEM                        /* NetBSD, HP-UX */
+          case F_CLOSEM:
+          #endif
+          #ifdef F_FLUSH_DATA                    /* macOS */
+          case F_FLUSH_DATA:
+          #endif
+          #ifdef F_FREEZE_FS                     /* macOS */
+          case F_FREEZE_FS:
+          #endif
+          #ifdef F_FULLFSYNC                     /* macOS */
+          case F_FULLFSYNC:
+          #endif
+          #ifdef F_GETCONFINED                   /* macOS */
+          case F_GETCONFINED:
+          #endif
+          #ifdef F_GETDEFAULTPROTLEVEL           /* macOS */
+          case F_GETDEFAULTPROTLEVEL:
+          #endif
+          #ifdef F_GETFD                         /* POSIX */
+          case F_GETFD:
+          #endif
+          #ifdef F_GETFL                         /* POSIX */
+          case F_GETFL:
+          #endif
+          #ifdef F_GETLEASE                      /* Linux */
+          case F_GETLEASE:
+          #endif
+          #ifdef F_GETNOSIGPIPE                  /* macOS */
+          case F_GETNOSIGPIPE:
+          #endif
+          #ifdef F_GETOWN                        /* POSIX */
+          case F_GETOWN:
+          #endif
+          #ifdef F_GETPIPE_SZ                    /* Linux */
+          case F_GETPIPE_SZ:
+          #endif
+          #ifdef F_GETPROTECTIONCLASS            /* macOS */
+          case F_GETPROTECTIONCLASS:
+          #endif
+          #ifdef F_GETPROTECTIONLEVEL            /* macOS */
+          case F_GETPROTECTIONLEVEL:
+          #endif
+          #ifdef F_GET_SEALS                     /* Linux */
+          case F_GET_SEALS:
+          #endif
+          #ifdef F_GETSIG                        /* Linux */
+          case F_GETSIG:
+          #endif
+          #ifdef F_MAXFD                         /* NetBSD */
+          case F_MAXFD:
+          #endif
+          #ifdef F_RECYCLE                       /* macOS */
+          case F_RECYCLE:
+          #endif
+          #ifdef F_SETFIFOENH                    /* HP-UX */
+          case F_SETFIFOENH:
+          #endif
+          #ifdef F_THAW_FS                       /* macOS */
+          case F_THAW_FS:
+          #endif
+            /* These actions take no argument.  */
+            result = fcntl (fd, action);
+            break;
+
+          #ifdef F_ADD_SEALS                     /* Linux */
+          case F_ADD_SEALS:
+          #endif
+          #ifdef F_BADFD                         /* Solaris */
+          case F_BADFD:
+          #endif
+          #ifdef F_CHECK_OPENEVT                 /* macOS */
+          case F_CHECK_OPENEVT:
+          #endif
+          #ifdef F_DUP2FD                        /* FreeBSD, AIX, Solaris */
+          case F_DUP2FD:
+          #endif
+          #ifdef F_DUP2FD_CLOEXEC                /* FreeBSD, Solaris */
+          case F_DUP2FD_CLOEXEC:
+          #endif
+          #ifdef F_DUP2FD_CLOFORK                /* Solaris */
+          case F_DUP2FD_CLOFORK:
+          #endif
+          #ifdef F_DUPFD                         /* POSIX */
+          case F_DUPFD:
+          #endif
+          #ifdef F_DUPFD_CLOEXEC                 /* POSIX */
+          case F_DUPFD_CLOEXEC:
+          #endif
+          #ifdef F_DUPFD_CLOFORK                 /* Solaris */
+          case F_DUPFD_CLOFORK:
+          #endif
+          #ifdef F_GETXFL                        /* Solaris */
+          case F_GETXFL:
+          #endif
+          #ifdef F_GLOBAL_NOCACHE                /* macOS */
+          case F_GLOBAL_NOCACHE:
+          #endif
+          #ifdef F_MAKECOMPRESSED                /* macOS */
+          case F_MAKECOMPRESSED:
+          #endif
+          #ifdef F_MOVEDATAEXTENTS               /* macOS */
+          case F_MOVEDATAEXTENTS:
+          #endif
+          #ifdef F_NOCACHE                       /* macOS */
+          case F_NOCACHE:
+          #endif
+          #ifdef F_NODIRECT                      /* macOS */
+          case F_NODIRECT:
+          #endif
+          #ifdef F_NOTIFY                        /* Linux */
+          case F_NOTIFY:
+          #endif
+          #ifdef F_OPLKACK                       /* IRIX */
+          case F_OPLKACK:
+          #endif
+          #ifdef F_OPLKREG                       /* IRIX */
+          case F_OPLKREG:
+          #endif
+          #ifdef F_RDAHEAD                       /* macOS */
+          case F_RDAHEAD:
+          #endif
+          #ifdef F_SETBACKINGSTORE               /* macOS */
+          case F_SETBACKINGSTORE:
+          #endif
+          #ifdef F_SETCONFINED                   /* macOS */
+          case F_SETCONFINED:
+          #endif
+          #ifdef F_SETFD                         /* POSIX */
+          case F_SETFD:
+          #endif
+          #ifdef F_SETFL                         /* POSIX */
+          case F_SETFL:
+          #endif
+          #ifdef F_SETLEASE                      /* Linux */
+          case F_SETLEASE:
+          #endif
+          #ifdef F_SETNOSIGPIPE                  /* macOS */
+          case F_SETNOSIGPIPE:
+          #endif
+          #ifdef F_SETOWN                        /* POSIX */
+          case F_SETOWN:
+          #endif
+          #ifdef F_SETPIPE_SZ                    /* Linux */
+          case F_SETPIPE_SZ:
+          #endif
+          #ifdef F_SETPROTECTIONCLASS            /* macOS */
+          case F_SETPROTECTIONCLASS:
+          #endif
+          #ifdef F_SETSIG                        /* Linux */
+          case F_SETSIG:
+          #endif
+          #ifdef F_SINGLE_WRITER                 /* macOS */
+          case F_SINGLE_WRITER:
+          #endif
+            /* These actions take an 'int' argument.  */
+            {
+              int x = va_arg (arg, int);
+              result = fcntl (fd, action, x);
+            }
+            break;
+
+          default:
+            /* Other actions take a pointer argument.  */
+            {
+              void *p = va_arg (arg, void *);
+              result = fcntl (fd, action, p);
+            }
+            break;
+          }
 #else
         errno = EINVAL;
 #endif
@@ -416,3 +441,186 @@ rpl_fcntl (int fd, int action, /* arg */...)
   va_end (arg);
   return result;
 }
+
+static int
+rpl_fcntl_DUPFD (int fd, int target)
+{
+  int result;
+#if !HAVE_FCNTL
+  result = dupfd (fd, target, 0);
+#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
+  /* Detect invalid target; needed for cygwin 1.5.x.  */
+  if (target < 0 || getdtablesize () <= target)
+    {
+      result = -1;
+      errno = EINVAL;
+    }
+  else
+    {
+      /* Haiku alpha 2 loses fd flags on original.  */
+      int flags = fcntl (fd, F_GETFD);
+      if (flags < 0)
+        result = -1;
+      else
+        {
+          result = fcntl (fd, F_DUPFD, 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);
+# endif
+        }
+    }
+#else
+  result = fcntl (fd, F_DUPFD, target);
+#endif
+  return result;
+}
+
+static int
+rpl_fcntl_DUPFD_CLOEXEC (int fd, int target)
+{
+  int result;
+#if !HAVE_FCNTL
+  result = dupfd (fd, target, O_CLOEXEC);
+#else /* HAVE_FCNTL */
+# if defined __HAIKU__
+  /* On Haiku, the system fcntl (fd, F_DUPFD_CLOEXEC, target) sets
+     the FD_CLOEXEC flag on fd, not on target.  Therefore avoid the
+     system fcntl in this case.  */
+#  define have_dupfd_cloexec -1
+# else
+  /* Try the system call first, if the headers claim it exists
+     (that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we
+     may be running with a glibc that has the macro but with an
+     older kernel that does not support it.  Cache the
+     information on whether the system call really works, but
+     avoid caching failure if the corresponding F_DUPFD fails
+     for any reason.  0 = unknown, 1 = yes, -1 = no.  */
+  static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0;
+  if (0 <= have_dupfd_cloexec)
+    {
+      result = fcntl (fd, F_DUPFD_CLOEXEC, target);
+      if (0 <= result || errno != EINVAL)
+        {
+          have_dupfd_cloexec = 1;
+#  if REPLACE_FCHDIR
+          if (0 <= result)
+            result = _gl_register_dup (fd, result);
+#  endif
+        }
+      else
+        {
+          result = rpl_fcntl_DUPFD (fd, target);
+          if (result >= 0)
+            have_dupfd_cloexec = -1;
+        }
+    }
+  else
+# endif
+    result = rpl_fcntl_DUPFD (fd, target);
+  if (0 <= result && have_dupfd_cloexec == -1)
+    {
+      int flags = fcntl (result, F_GETFD);
+      if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1)
+        {
+          int saved_errno = errno;
+          close (result);
+          errno = saved_errno;
+          result = -1;
+        }
+    }
+#endif /* HAVE_FCNTL */
+  return result;
+}
+
+#undef fcntl
+
+#ifdef __KLIBC__
+
+static int
+klibc_fcntl (int fd, int action, /* arg */...);
+{
+  va_list arg_ptr;
+  int arg;
+  struct stat sbuf;
+  int result;
+
+  va_start (arg_ptr, action);
+  arg = va_arg (arg_ptr, int);
+  result = fcntl (fd, action, arg);
+  /* EPERM for F_DUPFD, ENOTSUP for others */
+  if (result == -1 && (errno == EPERM || errno == ENOTSUP)
+      && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
+    {
+      ULONG ulMode;
+
+      switch (action)
+        {
+        case F_DUPFD:
+          /* Find available fd */
+          while (fcntl (arg, F_GETFL) != -1 || errno != EBADF)
+            arg++;
+
+          result = dup2 (fd, arg);
+          break;
+
+        /* Using underlying APIs is right ? */
+        case F_GETFD:
+          if (DosQueryFHState (fd, &ulMode))
+            break;
+
+          result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0;
+          break;
+
+        case F_SETFD:
+          if (arg & ~FD_CLOEXEC)
+            break;
+
+          if (DosQueryFHState (fd, &ulMode))
+            break;
+
+          if (arg & FD_CLOEXEC)
+            ulMode |= OPEN_FLAGS_NOINHERIT;
+          else
+            ulMode &= ~OPEN_FLAGS_NOINHERIT;
+
+          /* Filter supported flags.  */
+          ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR
+                     | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT);
+
+          if (DosSetFHState (fd, ulMode))
+            break;
+
+          result = 0;
+          break;
+
+        case F_GETFL:
+          result = 0;
+          break;
+
+        case F_SETFL:
+          if (arg != 0)
+            break;
+
+          result = 0;
+          break;
+
+        default:
+          errno = EINVAL;
+          break;
+        }
+    }
+
+  va_end (arg_ptr);
+
+  return result;
+}
+
+#endif
index 719a54d0f72590f6315cdafd948440b44faca5f5..a1e7d35c1b9cdeb11ca6758e4aeef8e5612980c2 100644 (file)
@@ -68,7 +68,7 @@
 
 /* Native Windows platforms declare open(), creat() in <io.h>.  */
 #if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
-    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+    && (defined _WIN32 && ! defined __CYGWIN__)
 # include <io.h>
 #endif
 
index 983ade0ffbd9528fe8331480467112ebf8894ee9..a140b7ad9a06946ed0590ad2ed4499fba8edb412 100644 (file)
@@ -33,7 +33,8 @@
 #undef fflush
 
 
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+/* GNU libc, BeOS, Haiku, Linux libc5 */
 
 /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
 static void
@@ -72,7 +73,8 @@ clear_ungetc_buffer (FILE *fp)
 
 #endif
 
-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+#if ! (defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1)
+/* GNU libc, BeOS, Haiku, Linux libc5 */
 
 # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
 /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
@@ -148,7 +150,8 @@ rpl_fflush (FILE *stream)
   if (stream == NULL || ! freading (stream))
     return fflush (stream);
 
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+  /* GNU libc, BeOS, Haiku, Linux libc5 */
 
   clear_ungetc_buffer_preserving_position (stream);
 
index a8127e87792c2427beca909bf18e039a01f268f0..a7ad7e7e0c04000540b7558a4d94adac228d0098 100644 (file)
@@ -28,7 +28,7 @@ extern "C" {
                         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__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
   /* Native Windows, Cygwin, OS/2, DOS */
 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
 # define HAS_DEVICE(P) \
index 452d3b95df21f8ee58bf90617c97eb16a24cfad4..f50ecc138274d307cceb5b732227a31118c7d4be 100644 (file)
 # 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
+/* Concatenate two file name components, DIR and BASE, 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.
+   DIR; ls ./BASE)" refer to the same file.  If necessary, put
+   a separator between DIR and BASE in the result.  Typically this
+   separator is "/", but in rare cases it might be ".".
    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.
+   *BASE_IN_RESULT to point to the copy of BASE at the end of the
+   returned concatenation.
 
    Return NULL if malloc fails.  */
 
 char *
-mfile_name_concat (char const *dir, char const *abase, char **base_in_result)
+mfile_name_concat (char const *dir, char const *base, 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 sep = '\0';
+  if (dirbaselen)
+    {
+      /* DIR is not a file system root, so separate with / if needed.  */
+      if (! ISSLASH (dir[dirlen - 1]) && ! ISSLASH (*base))
+        sep = '/';
+    }
+  else if (ISSLASH (*base))
+    {
+      /* DIR is a file system root and BASE begins with a slash, so
+         separate with ".".  For example, if DIR is "/" and BASE is
+         "/foo" then return "/./foo", as "//foo" would be wrong on
+         some POSIX systems.  A fancier algorithm could omit "." in
+         some cases but is not worth the trouble.  */
+      sep = '.';
+    }
+
+  char *p_concat = malloc (dirlen + (sep != '\0')  + baselen + 1);
   char *p;
 
   if (p_concat == NULL)
     return NULL;
 
   p = mempcpy (p_concat, dir, dirlen);
-  *p = DIRECTORY_SEPARATOR;
-  p += needs_separator;
+  *p = sep;
+  p += sep != '\0';
 
   if (base_in_result)
-    *base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase);
+    *base_in_result = p;
 
   p = mempcpy (p, base, baselen);
   *p = '\0';
index b1d417c7a2b09a7753ca876c61fc12a20bf53246..f9c82cdadd55cd07d5d769b258a8a305ff199b76 100644 (file)
@@ -19,7 +19,7 @@
 /* Specification.  */
 #include <stdio.h>
 
-#if HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7 */
+#if HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7, Android API >= 23 */
 # include <stdio_ext.h>
 #endif
 #include <stdlib.h>
@@ -29,7 +29,7 @@
 int
 fpurge (FILE *fp)
 {
-#if HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7, musl libc */
+#if HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7, Android API >= 23, musl libc */
 
   __fpurge (fp);
   /* The __fpurge function does not have a return value.  */
@@ -62,7 +62,8 @@ fpurge (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_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+  /* GNU libc, BeOS, Haiku, Linux libc5 */
   fp->_IO_read_end = fp->_IO_read_ptr;
   fp->_IO_write_ptr = fp->_IO_write_base;
   /* Avoid memory leak when there is an active ungetc buffer.  */
index 73c28acddfdc48ee5ed00d86d6ef2b919567f459..790f92ca3b359cb124f9455493dc26a9e98f170c 100644 (file)
@@ -31,7 +31,8 @@ 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_EOF_SEEN || 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));
index 29d92b13916f81a7fef8590ceb4384a015d3ad5d..31d71fdb759f98a1b127eb60aaf7e1d21d1c643e 100644 (file)
@@ -33,7 +33,7 @@
    STREAM must not be wide-character oriented.  */
 
 #if HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
-/* Solaris >= 7, not glibc >= 2.2, but glibc >= 2.7, or musl libc  */
+/* Solaris >= 7, Android API >= 29, not glibc >= 2.2, but glibc >= 2.7, or musl libc  */
 
 # include <stdio_ext.h>
 # define freading(stream) (__freading (stream) != 0)
index 56cdc596a6b195cc179102030cb91c27d3eb8e7f..5bd7d66d9029460141e655743df3978ad648a0ab 100644 (file)
@@ -33,9 +33,9 @@ fseeko (FILE *fp, off_t offset, int whence)
 #endif
 #if _GL_WINDOWS_64_BIT_OFF_T
 # undef fseeko
-# if HAVE__FSEEKI64 /* msvc, mingw64 */
+# if HAVE__FSEEKI64 && HAVE_DECL__FSEEKI64 /* msvc, mingw since msvcrt8.0, mingw64 */
 #  define fseeko _fseeki64
-# else /* mingw */
+# else /* mingw before msvcrt8.0 */
 #  define fseeko fseeko64
 # endif
 #endif
@@ -47,7 +47,8 @@ fseeko (FILE *fp, off_t offset, int whence)
 #endif
 
   /* These tests are based on fpurge.c.  */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+  /* GNU libc, BeOS, Haiku, Linux libc5 */
   if (fp->_IO_read_end == fp->_IO_read_ptr
       && fp->_IO_write_ptr == fp->_IO_write_base
       && fp->_IO_save_base == NULL)
@@ -123,7 +124,8 @@ fseeko (FILE *fp, off_t offset, int whence)
           return -1;
         }
 
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || 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__ || defined __ANDROID__
index 82649c3ac1bf139dea7b2a7a6fc0832371a304c0..81f51edade3efb01647d9ea5c120e114d1c2aa93 100644 (file)
 
 #include "stdio-impl.h"
 
+/* This file is not used on systems that have the __fseterr function,
+   namely musl libc.  */
+
 void
 fseterr (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_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+  /* GNU libc, BeOS, Haiku, Linux libc5 */
   fp->_flags |= _IO_ERR_SEEN;
 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
index c143d4613411c266e4916004be189a441c7371fd..41ee7618d22152aeb1acb0c7b6ad796ea00af724 100644 (file)
@@ -25,7 +25,7 @@
 #include <sys/stat.h>
 #undef __need_system_sys_stat_h
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # define WINDOWS_NATIVE
 #endif
 
index a0b12b6ccc7813c62cf2030bf0d1559f3ed00bcc..ecacb0ba25ea1a9b8ecaf822dab32906fa8b9296 100644 (file)
@@ -25,7 +25,7 @@
 #include <config.h>
 #include <unistd.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 /* FlushFileBuffers */
 # define WIN32_LEAN_AND_MEAN
index c6c1136fc55173a3d73c9312c5ce7d616baf46ad..ac05bc483cce1e90cb4c169709e5031beeae7a70 100644 (file)
@@ -20,7 +20,7 @@
 /* Specification.  */
 #include <unistd.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 # include <stdio.h>
 
index 55375ccd40fb1df97ef82cba41226b87298aecdb..11e36eef815b83fa00f39035fabf2fed13f0016d 100644 (file)
@@ -46,7 +46,7 @@
 /* When used standalone, flockfile and funlockfile might not be
    available.  */
 # if (!defined _POSIX_THREAD_SAFE_FUNCTIONS \
-      || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+      || (defined _WIN32 && ! defined __CYGWIN__))
 #  define flockfile(fp) /* nop */
 #  define funlockfile(fp) /* nop */
 # endif
index 88626bf57ae153569d6834e558dd390ed52dda0f..58da144ebad4e89fdd87c599f76f7e87fffa1893 100644 (file)
@@ -110,9 +110,73 @@ getprogname (void)
       first = 0;
       pid_t pid = getpid ();
       struct pst_status status;
-      p = (0 < pstat_getproc (&status, sizeof status, 0, pid)
-           ? strdup (status.pst_ucomm)
-           : NULL);
+      if (pstat_getproc (&status, sizeof status, 0, pid) > 0)
+        {
+          char *ucomm = status.pst_ucomm;
+          char *cmd = status.pst_cmd;
+          if (strlen (ucomm) < PST_UCOMMLEN - 1)
+            p = ucomm;
+          else
+            {
+              /* ucomm is truncated to length PST_UCOMMLEN - 1.
+                 Look at cmd instead.  */
+              char *space = strchr (cmd, ' ');
+              if (space != NULL)
+                *space = '\0';
+              p = strrchr (cmd, '/');
+              if (p != NULL)
+                p++;
+              else
+                p = cmd;
+              if (strlen (p) > PST_UCOMMLEN - 1
+                  && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0)
+                /* p is less truncated than ucomm.  */
+                ;
+              else
+                p = ucomm;
+            }
+          p = strdup (p);
+        }
+      else
+        {
+#  if !defined __LP64__
+          /* Support for 32-bit programs running in 64-bit HP-UX.
+             The documented way to do this is to use the same source code
+             as above, but in a compilation unit where '#define _PSTAT64 1'
+             is in effect.  I prefer a single compilation unit; the struct
+             size and the offsets are not going to change.  */
+          char status64[1216];
+          if (__pstat_getproc64 (status64, sizeof status64, 0, pid) > 0)
+            {
+              char *ucomm = status64 + 288;
+              char *cmd = status64 + 168;
+              if (strlen (ucomm) < PST_UCOMMLEN - 1)
+                p = ucomm;
+              else
+                {
+                  /* ucomm is truncated to length PST_UCOMMLEN - 1.
+                     Look at cmd instead.  */
+                  char *space = strchr (cmd, ' ');
+                  if (space != NULL)
+                    *space = '\0';
+                  p = strrchr (cmd, '/');
+                  if (p != NULL)
+                    p++;
+                  else
+                    p = cmd;
+                  if (strlen (p) > PST_UCOMMLEN - 1
+                      && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0)
+                    /* p is less truncated than ucomm.  */
+                    ;
+                  else
+                    p = ucomm;
+                }
+              p = strdup (p);
+            }
+          else
+#  endif
+            p = NULL;
+        }
       if (!p)
         p = "?";
     }
@@ -182,3 +246,10 @@ getprogname (void)
 }
 
 #endif
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
index f2d7458f4a860c21f866e6e0aa7b2094bbde1423..8eef008e7ce9ba1f02754f3e193030eae570d1e9 100644 (file)
@@ -185,7 +185,7 @@ npgettext_aux (const char *domain,
 #include <string.h>
 
 #if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
-     /* || __STDC_VERSION__ == 199901L
+     /* || (__STDC_VERSION__ == 199901L && !defined __HP_cc)
         || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ )
 # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
 #else
index 9a4e342f18e0cd8a7a922988c9fc0f88baf57f25..bb59c44ff0e432349526646479da115d64cffc99 100644 (file)
 void
 gettime (struct timespec *ts)
 {
-#if HAVE_NANOTIME
-  nanotime (ts);
+#if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME
+  clock_gettime (CLOCK_REALTIME, ts);
 #else
+  struct timeval tv;
+  gettimeofday (&tv, NULL);
+  ts->tv_sec = tv.tv_sec;
+  ts->tv_nsec = tv.tv_usec * 1000;
+#endif
+}
 
-# if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME
-  if (clock_gettime (CLOCK_REALTIME, ts) == 0)
-    return;
-# endif
-
-  {
-    struct timeval tv;
-    gettimeofday (&tv, NULL);
-    ts->tv_sec = tv.tv_sec;
-    ts->tv_nsec = tv.tv_usec * 1000;
-  }
+/* Return the current system time as a struct timespec.  */
 
-#endif
+struct timespec
+current_timespec (void)
+{
+  struct timespec ts;
+  gettime (&ts);
+  return ts;
 }
index 3957565826407650f49c8f48b0b1ebde3886e0eb..1bd50fa3d3603e630d35c4e7a424501df751d032 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <time.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # define WINDOWS_NATIVE
 # include <windows.h>
 #endif
 
 #ifdef WINDOWS_NATIVE
 
+/* Avoid warnings from gcc -Wcast-function-type.  */
+# define GetProcAddress \
+   (void *) GetProcAddress
+
 /* GetSystemTimePreciseAsFileTime was introduced only in Windows 8.  */
 typedef void (WINAPI * GetSystemTimePreciseAsFileTimeFuncType) (FILETIME *lpTime);
 static GetSystemTimePreciseAsFileTimeFuncType GetSystemTimePreciseAsFileTimeFunc = NULL;
@@ -45,7 +49,7 @@ initialize (void)
   if (kernel32 != NULL)
     {
       GetSystemTimePreciseAsFileTimeFunc =
-       (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime");
+        (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime");
     }
   initialized = TRUE;
 }
index 34ff109680b1305838e903d163a916249fa31781..30aa730b1d249ea0d07f78a4d756e6d7202a48dc 100644 (file)
@@ -149,8 +149,14 @@ extern int glthread_in_use (void);
 #  endif
 
 #  if !PTHREAD_IN_USE_DETECTION_HARD
-#   pragma weak pthread_cancel
-#   define pthread_in_use() (pthread_cancel != NULL)
+    /* Considering all platforms with USE_POSIX_THREADS_WEAK, only few symbols
+       can be used to determine whether libpthread is in use.  These are:
+         pthread_mutexattr_gettype
+         pthread_rwlockattr_destroy
+         pthread_rwlockattr_init
+     */
+#   pragma weak pthread_mutexattr_gettype
+#   define pthread_in_use() (pthread_mutexattr_gettype != NULL)
 #  endif
 
 # else
index b8bdfbb9215ef55fb1a48864c21ee09ccf40917a..7c73cc36f6b4bf38d8703130cefe24acc7a67b74 100644 (file)
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --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 dirname-lgpl dosname fclose fcntl fcntl-safer fdatasync fdl fdopendir fprintf-posix fsync getopt-gnu git-version-gen gitlog-to-changelog gnu-make gnu-web-doc-update gnumakefile gnupload ignore-value intprops largefile lib-ignore lstat maintainer-makefile malloc-gnu manywarnings openat-safer perror printf-posix readme-release realloc-gnu savedir stat-time stdnoreturn sys_stat time unistd-safer unlinkat update-copyright utimens verify xalloc year2038 yesno
+# Reproduce by:
+# gnulib-tool --import --local-dir=gl \
+#  --lib=libgzip \
+#  --source-base=lib \
+#  --m4-base=m4 \
+#  --doc-base=doc \
+#  --tests-base=tests \
+#  --aux-dir=build-aux \
+#  --makefile-name=gnulib.mk \
+#  --no-conditional-dependencies \
+#  --no-libtool \
+#  --macro-prefix=gl \
+#  --avoid=getline \
+#  --avoid=rpmatch \
+#  announce-gen \
+#  calloc \
+#  close \
+#  dirname-lgpl \
+#  dosname \
+#  fclose \
+#  fcntl \
+#  fcntl-safer \
+#  fdatasync \
+#  fdl \
+#  fdopendir \
+#  fprintf-posix \
+#  fsync \
+#  getopt-gnu \
+#  git-version-gen \
+#  gitlog-to-changelog \
+#  gnu-make \
+#  gnu-web-doc-update \
+#  gnumakefile \
+#  gnupload \
+#  ignore-value \
+#  intprops \
+#  largefile \
+#  lib-ignore \
+#  lstat \
+#  maintainer-makefile \
+#  malloc-gnu \
+#  manywarnings \
+#  openat-safer \
+#  perror \
+#  printf-posix \
+#  readme-release \
+#  realloc-gnu \
+#  savedir \
+#  sigaction \
+#  stat-time \
+#  stdnoreturn \
+#  sys_stat \
+#  time \
+#  unistd-safer \
+#  unlinkat \
+#  update-copyright \
+#  utimens \
+#  verify \
+#  xalloc \
+#  year2038 \
+#  yesno
 
 
 MOSTLYCLEANFILES += core *.stackdump
@@ -609,7 +669,7 @@ BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_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 $(top_builddir)/config.status
+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|@''GUARD_PREFIX''@|GL|g' \
@@ -853,7 +913,7 @@ EXTRA_libgzip_a_SOURCES += malloc.c
 
 libgzip_a_SOURCES += malloca.c
 
-EXTRA_DIST += malloca.h malloca.valgrind
+EXTRA_DIST += malloca.h
 
 ## end   gnulib module malloca
 
@@ -1290,6 +1350,15 @@ EXTRA_libgzip_a_SOURCES += printf.c
 
 ## end   gnulib module printf-posix
 
+## begin gnulib module raise
+
+
+EXTRA_DIST += raise.c
+
+EXTRA_libgzip_a_SOURCES += raise.c
+
+## end   gnulib module raise
+
 ## begin gnulib module readdir
 
 
@@ -1342,6 +1411,58 @@ EXTRA_DIST += savedir.h
 
 ## end   gnulib module savedir
 
+## begin gnulib module sigaction
+
+libgzip_a_SOURCES += sig-handler.c
+
+EXTRA_DIST += sig-handler.h sigaction.c
+
+EXTRA_libgzip_a_SOURCES += sigaction.c
+
+## end   gnulib module sigaction
+
+## begin gnulib module signal-h
+
+BUILT_SOURCES += signal.h
+
+# We need the following in order to create <signal.h> when the system
+# doesn't have a complete one.
+signal.h: signal.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|@''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_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
+             -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GNULIB_PTHREAD_SIGMASK)/g' \
+             -e 's/@''GNULIB_RAISE''@/$(GNULIB_RAISE)/g' \
+             -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
+             -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \
+             -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \
+             -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \
+             -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \
+             -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \
+             -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \
+             -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \
+             -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \
+             -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
+             -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \
+             -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \
+             -e 's|@''REPLACE_RAISE''@|$(REPLACE_RAISE)|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)/signal.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += signal.h signal.h-t
+
+EXTRA_DIST += signal.in.h
+
+## end   gnulib module signal-h
+
 ## begin gnulib module signbit
 
 
@@ -1351,6 +1472,15 @@ EXTRA_libgzip_a_SOURCES += signbitd.c signbitf.c signbitl.c
 
 ## end   gnulib module signbit
 
+## begin gnulib module sigprocmask
+
+
+EXTRA_DIST += sigprocmask.c
+
+EXTRA_libgzip_a_SOURCES += sigprocmask.c
+
+## end   gnulib module sigprocmask
+
 ## begin gnulib module size_max
 
 libgzip_a_SOURCES += size_max.h
@@ -2189,6 +2319,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -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_GETPASS''@/$(GNULIB_GETPASS)/g' \
              -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
              -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
              -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
@@ -2232,6 +2363,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
+             -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \
              -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
              -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
              -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
@@ -2246,7 +2378,6 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
              -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \
              -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \
-             -e 's|@''HAVE_TRUNCATE''@|$(HAVE_TRUNCATE)|g' \
              -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
              -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
@@ -2258,6 +2389,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -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_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|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' \
@@ -2275,6 +2407,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -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_GETPASS''@|$(REPLACE_GETPASS)|g' \
              -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
              -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
@@ -2364,7 +2497,7 @@ BUILT_SOURCES += $(UTIME_H)
 # We need the following in order to create <utime.h> when the system
 # doesn't have one that works with the given compiler.
 if GL_GENERATE_UTIME_H
-utime.h: utime.in.h $(top_builddir)/config.status
+utime.h: utime.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|@''GUARD_PREFIX''@|GL|g' \
index 15e470cbc6eaa143c9756d0e2047217ae7b8eec6..cdaf6586cb6daf51b096c87c26f6030cd64d9971 100644 (file)
 
 #include <limits.h>
 
-/* Return a value with the common real type of E and V and the value of V.  */
-#define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
+/* Return a value with the common real type of E and V and the value of V.
+   Do not evaluate E.  */
+#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
 
 /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
    <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>.  */
-#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v))
+#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v))
 
 /* The extra casts in the following macros work around compiler bugs,
    e.g., in Cray C 5.0.3.0.  */
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
 
 /* Return 1 if the real expression E, after promotion, has a
-   signed or floating type.  */
+   signed or floating type.  Do not evaluate E.  */
 #define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
 
 
 /* Minimum and maximum values for integer types and expressions.  */
 
 /* The width in bits of the integer type or expression T.
+   Do not evaluate T.
    Padding bits are not supported; this is checked at compile-time below.  */
 #define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
 
@@ -58,7 +60,7 @@
         : ((((t) 1 << (TYPE_WIDTH (t) - 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.  */
+   after integer promotion.  E is not evaluated.  */
 #define _GL_INT_MINIMUM(e)                                              \
   (EXPR_SIGNED (e)                                                      \
    ? ~ _GL_SIGNED_INT_MAXIMUM (e)                                       \
    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)))
+                      _GL_INT_MINIMUM (_GL_INT_CONVERT (a, b)), \
+                      _GL_INT_MAXIMUM (_GL_INT_CONVERT (a, b)))
 
 /* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
    Return 1 if the result overflows.  See above for restrictions.  */
index 2c809d97ac4f76a08b255ca6a38471a127a2b330..89d7195488a62e5993cc87a5ef59a002cf84052e 100644 (file)
 #ifndef _@GUARD_PREFIX@_LIMITS_H
 #define _@GUARD_PREFIX@_LIMITS_H
 
-/* For HP-UX 11.31.  */
-#if defined LONG_LONG_MIN && !defined LLONG_MIN
-# define LLONG_MIN LONG_LONG_MIN
+#ifndef LLONG_MIN
+# if defined LONG_LONG_MIN /* HP-UX 11.31 */
+#  define LLONG_MIN LONG_LONG_MIN
+# elif defined LONGLONG_MIN /* IRIX 6.5 */
+#  define LLONG_MIN LONGLONG_MIN
+# elif defined __GNUC__
+#  define LLONG_MIN (- __LONG_LONG_MAX__ - 1LL)
+# endif
 #endif
-#if defined LONG_LONG_MAX && !defined LLONG_MAX
-# define LLONG_MAX LONG_LONG_MAX
+#ifndef LLONG_MAX
+# if defined LONG_LONG_MAX /* HP-UX 11.31 */
+#  define LLONG_MAX LONG_LONG_MAX
+# elif defined LONGLONG_MAX /* IRIX 6.5 */
+#  define LLONG_MAX LONGLONG_MAX
+# elif defined __GNUC__
+#  define LLONG_MAX __LONG_LONG_MAX__
+# endif
 #endif
-#if defined ULONG_LONG_MAX && !defined ULLONG_MAX
-# define ULLONG_MAX ULONG_LONG_MAX
+#ifndef ULLONG_MAX
+# if defined ULONG_LONG_MAX /* HP-UX 11.31 */
+#  define ULLONG_MAX ULONG_LONG_MAX
+# elif defined ULONGLONG_MAX /* IRIX 6.5 */
+#  define ULLONG_MAX ULONGLONG_MAX
+# elif defined __GNUC__
+#  define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL)
+# endif
 #endif
 
 /* The number of usable bits in an unsigned or signed integer type
 #define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
 #define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
 
+#ifndef WORD_BIT
+/* Assume 'int' is 32 bits wide.  */
+# define WORD_BIT 32
+#endif
+#ifndef LONG_BIT
+/* Assume 'long' is 32 or 64 bits wide.  */
+# if LONG_MAX == INT_MAX
+#  define LONG_BIT 32
+# else
+#  define LONG_BIT 64
+# endif
+#endif
+
 /* Macros specified by ISO/IEC TS 18661-1:2014.  */
 
 #if (! defined ULLONG_WIDTH                                             \
index df11f4321dbe090a2d7cd2560c3a531d24a98596..910c8bcfed30a78903606eb002275705ef2f3479 100644 (file)
@@ -34,6 +34,7 @@ struct tm *localtime_buffer_addr = &tm_zero_buffer;
 
 struct tm *
 rpl_localtime (time_t const *timep)
+#undef localtime
 {
   struct tm *tm = localtime (timep);
 
@@ -46,6 +47,7 @@ rpl_localtime (time_t const *timep)
 /* Same as above, since gmtime and localtime use the same buffer.  */
 struct tm *
 rpl_gmtime (time_t const *timep)
+#undef gmtime
 {
   struct tm *tm = gmtime (timep);
 
index e37aadffd29640346ba4c2c57e926b1194ba4a19..9125b9805dfb46ff4d5e02eb82fedede6aed319d 100644 (file)
@@ -19,7 +19,7 @@
 /* Specification.  */
 #include <unistd.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Windows platforms.  */
 /* Get GetFileType.  */
 # include <windows.h>
@@ -39,7 +39,7 @@
 off_t
 rpl_lseek (int fd, off_t offset, int whence)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* mingw lseek mistakenly succeeds on pipes, sockets, and terminals.  */
   HANDLE h = (HANDLE) _get_osfhandle (fd);
   if (h == INVALID_HANDLE_VALUE)
index ebf7a4c57f92ebeb5404e41bdbd72f501821f1ab..c54e1e0f9b74df47dd7a59a392e40ef22c64ac40 100644 (file)
@@ -1,6 +1,6 @@
 /* Safe automatic memory allocation.
    Copyright (C) 2003, 2006-2007, 2009-2018 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2003.
+   Written by Bruno Haible <bruno@clisp.org>, 2003, 2018.
 
    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 "malloca.h"
 
-#include <stdint.h>
-
 #include "verify.h"
 
-/* Silence a warning from clang's MemorySanitizer.  */
-#if defined __has_feature
-# if __has_feature(memory_sanitizer)
-#  define NO_SANITIZE_MEMORY __attribute__((no_sanitize("memory")))
-# endif
-#endif
-#ifndef NO_SANITIZE_MEMORY
-# define NO_SANITIZE_MEMORY
-#endif
-
 /* The speed critical point in this file is freea() applied to an alloca()
    result: it must be fast, to match the speed of alloca().  The speed of
    mmalloca() and freea() in the other case are not critical, because they
-   are only invoked for big memory sizes.  */
-
-#if HAVE_ALLOCA
-
-/* Store the mmalloca() results in a hash table.  This is needed to reliably
-   distinguish a mmalloca() result and an alloca() result.
-
-   Although it is possible that the same pointer is returned by alloca() and
-   by mmalloca() at different times in the same application, it does not lead
-   to a bug in freea(), because:
-     - Before a pointer returned by alloca() can point into malloc()ed memory,
-       the function must return, and once this has happened the programmer must
-       not call freea() on it anyway.
-     - Before a pointer returned by mmalloca() can point into the stack, it
-       must be freed.  The only function that can free it is freea(), and
-       when freea() frees it, it also removes it from the hash table.  */
-
-#define MAGIC_NUMBER 0x1415fb4a
-#define MAGIC_SIZE sizeof (int)
-/* This is how the header info would look like without any alignment
-   considerations.  */
-struct preliminary_header { void *next; int magic; };
-/* But the header's size must be a multiple of sa_alignment_max.  */
-#define HEADER_SIZE \
-  (((sizeof (struct preliminary_header) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max)
-union header {
-  void *next;
-  struct {
-    char room[HEADER_SIZE - MAGIC_SIZE];
-    int word;
-  } magic;
-};
-verify (HEADER_SIZE == sizeof (union header));
-/* We make the hash table quite big, so that during lookups the probability
-   of empty hash buckets is quite high.  There is no need to make the hash
-   table resizable, because when the hash table gets filled so much that the
-   lookup becomes slow, it means that the application has memory leaks.  */
-#define HASH_TABLE_SIZE 257
-static void * mmalloca_results[HASH_TABLE_SIZE];
-
-#endif
+   are only invoked for big memory sizes.
+   Here we use a bit in the address as an indicator, an idea by OndÅ™ej Bílka.
+   malloca() can return three types of pointers:
+     - Pointers â‰¡ 0 mod 2*sa_alignment_max come from stack allocation.
+     - Pointers â‰¡ sa_alignment_max mod 2*sa_alignment_max come from heap
+       allocation.
+     - NULL comes from a failed heap allocation.  */
+
+/* Type for holding very small pointer differences.  */
+typedef unsigned char small_t;
+/* Verify that it is wide enough.  */
+verify (2 * sa_alignment_max - 1 <= (small_t) -1);
 
 void *
 mmalloca (size_t n)
 {
 #if HAVE_ALLOCA
-  /* Allocate one more word, that serves as an indicator for malloc()ed
-     memory, so that freea() of an alloca() result is fast.  */
-  size_t nplus = n + HEADER_SIZE;
+  /* Allocate one more word, used to determine the address to pass to freea(),
+     and room for the alignment â‰¡ sa_alignment_max mod 2*sa_alignment_max.  */
+  size_t nplus = n + sizeof (small_t) + 2 * sa_alignment_max - 1;
 
   if (nplus >= n)
     {
-      void *p = malloc (nplus);
+      char *mem = (char *) malloc (nplus);
 
-      if (p != NULL)
+      if (mem != NULL)
         {
-          size_t slot;
-          union header *h = p;
-
-          p = h + 1;
-
-          /* Put a magic number into the indicator word.  */
-          h->magic.word = MAGIC_NUMBER;
-
-          /* Enter p into the hash table.  */
-          slot = (uintptr_t) p % HASH_TABLE_SIZE;
-          h->next = mmalloca_results[slot];
-          mmalloca_results[slot] = p;
-
+          char *p =
+            (char *)((((uintptr_t)mem + sizeof (small_t) + sa_alignment_max - 1)
+                      & ~(uintptr_t)(2 * sa_alignment_max - 1))
+                     + sa_alignment_max);
+          /* Here p >= mem + sizeof (small_t),
+             and p <= mem + sizeof (small_t) + 2 * sa_alignment_max - 1
+             hence p + n <= mem + nplus.
+             So, the memory range [p, p+n) lies in the allocated memory range
+             [mem, mem + nplus).  */
+          ((small_t *) p)[-1] = p - mem;
+          /* p â‰¡ sa_alignment_max mod 2*sa_alignment_max.  */
           return p;
         }
     }
@@ -122,38 +79,27 @@ mmalloca (size_t n)
 }
 
 #if HAVE_ALLOCA
-void NO_SANITIZE_MEMORY
+void
 freea (void *p)
 {
-  /* mmalloca() may have returned NULL.  */
-  if (p != NULL)
+  /* Check argument.  */
+  if ((uintptr_t) p & (sa_alignment_max - 1))
     {
-      /* Attempt to quickly distinguish the mmalloca() result - which has
-         a magic indicator word - and the alloca() result - which has an
-         uninitialized indicator word.  It is for this test that sa_increment
-         additional bytes are allocated in the alloca() case.  */
-      if (((int *) p)[-1] == MAGIC_NUMBER)
-        {
-          /* Looks like a mmalloca() result.  To see whether it really is one,
-             perform a lookup in the hash table.  */
-          size_t slot = (uintptr_t) p % HASH_TABLE_SIZE;
-          void **chain = &mmalloca_results[slot];
-          for (; *chain != NULL;)
-            {
-              union header *h = p;
-              if (*chain == p)
-                {
-                  /* Found it.  Remove it from the hash table and free it.  */
-                  union header *p_begin = h - 1;
-                  *chain = p_begin->next;
-                  free (p_begin);
-                  return;
-                }
-              h = *chain;
-              chain = &h[-1].next;
-            }
-        }
-      /* At this point, we know it was not a mmalloca() result.  */
+      /* p was not the result of a malloca() call.  Invalid argument.  */
+      abort ();
+    }
+  /* Determine whether p was a non-NULL pointer returned by mmalloca().  */
+  if ((uintptr_t) p & sa_alignment_max)
+    {
+      void *mem = (char *) p - ((small_t *) p)[-1];
+      free (mem);
     }
 }
 #endif
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
index 499e82209175b5ab17694efb2b942bcc529cedcf..1e47813ff48b96d20f9b639e9743b0b873cfff12 100644 (file)
@@ -56,8 +56,10 @@ extern "C" {
    the function returns.  Upon failure, it returns NULL.  */
 #if HAVE_ALLOCA
 # define malloca(N) \
-  ((N) < 4032 - sa_increment                                        \
-   ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \
+  ((N) < 4032 - (2 * sa_alignment_max - 1)                                   \
+   ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \
+                + (2 * sa_alignment_max - 1))                                \
+               & ~(uintptr_t)(2 * sa_alignment_max - 1))                     \
    : mmalloca (N))
 #else
 # define malloca(N) \
@@ -119,10 +121,7 @@ enum
                       | (sa_alignment_longlong - 1)
 #endif
                       | (sa_alignment_longdouble - 1)
-                     ) + 1,
-/* The increment that guarantees room for a magic word must be >= sizeof (int)
-   and a multiple of sa_alignment_max.  */
-  sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max
+                     ) + 1
 };
 
 #endif /* _MALLOCA_H */
diff --git a/lib/malloca.valgrind b/lib/malloca.valgrind
deleted file mode 100644 (file)
index 52f0a50..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Suppress a valgrind message about use of uninitialized memory in freea().
-# This use is OK because it provides only a speedup.
-{
-    freea
-    Memcheck:Cond
-    fun:freea
-}
index 053d4e1b85cee6183acd8a57ffd4de7c4f4499be..c30fc202c0d31b7df331a9910dae0842511589ba 100644 (file)
@@ -92,27 +92,27 @@ _GL_END_NAMESPACE
    classification macros with an argument of real-floating (that is,
    one of float, double, or long double).  */
 #define _GL_WARN_REAL_FLOATING_DECL(func) \
-_GL_MATH_INLINE int                                                 \
-rpl_ ## func ## f (float f)                                         \
-{                                                                   \
-  return func (f);                                                  \
-}                                                                   \
-_GL_MATH_INLINE int                                                 \
-rpl_ ## func ## d (double d)                                        \
-{                                                                   \
-  return func (d);                                                  \
-}                                                                   \
-_GL_MATH_INLINE int                                                 \
-rpl_ ## func ## l (long double l)                                   \
-{                                                                   \
-  return func (l);                                                  \
-}                                                                   \
-_GL_WARN_ON_USE (rpl_ ## func ## f, #func " is unportable - "       \
-                 "use gnulib module " #func " for portability");    \
-_GL_WARN_ON_USE (rpl_ ## func ## d, #func " is unportable - "       \
-                 "use gnulib module " #func " for portability");    \
-_GL_WARN_ON_USE (rpl_ ## func ## l, #func " is unportable - "       \
-                 "use gnulib module " #func " for portability")
+_GL_MATH_INLINE int                                                       \
+_GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - "                      \
+                           "use gnulib module " #func " for portability") \
+rpl_ ## func ## f (float f)                                               \
+{                                                                         \
+  return func (f);                                                        \
+}                                                                         \
+_GL_MATH_INLINE int                                                       \
+_GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - "                      \
+                           "use gnulib module " #func " for portability") \
+rpl_ ## func ## d (double d)                                              \
+{                                                                         \
+  return func (d);                                                        \
+}                                                                         \
+_GL_MATH_INLINE int                                                       \
+_GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - "                      \
+                           "use gnulib module " #func " for portability") \
+rpl_ ## func ## l (long double l)                                         \
+{                                                                         \
+  return func (l);                                                        \
+}
 #define _GL_WARN_REAL_FLOATING_IMPL(func, value) \
   (sizeof (value) == sizeof (float) ? rpl_ ## func ## f (value)     \
    : sizeof (value) == sizeof (double) ? rpl_ ## func ## d (value)  \
index 99acfd9c56d98cd7a02922d8d715308720390eb5..2efc7cb97521db78157e364378710bf6579e7de7 100644 (file)
@@ -68,7 +68,7 @@ __memrchr (void const *s, int c_in, size_t n)
     if (*--char_ptr == c)
       return (void *) char_ptr;
 
-  longword_ptr = (const longword *) char_ptr;
+  longword_ptr = (const void *) char_ptr;
 
   /* All these elucidatory comments refer to 4-byte longwords,
      but the theory applies equally well to any size longwords.  */
index f7a7f8a0afa866e72cfd761e70d4518d9e4f464b..a9671c3b641e23dd50730f5f3110ed7443e386f3 100644 (file)
@@ -25,7 +25,7 @@
    This file defines wrappers that turn such an invalid parameter notification
    into an error code.  */
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 /* Get original declaration of _get_osfhandle.  */
 # include <io.h>
index b344f13a92ac64cfcb3e9c4af3b316d4ae1f4456..792e258ba0b09199346fc053356c6cf3e3b6d73a 100644 (file)
@@ -86,7 +86,7 @@ open (const char *filename, int flags, ...)
   flags &= ~O_NONBLOCK;
 #endif
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   if (strcmp (filename, "/dev/null") == 0)
     filename = "NUL";
 #endif
index 1eafb49d52e97afa52334b92b0e026cfd5979449..7052e6a84e90db90ec8186fa748042f9e311283b 100644 (file)
@@ -65,7 +65,7 @@
 #  define PATH_MAX 1024
 # endif
 
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 /* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com,
    section "Maximum Path Length Limitation",
    <https://msdn.microsoft.com/en-us/library/aa365247.aspx#maxpath>
index ee5c3be4bba7737d82b601927cdc3d645c9ec9f9..e6251458fd916d6fd57a669b8d77c966289a5ea1 100644 (file)
@@ -419,7 +419,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                       cp++;
                     }
 #endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
                   /* 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.  */
diff --git a/lib/raise.c b/lib/raise.c
new file mode 100644 (file)
index 0000000..8a93bea
--- /dev/null
@@ -0,0 +1,83 @@
+/* Provide a non-threads replacement for the POSIX raise function.
+
+   Copyright (C) 2002-2003, 2005-2006, 2009-2018 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 <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering and Bruno Haible */
+
+#include <config.h>
+
+/* Specification.  */
+#include <signal.h>
+
+#if HAVE_RAISE
+/* Native Windows platform.  */
+
+# include <errno.h>
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+#  include "msvc-inval.h"
+# endif
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+/* Forward declaration.  */
+static int raise_nothrow (int sig);
+# else
+#  define raise_nothrow raise
+# endif
+
+#else
+/* An old Unix platform.  */
+
+# include <unistd.h>
+
+#endif
+
+int
+raise (int sig)
+#undef raise
+{
+#if GNULIB_defined_signal_blocking && GNULIB_defined_SIGPIPE
+  if (sig == SIGPIPE)
+    return _gl_raise_SIGPIPE ();
+#endif
+
+#if HAVE_RAISE
+  return raise_nothrow (sig);
+#else
+  return kill (getpid (), sig);
+#endif
+}
+
+#if HAVE_RAISE && HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+raise_nothrow (int sig)
+{
+  int result;
+
+  TRY_MSVC_INVAL
+    {
+      result = raise (sig);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = -1;
+      errno = EINVAL;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+#endif
diff --git a/lib/sig-handler.c b/lib/sig-handler.c
new file mode 100644 (file)
index 0000000..52c3621
--- /dev/null
@@ -0,0 +1,3 @@
+#include <config.h>
+#define SIG_HANDLER_INLINE _GL_EXTERN_INLINE
+#include "sig-handler.h"
diff --git a/lib/sig-handler.h b/lib/sig-handler.h
new file mode 100644 (file)
index 0000000..9ea3394
--- /dev/null
@@ -0,0 +1,51 @@
+/* Convenience declarations when working with <signal.h>.
+
+   Copyright (C) 2008-2018 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 <https://www.gnu.org/licenses/>.  */
+
+#ifndef _GL_SIG_HANDLER_H
+#define _GL_SIG_HANDLER_H
+
+#include <signal.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef SIG_HANDLER_INLINE
+# define SIG_HANDLER_INLINE _GL_INLINE
+#endif
+
+/* Convenience type when working with signal handlers.  */
+typedef void (*sa_handler_t) (int);
+
+/* Return the handler of a signal, as a sa_handler_t value regardless
+   of its true type.  The resulting function can be compared to
+   special values like SIG_IGN but it is not portable to call it.  */
+SIG_HANDLER_INLINE sa_handler_t _GL_ATTRIBUTE_PURE
+get_handler (struct sigaction const *a)
+{
+  /* POSIX says that special values like SIG_IGN can only occur when
+     action.sa_flags does not contain SA_SIGINFO.  But in Linux 2.4,
+     for example, sa_sigaction and sa_handler are aliases and a signal
+     is ignored if sa_sigaction (after casting) equals SIG_IGN.  In
+     this case, this implementation relies on the fact that the two
+     are aliases, and simply returns sa_handler.  */
+  return a->sa_handler;
+}
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_SIG_HANDLER_H */
diff --git a/lib/sigaction.c b/lib/sigaction.c
new file mode 100644 (file)
index 0000000..7e4af5f
--- /dev/null
@@ -0,0 +1,204 @@
+/* POSIX compatible signal blocking.
+   Copyright (C) 2008-2018 Free Software Foundation, Inc.
+   Written by Eric Blake <ebb9@byu.net>, 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 <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <signal.h>
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+/* This implementation of sigaction is tailored to native Windows behavior:
+   signal() has SysV semantics (ie. the handler is uninstalled before
+   it is invoked).  This is an inherent data race if an asynchronous
+   signal is sent twice in a row before we can reinstall our handler,
+   but there's nothing we can do about it.  Meanwhile, sigprocmask()
+   is not present, and while we can use the gnulib replacement to
+   provide critical sections, it too suffers from potential data races
+   in the face of an ill-timed asynchronous signal.  And we compound
+   the situation by reading static storage in a signal handler, which
+   POSIX warns is not generically async-signal-safe.  Oh well.
+
+   Additionally:
+     - We don't implement SA_NOCLDSTOP or SA_NOCLDWAIT, because SIGCHLD
+       is not defined.
+     - We don't implement SA_ONSTACK, because sigaltstack() is not present.
+     - We ignore SA_RESTART, because blocking native Windows API calls are
+       not interrupted anyway when an asynchronous signal occurs, and the
+       MSVCRT runtime never sets errno to EINTR.
+     - We don't implement SA_SIGINFO because it is impossible to do so
+       portably.
+
+   POSIX states that an application should not mix signal() and
+   sigaction().  We support the use of signal() within the gnulib
+   sigprocmask() substitute, but all other application code linked
+   with this module should stick with only sigaction().  */
+
+/* Check some of our assumptions.  */
+#if defined SIGCHLD || defined HAVE_SIGALTSTACK || defined HAVE_SIGINTERRUPT
+# error "Revisit the assumptions made in the sigaction module"
+#endif
+
+/* Out-of-range substitutes make a good fallback for uncatchable
+   signals.  */
+#ifndef SIGKILL
+# define SIGKILL (-1)
+#endif
+#ifndef SIGSTOP
+# define SIGSTOP (-1)
+#endif
+
+/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias
+   for the signal SIGABRT.  Only one signal handler is stored for both
+   SIGABRT and SIGABRT_COMPAT.  SIGABRT_COMPAT is not a signal of its own.  */
+#if defined _WIN32 && ! defined __CYGWIN__
+# undef SIGABRT_COMPAT
+# define SIGABRT_COMPAT 6
+#endif
+
+/* A signal handler.  */
+typedef void (*handler_t) (int signal);
+
+/* Set of current actions.  If sa_handler for an entry is NULL, then
+   that signal is not currently handled by the sigaction handler.  */
+static struct sigaction volatile action_array[NSIG] /* = 0 */;
+
+/* Signal handler that is installed for signals.  */
+static void
+sigaction_handler (int sig)
+{
+  handler_t handler;
+  sigset_t mask;
+  sigset_t oldmask;
+  int saved_errno = errno;
+  if (sig < 0 || NSIG <= sig || !action_array[sig].sa_handler)
+    {
+      /* Unexpected situation; be careful to avoid recursive abort.  */
+      if (sig == SIGABRT)
+        signal (SIGABRT, SIG_DFL);
+      abort ();
+    }
+
+  /* Reinstall the signal handler when required; otherwise update the
+     bookkeeping so that the user's handler may call sigaction and get
+     accurate results.  We know the signal isn't currently blocked, or
+     we wouldn't be in its handler, therefore we know that we are not
+     interrupting a sigaction() call.  There is a race where any
+     asynchronous instance of the same signal occurring before we
+     reinstall the handler will trigger the default handler; oh
+     well.  */
+  handler = action_array[sig].sa_handler;
+  if ((action_array[sig].sa_flags & SA_RESETHAND) == 0)
+    signal (sig, sigaction_handler);
+  else
+    action_array[sig].sa_handler = NULL;
+
+  /* Block appropriate signals.  */
+  mask = action_array[sig].sa_mask;
+  if ((action_array[sig].sa_flags & SA_NODEFER) == 0)
+    sigaddset (&mask, sig);
+  sigprocmask (SIG_BLOCK, &mask, &oldmask);
+
+  /* Invoke the user's handler, then restore prior mask.  */
+  errno = saved_errno;
+  handler (sig);
+  saved_errno = errno;
+  sigprocmask (SIG_SETMASK, &oldmask, NULL);
+  errno = saved_errno;
+}
+
+/* Change and/or query the action that will be taken on delivery of
+   signal SIG.  If not NULL, ACT describes the new behavior.  If not
+   NULL, OACT is set to the prior behavior.  Return 0 on success, or
+   set errno and return -1 on failure.  */
+int
+sigaction (int sig, const struct sigaction *restrict act,
+           struct sigaction *restrict oact)
+{
+  sigset_t mask;
+  sigset_t oldmask;
+  int saved_errno;
+
+  if (sig < 0 || NSIG <= sig || sig == SIGKILL || sig == SIGSTOP
+      || (act && act->sa_handler == SIG_ERR))
+    {
+      errno = EINVAL;
+      return -1;
+    }
+
+#ifdef SIGABRT_COMPAT
+  if (sig == SIGABRT_COMPAT)
+    sig = SIGABRT;
+#endif
+
+  /* POSIX requires sigaction() to be async-signal-safe.  In other
+     words, if an asynchronous signal can occur while we are anywhere
+     inside this function, the user's handler could then call
+     sigaction() recursively and expect consistent results.  We meet
+     this rule by using sigprocmask to block all signals before
+     modifying any data structure that could be read from a signal
+     handler; this works since we know that the gnulib sigprocmask
+     replacement does not try to use sigaction() from its handler.  */
+  if (!act && !oact)
+    return 0;
+  sigfillset (&mask);
+  sigprocmask (SIG_BLOCK, &mask, &oldmask);
+  if (oact)
+    {
+      if (action_array[sig].sa_handler)
+        *oact = action_array[sig];
+      else
+        {
+          /* Safe to change the handler at will here, since all
+             signals are currently blocked.  */
+          oact->sa_handler = signal (sig, SIG_DFL);
+          if (oact->sa_handler == SIG_ERR)
+            goto failure;
+          signal (sig, oact->sa_handler);
+          oact->sa_flags = SA_RESETHAND | SA_NODEFER;
+          sigemptyset (&oact->sa_mask);
+        }
+    }
+
+  if (act)
+    {
+      /* Safe to install the handler before updating action_array,
+         since all signals are currently blocked.  */
+      if (act->sa_handler == SIG_DFL || act->sa_handler == SIG_IGN)
+        {
+          if (signal (sig, act->sa_handler) == SIG_ERR)
+            goto failure;
+          action_array[sig].sa_handler = NULL;
+        }
+      else
+        {
+          if (signal (sig, sigaction_handler) == SIG_ERR)
+            goto failure;
+          action_array[sig] = *act;
+        }
+    }
+  sigprocmask (SIG_SETMASK, &oldmask, NULL);
+  return 0;
+
+ failure:
+  saved_errno = errno;
+  sigprocmask (SIG_SETMASK, &oldmask, NULL);
+  errno = saved_errno;
+  return -1;
+}
diff --git a/lib/signal.in.h b/lib/signal.in.h
new file mode 100644 (file)
index 0000000..7d4927b
--- /dev/null
@@ -0,0 +1,463 @@
+/* A GNU-like <signal.h>.
+
+   Copyright (C) 2006-2018 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 <https://www.gnu.org/licenses/>.  */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined __need_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T)
+/* Special invocation convention:
+   - Inside glibc header files.
+   - On glibc systems we have a sequence of nested includes
+     <signal.h> -> <ucontext.h> -> <signal.h>.
+     In this situation, the functions are not yet declared, therefore we cannot
+     provide the C++ aliases.
+   - On glibc systems with GCC 4.3 we have a sequence of nested includes
+     <csignal> -> </usr/include/signal.h> -> <sys/ucontext.h> -> <signal.h>.
+     In this situation, some of the functions are not yet declared, therefore
+     we cannot provide the C++ aliases.  */
+
+# @INCLUDE_NEXT@ @NEXT_SIGNAL_H@
+
+#else
+/* Normal invocation convention.  */
+
+#ifndef _@GUARD_PREFIX@_SIGNAL_H
+
+#define _GL_ALREADY_INCLUDING_SIGNAL_H
+
+/* Define pid_t, uid_t.
+   Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.
+   On Solaris 10, <signal.h> includes <sys/types.h>, which eventually includes
+   us; so include <sys/types.h> now, before the second inclusion guard.  */
+#include <sys/types.h>
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_SIGNAL_H@
+
+#undef _GL_ALREADY_INCLUDING_SIGNAL_H
+
+#ifndef _@GUARD_PREFIX@_SIGNAL_H
+#define _@GUARD_PREFIX@_SIGNAL_H
+
+/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android
+   declare pthread_sigmask in <pthread.h>, not in <signal.h>.
+   But avoid namespace pollution on glibc systems.*/
+#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
+    && ((defined __APPLE__ && defined __MACH__) \
+        || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \
+        || defined __sun || defined __ANDROID__) \
+    && ! defined __GLIBC__
+# include <pthread.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.  */
+
+/* On AIX, sig_atomic_t already includes volatile.  C99 requires that
+   'volatile sig_atomic_t' ignore the extra modifier, but C89 did not.
+   Hence, redefine this to a non-volatile type as needed.  */
+#if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
+# if !GNULIB_defined_sig_atomic_t
+typedef int rpl_sig_atomic_t;
+#  undef sig_atomic_t
+#  define sig_atomic_t rpl_sig_atomic_t
+#  define GNULIB_defined_sig_atomic_t 1
+# endif
+#endif
+
+/* A set or mask of signals.  */
+#if !@HAVE_SIGSET_T@
+# if !GNULIB_defined_sigset_t
+typedef unsigned int sigset_t;
+#  define GNULIB_defined_sigset_t 1
+# endif
+#endif
+
+/* Define sighandler_t, the type of signal handlers.  A GNU extension.  */
+#if !@HAVE_SIGHANDLER_T@
+# ifdef __cplusplus
+extern "C" {
+# endif
+# if !GNULIB_defined_sighandler_t
+typedef void (*sighandler_t) (int);
+#  define GNULIB_defined_sighandler_t 1
+# endif
+# ifdef __cplusplus
+}
+# endif
+#endif
+
+
+#if @GNULIB_SIGNAL_H_SIGPIPE@
+# ifndef SIGPIPE
+/* Define SIGPIPE to a value that does not overlap with other signals.  */
+#  define SIGPIPE 13
+#  define GNULIB_defined_SIGPIPE 1
+/* To actually use SIGPIPE, you also need the gnulib modules 'sigprocmask',
+   'write', 'stdio'.  */
+# endif
+#endif
+
+
+/* Maximum signal number + 1.  */
+#ifndef NSIG
+# if defined __TANDEM
+#  define NSIG 32
+# endif
+#endif
+
+
+#if @GNULIB_PTHREAD_SIGMASK@
+# if @REPLACE_PTHREAD_SIGMASK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_sigmask
+#   define pthread_sigmask rpl_pthread_sigmask
+#  endif
+_GL_FUNCDECL_RPL (pthread_sigmask, int,
+                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+_GL_CXXALIAS_RPL (pthread_sigmask, int,
+                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+# else
+#  if !(@HAVE_PTHREAD_SIGMASK@ || defined pthread_sigmask)
+_GL_FUNCDECL_SYS (pthread_sigmask, int,
+                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+#  endif
+_GL_CXXALIAS_SYS (pthread_sigmask, int,
+                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+# endif
+_GL_CXXALIASWARN (pthread_sigmask);
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_sigmask
+# if HAVE_RAW_DECL_PTHREAD_SIGMASK
+_GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - "
+                 "use gnulib module pthread_sigmask for portability");
+# endif
+#endif
+
+
+#if @GNULIB_RAISE@
+# if @REPLACE_RAISE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef raise
+#   define raise rpl_raise
+#  endif
+_GL_FUNCDECL_RPL (raise, int, (int sig));
+_GL_CXXALIAS_RPL (raise, int, (int sig));
+# else
+#  if !@HAVE_RAISE@
+_GL_FUNCDECL_SYS (raise, int, (int sig));
+#  endif
+_GL_CXXALIAS_SYS (raise, int, (int sig));
+# endif
+_GL_CXXALIASWARN (raise);
+#elif defined GNULIB_POSIXCHECK
+# undef raise
+/* Assume raise is always declared.  */
+_GL_WARN_ON_USE (raise, "raise can crash on native Windows - "
+                 "use gnulib module raise for portability");
+#endif
+
+
+#if @GNULIB_SIGPROCMASK@
+# if !@HAVE_POSIX_SIGNALBLOCKING@
+
+#  ifndef GNULIB_defined_signal_blocking
+#   define GNULIB_defined_signal_blocking 1
+#  endif
+
+/* Maximum signal number + 1.  */
+#  ifndef NSIG
+#   define NSIG 32
+#  endif
+
+/* This code supports only 32 signals.  */
+#  if !GNULIB_defined_verify_NSIG_constraint
+typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
+#   define GNULIB_defined_verify_NSIG_constraint 1
+#  endif
+
+# endif
+
+/* When also using extern inline, suppress the use of static inline in
+   standard headers of problematic Apple configurations, as Libc at
+   least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
+   <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
+   Perhaps Apple will fix this some day.  */
+#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
+     && (defined __i386__ || defined __x86_64__))
+# undef sigaddset
+# undef sigdelset
+# undef sigemptyset
+# undef sigfillset
+# undef sigismember
+#endif
+
+/* Test whether a given signal is contained in a signal set.  */
+# if @HAVE_POSIX_SIGNALBLOCKING@
+/* This function is defined as a macro on Mac OS X.  */
+#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   undef sigismember
+#  endif
+# else
+_GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig)
+                                    _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig));
+_GL_CXXALIASWARN (sigismember);
+
+/* Initialize a signal set to the empty set.  */
+# if @HAVE_POSIX_SIGNALBLOCKING@
+/* This function is defined as a macro on Mac OS X.  */
+#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   undef sigemptyset
+#  endif
+# else
+_GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set));
+_GL_CXXALIASWARN (sigemptyset);
+
+/* Add a signal to a signal set.  */
+# if @HAVE_POSIX_SIGNALBLOCKING@
+/* This function is defined as a macro on Mac OS X.  */
+#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   undef sigaddset
+#  endif
+# else
+_GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig)
+                                  _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig));
+_GL_CXXALIASWARN (sigaddset);
+
+/* Remove a signal from a signal set.  */
+# if @HAVE_POSIX_SIGNALBLOCKING@
+/* This function is defined as a macro on Mac OS X.  */
+#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   undef sigdelset
+#  endif
+# else
+_GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig)
+                                  _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig));
+_GL_CXXALIASWARN (sigdelset);
+
+/* Fill a signal set with all possible signals.  */
+# if @HAVE_POSIX_SIGNALBLOCKING@
+/* This function is defined as a macro on Mac OS X.  */
+#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   undef sigfillset
+#  endif
+# else
+_GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set));
+_GL_CXXALIASWARN (sigfillset);
+
+/* Return the set of those blocked signals that are pending.  */
+# if !@HAVE_POSIX_SIGNALBLOCKING@
+_GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set));
+_GL_CXXALIASWARN (sigpending);
+
+/* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET.
+   Then, if SET is not NULL, affect the current set of blocked signals by
+   combining it with *SET as indicated in OPERATION.
+   In this implementation, you are not allowed to change a signal handler
+   while the signal is blocked.  */
+# if !@HAVE_POSIX_SIGNALBLOCKING@
+#  define SIG_BLOCK   0  /* blocked_set = blocked_set | *set; */
+#  define SIG_SETMASK 1  /* blocked_set = *set; */
+#  define SIG_UNBLOCK 2  /* blocked_set = blocked_set & ~*set; */
+_GL_FUNCDECL_SYS (sigprocmask, int,
+                  (int operation, const sigset_t *set, sigset_t *old_set));
+# endif
+_GL_CXXALIAS_SYS (sigprocmask, int,
+                  (int operation, const sigset_t *set, sigset_t *old_set));
+_GL_CXXALIASWARN (sigprocmask);
+
+/* Install the handler FUNC for signal SIG, and return the previous
+   handler.  */
+# ifdef __cplusplus
+extern "C" {
+# endif
+# if !GNULIB_defined_function_taking_int_returning_void_t
+typedef void (*_gl_function_taking_int_returning_void_t) (int);
+#  define GNULIB_defined_function_taking_int_returning_void_t 1
+# endif
+# ifdef __cplusplus
+}
+# endif
+# if !@HAVE_POSIX_SIGNALBLOCKING@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define signal rpl_signal
+#  endif
+_GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t,
+                  (int sig, _gl_function_taking_int_returning_void_t func));
+_GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
+                  (int sig, _gl_function_taking_int_returning_void_t func));
+# else
+_GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t,
+                  (int sig, _gl_function_taking_int_returning_void_t func));
+# endif
+_GL_CXXALIASWARN (signal);
+
+# if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE
+/* Raise signal SIGPIPE.  */
+_GL_EXTERN_C int _gl_raise_SIGPIPE (void);
+# endif
+
+#elif defined GNULIB_POSIXCHECK
+# undef sigaddset
+# if HAVE_RAW_DECL_SIGADDSET
+_GL_WARN_ON_USE (sigaddset, "sigaddset is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigdelset
+# if HAVE_RAW_DECL_SIGDELSET
+_GL_WARN_ON_USE (sigdelset, "sigdelset is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigemptyset
+# if HAVE_RAW_DECL_SIGEMPTYSET
+_GL_WARN_ON_USE (sigemptyset, "sigemptyset is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigfillset
+# if HAVE_RAW_DECL_SIGFILLSET
+_GL_WARN_ON_USE (sigfillset, "sigfillset is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigismember
+# if HAVE_RAW_DECL_SIGISMEMBER
+_GL_WARN_ON_USE (sigismember, "sigismember is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigpending
+# if HAVE_RAW_DECL_SIGPENDING
+_GL_WARN_ON_USE (sigpending, "sigpending is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+# undef sigprocmask
+# if HAVE_RAW_DECL_SIGPROCMASK
+_GL_WARN_ON_USE (sigprocmask, "sigprocmask is unportable - "
+                 "use the gnulib module sigprocmask for portability");
+# endif
+#endif /* @GNULIB_SIGPROCMASK@ */
+
+
+#if @GNULIB_SIGACTION@
+# if !@HAVE_SIGACTION@
+
+#  if !@HAVE_SIGINFO_T@
+
+#   if !GNULIB_defined_siginfo_types
+
+/* Present to allow compilation, but unsupported by gnulib.  */
+union sigval
+{
+  int sival_int;
+  void *sival_ptr;
+};
+
+/* Present to allow compilation, but unsupported by gnulib.  */
+struct siginfo_t
+{
+  int si_signo;
+  int si_code;
+  int si_errno;
+  pid_t si_pid;
+  uid_t si_uid;
+  void *si_addr;
+  int si_status;
+  long si_band;
+  union sigval si_value;
+};
+typedef struct siginfo_t siginfo_t;
+
+#    define GNULIB_defined_siginfo_types 1
+#   endif
+
+#  endif /* !@HAVE_SIGINFO_T@ */
+
+/* We assume that platforms which lack the sigaction() function also lack
+   the 'struct sigaction' type, and vice versa.  */
+
+#  if !GNULIB_defined_struct_sigaction
+
+struct sigaction
+{
+  union
+  {
+    void (*_sa_handler) (int);
+    /* Present to allow compilation, but unsupported by gnulib.  POSIX
+       says that implementations may, but not must, make sa_sigaction
+       overlap with sa_handler, but we know of no implementation where
+       they do not overlap.  */
+    void (*_sa_sigaction) (int, siginfo_t *, void *);
+  } _sa_func;
+  sigset_t sa_mask;
+  /* Not all POSIX flags are supported.  */
+  int sa_flags;
+};
+#   define sa_handler _sa_func._sa_handler
+#   define sa_sigaction _sa_func._sa_sigaction
+/* Unsupported flags are not present.  */
+#   define SA_RESETHAND 1
+#   define SA_NODEFER 2
+#   define SA_RESTART 4
+
+#   define GNULIB_defined_struct_sigaction 1
+#  endif
+
+_GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
+                                   struct sigaction *restrict));
+
+# elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@
+
+#  define sa_sigaction sa_handler
+
+# endif /* !@HAVE_SIGACTION@, !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ */
+
+_GL_CXXALIAS_SYS (sigaction, int, (int, const struct sigaction *restrict,
+                                   struct sigaction *restrict));
+_GL_CXXALIASWARN (sigaction);
+
+#elif defined GNULIB_POSIXCHECK
+# undef sigaction
+# if HAVE_RAW_DECL_SIGACTION
+_GL_WARN_ON_USE (sigaction, "sigaction is unportable - "
+                 "use the gnulib module sigaction for portability");
+# endif
+#endif
+
+/* Some systems don't have SA_NODEFER.  */
+#ifndef SA_NODEFER
+# define SA_NODEFER 0
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SIGNAL_H */
+#endif /* _@GUARD_PREFIX@_SIGNAL_H */
+#endif
diff --git a/lib/sigprocmask.c b/lib/sigprocmask.c
new file mode 100644 (file)
index 0000000..7a49bcd
--- /dev/null
@@ -0,0 +1,349 @@
+/* POSIX compatible signal blocking.
+   Copyright (C) 2006-2018 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+   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 <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <signal.h>
+
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+/* We assume that a platform without POSIX signal blocking functions
+   also does not have the POSIX sigaction() function, only the
+   signal() function.  We also assume signal() has SysV semantics,
+   where any handler is uninstalled prior to being invoked.  This is
+   true for native Windows platforms.  */
+
+/* We use raw signal(), but also provide a wrapper rpl_signal() so
+   that applications can query or change a blocked signal.  */
+#undef signal
+
+/* Provide invalid signal numbers as fallbacks if the uncatchable
+   signals are not defined.  */
+#ifndef SIGKILL
+# define SIGKILL (-1)
+#endif
+#ifndef SIGSTOP
+# define SIGSTOP (-1)
+#endif
+
+/* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias
+   for the signal SIGABRT.  Only one signal handler is stored for both
+   SIGABRT and SIGABRT_COMPAT.  SIGABRT_COMPAT is not a signal of its own.  */
+#if defined _WIN32 && ! defined __CYGWIN__
+# undef SIGABRT_COMPAT
+# define SIGABRT_COMPAT 6
+#endif
+#ifdef SIGABRT_COMPAT
+# define SIGABRT_COMPAT_MASK (1U << SIGABRT_COMPAT)
+#else
+# define SIGABRT_COMPAT_MASK 0
+#endif
+
+typedef void (*handler_t) (int);
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static handler_t
+signal_nothrow (int sig, handler_t handler)
+{
+  handler_t result;
+
+  TRY_MSVC_INVAL
+    {
+      result = signal (sig, handler);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = SIG_ERR;
+      errno = EINVAL;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+# define signal signal_nothrow
+#endif
+
+/* Handling of gnulib defined signals.  */
+
+#if GNULIB_defined_SIGPIPE
+static handler_t SIGPIPE_handler = SIG_DFL;
+#endif
+
+#if GNULIB_defined_SIGPIPE
+static handler_t
+ext_signal (int sig, handler_t handler)
+{
+  switch (sig)
+    {
+    case SIGPIPE:
+      {
+        handler_t old_handler = SIGPIPE_handler;
+        SIGPIPE_handler = handler;
+        return old_handler;
+      }
+    default: /* System defined signal */
+      return signal (sig, handler);
+    }
+}
+# undef signal
+# define signal ext_signal
+#endif
+
+int
+sigismember (const sigset_t *set, int sig)
+{
+  if (sig >= 0 && sig < NSIG)
+    {
+      #ifdef SIGABRT_COMPAT
+      if (sig == SIGABRT_COMPAT)
+        sig = SIGABRT;
+      #endif
+
+      return (*set >> sig) & 1;
+    }
+  else
+    return 0;
+}
+
+int
+sigemptyset (sigset_t *set)
+{
+  *set = 0;
+  return 0;
+}
+
+int
+sigaddset (sigset_t *set, int sig)
+{
+  if (sig >= 0 && sig < NSIG)
+    {
+      #ifdef SIGABRT_COMPAT
+      if (sig == SIGABRT_COMPAT)
+        sig = SIGABRT;
+      #endif
+
+      *set |= 1U << sig;
+      return 0;
+    }
+  else
+    {
+      errno = EINVAL;
+      return -1;
+    }
+}
+
+int
+sigdelset (sigset_t *set, int sig)
+{
+  if (sig >= 0 && sig < NSIG)
+    {
+      #ifdef SIGABRT_COMPAT
+      if (sig == SIGABRT_COMPAT)
+        sig = SIGABRT;
+      #endif
+
+      *set &= ~(1U << sig);
+      return 0;
+    }
+  else
+    {
+      errno = EINVAL;
+      return -1;
+    }
+}
+
+
+int
+sigfillset (sigset_t *set)
+{
+  *set = ((2U << (NSIG - 1)) - 1) & ~ SIGABRT_COMPAT_MASK;
+  return 0;
+}
+
+/* Set of currently blocked signals.  */
+static volatile sigset_t blocked_set /* = 0 */;
+
+/* Set of currently blocked and pending signals.  */
+static volatile sig_atomic_t pending_array[NSIG] /* = { 0 } */;
+
+/* Signal handler that is installed for blocked signals.  */
+static void
+blocked_handler (int sig)
+{
+  /* Reinstall the handler, in case the signal occurs multiple times
+     while blocked.  There is an inherent race where an asynchronous
+     signal in between when the kernel uninstalled the handler and
+     when we reinstall it will trigger the default handler; oh
+     well.  */
+  signal (sig, blocked_handler);
+  if (sig >= 0 && sig < NSIG)
+    pending_array[sig] = 1;
+}
+
+int
+sigpending (sigset_t *set)
+{
+  sigset_t pending = 0;
+  int sig;
+
+  for (sig = 0; sig < NSIG; sig++)
+    if (pending_array[sig])
+      pending |= 1U << sig;
+  *set = pending;
+  return 0;
+}
+
+/* The previous signal handlers.
+   Only the array elements corresponding to blocked signals are relevant.  */
+static volatile handler_t old_handlers[NSIG];
+
+int
+sigprocmask (int operation, const sigset_t *set, sigset_t *old_set)
+{
+  if (old_set != NULL)
+    *old_set = blocked_set;
+
+  if (set != NULL)
+    {
+      sigset_t new_blocked_set;
+      sigset_t to_unblock;
+      sigset_t to_block;
+
+      switch (operation)
+        {
+        case SIG_BLOCK:
+          new_blocked_set = blocked_set | *set;
+          break;
+        case SIG_SETMASK:
+          new_blocked_set = *set;
+          break;
+        case SIG_UNBLOCK:
+          new_blocked_set = blocked_set & ~*set;
+          break;
+        default:
+          errno = EINVAL;
+          return -1;
+        }
+      to_unblock = blocked_set & ~new_blocked_set;
+      to_block = new_blocked_set & ~blocked_set;
+
+      if (to_block != 0)
+        {
+          int sig;
+
+          for (sig = 0; sig < NSIG; sig++)
+            if ((to_block >> sig) & 1)
+              {
+                pending_array[sig] = 0;
+                if ((old_handlers[sig] = signal (sig, blocked_handler)) != SIG_ERR)
+                  blocked_set |= 1U << sig;
+              }
+        }
+
+      if (to_unblock != 0)
+        {
+          sig_atomic_t received[NSIG];
+          int sig;
+
+          for (sig = 0; sig < NSIG; sig++)
+            if ((to_unblock >> sig) & 1)
+              {
+                if (signal (sig, old_handlers[sig]) != blocked_handler)
+                  /* The application changed a signal handler while the signal
+                     was blocked, bypassing our rpl_signal replacement.
+                     We don't support this.  */
+                  abort ();
+                received[sig] = pending_array[sig];
+                blocked_set &= ~(1U << sig);
+                pending_array[sig] = 0;
+              }
+            else
+              received[sig] = 0;
+
+          for (sig = 0; sig < NSIG; sig++)
+            if (received[sig])
+              raise (sig);
+        }
+    }
+  return 0;
+}
+
+/* Install the handler FUNC for signal SIG, and return the previous
+   handler.  */
+handler_t
+rpl_signal (int sig, handler_t handler)
+{
+  /* We must provide a wrapper, so that a user can query what handler
+     they installed even if that signal is currently blocked.  */
+  if (sig >= 0 && sig < NSIG && sig != SIGKILL && sig != SIGSTOP
+      && handler != SIG_ERR)
+    {
+      #ifdef SIGABRT_COMPAT
+      if (sig == SIGABRT_COMPAT)
+        sig = SIGABRT;
+      #endif
+
+      if (blocked_set & (1U << sig))
+        {
+          /* POSIX states that sigprocmask and signal are both
+             async-signal-safe.  This is not true of our
+             implementation - there is a slight data race where an
+             asynchronous interrupt on signal A can occur after we
+             install blocked_handler but before we have updated
+             old_handlers for signal B, such that handler A can see
+             stale information if it calls signal(B).  Oh well -
+             signal handlers really shouldn't try to manipulate the
+             installed handlers of unrelated signals.  */
+          handler_t result = old_handlers[sig];
+          old_handlers[sig] = handler;
+          return result;
+        }
+      else
+        return signal (sig, handler);
+    }
+  else
+    {
+      errno = EINVAL;
+      return SIG_ERR;
+    }
+}
+
+#if GNULIB_defined_SIGPIPE
+/* Raise the signal SIGPIPE.  */
+int
+_gl_raise_SIGPIPE (void)
+{
+  if (blocked_set & (1U << SIGPIPE))
+    pending_array[SIGPIPE] = 1;
+  else
+    {
+      handler_t handler = SIGPIPE_handler;
+      if (handler == SIG_DFL)
+        exit (128 + SIGPIPE);
+      else if (handler != SIG_IGN)
+        (*handler) (SIGPIPE);
+    }
+  return 0;
+}
+#endif
index 104f53766829c5aa3709d9b6bfa7657799813bae..69ebe85df1dd1535ef295a14e76efc3fb4563539 100644 (file)
@@ -168,7 +168,7 @@ get_stat_birthtime (struct stat const *st _GL_UNUSED)
 #elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
   t.tv_sec = st->st_birthtime;
   t.tv_nsec = st->st_birthtimensec;
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
   /* Native Windows platforms (but not Cygwin) put the "file creation
      time" in st_ctime (!).  See
      <https://msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx>.  */
@@ -213,7 +213,7 @@ stat_time_normalize (int result, struct stat *st _GL_UNUSED)
 #if defined __sun && defined STAT_TIMESPEC
   if (result == 0)
     {
-      long int timespec_resolution = 1000000000;
+      long int timespec_hz = 1000000000;
       short int const ts_off[] = { offsetof (struct stat, st_atim),
                                    offsetof (struct stat, st_mtim),
                                    offsetof (struct stat, st_ctim) };
@@ -221,11 +221,11 @@ stat_time_normalize (int result, struct stat *st _GL_UNUSED)
       for (i = 0; i < sizeof ts_off / sizeof *ts_off; i++)
         {
           struct timespec *ts = (struct timespec *) ((char *) st + ts_off[i]);
-          long int q = ts->tv_nsec / timespec_resolution;
-          long int r = ts->tv_nsec % timespec_resolution;
+          long int q = ts->tv_nsec / timespec_hz;
+          long int r = ts->tv_nsec % timespec_hz;
           if (r < 0)
             {
-              r += timespec_resolution;
+              r += timespec_hz;
               q--;
             }
           ts->tv_nsec = r;
index 5d76a462e19d6d80f8aa3592aa6e1a14cafc8f28..c7a53f9da8d8d09573d36fbb98f5f77dfff27de6 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <config.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 /* Ensure that <windows.h> defines FILE_ID_INFO.  */
 #undef _WIN32_WINNT
 #include "pathmax.h"
 #include "verify.h"
 
+/* Avoid warnings from gcc -Wcast-function-type.  */
+#define GetProcAddress \
+  (void *) GetProcAddress
+
 #if _GL_WINDOWS_STAT_INODES == 2
 /* GetFileInformationByHandleEx was introduced only in Windows Vista.  */
 typedef DWORD (WINAPI * GetFileInformationByHandleExFuncType) (HANDLE hFile,
index 1c5b62e2ea563bf850dcc824c4d291c13e17a80e..18c0caa19d14da1e21b79d25d5fb84f3bda8171a 100644 (file)
@@ -27,7 +27,7 @@
 #include <sys/stat.h>
 #undef __need_system_sys_stat_h
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # define WINDOWS_NATIVE
 #endif
 
index 78d896e9f5528eb670db149d147e7bc7e48e99ae..393ef0cf58d013ec18cfcbb2ee120c4d1df7e028 100644 (file)
    the same implementation of stdio extension API, except that some fields
    have different naming conventions, or their access requires some casts.  */
 
+/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
+   problem by defining it ourselves.  FIXME: Do not rely on glibc
+   internals.  */
+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
+# define _IO_IN_BACKUP 0x100
+#endif
 
 /* BSD stdio derived implementations.  */
 
 #  define _flags pub._flags
 #  define _r pub._r
 #  define _w pub._w
+# elif defined __ANDROID__ /* Android */
+  /* Up to this commit from 2015-10-12
+     <https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a>
+     the innards of FILE were public, and fp_ub could be defined like for OpenBSD,
+     see <https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/fileext.h>
+     and <https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/local.h>.
+     After this commit, the innards of FILE are hidden.  */
+#  define fp_ ((struct { unsigned char *_p; \
+                         int _r; \
+                         int _w; \
+                         int _flags; \
+                         int _file; \
+                         struct { unsigned char *_base; size_t _size; } _bf; \
+                         int _lbfsize; \
+                         void *_cookie; \
+                         void *_close; \
+                         void *_read; \
+                         void *_seek; \
+                         void *_write; \
+                         struct { unsigned char *_base; size_t _size; } _ext; \
+                         unsigned char *_up; \
+                         int _ur; \
+                         unsigned char _ubuf[3]; \
+                         unsigned char _nbuf[1]; \
+                         struct { unsigned char *_base; size_t _size; } _lb; \
+                         int _blksize; \
+                         fpos_t _offset; \
+                         /* More fields, not relevant here.  */ \
+                       } *) fp)
 # else
 #  define fp_ fp
 # endif
 
-# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Minix 3, Android */
+# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix /* NetBSD >= 1.5ZA, OpenBSD, Minix 3 */
   /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
-     and <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */
+     and <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
+     and <https://github.com/Stichting-MINIX-Research-Foundation/minix/blob/master/lib/libc/stdio/fileext.h> */
   struct __sfileext
     {
       struct  __sbuf _ub; /* ungetc buffer */
       /* More fields, not relevant here.  */
     };
 #  define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
-# else                                         /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin, Android */
+# elif defined __ANDROID__                     /* Android */
+  struct __sfileext
+    {
+      struct { unsigned char *_base; size_t _size; } _ub; /* ungetc buffer */
+      /* More fields, not relevant here.  */
+    };
+#  define fp_ub ((struct __sfileext *) fp_->_ext._base)->_ub
+# else                                         /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin */
 #  define fp_ub fp_->_ub
 # endif
 
 # define HASUB(fp) (fp_ub._base != NULL)
 
+# if defined __ANDROID__ /* Android */
+  /* Needed after this commit from 2016-01-25
+     <https://android.googlesource.com/platform/bionic.git/+/e70e0e9267d069bf56a5078c99307e08a7280de7> */
+#  ifndef __SEOF
+#   define __SLBF 1
+#   define __SNBF 2
+#   define __SRD 4
+#   define __SWR 8
+#   define __SRW 0x10
+#   define __SEOF 0x20
+#   define __SERR 0x40
+#  endif
+#  ifndef __SOFF
+#   define __SOFF 0x1000
+#  endif
+# endif
+
 #endif
 
 
 #  define _flag __flag
 # endif
 
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__  /* newer Windows with MSVC */
+#elif defined _WIN32 && ! defined __CYGWIN__  /* newer Windows with MSVC */
 
 /* <stdio.h> does not define the innards of FILE any more.  */
 # define WINDOWS_OPAQUE_FILE
index b9a43bb80ca6571f202f61c2d1fe2b8d1c792ea7..ff7c9c831acbba515b2825e04aa3fe9c9a75a5e1 100644 (file)
    it before we  #define perror rpl_perror.  */
 /* But in any case avoid namespace pollution on glibc systems.  */
 #if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
-    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && (defined _WIN32 && ! defined __CYGWIN__) \
     && ! defined __GLIBC__
 # include <stdlib.h>
 #endif
    it before we  #define rename rpl_rename.  */
 /* But in any case avoid namespace pollution on glibc systems.  */
 #if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
-    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && (defined _WIN32 && ! defined __CYGWIN__) \
     && ! defined __GLIBC__
 # include <io.h>
 #endif
index b9701d5b287e38ee9eae5069ce4d801efb2c85ce..441c018ec18906488c0df224488f3a50727410b5 100644 (file)
 
 /* Solaris declares getloadavg() in <sys/loadavg.h>.  */
 #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
+/* OpenIndiana has a bug: <sys/time.h> must be included before
+   <sys/loadavg.h>.  */
+# include <sys/time.h>
 # include <sys/loadavg.h>
 #endif
 
 /* Native Windows platforms declare mktemp() in <io.h>.  */
-#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
 # include <io.h>
 #endif
 
@@ -87,9 +90,10 @@ struct random_data
 # endif
 #endif
 
-#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
 /* On Mac OS X 10.3, only <unistd.h> declares mkstemp.  */
 /* On Mac OS X 10.5, only <unistd.h> declares mkstemps.  */
+/* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps.  */
 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
 /* But avoid namespace pollution on glibc systems and native Windows.  */
 # include <unistd.h>
index c556c26737a4864529511fd2f5d97b327f7116d9..2a22cb41466327d730256d5c883684f19852c385 100644 (file)
@@ -61,7 +61,7 @@ int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
 
 # define USE_SYSTEM_STRERROR 1
 
-# if defined __NetBSD__ || defined __hpux || ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __sgi || (defined __sun && !defined _LP64) || defined __CYGWIN__
+# if defined __NetBSD__ || defined __hpux || (defined _WIN32 && !defined __CYGWIN__) || defined __sgi || (defined __sun && !defined _LP64) || defined __CYGWIN__
 
 /* No locking needed.  */
 
@@ -129,22 +129,13 @@ static int
 safe_copy (char *buf, size_t buflen, const char *msg)
 {
   size_t len = strlen (msg);
-  int ret;
+  size_t moved = len < buflen ? len : buflen - 1;
 
-  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;
+  /* Although POSIX lets memmove corrupt errno, we don't
+     know of any implementation where this is a real problem.  */
+  memmove (buf, msg, moved);
+  buf[moved] = '\0';
+  return len < buflen ? 0 : ERANGE;
 }
 
 
@@ -258,7 +249,7 @@ strerror_r (int errnum, char *buf, size_t buflen)
     /* 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 */
+# if defined __NetBSD__ || defined __hpux || (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.
@@ -335,7 +326,7 @@ strerror_r (int errnum, char *buf, size_t buflen)
 
 #endif
 
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
     /* MSVC 14 defines names for many error codes in the range 100..140,
        but _sys_errlist contains strings only for the error codes
        < _sys_nerr = 43.  */
index d96fde1007dfd47c9edbda1b98002df1369296ba..6ae6ac5fbdcbacd3e3d4f11a8bd11f5d567aea90 100644 (file)
 /* Before doing "#define mkdir rpl_mkdir" below, we need to include all
    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__
+#if 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__)
+#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
 # include <io.h>
 #endif
 
@@ -576,7 +576,7 @@ _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
    Additionally, it declares _mkdir (and depending on compile flags, an
    alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
    which are included above.  */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 
 #  if !GNULIB_defined_rpl_mkdir
 static int
index 747371644df6b0e6c7b55d66fa50be38e1af567e..7f8c1c42117474e9cef88e3bb6daa01443560496 100644 (file)
 #endif
 @PRAGMA_COLUMNS@
 
+#if defined _WIN32 && !defined __CYGWIN__ \
+    && (defined __need_off_t || defined __need___off64_t \
+        || defined __need_ssize_t || defined __need_time_t)
+
+/* Special invocation convention inside mingw header files.  */
+
+#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
+
+#else
+/* Normal invocation convention.  */
+
 #ifndef _@GUARD_PREFIX@_SYS_TYPES_H
 
 /* The include_next requires a split double-inclusion guard.  */
@@ -86,10 +97,10 @@ typedef unsigned long long int rpl_ino_t;
 
 /* 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__
+#if (defined _WIN32 && ! defined __CYGWIN__) && ! defined __GLIBC__
 # include <stddef.h>
 #endif
 
 #endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
 #endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
+#endif /* __need_XXX */
index a2dca89340cf5d643961e1fddcdf4376019e02b4..3128f44a6f78f06b2c6060d528913c1886b88e45 100644 (file)
@@ -48,7 +48,7 @@
 
 /* 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).
+/* Some systems don't define struct timespec (e.g., AIX 4.1).
    Or they define it with the wrong member names or define it in <sys/time.h>
    (e.g., FreeBSD circa 1997).  Stock Mingw prior to 3.0 does not define it,
    but the pthreads-win32 library defines it in <pthread.h>.  */
@@ -212,7 +212,7 @@ _GL_CXXALIASWARN (gmtime_r);
 #    define localtime rpl_localtime
 #   endif
 _GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
-                                         _GL_ARG_NONNULL ((1)));
+                                          _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
 #  else
 _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
index eef3030d9c55d798ab3a6f314f40453159b8504b..cc49668f42a6d455e3c556be97293854445e6aaf 100644 (file)
@@ -17,9 +17,9 @@
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if ! defined TIMESPEC_H
-# define TIMESPEC_H
+#define TIMESPEC_H
 
-# include <time.h>
+#include <time.h>
 
 #ifndef _GL_INLINE_HEADER_BEGIN
  #error "Please include config.h first."
@@ -33,13 +33,20 @@ _GL_INLINE_HEADER_BEGIN
 extern "C" {
 #endif
 
+#include "arg-nonnull.h"
 #include "verify.h"
 
-/* Resolution of timespec timestamps (in units per second), and log
-   base 10 of the resolution.  */
+/* Inverse resolution of timespec timestamps (in units per second),
+   and log base 10 of the inverse resolution.  */
 
-enum { TIMESPEC_RESOLUTION = 1000000000 };
-enum { LOG10_TIMESPEC_RESOLUTION = 9 };
+enum { TIMESPEC_HZ = 1000000000 };
+enum { LOG10_TIMESPEC_HZ = 9 };
+
+/* Obsolescent names for backward compatibility.
+   They are misnomers, because TIMESPEC_RESOLUTION is not a resolution.  */
+
+enum { TIMESPEC_RESOLUTION = TIMESPEC_HZ };
+enum { LOG10_TIMESPEC_RESOLUTION = LOG10_TIMESPEC_HZ };
 
 /* Return a timespec with seconds S and nanoseconds NS.  */
 
@@ -87,9 +94,9 @@ timespec_cmp (struct timespec a, struct timespec b)
     return 1;
 
   /* Pacify gcc -Wstrict-overflow (bleeding-edge circa 2017-10-02).  See:
-     http://lists.gnu.org/r/bug-gnulib/2017-10/msg00006.html  */
-  assume (-1 <= a.tv_nsec && a.tv_nsec <= 2 * TIMESPEC_RESOLUTION);
-  assume (-1 <= b.tv_nsec && b.tv_nsec <= 2 * TIMESPEC_RESOLUTION);
+     https://lists.gnu.org/r/bug-gnulib/2017-10/msg00006.html  */
+  assume (-1 <= a.tv_nsec && a.tv_nsec <= 2 * TIMESPEC_HZ);
+  assume (-1 <= b.tv_nsec && b.tv_nsec <= 2 * TIMESPEC_HZ);
 
   return a.tv_nsec - b.tv_nsec;
 }
@@ -116,8 +123,9 @@ timespectod (struct timespec a)
   return a.tv_sec + a.tv_nsec / 1e9;
 }
 
-void gettime (struct timespec *);
-int settime (struct timespec const *);
+struct timespec current_timespec (void);
+void gettime (struct timespec *) _GL_ARG_NONNULL ((1));
+int settime (struct timespec const *) _GL_ARG_NONNULL ((1));
 
 #ifdef __cplusplus
 }
index ae59cb2e62749b6675a135964732383b5324c7a0..66f254d60f548d33151e93610515b8b359d8b575 100644 (file)
@@ -61,7 +61,7 @@
 /* But avoid namespace pollution on glibc systems.  */
 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
      || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \
-         && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) \
+         && (defined _WIN32 && ! defined __CYGWIN__)) \
      || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
          && defined __CYGWIN__)) \
     && ! defined __GLIBC__
    lseek(), read(), unlink(), write() in <io.h>.  */
 #if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
       || defined GNULIB_POSIXCHECK) \
-     && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+     && (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__)
+      && (defined _WIN32 && ! defined __CYGWIN__)
 # include <io.h>
 #endif
 
@@ -400,6 +400,13 @@ _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
 
 
 #if @GNULIB_ENVIRON@
+# if defined __CYGWIN__ && !defined __i386__
+/* The 'environ' variable is defined in a DLL. Therefore its declaration needs
+   the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it.
+   This leads to a link error on 64-bit Cygwin when the option
+   -Wl,--disable-auto-import is in use.  */
+_GL_EXTERN_C __declspec(dllimport) char **environ;
+# endif
 # if !@HAVE_DECL_ENVIRON@
 /* Set of environment variables and values.  An array of strings of the form
    "VARIABLE=VALUE", terminated with a NULL.  */
@@ -425,12 +432,12 @@ extern char **environ;
 #elif defined GNULIB_POSIXCHECK
 # if HAVE_RAW_DECL_ENVIRON
 _GL_UNISTD_INLINE char ***
+_GL_WARN_ON_USE_ATTRIBUTE ("environ is unportable - "
+                           "use gnulib module environ for portability")
 rpl_environ (void)
 {
   return &environ;
 }
-_GL_WARN_ON_USE (rpl_environ, "environ is unportable - "
-                 "use gnulib module environ for portability");
 #  undef environ
 #  define environ (*rpl_environ ())
 # endif
@@ -928,6 +935,36 @@ _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
 #endif
 
 
+#if @GNULIB_GETPASS@
+/* Function getpass() from module 'getpass':
+     Read a password from /dev/tty or stdin.
+   Function getpass() from module 'getpass-gnu':
+     Read a password of arbitrary length from /dev/tty or stdin.  */
+# if @REPLACE_GETPASS@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getpass
+#   define getpass rpl_getpass
+#  endif
+_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt)
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
+# else
+#  if !@HAVE_GETPASS@
+_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt)
+                                   _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
+# endif
+_GL_CXXALIASWARN (getpass);
+#elif defined GNULIB_POSIXCHECK
+# undef getpass
+# if HAVE_RAW_DECL_GETPASS
+_GL_WARN_ON_USE (getpass, "getpass is unportable - "
+                 "use gnulib module getpass or getpass-gnu for portability");
+# endif
+#endif
+
+
 #if @GNULIB_GETUSERSHELL@
 /* Return the next valid login shell on the system, or NULL when the end of
    the list has been reached.  */
@@ -1482,7 +1519,7 @@ _GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length)
                                  _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
 # else
-#  if !@HAVE_TRUNCATE@
+#  if !@HAVE_DECL_TRUNCATE@
 _GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
                                  _GL_ARG_NONNULL ((1)));
 #  endif
index 80291d3acbdfd02667199b5328482efea8533300..1893c87f14e135fccb0eb2f27ec722ce9a7a26e6 100644 (file)
@@ -21,7 +21,7 @@
 /* Specification.  */
 #include <utime.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 # include <errno.h>
 # include <stdbool.h>
index 8a52a0d695d63425d39511c569ce8f866d2fd4f7..07fdb30952c25b9c6ab427306a2d364fbb1723d5 100644 (file)
@@ -45,7 +45,7 @@
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 /* Define 'struct utimbuf' as an alias of 'struct _utimbuf'
    (or possibly, if present, 'struct __utimbuf64').  */
index c0b0704eb29d29a50e53bb9b35f9ef41c218249f..f6c4fe34c7c524ecb1695912ac5ceaacaee868b0 100644 (file)
@@ -39,8 +39,7 @@
    GNU Emacs, which arranges for this in some other way and which
    defines WIN32_LEAN_AND_MEAN itself.  */
 
-#if ((defined _WIN32 || defined __WIN32__) \
-     && ! defined __CYGWIN__ && ! defined EMACS_CONFIGURATION)
+#if defined _WIN32 && ! defined __CYGWIN__ && ! defined EMACS_CONFIGURATION
 # define USE_SETFILETIME
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
@@ -92,11 +91,11 @@ validate_timespec (struct timespec timespec[2])
   if ((timespec[0].tv_nsec != UTIME_NOW
        && timespec[0].tv_nsec != UTIME_OMIT
        && ! (0 <= timespec[0].tv_nsec
-             && timespec[0].tv_nsec < TIMESPEC_RESOLUTION))
+             && timespec[0].tv_nsec < TIMESPEC_HZ))
       || (timespec[1].tv_nsec != UTIME_NOW
           && timespec[1].tv_nsec != UTIME_OMIT
           && ! (0 <= timespec[1].tv_nsec
-                && timespec[1].tv_nsec < TIMESPEC_RESOLUTION)))
+                && timespec[1].tv_nsec < TIMESPEC_HZ)))
     {
       errno = EINVAL;
       return -1;
index 8b91e3fe53e1e6acd571a6cc0db588dacaf7b4d0..57571750a0b21a17b67122e764db3838d7bfb78e 100644 (file)
@@ -860,7 +860,9 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes)
   size_t a_len = a.nlimbs;
   /* 0.03345 is slightly larger than log(2)/(9*log(10)).  */
   size_t c_len = 9 * ((size_t)(a_len * (GMP_LIMB_BITS * 0.03345f)) + 1);
-  char *c_ptr = (char *) malloc (xsum (c_len, extra_zeroes));
+  /* We need extra_zeroes bytes for zeroes, followed by c_len bytes for the
+     digits of a, followed by 1 byte for the terminating NUL.  */
+  char *c_ptr = (char *) malloc (xsum (xsum (extra_zeroes, c_len), 1));
   if (c_ptr != NULL)
     {
       char *d_ptr = c_ptr;
@@ -2694,7 +2696,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                               errno = EILSEQ;
                               return NULL;
                             }
-                          if (precision < count)
+                          if (precision < (unsigned int) count)
                             break;
                           arg_end++;
                           characters += count;
@@ -4243,7 +4245,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                   static const wchar_t decimal_format[] =
                                     /* Produce the same number of exponent digits
                                        as the native printf implementation.  */
-#    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#    if defined _WIN32 && ! defined __CYGWIN__
                                     { '%', '+', '.', '3', 'd', '\0' };
 #    else
                                     { '%', '+', '.', '2', 'd', '\0' };
@@ -4257,7 +4259,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                   static const char decimal_format[] =
                                     /* Produce the same number of exponent digits
                                        as the native printf implementation.  */
-#    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#    if defined _WIN32 && ! defined __CYGWIN__
                                     "%+.3d";
 #    else
                                     "%+.2d";
@@ -4436,7 +4438,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                           static const wchar_t decimal_format[] =
                                             /* Produce the same number of exponent digits
                                                as the native printf implementation.  */
-#    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#    if defined _WIN32 && ! defined __CYGWIN__
                                             { '%', '+', '.', '3', 'd', '\0' };
 #    else
                                             { '%', '+', '.', '2', 'd', '\0' };
@@ -4450,7 +4452,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                           static const char decimal_format[] =
                                             /* Produce the same number of exponent digits
                                                as the native printf implementation.  */
-#    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#    if defined _WIN32 && ! defined __CYGWIN__
                                             "%+.3d";
 #    else
                                             "%+.2d";
@@ -4508,7 +4510,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                 *p++ = '+';
                                 /* Produce the same number of exponent digits as
                                    the native printf implementation.  */
-#   if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#   if defined _WIN32 && ! defined __CYGWIN__
                                 *p++ = '0';
 #   endif
                                 *p++ = '0';
@@ -4836,7 +4838,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #if HAVE_LONG_LONG_INT
                   case TYPE_LONGLONGINT:
                   case TYPE_ULONGLONGINT:
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
                     *fbp++ = 'I';
                     *fbp++ = '6';
                     *fbp++ = '4';
@@ -4872,7 +4874,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 # if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))        \
          && !defined __UCLIBC__)                                            \
         || (defined __APPLE__ && defined __MACH__)                          \
-        || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+        || (defined _WIN32 && ! defined __CYGWIN__))
                 fbp[1] = '%';
                 fbp[2] = 'n';
                 fbp[3] = '\0';
@@ -5125,7 +5127,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                       {
                         /* Verify that snprintf() has NUL-terminated its
                            result.  */
-                        if (count < maxlen
+                        if ((unsigned int) count < maxlen
                             && ((TCHAR_T *) (result + length)) [count] != '\0')
                           abort ();
                         /* Portability hack.  */
index bc7f99dbd739a2ec6d4ecd85abf7af8eddf3fd92..3b57ddee0acffd23cc51bc8910a15cf879f90619 100644 (file)
@@ -276,7 +276,8 @@ template <int w>
      when 'assume' silences warnings even with older GCCs.  */
 # define assume(R) ((R) ? (void) 0 : __builtin_trap ())
 #else
-# define assume(R) ((void) (0 && (R)))
+  /* Some tools grok NOTREACHED, e.g., Oracle Studio 12.6.  */
+# define assume(R) ((R) ? (void) 0 : /*NOTREACHED*/ (void) 0)
 #endif
 
 /* @assert.h omit end@  */
index e76c38427d51c05c67ac71bfa1589caa1620770d..72d67cc23484eff8851b9080201b0149bbee4f06 100644 (file)
    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
+   _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
+   attribute used in _GL_WARN_ON_USE.  If the compiler does not support
+   this feature, it expands to empty.
+
+   These macros are 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.
+   instead.
+   _GL_WARN_ON_USE is for functions with 'extern' linkage.
+   _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
+   linkage.
+
+   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>]],
    (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 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
+     #if HAVE_RAW_DECL_ENVIRON
+     static 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
+   or better (avoiding contradictory use of 'static' and 'extern'):
+     #if HAVE_RAW_DECL_ENVIRON
+     static char ***
+     _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
+     rpl_environ (void) { return &environ; }
+     # undef environ
+     # define environ (*rpl_environ ())
+     #endif
    */
 #ifndef _GL_WARN_ON_USE
 
 /* 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)))
+#  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
+  __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
+#  define _GL_WARN_ON_USE_ATTRIBUTE(message)
 # else /* Unsupported.  */
 #  define _GL_WARN_ON_USE(function, message) \
 _GL_WARN_EXTERN_C int _gl_warn_on_use
+#  define _GL_WARN_ON_USE_ATTRIBUTE(message)
 # endif
 #endif
 
index 2a51b840db8e6754815d8fbb52f58cb38c167f20..c419a2de6c1d574e7e810875ad44e0e63e0a326b 100644 (file)
@@ -36,12 +36,6 @@ extern "C" {
 #endif
 
 
-#if __GNUC__ >= 3
-# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-#else
-# define _GL_ATTRIBUTE_MALLOC
-#endif
-
 #if ! defined __clang__ && \
     (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
 # define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
index cc92534f0385e919a8542a4db4340539462c5315..58a5299c2286eef1c3de128417aca208d561d31c 100644 (file)
@@ -1,4 +1,4 @@
-# asm-underscore.m4 serial 3
+# asm-underscore.m4 serial 4
 dnl Copyright (C) 2010-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,6 +14,7 @@ dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
 
 AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
 [
+  AC_REQUIRE([AC_PROG_EGREP])
   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.
@@ -29,7 +30,7 @@ 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 LC_ALL=C grep -E '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' conftest.$gl_asmext >/dev/null; then
+     if LC_ALL=C $EGREP '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' conftest.$gl_asmext >/dev/null; then
        gl_cv_prog_as_underscore=yes
      else
        gl_cv_prog_as_underscore=no
index 9dbdedd505a0d709da7da03ff55eb42512dec1e6..e1ae295126981177d78eb441f64ffc756c5a185e 100644 (file)
@@ -1,9 +1,11 @@
-# errno_h.m4 serial 12
+# errno_h.m4 serial 13
 dnl Copyright (C) 2004, 2006, 2008-2018 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_PREREQ([2.61])
+
 AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
 [
   AC_REQUIRE([AC_PROG_CC])
@@ -129,9 +131,3 @@ yes
     AC_SUBST($1[_VALUE])
   fi
 ])
-
-dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
-dnl Remove this when we can assume autoconf >= 2.61.
-m4_ifdef([AC_COMPUTE_INT], [], [
-  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
-])
index d1b23215b05adc641f75f69073fd61cbb6dcb351..71a854f8bfaea77e3872f52b9097f26ad3838cbf 100644 (file)
@@ -1,4 +1,4 @@
-# serial 17  -*- Autoconf -*-
+# serial 18  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
 # Copyright (C) 2003, 2006-2018 Free Software Foundation, Inc.
@@ -118,6 +118,11 @@ dnl configure.ac when using autoheader 2.62.
 #ifndef _XOPEN_SOURCE
 # undef _XOPEN_SOURCE
 #endif
+/* Enable X/Open compliant socket functions that do not require linking
+   with -lxnet on HP-UX 11.11.  */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# undef _HPUX_ALT_XOPEN_SOCKET_API
+#endif
 /* Enable general extensions on Solaris.  */
 #ifndef __EXTENSIONS__
 # undef __EXTENSIONS__
@@ -163,6 +168,7 @@ dnl configure.ac when using autoheader 2.62.
           [ac_cv_should_define__xopen_source=yes])])])
   test $ac_cv_should_define__xopen_source = yes &&
     AC_DEFINE([_XOPEN_SOURCE], [500])
+  AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API])
 ])# AC_USE_SYSTEM_EXTENSIONS
 
 # gl_USE_SYSTEM_EXTENSIONS
index da8a2cc01c71a1b354c89cbcab35f13a2becef9e..3661cbda5edc84f48e41cfe630630f06bb717d93 100644 (file)
@@ -25,7 +25,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
    if isdigit is mistakenly implemented via a static inline function,
    a program containing an extern inline function that calls isdigit
    may not work since the C standard prohibits extern inline functions
-   from calling static functions.  This bug is known to occur on:
+   from calling static functions (ISO C 99 section 6.7.4.(3).
+   This bug is known to occur on:
 
      OS X 10.8 and earlier; see:
      https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
@@ -38,7 +39,18 @@ AC_DEFUN([gl_EXTERN_INLINE],
 
    OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
    for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
-   Assume DragonFly and FreeBSD will be similar.  */
+   Assume DragonFly and FreeBSD will be similar.
+
+   GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+   inline semantics, unless -fgnu89-inline is used.  It defines a macro
+   __GNUC_STDC_INLINE__ to indicate this situation or a macro
+   __GNUC_GNU_INLINE__ to indicate the opposite situation.
+   GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
+   semantics but warns, unless -fgnu89-inline is used:
+     warning: C99 inline functions are not supported; using GNU89
+     warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
+   It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
+ */
 #if (((defined __APPLE__ && defined __MACH__) \
       || defined __DragonFly__ || defined __FreeBSD__) \
      && (defined __header_inline \
index b621ae216e91065a8a6bd5d10da1992ab75a2398..470b228f7f9f9a623ca2687814eff34ddf9833bc 100644 (file)
@@ -1,4 +1,4 @@
-# fchdir.m4 serial 23
+# fchdir.m4 serial 24
 dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -31,12 +31,14 @@ AC_DEFUN([gl_FUNC_FCHDIR],
         [gl_cv_func_open_directory_works=yes],
         [gl_cv_func_open_directory_works=no],
         [case "$host_os" in
-                          # Guess yes on glibc systems.
-           *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;;
-                          # Guess no on native Windows.
-           mingw*)        gl_cv_func_open_directory_works="guessing no" ;;
-                          # If we don't know, assume the worst.
-           *)             gl_cv_func_open_directory_works="guessing no" ;;
+                            # Guess yes on Linux systems.
+           linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
+                            # Guess yes on glibc systems.
+           *-gnu* | gnu*)   gl_cv_func_open_directory_works="guessing yes" ;;
+                            # Guess no on native Windows.
+           mingw*)          gl_cv_func_open_directory_works="guessing no" ;;
+                            # 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
index 4dc3daa2faf89e664c938a32631a696599e2b215..cffb9de1765f4a8ff0f91e2a034c5d48a766f30f 100644 (file)
@@ -1,4 +1,4 @@
-# fcntl-o.m4 serial 5
+# fcntl-o.m4 serial 6
 dnl Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,17 +6,15 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Paul Eggert.
 
+AC_PREREQ([2.60])
+
 # Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
 # Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
 # Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
 AC_DEFUN([gl_FCNTL_O_FLAGS],
 [
   dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
-  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_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CHECK_HEADERS_ONCE([unistd.h])
index 8967cf1539572e987313f97fe57c98e49232c10f..86c246e8996d8cdd357be6fa01229ae933cf0836 100644 (file)
@@ -1,4 +1,4 @@
-# fseeko.m4 serial 18
+# fseeko.m4 serial 19
 dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -68,7 +68,10 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
 # Prerequisites of lib/fseeko.c.
 AC_DEFUN([gl_PREREQ_FSEEKO],
 [
-  dnl Native Windows has the function _fseeki64. mingw hides it, but mingw64
-  dnl makes it usable again.
+  dnl Native Windows has the function _fseeki64. mingw hides it in some
+  dnl circumstances, but mingw64 makes it usable again.
   AC_CHECK_FUNCS([_fseeki64])
+  if test $ac_cv_func__fseeki64 = yes; then
+    AC_CHECK_DECLS([_fseeki64])
+  fi
 ])
index 2875fe590b15831495048dab25e6e49d0f128bcc..019934d5807d2d3c4caa9837c98a7ab1c19db9f2 100644 (file)
@@ -6,7 +6,7 @@
 # with or without modifications, as long as this notice is preserved.
 
 # Written by Paul Eggert.
-# serial 15
+# serial 16
 
 AC_DEFUN([gl_FUNC_GETCWD_NULL],
   [
@@ -25,7 +25,7 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
          char *getcwd ();
 #        endif
 ]], [[
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* mingw cwd does not start with '/', but getcwd does allocate.
    However, mingw fails to honor non-zero size.  */
 #else
index ad355463cce96ed87aa6bcf09e897ac1f8614ce7..671b70d5ab28c90b6491d3fc13bbfcea79942b40 100644 (file)
@@ -1,4 +1,4 @@
-# gettime.m4 serial 8
+# gettime.m4 serial 9
 dnl Copyright (C) 2002, 2004-2006, 2009-2018 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,5 +9,5 @@ AC_DEFUN([gl_GETTIME],
   dnl Prerequisites of lib/gettime.c.
   AC_REQUIRE([gl_CLOCK_TIME])
   AC_REQUIRE([gl_TIMESPEC])
-  AC_CHECK_FUNCS_ONCE([gettimeofday nanotime])
+  AC_CHECK_FUNCS_ONCE([gettimeofday])
 ])
index 1f833d96bc4d5794378818b3d84b140221be4203..507dad6ec8a0711ca5e5e35dceeeef2119b411cd 100644 (file)
 
 # Set GNU_MAKE if we are using a recent-enough version of GNU make.
 
-# Use --version AND trailing junk, because SGI Make doesn't fail on --version.
-
 AC_DEFUN([gl_GNU_MAKE],
 [
   AM_CONDITIONAL([GNU_MAKE],
-    [${MAKE-make} --version /cannot/make/this >/dev/null 2>&1])
+    [LC_ALL=C ${MAKE-make} --version 2>/dev/null | sed -e '2,$d' | grep GNU >/dev/null])
 ])
index de65f6b82e87c472dcc3c7bae685df6e02c56513..2b253dabf520bd636e5f2333476331db1a87cd44 100644 (file)
@@ -1,9 +1,11 @@
-# gnulib-common.m4 serial 38
+# gnulib-common.m4 serial 41
 dnl Copyright (C) 2007-2018 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_PREREQ([2.62])
+
 # gl_COMMON
 # is expanded unconditionally through gnulib-tool magic.
 AC_DEFUN([gl_COMMON], [
@@ -14,12 +16,15 @@ AC_DEFUN([gl_COMMON], [
 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)
+#ifndef _Noreturn
+# if 201103 <= (defined __cplusplus ? __cplusplus : 0)
+#  define _Noreturn [[noreturn]]
+# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+        || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))
+   /* _Noreturn works as-is.  */
+# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
 #  define _Noreturn __attribute__ ((__noreturn__))
-# elif defined _MSC_VER && 1200 <= _MSC_VER
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
 #  define _Noreturn __declspec (noreturn)
 # else
 #  define _Noreturn
@@ -72,6 +77,13 @@ AC_DEFUN([gl_COMMON_BODY], [
 #else
 # define _GL_ATTRIBUTE_CONST /* empty */
 #endif
+
+/* The __malloc__ attribute was added in gcc 3.  */
+#if 3 <= __GNUC__
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+#else
+# define _GL_ATTRIBUTE_MALLOC /* empty */
+#endif
 ])
   dnl Preparation for running test programs:
   dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
@@ -207,13 +219,6 @@ AC_DEFUN([gl_FEATURES_H],
   AC_SUBST([HAVE_FEATURES_H])
 ])
 
-# m4_foreach_w
-# is a backport of autoconf-2.59c's m4_foreach_w.
-# Remove this macro when we can assume autoconf >= 2.60.
-m4_ifndef([m4_foreach_w],
-  [m4_define([m4_foreach_w],
-    [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
-
 # AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH])
 # ----------------------------------------------------
 # Backport of autoconf-2.63b's macro.
@@ -226,7 +231,6 @@ m4_ifndef([AS_VAR_IF],
 # 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
 #   <https://lists.gnu.org/r/bug-gnulib/2011-09/msg00367.html>,
 #   but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
@@ -315,25 +319,6 @@ Amsterdam
   AC_SUBST([RANLIB])
 ])
 
-# 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.
-# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
-m4_ifndef([AC_AUTOCONF_VERSION],[
-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)'
-     AC_SUBST([MKDIR_P])])])
-])
-
 # AC_C_RESTRICT
 # This definition is copied from post-2.69 Autoconf and overrides the
 # AC_C_RESTRICT macro from autoconf 2.60..2.69.  It can be removed
@@ -347,16 +332,16 @@ AC_DEFUN([AC_C_RESTRICT],
    for ac_kw in __restrict __restrict__ _Restrict restrict; do
      AC_COMPILE_IFELSE(
       [AC_LANG_PROGRAM(
-        [[typedef int *int_ptr;
-          int foo (int_ptr $ac_kw ip) { return ip[0]; }
-          int bar (int [$ac_kw]); /* Catch GCC bug 14050.  */
-          int bar (int ip[$ac_kw]) { return ip[0]; }
-        ]],
-        [[int s[1];
-          int *$ac_kw t = s;
-          t[0] = 0;
-          return foo (t) + bar (t);
-        ]])],
+         [[typedef int *int_ptr;
+           int foo (int_ptr $ac_kw ip) { return ip[0]; }
+           int bar (int [$ac_kw]); /* Catch GCC bug 14050.  */
+           int bar (int ip[$ac_kw]) { return ip[0]; }
+         ]],
+         [[int s[1];
+           int *$ac_kw t = s;
+           t[0] = 0;
+           return foo (t) + bar (t);
+         ]])],
       [ac_cv_c_restrict=$ac_kw])
      test "$ac_cv_c_restrict" != no && break
    done
@@ -407,61 +392,3 @@ AC_DEFUN([gl_CACHE_VAL_SILENT],
 # AS_VAR_COPY was added in autoconf 2.63b
 m4_define_default([AS_VAR_COPY],
 [AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
-
-# AC_PROG_SED was added in autoconf 2.59b
-m4_ifndef([AC_PROG_SED],
-[AC_DEFUN([AC_PROG_SED],
-[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
-    [dnl ac_script should not contain more than 99 commands (for HP-UX sed),
-     dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
-     ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-     for ac_i in 1 2 3 4 5 6 7; do
-       ac_script="$ac_script$as_nl$ac_script"
-     done
-     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
-     AS_UNSET([ac_script])
-     if test -z "$SED"; then
-       ac_path_SED_found=false
-       _AS_PATH_WALK([], [
-         for ac_prog in sed gsed; do
-           for ac_exec_ext in '' $ac_executable_extensions; do
-             ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-             AS_EXECUTABLE_P(["$ac_path_SED"]) || continue
-             case `"$ac_path_SED" --version 2>&1` in
-               *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;;
-               *)
-                 ac_count=0
-                 _AS_ECHO_N([0123456789]) >conftest.in
-                 while :
-                 do
-                   cat conftest.in conftest.in >conftest.tmp
-                   mv conftest.tmp conftest.in
-                   cp conftest.in conftest.nl
-                   echo >> conftest.nl
-                   "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
-                   diff conftest.out conftest.nl >/dev/null 2>&1 || break
-                   ac_count=`expr $ac_count + 1`
-                   if test $ac_count -gt ${ac_path_SED_max-0}; then
-                     # Best so far, but keep looking for better
-                     ac_cv_path_SED=$ac_path_SED
-                     ac_path_SED_max=$ac_count
-                   fi
-                   test $ac_count -gt 10 && break
-                 done
-                 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-             esac
-             $ac_path_SED_found && break 3
-           done
-         done])
-       if test -z "$ac_cv_path_SED"; then
-         AC_ERROR([no acceptable sed could be found in \$PATH])
-       fi
-     else
-       ac_cv_path_SED=$SED
-     fi
-    ])
- SED="$ac_cv_path_SED"
- AC_SUBST([SED])dnl
- rm -f conftest.sed
-])
-])
index db06ae80b5a4823d1f19faac00444a12b10bfda6..773ea1cd9c94258ac7a02598a1518b56a1250077 100644 (file)
@@ -120,7 +120,6 @@ AC_DEFUN([gl_EARLY],
   # Code from module gnumakefile:
   # Code from module gnupload:
   # Code from module havelib:
-  # Code from module host-cpu-c-abi:
   # Code from module ignore-value:
   # Code from module include_next:
   # Code from module intprops:
@@ -160,6 +159,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module printf-frexpl:
   # Code from module printf-posix:
   # Code from module printf-safe:
+  # Code from module raise:
   # Code from module readdir:
   # Code from module readme-release:
   # Code from module realloc-gnu:
@@ -167,7 +167,10 @@ AC_DEFUN([gl_EARLY],
   # Code from module rmdir:
   # Code from module save-cwd:
   # Code from module savedir:
+  # Code from module sigaction:
+  # Code from module signal-h:
   # Code from module signbit:
+  # Code from module sigprocmask:
   # Code from module size_max:
   # Code from module snippet/_Noreturn:
   # Code from module snippet/arg-nonnull:
@@ -453,7 +456,6 @@ AC_DEFUN([gl_INIT],
           m4_defn([m4_PACKAGE_VERSION])), [1], [],
         [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
           [GNUmakefile=$GNUmakefile])])
-  AC_REQUIRE([gl_HOST_CPU_C_ABI])
   gl_FUNC_ISNAND_NO_LIBM
   if test $gl_func_isnand_no_libm != yes; then
     AC_LIBOBJ([isnand])
@@ -561,6 +563,12 @@ AC_DEFUN([gl_INIT],
   gl_FUNC_PRINTF_POSIX
   gl_STDIO_MODULE_INDICATOR([printf-posix])
   m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes])
+  gl_FUNC_RAISE
+  if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then
+    AC_LIBOBJ([raise])
+    gl_PREREQ_RAISE
+  fi
+  gl_SIGNAL_MODULE_INDICATOR([raise])
   gl_FUNC_READDIR
   if test $HAVE_READDIR = 0; then
     AC_LIBOBJ([readdir])
@@ -583,6 +591,13 @@ AC_DEFUN([gl_INIT],
   gl_UNISTD_MODULE_INDICATOR([rmdir])
   gl_SAVE_CWD
   gl_SAVEDIR
+  gl_SIGACTION
+  if test $HAVE_SIGACTION = 0; then
+    AC_LIBOBJ([sigaction])
+    gl_PREREQ_SIGACTION
+  fi
+  gl_SIGNAL_MODULE_INDICATOR([sigaction])
+  gl_SIGNAL_H
   gl_SIGNBIT
   if test $REPLACE_SIGNBIT = 1; then
     AC_LIBOBJ([signbitf])
@@ -590,6 +605,12 @@ AC_DEFUN([gl_INIT],
     AC_LIBOBJ([signbitl])
   fi
   gl_MATH_MODULE_INDICATOR([signbit])
+  gl_SIGNALBLOCKING
+  if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+    AC_LIBOBJ([sigprocmask])
+    gl_PREREQ_SIGPROCMASK
+  fi
+  gl_SIGNAL_MODULE_INDICATOR([sigprocmask])
   gl_SIZE_MAX
   gt_TYPE_SSIZE_T
   gl_FUNC_STAT
@@ -941,7 +962,6 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/malloc.c
   lib/malloca.c
   lib/malloca.h
-  lib/malloca.valgrind
   lib/math.c
   lib/math.in.h
   lib/memchr.c
@@ -974,6 +994,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/printf-parse.c
   lib/printf-parse.h
   lib/printf.c
+  lib/raise.c
   lib/readdir.c
   lib/realloc.c
   lib/rmdir.c
@@ -981,9 +1002,14 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/save-cwd.h
   lib/savedir.c
   lib/savedir.h
+  lib/sig-handler.c
+  lib/sig-handler.h
+  lib/sigaction.c
+  lib/signal.in.h
   lib/signbitd.c
   lib/signbitf.c
   lib/signbitl.c
+  lib/sigprocmask.c
   lib/size_max.h
   lib/stat-time.c
   lib/stat-time.h
@@ -1139,11 +1165,15 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/printf-posix-rpl.m4
   m4/printf.m4
   m4/pthread_rwlock_rdlock.m4
+  m4/raise.m4
   m4/readdir.m4
   m4/realloc.m4
   m4/rmdir.m4
   m4/save-cwd.m4
   m4/savedir.m4
+  m4/sigaction.m4
+  m4/signal_h.m4
+  m4/signalblocking.m4
   m4/signbit.m4
   m4/size_max.m4
   m4/ssize_t.m4
index dd7c5235b8d27d4138554e685a238d783622f10c..cd88070ea2acf3c5e30bb439314e64da7f894bdb 100644 (file)
@@ -1,4 +1,4 @@
-# host-cpu-c-abi.m4 serial 8
+# host-cpu-c-abi.m4 serial 11
 dnl Copyright (C) 2002-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -135,7 +135,7 @@ changequote([,])dnl
             echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
             # Look for a reference to the register d0 in the .s file.
             AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
-            if LC_ALL=C grep -E 'd0,' conftest.$gl_asmext >/dev/null; then
+            if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
               gl_cv_host_cpu_c_abi=armhf
             else
               gl_cv_host_cpu_c_abi=arm
@@ -237,6 +237,60 @@ changequote([,])dnl
          gl_cv_host_cpu_c_abi=powerpc
          ;;
 
+       riscv32 | riscv64 )
+         # There are 2 architectures (with variants): rv32* and rv64*.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if __riscv_xlen == 64
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [cpu=riscv64],
+           [cpu=riscv32])
+         # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+         # Size of 'long' and 'void *':
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __LP64__
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [main_abi=lp64],
+           [main_abi=ilp32])
+         # Float ABIs:
+         # __riscv_float_abi_double:
+         #   'float' and 'double' are passed in floating-point registers.
+         # __riscv_float_abi_single:
+         #   'float' are passed in floating-point registers.
+         # __riscv_float_abi_soft:
+         #   No values are passed in floating-point registers.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __riscv_float_abi_double
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [float_abi=d],
+           [AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if defined __riscv_float_abi_single
+                     int ok;
+                   #else
+                     error fail
+                   #endif
+                 ]])],
+              [float_abi=f],
+              [float_abi=''])
+           ])
+         gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
+         ;;
+
        s390* )
          # On s390x, the C compiler may be generating 64-bit (= s390x) code
          # or 31-bit (= s390) code.
@@ -349,6 +403,39 @@ EOF
 #ifndef __powerpc64_elfv2__
 #undef __powerpc64_elfv2__
 #endif
+#ifndef __riscv32__
+#undef __riscv32__
+#endif
+#ifndef __riscv64__
+#undef __riscv64__
+#endif
+#ifndef __riscv32_ilp32__
+#undef __riscv32_ilp32__
+#endif
+#ifndef __riscv32_ilp32f__
+#undef __riscv32_ilp32f__
+#endif
+#ifndef __riscv32_ilp32d__
+#undef __riscv32_ilp32d__
+#endif
+#ifndef __riscv64_ilp32__
+#undef __riscv64_ilp32__
+#endif
+#ifndef __riscv64_ilp32f__
+#undef __riscv64_ilp32f__
+#endif
+#ifndef __riscv64_ilp32d__
+#undef __riscv64_ilp32d__
+#endif
+#ifndef __riscv64_lp64__
+#undef __riscv64_lp64__
+#endif
+#ifndef __riscv64_lp64f__
+#undef __riscv64_lp64f__
+#endif
+#ifndef __riscv64_lp64d__
+#undef __riscv64_lp64d__
+#endif
 #ifndef __s390__
 #undef __s390__
 #endif
@@ -367,3 +454,191 @@ EOF
 ])
 
 ])
+
+
+dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
+dnl (application binary interface) is a 32-bit one, or to 'no' otherwise.
+dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
+AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
+    [if test -n "$gl_cv_host_cpu_c_abi"; then
+       case "$gl_cv_host_cpu_c_abi" in
+         i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+           gl_cv_host_cpu_c_abi_32bit=yes ;;
+         *)
+           gl_cv_host_cpu_c_abi_32bit=no ;;
+       esac
+     else
+       case "$host_cpu" in
+
+changequote(,)dnl
+         i[4567]86 )
+changequote([,])dnl
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         x86_64 )
+           # On x86_64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+           # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+           #   with native Windows (mingw, MSVC).
+           # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if (defined __x86_64__ || defined __amd64__ \
+                       || defined _M_X64 || defined _M_AMD64) \
+                      && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         arm* | aarch64 )
+           # Assume arm with EABI.
+           # On arm64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+           # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+           # On hppa, the C compiler may be generating 32-bit code or 64-bit
+           # code. In the latter case, it defines _LP64 and __LP64__.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#ifdef __LP64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         ia64* )
+           # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+           # 32-bit code. In the latter case, it defines _ILP32.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#ifdef _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=yes],
+             [gl_cv_host_cpu_c_abi_32bit=no])
+           ;;
+
+         mips* )
+           # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+           # at 32.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         powerpc* )
+           # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+           # No need to distinguish them here; the caller may distinguish
+           # them based on the OS.
+           # On powerpc64 systems, the C compiler may still be generating
+           # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+           # be generating 64-bit code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __powerpc64__ || defined _ARCH_PPC64
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         rs6000 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         riscv32 | riscv64 )
+           # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+           # Size of 'long' and 'void *':
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __LP64__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         s390* )
+           # On s390x, the C compiler may be generating 64-bit (= s390x) code
+           # or 31-bit (= s390) code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __LP64__ || defined __s390x__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         sparc | sparc64 )
+           # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+           # C compiler still generates 32-bit code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __sparcv9 || defined __arch64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         *)
+           gl_cv_host_cpu_c_abi_32bit=no
+           ;;
+       esac
+     fi
+    ])
+
+  HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+])
index 4a4a185e3cf14326a0440e781b9a1aba5a0be599..dee3300d035931d0ec423068c522df94a0fc096d 100644 (file)
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 26 (gettext-0.18.2)
+# lib-link.m4 serial 28
 dnl Copyright (C) 2001-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,7 +6,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
-AC_PREREQ([2.54])
+AC_PREREQ([2.61])
 
 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
 dnl the libraries corresponding to explicit and implicit dependencies.
@@ -124,8 +124,8 @@ 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])])
+  dnl Complain if config.rpath is missing.
+  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
@@ -187,17 +187,15 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
   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]],
+  AC_ARG_WITH(PACK[-prefix],
+[[  --with-]]PACK[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
+  --without-]]PACK[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
 [
     if test "X$withval" = "Xno"; then
       use_additional=no
@@ -211,7 +209,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
         additional_includedir="$withval/include"
         additional_libdir="$withval/$acl_libdirstem"
         if test "$acl_libdirstem2" != "$acl_libdirstem" \
-           && ! test -d "$withval/$acl_libdirstem"; then
+           && test ! -d "$withval/$acl_libdirstem"; then
           additional_libdir="$withval/$acl_libdirstem2"
         fi
       fi
@@ -670,7 +668,6 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
     done
   fi
-  popdef([P_A_C_K])
   popdef([PACKLIBS])
   popdef([PACKUP])
   popdef([PACK])
index 16b26fb2a8dd191b139a54eb34a1937c396a4048..2e90b11a8754ef701160c2fadfd5188182697e3f 100644 (file)
@@ -1,4 +1,4 @@
-# lib-prefix.m4 serial 11
+# lib-prefix.m4 serial 14
 dnl Copyright (C) 2001-2005, 2008-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,13 +6,6 @@ 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
@@ -32,9 +25,9 @@ AC_DEFUN([AC_LIB_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],
+  AC_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
@@ -174,7 +167,24 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
   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])
-  AC_REQUIRE([gl_HOST_CPU_C_ABI])
+  AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
+
+  case "$host_os" in
+    solaris*)
+      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
+        [AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#ifdef _LP64
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_solaris_64bit=yes],
+           [gl_cv_solaris_64bit=no])
+        ]);;
+  esac
+
   dnl Allow the user to override the result by setting acl_cv_libdirstems.
   AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
     [acl_cv_libdirstems],
@@ -187,18 +197,6 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
          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_COMPILE_IFELSE(
-              [AC_LANG_SOURCE(
-                 [[#ifdef _LP64
-                    int ok;
-                   #else
-                    error fail
-                   #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
@@ -210,40 +208,36 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
        *)
          dnl If $CC generates code for a 32-bit ABI, the libraries are
          dnl surely under $prefix/lib, not $prefix/lib64.
-         case "$gl_cv_host_cpu_c_abi" in
-           i386 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | s390 | sparc)
-             ;;
-           *) # x86_64 | arm64 | hppa64 | ia64 | mips64 | powerpc64* | s390x | sparc64 | ...
-             dnl The result is a property of the system. However, non-system
-             dnl compilers sometimes have odd library search paths. Therefore
-             dnl prefer asking /usr/bin/gcc, if available, rather than $CC.
-             searchpath=`(if test -f /usr/bin/gcc \
-                             && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \
-                            LC_ALL=C /usr/bin/gcc -print-search-dirs; \
-                          else \
-                            LC_ALL=C $CC -print-search-dirs; \
-                          fi) 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
+         if test "$HOST_CPU_C_ABI_32BIT" != yes; then
+           dnl The result is a property of the system. However, non-system
+           dnl compilers sometimes have odd library search paths. Therefore
+           dnl prefer asking /usr/bin/gcc, if available, rather than $CC.
+           searchpath=`(if test -f /usr/bin/gcc \
+                           && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \
+                          LC_ALL=C /usr/bin/gcc -print-search-dirs; \
+                        else \
+                          LC_ALL=C $CC -print-search-dirs; \
+                        fi) 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
+         fi
          ;;
      esac
      test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
index 511dcef5e04d68ca21df71f9d9cc5e4e31fbc2cd..3a2cd91ead06b98b26fab0dd70b0edf60c8736db 100644 (file)
@@ -11,14 +11,18 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
 [
   gl_CHECK_NEXT_HEADERS([limits.h])
 
-  AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.],
+  AC_CACHE_CHECK([whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.],
     [gl_cv_header_limits_width],
     [AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
-                           #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
-                          #endif
-                          #include <limits.h>
-                          int ullw = ULLONG_WIDTH;]])],
+       [AC_LANG_PROGRAM(
+          [[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+             #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+            #endif
+            #include <limits.h>
+            long long llm = LLONG_MAX;
+            int wb = WORD_BIT;
+            int ullw = ULLONG_WIDTH;
+          ]])],
        [gl_cv_header_limits_width=yes],
        [gl_cv_header_limits_width=no])])
   if test "$gl_cv_header_limits_width" = yes; then
@@ -29,3 +33,11 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
   AC_SUBST([LIMITS_H])
   AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
 ])
+
+dnl Unconditionally enables the replacement of <limits.h>.
+AC_DEFUN([gl_REPLACE_LIMITS_H],
+[
+  AC_REQUIRE([gl_LIMITS_H])
+  LIMITS_H='limits.h'
+  AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+])
index 27e63265a8168d4c0211002b21a6365d223bebe7..582af53f6c4db8f5f53a7596c69a65f3efab46cd 100644 (file)
@@ -1,4 +1,4 @@
-# longlong.m4 serial 17
+# longlong.m4 serial 18
 dnl Copyright (C) 1999-2007, 2009-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,9 +6,10 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Paul Eggert.
 
+AC_PREREQ([2.62])
+
 # Define HAVE_LONG_LONG_INT if 'long long int' works.
-# This fixes a bug in Autoconf 2.61, and can be faster
-# than what's in Autoconf 2.62 through 2.68.
+# This 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
@@ -56,8 +57,7 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT],
 ])
 
 # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
-# This fixes a bug in Autoconf 2.61, and can be faster
-# than what's in Autoconf 2.62 through 2.68.
+# This 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
index ac6f143ce7dd86166e310bfb71899bdbd1cc33fa..3694e4ceaf74f594c7c7da147ba3d702c43c1341 100644 (file)
@@ -1,4 +1,4 @@
-# serial 31
+# serial 32
 
 # Copyright (C) 1997-2001, 2003-2018 Free Software Foundation, Inc.
 #
@@ -53,6 +53,9 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
        [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
        [gl_cv_func_lstat_dereferences_slashed_symlink=no],
        [case "$host_os" in
+          linux-* | linux)
+            # Guess yes on Linux systems.
+            gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
           *-gnu* | gnu*)
             # Guess yes on glibc systems.
             gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
index 0ded9ba219995caf448ab35ba289d631a75d9fbd..4c182b4140650efaf2c340b60d0ef833cd69d4b8 100644 (file)
@@ -1,4 +1,4 @@
-# malloc.m4 serial 16
+# malloc.m4 serial 17
 dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -91,7 +91,7 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
       AC_COMPILE_IFELSE(
         [AC_LANG_PROGRAM(
            [[]],
-           [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+           [[#if defined _WIN32 && ! defined __CYGWIN__
              choke me
              #endif
             ]])],
index dda3d468aefe89392ed28e80872db396821aeda9..d831ed2eb60ab537a446c18e20a54a421e4fb015 100644 (file)
@@ -1,4 +1,4 @@
-# manywarnings.m4 serial 13
+# manywarnings.m4 serial 17
 dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -51,54 +51,53 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
 
     dnl Check if -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])
+    AC_CACHE_CHECK([whether -Wno-missing-field-initializers is supported],
+      [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"
+      ])
 
     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(
-             [[int f (void)
-               {
-                 typedef struct { int a; int b; } s_t;
-                 s_t s1 = { 0, };
-                 return s1.b;
-               }
-             ]],
-             [[]])],
-          [gl_cv_cc_nomfi_needed=no],
-          [gl_cv_cc_nomfi_needed=yes])
-        CFLAGS="$gl_save_CFLAGS"
-      ])
-      AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
+      AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed],
+        [gl_cv_cc_nomfi_needed],
+        [gl_save_CFLAGS="$CFLAGS"
+         CFLAGS="$CFLAGS -W -Werror"
+         AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[int f (void)
+                {
+                  typedef struct { int a; int b; } s_t;
+                  s_t s1 = { 0, };
+                  return s1.b;
+                }
+              ]],
+              [[]])],
+           [gl_cv_cc_nomfi_needed=no],
+           [gl_cv_cc_nomfi_needed=yes])
+         CFLAGS="$gl_save_CFLAGS"
+        ])
     fi
 
     dnl Next, check if -Werror -Wuninitialized is useful with the
     dnl user's choice of $CFLAGS; some versions of gcc warn that it
     dnl has no effect if -O is not also used
-    AC_MSG_CHECKING([whether -Wuninitialized is supported])
-    AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -Werror -Wuninitialized"
-      AC_COMPILE_IFELSE(
-        [AC_LANG_PROGRAM([[]], [[]])],
-        [gl_cv_cc_uninitialized_supported=yes],
-        [gl_cv_cc_uninitialized_supported=no])
-      CFLAGS="$gl_save_CFLAGS"])
-    AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported])
+    AC_CACHE_CHECK([whether -Wuninitialized is supported],
+      [gl_cv_cc_uninitialized_supported],
+      [gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -Werror -Wuninitialized"
+       AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[]], [[]])],
+         [gl_cv_cc_uninitialized_supported=yes],
+         [gl_cv_cc_uninitialized_supported=no])
+       CFLAGS="$gl_save_CFLAGS"
+      ])
 
   fi
 
@@ -106,18 +105,17 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
   # To compare this list to your installed GCC's, run this Bash command:
   #
   # comm -3 \
-  #  <(sed -n 's/^  *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
-  #  <(gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort |
-  #      grep -v -x -F -f <(
-  #         awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec))
+  #  <((sed -n 's/^  *\(-[^ 0-9][^ ]*\) .*/\1/p' manywarnings.m4; \
+  #     awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec) | sort) \
+  #  <(LC_ALL=C gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort)
 
   gl_manywarn_set=
   for gl_manywarn_item in -fno-common \
     -W \
-    -Wabi \
     -Waddress \
     -Waggressive-loop-optimizations \
     -Wall \
+    -Wattribute-alias \
     -Wattributes \
     -Wbad-function-cast \
     -Wbool-compare \
@@ -125,8 +123,9 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Wbuiltin-declaration-mismatch \
     -Wbuiltin-macro-redefined \
     -Wcast-align \
+    -Wcast-align=strict \
+    -Wcast-function-type \
     -Wchar-subscripts \
-    -Wchkp \
     -Wclobbered \
     -Wcomment \
     -Wcomments \
@@ -160,6 +159,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Wframe-address \
     -Wfree-nonheap-object \
     -Whsa \
+    -Wif-not-aligned \
     -Wignored-attributes \
     -Wignored-qualifiers \
     -Wimplicit \
@@ -173,7 +173,6 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Wint-to-pointer-cast \
     -Winvalid-memory-model \
     -Winvalid-pch \
-    -Wjump-misses-init \
     -Wlogical-not-parentheses \
     -Wlogical-op \
     -Wmain \
@@ -181,6 +180,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Wmemset-elt-size \
     -Wmemset-transposed-args \
     -Wmisleading-indentation \
+    -Wmissing-attributes \
     -Wmissing-braces \
     -Wmissing-declarations \
     -Wmissing-field-initializers \
@@ -188,6 +188,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Wmissing-parameter-type \
     -Wmissing-prototypes \
     -Wmultichar \
+    -Wmultistatement-macros \
     -Wnarrowing \
     -Wnested-externs \
     -Wnonnull \
@@ -202,6 +203,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Woverride-init \
     -Wpacked \
     -Wpacked-bitfield-compat \
+    -Wpacked-not-aligned \
     -Wparentheses \
     -Wpointer-arith \
     -Wpointer-compare \
@@ -219,20 +221,23 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
     -Wshift-count-overflow \
     -Wshift-negative-value \
     -Wsizeof-array-argument \
+    -Wsizeof-pointer-div \
     -Wsizeof-pointer-memaccess \
     -Wstack-protector \
     -Wstrict-aliasing \
     -Wstrict-overflow \
     -Wstrict-prototypes \
+    -Wstringop-truncation \
+    -Wsuggest-attribute=cold \
     -Wsuggest-attribute=const \
     -Wsuggest-attribute=format \
+    -Wsuggest-attribute=malloc \
     -Wsuggest-attribute=noreturn \
     -Wsuggest-attribute=pure \
     -Wsuggest-final-methods \
     -Wsuggest-final-types \
     -Wswitch \
     -Wswitch-bool \
-    -Wswitch-default \
     -Wswitch-unreachable \
     -Wsync-nand \
     -Wsystem-headers \
index 87b2d4cbf69697433ba19691ead09a672cf8f1f0..49140074d08596e3388c42fbfd9a27005e3e3ab5 100644 (file)
@@ -1,4 +1,4 @@
-# nocrash.m4 serial 4
+# nocrash.m4 serial 5
 dnl Copyright (C) 2005, 2009-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -79,7 +79,7 @@ nocrash_init (void)
     }
   }
 }
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
 /* Avoid a crash on native Windows.  */
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
index 403a37534d88f3986230a3b90eeb6ed58cec8a0c..292a25697116aed451359f81018b833b8031aff2 100644 (file)
@@ -1,4 +1,4 @@
-# pathmax.m4 serial 10
+# pathmax.m4 serial 11
 dnl Copyright (C) 2002-2003, 2005-2006, 2009-2018 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -29,7 +29,7 @@ AC_DEFUN([gl_PATHMAX_SNIPPET], [[
 # undef PATH_MAX
 # define PATH_MAX 1024
 #endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # undef PATH_MAX
 # define PATH_MAX 260
 #endif
index 82f48bfd308457abed0aac0b6313b86637213d24..e5f7b39a1227d09af1dd4705a83a7b3cf7e1c280 100644 (file)
@@ -1,4 +1,4 @@
-# printf.m4 serial 58
+# printf.m4 serial 59
 dnl Copyright (C) 2003, 2007-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -1606,6 +1606,7 @@ 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 11.4                   .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Solaris 11.3                   .  .  .  .  #  .  .  #  .  .  .  .  .  .  .  .  .  .  .  .
 dnl   Solaris 11.0                   .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  #  .  .  .  .  .  .  .
index 9c1d5d019317b5a8dc608040012df1dae9387dc5..6812b4f4e24b00b8f91520dd3323aebe0f001d48 100644 (file)
@@ -1,4 +1,4 @@
-# pthread_rwlock_rdlock.m4 serial 1
+# pthread_rwlock_rdlock.m4 serial 2
 dnl Copyright (C) 2017-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -23,12 +23,14 @@ dnl time, a phenomenon called "writer starvation".
 dnl Without such a guarantee, applications have a hard time avoiding writer
 dnl starvation.
 dnl
-dnl POSIX:2008 makes this requirement only for implementations that support TPS
+dnl POSIX:2017 makes this requirement only for implementations that support TPS
 dnl (Thread Priority Scheduling) and only for the scheduling policies SCHED_FIFO
 dnl and SCHED_RR, see
 dnl http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html
-dnl but test verifies the guarantee regardless of TPS and regardless of
+dnl but this test verifies the guarantee regardless of TPS and regardless of
 dnl scheduling policy.
+dnl Glibc currently does not provide this guarantee, see
+dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701
 AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
 [
   AC_REQUIRE([gl_THREADLIB_EARLY])
diff --git a/m4/raise.m4 b/m4/raise.m4
new file mode 100644 (file)
index 0000000..761e4b9
--- /dev/null
@@ -0,0 +1,36 @@
+# raise.m4 serial 4
+dnl Copyright (C) 2011-2018 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_RAISE],
+[
+  AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CHECK_FUNCS([raise])
+  if test $ac_cv_func_raise = no; then
+    HAVE_RAISE=0
+  else
+    m4_ifdef([gl_MSVC_INVAL], [
+      AC_REQUIRE([gl_MSVC_INVAL])
+      if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+        REPLACE_RAISE=1
+      fi
+    ])
+    m4_ifdef([gl_SIGNALBLOCKING], [
+      gl_SIGNALBLOCKING
+      if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+        m4_ifdef([gl_SIGNAL_SIGPIPE], [
+          gl_SIGNAL_SIGPIPE
+          if test $gl_cv_header_signal_h_SIGPIPE != yes; then
+            REPLACE_RAISE=1
+          fi
+        ], [:])
+      fi
+    ])
+  fi
+])
+
+# Prerequisites of lib/raise.c.
+AC_DEFUN([gl_PREREQ_RAISE], [:])
index 36c45146f654c422c1afe74f328dc0ea19f23239..a24d845e37b970f578efcad4839e006037b623cc 100644 (file)
@@ -1,4 +1,4 @@
-# rmdir.m4 serial 15
+# rmdir.m4 serial 16
 dnl Copyright (C) 2002, 2005, 2009-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -33,12 +33,14 @@ AC_DEFUN([gl_FUNC_RMDIR],
     ]])],
        [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
        [case "$host_os" in
-                         # Guess yes on glibc systems.
-          *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
-                         # Guess no on native Windows.
-          mingw*)        gl_cv_func_rmdir_works="guessing no" ;;
-                         # If we don't know, assume the worst.
-          *)             gl_cv_func_rmdir_works="guessing no" ;;
+                           # Guess yes on Linux systems.
+          linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
+                           # Guess yes on glibc systems.
+          *-gnu* | gnu*)   gl_cv_func_rmdir_works="guessing yes" ;;
+                           # Guess no on native Windows.
+          mingw*)          gl_cv_func_rmdir_works="guessing no" ;;
+                           # If we don't know, assume the worst.
+          *)               gl_cv_func_rmdir_works="guessing no" ;;
         esac
        ])
      rm -rf conftest.dir conftest.file])
diff --git a/m4/sigaction.m4 b/m4/sigaction.m4
new file mode 100644 (file)
index 0000000..f6918fa
--- /dev/null
@@ -0,0 +1,40 @@
+# sigaction.m4 serial 7
+dnl Copyright (C) 2008-2018 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.
+
+# Determine if sigaction interface is present.
+AC_DEFUN([gl_SIGACTION],
+[
+  AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+  AC_CHECK_FUNCS_ONCE([sigaction])
+  if test $ac_cv_func_sigaction = yes; then
+    AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], , ,
+                     [[#include <signal.h>]])
+    if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then
+      HAVE_STRUCT_SIGACTION_SA_SIGACTION=0
+    fi
+  else
+    HAVE_SIGACTION=0
+  fi
+])
+
+# Prerequisites of the part of lib/signal.in.h and of lib/sigaction.c.
+AC_DEFUN([gl_PREREQ_SIGACTION],
+[
+  AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+  AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([AC_TYPE_UID_T])
+  AC_REQUIRE([gl_PREREQ_SIG_HANDLER_H])
+  AC_CHECK_FUNCS_ONCE([sigaltstack siginterrupt])
+  AC_CHECK_TYPES([siginfo_t], [], [], [[
+#include <signal.h>
+  ]])
+  if test $ac_cv_type_siginfo_t = no; then
+    HAVE_SIGINFO_T=0
+  fi
+])
+
+# Prerequisites of lib/sig-handler.h.
+AC_DEFUN([gl_PREREQ_SIG_HANDLER_H], [:])
diff --git a/m4/signal_h.m4 b/m4/signal_h.m4
new file mode 100644 (file)
index 0000000..394b91d
--- /dev/null
@@ -0,0 +1,83 @@
+# signal_h.m4 serial 18
+dnl Copyright (C) 2007-2018 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_SIGNAL_H],
+[
+  AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+  AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
+  gl_NEXT_HEADERS([signal.h])
+
+# AIX declares sig_atomic_t to already include volatile, and C89 compilers
+# then choke on 'volatile sig_atomic_t'.  C99 requires that it compile.
+  AC_CHECK_TYPE([volatile sig_atomic_t], [],
+    [HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0], [[
+#include <signal.h>
+    ]])
+
+  dnl Ensure the type pid_t gets defined.
+  AC_REQUIRE([AC_TYPE_PID_T])
+
+  AC_REQUIRE([AC_TYPE_UID_T])
+
+  dnl Persuade glibc <signal.h> to define sighandler_t.
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+  AC_CHECK_TYPE([sighandler_t], [], [HAVE_SIGHANDLER_T=0], [[
+#include <signal.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 <signal.h>
+    ]], [pthread_sigmask sigaction
+    sigaddset sigdelset sigemptyset sigfillset sigismember
+    sigpending sigprocmask])
+])
+
+AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
+[
+  AC_CHECK_TYPES([sigset_t],
+    [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no],
+    [[
+      #include <signal.h>
+      /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.  */
+      #include <sys/types.h>
+    ]])
+  if test $gl_cv_type_sigset_t != yes; then
+    HAVE_SIGSET_T=0
+  fi
+])
+
+AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_SIGNAL_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_SIGNAL_H_DEFAULTS],
+[
+  GNULIB_PTHREAD_SIGMASK=0;    AC_SUBST([GNULIB_PTHREAD_SIGMASK])
+  GNULIB_RAISE=0;              AC_SUBST([GNULIB_RAISE])
+  GNULIB_SIGNAL_H_SIGPIPE=0;   AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE])
+  GNULIB_SIGPROCMASK=0;        AC_SUBST([GNULIB_SIGPROCMASK])
+  GNULIB_SIGACTION=0;          AC_SUBST([GNULIB_SIGACTION])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING])
+  HAVE_PTHREAD_SIGMASK=1;      AC_SUBST([HAVE_PTHREAD_SIGMASK])
+  HAVE_RAISE=1;                AC_SUBST([HAVE_RAISE])
+  HAVE_SIGSET_T=1;             AC_SUBST([HAVE_SIGSET_T])
+  HAVE_SIGINFO_T=1;            AC_SUBST([HAVE_SIGINFO_T])
+  HAVE_SIGACTION=1;            AC_SUBST([HAVE_SIGACTION])
+  HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
+                               AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION])
+  HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
+                               AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T])
+  HAVE_SIGHANDLER_T=1;         AC_SUBST([HAVE_SIGHANDLER_T])
+  REPLACE_PTHREAD_SIGMASK=0;   AC_SUBST([REPLACE_PTHREAD_SIGMASK])
+  REPLACE_RAISE=0;             AC_SUBST([REPLACE_RAISE])
+])
diff --git a/m4/signalblocking.m4 b/m4/signalblocking.m4
new file mode 100644 (file)
index 0000000..4350b21
--- /dev/null
@@ -0,0 +1,25 @@
+# signalblocking.m4 serial 14
+dnl Copyright (C) 2001-2002, 2006-2018 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.
+
+# Determine available signal blocking primitives. Three different APIs exist:
+# 1) POSIX: sigemptyset, sigaddset, sigprocmask
+# 2) SYSV: sighold, sigrelse
+# 3) BSD: sigblock, sigsetmask
+# For simplicity, here we check only for the POSIX signal blocking.
+AC_DEFUN([gl_SIGNALBLOCKING],
+[
+  AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+  AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
+  if test $gl_cv_type_sigset_t = yes; then
+    AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1])
+  fi
+  if test -z "$gl_cv_func_sigprocmask"; then
+    HAVE_POSIX_SIGNALBLOCKING=0
+  fi
+])
+
+# Prerequisites of lib/sigprocmask.c.
+AC_DEFUN([gl_PREREQ_SIGPROCMASK], [:])
index 2b770e6ca309c1fcb5ed7333cb04aac09322cb5c..3e3986e15e96eb8921d59dbcc82b6f6ae2b5f040 100644 (file)
@@ -1,4 +1,4 @@
-# size_max.m4 serial 10
+# size_max.m4 serial 11
 dnl Copyright (C) 2003, 2005-2006, 2008-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,6 +6,8 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
+AC_PREREQ([2.61])
+
 AC_DEFUN([gl_SIZE_MAX],
 [
   AC_CHECK_HEADERS([stdint.h])
@@ -71,9 +73,3 @@ Found it
 # undef SIZE_MAX
 #endif])
 ])
-
-dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
-dnl Remove this when we can assume autoconf >= 2.61.
-m4_ifdef([AC_COMPUTE_INT], [], [
-  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
-])
index d762cba24ee0a1a62ff26c3ba1ad23e0de8464a4..e8ec3b2b966902813ca9a6349c532eb937279596 100644 (file)
@@ -1,4 +1,4 @@
-# serial 14
+# serial 15
 
 # Copyright (C) 2009-2018 Free Software Foundation, Inc.
 #
@@ -43,10 +43,12 @@ AC_DEFUN([gl_FUNC_STAT],
              ]])],
            [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
            [case "$host_os" in
-                             # Guess yes on glibc systems.
-              *-gnu* | 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" ;;
+                               # Guess yes on Linux systems.
+              linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
+                               # Guess yes on glibc systems.
+              *-gnu* | 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])
index ba3d201cf375ed1f445326a57c2a95270a5f1bec..07b040abdf1cba79a58676b4ea59e41730713e6d 100644 (file)
@@ -1,5 +1,5 @@
 dnl A placeholder for <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 5
+# stddef_h.m4 serial 6
 dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,13 +10,33 @@ AC_DEFUN([gl_STDDEF_H],
   AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   STDDEF_H=
-  AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h],
-    [[#include <stddef.h>
-    ]])
+
+  dnl Test whether the type max_align_t exists and whether its alignment
+  dnl "is as great as is supported by the implementation in all contexts".
+  AC_CACHE_CHECK([for good max_align_t],
+    [gl_cv_type_max_align_t],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <stddef.h>
+            unsigned int s = sizeof (max_align_t);
+            #if defined __GNUC__ || defined __IBM__ALIGNOF__
+            int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
+            int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
+            #endif
+          ]])],
+       [gl_cv_type_max_align_t=yes],
+       [gl_cv_type_max_align_t=no])
+    ])
+  if test $gl_cv_type_max_align_t = no; then
+    HAVE_MAX_ALIGN_T=0
+    STDDEF_H=stddef.h
+  fi
+
   if test $gt_cv_c_wchar_t = no; then
     HAVE_WCHAR_T=0
     STDDEF_H=stddef.h
   fi
+
   AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
     [gl_cv_decl_null_works],
     [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
@@ -28,6 +48,7 @@ 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
index b86184c2ea6f8294fc2c49016f6432bd8e136cf9..81d065f655bf1d81119303b6c5cd5c450fb94eab 100644 (file)
@@ -1,4 +1,4 @@
-# stdint.m4 serial 51
+# stdint.m4 serial 53
 dnl Copyright (C) 2001-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,6 +7,8 @@ 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_PREREQ([2.61])
+
 AC_DEFUN_ONCE([gl_STDINT_H],
 [
   AC_PREREQ([2.59])dnl
@@ -364,8 +366,7 @@ int32_t i32 = INT32_C (0x7fffffff);
   esac
 
   dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
-  LIMITS_H=limits.h
-  AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+  gl_REPLACE_LIMITS_H
 
   AC_SUBST([HAVE_C99_STDINT_H])
   AC_SUBST([HAVE_SYS_BITYPES_H])
@@ -541,9 +542,3 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
     BITSIZEOF_WINT_T=32
   fi
 ])
-
-dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
-dnl Remove this when we can assume autoconf >= 2.61.
-m4_ifdef([AC_COMPUTE_INT], [], [
-  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
-])
index e06461e6934b9db3c4da47027f89387f08324a7c..0debe69e92d94a2a3175278ce4ab2a9242b1d9f4 100644 (file)
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 48
+# stdio_h.m4 serial 49
 dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -28,7 +28,7 @@ AC_DEFUN([gl_STDIO_H],
        /* For non-mingw systems, compilation will trivially succeed.
           For mingw, compilation will succeed for older mingw (system
           printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
-       #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \
+       #if (defined _WIN32 && ! defined __CYGWIN__) && \
          (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
        extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
        #endif
index eff6f9e685b1eed9211d2b0b9f85e7e0d9b8ff1b..49dc5d59cbe197b698c2792ff74780f4a56ada27 100644 (file)
@@ -1,4 +1,4 @@
-# stdlib_h.m4 serial 44
+# stdlib_h.m4 serial 45
 dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,6 +14,9 @@ AC_DEFUN([gl_STDLIB_H],
   dnl guaranteed by C89.
   gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
 #if HAVE_SYS_LOADAVG_H
+/* OpenIndiana has a bug: <sys/time.h> must be included before
+   <sys/loadavg.h>.  */
+# include <sys/time.h>
 # include <sys/loadavg.h>
 #endif
 #if HAVE_RANDOM_H
index 1f7b1341c1e3fc2360171bdb4a1cf4fb433299a7..ed6ebd51175f3a9d4b0f1277831364311f22edd1 100644 (file)
@@ -1,4 +1,4 @@
-# threadlib.m4 serial 13
+# threadlib.m4 serial 15
 dnl Copyright (C) 2005-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,6 +6,8 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
+AC_PREREQ([2.60])
+
 dnl gl_THREADLIB
 dnl ------------
 dnl Tests for a multithreading library to be used.
@@ -43,11 +45,7 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY],
 
   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])])
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
   dnl Check for multithreading.
   m4_ifdef([gl_THREADLIB_DEFAULT_NO],
     [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
@@ -153,6 +151,36 @@ int main ()
          *" -static "*) gl_cv_have_weak=no ;;
        esac
       ])
+    dnl Check whether the linker supports the --as-needed/--no-as-needed options.
+    dnl Assume GCC, so that we can use the -Wl option.
+    AC_CACHE_CHECK([whether the linker supports --as-needed],
+      [gl_cv_linker_have_as_needed],
+      [if test -n "$GCC"; then
+         gl_saved_ldflags="$LDFLAGS"
+         LDFLAGS="$gl_saved_ldflags -Wl,--as-needed -Wl,--no-as-needed"
+         AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+           [gl_cv_linker_have_as_needed=yes],
+           [gl_cv_linker_have_as_needed=no])
+         LDFLAGS="$gl_saved_ldflags"
+       else
+         gl_cv_linker_have_as_needed=no
+       fi
+      ])
+    dnl Check whether the linker supports the --push-state/--pop-state options.
+    dnl Assume GCC, so that we can use the -Wl option.
+    AC_CACHE_CHECK([whether the linker supports --push-state],
+      [gl_cv_linker_have_push_state],
+      [if test -n "$GCC"; then
+         gl_saved_ldflags="$LDFLAGS"
+         LDFLAGS="$gl_saved_ldflags -Wl,--push-state -Wl,--pop-state"
+         AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+           [gl_cv_linker_have_push_state=yes],
+           [gl_cv_linker_have_push_state=no])
+         LDFLAGS="$gl_saved_ldflags"
+       else
+         gl_cv_linker_have_push_state=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.
@@ -231,6 +259,32 @@ int main ()
                 [Define if references to the POSIX multithreading library should be made weak.])
               LIBTHREAD=
               LTLIBTHREAD=
+              dnl On platforms where GCC enables --as-needed by default, attempt
+              dnl to make sure that LIBMULTITHREAD really links with -lpthread.
+              dnl Otherwise linking with LIBMULTITHREAD has no effect; then
+              dnl the weak symbols are not defined and thus evaluate to NULL.
+              case "$LIBMULTITHREAD" in
+                "") ;;
+                -pthread)
+                  if test $gl_cv_linker_have_as_needed = yes; then
+                    if test $gl_cv_linker_have_push_state = yes; then
+                      LIBMULTITHREAD="$LIBMULTITHREAD -Wl,--push-state -Wl,--no-as-needed -lpthread -Wl,--pop-state"
+                    else
+                      LIBMULTITHREAD="$LIBMULTITHREAD -Wl,--no-as-needed -lpthread"
+                    fi
+                  fi
+                  ;;
+                *)
+                  if test $gl_cv_linker_have_as_needed = yes; then
+                    if test $gl_cv_linker_have_push_state = yes; then
+                      LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
+                    else
+                      LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
+                    fi
+                  fi
+                  ;;
+              esac
+              # TODO: May need to modify LTLIBMULTITHREAD similarly.
             fi
           fi
         fi
@@ -263,6 +317,18 @@ int main ()
               [Define if references to the old Solaris multithreading library should be made weak.])
             LIBTHREAD=
             LTLIBTHREAD=
+            dnl On platforms where GCC enables --as-needed by default, attempt
+            dnl to make sure that LIBMULTITHREAD really links with -lthread.
+            dnl Otherwise linking with LIBMULTITHREAD has no effect; then
+            dnl the weak symbols are not defined and thus evaluate to NULL.
+            if test $gl_cv_linker_have_as_needed = yes; then
+              if test $gl_cv_linker_have_push_state = yes; then
+                LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
+              else
+                LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
+              fi
+            fi
+            # TODO: May need to modify LTLIBMULTITHREAD similarly.
           fi
         fi
       fi
@@ -291,6 +357,18 @@ int main ()
               [Define if references to the GNU Pth multithreading library should be made weak.])
             LIBTHREAD=
             LTLIBTHREAD=
+            dnl On platforms where GCC enables --as-needed by default, attempt
+            dnl to make sure that LIBMULTITHREAD really links with -lpth.
+            dnl Otherwise linking with LIBMULTITHREAD has no effect; then
+            dnl the weak symbols are not defined and thus evaluate to NULL.
+            if test $gl_cv_linker_have_as_needed = yes; then
+              if test $gl_cv_linker_have_push_state = yes; then
+                LIBMULTITHREAD="-Wl,--push-state -Wl,--no-as-needed $LIBMULTITHREAD -Wl,--pop-state"
+              else
+                LIBMULTITHREAD="-Wl,--no-as-needed $LIBMULTITHREAD"
+              fi
+            fi
+            # TODO: May need to modify LTLIBMULTITHREAD similarly.
           fi
         fi
       else
index b3b71ec2709e7e844efb5e161c2e3333b7bffc80..3ba64da8a0bfe2a3c8f57d79fe108c773371f631 100644 (file)
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 71
+# unistd_h.m4 serial 74
 dnl Copyright (C) 2006-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -37,13 +37,13 @@ AC_DEFUN([gl_UNISTD_H],
 # include <fcntl.h>
 # include <stdio.h>
 # include <stdlib.h>
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 #  include <io.h>
 # endif
 #endif
     ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat
     fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups
-    gethostname getlogin getlogin_r getpagesize
+    gethostname getlogin getlogin_r getpagesize getpass
     getusershell setusershell endusershell
     group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
     readlink readlinkat rmdir sethostname sleep symlink symlinkat
@@ -83,6 +83,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   GNULIB_GETLOGIN=0;             AC_SUBST([GNULIB_GETLOGIN])
   GNULIB_GETLOGIN_R=0;           AC_SUBST([GNULIB_GETLOGIN_R])
   GNULIB_GETPAGESIZE=0;          AC_SUBST([GNULIB_GETPAGESIZE])
+  GNULIB_GETPASS=0;              AC_SUBST([GNULIB_GETPASS])
   GNULIB_GETUSERSHELL=0;         AC_SUBST([GNULIB_GETUSERSHELL])
   GNULIB_GROUP_MEMBER=0;         AC_SUBST([GNULIB_GROUP_MEMBER])
   GNULIB_ISATTY=0;               AC_SUBST([GNULIB_ISATTY])
@@ -126,6 +127,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_GETHOSTNAME=1;     AC_SUBST([HAVE_GETHOSTNAME])
   HAVE_GETLOGIN=1;        AC_SUBST([HAVE_GETLOGIN])
   HAVE_GETPAGESIZE=1;     AC_SUBST([HAVE_GETPAGESIZE])
+  HAVE_GETPASS=1;         AC_SUBST([HAVE_GETPASS])
   HAVE_GROUP_MEMBER=1;    AC_SUBST([HAVE_GROUP_MEMBER])
   HAVE_LCHOWN=1;          AC_SUBST([HAVE_LCHOWN])
   HAVE_LINK=1;            AC_SUBST([HAVE_LINK])
@@ -140,7 +142,6 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_SLEEP=1;           AC_SUBST([HAVE_SLEEP])
   HAVE_SYMLINK=1;         AC_SUBST([HAVE_SYMLINK])
   HAVE_SYMLINKAT=1;       AC_SUBST([HAVE_SYMLINKAT])
-  HAVE_TRUNCATE=1;        AC_SUBST([HAVE_TRUNCATE])
   HAVE_UNLINKAT=1;        AC_SUBST([HAVE_UNLINKAT])
   HAVE_USLEEP=1;          AC_SUBST([HAVE_USLEEP])
   HAVE_DECL_ENVIRON=1;    AC_SUBST([HAVE_DECL_ENVIRON])
@@ -152,6 +153,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   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_TRUNCATE=1;   AC_SUBST([HAVE_DECL_TRUNCATE])
   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])
@@ -168,6 +170,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_GETLOGIN_R=0;   AC_SUBST([REPLACE_GETLOGIN_R])
   REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
   REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
+  REPLACE_GETPASS=0;      AC_SUBST([REPLACE_GETPASS])
   REPLACE_ISATTY=0;       AC_SUBST([REPLACE_ISATTY])
   REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
   REPLACE_LINK=0;         AC_SUBST([REPLACE_LINK])
index 73172e84d2d19a6dba9bb6c63a9cc3d69e6f1d88..6faaa5cd2e95100d36ba6b6edbc8bba747618b1b 100644 (file)
@@ -1,4 +1,4 @@
-# unlink.m4 serial 12
+# unlink.m4 serial 13
 dnl Copyright (C) 2009-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -43,12 +43,14 @@ AC_DEFUN([gl_FUNC_UNLINK],
       [gl_cv_func_unlink_honors_slashes=yes],
       [gl_cv_func_unlink_honors_slashes=no],
       [case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
-                 # Guess no on native Windows.
-         mingw*) gl_cv_func_unlink_honors_slashes="guessing no" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_unlink_honors_slashes="guessing no" ;;
+                          # Guess yes on Linux systems.
+         linux-* | linux) gl_cv_func_unlink_honors_slashes="guessing yes" ;;
+                          # Guess yes on glibc systems.
+         *-gnu*)          gl_cv_func_unlink_honors_slashes="guessing yes" ;;
+                          # Guess no on native Windows.
+         mingw*)          gl_cv_func_unlink_honors_slashes="guessing no" ;;
+                          # If we don't know, assume the worst.
+         *)               gl_cv_func_unlink_honors_slashes="guessing no" ;;
        esac
       ])
      rm -f conftest.file conftest.lnk])
index 89e301ba27b2be32d9bee85647ebfd5d785aa170..89a99818494ec4d3cbed4a7c469109fd11b33467 100644 (file)
@@ -1,4 +1,4 @@
-# utime_h.m4 serial 1
+# utime_h.m4 serial 3
 dnl Copyright (C) 2017-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,6 +10,7 @@ AC_DEFUN([gl_UTIME_H],
 [
   AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([gl_UTIME_H_DEFAULTS])
+  m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
   AC_CHECK_HEADERS_ONCE([utime.h])
   gl_CHECK_NEXT_HEADERS([utime.h])
 
@@ -20,17 +21,25 @@ AC_DEFUN([gl_UTIME_H],
   fi
   AC_SUBST([HAVE_UTIME_H])
 
-  UTIME_H=''
-  if test $ac_cv_header_utime_h != yes; then
-    dnl Provide a substitute <utime.h> file.
-    UTIME_H=utime.h
-  else
-    case "$host_os" in
-      mingw*) dnl Need special handling of 'struct utimbuf'.
-        UTIME_H=utime.h
-        ;;
-    esac
-  fi
+  m4_ifdef([gl_POSIXCHECK],
+    [UTIME_H=utime.h],
+    [UTIME_H=''
+     if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then
+       dnl Override <utime.h> always, to support the C++ GNULIB_NAMESPACE.
+       UTIME_H=utime.h
+     else
+       if test $ac_cv_header_utime_h != yes; then
+         dnl Provide a substitute <utime.h> file.
+         UTIME_H=utime.h
+       else
+         case "$host_os" in
+           mingw*) dnl Need special handling of 'struct utimbuf'.
+             UTIME_H=utime.h
+             ;;
+         esac
+       fi
+     fi
+    ])
   AC_SUBST([UTIME_H])
   AM_CONDITIONAL([GL_GENERATE_UTIME_H], [test -n "$UTIME_H"])
 
index 16798a0ad1e0df7490f9ceb9f3a2e07da1fe3a57..9a4db07a3dae4a3526c66f881eaed675f0f1acf2 100644 (file)
@@ -3,7 +3,7 @@ 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 8
+dnl serial 9
 
 AC_DEFUN([gl_UTIMENS],
 [
@@ -31,10 +31,12 @@ AC_DEFUN([gl_UTIMENS],
         [gl_cv_func_futimesat_works=yes],
         [gl_cv_func_futimesat_works=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" ;;
+                            # Guess yes on Linux systems.
+           linux-* | linux) gl_cv_func_futimesat_works="guessing yes" ;;
+                            # 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])
index eb1c795c5988325f244c7b03bf74cf71ab4faa8a..07edda1cca6ea8902917cd0296eab77043dd8fee 100644 (file)
@@ -1,4 +1,4 @@
-# warnings.m4 serial 13
+# warnings.m4 serial 14
 dnl Copyright (C) 2008-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -76,6 +76,15 @@ m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)],
   AC_LANG_POP([C++])
 ])
 
+# Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd.
+# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b.
+m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)],
+[
+  AC_LANG_PUSH([Objective C])
+  gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+  AC_LANG_POP([Objective C])
+])
+
 AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL],
 [gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option],
    [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'],
index 416e0a1f8046c3e74b77e1f281f9a752a03ec3cf..a062ca981df3106e0afb8005476ef4b015e09262 100644 (file)
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Eric Blake.
 
-# wchar_h.m4 serial 42
+# wchar_h.m4 serial 43
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -90,7 +90,8 @@ int main () { return zero(); }
      dnl that the object file has the latter name from the start.
      save_ac_compile="$ac_compile"
      ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
-     if AC_TRY_EVAL([ac_compile]); then
+     if echo '#include "conftest.c"' >conftest1.c &&
+        AC_TRY_EVAL([ac_compile]); then
        AC_LANG_CONFTEST([
          AC_LANG_SOURCE([[#define wcstod renamed_wcstod
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
@@ -105,7 +106,8 @@ int zero (void) { return 0; }
 ]])])
        dnl See note above about renaming object files.
        ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
-       if AC_TRY_EVAL([ac_compile]); then
+       if echo '#include "conftest.c"' >conftest2.c &&
+          AC_TRY_EVAL([ac_compile]); then
          if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
            :
          else
@@ -114,7 +116,7 @@ int zero (void) { return 0; }
        fi
      fi
      ac_compile="$save_ac_compile"
-     rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
+     rm -f conftest[12].c conftest[12].$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).
index be86fb5d5251f83fe2970c11eefc9a9f5a696e52..4889ebacc777094e74740c79433cccd84e6e4e77 100644 (file)
--- a/maint.mk
+++ b/maint.mk
@@ -421,6 +421,7 @@ sc_error_message_period:
 
 sc_file_system:
        @prohibit=file''system                                          \
+       exclude='/proc/filesystems'                                     \
        ignore_case=1                                                   \
        halt='found use of "file''system"; spell it "file system"'      \
          $(_sc_search_regexp)
@@ -571,7 +572,7 @@ 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)
+       @h='same.h' re='\<same_name(at)? *\(' $(_sc_header_without_use)
 
 sc_prohibit_hash_pjw_without_use:
        @h='hash-pjw.h' \
index ebdce5b981bac79f2945c92fb13ac5abedc9cd4d..691bbf8dd4cc18f7664804421ef50dea41748b1f 100644 (file)
@@ -24,6 +24,7 @@ TESTS =                                       \
   memcpy-abuse                         \
   mixed                                        \
   null-suffix-clobber                  \
+  reproducible                         \
   stdin                                        \
   timestamp                            \
   trailing-nul                         \
index f18ee9c752c83875ed428adc91334808fa7eba63..5b7c5f9285c663e1201e4f880136fe392e8a8544 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15a from Makefile.am.
+# Makefile.in generated by automake 1.16a from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -160,18 +160,21 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
        $(top_srcdir)/m4/printf-posix-rpl.m4 \
        $(top_srcdir)/m4/printf.m4 \
        $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \
-       $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/realloc.m4 \
-       $(top_srcdir)/m4/rmdir.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/stdnoreturn.m4 \
-       $(top_srcdir)/m4/stpcpy.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/raise.m4 $(top_srcdir)/m4/readdir.m4 \
+       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/rmdir.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/savedir.m4 \
+       $(top_srcdir)/m4/shell.m4 $(top_srcdir)/m4/sigaction.m4 \
+       $(top_srcdir)/m4/signal_h.m4 \
+       $(top_srcdir)/m4/signalblocking.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/stdnoreturn.m4 $(top_srcdir)/m4/stpcpy.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 \
@@ -570,6 +573,7 @@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
 GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
 GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
 GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
+GNULIB_GETPASS = @GNULIB_GETPASS@
 GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
 GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
 GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
@@ -671,6 +675,7 @@ GNULIB_POWF = @GNULIB_POWF@
 GNULIB_PREAD = @GNULIB_PREAD@
 GNULIB_PRINTF = @GNULIB_PRINTF@
 GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
 GNULIB_PTSNAME = @GNULIB_PTSNAME@
 GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
 GNULIB_PUTC = @GNULIB_PUTC@
@@ -679,6 +684,7 @@ GNULIB_PUTENV = @GNULIB_PUTENV@
 GNULIB_PUTS = @GNULIB_PUTS@
 GNULIB_PWRITE = @GNULIB_PWRITE@
 GNULIB_QSORT_R = @GNULIB_QSORT_R@
+GNULIB_RAISE = @GNULIB_RAISE@
 GNULIB_RANDOM = @GNULIB_RANDOM@
 GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
 GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
@@ -709,7 +715,10 @@ GNULIB_SCANF = @GNULIB_SCANF@
 GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
 GNULIB_SETENV = @GNULIB_SETENV@
 GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SIGACTION = @GNULIB_SIGACTION@
+GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
 GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
+GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
 GNULIB_SINF = @GNULIB_SINF@
 GNULIB_SINHF = @GNULIB_SINHF@
 GNULIB_SINL = @GNULIB_SINL@
@@ -904,6 +913,7 @@ 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_TRUNCATE = @HAVE_DECL_TRUNCATE@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
 HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
@@ -951,6 +961,7 @@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
 HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
 HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
 HAVE_GRANTPT = @HAVE_GRANTPT@
@@ -1011,12 +1022,15 @@ HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
 HAVE_PTSNAME = @HAVE_PTSNAME@
 HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
 HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RAISE = @HAVE_RAISE@
 HAVE_RANDOM = @HAVE_RANDOM@
 HAVE_RANDOM_H = @HAVE_RANDOM_H@
 HAVE_RANDOM_R = @HAVE_RANDOM_R@
@@ -1038,9 +1052,13 @@ HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
+HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
 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_SIGSET_T = @HAVE_SIGSET_T@
 HAVE_SINF = @HAVE_SINF@
 HAVE_SINHF = @HAVE_SINHF@
 HAVE_SINL = @HAVE_SINL@
@@ -1059,6 +1077,7 @@ HAVE_STRTOD = @HAVE_STRTOD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
+HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
@@ -1075,7 +1094,7 @@ HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
 HAVE_TIMEGM = @HAVE_TIMEGM@
 HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
-HAVE_TRUNCATE = @HAVE_TRUNCATE@
+HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
 HAVE_TZSET = @HAVE_TZSET@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
@@ -1125,8 +1144,6 @@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
 HAVE_WMEMSET = @HAVE_WMEMSET@
 HAVE__BOOL = @HAVE__BOOL@
 HAVE__EXIT = @HAVE__EXIT@
-HOST_CPU = @HOST_CPU@
-HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
 IGNORE_UNUSED_LIBRARIES_CFLAGS = @IGNORE_UNUSED_LIBRARIES_CFLAGS@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
@@ -1163,6 +1180,7 @@ 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_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
 NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_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@
@@ -1182,6 +1200,7 @@ NEXT_FLOAT_H = @NEXT_FLOAT_H@
 NEXT_GETOPT_H = @NEXT_GETOPT_H@
 NEXT_LIMITS_H = @NEXT_LIMITS_H@
 NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
 NEXT_STDDEF_H = @NEXT_STDDEF_H@
 NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
@@ -1276,6 +1295,7 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_GMTIME = @REPLACE_GMTIME@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
@@ -1342,11 +1362,13 @@ REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
 REPLACE_PTSNAME = @REPLACE_PTSNAME@
 REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
 REPLACE_QSORT_R = @REPLACE_QSORT_R@
+REPLACE_RAISE = @REPLACE_RAISE@
 REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
 REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
@@ -1516,6 +1538,7 @@ TESTS = \
   memcpy-abuse                         \
   mixed                                        \
   null-suffix-clobber                  \
+  reproducible                         \
   stdin                                        \
   timestamp                            \
   trailing-nul                         \
@@ -1835,6 +1858,13 @@ null-suffix-clobber.log: null-suffix-clobber
        --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)
+reproducible.log: reproducible
+       @p='reproducible'; \
+       b='reproducible'; \
+       $(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'; \
index 1076c833cbe0c7bfc8ed6d23dc61a6c39b5ee867..5660ec3626abe30fe432d2c6303f6f2ce06505d1 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Exercise a bug whereby an invalid input could make gzip -d misbehave.
+# Exercise bugs whereby invalid input could make gzip -d misbehave.
 
 # Copyright (C) 2009-2018 Free Software Foundation, Inc.
 
@@ -30,4 +30,11 @@ compare /dev/null out || fail=1
 sed 's/.*hufts-segv.gz: /...: /' err > k; mv k err || fail=1
 compare exp err || fail=1
 
+printf '\037\213\010\000\060\060\060\060\060\060\144\000\000\000' > bug33501 \
+  || framework_failure_
+printf '\ngzip: stdin: invalid compressed data--format violated\n' >exp33501 \
+  || framework_failure_
+returns_ 1 gzip -d <bug33501 >out33501 2> err33501 || fail=1
+compare exp33501 err33501 || fail=1
+
 Exit $fail
index 3a0e63c549bd2552fba345abc6e943391d16387f..93d14f5aeddec536cc05ff6f3163e2da93816a63 100644 (file)
@@ -527,7 +527,7 @@ rand_bytes_ ()
   fi
 
   n_plus_50_=`expr $n_ + 50`
-  cmds_='date; date +%N; free; who -a; w; ps auxww; ps ef; netstat -n'
+  cmds_='date; date +%N; free; who -a; w; ps auxww; ps -ef'
   data_=` (eval "$cmds_") 2>&1 | gzip `
 
   # Ensure that $data_ has length at least 50+$n_
diff --git a/tests/reproducible b/tests/reproducible
new file mode 100755 (executable)
index 0000000..3bb4974
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+# Ensure that gzip has repoducible output.
+
+# Copyright 2018 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 <https://www.gnu.org/licenses/>.
+# limit so don't run it by default.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ..
+
+echo a | gzip > exp || fail=1
+sleep 1
+echo a | gzip > out || fail=1
+
+compare exp out || fail=1
+
+Exit $fail
diff --git a/trees.c b/trees.c
index ad72ccd71913d2e51c36c4b9de5b3f87ae1c10d1..473edd4f2452478b3375291748b1b14dced5f027 100644 (file)
--- a/trees.c
+++ b/trees.c
@@ -897,7 +897,7 @@ off_t flush_block(buf, stored_len, pad, eof)
     if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
 
     /* If compression failed and this is the first and last block,
-     * and if the zip file can be seeked (to rewrite the local header),
+     * and if we can seek through the zip file (to rewrite the local header),
      * the whole file is transformed into a stored file:
      */
 #ifdef FORCE_METHOD
diff --git a/zcat.in b/zcat.in
index 77c55cfd2de8e29bc15a37182db2819f2dfdd5a3..390dcfef1f2c638b4b41f4265326b2e43771a1ca 100644 (file)
--- a/zcat.in
+++ b/zcat.in
@@ -18,7 +18,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 version="zcat (gzip) @VERSION@
-Copyright (C) 2007, 2011-2017 Free Software Foundation, Inc.
+Copyright (C) 2007, 2011-2018 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
index 960bf86131dc6ed6d28dfc16e38dfab8ba680b76..4cf73951f48a001c6aa7b5098a8da0dde4b68f25 100644 (file)
--- a/zdiff.in
+++ b/zdiff.in
@@ -25,7 +25,7 @@ case $1 in
 esac
 
 version="z$prog (gzip) @VERSION@
-Copyright (C) 2009, 2011-2017 Free Software Foundation, Inc.
+Copyright (C) 2009, 2011-2018 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
index f122655936b3430b333d7d447fa233c8ed0587ed..023a661ebdb450361ea94de77e43d4e1f2765cf9 100644 (file)
--- a/zforce.in
+++ b/zforce.in
@@ -24,7 +24,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 version="zforce (gzip) @VERSION@
-Copyright (C) 2010-2017 Free Software Foundation, Inc.
+Copyright (C) 2010-2018 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
index 7a4a2d485b47fa805f6aae818019ba5ff839d2c4..3efdb529b8f7dc384a001562ca13261183d70d8d 100644 (file)
--- a/zgrep.in
+++ b/zgrep.in
@@ -25,7 +25,7 @@
 grep='${GREP-'\''@GREP@'\''}'
 
 version='zgrep (gzip) @VERSION@
-Copyright (C) 2010-2017 Free Software Foundation, Inc.
+Copyright (C) 2010-2018 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
diff --git a/zip.c b/zip.c
index 337932ca0968f99f560b590c3ffeb99c499dd03c..be5c4b0b95267ddfaa67c3f439a87369d2e02f1c 100644 (file)
--- a/zip.c
+++ b/zip.c
@@ -124,7 +124,6 @@ int file_read(buf, size)
     if (len == 0) return (int)len;
     if (len == (unsigned)-1) {
         read_error();
-        return EOF;
     }
 
     crc = updcrc((uch*)buf, len);
index fd1d4c6a75bda912099030284b3d4e923de84590..d34068d2b195f05d909eb9873145c976abaef587 100644 (file)
--- a/zless.in
+++ b/zless.in
@@ -17,7 +17,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 version="zless (gzip) @VERSION@
-Copyright (C) 2007, 2011-2017 Free Software Foundation, Inc.
+Copyright (C) 2007, 2011-2018 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
index c29f5b2afb055c06fa38e180b7675939a0a1bb10..c5550f5597bab01543ed665f69d4ca20ba41d481 100644 (file)
--- a/zmore.in
+++ b/zmore.in
@@ -18,7 +18,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 version="zmore (gzip) @VERSION@
-Copyright (C) 2010-2017 Free Software Foundation, Inc.
+Copyright (C) 2010-2018 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
diff --git a/znew.in b/znew.in
index 91fd2bf37a6489988a940f7ac0b92f38ec972861..2b703d17642b2c3393dfd9744774d71c1e500c23 100644 (file)
--- a/znew.in
+++ b/znew.in
@@ -19,7 +19,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 version="znew (gzip) @VERSION@
-Copyright (C) 2010-2017 Free Software Foundation, Inc.
+Copyright (C) 2010-2018 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <https://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.