Merge change up to right before new-year copyright bumping
authorIan Beckwith <ianb@erislabs.net>
Sun, 2 Feb 2014 20:48:41 +0000 (20:48 +0000)
committerIan Beckwith <ianb@erislabs.net>
Sun, 2 Feb 2014 20:48:41 +0000 (20:48 +0000)
Merge commit 'beae0bdcf7fe30f2415c16f6b8c1368d469e519c'

Conflicts:
ChangeLog
build-aux/config.guess
doc/maintain.texi
doc/standards.texi

282 files changed:
ChangeLog
MODULES.html.sh
build-aux/bootstrap
build-aux/config.guess
build-aux/config.sub
build-aux/gendocs.sh
build-aux/install-reloc
build-aux/pmccabe2html
build-aux/texinfo.tex
config/srclist-update
doc/INSTALL
doc/INSTALL.ISO
doc/INSTALL.UTF-8
doc/Makefile
doc/extern-inline.texi [new file with mode: 0644]
doc/glibc-functions/dup3.texi
doc/glibc-functions/getdtablesize.texi
doc/gnu-oids.texi
doc/gnulib.texi
doc/install.texi
doc/maintain.texi
doc/make-stds.texi
doc/posix-functions/dup2.texi
doc/posix-functions/isalnum.texi
doc/posix-functions/isalpha.texi
doc/posix-functions/isascii.texi
doc/posix-functions/isblank.texi
doc/posix-functions/iscntrl.texi
doc/posix-functions/isdigit.texi
doc/posix-functions/isgraph.texi
doc/posix-functions/islower.texi
doc/posix-functions/isprint.texi
doc/posix-functions/ispunct.texi
doc/posix-functions/isspace.texi
doc/posix-functions/isupper.texi
doc/posix-functions/iswalnum.texi
doc/posix-functions/iswalpha.texi
doc/posix-functions/iswcntrl.texi
doc/posix-functions/iswctype.texi
doc/posix-functions/iswdigit.texi
doc/posix-functions/iswgraph.texi
doc/posix-functions/iswlower.texi
doc/posix-functions/iswprint.texi
doc/posix-functions/iswpunct.texi
doc/posix-functions/iswspace.texi
doc/posix-functions/iswupper.texi
doc/posix-functions/iswxdigit.texi
doc/posix-functions/isxdigit.texi
doc/posix-functions/memcpy.texi
doc/posix-functions/memmove.texi
doc/posix-functions/memset.texi
doc/posix-functions/mkfifo.texi
doc/posix-functions/mkfifoat.texi
doc/posix-functions/mknod.texi
doc/posix-functions/mknodat.texi
doc/posix-functions/putc_unlocked.texi
doc/posix-functions/putchar_unlocked.texi
doc/posix-functions/sigaddset.texi
doc/posix-functions/sigdelset.texi
doc/posix-functions/sigemptyset.texi
doc/posix-functions/sigfillset.texi
doc/posix-functions/sigismember.texi
doc/posix-functions/stpcpy.texi
doc/posix-functions/stpncpy.texi
doc/posix-functions/strcat.texi
doc/posix-functions/strcpy.texi
doc/posix-functions/strncat.texi
doc/posix-functions/strncpy.texi
doc/posix-functions/toascii.texi
doc/posix-functions/tolower.texi
doc/posix-functions/toupper.texi
doc/posix-functions/towlower.texi
doc/posix-functions/towupper.texi
doc/relocatable-maint.texi
doc/standards.texi
doc/verify.texi
gnulib-tool
lib/accept4.c
lib/acl-internal.h
lib/argp-fmtstream.h
lib/argp.h
lib/base64.c
lib/binary-io.h
lib/bitrotate.h
lib/count-leading-zeros.h
lib/count-one-bits.c
lib/count-one-bits.h
lib/count-trailing-zeros.c [new file with mode: 0644]
lib/count-trailing-zeros.h [new file with mode: 0644]
lib/dtotimespec.c
lib/dup2.c
lib/dup3.c
lib/eealloc.h
lib/error.c
lib/execinfo.in.h
lib/file-has-acl.c
lib/fpending.h
lib/fseeko.c
lib/gc-gnulib.c
lib/gc-libgcrypt.c
lib/gc.h
lib/getdtablesize.c
lib/getgroups.c
lib/gethrxtime.h
lib/gl_list.h
lib/gl_openssl.h [new file with mode: 0644]
lib/gl_oset.h
lib/gl_xlist.h
lib/gl_xoset.h
lib/gl_xsublist.h
lib/glob.c
lib/glob.in.h
lib/glthread/cond.h
lib/glthread/thread.h
lib/hmac-sha256.c [new file with mode: 0644]
lib/hmac-sha512.c [new file with mode: 0644]
lib/hmac.h
lib/ignore-value.h
lib/intprops.h
lib/inttypes.in.h
lib/isnan.c
lib/localcharset.c
lib/math.in.h
lib/mbchar.h
lib/mbfile.h
lib/mbiter.h
lib/mbuiter.h
lib/md5.c
lib/md5.h
lib/mgetgroups.c
lib/mountlist.c
lib/mountlist.h
lib/msvc-inval.c
lib/obstack.c
lib/obstack.h
lib/openat.h
lib/passfd.c
lib/pipe-filter-aux.h
lib/pipe2.c
lib/priv-set.h
lib/pthread.in.h
lib/quotearg.c
lib/regex-quote.c
lib/regex_internal.h
lib/savewd.h
lib/se-context.in.h
lib/se-selinux.in.h
lib/selinux-at.c
lib/sha1.c
lib/sha1.h
lib/sha256.c
lib/sha256.h
lib/sha512.c
lib/sha512.h
lib/sig-handler.h
lib/signal.in.h
lib/stat-time.h
lib/stdalign.in.h
lib/stdio-impl.h
lib/stdio.in.h
lib/strerror-override.h
lib/strtoimax.c
lib/sys_socket.in.h
lib/sys_time.in.h
lib/time.in.h
lib/timespec-add.c
lib/timespec-sub.c
lib/timespec.h
lib/tmpdir.c
lib/u64.h
lib/unistd.in.h
lib/userspec.c
lib/utimens.c
lib/utimens.h
lib/utimensat.c
lib/verify.h
lib/wctype.in.h
lib/xalloc.h
lib/xfreopen.c
lib/xsize.h
lib/xtime.h
m4/acl.m4
m4/configmake.m4
m4/count-trailing-zeros.m4 [new file with mode: 0644]
m4/d-ino.m4
m4/dup2.m4
m4/dup3.m4
m4/extern-inline.m4
m4/fclose.m4
m4/fflush.m4
m4/fpending.m4
m4/fseeko.m4
m4/gc-hmac-sha256.m4 [new file with mode: 0644]
m4/gc-hmac-sha512.m4 [new file with mode: 0644]
m4/gc-sha256.m4 [new file with mode: 0644]
m4/gc-sha512.m4 [new file with mode: 0644]
m4/gc.m4
m4/getcwd-abort-bug.m4
m4/getdtablesize.m4
m4/gettimeofday.m4
m4/gl-openssl.m4 [new file with mode: 0644]
m4/include_next.m4
m4/intl.m4
m4/inttypes.m4
m4/manywarnings.m4
m4/md5.m4
m4/po.m4
m4/pty.m4
m4/regex.m4
m4/selinux-selinux-h.m4
m4/sha1.m4
m4/sha256.m4
m4/sha512.m4
m4/stdalign.m4
m4/strtoimax.m4
m4/strtoumax.m4
m4/time_h.m4
m4/unistd_h.m4
m4/warnings.m4
modules/configmake
modules/count-one-bits
modules/count-trailing-zeros [new file with mode: 0644]
modules/count-trailing-zeros-tests [new file with mode: 0644]
modules/crypto/gc-des-tests
modules/crypto/gc-hmac-md5-tests
modules/crypto/gc-hmac-sha1-tests
modules/crypto/gc-hmac-sha256 [new file with mode: 0644]
modules/crypto/gc-hmac-sha256-tests [new file with mode: 0644]
modules/crypto/gc-hmac-sha512 [new file with mode: 0644]
modules/crypto/gc-hmac-sha512-tests [new file with mode: 0644]
modules/crypto/gc-md5-tests
modules/crypto/gc-pbkdf2-sha1-tests
modules/crypto/gc-sha1-tests
modules/crypto/gc-tests
modules/crypto/hmac-md5-tests
modules/crypto/hmac-sha1-tests
modules/crypto/hmac-sha256 [new file with mode: 0644]
modules/crypto/hmac-sha256-tests [new file with mode: 0644]
modules/crypto/hmac-sha512 [new file with mode: 0644]
modules/crypto/hmac-sha512-tests [new file with mode: 0644]
modules/crypto/md5
modules/crypto/md5-tests
modules/crypto/sha1
modules/crypto/sha1-tests
modules/crypto/sha256
modules/crypto/sha512
modules/ctype
modules/error
modules/fpending
modules/getdtablesize
modules/hash
modules/include_next
modules/inttypes-incomplete
modules/memcpy
modules/memmove
modules/memset
modules/mgetgroups
modules/regex
modules/regex-tests
modules/string
modules/strtoimax
modules/strtoumax
modules/time
modules/unistd
modules/xfreopen
tests/macros.h
tests/test-count-trailing-zeros.c [new file with mode: 0644]
tests/test-dup2.c
tests/test-dup3.c
tests/test-gc-hmac-sha256.c [new file with mode: 0644]
tests/test-gc-hmac-sha512.c [new file with mode: 0644]
tests/test-getdtablesize.c
tests/test-hmac-sha256.c [new file with mode: 0644]
tests/test-hmac-sha512.c [new file with mode: 0644]
tests/test-mkfifo.h
tests/test-open.h
tests/test-passfd.c
tests/test-sys_select.c
tests/test-sys_time.c
tests/test-userspec.c
tests/test-xvasprintf.c
top/maint.mk

index 21eedcd..36ede18 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,989 @@
+2013-12-24  Eric Blake  <eblake@redhat.com>
+
+       passfd: give nicer error for recvfd at eof
+       * lib/passfd.c (recvfd): Fake ENOTCONN if other end closes early.
+       * tests/test-passfd.c (main): Enhance test to cover this.
+
+2013-12-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       gettimeofday: port recent C++ fix to Emacs
+       Without this further patch, Emacs won't build due to
+       the portcheck failing.  Also, this simplifies the patch a bit.
+       * lib/time.in.h (localtime, gmtime): Don't replace unless
+       GNULIB_GETTIMEOFDAY.  Treat them more like mktime.
+       * lib/time.in.h (localtime, gmtime):
+       * m4/gettimeofday.m4 (gl_GETTIMEOFDAY_REPLACE_LOCALTIME):
+       * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS):
+       * modules/time (time.h):
+       Don't worry about about the possibility of localtime and gmtime
+       being absent; they're present in all C libraries we know about.
+       * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS):
+       Don't assume sys_time is present and has been initialized.
+       Instead, use a hack that should work even if it hasn't been.
+       Don't use a portcheck for gmtime or localtime; this supports
+       the hack.
+       * modules/time (time.h): Substitute GNULIB_GETTIMEOFDAY.
+
+2013-12-17  John W. Eaton  <jwe@gnu.org>
+
+       gettimeofday: fix C++ crosscompilation
+
+       Never replace gmtime and localtime by macros when compiling with
+       C++, this prevents <ctime> from being included.
+
+       * m4/gettimeofday.m4 (gl_GETTIMEOFDAY_REPLACE_LOCALTIME): Do not
+       define gmtime and localtime as preprocessor macros.  Instead
+       define some HAVE_GMTIME, HAVE_LOCALTIME, REPLACE_GMTIME, and
+       REPLACE_LOCALTIME substitutions.
+       * lib/time.in.h: Declare gmtime and localtime when needed.
+       * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): AC_SUBST HAVE_GMTIME,
+       HAVE_LOCALTIME, REPLACE_GMTIME, and REPLACE_LOCALTIME.
+       * modules/time: Depend on gettimeofday, and substitute the above
+       variables in time.h.
+
+2013-12-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       qacl: port to Windows better
+       See Eli Zaretskii in
+       <http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00593.html>.
+       * lib/file-has-acl.c (acl_access_nontrivial):
+       Return -1 and set errno if !HAVE_ACL_FIRST_ENTRY &&
+       !HAVE_ACL_TO_SHORT_TEXT && !HAVE_ACL_FREE_TEXT.
+
+2013-12-12  Alexander V. Lukyanov  <lav@netis.ru>
+
+       md5, sha1, sha256, sha512: fix (trivial) compile error in c++ mode.
+       * lib/gl_openssl.h: Cast void pointers to a specific type.
+
+2013-12-07  Pádraig Brady <P@draigBrady.com>
+
+       open-tests: fix build failure with -Werror=old-style-declaration
+       * tests/test-open.h: Reorder the inline to avoid the issue.
+
+2013-12-07  Pádraig Brady <P@draigBrady.com>
+
+       md5, sha1, sha256, sha512: fix link error with partial libcrypto
+       * m4/gl-openssl.m4 (gl_CRYPTO_CHECK): Only clear LIB_CRYPTO at
+       init time, so that if early checks find crypto routines,
+       while the last does not, then @LIB_CRYPTO@ is replaced correctly,
+       avoiding link failures.
+
+2013-12-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       md5, sha1, sha256, sha512: add gl_SET_CRYPTO_CHECK_DEFAULT
+       This provides a new way to specify the default for
+       gl_CRYPTO_CHECK, one that is reflected in the --help message.
+       Emacs uses this, as well as the old way.
+       This attempts to implement a suggestion by Pádraig Brady in
+       <http://lists.gnu.org/archive/html/coreutils/2013-12/msg00080.html>.
+       * m4/gl-openssl.m4(gl_SET_CRYPTO_CHECK_DEFAULT): New macro.
+       (gl_CRYPTO_CHECK): Use it.  Mention the default in --help output.
+
+       md5, sha1, sha256, sha512: add 'auto', and a way to specify default
+       * m4/gl-openssl.m4 (gl_CRYPTO_CHECK):
+       Add support for a new option, --with-openssl=auto, which causes
+       the library to be used if available and silently ignored if not.
+       Add support to allow allow configure.ac to specify its own
+       default, by setting with_openssl_default before invoking gl_INIT.
+
+2013-12-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       open-tests: port to glibc with _FORTIFY_SOURCE and -O1
+       Problem reported by Daiki Ueno in:
+       http://lists.gnu.org/archive/html/bug-gnulib/2013-06/msg00052.html
+       * tests/test-open.h (__always_inline):
+       New macro, if not already defined.
+       (test_open): Use it.
+
+2013-12-04  Eric Blake  <eblake@redhat.com>
+
+       include_next: minimize code duplication
+       * modules/include_next (Depends-on): Add absolute-header.
+       * m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Reuse
+       gl_ABSOLUTE_HEADER_ONE instead of open-coding it.
+
+2013-12-04  Pádraig Brady <P@draigBrady.com>
+
+       getcwd: fix compile error in configure check
+       * m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Include errno.h
+
+2013-12-04  Pádraig Brady <P@draigBrady.com>
+
+       regex: suppress core dumps from detection code
+       * m4/regex.m4 (gl_REGEX): Catch the SIGABRT and convert to SIGTERM
+       to suppress core dumps that may well occur on glibc systems.
+       These core dumps might not be cleaned up automatically, or could
+       trigger some system core dump handling logic.
+
+2013-12-03  Pádraig Brady <P@draigBrady.com>
+
+       md5, sha1, sha256, sha512: support mandating use of openssl
+       * m4/gl-openssl.m4 (gl_crypto_check): Adjust the --with-openssl
+       description, to list the now 3 separate options.  also don't
+       mention the default=no, since this is implicit given the option
+       is described as --with-openssl rather than --without-openssl.
+       If projects change the default they're free to document that.
+       with --with-openssl[=yes] we now error out when the specified
+       hash algorithm is not available in libcrypto.
+
+2013-12-03  Ivailo  <xakepa10@gmail.com>
+
+       test-xvasprintf: (trivial) fix to disable some -Wformat-security diags
+       * tests/test-xvasprintf.c: Disable -Wformat-zero-length and
+       -Wformat-nonliteral checks, as these edge cases are part of the test.
+
+2013-12-03  Eric Blake  <eblake@redhat.com>
+
+       regex: avoid glibc deadlock during configure
+       * m4/regex.m4 (gl_REGEX): Avoid recursive malloc deadlock when
+       glibc bug 15078 in turn triggers bug 16159.
+       Reported by Michal Privoznik.
+
+2013-12-02  Pádraig Brady <P@draigBrady.com>
+
+       md5, sha1, sha256, sha512: use openssl routines if available.
+       --with-openssl the libcrypto md5, sha1, sha224, sha256, sha384, sha256
+       routines will be used if available, requiring apps to link @LIB_CRYPTO@
+       * lib/gl_openssl.h: Provide wrappers for specified openssl hash.
+       * m4/gl-openssl.m4 (gl_CRYPTO_CHECK): New function to lookup libcrypto
+       in the standard system location.
+       * m4/sha1.m4: Call gl_CRYPTO_CHECK() for SHA1.
+       * m4/sha256.m4: Likewise with SHA256.
+       * m4/sha512.m4: Likewise with SHA512.
+       * m4/md5.m4: Likewise with MD5.
+       * m4/gc.m4: Ensure @LIB_CRYPTO@ set for tests.
+       * lib/sha1.h: Include wrappers if HAVE_OPENSSL_SHA1.
+       * lib/sha256.h: Likewise with SHA256.
+       * lib/sha512.h: Likewise with SHA512.
+       * lib/md5.h: Likewise with MD5.
+       * lib/sha1.c: Exlude functionality if HAVE_OPENSSL_SHA1.
+       * lib/sha256.c: Likewise with SHA256.
+       * lib/sha512.c: Likewise with SHA512.
+       * lib/md5.c: Likewise with MD5.
+       * modules/crypto/sha1 (Link:): Add the new optional lib.
+       (Depends-on:): Add dependency on extern-inline.
+       * modules/crypto/sha256: Likewise.
+       * modules/crypto/sha512: Likewise.
+       * modules/crypto/md5: Likewise.
+       * modules/crypto/sha1-tests: Reference the lib here too.
+       * modules/crypto/md5-tests: Likewise.
+       * modules/crypto/gc-des-tests: Likewise.
+       * modules/crypto/gc-hmac-md5-tests: Likewise.
+       * modules/crypto/gc-hmac-sha1-tests: Likewise.
+       * modules/crypto/gc-hmac-sha256-tests: Likewise.
+       * modules/crypto/gc-hmac-sha512-tests: Likewise.
+       * modules/crypto/gc-md5-tests: Likewise.
+       * modules/crypto/gc-pbkdf2-sha1-tests: Likewise.
+       * modules/crypto/gc-sha1-tests: Likewise.
+       * modules/crypto/gc-tests: Likewise.
+       * modules/crypto/hmac-md5-tests: Likewise.
+       * modules/crypto/hmac-sha1-tests: Likewise.
+       * modules/crypto/hmac-sha256-tests: Likewise.
+       * modules/crypto/hmac-sha512-tests: Likewise.
+
+2013-11-29  RV1971  <rv1971@web.de>
+
+       base64: (trivial) fix compilation regression on some compilers
+       * lib/base64.c: Don't return the void function,
+       instead split to a separate return statement.
+
+2013-11-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       ignore-value: revert previous code change
+       * lib/ignore-value.h (ignore_value): Use __extension__ and
+       __typeof__ only for GCC 3.4 and later.  Reported by Eric Blake in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-11/msg00102.html>.
+       Change the comment to try to explain this better.
+
+2013-11-27  Pádraig Brady <P@draigBrady.com>
+
+       selinux-h: improve stub types and add more stub functions
+
+       * lib/se-selinux.in.h: Change security_context_t to a typedef
+       rather than a define, as it's a pointer type and so is better
+       as a typedef to avoid issues declaring multiple variables
+       with the comma operator.  Also add stub for string_to_security_class().
+       * lib/se-context.in.h: Add stub functions for
+       context_{type,range,role,user}_get().
+
+2013-11-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       ignore-value: prefer GCC version back through 2.0
+       The code didn't match the comments, so I did a bit of software
+       archaeology.  GCC 2.0 seems to support __extension__ and
+       __typeof__, so fix both code and comments to use 2.0.
+       * lib/ignore-value.h (ignore_value): Use __extension__ and
+       __typeof__ for GCC 2.0 through 3.3, too.
+
+2013-11-25  Mats Erik Andersson  <gnu@gisladisker.se>
+
+       pty: Activate the signature wrapper of forkpty.
+       The intended preprocessor macro HAVE_FORKPTY is
+       never defined, yet `lib/forkpty.c' depends on it.
+
+       * m4/pty.m4 (gl_FUNC_FORKPTY): At completed analysis,
+       apply AC_DEFINE_UNQUOTED to HAVE_FORKPTY with value
+       $HAVE_FORKPTY for access to wrapper in `lib/forkpty.c'.
+
+2013-11-18  Jim Meyering  <meyering@fb.com>
+       and Paul Eggert  <eggert@cs.ucla.edu>
+
+       quotearg: don't attempt to store 1 << 31 into an "int"
+       * lib/quotearg.c (quotearg_buffer_restyled): Building coreutils with
+       gcc's new -fsanitize=undefined and running its tests triggered some
+       new test failures due to undefined behavior, all with this diagnostic:
+         lib/quotearg.c:629:62: runtime error: left shift of 1 by 31 places \
+           cannot be represented in type int
+       Rather than shifting "1" left to form a mask, shift the bits right and
+       simply use "1" as the mask.
+
+2013-11-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       error: depend on stdio
+       Problem reported by Nikos Mavrogiannopoulos in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-11/msg00084.html>
+       * modules/error (Depends-on): Add stdio.
+
+2013-11-18  Ben Pfaff  <blp@cs.stanford.edu>
+
+       * doc/relocatable-maint.texi (Supporting Relocation): Improve
+       wording.
+       Reported by Reuben Thomas <rrt@sc3d.org>.
+
+2013-11-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/getgroups.c (posix_getgroups, getgroups) [__APPLE__]:
+       New function and macro, to work around _DARWIN_C_SOURCE problem.
+       Reported by Jack Howarth in <http://bugs.gnu.org/14463>.
+
+2013-11-11  Pádraig Brady <P@draigBrady.com>
+
+       base64: provide a fast path for encoding well sized buffers
+       Avoid conditionals in the base64 encoding loop,
+       which was seen to give 60% better throughput.
+       * lib/base64.c (base64_encode_fast): A new function to be called
+       when we don't want to NUL terminate, and we have enough space
+       in the output to encode the given input.
+       (base64_encode): Call the _fast() version when appropriate.
+       Also remove a redundant mask with 0x3F on the first encoded byte.
+
+2013-11-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       extern-inline: port better to OS X 10.9
+       * m4/extern-inline.m4: Omit serial number; this file doesn't use them.
+       (gl_EXTERN_INLINE): Do not suppress the use of extern inline on
+       OS X 10.9, except for g++ where the bug is still present.
+       See <http://trac.macports.org/ticket/41033>.
+
+2013-11-08  Eric Blake  <eblake@redhat.com>
+
+       fpending: fix regression on DragonFly BSD
+       * m4/fpending.m4 (gl_FUNC_FPENDING): Check for declaration.
+       * lib/fpending.h (__fpending): Don't declare twice.
+       Reported by GW in
+       <https://lists.gnu.org/archive/html/bug-m4/2013-11/msg00000.html>
+
+2013-11-05  Jim Meyering  <meyering@fb.com>
+
+       hash: relax license to LGPLv2+, for libguestfs
+       * modules/hash (License): Change from GPL to LGPLv2+.
+
+2013-11-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       intprops: port to Oracle Studio c99
+       * lib/intprops.h (_GL_HAVE___TYPEOF__) [__SUNPRO_C && __STDC__]:
+       Define to 0, to avoid diagnostics when Oracle Studio is pedantic.
+
+2013-10-31  Paul Eggert  <eggert@cs.ucla.edu>
+
+       obstack: pacify HP C
+       * lib/obstack.h (obstack_free) [!__GNUC__]: Rewrite to avoid
+       warning "conversion from pointer to smaller integer" from HP
+       C-ANSI-C - cc version B9007AA/B3910B A.06.26.  It's safe to assume
+       C89 or later nowadays, so cast to void instead of int.  Privately
+       reported by H.Merijn Brand.  Also, change header to match glibc's,
+       to make checking against glibc easier.
+
+2013-10-29  Jim Meyering  <meyering@fb.com>
+
+       maint.mk: prefer gpgv2 over gpgv
+       * top/maint.mk (gpgv): Use gpgv2 if present, else gpgv.
+       (gpg_key_ID): Use $(gpgv), rather than hard-coding "gpgv".
+       Reported by Gary Vaughan.
+
+2013-10-30  Paul Eggert  <eggert@cs.ucla.edu>
+
+       isnan: port to VAX
+       Reported by John Klos for NetBSD-5/VAX in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00133.html>.
+       * lib/isnan.c (IEEE_FLOATING_POINT): New macro, stolen from Emacs.
+       (FUNC): Use it.
+
+2013-10-28  Jim Meyering  <meyering@fb.com>
+
+       gnulib-tool: protect against CDPATH
+       * gnulib-tool: Many "cd" built-in functions print a directory name
+       to stdout when CDPATH is set, e.g.,
+         $ bash -c 'CDPATH=/; cd tmp'
+         /tmp
+       Unset it, when possible.  Prompted by a comment from Bruce Korb.
+
+       maint.mk: restore functionality removed by recent change...
+       Sunday's change, v0.0-8062-g6b24f60, may have appeared correct from
+       the context of a shallow-cloned gnulib repository: "git describe"
+       would fail in such a directory.  However, that change made it so
+       the reported gnulib revision no longer includes the version number
+       or a commit count, even when run from a full clone.
+       * top/maint.mk (gnulib-version): Use the full "git describe"
+       output when possible, e.g., the form above, rather than the
+       abbreviated, no-tag, no-commit-count string, and fall back to
+       using a 10-byte hash, rather than the default minimal-length
+       hash prefix, since while the minimal-length one may be fine today,
+       it is likely not to be unique for very long.
+
+2013-10-26  Jim Meyering  <meyering@fb.com>
+
+       maint.mk: fix "release" target to build _version
+       This fixes a bug in README-release whereby following the outlined
+       steps, one would publish a tarball whose programs would report
+       --version output not consistent with the package version number.
+       This bug caused grep-2.15 to produce a grep program whose
+       --version option made it print 2.14.56-1e3d rather than 2.15.
+       * top/maint.mk (release): Making this target build "_version"
+       ensures that the new version number is reflected in configure.
+
+2013-10-21  Ben Pfaff  <blp@cs.stanford.edu>
+
+       install-reloc: Support multi-binary installation.
+       * build-aux/install-reloc: Support installing multiple programs in
+       one invocation, as done by Automake starting with commit
+       4295fe33eb23f (Multi-file install for PROGRAMS.).  From Bruno
+       Haible <bruno@clisp.org>, archived at
+       http://lists.debian.org/debian-bsd/2012/05/msg00032.html.
+       Reported by Sylvain <beuc@gnu.org>.
+
+2013-10-21  Michael Haubenwallner <michael.haubenwallner@salomon.at>
+
+       selinux-h: Really build without selinux when library is missing.
+       * m4/selinux-selinux-h.m4: When the selinux library is missing, really
+       continue without selinux, as already told in the warning message.
+
+2013-10-21  Jim Meyering  <meyering@fb.com>
+
+       regex: also remove dependency on HAVE_WCSCOLL
+       * lib/regex_internal.h: Remove final vestige of the wcscoll dependency.
+
+2013-10-21  Reuben Thomas <rrt@sc3d.org>
+
+       xfreopen: Fix typo. s/frepoen/freopen/
+       * lib/xfreopen.c: Fix description.
+       * modules/xfreopen: Likewise.
+
+2013-10-21  Jim Meyering  <meyering@fb.com>
+
+       regex: don't depend on wcscoll
+       * m4/regex.m4 (gl_PREREQ_REGEX): Don't check for wcscoll.
+       It is no longer used.
+
+2013-10-20  Jim Meyering  <meyering@fb.com>
+
+       error: add the printf attribute to a static function
+       * lib/error.c (error_tail): Add the printf attribute, to placate
+       gcc's -Werror=suggest-attribute=format option.
+
+2013-09-30  Jim Meyering  <meyering@fb.com>
+
+       fpending, obstack, strerror-override: use pure+const function attrs
+       * lib/fpending.h (__fpending): Declare with the "pure" attribute.
+       * lib/obstack.c (_obstack_allocated_p): Likewise.
+       * lib/obstack.h (_obstack_memory_used): Likewise.
+       (_obstack_memory_used): Likewise.
+       * lib/strerror-override.h (strerror_override): Declare with
+       the "const" attribute.
+
+2013-10-18  Eric Blake  <eblake@redhat.com>
+
+       extern-inline: make safe for -Wundef usage
+       Reported by Vladimir 'phcoder' Serbinenko in
+       https://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00078.html
+       * m4/extern-inline.m4 (gl_EXTERN_INLINE): Port to older gcc.
+
+2013-10-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       mkfifo-tests, etc.: allow HP-UX 11.11 bug
+       Problem reported by Daniel Richard G. in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00068.html>.
+       * doc/posix-functions/mkfifo.texi (mkfifo):
+       * doc/posix-functions/mkfifoat.texi (mkfifoat):
+       * doc/posix-functions/mknod.texi (mknod):
+       * doc/posix-functions/mknodat.texi (mknodat):
+       Document the HP-UX 11.11 bug.
+       * tests/test-mkfifo.h (test_mkfifo):
+       Allow the HP-UX 11.11 bug.
+
+2013-10-14  Paul Eggert  <eggert@cs.ucla.edu>
+
+       acl: allow cross-compilation to Gentoo
+       Problem reported by Gabriel Marcano in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00058.html>.
+       * m4/acl.m4 (gl_ACL_GET_FILE): When cross-compiling,
+       test only whether it links.
+
+2013-10-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       mgetgroups: remove dependency on realloc-gnu
+       The dependency violates the comment in realloc-gnu, which
+       says that tests can't depend on realloc-gnu; some tests depend
+       on mgetgroups, so mgetgroups can't depend on realloc-gnu.
+       Problem reported by Daniel Richard G. in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00056.html>.
+       * lib/mgetgroups.c (mgetgroups): Don't call realloc (NULL, 0).
+       * modules/mgetgroups (Depends-on): Depend on realloc-posix,
+       not realloc-gnu.
+
+2013-10-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       regex-tests: port to HP-UX 11.11
+       Problem reported by Daniel Richard G. in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00052.html>.
+       * modules/regex-tests (test_regex_LDADD): Add LIBTHREAD, LIB_PTHREAD.
+
+2013-10-10  Paul Eggert  <eggert@cs.ucla.edu>
+
+       verify: document some 'assume' pitfalls
+       * doc/verify.texi (Compile-time Assertions):
+       Mention that 'assume (E)' can sometimes slow things down.
+       Use CHAR_MAX + 1, not UCHAR_MAX + 1.
+
+2013-10-10  Eric Blake  <eblake@redhat.com>
+
+       strtoumax: fix typo in previous commit.
+       * modules/strtoumax (Depends-on): Fix typo.
+       * modules/strtoimax (Depends-on): Likewise.
+
+2013-10-10  Paul Eggert  <eggert@cs.ucla.edu>
+
+       strtoumax: port to Solaris 8
+       This problem was introduced in the recent HP-UX patch.
+       Reported by Tom G. Christensen in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00037.html>.
+       * modules/strtoumax (Depends-on): Test HAVE_STRTOUMAX
+       and REPLACE_STRTOUMAX rather than ac_cv_func_strtoumax.
+
+2013-10-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       strtoimax, strtoumax: port to HP-UX 11.11
+       Problem reported by Daniel Richard G. in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00023.html>.
+       * lib/inttypes.in.h (strtoumax): Replace strtoumax if
+       REPLACE_STRTOUMAX, thus treating it consistently with strtoimax.
+       * m4/inttypes.m4 (gl_INTTYPES_H_DEFAULTS): Add default for
+       REPLACE_STRTOUMAX.
+       * m4/strtoimax.m4 (gl_FUNC_STRTOIMAX):
+       * m4/strtoumax.m4 (gl_FUNC_STRTOUMAX):
+       Replace the function if defined as a macro but not as a function.
+       * modules/inttypes-incomplete (inttypes.h): Substitute
+       REPLACE_STRTOUMAX.
+       * modules/strtoumax (configure.ac): Replace strtoumax if
+       REPLACE_STRTOUMAX.
+
+2013-10-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       strtoimax: port to HP-UX 11.11
+       Problem reported by Daniel Richard G.
+       * lib/strtoimax.c (Strtoimax, Strtol, Strtoll): New macros.
+       (strtoimax, strtol, strtoll) [UNSIGNED]: Remove, since
+       they might clash with inttypes.h.
+
+2013-10-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       New module 'count-trailing-zeros'.
+       * MODULES.html.sh: Mention it.
+       * lib/count-trailing-zeros.c, lib/count-trailing-zeros.h:
+       * m4/count-trailing-zeros.m4, modules/count-trailing-zeros:
+       * modules/count-trailing-zeros-tests:
+       * tests/test-count-trailing-zeros.c:
+       New files.
+
+       count-leading-zeros: port to MSC; support types wider than 64 bits
+       The ideas behind the MSC port are stolen from Emacs.
+       * lib/count-leading-zeros.h:
+       Don't include verify.h: it's no longer needed, as types wider than
+       64 bits are now supported.
+       (COUNT_LEADING_ZEROS): New arg MSC_BUILTIN, for better
+       performance with MSC.  All uses changed.  Do not assume that TYPE
+       has at most 64 bits.
+       (count_leading_zeros_32): Assume 0 < X < 2**32, for speed.
+       All uses changed.  Fold the subtraction from 31 into the table.
+
+       count-one-bits: port to MSC; support types wider than 64 bits
+       The ideas behind the MSC port are stolen from Emacs.
+       * lib/count-one-bits.c (popcount_support) [_MSC_VER]: New variable.
+       * lib/count-one-bits.h: Include limits.h, for CHAR_BIT.
+       Don't include verify.h: it's no longer needed, as types wider than
+       64 bits are now supported.
+       (COUNT_ONE_BITS_GENERIC): New macro.
+       (popcount_supported) [_MSC_VER]: New inline function.
+       (COUNT_ONE_BITS): Use it.  New arg MSC_BUILTIN, for better
+       performance with MSC.  All uses changed.  Do not assume that TYPE
+       has at most 64 bits.
+       * modules/count-one-bits (Depends-on): Do not depend on 'verify'.
+
+2013-10-06  Andrew Borodin  <aborodin@vmail.ru>
+
+       mountlist: fix resource leak with MOUNTED_INTERIX_STATVFS
+       * lib/mountlist.c (read_file_system_list): fix leak of directory
+       streams in case of #ifdef MOUNTED_INTERIX_STATVFS.
+
+2013-10-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       tests: improve diagnostic when an assertion fails
+       * tests/macros.h (ASSERT): Report the assertion that failed.
+
+2013-10-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       verify: new macro 'assume'
+       This is taken from Emacs, and should be generally useful.
+       * doc/verify.texi (assume): Document it.
+       * lib/verify.h (assume): New macro.
+       (__has_builtin): Expand to 0 if not defined.
+
+2013-09-26  Eric Blake  <eblake@redhat.com>
+
+       dup2, dup3: work around another cygwin crasher
+       * m4/dup2.m4 (gl_FUNC_DUP2): Expose the bug.
+       * m4/dup3.m4 (gl_FUNC_DUP3): Likewise.
+       * tests/test-dup2.c (main): Likewise.
+       * lib/dup2.c (rpl_dup2): Use setdtablesize to avoid it.
+       * lib/dup3.c (dup3): Likewise.
+       * doc/posix-functions/dup2.texi (dup2): Document it.
+       * doc/glibc-functions/dup3.texi (dup3): Likewise.
+
+       getdtablesize: work around cygwin issue
+       * m4/getdtablesize.m4 (gl_FUNC_GETDTABLESIZE): Detect problem.
+       * modules/getdtablesize (configure.ac): Build replacement.
+       * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set up a witness.
+       * modules/unistd (Makefile.am): Expose the witness.
+       * lib/unistd.in.h (getdtablesize): Declare replacement.
+       * lib/getdtablesize.c (rpl_getdtablesize): Work around it.
+       * tests/test-getdtablesize.c (main): Test it.
+       * doc/glibc-functions/getdtablesize.texi (getdtablesize): Document it.
+
+2013-09-25  Mats Erik Andersson  <gnu@gisladisker.se>
+
+       pmccabe2html: escaping of special characters
+       Escape all '<', '>', and '&' in HTML output.
+       * build-aux/pmccabe2html (html_fnc): Call gsub()
+       instead of sub() to capture all '<', '>', and '&'.
+       Neither of '<' and '>' is special in a regexp,
+       so first arguments to gsub() are corrected. Also,
+       in replacement strings, ampersand must be escaped.
+       Finally, '&' must be handled first, then '<' and '>'.
+
+2013-09-24  Eric Blake  <eblake@redhat.com>
+
+       manywarnings: enable nicer gcc warning messages
+       * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Older gcc requires
+       some -f options for optimal warnings.
+
+2013-09-21  Jim Meyering  <meyering@fb.com>
+
+       timespec: use the new TIMESPEC_RESOLUTION in a few more places
+       * lib/timespec-add.c (timespec_add): Also replace 999999999
+       with TIMESPEC_RESOLUTION - 1.
+       * lib/timespec-sub.c (timespec_sub): Likewise.
+
+2013-09-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+       warnings: port --enable-gcc-warnings to Solaris Studio 12.3
+       Problem reported by Dagobert Michelsen via Eric Blake in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-09/msg00052.html>.
+       * m4/warnings.m4 (gl_COMPILER_OPTION_IF): Use AC_LINK_IFELSE,
+       not AC_COMPILE_IFELSE.
+
+2013-09-23  Eric Blake  <eblake@redhat.com>
+
+       configmake: support new --runstatedir option
+       * m4/configmake.m4 (gl_CONFIGMAKE_PREP): Substitute runstatedir
+       even if autoconf was too old to provide the command line option.
+       * modules/configmake (Makefile.am): Propagate it to .h file.
+
+2013-09-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+       ctype, string: depend on extern-inline
+       This is needed to complete the recent OS X fixes.
+       Also, fix related documentation as suggested by Eric Blake.
+       * doc/posix-functions/isalnum.texi, doc/posix-functions/isalpha.texi:
+       * doc/posix-functions/isascii.texi, doc/posix-functions/iscntrl.texi:
+       * doc/posix-functions/isdigit.texi, doc/posix-functions/isgraph.texi:
+       * doc/posix-functions/islower.texi, doc/posix-functions/isprint.texi:
+       * doc/posix-functions/ispunct.texi, doc/posix-functions/isspace.texi:
+       * doc/posix-functions/isupper.texi, doc/posix-functions/isxdigit.texi:
+       * doc/posix-functions/toascii.texi, doc/posix-functions/tolower.texi:
+       * doc/posix-functions/toupper.texi:
+       List the 'ctype' gnulib module.
+       * doc/posix-functions/strcat.texi, doc/posix-functions/strcpy.texi:
+       * doc/posix-functions/strncpy.texi:
+       List the 'string' gnulib module.
+       * modules/memcpy, modules/memmove, modules/memset (Depends-on):
+       Add string.
+       * modules/ctype, modules/string (Depends-on): Add extern-inline.
+
+2013-09-19  Pádraig Brady  <P@draigBrady.com>
+
+       userspec: support optional parameters to parse_user_spec()
+       * lib/userspec.c (parse_user_spec): If the GID param is NULL,
+       then avoid group processing and treat the full spec as a user.
+       (parse_with_separator): Allow the USERNAME and GROUPNAME to
+       be optional params (NULL), in which case they're ignored.
+
+2013-09-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       timespec: new function make_timespec, and new constants
+       * lib/timespec.h: Incorporate recent changes on the Emacs trunk.
+       (TIMESPEC_RESOLUTION, LOG10_TIMESPEC_RESOLUTION): New constants.
+       (make_timespec): New function.
+       * lib/dtotimespec.c (dtotimespec):
+       * lib/timespec-add.c (timespec_add):
+       * lib/timespec-sub.c (timespec_sub):
+       * lib/utimens.c (validate_timespec):
+       * lib/utimensat.c (rpl_utimensat):
+       Use these new constants and functions.
+
+       stdio: OS X port of putc_unlocked + extern inline
+       * lib/stdio.in.h (putc_unlocked): #undef on problematic Apple platforms.
+       * doc/posix-functions/putc_unlocked.texi:
+       * doc/posix-functions/putchar_unlocked.texi:
+       Document this portability problem.
+
+       signal: OS X port of sigaddset etc. + extern inline
+       * lib/signal.in.h (sigaddset, sigdelset, sigemptyset, sigfillset)
+       (sigismember): #undef on problematic Apple platforms.
+       * doc/posix-functions/sigaddset.texi:
+       * doc/posix-functions/sigdelset.texi:
+       * doc/posix-functions/sigemptyset.texi:
+       * doc/posix-functions/sigfillset.texi:
+       * doc/posix-functions/sigismember.texi:
+       Document this portability problem.
+
+       extern-inline: do not always suppress extern inline on OS X
+       * m4/extern-inline.m4 (gl_EXTERN_INLINE): Suppress the use of
+       extern inline on Apple only if the particular compile-time
+       configuration is known to have the problem.
+       (_GL_EXTERN_INLINE_APPLE_BUG): New private macro, to implement this.
+       (_GL_EXTERN_INLINE_IN_USE): New macro, intended for use by
+       other Gnulib modules.
+
+       extern-inline: document fixes for ctype and wctype macros
+       * doc/posix-functions/isalnum.texi, doc/posix-functions/isalpha.texi:
+       * doc/posix-functions/isascii.texi, doc/posix-functions/isblank.texi:
+       * doc/posix-functions/iscntrl.texi, doc/posix-functions/isdigit.texi:
+       * doc/posix-functions/isgraph.texi, doc/posix-functions/islower.texi:
+       * doc/posix-functions/isprint.texi, doc/posix-functions/ispunct.texi:
+       * doc/posix-functions/isspace.texi, doc/posix-functions/isupper.texi:
+       * doc/posix-functions/iswalnum.texi, doc/posix-functions/iswalpha.texi:
+       * doc/posix-functions/iswcntrl.texi, doc/posix-functions/iswctype.texi:
+       * doc/posix-functions/iswdigit.texi, doc/posix-functions/iswgraph.texi:
+       * doc/posix-functions/iswlower.texi, doc/posix-functions/iswprint.texi:
+       * doc/posix-functions/iswpunct.texi, doc/posix-functions/iswspace.texi:
+       * doc/posix-functions/iswupper.texi, doc/posix-functions/iswxdigit.texi:
+       * doc/posix-functions/isxdigit.texi, doc/posix-functions/toascii.texi:
+       * doc/posix-functions/memcpy.texi, doc/posix-functions/memmove.texi:
+       * doc/posix-functions/memset.texi, doc/posix-functions/stpcpy.texi:
+       * doc/posix-functions/stpncpy.texi, doc/posix-functions/strcat.texi:
+       * doc/posix-functions/strcpy.texi, doc/posix-functions/strncat.texi:
+       * doc/posix-functions/strncpy.texi:
+       * doc/posix-functions/tolower.texi, doc/posix-functions/toupper.texi:
+       * doc/posix-functions/towlower.texi, doc/posix-functions/towupper.texi:
+       Document that Gnulib fixes portability problems with these
+       functions on OS X 10.8 and earlier when called from plain inline
+       or extern inline functions.
+
+2013-09-17  Kevin Cernekee  <cernekee@gmail.com>
+
+       fflush, freadahead, fseeko: Fix for Android
+       Suggested by Bruno Haible in:
+       <http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00306.html>
+       * lib/stdio-impl.h: Use local __sfileext definition.
+
+2013-09-17  Mats Erik Andersson  <gnu@gisladisker.se>
+
+       pmccabe2html: Portability to other awk versions.
+       The functions systime() and strftime() are available
+       in Gawk only.  Properly close two HTML-tags 'style'
+       and 'span'.
+       * build-aux/pmccabe2html (BEGIN): Store timing
+       strings in EPOCH_TIME and CHRONOS_TIME.  Replace
+       systime() in HTML_COMMENT.
+       (html_header): Correctly close tag 'style'.
+       (END): Replace strftime() by CHRONOS_TIME.  Close
+       tag 'span' correctly, not as 'div'.
+
+2013-09-17  Mats Erik Andersson  <gnu@gisladisker.se>  (tiny change)
+
+       getgroups: statement without effect
+       * lib/getgroups.c (rpl_getgroups) [HAVE_GETGROUPS]:
+       Change equality conditional to expected assignment.
+
+2013-09-09  Eric Blake  <eblake@redhat.com>
+
+       glob: fix compilation
+       * lib/glob.in.h (__THROW): Fix missing line in previous commit.
+
+2013-09-07  Eric Blake  <eblake@redhat.com>
+
+       glob: fix build for platforms without __THROW
+       * lib/glob.in.h (__THROW): Add definition again.
+
+2013-09-04  Anton Ovchinnikov  <revolver112@gmail.com>  (tiny change)
+
+       regex-quote: fix buffer access out of bounds
+       http://lists.gnu.org/archive/html/bug-gnulib/2013-09/msg00001.html
+       * lib/regex-quote.c (regex_quote_spec_pcre):
+       Fix typo that resulted in an out-of-bounds read.
+
+2013-09-04  Eric Blake  <eblake@redhat.com>
+
+       glob: avoid -Wattribute warnings on glibc
+       * lib/glob.c (next_brace_sub, prefix_array, collated_compare): Use
+       __THROWNL, not __THROW, on static functions.
+       * lib/glob.in.h (__THROW): Adjust...
+       (__THROWNL): ...accordingly.
+
+2013-08-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       headers: check that _GL_INLINE_HEADER_BEGIN is defined
+       Suggested by Bruce Korb in:
+       http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00070.html
+       * doc/extern-inline.texi (extern inline):
+       Suggest checking that _GL_INLINE_HEADER_BEGIN is defined.
+       * lib/acl-internal.h, lib/argp-fmtstream.h, lib/argp.h:
+       * lib/binary-io.h, lib/bitrotate.h, lib/count-leading-zeros.h:
+       * lib/count-one-bits.h, lib/eealloc.h, lib/execinfo.in.h:
+       * lib/gethrxtime.h, lib/gl_list.h, lib/gl_oset.h, lib/gl_xlist.h:
+       * lib/gl_xoset.h, lib/gl_xsublist.h, lib/glthread/cond.h:
+       * lib/glthread/thread.h, lib/math.in.h, lib/mbchar.h, lib/mbfile.h:
+       * lib/mbiter.h, lib/mbuiter.h, lib/openat.h, lib/pipe-filter-aux.h:
+       * lib/priv-set.h, lib/pthread.in.h, lib/savewd.h, lib/se-context.in.h:
+       * lib/se-selinux.in.h, lib/sig-handler.h, lib/stat-time.h:
+       * lib/sys_socket.in.h, lib/timespec.h, lib/u64.h, lib/unistd.in.h:
+       * lib/utimens.h, lib/wctype.in.h, lib/xalloc.h, lib/xsize.h:
+       * lib/xtime.h:
+       Check that _GL_INLINE_HEADER_BEGIN is defined.
+
+2013-08-29  Pádraig Brady  <P@draigBrady.com>
+
+       bootstrap: remove the --version requirement from ancillary tools
+       * build-aux/bootstrap (check_exists): A new refactored function to
+       determine if a command exists.
+       (find_tool): Use the new function which does not require the
+       --version option to be supported.
+       (check_versions): Use the new function.
+
+2013-08-26  Simon Josefsson  <simon@josefsson.org>
+
+       gc: support HMAC-SHA256 and HMAC-SHA512.
+       * lib/gc.h: Add gc_hmac_sha256 and gc_hmac_sha512.
+       * lib/gc-libgcrypt.c (gc_hmac_sha256, gc_hmac_sha512): New
+       functions.
+       (gc_hmac_md5): Use symbolic constant.
+       * lib/gc-gnulib.c: Include hmac.h for HMAC-SHA256/512 too.
+       (gc_hmac_sha256, gc_hmac_sha512): New functions.
+       * lib/hmac.h: Add hmac_sha256 and hmac_sha512 prototypes.
+       * m4/sha256.m4: Protect against empty expansion.
+       * m4/sha512.m4: Likewise.
+       * lib/hmac-sha256.c: New file.
+       * lib/hmac-sha512.c: Likewise.
+       * m4/gc-hmac-sha256.m4: Likewise.
+       * m4/gc-hmac-sha512.m4: Likewise.
+       * m4/gc-sha256.m4: Likewise.
+       * m4/gc-sha512.m4: Likewise.
+       * modules/crypto/gc-hmac-sha256: Likewise.
+       * modules/crypto/gc-hmac-sha256-tests: Likewise.
+       * modules/crypto/gc-hmac-sha512: Likewise.
+       * modules/crypto/gc-hmac-sha512-tests: Likewise.
+       * modules/crypto/hmac-sha256: Likewise.
+       * modules/crypto/hmac-sha256-tests: Likewise.
+       * modules/crypto/hmac-sha512: Likewise.
+       * modules/crypto/hmac-sha512-tests: Likewise.
+       * tests/test-gc-hmac-sha256.c: Likewise.
+       * tests/test-gc-hmac-sha512.c: Likewise
+       * tests/test-hmac-sha256.c: Likewise.
+       * tests/test-hmac-sha512.c: Likewise
+
+2013-08-24  Daiki Ueno  <ueno@gnu.org>
+
+       * m4/intl.m4: Update from gettext-0.18.3.1, which fixes a misuse
+       of AC_CHECK_DECLS.
+
+2013-08-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+       selinux-at: omit unnecessary include
+       * lib/selinux-at.c: Don't include dosname.h; not needed, since
+       this source file doesn't use its macros, and subsidiary files that
+       use the macros already include it.
+
+2013-08-21  Eric Blake  <eblake@redhat.com>
+
+       d-ino: avoid false negative on symlink
+       * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Use lstat.
+       Reported by Stephane Chazelas.
+
+2013-08-12  Mike Miller  <mtmiller@ieee.org>  (tiny change)
+
+       bootstrap: port to OpenBSD sed
+       * build-aux/bootstrap (insert_if_absent): Port to OpenBSD sed which
+       does not interpret `-' as a file argument to mean stdin.
+
+2013-08-15  Eric Blake  <eblake@redhat.com>
+
+       warnings: minor optimization
+       * m4/warnings.m4 (gl_COMPILER_OPTION_IF): Use fewer processes.
+
+       warnings: check -Wfoo rather than -Wno-foo
+       * m4/warnings.m4 (gl_COMPILER_OPTION_IF): If name begins with
+       -Wno-, test if the compiler recognizes the positive form instead.
+
+2013-08-15  Karl Berry  <karl@gnu.org>
+
+       * config/srclist-update: add option "doclicense" to placate
+       pulling *.texi files from Emacs.  Write terse usage
+       documentation at the top.
+
+2013-08-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       xvasprintf-tests: port to GCC with hardening flags
+       * tests/test-xvasprintf.c (test_xasprintf): Pass another arg to
+       xasprintf, to pacify GCC.  Reported by Santiago Vila in:
+       http://lists.gnu.org/archive/html/bug-diffutils/2013-08/msg00002.html
+
+2013-08-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+       fpending: port to recent Cygwin change to stdio_ext.h
+       Reported by LRN in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00028.html>.
+       * lib/fpending.h: Don't worry about HAVE_DECL___FPENDING;
+       just declare __fpending unless it's a macro.
+       A duplicate decl shouldn't hurt.
+       * m4/fpending.m4 (gl_FUNC_FPENDING): Check that an __fpending
+       call compiles and links, instead of separately checking for
+       decl and lib function.
+       * modules/fpending (configure-ac):
+       Adjust to fpending.m4's renaming of shell variable.
+
+2013-08-10  Paul Eggert  <eggert@cs.ucla.edu>
+
+       sys_time: port to OpenBSD
+       * lib/sys_time.in.h: Simply delegate to the system's header
+       in the BSDish cases as well.  Problem reported by Mike Miller in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00016.html>.
+       * tests/test-sys_select.c, tests/test-sys_time.c (verify_tv_sec_type):
+       Allow platforms like 64-bit OpenBSD where timeval's tv_sec is
+       wider than time_t.
+
+2013-08-09  Pádraig Brady <P@draigBrady.com>
+
+       bootstrap: support checksum utils having -c but not --status
+       * build-aux/bootstrap: Only look for sha1sum if updating po files.
+       Add sha1 to the list of supported checksum utils since it's now
+       supported through adjustments below.
+       (update_po_files): Remove the use of --status
+       in a way that will suppress all error messages, but since this is
+       only used to minimize updates, it shouldn't cause an issue.
+       Exit early if there is a problem updating the po file checksums.
+       (find_tool): Remove the check for --version support as this
+       is optional as per commit 86186b17.  Don't even check for the
+       presence of the command as if that is needed, it's supported
+       through configuring prerequisites in bootstrap.conf.
+       Prompt that when a tool isn't found, one can define an environment
+       variable to add to the hardcoded search list.
+
+2013-08-05  Jim Meyering  <meyering@fb.com>
+
+       regex: port to non-glibc/lock-using systems
+       Since 29-05-2013 commit, 55ba71f4, compilation on a non-glibc
+       system with GNULIB_LOCK would fail due to absence of the
+       included "glthread/lock.h".  This would affect any package
+       for which the "lock" module is used only by the regex module,
+       and not explicitly used.
+       * m4/regex.m4 (gl_PREREQ_REGEX): Require gl_GLIBC21.
+       * modules/regex (Depends-on) [!GLIBC && $ac_use_included_regex]:
+       Add a dependency on the "lock" module.
+
+2013-07-20  Daiki Ueno  <ueno@gnu.org>
+
+       localecharset: make locale_charset thread-safe on Mac OS X
+       * lib/localcharset.c (locale_charset) [DARWIN7]: Use MB_CUR_MAX_L
+       instead of MB_CUR_MAX.
+
+2013-07-20  Daiki Ueno  <ueno@gnu.org>
+
+       gettext: update to version 0.18.3
+       * m4/intl.m4, m4/po.m4: Update from gettext-0.18.3.  In particular,
+       require AC_PROG_SED to allow user to specify custom sed command when
+       generating en@quot PO file.
+
+2013-07-18  Werner Lemberg <wl@gnu.org>  (tiny change)
+
+       bootstrap: use correct source when copying build-aux files
+       * build-aux/bootstrap (gnulib_extra_files): This variable is
+       relative to upstream gnulib layout, not downstream.
+
+2013-07-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       tmpdir: fix bug in VMS port
+       * lib/tmpdir.c (path_search) [__VMS]: Never add slash.
+       See Steven M. Schweda in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00026.html>.
+
+2013-07-15  Paul Eggert  <eggert@cs.ucla.edu>
+
+       tmpdir: port to VMS, to // != /, and to long dirs
+       * lib/tmpdir.c (__libc_secure_getenv) [!_LIBC]: Rename from
+       __secure_getenv, so that we're more like the glibc version.
+       All uses changed.
+       (path_search): Don't put slash after directory if __VMS.
+       Problem reported by Steven M. Schweda in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00019.html>.
+       Simplify code to add slash; no need for a loop.
+       Do not remove trailing slash from "//".
+       Do not assume dlen <= INT_MAX.
+
+2013-07-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       regex: port to --with-included-regex --enable-gcc-warnings non-threaded
+       * lib/regex_internal.h (lock_fini, lock_lock): Rework to avoid
+       gcc warnings in the non-threaded case.  Reported by Charlie Brown in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00015.html>.
+
+       accept4, dup3, pipe2: port to Cygwin
+       Problem reported for Emacs by Ken Brown in <http://bugs.gnu.org/14821>.
+       * lib/accept4.c (accept4) [O_BINARY]:
+       * lib/dup3.c (dup3) [O_BINARY]:
+       * lib/pipe2.c (pipe2) [O_BINARY]:
+       Use set_binary_mode, not setmode.
+       * lib/pipe2.c [!GNULIB_BINARY_IO]: Include binary-io.h.
+       * modules/binary-io (Depends-on): Remove module indicator.
+       These last two bits undo the previous change to pipe2 and binary-io.
+
+2013-07-09  Pádraig Brady  <P@draigBrady.com>
+
+       mountlist: add support for deallocating returned list entries
+       * lib/mountlist.c (free_mount_entry): A new exported function
+       to deallocate a mount list entry.
+       (read_file_system_list): Refactor to use the new deallocation function.
+       Suggested by Anton Ovchinnikov.
+
+2013-07-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+       stdalign, verify: port to FreeBSD 9.1, to C11, and to C++11
+       Problem reported by Ulrich Mueller in <http://bugs.gnu.org/14812>.
+       * lib/stdalign.in.h (_Alignas, _Alignof):
+       Port to FreeBSD 9.1, and to C11 and C++11.
+       (_Alignas): Also support ICC.
+       * lib/verify.h (_Static_assert): Undef if <stddef.h> defines it.
+       * m4/stdalign.m4 (gl_STDALIGN_H): Port to ICC and to C++11.
+
 2013-07-06  Paul Eggert  <eggert@cs.ucla.edu>
 
        fnmatch: don't goto over declaration
        Problem reported by Charlie Brown in
        <http://lists.gnu.org/archive/html/bug-gnulib/2013-07/msg00009.html>.
 
+       pipe2: decouple from binary-io a bit
+       This is for Emacs, which needs pipe2 but not binary-io.
+       * lib/pipe2.c [!GNULIB_BINARY_IO]: Don't include binary-io.h.
+       * modules/binary-io (Depends-on): Add module indicator.
+
 2013-07-03  Eric Blake  <eblake@redhat.com>
 
        mgetgroups: relax license to LGPLv2+
        nproc: relax license to LGPLv2+
        * modules/nproc (License): Change from LGPLv3+.
 
+       bootstrap: honor --no-git
+       * build-aux/bootstrap: Don't even try to use git when user is
+       pointing to a static checkout.
+
+2013-06-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+       ignore-value: port to gcc -pedantic
+       * lib/ignore-value.h (ignore_value):
+       Port to gcc -pedantic, by using __extension__.
+       Reindent as per usual gnulib style nowadays.
+       Simplify GCC version check.
+
+2013-06-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       extern-inline: port to gcc -std=c89
+       * m4/extern-inline.m4 (gl_EXTERN_INLINE):
+       Do not use __gnu_inline__ if pedantic and pre-C99.
+
+2013-06-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       doc: document extern-inline
+       * doc/extern-inline.texi: New file.
+       * doc/gnulib.texi (alloca-opt): Include it.
+       * m4/extern-inline.m4: Move some comments to documentation,
+       and others closer to what they describe.
+
+       doc: chatter less
+       * doc/Makefile (NEWEST_GNULIB_TEXI_FILE): New macro.
+       (updated-stamp): Use it.  This causes 'make' to output just
+       one file name rather than zillions.
+
+       fflush, fseeko: port to musl cross-compiles
+       * lib/fseeko.c (fseeko): Assume that fflushing stdin works if
+       on some implementation that (1) is not known to be buggy,
+       (2) claims conformance to POSIX.1-2008 or later, and (3) is being
+       cross-compiled to so we can't easily check for lack of
+       conformance.  This is for cross-compiling to musl.
+       Reported by Rich Felker in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-06/msg00043.html>.
+       * m4/fclose.m4 (gl_FUNC_FCLOSE):
+       * m4/fflush.m4 (gl_FUNC_FFLUSH):
+       * m4/fseeko.m4 (gl_FUNC_FSEEKO):
+       Adjust to above change.
+       * m4/fflush.m4 (gl_FUNC_FFLUSH_STDIN): Set gl_cv_func_fflush_stdin
+       to 'cross', not to 'no', when cross-compiling.  AC_DEFINE
+       FUNC_FFLUSH_STDIN to 1, 0, -1 if fflushing stdin is known to work,
+       known not to work, or unknown.
+
+2013-06-15  Paul Eggert  <eggert@cs.ucla.edu>
+
+       msvc-inval: port to mingw-w64
+       * lib/msvc-inval.c (gl_msvc_invalid_parameter_handler):
+       Use __cdecl, not cdecl, for mingw-w64.  Reported by LRN in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-06/msg00039.html>.
+
 2013-06-11  Paul Eggert  <eggert@cs.ucla.edu>
 
        getcwd-lgpl: port to Tru64
        if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to
        be needed on Solaris either.
        * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]:
-       Simply delgate to the system <sys/time.h> in this case.
+       Simply delegate to the system <sys/time.h> in this case.
 
 2013-03-19  Karl Berry  <karl@gnu.org>
 
index 5a563d4..5a0405c 100755 (executable)
@@ -1757,6 +1757,7 @@ func_all_modules ()
   func_begin_table
   func_module count-leading-zeros
   func_module count-one-bits
+  func_module count-trailing-zeros
   func_module ffs
   func_module ffsl
   func_module ffsll
index 0cbea66..5acbe5b 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2013-05-08.20; # UTC
+scriptversion=2013-12-05.23; # UTC
 
 # Bootstrap this package from checked-out sources.
 
@@ -209,12 +209,16 @@ bootstrap_sync=false
 # Use git to update gnulib sources
 use_git=true
 
+check_exists() {
+  ($1 --version </dev/null) >/dev/null 2>&1
+  test $? -lt 126
+}
+
 # find_tool ENVVAR NAMES...
 # -------------------------
 # Search for a required program.  Use the value of ENVVAR, if set,
-# otherwise find the first of the NAMES that can be run (i.e.,
-# supports --version).  If found, set ENVVAR to the program name,
-# die otherwise.
+# otherwise find the first of the NAMES that can be run.
+# If found, set ENVVAR to the program name, die otherwise.
 #
 # FIXME: code duplication, see also gnu-web-doc-update.
 find_tool ()
@@ -224,27 +228,21 @@ find_tool ()
   find_tool_names=$@
   eval "find_tool_res=\$$find_tool_envvar"
   if test x"$find_tool_res" = x; then
-    for i
-    do
-      if ($i --version </dev/null) >/dev/null 2>&1; then
-       find_tool_res=$i
-       break
+    for i; do
+      if check_exists $i; then
+        find_tool_res=$i
+        break
       fi
     done
-  else
-    find_tool_error_prefix="\$$find_tool_envvar: "
   fi
-  test x"$find_tool_res" != x \
-    || die "one of these is required: $find_tool_names"
-  ($find_tool_res --version </dev/null) >/dev/null 2>&1 \
-    || die "${find_tool_error_prefix}cannot run $find_tool_res --version"
+  if test x"$find_tool_res" = x; then
+    warn_ "one of these is required: $find_tool_names;"
+    die   "alternatively set $find_tool_envvar to a compatible tool"
+  fi
   eval "$find_tool_envvar=\$find_tool_res"
   eval "export $find_tool_envvar"
 }
 
-# Find sha1sum, named gsha1sum on MacPorts, and shasum on Mac OS X 10.6.
-find_tool SHA1SUM sha1sum gsha1sum shasum
-
 # Override the default configuration, if necessary.
 # Make sure that bootstrap.conf is sourced from the current directory
 # if we were invoked as "sh bootstrap".
@@ -256,12 +254,12 @@ esac
 # Extra files from gnulib, which override files from other sources.
 test -z "${gnulib_extra_files}" && \
   gnulib_extra_files="
-        $build_aux/install-sh
-        $build_aux/mdate-sh
-        $build_aux/texinfo.tex
-        $build_aux/depcomp
-        $build_aux/config.guess
-        $build_aux/config.sub
+        build-aux/install-sh
+        build-aux/mdate-sh
+        build-aux/texinfo.tex
+        build-aux/depcomp
+        build-aux/config.guess
+        build-aux/config.sub
         doc/INSTALL
 "
 
@@ -326,7 +324,7 @@ insert_if_absent() {
     die "Error: Duplicate entries in $file: " $duplicate_entries
   fi
   linesold=$(gitignore_entries $file | wc -l)
-  linesnew=$(echo "$str" | gitignore_entries - $file | sort -u | wc -l)
+  linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
   if [ $linesold != $linesnew ] ; then
     { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
       || die "insert_if_absent $file $str: failed"
@@ -469,8 +467,7 @@ check_versions() {
     if [ "$req_ver" = "-" ]; then
       # Merely require app to exist; not all prereq apps are well-behaved
       # so we have to rely on $? rather than get_version.
-      $app --version >/dev/null 2>&1
-      if [ 126 -le $? ]; then
+      if ! check_exists $app; then
         warn_ "Error: '$app' not found"
         ret=1
       fi
@@ -503,6 +500,12 @@ print_versions() {
   # can't depend on column -t
 }
 
+# Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6.
+# Also find the compatible sha1 utility on the BSDs
+if test x"$SKIP_PO" = x; then
+  find_tool SHA1SUM sha1sum gsha1sum shasum sha1
+fi
+
 use_libtool=0
 # We'd like to use grep -E, to see if any of LT_INIT,
 # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
@@ -548,13 +551,21 @@ if ! printf "$buildreq" | check_versions; then
   fi
 fi
 
+# Warn the user if autom4te appears to be broken; this causes known
+# issues with at least gettext 0.18.3.
+probe=$(echo 'm4_quote([hi])' | autom4te -l M4sugar -t 'm4_quote:$%' -)
+if test "x$probe" != xhi; then
+  warn_ "WARNING: your autom4te wrapper eats stdin;"
+  warn_ "if bootstrap fails, consider upgrading your autotools"
+fi
+
 echo "$0: Bootstrapping from checked-out $package sources..."
 
 # See if we can use gnulib's git-merge-changelog merge driver.
-if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
+if $use_git && test -d .git && check_exists git; then
   if git config merge.merge-changelog.driver >/dev/null ; then
     :
-  elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
+  elif check_exists git-merge-changelog; then
     echo "$0: initializing git-merge-changelog driver"
     git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
     git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
@@ -574,13 +585,17 @@ git_modules_config () {
   test -f .gitmodules && git config --file .gitmodules "$@"
 }
 
-gnulib_path=$(git_modules_config submodule.gnulib.path)
-test -z "$gnulib_path" && gnulib_path=gnulib
+if $use_git; then
+  gnulib_path=$(git_modules_config submodule.gnulib.path)
+  test -z "$gnulib_path" && gnulib_path=gnulib
+fi
 
-# Get gnulib files.
+# Get gnulib files.  Populate $GNULIB_SRCDIR, possibly updating a
+# submodule, for use in the rest of the script.
 
 case ${GNULIB_SRCDIR--} in
 -)
+  # Note that $use_git is necessarily true in this case.
   if git_modules_config submodule.gnulib.url >/dev/null; then
     echo "$0: getting gnulib files..."
     git submodule init || exit $?
@@ -601,8 +616,8 @@ case ${GNULIB_SRCDIR--} in
   GNULIB_SRCDIR=$gnulib_path
   ;;
 *)
-  # Use GNULIB_SRCDIR as a reference.
-  if test -d "$GNULIB_SRCDIR"/.git && \
+  # Use GNULIB_SRCDIR directly or as a reference.
+  if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
         git_modules_config submodule.gnulib.url >/dev/null; then
     echo "$0: getting gnulib files..."
     if git submodule -h|grep -- --reference > /dev/null; then
@@ -628,6 +643,9 @@ case ${GNULIB_SRCDIR--} in
   ;;
 esac
 
+# $GNULIB_SRCDIR now points to the version of gnulib to use, and
+# we no longer need to use git or $gnulib_path below here.
+
 if $bootstrap_sync; then
   cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
     echo "$0: updating bootstrap and restarting..."
@@ -685,11 +703,10 @@ update_po_files() {
     cksum_file="$ref_po_dir/$po.s1"
     if ! test -f "$cksum_file" ||
         ! test -f "$po_dir/$po.po" ||
-        ! $SHA1SUM -c --status "$cksum_file" \
-            < "$new_po" > /dev/null; then
+        ! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then
       echo "$me: updated $po_dir/$po.po..."
       cp "$new_po" "$po_dir/$po.po" \
-          && $SHA1SUM < "$new_po" > "$cksum_file"
+          && $SHA1SUM < "$new_po" > "$cksum_file" || return
     fi
   done
 }
index b79252d..9afd676 100755 (executable)
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2013-06-10'
+timestamp='2013-11-29'
 
 # 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
@@ -1260,16 +1260,26 @@ EOF
        if test "$UNAME_PROCESSOR" = unknown ; then
            UNAME_PROCESSOR=powerpc
        fi
-       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) | \
-               grep IS_64BIT_ARCH >/dev/null
-           then
-               case $UNAME_PROCESSOR in
-                   i386) UNAME_PROCESSOR=x86_64 ;;
-                   powerpc) UNAME_PROCESSOR=powerpc64 ;;
-               esac
+       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) | \
+                   grep IS_64BIT_ARCH >/dev/null
+               then
+                   case $UNAME_PROCESSOR in
+                       i386) UNAME_PROCESSOR=x86_64 ;;
+                       powerpc) UNAME_PROCESSOR=powerpc64 ;;
+                   esac
+               fi
            fi
+       elif test "$UNAME_PROCESSOR" = i386 ; then
+           # Avoid executing cc on OS X 10.9, as it ships with a stub
+           # that puts up a graphical alert prompting to install
+           # developer tools.  Any system running Mac OS X 10.7 or
+           # later (Darwin 11 and later) is required to have a 64-bit
+           # processor. This is not true of the ARM version of Darwin
+           # that Apple uses in portable devices.
+           UNAME_PROCESSOR=x86_64
        fi
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
        exit ;;
index 8b612ab..61cb4bc 100755 (executable)
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2013-04-24'
+timestamp='2013-10-01'
 
 # 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
@@ -257,7 +257,7 @@ case $basic_machine in
        | avr | avr32 \
        | be32 | be64 \
        | bfin \
-       | c4x | clipper \
+       | c4x | c8051 | clipper \
        | d10v | d30v | dlx | dsp16xx \
        | epiphany \
        | fido | fr30 | frv \
@@ -265,6 +265,7 @@ case $basic_machine in
        | hexagon \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
+       | k1om \
        | le32 | le64 \
        | lm32 \
        | m32c | m32r | m32rle | m68000 | m68k | m88k \
@@ -324,7 +325,7 @@ case $basic_machine in
        c6x)
                basic_machine=tic6x-unknown
                ;;
-       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
                basic_machine=$basic_machine-unknown
                os=-none
                ;;
@@ -372,7 +373,7 @@ case $basic_machine in
        | be32-* | be64-* \
        | bfin-* | bs2000-* \
        | c[123]* | c30-* | [cjt]90-* | c4x-* \
-       | clipper-* | craynv-* | cydra-* \
+       | c8051-* | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
        | elxsi-* \
        | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
@@ -381,6 +382,7 @@ case $basic_machine in
        | hexagon-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
+       | k1om-* \
        | le32-* | le64-* \
        | lm32-* \
        | m32c-* | m32r-* | m32rle-* \
@@ -794,7 +796,7 @@ case $basic_machine in
                os=-mingw64
                ;;
        mingw32)
-               basic_machine=i386-pc
+               basic_machine=i686-pc
                os=-mingw32
                ;;
        mingw32ce)
@@ -830,7 +832,7 @@ case $basic_machine in
                basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
                ;;
        msys)
-               basic_machine=i386-pc
+               basic_machine=i686-pc
                os=-msys
                ;;
        mvs)
@@ -1546,6 +1548,9 @@ case $basic_machine in
        c4x-* | tic4x-*)
                os=-coff
                ;;
+       c8051-*)
+               os=-elf
+               ;;
        hexagon-*)
                os=-elf
                ;;
index 98c7523..f9ec9df 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=2013-03-08.15
+scriptversion=2013-10-10.09
 
 # Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
 # Free Software Foundation, Inc.
@@ -272,6 +272,7 @@ mkdir -p "$outdir/"
 
 cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\""
 echo "Generating info... ($cmd)"
+rm -f $PACKAGE.info* # get rid of any strays
 eval "$cmd"
 tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info*
 ls -l "$outdir/$PACKAGE.info.tar.gz"
index 7edc541..0eb1326 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Usage:
-#   install-reloc library_path_var library_path_value prefix destdir \
-#                 compile_command srcdir builddir config_h_dir exeext \
-#                 strip_command \
-#                 install_command... destprog
+# Usage 1:
+#   install-reloc -- library_path_var library_path_value prefix destdir \
+#                    compile_command srcdir builddir config_h_dir exeext \
+#                    strip_command \
+#                    install_command... destprog
 # where
 #   - library_path_var is the platform dependent runtime library path variable
 #   - library_path_value is a colon separated list of directories that contain
 #     stripping is desired
 #   - install_command is the install command line, excluding the final destprog
 #   - destprog is the destination program name
+# Usage 2:
+#   env RELOC_LIBRARY_PATH_VAR=library_path_var \
+#       RELOC_LIBRARY_PATH_VALUE=library_path_value \
+#       RELOC_PREFIX=prefix \
+#       RELOC_DESTDIR=destdir \
+#       RELOC_COMPILE_COMMAND=compile_command \
+#       RELOC_SRCDIR=srcdir \
+#       RELOC_BUILDDIR=builddir \
+#       RELOC_CONFIG_H_DIR=config_h_dir \
+#       RELOC_EXEEXT=exeext \
+#       RELOC_STRIP_PROG=strip_command \
+#       RELOC_INSTALL_PROG=install_command... \
+#   install-reloc prog1 ... destprog
+#   where destprog is either the destination program name (when only one program
+#   is specified) or the destination directory for all programs.
 # install-reloc renames destprog to destprog.bin and installs a relocating
 # wrapper in the place of destprog.
 
 progname=$0
 
-if test $# -eq 2; then
-  # Get arguments from environment variables.
-  library_path_var=$RELOC_LIBRARY_PATH_VAR
-  library_path_value=$RELOC_LIBRARY_PATH_VALUE
-  prefix=$RELOC_PREFIX
-  destdir=$RELOC_DESTDIR
-  compile_command=$RELOC_COMPILE_COMMAND
-  srcdir=$RELOC_SRCDIR
-  builddir=$RELOC_BUILDDIR
-  config_h_dir=$RELOC_CONFIG_H_DIR
-  exeext=$RELOC_EXEEXT
-  strip_prog=$RELOC_STRIP_PROG
-  install_prog=$RELOC_INSTALL_PROG # including the "-c" option
+if test $# -ge 12 && test "x$1" = "x--"; then
+  # Get fixed position arguments.
+  shift
+  library_path_var=$1
+  library_path_value=$2
+  prefix=$3
+  destdir=$4
+  shift
+  shift
+  shift
+  shift
+  compile_command=$1
+  srcdir=$2
+  builddir=$3
+  config_h_dir=$4
+  exeext=$5
+  shift
+  shift
+  shift
+  shift
+  shift
+  strip_prog=$1
+  shift
+  install_prog=$1 # maybe not including the "-c" option
+  shift
 else
-  if test $# -ge 11; then
-    # Get fixed position arguments.
-    library_path_var=$1
-    library_path_value=$2
-    prefix=$3
-    destdir=$4
-    shift
-    shift
-    shift
-    shift
-    compile_command=$1
-    srcdir=$2
-    builddir=$3
-    config_h_dir=$4
-    exeext=$5
-    shift
-    shift
-    shift
-    shift
-    shift
-    strip_prog=$1
-    shift
-    install_prog=$1 # maybe not including the "-c" option
-    shift
+  if test $# -ge 2; then
+    # Get arguments from environment variables.
+    library_path_var=$RELOC_LIBRARY_PATH_VAR
+    library_path_value=$RELOC_LIBRARY_PATH_VALUE
+    prefix=$RELOC_PREFIX
+    destdir=$RELOC_DESTDIR
+    compile_command=$RELOC_COMPILE_COMMAND
+    srcdir=$RELOC_SRCDIR
+    builddir=$RELOC_BUILDDIR
+    config_h_dir=$RELOC_CONFIG_H_DIR
+    exeext=$RELOC_EXEEXT
+    strip_prog=$RELOC_STRIP_PROG
+    install_prog=$RELOC_INSTALL_PROG # including the "-c" option
   else
-    echo "Usage: $0 library_path_var library_path_value prefix destdir" \
+    echo "Usage: $0 -- library_path_var library_path_value prefix destdir" \
          "compile_command srcdir builddir config_h_dir exeext" \
          "strip_command" \
          "install_command... destprog" 1>&2
@@ -97,11 +113,26 @@ for arg
 do
   destprog=$arg
 done
-# Remove trailing $exeext, if present.
+# Determine whether destprog is a program name or a directory name.
+if test -d "$destprog"; then
+  sed_remove_trailing_slashes='s|//*$||'
+  destprog_directory=`echo "$destprog" | sed -e "$sed_remove_trailing_slashes"`
+  if test -z "$destprog_directory"; then
+    destprog_directory='/'
+  fi
+else
+  destprog_directory=
+fi
+# Prepare for remove trailing $exeext, if present.
 if test -n "$exeext"; then
   sed_quote='s,\.,\\.,g'
   sed_remove_exeext='s|'`echo "$exeext" | sed -e "$sed_quote"`'$||'
-  destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"`
+fi
+if test -z "$destprog_directory"; then
+  # Remove trailing $exeext, if present.
+  if test -n "$exeext"; then
+    destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"`
+  fi
 fi
 
 # Outputs a command and runs it.
@@ -114,8 +145,39 @@ func_verbose ()
 # Run install_command.
 func_verbose $install_prog "$@" || exit $?
 
+# Iterate over all destination program names.
+# func_iterate f
+# applies f to each destination program names, after setting destprog.
+sed_basename_of_file='s|^.*/||'
+func_iterate ()
+{
+  if test -n "$destprog_directory"; then
+    prev_arg=
+    for arg
+    do
+      if test -n "prev_arg"; then
+        destprog="$destprog_directory"/`echo "$prev_arg" | sed -e "$sed_basename_of_file"`
+        $1
+      fi
+      prev_arg="$arg"
+    done
+  else
+    $1
+  fi
+}
+
 # Run strip_command.
-test "$strip_prog" = ':' || func_verbose "$strip_prog" "$destprog$exeext" || exit $?
+func_strip ()
+{
+  # Remove trailing $exeext, if present.
+  if test -n "$exeext"; then
+    destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"`
+  fi
+  func_verbose "$strip_prog" "$destprog$exeext" || exit $?
+}
+if test "$strip_prog" != ':'; then
+  func_iterate func_strip
+fi
 
 # If the platform doesn't support LD_LIBRARY_PATH or similar, we cannot build
 # a wrapper.
@@ -138,63 +200,77 @@ IFS="$save_IFS"
 test -n "$libdirs" || exit 0
 
 # Determine installdir from destprog, removing a leading destdir if present.
-installdir=`echo "$destprog" | sed -e 's,/[^/]*$,,'`
+if test -n "$destprog_directory"; then
+  installdir="$destprog_directory"
+else
+  installdir=`echo "$destprog" | sed -e 's,/[^/]*$,,'`
+fi
 if test -n "$destdir"; then
   sed_quote='s,\([|.\*^$[]\),\\\1,g'
   sed_remove_destdir='s|^'`echo "$destdir" | sed -e "$sed_quote"`'||'
   installdir=`echo "$installdir" | sed -e "$sed_remove_destdir"`
 fi
 
-# Compile wrapper.
-func_verbose $compile_command \
-             -I"$builddir" -I"$srcdir" -I"$config_h_dir" \
-             -DHAVE_CONFIG_H -DIN_RELOCWRAPPER -DNO_XMALLOC \
-             -D"INSTALLPREFIX=\"$prefix\"" -D"INSTALLDIR=\"$installdir\"" \
-             -D"LIBPATHVAR=\"$library_path_var\"" -D"LIBDIRS=$libdirs" \
-             -D"EXEEXT=\"$exeext\"" \
-             "$srcdir"/relocwrapper.c \
-             "$srcdir"/progname.c \
-             "$srcdir"/progreloc.c \
-             "$srcdir"/areadlink.c \
-             "$srcdir"/careadlinkat.c \
-             "$srcdir"/allocator.c \
-             "$srcdir"/readlink.c \
-             "$srcdir"/canonicalize-lgpl.c \
-             "$srcdir"/malloca.c \
-             "$srcdir"/relocatable.c \
-             "$srcdir"/setenv.c \
-             "$srcdir"/strerror.c \
-             "$srcdir"/c-ctype.c \
-             -o "$destprog.wrapper$exeext"
-rc=$?
-# Clean up object files left over in the current directory by the native C
-# compilers on Solaris, HP-UX, OSF/1, IRIX.
-rm -f relocwrapper.o \
-      progname.o \
-      progreloc.o \
-      areadlink.o \
-      careadlinkat.o \
-      allocator.o \
-      readlink.o \
-      canonicalize-lgpl.o \
-      malloca.o \
-      relocatable.o \
-      setenv.o \
-      strerror.o \
-      c-ctype.o
-test $rc = 0 || exit $?
-# Clean up debugging information left over by the native C compiler on Mac OS X.
-rm -rf "$destprog.wrapper$exeext.dSYM"
-test $rc = 0 || exit $?
-
-# Strip wrapper.
-test "$strip_prog" = ':' || func_verbose "$strip_prog" "$destprog.wrapper$exeext" || exit $?
-
-# Rename $destprog.wrapper -> $destprog -> $destprog.bin.
-ln -f "$destprog$exeext" "$destprog.bin$exeext" \
-  || { rm -f "$destprog.bin$exeext" \
-       && cp -p "$destprog$exeext" "$destprog.bin$exeext"; } \
-  || exit 1
-mv "$destprog.wrapper$exeext" "$destprog$exeext" || exit 1
+# Compile and install wrapper.
+func_create_wrapper ()
+{
+  # Remove trailing $exeext, if present.
+  if test -n "$exeext"; then
+    destprog=`echo "$destprog" | sed -e "$sed_remove_exeext"`
+  fi
+
+  # Compile wrapper.
+  func_verbose $compile_command \
+               -I"$builddir" -I"$srcdir" -I"$config_h_dir" \
+               -DHAVE_CONFIG_H -DIN_RELOCWRAPPER -DNO_XMALLOC \
+               -D"INSTALLPREFIX=\"$prefix\"" -D"INSTALLDIR=\"$installdir\"" \
+               -D"LIBPATHVAR=\"$library_path_var\"" -D"LIBDIRS=$libdirs" \
+               -D"EXEEXT=\"$exeext\"" \
+               "$srcdir"/relocwrapper.c \
+               "$srcdir"/progname.c \
+               "$srcdir"/progreloc.c \
+               "$srcdir"/areadlink.c \
+               "$srcdir"/careadlinkat.c \
+               "$srcdir"/allocator.c \
+               "$srcdir"/readlink.c \
+               "$srcdir"/canonicalize-lgpl.c \
+               "$srcdir"/malloca.c \
+               "$srcdir"/relocatable.c \
+               "$srcdir"/setenv.c \
+               "$srcdir"/strerror.c \
+               "$srcdir"/c-ctype.c \
+               -o "$destprog.wrapper$exeext"
+  rc=$?
+  # Clean up object files left over in the current directory by the native C
+  # compilers on Solaris, HP-UX, OSF/1, IRIX.
+  rm -f relocwrapper.o \
+        progname.o \
+        progreloc.o \
+        areadlink.o \
+        careadlinkat.o \
+        allocator.o \
+        readlink.o \
+        canonicalize-lgpl.o \
+        malloca.o \
+        relocatable.o \
+        setenv.o \
+        strerror.o \
+        c-ctype.o
+  test $rc = 0 || exit $?
+  # Clean up debugging information left over by the native C compiler on MacOS X.
+  rm -rf "$destprog.wrapper$exeext.dSYM"
+  test $rc = 0 || exit $?
+
+  # Strip wrapper.
+  test "$strip_prog" = ':' || func_verbose "$strip_prog" "$destprog.wrapper$exeext" || exit $?
+
+  # Rename $destprog.wrapper -> $destprog -> $destprog.bin.
+  ln -f "$destprog$exeext" "$destprog.bin$exeext" \
+    || { rm -f "$destprog.bin$exeext" \
+         && cp -p "$destprog$exeext" "$destprog.bin$exeext"; } \
+    || exit 1
+  mv "$destprog.wrapper$exeext" "$destprog$exeext" || exit 1
+}
+func_iterate func_create_wrapper
 
 exit 0
index 863c73e..ffd0788 100644 (file)
 
 # Prologue & configuration
 BEGIN {
+    # Portable lookup of present time.
+    "date +%s" | getline epoch_time
+    "date" | getline chronos_time
+
     section_global_stats_p = 1
     section_function_cyclo_p = 1
 
@@ -69,7 +73,7 @@ BEGIN {
 Copyright (c) 2007, 2008 Free Software Foundation, Inc."
     html_doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \
 \"http://www.w3.org/TR/html401/loose.dtd\">"
-    html_comment = "<!-- Generated by gnulib's pmccabe2html at " systime() " -->"
+    html_comment = "<!-- Generated by gnulib's pmccabe2html at " epoch_time " -->"
     html_title = "Cyclomatic Complexity report for " package_name
 
     # Wiki options
@@ -211,7 +215,7 @@ function html_header ()
            print cssline
        }
         print "-->"
-       print "</style />"
+       print "</style>"
        close(css)
     }
     print "</head>"
@@ -418,9 +422,9 @@ function html_fnc (nfun,
 
             while ((getline codeline < (fname nfun "_fn.txt")) > 0)
             {
-                sub(/\\</, "&lt;", codeline)
-                sub(/\\>/, "&gt;", codeline)
-                sub(/&/, "&amp;", codeline)
+                gsub(/&/, "\&amp;", codeline)  # Must come first.
+                gsub(/</, "\&lt;", codeline)
+                gsub(/>/, "\&gt;", codeline)
 
                 print codeline
             }
@@ -852,12 +856,12 @@ END {
     if (output_lang == "html")
     {
         print "<div class=\"page_title\">" package_name " Cyclomatic Complexity Report</div>"
-        print "<p>Report generated at: <span class=\"report_timestamp\">" strftime() "</div></p>"
+        print "<p>Report generated at: <span class=\"report_timestamp\">" chronos_time "</span></p>"
     }
     if (output_lang == "wiki")
     {
         print "==" package_name " Cyclomatic Complexity Report=="
-        print "Report generated at: '''" strftime() "'''"
+        print "Report generated at: '''" chronos_time "'''"
     }
 
     if (section_global_stats_p)
index 85f184c..bfd765d 100644 (file)
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2013-02-01.11}
+\def\texinfoversion{2013-09-11.11}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
   \toks6=\expandafter{\prevsectiondefs}%
   \toks8=\expandafter{\lastcolordefs}%
   \mark{%
-                   \the\toks0 \the\toks2
-      \noexpand\or \the\toks4 \the\toks6
-    \noexpand\else \the\toks8
+                   \the\toks0 \the\toks2  % 0: top marks (\last...)
+      \noexpand\or \the\toks4 \the\toks6  % 1: bottom marks (default, \prev...)
+    \noexpand\else \the\toks8             % 2: color marks
   }%
 }
 % \topmark doesn't work for the very first chapter (after the title
   %
   % Do this outside of the \shipout so @code etc. will be expanded in
   % the headline as they should be, not taken literally (outputting ''code).
+  \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars}
+  %
   \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
-  \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+  \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
+  %
   \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
-  \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+  \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
   %
   {%
     % Have to do this stuff outside the \shipout because we want it to
@@ -2377,8 +2380,10 @@ end
   \ifx\next,%
   \else\ifx\next-%
   \else\ifx\next.%
+  \else\ifx\next\.%
+  \else\ifx\next\comma%
   \else\ptexslash
-  \fi\fi\fi
+  \fi\fi\fi\fi\fi
   \aftersmartic
 }
 
@@ -2475,14 +2480,14 @@ end
 }
 
 % We *must* turn on hyphenation at `-' and `_' in @code.
+% (But see \codedashfinish below.)
 % Otherwise, it is too hard to avoid overfull hboxes
 % in the Emacs manual, the Library manual, etc.
 %
 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
 % both hyphenation at - and hyphenation within words.
 % We must therefore turn them both off (\tclose does that)
-% and arrange explicitly to hyphenate at a dash.
-%  -- rms.
+% and arrange explicitly to hyphenate at a dash. -- rms.
 {
   \catcode`\-=\active \catcode`\_=\active
   \catcode`\'=\active \catcode`\`=\active
@@ -2499,14 +2504,35 @@ end
      \let-\normaldash
      \let_\realunder
     \fi
+    % Given -foo (with a single dash), we do not want to allow a break
+    % after the hyphen.
+    \global\let\codedashprev=\codedash
+    %
     \codex
   }
+  %
+  \gdef\codedash{\futurelet\next\codedashfinish}
+  \gdef\codedashfinish{%
+    \normaldash % always output the dash character itself.
+    % 
+    % Now, output a discretionary to allow a line break, unless
+    % (a) the next character is a -, or
+    % (b) the preceding character is a -.
+    % E.g., given --posix, we do not want to allow a break after either -.
+    % Given --foo-bar, we do want to allow a break between the - and the b.
+    \ifx\next\codedash \else
+      \ifx\codedashprev\codedash 
+      \else \discretionary{}{}{}\fi
+    \fi
+    % we need the space after the = for the case when \next itself is a
+    % space token; it would get swallowed otherwise.  As in @code{- a}.
+    \global\let\codedashprev= \next
+  }
 }
-
+\def\normaldash{-}
+%
 \def\codex #1{\tclose{#1}\endgroup}
 
-\def\normaldash{-}
-\def\codedash{-\discretionary{}{}{}}
 \def\codeunder{%
   % this is all so @math{@code{var_name}+1} can work.  In math mode, _
   % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
@@ -2868,6 +2894,15 @@ end
   \def\inlinefmtname{#1}%
   \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
 }
+% 
+% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
+% FMTNAME is tex, else ELSE-TEXT.
+\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
+\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
+  \def\inlinefmtname{#1}%
+  \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
+}
+%
 % For raw, must switch into @tex before parsing the argument, to avoid
 % setting catcodes prematurely.  Doing it this way means that, for
 % example, @inlineraw{html, foo{bar} gets a parse error instead of being
@@ -2884,6 +2919,23 @@ end
   \endgroup % close group opened by \tex.
 }
 
+% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
+%
+\long\def\inlineifset#1{\doinlineifset #1,\finish}
+\long\def\doinlineifset#1,#2,\finish{%
+  \def\inlinevarname{#1}%
+  \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
+  \else\ignorespaces#2\fi
+}
+
+% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
+%
+\long\def\inlineifclear#1{\doinlineifclear #1,\finish}
+\long\def\doinlineifclear#1,#2,\finish{%
+  \def\inlinevarname{#1}%
+  \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
+}
+
 
 \message{glyphs,}
 % and logos.
@@ -4179,7 +4231,7 @@ end
 \def\value{\begingroup\makevalueexpandable\valuexxx}
 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
 {
-  \catcode`\- = \active \catcode`\_ = \active
+  \catcode`\-=\active \catcode`\_=\active
   %
   \gdef\makevalueexpandable{%
     \let\value = \expandablevalue
@@ -4199,7 +4251,12 @@ end
 % variable's value contains other Texinfo commands, it's almost certain
 % it will fail (although perhaps we could fix that with sufficient work
 % to do a one-level expansion on the result, instead of complete).
-%
+% 
+% Unfortunately, this has the consequence that when _ is in the *value*
+% of an @set, it does not print properly in the roman fonts (get the cmr
+% dot accent at position 126 instead).  No fix comes to mind, and it's
+% been this way since 2003 or earlier, so just ignore it.
+% 
 \def\expandablevalue#1{%
   \expandafter\ifx\csname SET#1\endcsname\relax
     {[No value for ``#1'']}%
@@ -4211,8 +4268,9 @@ end
 
 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
 % with @set.
-%
-% To get special treatment of `@end ifset,' call \makeond and the redefine.
+% 
+% To get the special treatment we need for `@end ifset,' we call
+% \makecond and then redefine.
 %
 \makecond{ifset}
 \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
@@ -5885,7 +5943,7 @@ end
     %
     % Now the second mark, after the heading break.  No break points
     % between here and the heading.
-    \let\prevsectiondefs=\lastsectiondefs
+    \global\let\prevsectiondefs=\lastsectiondefs
     \domark
     %
     % Only insert the space after the number if we have a section number.
@@ -6252,8 +6310,8 @@ end
   \catcode `\|=\other
   \catcode `\<=\other
   \catcode `\>=\other
-  \catcode`\`=\other
-  \catcode`\'=\other
+  \catcode `\`=\other
+  \catcode `\'=\other
   \escapechar=`\\
   %
   % ' is active in math mode (mathcode"8000).  So reset it, and all our
@@ -6277,7 +6335,7 @@ end
   \let\/=\ptexslash
   \let\*=\ptexstar
   \let\t=\ptext
-  \expandafter \let\csname top\endcsname=\ptextop  % outer
+  \expandafter \let\csname top\endcsname=\ptextop  % we've made it outer
   \let\frenchspacing=\plainfrenchspacing
   %
   \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
@@ -6402,7 +6460,7 @@ end
 \newdimen\nonfillparindent
 \def\nonfillstart{%
   \aboveenvbreak
-  \hfuzz = 12pt % Don't be fussy
+  \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
   \sepspaces % Make spaces be word-separators rather than space tokens.
   \let\par = \lisppar % don't ignore blank lines
   \obeylines % each line of input is a line of output
@@ -9920,11 +9978,9 @@ directory should work if nowhere else does.}
 \catcode`\"=\active
 \def\activedoublequote{{\tt\char34}}
 \let"=\activedoublequote
-\catcode`\~=\active
-\def~{{\tt\char126}}
+\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
 \chardef\hat=`\^
-\catcode`\^=\active
-\def^{{\tt \hat}}
+\catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat
 
 \catcode`\_=\active
 \def_{\ifusingtt\normalunderscore\_}
@@ -9934,16 +9990,26 @@ directory should work if nowhere else does.}
 
 \catcode`\|=\active
 \def|{{\tt\char124}}
+
 \chardef \less=`\<
-\catcode`\<=\active
-\def<{{\tt \less}}
+\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
 \chardef \gtr=`\>
-\catcode`\>=\active
-\def>{{\tt \gtr}}
-\catcode`\+=\active
-\def+{{\tt \char 43}}
-\catcode`\$=\active
-\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
+\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
+\catcode`\+=\active \def+{{\tt \char 43}}
+\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
+
+% used for headline/footline in the output routine, in case the page
+% breaks in the middle of an @tex block.
+\def\texinfochars{%
+  \let< = \activeless
+  \let> = \activegtr
+  \let~ = \activetilde 
+  \let^ = \activehat
+  \markupsetuplqdefault \markupsetuprqdefault 
+  \let\b = \strong
+  \let\i = \smartitalic
+  % in principle, all other definitions in \tex have to be undone too.
+}
 
 % If a .fmt file is being used, characters that might appear in a file
 % name cannot be active until we have parsed the command line.
index ee7b295..1fa6563 100755 (executable)
@@ -2,6 +2,20 @@
 # Check for files in directory $1 being up to date, according to the
 # list on stdin.  Don't actually make any changes, just show the diffs.
 #
+# Empty (or only whitespace) input lines are ignored.
+# Lines beginning with # are ignored.
+# Lines with just one word are ignored.
+# Otherwise, the line has two or more whitespace-separated words:
+#   the first word is the source, the second word is the destination,
+#   other optional words are options.
+# The possible options are "gpl" (to replace the license with the GPL)
+#   and "doclicense" (to replace @include doclicense.texi with fdl.texi).
+#   Unrecognized options are ignored.
+# $VARIABLE expansions are done (with sh eval).
+#
+# This script is used in gnulib and texinfo; the input files are named
+# srclist.txt.
+#
 # Copyright (C) 2002-2003, 2005, 2007-2013 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
@@ -83,6 +97,9 @@ fixfile() \
   case " $options " in
   *' gpl '*)
     sed_command="$sed_command; $fixlicense";;
+
+  *' doclicense '*)
+    sed_command="$sed_command; s/@include doclicense.texi/@include fdl.texi/";;
   esac
 
   sed "$sed_command" $1 >$2
index 007e939..2099840 100644 (file)
@@ -12,8 +12,8 @@ without warranty of any kind.
 Basic Installation
 ==================
 
-   Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package.  The following
+   Briefly, the shell command `./configure && make && make install'
+should configure, build, and install this package.  The following
 more-detailed instructions are generic; see the `README' file for
 instructions specific to this package.  Some packages provide this
 `INSTALL' file but do not implement all of the features documented
index 5fd5407..d60c04b 100644 (file)
@@ -12,8 +12,8 @@ without warranty of any kind.
 Basic Installation
 ==================
 
-   Briefly, the shell commands './configure; make; make install' should
-configure, build, and install this package.  The following
+   Briefly, the shell command './configure && make && make install'
+should configure, build, and install this package.  The following
 more-detailed instructions are generic; see the 'README' file for
 instructions specific to this package.  Some packages provide this
 'INSTALL' file but do not implement all of the features documented
index 1cc2b4f..1479e9a 100644 (file)
@@ -12,8 +12,8 @@ without warranty of any kind.
 Basic Installation
 ==================
 
-   Briefly, the shell commands â€˜./configure; make; make install’ should
-configure, build, and install this package.  The following
+   Briefly, the shell command â€˜./configure && make && make install’
+should configure, build, and install this package.  The following
 more-detailed instructions are generic; see the â€˜README’ file for
 instructions specific to this package.  Some packages provide this
 â€˜INSTALL’ file but do not implement all of the features documented
index cdd9305..ce8882c 100644 (file)
@@ -39,7 +39,7 @@ INSTALL_PRELUDE = echo '@firstparagraphindent insert'
 
 OMIT_TRAILING_EMPTY_LINES = /^$$/H; /^$$/d; x; s/\n//p; s/\n*//; x
 
-# INSTALL file with old ASCII quotation marks (looks ugly on modern machines).
+# INSTALL file with directed ASCII quotation marks.
 INSTALL: install.texi
        $(INSTALL_PRELUDE) | cat - $< > tmp.texi
        $(MAKEINFO) --plaintext --no-validate tmp.texi \
@@ -55,10 +55,11 @@ INSTALL.UTF-8: INSTALL
        sed -e "s/\`\([^']*\)'/‘\1’/g" $< > $@
 
 GNULIB_TEXI_FILES = $(filter-out maintain.texi make-stds.texi standards.texi,$(wildcard *.texi)) $(wildcard posix-headers/*.texi) $(wildcard posix-functions/*.texi) $(wildcard glibc-headers/*.texi) $(wildcard glibc-functions/*.texi)
+NEWEST_GNULIB_TEXI_FILE = $(shell ls -t $(GNULIB_TEXI_FILES) | sed 1q)
 
 # Date of last update. Requires GNU date.
 updated-stamp: $(GNULIB_TEXI_FILES)
-       date -u -r `ls -t $^ | sed 1q` +"@set UPDATED %F %T" > $@
+       date -u -r $(NEWEST_GNULIB_TEXI_FILE) +"@set UPDATED %F %T" > $@
 
 # Dependencies. Search for @include to find them all.
 gnulib.info gnulib.html gnulib.dvi gnulib.pdf: $(GNULIB_TEXI_FILES) updated-stamp
diff --git a/doc/extern-inline.texi b/doc/extern-inline.texi
new file mode 100644 (file)
index 0000000..be97f4e
--- /dev/null
@@ -0,0 +1,99 @@
+@c GNU extern-inline module documentation
+
+@c Copyright (C) 2013 Free Software Foundation, Inc.
+
+@c Permission is granted to copy, distribute and/or modify this document
+@c under the terms of the GNU Free Documentation License, Version 1.3
+@c or any later version published by the Free Software Foundation;
+@c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+@c Texts.  A copy of the license is included in the ``GNU Free
+@c Documentation License'' file as part of this distribution.
+
+@c Written by Paul Eggert.
+
+@node extern inline
+@section Extern inline functions
+
+@cindex extern inline
+@cindex inline
+
+The @code{extern-inline} module supports the use of C99-style
+@code{extern inline} functions so that the code still runs on pre-C99
+compilers.
+
+C code ordinarily should not use @code{inline}.  Typically it is
+better to let the compiler figure out whether to inline, as compilers
+are pretty good about optimization nowadays.  In this sense,
+@code{inline} is like @code{register}, another keyword that is
+typically no longer needed.
+
+Functions defined (not merely declared) in headers are an exception,
+as avoiding @code{inline} would commonly cause problems for these
+functions.  Suppose @file{aaa.h} defines the function @code{aaa_fun},
+and @file{aaa.c}, @file{bbb.c} and @file{ccc.c} all include
+@file{aaa.h}.  If code is intended to portable to pre-C99 compilers,
+@code{aaa_fun} cannot be declared with the C99 @code{inline} keyword.
+This problem cannot be worked around by making @code{aaa_fun} an
+ordinary function, as it would be defined three times with external
+linkage and the definitions would clash.  Although @code{aaa_fun}
+could be a static function, with separate compilation if
+@code{aaa_fun} is not inlined its code will appear in the executable
+three times.
+
+To avoid this code bloat, @file{aaa.h} can do this:
+
+@example
+/* aaa.h */
+/* #include any other headers here */
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef AAA_INLINE
+# define AAA_INLINE _GL_INLINE
+#endif
+...
+AAA_INLINE int
+aaa_fun (int i)
+@{
+  return i + 1;
+@}
+...
+_GL_INLINE_HEADER_END
+@end example
+
+@noindent
+and @file{aaa.c} can do this:
+
+@example
+/* aaa.c */
+#include <config.h>
+#define AAA_INLINE _GL_EXTERN_INLINE
+#include <aaa.h>
+@end example
+
+@noindent
+whereas @file{bbb.c} and @file{ccc.c} can include @file{aaa.h} in the
+usual way.  C99 compilers expand @code{AAA_INLINE} to C99-style
+@code{inline} usage, where @code{aaa_fun} is declared @code{extern
+inline} in @file{aaa.c} and plain @code{inline} in other modules.
+Pre-C99 compilers that are compatible with GCC use GCC-specific syntax
+to accomplish the same ends.  Other pre-C99 compilers use @code{static
+inline} so they suffer from code bloat, but they are not mainline
+platforms and will die out eventually.
+
+@findex _GL_INLINE
+@code{_GL_INLINE} is a portable alternative to C99 plain @code{inline}.
+
+@findex _GL_EXTERN_INLINE
+@code{_GL_EXTERN_INLINE} is a portable alternative to C99 @code{extern inline}.
+
+@findex _GL_INLINE_HEADER_BEGIN
+Invoke @code{_GL_INLINE_HEADER_BEGIN} before all uses of
+@code{_GL_INLINE} in an include file.  If an include file includes
+other files, it is better to invoke this macro after including the
+other files.
+
+@findex _GL_INLINE_HEADER_END
+Invoke @code{_GL_INLINE_HEADER_END} after all uses of
+@code{_GL_INLINE} in an include file.
index 52b8abb..cc3ca0d 100644 (file)
@@ -10,6 +10,10 @@ Portability problems fixed by Gnulib:
 This function is missing on many non-glibc platforms:
 Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11,
 IRIX 6.5, OSF/1 5.1, Solaris 11 2011-11, Cygwin 1.7.1, mingw, MSVC 9, Interix 3.5, BeOS.
+
+@item
+This function can crash on some platforms:
+Cygwin 1.7.25.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index d342b2f..c28a546 100644 (file)
@@ -9,6 +9,11 @@ Portability problems fixed by Gnulib:
 @item
 This function is missing on some platforms:
 mingw, MSVC 9.
+
+@item
+This function does not represent the true @code{RLIMIT_NOFILE} soft
+limit on some platforms:
+Cygwin 1.7.25.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index ecbd59b..761936e 100644 (file)
@@ -1,14 +1,13 @@
 @c This table of OID's is included in the GNU Coding Standards.
 @c
-@c Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
+@c Copyright 2008, 2009, 2010, 2013 Free Software Foundation, Inc.
 @c
 @c Copying and distribution of this file, with or without modification,
 @c are permitted in any medium without royalty provided the copyright
 @c notice and this notice are preserved.
 @c
 @c When adding new OIDs, please add them also to
-@c http://www.alvestrand.no/objectid/  (except it gets an internal
-@c server error, so never mind)
+@c   http://www.alvestrand.no/objectid/
 @c (Our page is http://www.alvestrand.no/objectid/1.3.6.1.4.1.11591.html.)
 
 1.3.6.1.4.1.11591 GNU
 @c Added 2010-07-02 on request from Sergey Poznyakoff <gray@gnu.org.ua>
 1.3.6.1.4.1.11591.8 GNU Dico
 
+@c Added 2013-12-17 on request from Sergey Poznyakoff <gray@gnu.org.ua>
+1.3.6.1.4.1.11591.9 GNU Rush
+
 1.3.6.1.4.1.11591.12 digestAlgorithm
   1.3.6.1.4.1.11591.12.2 TIGER/192
-  1.3.6.1.4.1.11591.13 encryptionAlgorithm
-    1.3.6.1.4.1.11591.13.2 Serpent
-      1.3.6.1.4.1.11591.13.2.1 Serpent-128-ECB
-      1.3.6.1.4.1.11591.13.2.2 Serpent-128-CBC
-      1.3.6.1.4.1.11591.13.2.3 Serpent-128-OFB
-      1.3.6.1.4.1.11591.13.2.4 Serpent-128-CFB
-      1.3.6.1.4.1.11591.13.2.21 Serpent-192-ECB
-      1.3.6.1.4.1.11591.13.2.22 Serpent-192-CBC
-      1.3.6.1.4.1.11591.13.2.23 Serpent-192-OFB
-      1.3.6.1.4.1.11591.13.2.24 Serpent-192-CFB
-      1.3.6.1.4.1.11591.13.2.41 Serpent-256-ECB
-      1.3.6.1.4.1.11591.13.2.42 Serpent-256-CBC
-      1.3.6.1.4.1.11591.13.2.43 Serpent-256-OFB
-      1.3.6.1.4.1.11591.13.2.44 Serpent-256-CFB
-  1.3.6.1.4.1.11591.14 CRC algorithms
-    1.3.6.1.4.1.11591.14.1 CRC 32
+
+1.3.6.1.4.1.11591.13 encryptionAlgorithm
+  1.3.6.1.4.1.11591.13.2 Serpent
+    1.3.6.1.4.1.11591.13.2.1 Serpent-128-ECB
+    1.3.6.1.4.1.11591.13.2.2 Serpent-128-CBC
+    1.3.6.1.4.1.11591.13.2.3 Serpent-128-OFB
+    1.3.6.1.4.1.11591.13.2.4 Serpent-128-CFB
+    1.3.6.1.4.1.11591.13.2.21 Serpent-192-ECB
+    1.3.6.1.4.1.11591.13.2.22 Serpent-192-CBC
+    1.3.6.1.4.1.11591.13.2.23 Serpent-192-OFB
+    1.3.6.1.4.1.11591.13.2.24 Serpent-192-CFB
+    1.3.6.1.4.1.11591.13.2.41 Serpent-256-ECB
+    1.3.6.1.4.1.11591.13.2.42 Serpent-256-CBC
+    1.3.6.1.4.1.11591.13.2.43 Serpent-256-OFB
+    1.3.6.1.4.1.11591.13.2.44 Serpent-256-CFB
+
+1.3.6.1.4.1.11591.14 CRC algorithms
+  1.3.6.1.4.1.11591.14.1 CRC 32
+
+@c Added 2013-12-05 on request from Werner Koch <wk@gnupg.org>
+1.3.6.1.4.1.11591.15 ellipticCurve
+  1.3.6.1.4.1.11591.15.1 Ed25519
index de39a44..1ff7720 100644 (file)
@@ -6679,6 +6679,7 @@ This list of functions is sorted according to the header that declares them.
 * Safe Allocation Macros::
 * Compile-time Assertions::
 * Integer Properties::
+* extern inline::
 * String Functions in C Locale::
 * Quoting::
 * error and progname::
@@ -6712,6 +6713,8 @@ This list of functions is sorted according to the header that declares them.
 
 @include intprops.texi
 
+@include extern-inline.texi
+
 @node String Functions in C Locale
 @section Character and String Functions in C Locale
 
index cabcef5..b58c9ed 100644 (file)
@@ -18,7 +18,8 @@ warranty of any kind.
 @node Basic Installation
 @section Basic Installation
 
-Briefly, the shell commands @samp{./configure; make; make install}
+Briefly, the shell command
+@samp{./configure@tie{}&& make@tie{}&& make@tie{}install}
 should configure, build, and install this package.  The following
 more-detailed instructions are generic; see the @file{README} file for
 instructions specific to this package.
index 6f2599d..ba62a53 100644 (file)
@@ -5,7 +5,7 @@
 @c For double-sided printing, uncomment:
 @c @setchapternewpage odd
 @c This date is automagically updated when you save this file:
-@set lastupdate July 19, 2013
+@set lastupdate October 9, 2013
 @c %**end of header
 
 @dircategory GNU organization
@@ -147,11 +147,11 @@ committee members.  Additional information is in
 
 @cindex down, when GNU machines are
 @cindex outage, of GNU machines
-@cindex @url{http://identi.ca/group/fsfstatus}
+@cindex @url{https://pumprock.net/fsfstatus}
 If you find that any GNU computer systems (@code{fencepost.gnu.org},
 @code{ftp.gnu.org}, @code{www.gnu.org}, @code{savannah.gnu.org},
 @dots{}) seem to be down, you can check the current status at
-@url{http://identi.ca/group/fsfstatus}.  Most likely the problem, if
+@url{http://pumprock.net/fsfstatus}.  Most likely the problem, if
 it can be alleviated at the FSF end, is already being worked on.
 
 @cindex sysadmin, FSF
@@ -292,13 +292,19 @@ as you maintain the program, to avoid legal difficulties.
 @cindex assignments, copyright
 @cindex disclaimers
 
-If you maintain an FSF-copyrighted package
-certain legal procedures are required when incorporating legally significant
-changes written by other people.  This ensures that the FSF has the
-legal right to distribute the package, and the standing to defend its
-GPL-covered status in court if necessary.
+If you maintain an FSF-copyrighted package, certain legal procedures
+are required when incorporating legally significant changes written by
+other people.  This ensures that the FSF has the legal right to
+distribute the package, and the standing to defend its GPL-covered
+status in court if necessary.
 
-@strong{Before} incorporating significant changes, make sure that the
+GNU packages need not be FSF-copyrighted; this is up to the author(s),
+generally at the time the package is dubbed GNU.  When copyright is
+assigned to the FSF, the FSF can act to stop GPL violations about the
+package.  Otherwise, legal actions are up to the author(s).  The rest
+of this section is about the case when a package is FSF-copyrighted.
+
+@emph{Before} incorporating significant changes, make sure that the
 person who wrote the changes has signed copyright papers and that the
 Free Software Foundation has received and signed them.  We may also
 need an employer's disclaimer from the person's employer, which
@@ -385,16 +391,19 @@ When the contributor emails the form to the FSF, the FSF sends per an
 electronic (usually PDF) copy of the assignment.  This, or whatever
 response is required, should happen within five business days of the
 initial request.  If no reply from the FSF comes after that time,
-please send a reminder.  If you still get no response after an
+please send a reminder.  If there is still no response after an
 additional week, please write to @email{maintainers@@gnu.org} about it.
 
-After receiving the necessary form, all contributors then print it and
-sign it.  Contributors located in the USA or Germany can then email or
-fax a scanned copy back to the FSF (or use postal mail, if they
-prefer).  Contributors residing outside the USA or Germany must mail
-the signed form to the FSF via postal mail.  To emphasize, the
-necessary distinction is between residents and non-residents of these
-countries; citizenship does not matter.
+After receiving the necessary form, the contributor needs to sign it.
+Contributors residing in the USA may use GPG in order to sign their
+assignment.  Contributors located in the USA or Germany can print,
+sign, and then email (or fax) a scanned copy back to the FSF.
+(Specific instructions for both cases are sent with the assignment
+form.)  They may use postal mail, if they prefer. Contributors
+residing outside the USA or Germany must mail the signed form to the
+FSF via postal mail.  To emphasize, the necessary distinction is
+between residents and non-residents of these countries; citizenship
+does not matter.
 
 For less common cases, we have template files you should send to the
 contributor.  Be sure to fill in the name of the person and the name
@@ -1566,6 +1575,10 @@ corresponding packages.
 The upload system will email receipts to the given email addresses
 when an upload is made, either successfully or unsuccessfully.
 
+Should you later have to update your GPG key, you'll have to re-submit
+it to both Savannah and @email{ftp-upload@@gnu.org}, as these systems
+are not connected.
+
 
 @node Automated Upload Procedure
 @subsection Automated Upload Procedure
@@ -1702,8 +1715,9 @@ is optional, and ignored if present:@*
 @t{comment: let's hope this works!}
 @end table
 
-Putting the above together, the complete contents of the directive
-file @file{foo-1.0.tar.gz.directive} for our example would be:
+Putting all of the above together, the complete contents of the
+directive file @file{foo-1.0.tar.gz.directive} for our example would
+be:
 
 @example
 version: 1.2
index 372c680..db01628 100644 (file)
@@ -8,7 +8,7 @@
 @cindex standards for makefiles
 
 @c Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
-@c 2004, 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
+@c 2004, 2005, 2006, 2007, 2008, 2010, 2013 Free Software Foundation, Inc.
 @c
 @c Permission is granted to copy, distribute and/or modify this document
 @c under the terms of the GNU Free Documentation License, Version 1.3
@@ -518,6 +518,19 @@ in @file{$(datadir)} or @file{$(sysconfdir)}.  @file{$(localstatedir)}
 should normally be @file{/usr/local/var}, but write it as
 @file{$(prefix)/var}.
 (If you are using Autoconf, write it as @samp{@@localstatedir@@}.)
+
+@item runstatedir
+The directory for installing data files which the programs modify
+while they run, that pertain to one specific machine, and which need
+not persist longer than the execution of the program---which is
+generally long-lived, for example, until the next reboot.  PID files
+for system daemons are a typical use.  In addition, this directory
+should not be cleaned except perhaps at reboot, while the general
+@file{/tmp} (@code{TMPDIR}) may be cleaned arbitrarily.  This should
+normally be @file{/var/run}, but write it as
+@file{$(localstatedir)/run}.  Having it as a separate variable allows
+the use of @file{/run} if desired, for example.  (If you are using
+Autoconf 2.70 or later, write it as @samp{@@runstatedir@@}.)
 @end table
 
 These variables specify the directory for installing certain specific
index 14e5236..cab793f 100644 (file)
@@ -21,6 +21,10 @@ This function crashes when invoked with invalid arguments on some platforms:
 Cygwin 1.7.17, MSVC 9.
 
 @item
+This function crashes when invoked with valid arguments on some platforms:
+Cygwin 1.7.25.
+
+@item
 This function resets the @code{FD_CLOEXEC} flag when duplicating an fd
 to itself on some platforms:
 Haiku.
index a19844f..9de1446 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/isalnum.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index dcff8e8..db06de7 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/isalpha.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 72312ea..d891757 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/isascii.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 7323400..25dc099 100644 (file)
@@ -11,6 +11,10 @@ Portability problems fixed by Gnulib:
 @item
 This function is missing on some platforms:
 AIX 4.3.2, IRIX 6.5, OSF/1 5.1, Solaris 9, mingw, MSVC 9.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index db6ead5..7e6813f 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iscntrl.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index dab1b62..4b27a83 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/isdigit.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 375c883..52f219d 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/isgraph.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index dec6ded..2c57fa3 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/islower.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 3483e4b..54227da 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/isprint.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index f4eeb32..0a85c9b 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/ispunct.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index e06fda6..f70fef0 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/isspace.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 6f22d5d..802d3f2 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/isupper.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index b30dabc..80b3aae 100644 (file)
@@ -14,6 +14,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 @item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index d782165..f23fe7b 100644 (file)
@@ -14,6 +14,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 @item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 6c65b8d..99eaa0e 100644 (file)
@@ -14,6 +14,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 @item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 361682d..f61fd17 100644 (file)
@@ -15,6 +15,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 This function is declared in @code{<wchar.h>}, not in @code{<wctype.h>}, on
 some platforms:
 HP-UX 11.00.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index e020938..3d3144d 100644 (file)
@@ -14,6 +14,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 @item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 47574e2..b6d9cb7 100644 (file)
@@ -14,6 +14,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 @item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 90d7516..541c11e 100644 (file)
@@ -14,6 +14,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 @item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 1fb58ff..cdbf86b 100644 (file)
@@ -14,6 +14,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 @item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 1de2894..5199102 100644 (file)
@@ -14,6 +14,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 @item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 69bb258..ebfbed4 100644 (file)
@@ -14,6 +14,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 @item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index ab112dd..ff02102 100644 (file)
@@ -14,6 +14,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 @item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 00a7b6a..759fc7d 100644 (file)
@@ -14,6 +14,10 @@ Minix 3.1.8, IRIX 5.3, Solaris 2.5.1.
 @item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 485a048..7d759fc 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/isxdigit.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 5348d9a..7616fdb 100644 (file)
@@ -10,6 +10,10 @@ Portability problems fixed by Gnulib:
 @itemize
 @item
 This function is missing on some older platforms.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 8b11234..5d32e14 100644 (file)
@@ -10,6 +10,10 @@ Portability problems fixed by Gnulib:
 @itemize
 @item
 This function is missing on some older platforms.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 38f1eee..4a2f867 100644 (file)
@@ -10,6 +10,10 @@ Portability problems fixed by Gnulib:
 @itemize
 @item
 This function is missing on some older platforms.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 53a17bc..6fc49f7 100644 (file)
@@ -19,4 +19,8 @@ mingw, MSVC 9.
 
 Portability problems not fixed by Gnulib:
 @itemize
+@item
+If the argument exists and is a directory, this function fails with
+@code{EISDIR} instead of the correct @code{EEXIST}:
+HP-UX 11.11.
 @end itemize
index fbe6c04..6476175 100644 (file)
@@ -20,6 +20,9 @@ Portability problems not fixed by Gnulib:
 @itemize
 @item
 The gnulib replacement function always fails with @samp{ENOSYS} on
-some platforms:
-mingw, MSVC 9.
+some platforms: mingw, MSVC 9.
+@item
+If the argument exists and is a directory, the gnulib replacement
+function fails with @code{EISDIR} instead of the correct
+@code{EEXIST}: HP-UX 11.11.
 @end itemize
index e7dd13c..6618694 100644 (file)
@@ -26,4 +26,8 @@ Portability problems not fixed by Gnulib:
 Use of this function for anything except fifos is not portable,
 generally requiring super-user privileges and knowledge of supported
 device numbers.
+@item
+If the argument exists and is a directory, this function fails with
+@code{EISDIR} instead of the correct @code{EEXIST}:
+HP-UX 11.11.
 @end itemize
index 8db9313..10175d0 100644 (file)
@@ -22,4 +22,8 @@ Portability problems not fixed by Gnulib:
 The gnulib replacement function always fails with @samp{ENOSYS} on
 some platforms:
 mingw, MSVC 9.
+@item
+If the argument exists and is a directory, the gnulib replacement
+function fails with @code{EISDIR} instead of the correct
+@code{EEXIST}: HP-UX 11.11.
 @end itemize
index 663bfdf..68f9d2c 100644 (file)
@@ -8,6 +8,10 @@ Gnulib module: ---
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index f0fe807..d307fe5 100644 (file)
@@ -8,6 +8,10 @@ Gnulib module: ---
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline
+functions on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 5b1a7aa..8333af0 100644 (file)
@@ -11,6 +11,10 @@ Portability problems fixed by Gnulib:
 @item
 This function is missing on some platforms:
 mingw, MSVC 9.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index b6938a5..a17a813 100644 (file)
@@ -11,6 +11,10 @@ Portability problems fixed by Gnulib:
 @item
 This function is missing on some platforms:
 mingw, MSVC 9.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 17a2d8e..7b4f2f3 100644 (file)
@@ -11,6 +11,10 @@ Portability problems fixed by Gnulib:
 @item
 This function is missing on some platforms:
 mingw, MSVC 9.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index e1fa6b8..9c20f12 100644 (file)
@@ -11,6 +11,10 @@ Portability problems fixed by Gnulib:
 @item
 This function is missing on some platforms:
 mingw, MSVC 9.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 2f995fc..4226dad 100644 (file)
@@ -11,6 +11,10 @@ Portability problems fixed by Gnulib:
 @item
 This function is missing on some platforms:
 mingw, MSVC 9.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index def3f03..dcd07c0 100644 (file)
@@ -12,6 +12,10 @@ Portability problems fixed by Gnulib:
 This function is missing on some platforms:
 NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 4.3.2, HP-UX 11, IRIX 6.5, OSF/1 5.1,
 Solaris 10, Cygwin 1.5.x, mingw, MSVC 9, Interix 3.5.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index ce3842a..82509db 100644 (file)
@@ -15,6 +15,10 @@ HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, MSVC 9, Interix
 @item
 This function has an incompatible return value on some platforms:
 AIX 5.1.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 4aba7fb..222460b 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/strcat.html}
 
-Gnulib module: ---
+Gnulib module: string
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index e46163b..3289362 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/strcpy.html}
 
-Gnulib module: ---
+Gnulib module: string
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index f64620d..9d09e05 100644 (file)
@@ -11,6 +11,10 @@ Portability problems fixed by Gnulib:
 @item
 This function dereferences too much memory on some platforms:
 Solaris 10 on SPARC.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index cbcf733..3cc6b45 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/strncpy.html}
 
-Gnulib module: ---
+Gnulib module: string
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 465e2cf..30358bd 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/toascii.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 585b57a..719a2cc 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/tolower.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 9292b75..e73f690 100644 (file)
@@ -4,10 +4,14 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/toupper.html}
 
-Gnulib module: ---
+Gnulib module: ctype
 
 Portability problems fixed by Gnulib:
 @itemize
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index a2282d1..740b9a3 100644 (file)
@@ -15,6 +15,10 @@ IRIX 5.3, Solaris 2.5.1.
 This function returns values of which the upper 16 bits are incorrect
 on some platforms:
 mingw.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 5bb4a15..6021105 100644 (file)
@@ -15,6 +15,10 @@ IRIX 5.3, Solaris 2.5.1.
 This function returns values of which the upper 16 bits are incorrect
 on some platforms:
 mingw.
+@item
+This function cannot be called from plain inline or extern inline functions
+on some platforms:
+OS X 10.8.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 58160cf..8780b84 100644 (file)
@@ -8,7 +8,7 @@ and have it work correctly (including i18n).  So many users need to go
 through @code{configure; make; make install} with all its
 dependencies, options, and hurdles.
 
-Red Hat, Debian, and similar package systems solve the ``ease of
+Red Hat, Debian, and other binary distributions solve the ``ease of
 installation'' problem, but they hardwire path names, usually to
 @file{/usr} or @file{/usr/local}.  This means that users need root
 privileges to install a binary package, and prevents installing two
index b18f4be..c86ad42 100644 (file)
@@ -3,7 +3,7 @@
 @setfilename standards.info
 @settitle GNU Coding Standards
 @c This date is automagically updated when you save this file:
-@set lastupdate July 20, 2013
+@set lastupdate December 17, 2013
 @c %**end of header
 
 @dircategory GNU organization
@@ -295,9 +295,13 @@ speed, the best language to use is C.  C++ is ok too, but please don't
 make heavy use of templates.  So is Java, if you compile it.
 
 When highest efficiency is not required, other languages commonly used
-in the free software community, such as Python and Ruby, are ok too.
-We encourage use of Lisp and Scheme as well.  Please implement the GNU
-configure and make interface no matter which language you use.
+in the free software community, such as Scheme, Python, Ruby, and
+Java, are OK too.  Scheme, as implemented by GNU@tie{}Guile, plays a
+particular role in the GNU System: it is the preferred language to
+extend programs written in C/C++, and also a fine language for a wide
+range of applications.  The more GNU components use Guile and Scheme,
+the more users are able to extend and combine them (@pxref{The Emacs
+Thesis,,, guile, GNU Guile Reference Manual}).
 
 Many programs are designed to be extensible: they include an interpreter
 for a language that is higher level than C.  Often much of the program
@@ -2285,8 +2289,8 @@ Print the version number.
 @cindex X.509
 
 The OID (object identifier) 1.3.6.1.4.1.11591 has been assigned to the
-GNU Project (thanks to Werner Koch).  These are used for SNMP, LDAP,
-X.509 certificates, and so on.  The web site
+GNU Project (thanks to Sergey Poznyakoff).  These are used for SNMP,
+LDAP, X.509 certificates, and so on.  The web site
 @url{http://www.alvestrand.no/objectid} has a (voluntary) listing of
 many OID assignments.
 
@@ -2368,6 +2372,11 @@ when writing GNU software.
 @section Formatting Your Source Code
 @cindex formatting source code
 
+@cindex line length
+@cindex length of source lines
+Please keep the length of source lines to 79 characters or less, for
+maximum readability in the widest range of environments.
+
 @cindex open brace
 @cindex braces, in C source
 @cindex function definitions, formatting
@@ -3236,8 +3245,9 @@ the option @option{--quoting-style} of GNU @code{ls}.
 @section Mmap
 @findex mmap
 
-Don't assume that @code{mmap} either works on all files or fails
-for all files.  It may work on some files and fail on others.
+If you use @code{mmap} to read or write files, don't assume it either
+works on all files or fails for all files.  It may work on some files
+and fail on others.
 
 The proper way to use @code{mmap} is to try it on the specific file for
 which you want to use it---and if @code{mmap} doesn't work, fall back on
@@ -3903,7 +3913,8 @@ corresponding to most of the standard directory variables
 
 @example
 --prefix --exec-prefix --bindir --sbindir --libexecdir --sysconfdir
---sharedstatedir --localstatedir --libdir --includedir --oldincludedir
+--sharedstatedir --localstatedir --runstatedir
+--libdir --includedir --oldincludedir
 --datarootdir --datadir --infodir --localedir --mandir --docdir
 --htmldir --dvidir --pdfdir --psdir
 @end example
index df721d9..bd38c07 100644 (file)
 @findex verify
 @findex verify_expr
 
-The @samp{verify} module supports compile-time tests, as opposed to
-the standard @code{assert} macro which supports only runtime tests.
-Since the tests occur at compile-time, they are more reliable, and
-they require no runtime overhead.
+This module provides a header file @file{verify.h} that defines
+macros related to compile-time verification.
 
-This module provides a header file @file{verify.h} that defines two
-macros: @code{verify (@var{V})} and @code{verify_expr
+Two of these macros are @code{verify (@var{V})} and @code{verify_expr
 (@var{V}, @var{EXPR})}.  Both accept an integer constant expression
 argument @var{V} and verify that it is nonzero.  If not, a compile-time error
 results.
 
+These two macros implement compile-time tests, as opposed to
+the standard @code{assert} macro which supports only runtime tests.
+Since the tests occur at compile-time, they are more reliable, and
+they require no runtime overhead.
+
 @code{verify (@var{V});} is a declaration; it can occur outside of
 functions.  In contrast, @code{verify_expr (@var{V}, @var{EXPR})} is
 an expression that returns the value of @var{EXPR}; it can be used in
@@ -60,7 +62,20 @@ within a @code{struct} or @code{union} specifier, in place of an
 ordinary member declaration.  Second, they require the programmer to
 specify a compile-time diagnostic as a string literal.
 
-Here are some example uses of @code{verify} and @code{verify_expr}.
+The @file{verify.h} header defines one more macro, @code{assume
+(@var{E})}, which expands to an expression of type @code{void}
+that causes the compiler to assume that @var{E} yields a nonzero
+value.  @var{E} should be a scalar expression, and should not
+have side effects; it may or may not be evaluated.  The behavior is
+undefined if @var{E} would yield zero.  The main use of @code{assume}
+is optimization, as the compiler may be able to generate better code
+if it assumes @var{E}.  For best results, @var{E} should be simple
+enough that a compiler can determine that it has no side effects: if
+@var{E} calls an external function or accesses volatile storage the
+compiler may not be able to optimize @var{E} away and @code{assume
+(@var{E})} may therefore slow down the program.
+
+Here are some example uses of these macros.
 
 @example
 #include <verify.h>
@@ -87,4 +102,18 @@ verify (~ (time_t) -1 == 0);
    even when T is narrower than unsigned int.  */
 #define MAX_UNSIGNED_VAL(t) \
    ((T) verify_expr (0 < (T) -1, -1))
+
+/* Return T divided by CHAR_MAX + 1, where behavior is
+   undefined if T < 0.  In the common case where CHAR_MAX
+   is 127 the compiler can therefore implement the division
+   by shifting T right 7 bits, an optimization that would
+   not be valid if T were negative.  */
+time_t
+time_index (time_t t)
+@{
+  assume (0 <= t);
+  return t / (CHAR_MAX + 1);
+@}
+
+
 @end example
index 84be8a7..cf22e54 100755 (executable)
@@ -899,6 +899,9 @@ if test "X$1" = "X--no-reexec"; then
   shift
 fi
 
+# Unset CDPATH.  Otherwise, output from 'cd dir' can surprise callers.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
 # Command-line option processing.
 # Removes the OPTIONS from the arguments. Sets the variables:
 # - mode            one of: list, find, import, add-import, remove-import,
index 4dcb542..906f251 100644 (file)
@@ -119,9 +119,9 @@ accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags)
 
 #if O_BINARY
   if (flags & O_BINARY)
-    setmode (fd, O_BINARY);
+    set_binary_mode (fd, O_BINARY);
   else if (flags & O_TEXT)
-    setmode (fd, O_TEXT);
+    set_binary_mode (fd, O_TEXT);
 #endif
 
   return fd;
index 7e6d77a..55c224c 100644 (file)
@@ -60,6 +60,9 @@ extern int aclsort (int, int, struct acl *);
 # define fchmod(fd, mode) (-1)
 #endif
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef ACL_INTERNAL_INLINE
 # define ACL_INTERNAL_INLINE _GL_INLINE
index 000090e..0222d1d 100644 (file)
@@ -197,6 +197,9 @@ extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
 #define __argp_fmtstream_point argp_fmtstream_point
 #define __argp_fmtstream_update _argp_fmtstream_update
 #define __argp_fmtstream_ensure _argp_fmtstream_ensure
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef ARGP_FS_EI
 # define ARGP_FS_EI _GL_INLINE
index c4094a4..a5f686a 100644 (file)
@@ -579,6 +579,9 @@ extern void *__argp_input (const struct argp *__restrict __argp,
 #  define __argp_state_help argp_state_help
 #  define __option_is_short _option_is_short
 #  define __option_is_end _option_is_end
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #  ifndef ARGP_EI
 #   define ARGP_EI _GL_INLINE
index 105f419..b8a52fd 100644 (file)
@@ -59,6 +59,27 @@ to_uchar (char ch)
   return ch;
 }
 
+static const char b64c[64] =
+  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+/* Base64 encode IN array of size INLEN into OUT array. OUT needs
+   to be of length >= BASE64_LENGTH(INLEN), and INLEN needs to be
+   a multiple of 3.  */
+static void
+base64_encode_fast (const char *restrict in, size_t inlen, char *restrict out)
+{
+  while (inlen)
+    {
+      *out++ = b64c[to_uchar (in[0]) >> 2];
+      *out++ = b64c[((to_uchar (in[0]) << 4) + (to_uchar (in[1]) >> 4)) & 0x3f];
+      *out++ = b64c[((to_uchar (in[1]) << 2) + (to_uchar (in[2]) >> 6)) & 0x3f];
+      *out++ = b64c[to_uchar (in[2]) & 0x3f];
+
+      inlen -= 3;
+      in += 3;
+    }
+}
+
 /* Base64 encode IN array of size INLEN into OUT array of size OUTLEN.
    If OUTLEN is less than BASE64_LENGTH(INLEN), write as many bytes as
    possible.  If OUTLEN is larger than BASE64_LENGTH(INLEN), also zero
@@ -67,28 +88,38 @@ void
 base64_encode (const char *restrict in, size_t inlen,
                char *restrict out, size_t outlen)
 {
-  static const char b64str[64] =
-    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+  /* Note this outlen constraint can be enforced at compile time.
+     I.E. that the output buffer is exactly large enough to hold
+     the encoded inlen bytes.  The inlen constraints (of corresponding
+     to outlen, and being a multiple of 3) can change at runtime
+     at the end of input.  However the common case when reading
+     large inputs is to have both constraints satisfied, so we depend
+     on both in base_encode_fast().  */
+  if (outlen % 4 == 0 && inlen == outlen / 4 * 3)
+    {
+      base64_encode_fast (in, inlen, out);
+      return;
+    }
 
   while (inlen && outlen)
     {
-      *out++ = b64str[(to_uchar (in[0]) >> 2) & 0x3f];
+      *out++ = b64c[to_uchar (in[0]) >> 2];
       if (!--outlen)
         break;
-      *out++ = b64str[((to_uchar (in[0]) << 4)
+      *out++ = b64c[((to_uchar (in[0]) << 4)
                        + (--inlen ? to_uchar (in[1]) >> 4 : 0))
                       & 0x3f];
       if (!--outlen)
         break;
       *out++ =
         (inlen
-         ? b64str[((to_uchar (in[1]) << 2)
+         ? b64c[((to_uchar (in[1]) << 2)
                    + (--inlen ? to_uchar (in[2]) >> 6 : 0))
                   & 0x3f]
          : '=');
       if (!--outlen)
         break;
-      *out++ = inlen ? b64str[to_uchar (in[2]) & 0x3f] : '=';
+      *out++ = inlen ? b64c[to_uchar (in[2]) & 0x3f] : '=';
       if (!--outlen)
         break;
       if (inlen)
index 317fe3d..423c2ae 100644 (file)
@@ -25,6 +25,9 @@
    so we include it here first.  */
 #include <stdio.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef BINARY_IO_INLINE
 # define BINARY_IO_INLINE _GL_INLINE
index 9e10a45..be2e407 100644 (file)
@@ -23,6 +23,9 @@
 #include <stdint.h>
 #include <sys/types.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef BITROTATE_INLINE
 # define BITROTATE_INLINE _GL_INLINE
index 470a443..0a04fc8 100644 (file)
 /* Written by Eric Blake.  */
 
 #ifndef COUNT_LEADING_ZEROS_H
-# define COUNT_LEADING_ZEROS_H 1
+#define COUNT_LEADING_ZEROS_H 1
 
 #include <limits.h>
 #include <stdlib.h>
-#include "verify.h"
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef COUNT_LEADING_ZEROS_INLINE
 # define COUNT_LEADING_ZEROS_INLINE _GL_INLINE
 #endif
 
-/* Expand the code which computes the number of leading zeros of the local
-   variable 'x' of type TYPE (an unsigned integer type) and returns it
+/* Assuming the GCC builtin is BUILTIN and the MSC builtin is MSC_BUILTIN,
+   expand to code that computes the number of leading zeros of the local
+   variable 'x' of type TYPE (an unsigned integer type) and return it
    from the current function.  */
 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# define COUNT_LEADING_ZEROS(BUILTIN, TYPE)     \
+# define COUNT_LEADING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE)                \
   return x ? BUILTIN (x) : CHAR_BIT * sizeof x;
+#elif _MSC_VER
+# pragma intrinsic _BitReverse
+# pragma intrinsic _BitReverse64
+# define COUNT_LEADING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE)                \
+    do                                                                  \
+      {                                                                 \
+        unsigned long result;                                           \
+        return MSC_BUILTIN (&result, x) ? result : CHAR_BIT * sizeof x; \
+      }                                                                 \
+    while (0)
 #else
-# define COUNT_LEADING_ZEROS(BUILTIN, TYPE)                             \
-  /* This condition is written so as to avoid shifting by more than     \
-     31 bits at once, and also avoids a random HP-UX cc bug.  */        \
-  verify (((TYPE) -1 >> 31 >> 31 >> 2) == 0); /* TYPE has at most 64 bits */ \
-  int count = 0;                                                        \
-  if (1 < (TYPE) -1 >> 31) { /* TYPE has more than 32 bits? */          \
-    count = count_leading_zeros_32 (x >> 31 >> 1);                      \
-    if (count < 32)                                                     \
-      return count;                                                     \
-  }                                                                     \
-  return count + count_leading_zeros_32 (x);
+# define COUNT_LEADING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE)                \
+    do                                                                  \
+      {                                                                 \
+        int count;                                                      \
+        unsigned int leading_32;                                        \
+        if (! x)                                                        \
+          return CHAR_BIT * sizeof x;                                   \
+        for (count = 0;                                                 \
+             (leading_32 = ((x >> (sizeof (TYPE) * CHAR_BIT - 32))      \
+                            & 0xffffffffU),                             \
+              count < CHAR_BIT * sizeof x - 32 && !leading_32);         \
+             count += 32)                                               \
+          x = x << 31 << 1;                                             \
+        return count + count_leading_zeros_32 (leading_32);             \
+      }                                                                 \
+    while (0)
 
-/* Compute and return the number of leading zeros in the least
-   significant 32 bits of X. */
+/* Compute and return the number of leading zeros in X,
+   where 0 < X < 2**32.  */
 COUNT_LEADING_ZEROS_INLINE int
 count_leading_zeros_32 (unsigned int x)
 {
   /* http://graphics.stanford.edu/~seander/bithacks.html */
-  static const char deBruijnLookup[32] = {
-    0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30,
-    8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31
+  static const char de_Bruijn_lookup[32] = {
+    31, 22, 30, 21, 18, 10, 29, 2, 20, 17, 15, 13, 9, 6, 28, 1,
+    23, 19, 11, 3, 16, 14, 7, 24, 12, 4, 8, 25, 5, 26, 27, 0
   };
 
-  x &= 0xffffffffU;
-  if (!x)
-    return 32;
   x |= x >> 1;
   x |= x >> 2;
   x |= x >> 4;
   x |= x >> 8;
   x |= x >> 16;
-  return 31 - deBruijnLookup[(x * 0x07c4acddU) >> 27];
+  return de_Bruijn_lookup[((x * 0x07c4acddU) & 0xffffffffU) >> 27];
 }
 #endif
 
@@ -74,14 +89,14 @@ count_leading_zeros_32 (unsigned int x)
 COUNT_LEADING_ZEROS_INLINE int
 count_leading_zeros (unsigned int x)
 {
-  COUNT_LEADING_ZEROS (__builtin_clz, unsigned int);
+  COUNT_LEADING_ZEROS (__builtin_clz, _BitScanReverse, unsigned int);
 }
 
 /* Compute and return the number of leading zeros in X. */
 COUNT_LEADING_ZEROS_INLINE int
 count_leading_zeros_l (unsigned long int x)
 {
-  COUNT_LEADING_ZEROS (__builtin_clzl, unsigned long int);
+  COUNT_LEADING_ZEROS (__builtin_clzl, _BitScanReverse, unsigned long int);
 }
 
 #if HAVE_UNSIGNED_LONG_LONG_INT
@@ -89,7 +104,8 @@ count_leading_zeros_l (unsigned long int x)
 COUNT_LEADING_ZEROS_INLINE int
 count_leading_zeros_ll (unsigned long long int x)
 {
-  COUNT_LEADING_ZEROS (__builtin_clzll, unsigned long long int);
+  COUNT_LEADING_ZEROS (__builtin_clzll, _BitScanReverse64,
+                       unsigned long long int);
 }
 #endif
 
index b15aec4..66341d7 100644 (file)
@@ -1,3 +1,7 @@
 #include <config.h>
 #define COUNT_ONE_BITS_INLINE _GL_EXTERN_INLINE
 #include "count-one-bits.h"
+
+#if 1500 <= _MSC_VER && (defined _M_IX86 || defined _M_X64)
+int popcount_support = -1;
+#endif
index 3cb9eca..2a7e93c 100644 (file)
 /* Written by Ben Pfaff.  */
 
 #ifndef COUNT_ONE_BITS_H
-# define COUNT_ONE_BITS_H 1
+#define COUNT_ONE_BITS_H 1
 
+#include <limits.h>
 #include <stdlib.h>
-#include "verify.h"
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef COUNT_ONE_BITS_INLINE
 # define COUNT_ONE_BITS_INLINE _GL_INLINE
 #endif
 
-/* Expand the code which computes the number of 1-bits of the local
-   variable 'x' of type TYPE (an unsigned integer type) and returns it
+/* Expand to code that computes the number of 1-bits of the local
+   variable 'x' of type TYPE (an unsigned integer type) and return it
+   from the current function.  */
+#define COUNT_ONE_BITS_GENERIC(TYPE)                                   \
+    do                                                                  \
+      {                                                                 \
+        int count = 0;                                                  \
+        int bits;                                                       \
+        for (bits = 0; bits < sizeof (TYPE) * CHAR_BIT; bits += 32)     \
+          {                                                             \
+            count += count_one_bits_32 (x);                             \
+            x = x >> 31 >> 1;                                           \
+          }                                                             \
+        return count;                                                   \
+      }                                                                 \
+    while (0)
+
+/* Assuming the GCC builtin is BUILTIN and the MSC builtin is MSC_BUILTIN,
+   expand to code that computes the number of 1-bits of the local
+   variable 'x' of type TYPE (an unsigned integer type) and return it
    from the current function.  */
 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#define COUNT_ONE_BITS(BUILTIN, TYPE)              \
-        return BUILTIN (x);
+# define COUNT_ONE_BITS(BUILTIN, MSC_BUILTIN, TYPE) return BUILTIN (x)
 #else
-#define COUNT_ONE_BITS(BUILTIN, TYPE)                                       \
-        /* This condition is written so as to avoid shifting by more than   \
-           31 bits at once, and also avoids a random HP-UX cc bug.  */      \
-        verify (((TYPE) -1 >> 31 >> 31 >> 2) == 0); /* TYPE has at most 64 bits */ \
-        int count = count_one_bits_32 (x);                                  \
-        if (1 < (TYPE) -1 >> 31) /* TYPE has more than 32 bits? */          \
-          count += count_one_bits_32 (x >> 31 >> 1);                        \
-        return count;
 
 /* Compute and return the number of 1-bits set in the least
    significant 32 bits of X. */
@@ -54,20 +66,60 @@ count_one_bits_32 (unsigned int x)
   x = ((x & 0xf0f0) >> 4) + (x & 0x0f0f);
   return (x >> 8) + (x & 0x00ff);
 }
+
+# if 1500 <= _MSC_VER && (defined _M_IX86 || defined _M_X64)
+
+/* While gcc falls back to its own generic code if the machine
+   on which it's running doesn't support popcount, with Microsoft's
+   compiler we need to detect and fallback ourselves.  */
+#  pragma intrinsic __cpuid
+#  pragma intrinsic __popcnt
+#  pragma intrinsic __popcnt64
+
+/* Return nonzero if popcount is supported.  */
+
+/* 1 if supported, 0 if not supported, -1 if unknown.  */
+extern int popcount_support;
+
+COUNT_ONE_BITS_INLINE int
+popcount_supported (void)
+{
+  if (popcount_support < 0)
+    {
+      int cpu_info[4];
+      __cpuid (cpu_info, 1);
+      popcount_support = (cpu_info[2] >> 23) & 1;  /* See MSDN.  */
+    }
+  return popcount_support;
+}
+
+#  define COUNT_ONE_BITS(BUILTIN, MSC_BUILTIN, TYPE)    \
+     do                                                 \
+       {                                                \
+         if (popcount_supported ())                     \
+           return MSC_BUILTIN (x);                      \
+         else                                           \
+           COUNT_ONE_BITS_GENERIC (TYPE);               \
+       }                                                \
+     while (0)
+# else
+#  define COUNT_ONE_BITS(BUILTIN, MSC_BUILTIN, TYPE)   \
+     COUNT_ONE_BITS_GENERIC (TYPE)
+# endif
 #endif
 
 /* Compute and return the number of 1-bits set in X. */
 COUNT_ONE_BITS_INLINE int
 count_one_bits (unsigned int x)
 {
-  COUNT_ONE_BITS (__builtin_popcount, unsigned int);
+  COUNT_ONE_BITS (__builtin_popcount, __popcnt, unsigned int);
 }
 
 /* Compute and return the number of 1-bits set in X. */
 COUNT_ONE_BITS_INLINE int
 count_one_bits_l (unsigned long int x)
 {
-  COUNT_ONE_BITS (__builtin_popcountl, unsigned long int);
+  COUNT_ONE_BITS (__builtin_popcountl, __popcnt, unsigned long int);
 }
 
 #if HAVE_UNSIGNED_LONG_LONG_INT
@@ -75,7 +127,7 @@ count_one_bits_l (unsigned long int x)
 COUNT_ONE_BITS_INLINE int
 count_one_bits_ll (unsigned long long int x)
 {
-  COUNT_ONE_BITS (__builtin_popcountll, unsigned long long int);
+  COUNT_ONE_BITS (__builtin_popcountll, __popcnt64, unsigned long long int);
 }
 #endif
 
diff --git a/lib/count-trailing-zeros.c b/lib/count-trailing-zeros.c
new file mode 100644 (file)
index 0000000..f3da886
--- /dev/null
@@ -0,0 +1,3 @@
+#include <config.h>
+#define COUNT_TRAILING_ZEROS_INLINE _GL_EXTERN_INLINE
+#include "count-trailing-zeros.h"
diff --git a/lib/count-trailing-zeros.h b/lib/count-trailing-zeros.h
new file mode 100644 (file)
index 0000000..1dab45d
--- /dev/null
@@ -0,0 +1,106 @@
+/* count-trailing-zeros.h -- counts the number of trailing 0 bits in a word.
+   Copyright 2013 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#ifndef COUNT_TRAILING_ZEROS_H
+#define COUNT_TRAILING_ZEROS_H 1
+
+#include <limits.h>
+#include <stdlib.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef COUNT_TRAILING_ZEROS_INLINE
+# define COUNT_TRAILING_ZEROS_INLINE _GL_INLINE
+#endif
+
+/* Assuming the GCC builtin is BUILTIN and the MSC builtin is MSC_BUILTIN,
+   expand to code that computes the number of trailing zeros of the local
+   variable 'x' of type TYPE (an unsigned integer type) and return it
+   from the current function.  */
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+# define COUNT_TRAILING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE)               \
+  return x ? BUILTIN (x) : CHAR_BIT * sizeof x;
+#elif _MSC_VER
+# pragma intrinsic _BitScanForward
+# pragma intrinsic _BitScanForward64
+# define COUNT_TRAILING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE)               \
+    do                                                                  \
+      {                                                                 \
+        unsigned long result;                                           \
+        return MSC_BUILTIN (&result, x) ? result : CHAR_BIT * sizeof x; \
+      }                                                                 \
+    while (0)
+#else
+# define COUNT_TRAILING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE)               \
+    do                                                                  \
+      {                                                                 \
+        int count = 0;                                                  \
+        if (! x)                                                        \
+          return CHAR_BIT * sizeof x;                                   \
+        for (count = 0;                                                 \
+             (count < CHAR_BIT * sizeof x - 32                          \
+              && ! (x & 0xffffffffU));                                  \
+             count += 32)                                               \
+          x = x >> 31 >> 1;                                             \
+        return count + count_trailing_zeros_32 (x);                     \
+      }                                                                 \
+    while (0)
+
+/* Compute and return the number of trailing zeros in the least
+   significant 32 bits of X.  One of these bits must be nonzero.  */
+COUNT_TRAILING_ZEROS_INLINE int
+count_trailing_zeros_32 (unsigned int x)
+{
+  /* http://graphics.stanford.edu/~seander/bithacks.html */
+  static const char de_Bruijn_lookup[32] = {
+    0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
+    31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
+  };
+  return de_Bruijn_lookup[(((x & -x) * 0x077cb531U) & 0xffffffffU) >> 27];
+}
+#endif
+
+/* Compute and return the number of trailing zeros in X. */
+COUNT_TRAILING_ZEROS_INLINE int
+count_trailing_zeros (unsigned int x)
+{
+  COUNT_TRAILING_ZEROS (__builtin_ctz, _BitScanForward, unsigned int);
+}
+
+/* Compute and return the number of trailing zeros in X. */
+COUNT_TRAILING_ZEROS_INLINE int
+count_trailing_zeros_l (unsigned long int x)
+{
+  COUNT_TRAILING_ZEROS (__builtin_ctzl, _BitScanForward, unsigned long int);
+}
+
+#if HAVE_UNSIGNED_LONG_LONG_INT
+/* Compute and return the number of trailing zeros in X. */
+COUNT_TRAILING_ZEROS_INLINE int
+count_trailing_zeros_ll (unsigned long long int x)
+{
+  COUNT_TRAILING_ZEROS (__builtin_ctzll, _BitScanForward64,
+                        unsigned long long int);
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif
index ecce2e5..064f7d3 100644 (file)
 struct timespec
 dtotimespec (double sec)
 {
-  enum { BILLION = 1000 * 1000 * 1000 };
   double min_representable = TYPE_MINIMUM (time_t);
   double max_representable =
-    ((TYPE_MAXIMUM (time_t) * (double) BILLION + (BILLION - 1))
-     / BILLION);
-  struct timespec r;
+    ((TYPE_MAXIMUM (time_t) * (double) TIMESPEC_RESOLUTION
+      + (TIMESPEC_RESOLUTION - 1))
+     / TIMESPEC_RESOLUTION);
 
   if (! (min_representable < sec))
-    {
-      r.tv_sec = TYPE_MINIMUM (time_t);
-      r.tv_nsec = 0;
-    }
+    return make_timespec (TYPE_MINIMUM (time_t), 0);
   else if (! (sec < max_representable))
-    {
-      r.tv_sec = TYPE_MAXIMUM (time_t);
-      r.tv_nsec = BILLION - 1;
-    }
+    return make_timespec (TYPE_MAXIMUM (time_t), TIMESPEC_RESOLUTION - 1);
   else
     {
       time_t s = sec;
-      double frac = BILLION * (sec - s);
+      double frac = TIMESPEC_RESOLUTION * (sec - s);
       long ns = frac;
       ns += ns < frac;
-      s += ns / BILLION;
-      ns %= BILLION;
+      s += ns / TIMESPEC_RESOLUTION;
+      ns %= TIMESPEC_RESOLUTION;
 
       if (ns < 0)
         {
           s--;
-          ns += BILLION;
+          ns += TIMESPEC_RESOLUTION;
         }
 
-      r.tv_sec = s;
-      r.tv_nsec = ns;
+      return make_timespec (s, ns);
     }
-
-  return r;
 }
index 9219eb3..f128e7a 100644 (file)
@@ -96,7 +96,11 @@ rpl_dup2 (int fd, int desired_fd)
   /* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF.
      On Cygwin 1.5.x, dup2 (1, 1) returns 0.
      On Cygwin 1.7.17, dup2 (1, -1) dumps core.
+     On Cygwin 1.7.25, dup2 (1, 256) can dump core.
      On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC.  */
+#  if HAVE_SETDTABLESIZE
+  setdtablesize (desired_fd + 1);
+#  endif
   if (desired_fd < 0)
     fd = desired_fd;
   if (fd == desired_fd)
index 99851d1..3073189 100644 (file)
@@ -30,6 +30,10 @@ dup3 (int oldfd, int newfd, int flags)
 {
 #if HAVE_DUP3
 # undef dup3
+# if HAVE_SETDTABLESIZE
+  /* Avoid a cygwin crasher. */
+  setdtablesize (newfd + 1);
+# endif
   /* Try the system call first, if it exists.  (We may be running with a glibc
      that has the function but with an older kernel that lacks it.)  */
   {
@@ -92,9 +96,9 @@ dup3 (int oldfd, int newfd, int flags)
 
 #if O_BINARY
   if (flags & O_BINARY)
-    setmode (newfd, O_BINARY);
+    set_binary_mode (newfd, O_BINARY);
   else if (flags & O_TEXT)
-    setmode (newfd, O_TEXT);
+    set_binary_mode (newfd, O_TEXT);
 #endif
 
   return newfd;
index cc29726..92b13c9 100644 (file)
@@ -31,6 +31,9 @@
 
 #include <stdlib.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef EEALLOC_INLINE
 # define EEALLOC_INLINE _GL_INLINE
index 865b293..cdc3026 100644 (file)
@@ -195,7 +195,7 @@ print_errno_message (int errnum)
 #endif
 }
 
-static void
+static void _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) _GL_ARG_NONNULL ((3))
 error_tail (int status, int errnum, const char *message, va_list args)
 {
 #if _LIBC
index b62e183..919565f 100644 (file)
@@ -20,6 +20,9 @@
 #ifndef _GL_EXECINFO_H
 #define _GL_EXECINFO_H
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_EXECINFO_INLINE
 # define _GL_EXECINFO_INLINE _GL_INLINE
index bb8bae1..53ac317 100644 (file)
@@ -75,8 +75,7 @@ acl_access_nontrivial (acl_t acl)
     }
   return got_one;
 
-#  else /* IRIX, Tru64 */
-#   if HAVE_ACL_TO_SHORT_TEXT /* IRIX */
+#  elif HAVE_ACL_TO_SHORT_TEXT /* IRIX */
   /* Don't use acl_get_entry: it is undocumented.  */
 
   int count = acl->acl_cnt;
@@ -93,8 +92,7 @@ acl_access_nontrivial (acl_t acl)
     }
   return 0;
 
-#   endif
-#   if HAVE_ACL_FREE_TEXT /* Tru64 */
+#  elif HAVE_ACL_FREE_TEXT /* Tru64 */
   /* Don't use acl_get_entry: it takes only one argument and does not work.  */
 
   int count = acl->acl_num;
@@ -117,7 +115,10 @@ acl_access_nontrivial (acl_t acl)
     }
   return 0;
 
-#   endif
+#  else
+
+  errno = ENOSYS;
+  return -1;
 #  endif
 }
 
index bf40d37..306a083 100644 (file)
 
 #include <stddef.h>
 #include <stdio.h>
+#if HAVE_STDIO_EXT_H
+# include <stdio_ext.h>
+#endif
 
-#if HAVE_DECL___FPENDING
-# if HAVE_STDIO_EXT_H
-#  include <stdio_ext.h>
-# endif
-#else
-size_t __fpending (FILE *);
+#if !HAVE_DECL___FPENDING
+size_t __fpending (FILE *) _GL_ATTRIBUTE_PURE;
 #endif
index a625803..ec5a6aa 100644 (file)
@@ -19,7 +19,7 @@
 /* Specification.  */
 #include <stdio.h>
 
-/* Get off_t and lseek.  */
+/* Get off_t, lseek, _POSIX_VERSION.  */
 #include <unistd.h>
 
 #include "stdio-impl.h"
@@ -99,8 +99,14 @@ fseeko (FILE *fp, off_t offset, int whence)
 #elif defined EPLAN9                /* Plan9 */
   if (fp->rp == fp->buf
       && fp->wp == fp->buf)
+#elif FUNC_FFLUSH_STDIN < 0 && 200809 <= _POSIX_VERSION
+  /* Cross-compiling to some other system advertising conformance to
+     POSIX.1-2008 or later.  Assume fseeko and fflush work as advertised.
+     If this assumption is incorrect, please report the bug to
+     bug-gnulib.  */
+  if (0)
 #else
-  #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib."
+  #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
 #endif
     {
       /* We get here when an fflush() call immediately preceded this one (or
index 4ec85cb..7bd5bbc 100644 (file)
@@ -48,7 +48,7 @@
 #ifdef GNULIB_GC_SHA1
 # include "sha1.h"
 #endif
-#if defined(GNULIB_GC_HMAC_MD5) || defined(GNULIB_GC_HMAC_SHA1)
+#if defined(GNULIB_GC_HMAC_MD5) || defined(GNULIB_GC_HMAC_SHA1) || defined(GNULIB_GC_HMAC_SHA256) || defined(GNULIB_GC_HMAC_SHA512)
 # include "hmac.h"
 #endif
 
@@ -914,3 +914,23 @@ gc_hmac_sha1 (const void *key, size_t keylen,
   return GC_OK;
 }
 #endif
+
+#ifdef GNULIB_GC_HMAC_SHA256
+Gc_rc
+gc_hmac_sha256 (const void *key, size_t keylen,
+                const void *in, size_t inlen, char *resbuf)
+{
+  hmac_sha256 (key, keylen, in, inlen, resbuf);
+  return GC_OK;
+}
+#endif
+
+#ifdef GNULIB_GC_HMAC_SHA512
+Gc_rc
+gc_hmac_sha512 (const void *key, size_t keylen,
+                const void *in, size_t inlen, char *resbuf)
+{
+  hmac_sha512 (key, keylen, in, inlen, resbuf);
+  return GC_OK;
+}
+#endif
index 050b89f..3be4272 100644 (file)
@@ -656,7 +656,7 @@ gc_hmac_md5 (const void *key, size_t keylen,
   unsigned char *hash;
   gpg_error_t err;
 
-  assert (hlen == 16);
+  assert (hlen == GC_MD5_DIGEST_SIZE);
 
   err = gcry_md_open (&mdh, GCRY_MD_MD5, GCRY_MD_FLAG_HMAC);
   if (err != GPG_ERR_NO_ERROR)
@@ -725,3 +725,83 @@ gc_hmac_sha1 (const void *key, size_t keylen,
   return GC_OK;
 }
 #endif
+
+#ifdef GNULIB_GC_HMAC_SHA256
+Gc_rc
+gc_hmac_sha256 (const void *key, size_t keylen,
+             const void *in, size_t inlen, char *resbuf)
+{
+  size_t hlen = gcry_md_get_algo_dlen (GCRY_MD_SHA256);
+  gcry_md_hd_t mdh;
+  unsigned char *hash;
+  gpg_error_t err;
+
+  assert (hlen == GC_SHA256_DIGEST_SIZE);
+
+  err = gcry_md_open (&mdh, GCRY_MD_SHA256, GCRY_MD_FLAG_HMAC);
+  if (err != GPG_ERR_NO_ERROR)
+    return GC_INVALID_HASH;
+
+  err = gcry_md_setkey (mdh, key, keylen);
+  if (err != GPG_ERR_NO_ERROR)
+    {
+      gcry_md_close (mdh);
+      return GC_INVALID_HASH;
+    }
+
+  gcry_md_write (mdh, in, inlen);
+
+  hash = gcry_md_read (mdh, GCRY_MD_SHA256);
+  if (hash == NULL)
+    {
+      gcry_md_close (mdh);
+      return GC_INVALID_HASH;
+    }
+
+  memcpy (resbuf, hash, hlen);
+
+  gcry_md_close (mdh);
+
+  return GC_OK;
+}
+#endif
+
+#ifdef GNULIB_GC_HMAC_SHA512
+Gc_rc
+gc_hmac_sha512 (const void *key, size_t keylen,
+              const void *in, size_t inlen, char *resbuf)
+{
+  size_t hlen = gcry_md_get_algo_dlen (GCRY_MD_SHA512);
+  gcry_md_hd_t mdh;
+  unsigned char *hash;
+  gpg_error_t err;
+
+  assert (hlen == GC_SHA512_DIGEST_SIZE);
+
+  err = gcry_md_open (&mdh, GCRY_MD_SHA512, GCRY_MD_FLAG_HMAC);
+  if (err != GPG_ERR_NO_ERROR)
+    return GC_INVALID_HASH;
+
+  err = gcry_md_setkey (mdh, key, keylen);
+  if (err != GPG_ERR_NO_ERROR)
+    {
+      gcry_md_close (mdh);
+      return GC_INVALID_HASH;
+    }
+
+  gcry_md_write (mdh, in, inlen);
+
+  hash = gcry_md_read (mdh, GCRY_MD_SHA512);
+  if (hash == NULL)
+    {
+      gcry_md_close (mdh);
+      return GC_INVALID_HASH;
+    }
+
+  memcpy (resbuf, hash, hlen);
+
+  gcry_md_close (mdh);
+
+  return GC_OK;
+}
+#endif
index 1482ba5..d2cd7d8 100644 (file)
--- a/lib/gc.h
+++ b/lib/gc.h
@@ -159,6 +159,10 @@ extern Gc_rc gc_hmac_md5 (const void *key, size_t keylen,
                           const void *in, size_t inlen, char *resbuf);
 extern Gc_rc gc_hmac_sha1 (const void *key, size_t keylen,
                            const void *in, size_t inlen, char *resbuf);
+extern Gc_rc gc_hmac_sha256 (const void *key, size_t keylen,
+                             const void *in, size_t inlen, char *resbuf);
+extern Gc_rc gc_hmac_sha512 (const void *key, size_t keylen,
+                             const void *in, size_t inlen, char *resbuf);
 
 /* Derive cryptographic keys from a password P of length PLEN, with
    salt S of length SLEN, placing the result in pre-allocated buffer
index 9947405..355c17e 100644 (file)
 
 #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 
-#include <stdio.h>
+# include <stdio.h>
 
-#include "msvc-inval.h"
+# include "msvc-inval.h"
 
-#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
 static int
 _setmaxstdio_nothrow (int newmax)
 {
@@ -44,10 +44,11 @@ _setmaxstdio_nothrow (int newmax)
 
   return result;
 }
-# define _setmaxstdio _setmaxstdio_nothrow
-#endif
+#  define _setmaxstdio _setmaxstdio_nothrow
+# endif
 
-/* Cache for the previous getdtablesize () result.  */
+/* Cache for the previous getdtablesize () result.  Safe to cache because
+   Windows also lacks setrlimit.  */
 static int dtablesize;
 
 int
@@ -83,4 +84,24 @@ getdtablesize (void)
   return dtablesize;
 }
 
+#elif HAVE_GETDTABLESIZE
+
+# include <sys/resource.h>
+# undef getdtablesize
+
+int
+rpl_getdtablesize(void)
+{
+  /* To date, this replacement is only compiled for Cygwin 1.7.25,
+     which auto-increased the RLIMIT_NOFILE soft limit until it
+     hits the compile-time constant hard limit of 3200.  Although
+     that version of cygwin supported a child process inheriting
+     a smaller soft limit, the smaller limit is not enforced, so
+     we might as well just report the hard limit.  */
+  struct rlimit lim;
+  if (!getrlimit (RLIMIT_NOFILE, &lim) && lim.rlim_max != RLIM_INFINITY)
+    return lim.rlim_max;
+  return getdtablesize ();
+}
+
 #endif
index 9856adc..482b24a 100644 (file)
@@ -43,6 +43,21 @@ getgroups (int n _GL_UNUSED, GETGROUPS_T *groups _GL_UNUSED)
 #  define GETGROUPS_ZERO_BUG 0
 # endif
 
+/* On OS X 10.6 and later, use the usual getgroups, not the one
+   supplied when _DARWIN_C_SOURCE is defined.  _DARWIN_C_SOURCE is
+   normally defined, since it means "conform to POSIX, but add
+   non-POSIX extensions even if that violates the POSIX namespace
+   rules", which is what we normally want.  But with getgroups there
+   is an inconsistency, and _DARWIN_C_SOURCE means "change getgroups()
+   so that it no longer works right".  The BUGS section of compat(5)
+   says that the behavior is dubious if you compile different sections
+   of a program with different _DARWIN_C_SOURCE settings, so fix only
+   the offending symbol.  */
+# ifdef __APPLE__
+int posix_getgroups (int, gid_t []) __asm ("_getgroups");
+#  define getgroups posix_getgroups
+# endif
+
 /* On at least Ultrix 4.3 and NextStep 3.2, getgroups (0, NULL) always
    fails.  On other systems, it returns the number of supplemental
    groups for the process.  This function handles that special case
@@ -86,7 +101,7 @@ rpl_getgroups (int n, gid_t *group)
         }
       saved_errno = errno;
       free (gbuf);
-      errno == saved_errno;
+      errno = saved_errno;
       return result;
     }
 
index 10df671..959f0ed 100644 (file)
@@ -22,6 +22,9 @@
 
 #include "xtime.h"
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef GETHRXTIME_INLINE
 # define GETHRXTIME_INLINE _GL_INLINE
index 58a92de..9094723 100644 (file)
@@ -21,6 +21,9 @@
 #include <stdbool.h>
 #include <stddef.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef GL_LIST_INLINE
 # define GL_LIST_INLINE _GL_INLINE
diff --git a/lib/gl_openssl.h b/lib/gl_openssl.h
new file mode 100644 (file)
index 0000000..bcdbbef
--- /dev/null
@@ -0,0 +1,116 @@
+/* gl_openssl.h -- wrap openssl crypto hash routines in gnulib interface
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Pádraig Brady */
+
+#ifndef GL_OPENSSL_NAME
+# error "Please define GL_OPENSSL_NAME to 1,5,256 etc."
+#endif
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+# error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef GL_OPENSSL_INLINE
+# define GL_OPENSSL_INLINE _GL_INLINE
+#endif
+
+/* Concatenate two preprocessor tokens.  */
+#define _GLCRYPTO_CONCAT_(prefix, suffix) prefix##suffix
+#define _GLCRYPTO_CONCAT(prefix, suffix) _GLCRYPTO_CONCAT_ (prefix, suffix)
+
+#if GL_OPENSSL_NAME == 5
+# define OPENSSL_ALG md5
+#else
+# define OPENSSL_ALG _GLCRYPTO_CONCAT (sha, GL_OPENSSL_NAME)
+#endif
+
+/* Context type mappings.  */
+#if BASE_OPENSSL_TYPE != GL_OPENSSL_NAME
+# undef BASE_OPENSSL_TYPE
+# if GL_OPENSSL_NAME == 224
+#  define BASE_OPENSSL_TYPE 256
+# elif GL_OPENSSL_NAME == 384
+#  define BASE_OPENSSL_TYPE 512
+# endif
+# define md5_CTX MD5_CTX
+# define sha1_CTX SHA_CTX
+# define sha224_CTX SHA256_CTX
+# define sha224_ctx sha256_ctx
+# define sha256_CTX SHA256_CTX
+# define sha384_CTX SHA512_CTX
+# define sha384_ctx sha512_ctx
+# define sha512_CTX SHA512_CTX
+# undef _gl_CTX
+# undef _gl_ctx
+# define _gl_CTX _GLCRYPTO_CONCAT (OPENSSL_ALG, _CTX) /* openssl type.  */
+# define _gl_ctx _GLCRYPTO_CONCAT (OPENSSL_ALG, _ctx) /* gnulib type.  */
+
+struct _gl_ctx { _gl_CTX CTX; };
+#endif
+
+/* Function name mappings.  */
+#define md5_prefix MD5
+#define sha1_prefix SHA1
+#define sha224_prefix SHA224
+#define sha256_prefix SHA256
+#define sha384_prefix SHA384
+#define sha512_prefix SHA512
+#define _GLCRYPTO_PREFIX _GLCRYPTO_CONCAT (OPENSSL_ALG, _prefix)
+#define OPENSSL_FN(suffix) _GLCRYPTO_CONCAT (_GLCRYPTO_PREFIX, suffix)
+#define GL_CRYPTO_FN(suffix) _GLCRYPTO_CONCAT (OPENSSL_ALG, suffix)
+
+GL_OPENSSL_INLINE void
+GL_CRYPTO_FN (_init_ctx) (struct _gl_ctx *ctx)
+{ (void) OPENSSL_FN (_Init) ((_gl_CTX *) ctx); }
+
+/* These were never exposed by gnulib.  */
+#if ! (GL_OPENSSL_NAME == 224 || GL_OPENSSL_NAME == 384)
+GL_OPENSSL_INLINE void
+GL_CRYPTO_FN (_process_bytes) (const void *buf, size_t len, struct _gl_ctx *ctx)
+{ OPENSSL_FN (_Update) ((_gl_CTX *) ctx, buf, len); }
+
+GL_OPENSSL_INLINE void
+GL_CRYPTO_FN (_process_block) (const void *buf, size_t len, struct _gl_ctx *ctx)
+{ GL_CRYPTO_FN (_process_bytes) (buf, len, ctx); }
+#endif
+
+GL_OPENSSL_INLINE void *
+GL_CRYPTO_FN (_finish_ctx) (struct _gl_ctx *ctx, void *res)
+{ OPENSSL_FN (_Final) ((unsigned char *) res, (_gl_CTX *) ctx); return res; }
+
+GL_OPENSSL_INLINE void *
+GL_CRYPTO_FN (_buffer) (const char *buf, size_t len, void *res)
+{ return OPENSSL_FN () ((const unsigned char *) buf, len, (unsigned char *) res); }
+
+GL_OPENSSL_INLINE void *
+GL_CRYPTO_FN (_read_ctx) (const struct _gl_ctx *ctx, void *res)
+{
+  /* Assume any unprocessed bytes in ctx are not to be ignored.  */
+  _gl_CTX tmp_ctx = *(_gl_CTX *) ctx;
+  OPENSSL_FN (_Final) ((unsigned char *) res, &tmp_ctx);
+  return res;
+}
+
+/* Undef so we can include multiple times.  */
+#undef GL_CRYPTO_FN
+#undef OPENSSL_FN
+#undef _GLCRYPTO_PREFIX
+#undef OPENSSL_ALG
+#undef GL_OPENSSL_NAME
+
+_GL_INLINE_HEADER_END
index 575ffd3..5134065 100644 (file)
@@ -21,6 +21,9 @@
 #include <stdbool.h>
 #include <stddef.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef GL_OSET_INLINE
 # define GL_OSET_INLINE _GL_INLINE
index 759bfe6..1c9451c 100644 (file)
@@ -21,6 +21,9 @@
 #include "gl_list.h"
 #include "xalloc.h"
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef GL_XLIST_INLINE
 # define GL_XLIST_INLINE _GL_INLINE
index 7ab0d49..b30b2ce 100644 (file)
@@ -21,6 +21,9 @@
 #include "gl_oset.h"
 #include "xalloc.h"
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef GL_XOSET_INLINE
 # define GL_XOSET_INLINE _GL_INLINE
index 725d3e1..53898ec 100644 (file)
@@ -22,6 +22,9 @@
 #include "gl_sublist.h"
 #include "xalloc.h"
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef GL_XSUBLIST_INLINE
 # define GL_XSUBLIST_INLINE _GL_INLINE
index bf90a00..7ec066f 100644 (file)
 # define GET_LOGIN_NAME_MAX()   (-1)
 #endif
 \f
-static const char *next_brace_sub (const char *begin, int flags) __THROW;
+static const char *next_brace_sub (const char *begin, int flags) __THROWNL;
 
 #endif /* !defined _LIBC || !defined GLOB_ONLY_P */
 
@@ -210,8 +210,8 @@ extern int __glob_pattern_type (const char *pattern, int quote)
     attribute_hidden;
 
 #if !defined _LIBC || !defined GLOB_ONLY_P
-static int prefix_array (const char *prefix, char **array, size_t n) __THROW;
-static int collated_compare (const void *, const void *) __THROW;
+static int prefix_array (const char *prefix, char **array, size_t n) __THROWNL;
+static int collated_compare (const void *, const void *) __THROWNL;
 
 
 /* Find the end of the sub-pattern in a brace expression.  */
index 49e15c0..c8f1749 100644 (file)
@@ -43,6 +43,9 @@
 #ifndef __THROW
 # define __THROW
 #endif
+#ifndef __THROWNL
+# define __THROWNL
+#endif
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
index 3926134..09544f3 100644 (file)
@@ -54,6 +54,9 @@
 #include <time.h>
 
 #include "glthread/lock.h"
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GLTHREAD_COND_INLINE
index e52b615..df8df61 100644 (file)
@@ -74,6 +74,9 @@
 #include <errno.h>
 #include <stdlib.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GLTHREAD_THREAD_INLINE
 # define _GLTHREAD_THREAD_INLINE _GL_INLINE
diff --git a/lib/hmac-sha256.c b/lib/hmac-sha256.c
new file mode 100644 (file)
index 0000000..a8e42c9
--- /dev/null
@@ -0,0 +1,80 @@
+/* hmac-sha256.c -- hashed message authentication codes
+   Copyright (C) 2005-2006, 2009-2013 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Simon Josefsson.  */
+
+#include <config.h>
+
+#include "hmac.h"
+
+#include "memxor.h"
+#include "sha256.h"
+
+#include <string.h>
+
+#define IPAD 0x36
+#define OPAD 0x5c
+
+int
+hmac_sha256 (const void *key, size_t keylen,
+             const void *in, size_t inlen, void *resbuf)
+{
+  struct sha256_ctx inner;
+  struct sha256_ctx outer;
+  char optkeybuf[32];
+  char block[64];
+  char innerhash[32];
+
+  /* Reduce the key's size, so that it becomes <= 64 bytes large.  */
+
+  if (keylen > 64)
+    {
+      struct sha256_ctx keyhash;
+
+      sha256_init_ctx (&keyhash);
+      sha256_process_bytes (key, keylen, &keyhash);
+      sha256_finish_ctx (&keyhash, optkeybuf);
+
+      key = optkeybuf;
+      keylen = 32;
+    }
+
+  /* Compute INNERHASH from KEY and IN.  */
+
+  sha256_init_ctx (&inner);
+
+  memset (block, IPAD, sizeof (block));
+  memxor (block, key, keylen);
+
+  sha256_process_block (block, 64, &inner);
+  sha256_process_bytes (in, inlen, &inner);
+
+  sha256_finish_ctx (&inner, innerhash);
+
+  /* Compute result from KEY and INNERHASH.  */
+
+  sha256_init_ctx (&outer);
+
+  memset (block, OPAD, sizeof (block));
+  memxor (block, key, keylen);
+
+  sha256_process_block (block, 64, &outer);
+  sha256_process_bytes (innerhash, 32, &outer);
+
+  sha256_finish_ctx (&outer, resbuf);
+
+  return 0;
+}
diff --git a/lib/hmac-sha512.c b/lib/hmac-sha512.c
new file mode 100644 (file)
index 0000000..05bf6ce
--- /dev/null
@@ -0,0 +1,80 @@
+/* hmac-sha512.c -- hashed message authentication codes
+   Copyright (C) 2005-2006, 2009-2013 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Simon Josefsson.  */
+
+#include <config.h>
+
+#include "hmac.h"
+
+#include "memxor.h"
+#include "sha512.h"
+
+#include <string.h>
+
+#define IPAD 0x36
+#define OPAD 0x5c
+
+int
+hmac_sha512 (const void *key, size_t keylen,
+             const void *in, size_t inlen, void *resbuf)
+{
+  struct sha512_ctx inner;
+  struct sha512_ctx outer;
+  char optkeybuf[64];
+  char block[128];
+  char innerhash[64];
+
+  /* Reduce the key's size, so that it becomes <= 128 bytes large.  */
+
+  if (keylen > 128)
+    {
+      struct sha512_ctx keyhash;
+
+      sha512_init_ctx (&keyhash);
+      sha512_process_bytes (key, keylen, &keyhash);
+      sha512_finish_ctx (&keyhash, optkeybuf);
+
+      key = optkeybuf;
+      keylen = 128;
+    }
+
+  /* Compute INNERHASH from KEY and IN.  */
+
+  sha512_init_ctx (&inner);
+
+  memset (block, IPAD, sizeof (block));
+  memxor (block, key, keylen);
+
+  sha512_process_block (block, 128, &inner);
+  sha512_process_bytes (in, inlen, &inner);
+
+  sha512_finish_ctx (&inner, innerhash);
+
+  /* Compute result from KEY and INNERHASH.  */
+
+  sha512_init_ctx (&outer);
+
+  memset (block, OPAD, sizeof (block));
+  memxor (block, key, keylen);
+
+  sha512_process_block (block, 128, &outer);
+  sha512_process_bytes (innerhash, 64, &outer);
+
+  sha512_finish_ctx (&outer, resbuf);
+
+  return 0;
+}
index 93970bc..a36a5af 100644 (file)
@@ -37,4 +37,20 @@ int
 hmac_sha1 (const void *key, size_t keylen,
            const void *in, size_t inlen, void *resbuf);
 
+/* Compute Hashed Message Authentication Code with SHA-256, over BUFFER
+   data of BUFLEN bytes using the KEY of KEYLEN bytes, writing the
+   output to pre-allocated 32 byte minimum RESBUF buffer.  Return 0 on
+   success.  */
+int
+hmac_sha256 (const void *key, size_t keylen,
+             const void *in, size_t inlen, void *resbuf);
+
+/* Compute Hashed Message Authentication Code with SHA-512, over BUFFER
+   data of BUFLEN bytes using the KEY of KEYLEN bytes, writing the
+   output to pre-allocated 64 byte minimum RESBUF buffer.  Return 0 on
+   success.  */
+int
+hmac_sha512 (const void *key, size_t keylen,
+             const void *in, size_t inlen, void *resbuf);
+
 #endif /* HMAC_H */
index 63ecde8..633c44a 100644 (file)
    declared with attribute warn_unused_result".  */
 
 #ifndef _GL_IGNORE_VALUE_H
-# define _GL_IGNORE_VALUE_H
-
-/* The __attribute__((__warn_unused_result__)) feature
-   is available in gcc versions 3.4 and newer,
-   while the typeof feature has been available since 2.7 at least.  */
-# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
-#  define ignore_value(x) ((void) (x))
-# else
-#  define ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
-# endif
+#define _GL_IGNORE_VALUE_H
+
+/* Normally casting an expression to void discards its value, but GCC
+   versions 3.4 and newer have __attribute__ ((__warn_unused_result__))
+   which may cause unwanted diagnostics in that case.  Use __typeof__
+   and __extension__ to work around the problem, if the workaround is
+   known to be needed.  */
+#if 3 < __GNUC__ + (4 <= __GNUC_MINOR__)
+# define ignore_value(x) \
+    (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; }))
+#else
+# define ignore_value(x) ((void) (x))
+#endif
 
 #endif
index f57f9b4..1d2deb7 100644 (file)
@@ -89,7 +89,8 @@
 
 /* Return 1 if the __typeof__ keyword works.  This could be done by
    'configure', but for now it's easier to do it by hand.  */
-#if 2 <= __GNUC__ || defined __IBM__TYPEOF__ || 0x5110 <= __SUNPRO_C
+#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
+     || (0x5110 <= __SUNPRO_C && !__STDC__))
 # define _GL_HAVE___TYPEOF__ 1
 #else
 # define _GL_HAVE___TYPEOF__ 0
index 1893f55..05a22ff 100644 (file)
@@ -1105,12 +1105,22 @@ _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
 #endif
 
 #if @GNULIB_STRTOUMAX@
-# if !@HAVE_DECL_STRTOUMAX@
-#  undef strtoumax
+# if @REPLACE_STRTOUMAX@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strtoumax
+#   define strtoumax rpl_strtoumax
+#  endif
+_GL_FUNCDECL_RPL (strtoumax, uintmax_t,
+                  (const char *, char **, int) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoumax, uintmax_t, (const char *, char **, int));
+# else
+#  if !@HAVE_DECL_STRTOUMAX@
+#   undef strtoumax
 _GL_FUNCDECL_SYS (strtoumax, uintmax_t,
                   (const char *, char **, int) _GL_ARG_NONNULL ((1)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int));
+# endif
 _GL_CXXALIASWARN (strtoumax);
 #elif defined GNULIB_POSIXCHECK
 # undef strtoumax
index d95e4ba..10596a9 100644 (file)
@@ -79,10 +79,21 @@ extern int rpl_isnanf (float x);
   ((sizeof (DOUBLE) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
 typedef union { DOUBLE value; unsigned int word[NWORDS]; } memory_double;
 
+/* Most hosts nowadays use IEEE floating point, so they use IEC 60559
+   representations, have infinities and NaNs, and do not trap on
+   exceptions.  Define IEEE_FLOATING_POINT if this host is one of the
+   typical ones.  The C11 macro __STDC_IEC_559__ is close to what is
+   wanted here, but is not quite right because this file does not require
+   all the features of C11 Annex F (and does not require C11 at all,
+   for that matter).  */
+
+#define IEEE_FLOATING_POINT (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \
+                             && FLT_MIN_EXP == -125 && FLT_MAX_EXP == 128)
+
 int
 FUNC (DOUBLE x)
 {
-#ifdef KNOWN_EXPBIT0_LOCATION
+#if defined KNOWN_EXPBIT0_LOCATION && IEEE_FLOATING_POINT
 # if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
   /* Special CPU dependent code is needed to treat bit patterns outside the
      IEEE 754 specification (such as Pseudo-NaNs, Pseudo-Infinities,
@@ -153,8 +164,9 @@ FUNC (DOUBLE x)
   }
 # endif
 #else
-  /* The configuration did not find sufficient information.  Give up about
-     the signaling NaNs, handle only the quiet NaNs.  */
+  /* The configuration did not find sufficient information, or does
+     not use IEEE floating point.  Give up about the signaling NaNs;
+     handle only the quiet NaNs.  */
   if (x == x)
     {
 # if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
index 6b0153e..bfd9a03 100644 (file)
 # include <os2.h>
 #endif
 
+/* For MB_CUR_MAX_L */
+#if defined DARWIN7
+# include <xlocale.h>
+#endif
+
 #if ENABLE_RELOCATABLE
 # include "relocatable.h"
 #else
@@ -545,7 +550,7 @@ locale_charset (void)
 #ifdef DARWIN7
   /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
      (the default codeset) does not work when MB_CUR_MAX is 1.  */
-  if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX <= 1)
+  if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
     codeset = "ASCII";
 #endif
 
index 7189819..6cc0f7d 100644 (file)
@@ -28,6 +28,9 @@
 #ifndef _@GUARD_PREFIX@_MATH_H
 #define _@GUARD_PREFIX@_MATH_H
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_MATH_INLINE
 # define _GL_MATH_INLINE _GL_INLINE
index 327c957..0646cf4 100644 (file)
 #include <wchar.h>
 #include <wctype.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef MBCHAR_INLINE
 # define MBCHAR_INLINE _GL_INLINE
index 199180e..704c0cc 100644 (file)
@@ -62,6 +62,9 @@
 
 #include "mbchar.h"
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef MBFILE_INLINE
 # define MBFILE_INLINE _GL_INLINE
@@ -244,6 +247,9 @@ typedef mbchar_t mbf_char_t;
 
 #define mb_iseof(mbc) ((mbc).bytes == 0)
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 
 #endif /* _MBFILE_H */
index 24504c3..9ef4707 100644 (file)
@@ -97,6 +97,9 @@
 
 #include "mbchar.h"
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef MBITER_INLINE
 # define MBITER_INLINE _GL_INLINE
index c5f5fce..ca130a4 100644 (file)
 #include "mbchar.h"
 #include "strnlen1.h"
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef MBUITER_INLINE
 # define MBUITER_INLINE _GL_INLINE
index c41538c..6a7c2f6 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -21,6 +21,9 @@
 
 #include <config.h>
 
+#if HAVE_OPENSSL_MD5
+# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
+#endif
 #include "md5.h"
 
 #include <stdalign.h>
@@ -61,6 +64,7 @@
 # error "invalid BLOCKSIZE"
 #endif
 
+#if ! HAVE_OPENSSL_MD5
 /* This array contains the bytes used to pad the buffer to the next
    64-byte boundary.  (RFC 1321, 3.1: Step 1)  */
 static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ...  */ };
@@ -128,6 +132,7 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
 
   return md5_read_ctx (ctx, resbuf);
 }
+#endif
 
 /* Compute MD5 message digest for bytes read from STREAM.  The
    resulting message digest number will be written into the 16 bytes
@@ -202,6 +207,7 @@ process_partial_block:
   return 0;
 }
 
+#if ! HAVE_OPENSSL_MD5
 /* Compute MD5 message digest for LEN bytes beginning at BUFFER.  The
    result is always in little endian byte order, so that a byte-wise
    output yields to the wanted ASCII representation of the message
@@ -459,3 +465,4 @@ md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
   ctx->C = C;
   ctx->D = D;
 }
+#endif
index 3786dc5..1ad82c2 100644 (file)
--- a/lib/md5.h
+++ b/lib/md5.h
 #include <stdio.h>
 #include <stdint.h>
 
+# if HAVE_OPENSSL_MD5
+#  include <openssl/md5.h>
+# endif
+
 #define MD5_DIGEST_SIZE 16
 #define MD5_BLOCK_SIZE 64
 
 extern "C" {
 # endif
 
+# if HAVE_OPENSSL_MD5
+#  define GL_OPENSSL_NAME 5
+#  include "gl_openssl.h"
+# else
 /* Structure to save state of computation between the single steps.  */
 struct md5_ctx
 {
@@ -106,11 +114,6 @@ extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW;
 extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) __THROW;
 
 
-/* Compute MD5 message digest for bytes read from STREAM.  The
-   resulting message digest number will be written into the 16 bytes
-   beginning at RESBLOCK.  */
-extern int __md5_stream (FILE *stream, void *resblock) __THROW;
-
 /* Compute MD5 message digest for LEN bytes beginning at BUFFER.  The
    result is always in little endian byte order, so that a byte-wise
    output yields to the wanted ASCII representation of the message
@@ -118,6 +121,13 @@ extern int __md5_stream (FILE *stream, void *resblock) __THROW;
 extern void *__md5_buffer (const char *buffer, size_t len,
                            void *resblock) __THROW;
 
+# endif
+/* Compute MD5 message digest for bytes read from STREAM.  The
+   resulting message digest number will be written into the 16 bytes
+   beginning at RESBLOCK.  */
+extern int __md5_stream (FILE *stream, void *resblock) __THROW;
+
+
 # ifdef __cplusplus
 }
 # endif
index 2d82f45..846662b 100644 (file)
@@ -133,7 +133,7 @@ mgetgroups (char const *username, gid_t gid, gid_t **groups)
       return -1;
     }
 
-  if (!username && gid != (gid_t) -1)
+  if (max_n_groups == 0 || (!username && gid != (gid_t) -1))
     max_n_groups++;
   g = realloc_groupbuf (NULL, max_n_groups);
   if (g == NULL)
index d8d5464..b839cd1 100644 (file)
@@ -946,6 +946,7 @@ read_file_system_list (bool need_fs_type)
             mtail = &me->me_next;
           }
       }
+    closedir (dirp);
   }
 #endif /* MOUNTED_INTERIX_STATVFS */
 
@@ -961,11 +962,7 @@ read_file_system_list (bool need_fs_type)
     while (mount_list)
       {
         me = mount_list->me_next;
-        free (mount_list->me_devname);
-        free (mount_list->me_mountdir);
-        if (mount_list->me_type_malloced)
-          free (mount_list->me_type);
-        free (mount_list);
+        free_mount_entry (mount_list);
         mount_list = me;
       }
 
@@ -973,3 +970,14 @@ read_file_system_list (bool need_fs_type)
     return NULL;
   }
 }
+
+/* Free a mount entry as returned from read_file_system_list ().  */
+
+void free_mount_entry (struct mount_entry *me)
+{
+  free (me->me_devname);
+  free (me->me_mountdir);
+  if (me->me_type_malloced)
+    free (me->me_type);
+  free (me);
+}
index ffdcc02..55877e2 100644 (file)
@@ -36,5 +36,6 @@ struct mount_entry
 };
 
 struct mount_entry *read_file_system_list (bool need_fs_type);
+void free_mount_entry (struct mount_entry *entry);
 
 #endif
index ef2b860..1873e23 100644 (file)
@@ -28,7 +28,7 @@
 
 # if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
 
-static void cdecl
+static void __cdecl
 gl_msvc_invalid_parameter_handler (const wchar_t *expression,
                                    const wchar_t *function,
                                    const wchar_t *file,
@@ -45,7 +45,7 @@ gl_msvc_invalid_parameter_handler (const wchar_t *expression,
 
 #  if defined _MSC_VER
 
-static void cdecl
+static void __cdecl
 gl_msvc_invalid_parameter_handler (const wchar_t *expression,
                                    const wchar_t *function,
                                    const wchar_t *file,
@@ -94,7 +94,7 @@ gl_msvc_inval_current (void)
     }
 }
 
-static void cdecl
+static void __cdecl
 gl_msvc_invalid_parameter_handler (const wchar_t *expression,
                                    const wchar_t *function,
                                    const wchar_t *file,
index d915449..f830fdc 100644 (file)
@@ -313,7 +313,7 @@ libc_hidden_def (_obstack_newchunk)
 
 /* Suppress -Wmissing-prototypes warning.  We don't want to declare this in
    obstack.h because it is just for debugging.  */
-int _obstack_allocated_p (struct obstack *h, void *obj);
+int _obstack_allocated_p (struct obstack *h, void *obj) _GL_ATTRIBUTE_PURE;
 
 int
 _obstack_allocated_p (struct obstack *h, void *obj)
index 7cf98ed..67c0b55 100644 (file)
@@ -1,20 +1,20 @@
 /* obstack.h - object stack macros
-   Copyright (C) 1988-1994, 1996-1999, 2003-2006, 2009-2013 Free Software
-   Foundation, Inc.
+   Copyright (C) 1988-2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with this program; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 /* Summary:
 
@@ -183,7 +183,7 @@ extern int _obstack_begin (struct obstack *, int, int,
 extern int _obstack_begin_1 (struct obstack *, int, int,
                              void *(*) (void *, long),
                              void (*) (void *, void *), void *);
-extern int _obstack_memory_used (struct obstack *);
+extern int _obstack_memory_used (struct obstack *) _GL_ATTRIBUTE_PURE;
 
 /* The default name of the function for freeing a chunk is 'obstack_free',
    but gnulib users can override this by defining '__obstack_free'.  */
@@ -501,9 +501,9 @@ __extension__                                                           \
 ( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk,             \
   ((((h)->temp.tempint > 0                                              \
     && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk))     \
-   ? (int) ((h)->next_free = (h)->object_base                           \
-            = (h)->temp.tempint + (char *) (h)->chunk)                  \
-   : (((__obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0)))
+   ? (void) ((h)->next_free = (h)->object_base                          \
+             = (h)->temp.tempint + (char *) (h)->chunk)                 \
+   : (__obstack_free) (h, (h)->temp.tempint + (char *) (h)->chunk)))
 
 #endif /* not __GNUC__ */
 
index eb90990..7208f44 100644 (file)
@@ -26,6 +26,9 @@
 #include <unistd.h>
 #include <stdbool.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 
 #if !HAVE_OPENAT
index 44a9de7..5388ca5 100644 (file)
@@ -110,6 +110,7 @@ recvfd (int sock, int flags)
   struct iovec iov;
   struct msghdr msg;
   int fd = -1;
+  ssize_t len;
 # ifdef CMSG_FIRSTHDR
   struct cmsghdr *cmsg;
   char buf[CMSG_SPACE (sizeof fd)];
@@ -142,16 +143,17 @@ recvfd (int sock, int flags)
   memcpy (CMSG_DATA (cmsg), &fd, sizeof fd);
   msg.msg_controllen = cmsg->cmsg_len;
 
-  if (recvmsg (sock, &msg, flags_recvmsg) < 0)
+  len = recvmsg (sock, &msg, flags_recvmsg);
+  if (len < 0)
     return -1;
 
   cmsg = CMSG_FIRSTHDR (&msg);
   /* be paranoiac */
-  if (cmsg == NULL || cmsg->cmsg_len != CMSG_LEN (sizeof fd)
+  if (len == 0 || cmsg == NULL || cmsg->cmsg_len != CMSG_LEN (sizeof fd)
       || cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS)
     {
       /* fake errno: at end the file is not available */
-      errno = EACCES;
+      errno = len ? EACCES : ENOTCONN;
       return -1;
     }
 
index 1bd5c22..302e582 100644 (file)
@@ -15,6 +15,9 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef PIPE_FILTER_AUX_INLINE
 # define PIPE_FILTER_AUX_INLINE _GL_INLINE
index 3ab194e..aca18e3 100644 (file)
@@ -138,13 +138,13 @@ pipe2 (int fd[2], int flags)
 # if O_BINARY
   if (flags & O_BINARY)
     {
-      setmode (fd[1], O_BINARY);
-      setmode (fd[0], O_BINARY);
+      set_binary_mode (fd[1], O_BINARY);
+      set_binary_mode (fd[0], O_BINARY);
     }
   else if (flags & O_TEXT)
     {
-      setmode (fd[1], O_TEXT);
-      setmode (fd[0], O_TEXT);
+      set_binary_mode (fd[1], O_TEXT);
+      set_binary_mode (fd[0], O_TEXT);
     }
 # endif
 
index 6f62cce..c4fd375 100644 (file)
@@ -17,6 +17,9 @@
 
    Written by David Bartley.  */
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef PRIV_SET_INLINE
 # define PRIV_SET_INLINE _GL_INLINE
index 7fcfb0b..bd8ccfa 100644 (file)
@@ -41,6 +41,9 @@
 #include <sys/types.h>
 #include <time.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_PTHREAD_INLINE
 # define _GL_PTHREAD_INLINE _GL_INLINE
index 40114d7..e280e6e 100644 (file)
@@ -626,7 +626,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
 
       if (! ((backslash_escapes || elide_outer_quotes)
              && quote_these_too
-             && quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))
+             && quote_these_too[c / INT_BITS] >> (c % INT_BITS) & 1)
           && !is_right_quote)
         goto store_c;
 
index 9a3f87d..770b427 100644 (file)
@@ -104,7 +104,7 @@ regex_quote_spec_pcre (int options, bool anchored)
   char *p;
 
   p = result.special;
-  memcpy (p, bre_special, sizeof (pcre_special) - 1);
+  memcpy (p, pcre_special, sizeof (pcre_special) - 1);
   p += sizeof (pcre_special) - 1;
   if (options & PCRE_EXTENDED)
     {
index c92fb1a..0270cbf 100644 (file)
@@ -72,8 +72,9 @@
 #else
 # define lock_define(name)
 # define lock_init(lock) 0
-# define lock_fini(lock) 0
-# define lock_lock(lock) ((void) 0)
+# define lock_fini(lock) ((void) 0)
+  /* The 'dfa' avoids an "unused variable 'dfa'" warning from GCC.  */
+# define lock_lock(lock) ((void) dfa)
 # define lock_unlock(lock) ((void) 0)
 #endif
 
 # define gettext_noop(String) String
 #endif
 
-#if (defined MB_CUR_MAX && HAVE_WCTYPE_H && HAVE_ISWCTYPE && HAVE_WCSCOLL) || _LIBC
+#if (defined MB_CUR_MAX && HAVE_WCTYPE_H && HAVE_ISWCTYPE) || _LIBC
 # define RE_ENABLE_I18N
 #endif
 
index 61912bc..7dedbee 100644 (file)
@@ -23,6 +23,9 @@
 #include <stdbool.h>
 #include <sys/types.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef SAVEWD_INLINE
 # define SAVEWD_INLINE _GL_INLINE
index a692f5a..c3890a2 100644 (file)
@@ -3,6 +3,9 @@
 
 # include <errno.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef SE_CONTEXT_INLINE
 # define SE_CONTEXT_INLINE _GL_INLINE
@@ -29,6 +32,14 @@ SE_CONTEXT_INLINE int context_range_set (context_t sc _GL_UNUSED_PARAMETER,
 SE_CONTEXT_INLINE int context_type_set (context_t sc _GL_UNUSED_PARAMETER,
                                         char const *s _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
+SE_CONTEXT_INLINE char *context_type_get (context_t sc _GL_UNUSED_PARAMETER)
+  { errno = ENOTSUP; return (void *) 0; }
+SE_CONTEXT_INLINE char *context_range_get (context_t sc _GL_UNUSED_PARAMETER)
+  { errno = ENOTSUP; return (void *) 0; }
+SE_CONTEXT_INLINE char *context_role_get (context_t sc _GL_UNUSED_PARAMETER)
+  { errno = ENOTSUP; return (void *) 0; }
+SE_CONTEXT_INLINE char *context_user_get (context_t sc _GL_UNUSED_PARAMETER)
+  { errno = ENOTSUP; return (void *) 0; }
 
 _GL_INLINE_HEADER_END
 
index 7f54f1e..43690c0 100644 (file)
@@ -31,6 +31,9 @@
 #  include <sys/types.h>
 #  include <errno.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #  ifndef SE_SELINUX_INLINE
 #   define SE_SELINUX_INLINE _GL_INLINE
@@ -41,7 +44,7 @@ _GL_INLINE_HEADER_BEGIN
 #  if !GNULIB_defined_security_types
 
 typedef unsigned short security_class_t;
-#   define security_context_t char*
+typedef char *security_context_t;
 #   define is_selinux_enabled() 0
 
 SE_SELINUX_INLINE int
@@ -100,6 +103,9 @@ security_compute_create (security_context_t scon _GL_UNUSED_PARAMETER,
                          security_class_t tclass _GL_UNUSED_PARAMETER,
                          security_context_t *newcon _GL_UNUSED_PARAMETER)
   { errno = ENOTSUP; return -1; }
+SE_SELINUX_INLINE security_class_t
+string_to_security_class (char const *name)
+  { errno = ENOTSUP; return 0; }
 SE_SELINUX_INLINE int
 matchpathcon_init_prefix (char const *path _GL_UNUSED_PARAMETER,
                           char const *prefix _GL_UNUSED_PARAMETER)
@@ -108,6 +114,9 @@ matchpathcon_init_prefix (char const *path _GL_UNUSED_PARAMETER,
 #   define GNULIB_defined_security_types 1
 #  endif
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 
 # endif
index 386763f..1c766fc 100644 (file)
@@ -26,7 +26,6 @@
 #include <errno.h>
 #include <fcntl.h>
 
-#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
 #include "save-cwd.h"
 
 #include "openat-priv.h"
index 9d7d447..6cf583c 100644 (file)
@@ -23,6 +23,9 @@
 
 #include <config.h>
 
+#if HAVE_OPENSSL_SHA1
+# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
+#endif
 #include "sha1.h"
 
 #include <stdalign.h>
@@ -46,6 +49,7 @@
 # error "invalid BLOCKSIZE"
 #endif
 
+#if ! HAVE_OPENSSL_SHA1
 /* This array contains the bytes used to pad the buffer to the next
    64-byte boundary.  (RFC 1321, 3.1: Step 1)  */
 static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ...  */ };
@@ -116,6 +120,7 @@ sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf)
 
   return sha1_read_ctx (ctx, resbuf);
 }
+#endif
 
 /* Compute SHA1 message digest for bytes read from STREAM.  The
    resulting message digest number will be written into the 16 bytes
@@ -190,6 +195,7 @@ sha1_stream (FILE *stream, void *resblock)
   return 0;
 }
 
+#if ! HAVE_OPENSSL_SHA1
 /* Compute SHA1 message digest for LEN bytes beginning at BUFFER.  The
    result is always in little endian byte order, so that a byte-wise
    output yields to the wanted ASCII representation of the message
@@ -424,3 +430,4 @@ sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
       e = ctx->E += e;
     }
 }
+#endif
index 4e9829b..1bed735 100644 (file)
 # include <stdio.h>
 # include <stdint.h>
 
+# if HAVE_OPENSSL_SHA1
+#  include <openssl/sha.h>
+# endif
+
 # ifdef __cplusplus
 extern "C" {
 # endif
 
 #define SHA1_DIGEST_SIZE 20
 
+# if HAVE_OPENSSL_SHA1
+#  define GL_OPENSSL_NAME 1
+#  include "gl_openssl.h"
+# else
 /* Structure to save state of computation between the single steps.  */
 struct sha1_ctx
 {
@@ -42,7 +50,6 @@ struct sha1_ctx
   uint32_t buffer[32];
 };
 
-
 /* Initialize structure containing state of computation. */
 extern void sha1_init_ctx (struct sha1_ctx *ctx);
 
@@ -73,17 +80,19 @@ extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf);
 extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf);
 
 
-/* Compute SHA1 message digest for bytes read from STREAM.  The
-   resulting message digest number will be written into the 20 bytes
-   beginning at RESBLOCK.  */
-extern int sha1_stream (FILE *stream, void *resblock);
-
 /* Compute SHA1 message digest for LEN bytes beginning at BUFFER.  The
    result is always in little endian byte order, so that a byte-wise
    output yields to the wanted ASCII representation of the message
    digest.  */
 extern void *sha1_buffer (const char *buffer, size_t len, void *resblock);
 
+# endif
+/* Compute SHA1 message digest for bytes read from STREAM.  The
+   resulting message digest number will be written into the 20 bytes
+   beginning at RESBLOCK.  */
+extern int sha1_stream (FILE *stream, void *resblock);
+
+
 # ifdef __cplusplus
 }
 # endif
index 4b2cee3..9d6912c 100644 (file)
@@ -22,6 +22,9 @@
 
 #include <config.h>
 
+#if HAVE_OPENSSL_SHA256
+# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
+#endif
 #include "sha256.h"
 
 #include <stdalign.h>
@@ -45,6 +48,7 @@
 # error "invalid BLOCKSIZE"
 #endif
 
+#if ! HAVE_OPENSSL_SHA256
 /* This array contains the bytes used to pad the buffer to the next
    64-byte boundary.  */
 static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ...  */ };
@@ -163,6 +167,7 @@ sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
   sha256_conclude_ctx (ctx);
   return sha224_read_ctx (ctx, resbuf);
 }
+#endif
 
 /* Compute SHA256 message digest for bytes read from STREAM.  The
    resulting message digest number will be written into the 32 bytes
@@ -308,6 +313,7 @@ sha224_stream (FILE *stream, void *resblock)
   return 0;
 }
 
+#if ! HAVE_OPENSSL_SHA256
 /* Compute SHA512 message digest for LEN bytes beginning at BUFFER.  The
    result is always in little endian byte order, so that a byte-wise
    output yields to the wanted ASCII representation of the message
@@ -567,3 +573,4 @@ sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
       h = ctx->state[7] += h;
     }
 }
+#endif
index 7e62522..6ee326b 100644 (file)
 # include <stdio.h>
 # include <stdint.h>
 
+# if HAVE_OPENSSL_SHA256
+#  include <openssl/sha.h>
+# endif
+
 # ifdef __cplusplus
 extern "C" {
 # endif
 
+enum { SHA224_DIGEST_SIZE = 224 / 8 };
+enum { SHA256_DIGEST_SIZE = 256 / 8 };
+
+# if HAVE_OPENSSL_SHA256
+#  define GL_OPENSSL_NAME 224
+#  include "gl_openssl.h"
+#  define GL_OPENSSL_NAME 256
+#  include "gl_openssl.h"
+# else
 /* Structure to save state of computation between the single steps.  */
 struct sha256_ctx
 {
@@ -35,9 +48,6 @@ struct sha256_ctx
   uint32_t buffer[32];
 };
 
-enum { SHA224_DIGEST_SIZE = 224 / 8 };
-enum { SHA256_DIGEST_SIZE = 256 / 8 };
-
 /* Initialize structure containing state of computation. */
 extern void sha256_init_ctx (struct sha256_ctx *ctx);
 extern void sha224_init_ctx (struct sha256_ctx *ctx);
@@ -71,12 +81,6 @@ extern void *sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
 extern void *sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
 
 
-/* Compute SHA256 (SHA224) message digest for bytes read from STREAM.  The
-   resulting message digest number will be written into the 32 (28) bytes
-   beginning at RESBLOCK.  */
-extern int sha256_stream (FILE *stream, void *resblock);
-extern int sha224_stream (FILE *stream, void *resblock);
-
 /* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER.  The
    result is always in little endian byte order, so that a byte-wise
    output yields to the wanted ASCII representation of the message
@@ -84,6 +88,14 @@ extern int sha224_stream (FILE *stream, void *resblock);
 extern void *sha256_buffer (const char *buffer, size_t len, void *resblock);
 extern void *sha224_buffer (const char *buffer, size_t len, void *resblock);
 
+# endif
+/* Compute SHA256 (SHA224) message digest for bytes read from STREAM.  The
+   resulting message digest number will be written into the 32 (28) bytes
+   beginning at RESBLOCK.  */
+extern int sha256_stream (FILE *stream, void *resblock);
+extern int sha224_stream (FILE *stream, void *resblock);
+
+
 # ifdef __cplusplus
 }
 # endif
index 79f1125..8429bb9 100644 (file)
@@ -22,6 +22,9 @@
 
 #include <config.h>
 
+#if HAVE_OPENSSL_SHA512
+# define GL_OPENSSL_INLINE _GL_EXTERN_INLINE
+#endif
 #include "sha512.h"
 
 #include <stdalign.h>
@@ -52,6 +55,7 @@
 # error "invalid BLOCKSIZE"
 #endif
 
+#if ! HAVE_OPENSSL_SHA512
 /* This array contains the bytes used to pad the buffer to the next
    128-byte boundary.  */
 static const unsigned char fillbuf[128] = { 0x80, 0 /* , 0, 0, ...  */ };
@@ -171,6 +175,7 @@ sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
   sha512_conclude_ctx (ctx);
   return sha384_read_ctx (ctx, resbuf);
 }
+#endif
 
 /* Compute SHA512 message digest for bytes read from STREAM.  The
    resulting message digest number will be written into the 64 bytes
@@ -316,6 +321,7 @@ sha384_stream (FILE *stream, void *resblock)
   return 0;
 }
 
+#if ! HAVE_OPENSSL_SHA512
 /* Compute SHA512 message digest for LEN bytes beginning at BUFFER.  The
    result is always in little endian byte order, so that a byte-wise
    output yields to the wanted ASCII representation of the message
@@ -619,3 +625,4 @@ sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
       h = ctx->state[7] = u64plus (ctx->state[7], h);
     }
 }
+#endif
index 2e78a5f..1de93da 100644 (file)
 # define SHA512_H 1
 
 # include <stdio.h>
-
 # include "u64.h"
 
+# if HAVE_OPENSSL_SHA512
+#  include <openssl/sha.h>
+# endif
+
 # ifdef __cplusplus
 extern "C" {
 # endif
 
+enum { SHA384_DIGEST_SIZE = 384 / 8 };
+enum { SHA512_DIGEST_SIZE = 512 / 8 };
+
+# if HAVE_OPENSSL_SHA512
+#  define GL_OPENSSL_NAME 384
+#  include "gl_openssl.h"
+#  define GL_OPENSSL_NAME 512
+#  include "gl_openssl.h"
+# else
 /* Structure to save state of computation between the single steps.  */
 struct sha512_ctx
 {
@@ -36,9 +48,6 @@ struct sha512_ctx
   u64 buffer[32];
 };
 
-enum { SHA384_DIGEST_SIZE = 384 / 8 };
-enum { SHA512_DIGEST_SIZE = 512 / 8 };
-
 /* Initialize structure containing state of computation. */
 extern void sha512_init_ctx (struct sha512_ctx *ctx);
 extern void sha384_init_ctx (struct sha512_ctx *ctx);
@@ -75,12 +84,6 @@ extern void *sha512_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
 extern void *sha384_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
 
 
-/* Compute SHA512 (SHA384) message digest for bytes read from STREAM.  The
-   resulting message digest number will be written into the 64 (48) bytes
-   beginning at RESBLOCK.  */
-extern int sha512_stream (FILE *stream, void *resblock);
-extern int sha384_stream (FILE *stream, void *resblock);
-
 /* Compute SHA512 (SHA384) message digest for LEN bytes beginning at BUFFER.  The
    result is always in little endian byte order, so that a byte-wise
    output yields to the wanted ASCII representation of the message
@@ -88,6 +91,14 @@ extern int sha384_stream (FILE *stream, void *resblock);
 extern void *sha512_buffer (const char *buffer, size_t len, void *resblock);
 extern void *sha384_buffer (const char *buffer, size_t len, void *resblock);
 
+# endif
+/* Compute SHA512 (SHA384) message digest for bytes read from STREAM.  The
+   resulting message digest number will be written into the 64 (48) bytes
+   beginning at RESBLOCK.  */
+extern int sha512_stream (FILE *stream, void *resblock);
+extern int sha384_stream (FILE *stream, void *resblock);
+
+
 # ifdef __cplusplus
 }
 # endif
index ca9f979..67d061d 100644 (file)
@@ -20,6 +20,9 @@
 
 #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
index 5484950..a531487 100644 (file)
@@ -195,6 +195,20 @@ typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
 
 # 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.,
+   <http://lists.gnu.org/archive/html/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.  */
index 2d3b5cd..d58eddd 100644 (file)
@@ -23,6 +23,9 @@
 #include <sys/stat.h>
 #include <time.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_STAT_TIME_INLINE
 # define _GL_STAT_TIME_INLINE _GL_INLINE
index 93d7da3..88632fd 100644 (file)
    are 4 unless the option '-malign-double' is used.
 
    The result cannot be used as a value for an 'enum' constant, if you
-   want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc.  */
+   want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc.
+
+   Include <stddef.h> for offsetof.  */
 #include <stddef.h>
-#if defined __cplusplus
+
+/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
+   standard headers, defines conflicting implementations of _Alignas
+   and _Alignof that are no better than ours; override them.  */
+#undef _Alignas
+#undef _Alignof
+
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+# ifdef __cplusplus
+#  if 201103 <= __cplusplus
+#   define _Alignof(type) alignof (type)
+#  else
    template <class __t> struct __alignof_helper { char __a; __t __b; };
-# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
-#else
-# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
+#   define _Alignof(type) offsetof (__alignof_helper<type>, __b)
+#  endif
+# else
+#  define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
+# endif
 #endif
 #define alignof _Alignof
 #define __alignof_is_defined 1
 
    */
 
-#if __GNUC__ || __IBMC__ || __IBMCPP__ || 0x5110 <= __SUNPRO_C
-# define _Alignas(a) __attribute__ ((__aligned__ (a)))
-#elif 1300 <= _MSC_VER
-# define _Alignas(a) __declspec (align (a))
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+# if defined __cplusplus && 201103 <= __cplusplus
+#  define _Alignas(a) alignas (a)
+# elif __GNUC__ || __IBMC__ || __IBMCPP__ || __ICC || 0x5110 <= __SUNPRO_C
+#  define _Alignas(a) __attribute__ ((__aligned__ (a)))
+# elif 1300 <= _MSC_VER
+#  define _Alignas(a) __declspec (align (a))
+# endif
 #endif
-#ifdef _Alignas
+#if defined _Alignas || (defined __STDC_VERSION && 201112 <= __STDC_VERSION__)
 # define alignas _Alignas
 # define __alignas_is_defined 1
 #endif
index e00600a..45291cf 100644 (file)
@@ -57,7 +57,7 @@
 #  define fp_ fp
 # endif
 
-# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ /* NetBSD >= 1.5ZA, OpenBSD */
+# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Android */
   /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
      and <http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */
   struct __sfileext
index d945d5c..232fd98 100644 (file)
 #define _GL_STDIO_STRINGIZE(token) #token
 #define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
 
+/* 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.,
+   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+   Perhaps Apple will fix this some day.  */
+#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
+     && defined __GNUC__ && defined __STDC__)
+# undef putc_unlocked
+#endif
 
 #if @GNULIB_DPRINTF@
 # if @REPLACE_DPRINTF@
index 3b8f24b..0d086b8 100644 (file)
@@ -48,7 +48,7 @@
      || GNULIB_defined_EOWNERDEAD \
      || GNULIB_defined_ENOTRECOVERABLE \
      || GNULIB_defined_EILSEQ
-extern const char *strerror_override (int errnum);
+extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST;
 # else
 #  define strerror_override(ignored) NULL
 # endif
index c9bd2ad..b4feaf3 100644 (file)
@@ -48,28 +48,31 @@ long long int strtoll (char const *, char **, int);
 #ifdef UNSIGNED
 # define Have_long_long HAVE_UNSIGNED_LONG_LONG_INT
 # define Int uintmax_t
+# define Strtoimax strtoumax
+# define Strtol strtoul
+# define Strtoll strtoull
 # define Unsigned unsigned
-# define strtoimax strtoumax
-# define strtol strtoul
-# define strtoll strtoull
 #else
 # define Have_long_long HAVE_LONG_LONG_INT
 # define Int intmax_t
+# define Strtoimax strtoimax
+# define Strtol strtol
+# define Strtoll strtoll
 # define Unsigned
 #endif
 
 Int
-strtoimax (char const *ptr, char **endptr, int base)
+Strtoimax (char const *ptr, char **endptr, int base)
 {
 #if Have_long_long
   verify (sizeof (Int) == sizeof (Unsigned long int)
           || sizeof (Int) == sizeof (Unsigned long long int));
 
   if (sizeof (Int) != sizeof (Unsigned long int))
-    return strtoll (ptr, endptr, base);
+    return Strtoll (ptr, endptr, base);
 #else
   verify (sizeof (Int) == sizeof (Unsigned long int));
 #endif
 
-  return strtol (ptr, endptr, base);
+  return Strtol (ptr, endptr, base);
 }
index 932fc22..8f64363 100644 (file)
@@ -63,6 +63,9 @@
 #ifndef _@GUARD_PREFIX@_SYS_SOCKET_H
 #define _@GUARD_PREFIX@_SYS_SOCKET_H
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_SYS_SOCKET_INLINE
 # define _GL_SYS_SOCKET_INLINE _GL_INLINE
index 09c9601..90dd02b 100644 (file)
 #endif
 @PRAGMA_COLUMNS@
 
-/* On Cygwin, <sys/time.h> includes itself recursively via <sys/select.h>.
+/* On Cygwin and on many BSDish systems, <sys/time.h> includes itself
+   recursively via <sys/select.h>.
    Simply delegate to the system's header in this case; it is a no-op.
    Without this extra ifdef, the C++ gettimeofday declaration below
    would be a forward declaration in gnulib's nested <sys/time.h>.  */
-#ifdef _CYGWIN_SYS_TIME_H
+#if defined _CYGWIN_SYS_TIME_H || defined _SYS_TIME_H || defined _SYS_TIME_H_
 # @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
 #else
 
index ceea2ee..dab0223 100644 (file)
@@ -187,6 +187,39 @@ _GL_CXXALIASWARN (gmtime_r);
 #  endif
 # endif
 
+/* Convert TIMER to RESULT, assuming local time and UTC respectively.  See
+   <http://www.opengroup.org/susv3xsh/localtime.html> and
+   <http://www.opengroup.org/susv3xsh/gmtime.html>.  */
+# if @GNULIB_GETTIMEOFDAY@
+#  if @REPLACE_LOCALTIME@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef localtime
+#    define localtime rpl_localtime
+#   endif
+_GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
+                                         _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));
+#  endif
+_GL_CXXALIASWARN (localtime);
+# endif
+
+# if @GNULIB_GETTIMEOFDAY@
+#  if @REPLACE_GMTIME@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef gmtime
+#    define gmtime rpl_gmtime
+#   endif
+_GL_FUNCDECL_RPL (gmtime, struct tm *, (time_t const *__timer)
+                                       _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (gmtime, struct tm *, (time_t const *__timer));
+#  else
+_GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer));
+#  endif
+_GL_CXXALIASWARN (gmtime);
+# endif
+
 /* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
    the resulting broken-down time into TM.  See
    <http://www.opengroup.org/susv3xsh/strptime.html>.  */
index 6ce2c73..d628237 100644 (file)
@@ -18,7 +18,7 @@
 /* Written by Paul Eggert.  */
 
 /* Return the sum of two timespec values A and B.  On overflow, return
-   an extremal value.  This assumes 0 <= tv_nsec <= 999999999.  */
+   an extremal value.  This assumes 0 <= tv_nsec < TIMESPEC_RESOLUTION.  */
 
 #include <config.h>
 #include "timespec.h"
 struct timespec
 timespec_add (struct timespec a, struct timespec b)
 {
-  struct timespec r;
   time_t rs = a.tv_sec;
   time_t bs = b.tv_sec;
   int ns = a.tv_nsec + b.tv_nsec;
-  int nsd = ns - 1000000000;
+  int nsd = ns - TIMESPEC_RESOLUTION;
   int rns = ns;
 
   if (0 <= nsd)
@@ -59,13 +58,11 @@ timespec_add (struct timespec a, struct timespec b)
         {
         high_overflow:
           rs = TYPE_MAXIMUM (time_t);
-          rns = 999999999;
+          rns = TIMESPEC_RESOLUTION - 1;
         }
     }
   else
     rs += bs;
 
-  r.tv_sec = rs;
-  r.tv_nsec = rns;
-  return r;
+  return make_timespec (rs, rns);
 }
index 97c9f9d..3f3adea 100644 (file)
@@ -18,8 +18,8 @@
 /* Written by Paul Eggert.  */
 
 /* Return the difference between two timespec values A and B.  On
-   overflow, return an extremal value.  This assumes 0 <= tv_nsec <=
-   999999999.  */
+   overflow, return an extremal value.  This assumes 0 <= tv_nsec <
+   TIMESPEC_RESOLUTION.  */
 
 #include <config.h>
 #include "timespec.h"
@@ -29,7 +29,6 @@
 struct timespec
 timespec_sub (struct timespec a, struct timespec b)
 {
-  struct timespec r;
   time_t rs = a.tv_sec;
   time_t bs = b.tv_sec;
   int ns = a.tv_nsec - b.tv_nsec;
@@ -37,7 +36,7 @@ timespec_sub (struct timespec a, struct timespec b)
 
   if (ns < 0)
     {
-      rns = ns + 1000000000;
+      rns = ns + TIMESPEC_RESOLUTION;
       if (rs == TYPE_MINIMUM (time_t))
         {
           if (bs <= 0)
@@ -59,13 +58,11 @@ timespec_sub (struct timespec a, struct timespec b)
       else
         {
           rs = TYPE_MAXIMUM (time_t);
-          rns = 999999999;
+          rns = TIMESPEC_RESOLUTION - 1;
         }
     }
   else
     rs -= bs;
 
-  r.tv_sec = rs;
-  r.tv_nsec = rns;
-  return r;
+  return make_timespec (rs, rns);
 }
index d665e6c..d0c029b 100644 (file)
 
 # include <time.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_TIMESPEC_INLINE
 # define _GL_TIMESPEC_INLINE _GL_INLINE
 #endif
 
+/* Resolution of timespec time stamps (in units per second), and log
+   base 10 of the resolution.  */
+
+enum { TIMESPEC_RESOLUTION = 1000000000 };
+enum { LOG10_TIMESPEC_RESOLUTION = 9 };
+
+/* Return a timespec with seconds S and nanoseconds NS.  */
+
+_GL_TIMESPEC_INLINE struct timespec
+make_timespec (time_t s, long int ns)
+{
+  struct timespec r;
+  r.tv_sec = s;
+  r.tv_nsec = ns;
+  return r;
+}
+
 /* Return negative, zero, positive if A < B, A == B, A > B, respectively.
 
    For each time stamp T, this code assumes that either:
index e804416..97fc3ff 100644 (file)
@@ -53,7 +53,7 @@
 # define struct_stat64 struct stat64
 #else
 # define struct_stat64 struct stat
-# define __secure_getenv secure_getenv
+# define __libc_secure_getenv secure_getenv
 # define __xstat64(version, path, buf) stat (path, buf)
 #endif
 
@@ -89,6 +89,7 @@ path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
 {
   const char *d;
   size_t dlen, plen;
+  bool add_slash;
 
   if (!pfx || !pfx[0])
     {
@@ -104,7 +105,7 @@ path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
 
   if (try_tmpdir)
     {
-      d = __secure_getenv ("TMPDIR");
+      d = __libc_secure_getenv ("TMPDIR");
       if (d != NULL && direxists (d))
         dir = d;
       else if (dir != NULL && direxists (dir))
@@ -139,16 +140,20 @@ path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
     }
 
   dlen = strlen (dir);
-  while (dlen >= 1 && ISSLASH (dir[dlen - 1]))
-    dlen--;                     /* remove trailing slashes */
+#ifdef __VMS
+  add_slash = 0;
+#else
+  add_slash = dlen != 0 && !ISSLASH (dir[dlen - 1]);
+#endif
 
   /* check we have room for "${dir}/${pfx}XXXXXX\0" */
-  if (tmpl_len < dlen + 1 + plen + 6 + 1)
+  if (tmpl_len < dlen + add_slash + plen + 6 + 1)
     {
       __set_errno (EINVAL);
       return -1;
     }
 
-  sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
+  memcpy (tmpl, dir, dlen);
+  sprintf (tmpl + dlen, &"/%.*sXXXXXX"[!add_slash], (int) plen, pfx);
   return 0;
 }
index d8009ad..af8441f 100644 (file)
--- a/lib/u64.h
+++ b/lib/u64.h
@@ -19,6 +19,9 @@
 
 #include <stdint.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_U64_INLINE
 # define _GL_U64_INLINE _GL_INLINE
index 31e20bc..bd2b099 100644 (file)
 # include <getopt.h>
 #endif
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_UNISTD_INLINE
 # define _GL_UNISTD_INLINE _GL_INLINE
@@ -651,10 +654,19 @@ _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
 #if @GNULIB_GETDTABLESIZE@
 /* Return the maximum number of file descriptors in the current process.
    In POSIX, this is same as sysconf (_SC_OPEN_MAX).  */
-# if !@HAVE_GETDTABLESIZE@
+# if @REPLACE_GETDTABLESIZE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getdtablesize
+#   define getdtablesize rpl_getdtablesize
+#  endif
+_GL_FUNCDECL_RPL (getdtablesize, int, (void));
+_GL_CXXALIAS_RPL (getdtablesize, int, (void));
+# else
+#  if !@HAVE_GETDTABLESIZE@
 _GL_FUNCDECL_SYS (getdtablesize, int, (void));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (getdtablesize, int, (void));
+# endif
 _GL_CXXALIASWARN (getdtablesize);
 #elif defined GNULIB_POSIXCHECK
 # undef getdtablesize
index d760996..e115552 100644 (file)
@@ -114,10 +114,13 @@ parse_with_separator (char const *spec, char const *separator,
   char const *g;
   char *gname = NULL;
   uid_t unum = *uid;
-  gid_t gnum = *gid;
+  gid_t gnum = gid ? *gid : -1;
 
   error_msg = NULL;
-  *username = *groupname = NULL;
+  if (username)
+    *username = NULL;
+  if (groupname)
+    *groupname = NULL;
 
   /* Set U and G to nonzero length strings corresponding to user and
      group specifiers or to NULL.  If U is not NULL, it is a newly
@@ -215,20 +218,29 @@ parse_with_separator (char const *spec, char const *separator,
   if (error_msg == NULL)
     {
       *uid = unum;
-      *gid = gnum;
-      *username = u;
-      *groupname = gname;
-      u = NULL;
+      if (gid)
+        *gid = gnum;
+      if (username)
+        {
+          *username = u;
+          u = NULL;
+        }
+      if (groupname)
+        {
+          *groupname = gname;
+          gname = NULL;
+        }
     }
-  else
-    free (gname);
 
   free (u);
+  free (gname);
   return _(error_msg);
 }
 
 /* Extract from SPEC, which has the form "[user][:.][group]",
    a USERNAME, UID U, GROUPNAME, and GID G.
+   If the GID parameter is NULL the entire SPEC is treated as a user.
+   If the USERNAME and GROUPNAME parameters are NULL they're ignored.
    Either user or group, or both, must be present.
    If the group is omitted but the separator is given,
    use the given user's login group.
@@ -247,11 +259,11 @@ char const *
 parse_user_spec (char const *spec, uid_t *uid, gid_t *gid,
                  char **username, char **groupname)
 {
-  char const *colon = strchr (spec, ':');
+  char const *colon = gid ? strchr (spec, ':') : NULL;
   char const *error_msg =
     parse_with_separator (spec, colon, uid, gid, username, groupname);
 
-  if (!colon && error_msg)
+  if (gid && !colon && error_msg)
     {
       /* If there's no colon but there is a dot, and if looking up the
          whole spec failed (i.e., the spec is not an owner name that
index 013843d..44a33c1 100644 (file)
@@ -90,10 +90,12 @@ validate_timespec (struct timespec timespec[2])
   assert (timespec);
   if ((timespec[0].tv_nsec != UTIME_NOW
        && timespec[0].tv_nsec != UTIME_OMIT
-       && (timespec[0].tv_nsec < 0 || 1000000000 <= timespec[0].tv_nsec))
+       && ! (0 <= timespec[0].tv_nsec
+             && timespec[0].tv_nsec < TIMESPEC_RESOLUTION))
       || (timespec[1].tv_nsec != UTIME_NOW
           && timespec[1].tv_nsec != UTIME_OMIT
-          && (timespec[1].tv_nsec < 0 || 1000000000 <= timespec[1].tv_nsec)))
+          && ! (0 <= timespec[1].tv_nsec
+                && timespec[1].tv_nsec < TIMESPEC_RESOLUTION)))
     {
       errno = EINVAL;
       return -1;
index 82a72a7..f1633c9 100644 (file)
@@ -26,6 +26,9 @@ int lutimens (char const *, struct timespec const [2]);
 # include <fcntl.h>
 # include <sys/stat.h>
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_UTIMENS_INLINE
 # define _GL_UTIMENS_INLINE _GL_INLINE
index 0c52b24..f3a6651 100644 (file)
@@ -93,11 +93,11 @@ rpl_utimensat (int fd, char const *file, struct timespec const times[2],
          values.  */
       else if (times
                && ((times[0].tv_nsec != UTIME_NOW
-                    && (times[0].tv_nsec < 0
-                        || times[0].tv_nsec >= 1000000000))
+                    && ! (0 <= times[0].tv_nsec
+                          && times[0].tv_nsec < TIMESPEC_RESOLUTION))
                    || (times[1].tv_nsec != UTIME_NOW
-                       && (times[1].tv_nsec < 0
-                           || times[1].tv_nsec >= 1000000000))))
+                       && ! (0 <= times[1].tv_nsec
+                             && times[1].tv_nsec < TIMESPEC_RESOLUTION))))
         {
           errno = EINVAL;
           return -1;
index 03492ef..bf40b02 100644 (file)
@@ -18,7 +18,7 @@
 /* Written by Paul Eggert, Bruno Haible, and Jim Meyering.  */
 
 #ifndef _GL_VERIFY_H
-# define _GL_VERIFY_H
+#define _GL_VERIFY_H
 
 
 /* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11.
    Use this only with GCC.  If we were willing to slow 'configure'
    down we could also use it with other compilers, but since this
    affects only the quality of diagnostics, why bother?  */
-# if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
-      && (201112L <= __STDC_VERSION__  || !defined __STRICT_ANSI__) \
-      && !defined __cplusplus)
-#  define _GL_HAVE__STATIC_ASSERT 1
-# endif
+#if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
+     && (201112L <= __STDC_VERSION__  || !defined __STRICT_ANSI__) \
+     && !defined __cplusplus)
+# define _GL_HAVE__STATIC_ASSERT 1
+#endif
 /* The condition (99 < __GNUC__) is temporary, until we know about the
    first G++ release that supports static_assert.  */
-# if (99 < __GNUC__) && defined __cplusplus
-#  define _GL_HAVE_STATIC_ASSERT 1
-# endif
+#if (99 < __GNUC__) && defined __cplusplus
+# define _GL_HAVE_STATIC_ASSERT 1
+#endif
+
+/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
+   system headers, defines a conflicting _Static_assert that is no
+   better than ours; override it.  */
+#ifndef _GL_HAVE_STATIC_ASSERT
+# include <stddef.h>
+# undef _Static_assert
+#endif
 
 /* Each of these macros verifies that its argument R is nonzero.  To
    be portable, R should be an integer constant expression.  Unlike
      Use a template type to work around the problem.  */
 
 /* Concatenate two preprocessor tokens.  */
-# define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
-# define _GL_CONCAT0(x, y) x##y
+#define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+#define _GL_CONCAT0(x, y) x##y
 
 /* _GL_COUNTER is an integer, preferably one that changes each time we
    use it.  Use __COUNTER__ if it works, falling back on __LINE__
    otherwise.  __LINE__ isn't perfect, but it's better than a
    constant.  */
-# if defined __COUNTER__ && __COUNTER__ != __COUNTER__
-#  define _GL_COUNTER __COUNTER__
-# else
-#  define _GL_COUNTER __LINE__
-# endif
+#if defined __COUNTER__ && __COUNTER__ != __COUNTER__
+# define _GL_COUNTER __COUNTER__
+#else
+# define _GL_COUNTER __LINE__
+#endif
 
 /* Generate a symbol with the given prefix, making it unique if
    possible.  */
-# define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
+#define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
 
 /* Verify requirement R at compile-time, as an integer constant expression
    that returns 1.  If R is false, fail at compile-time, preferably
    with a diagnostic that includes the string-literal DIAGNOSTIC.  */
 
-# define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \
-    (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
+#define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \
+   (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
 
-# ifdef __cplusplus
-#  if !GNULIB_defined_struct__gl_verify_type
+#ifdef __cplusplus
+# if !GNULIB_defined_struct__gl_verify_type
 template <int w>
   struct _gl_verify_type {
     unsigned int _gl_verify_error_if_negative: w;
   };
-#   define GNULIB_defined_struct__gl_verify_type 1
-#  endif
-#  define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
-    _gl_verify_type<(R) ? 1 : -1>
-# elif defined _GL_HAVE__STATIC_ASSERT
-#  define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
-     struct {                                   \
-       _Static_assert (R, DIAGNOSTIC);          \
-       int _gl_dummy;                          \
-     }
-# else
-#  define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
-     struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; }
+#  define GNULIB_defined_struct__gl_verify_type 1
 # endif
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+    _gl_verify_type<(R) ? 1 : -1>
+#elif defined _GL_HAVE__STATIC_ASSERT
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+    struct {                                   \
+      _Static_assert (R, DIAGNOSTIC);          \
+      int _gl_dummy;                          \
+    }
+#else
+# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+    struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; }
+#endif
 
 /* Verify requirement R at compile-time, as a declaration without a
    trailing ';'.  If R is false, fail at compile-time, preferably
@@ -195,23 +203,23 @@ template <int w>
    Unfortunately, unlike C11, this implementation must appear as an
    ordinary declaration, and cannot appear inside struct { ... }.  */
 
-# ifdef _GL_HAVE__STATIC_ASSERT
-#  define _GL_VERIFY _Static_assert
-# else
-#  define _GL_VERIFY(R, DIAGNOSTIC)                                   \
-     extern int (*_GL_GENSYM (_gl_verify_function) (void))            \
-       [_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
-# endif
+#ifdef _GL_HAVE__STATIC_ASSERT
+# define _GL_VERIFY _Static_assert
+#else
+# define _GL_VERIFY(R, DIAGNOSTIC)                                    \
+    extern int (*_GL_GENSYM (_gl_verify_function) (void))             \
+      [_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
+#endif
 
 /* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h.  */
-# ifdef _GL_STATIC_ASSERT_H
-#  if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert
-#   define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
-#  endif
-#  if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
-#   define static_assert _Static_assert /* C11 requires this #define.  */
-#  endif
+#ifdef _GL_STATIC_ASSERT_H
+# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert
+#  define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
 # endif
+# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
+#  define static_assert _Static_assert /* C11 requires this #define.  */
+# endif
+#endif
 
 /* @assert.h omit start@  */
 
@@ -229,18 +237,42 @@ template <int w>
 
    verify_true is obsolescent; please use verify_expr instead.  */
 
-# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
+#define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
 
 /* Verify requirement R at compile-time.  Return the value of the
    expression E.  */
 
-# define verify_expr(R, E) \
-    (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
+#define verify_expr(R, E) \
+   (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
 
 /* Verify requirement R at compile-time, as a declaration without a
    trailing ';'.  */
 
-# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+#define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+
+#ifndef __has_builtin
+# define __has_builtin(x) 0
+#endif
+
+/* Assume that R always holds.  This lets the compiler optimize
+   accordingly.  R should not have side-effects; it may or may not be
+   evaluated.  Behavior is undefined if R is false.  */
+
+#if (__has_builtin (__builtin_unreachable) \
+     || 4 < __GNUC__ + (5 <= __GNUC_MINOR__))
+# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
+#elif 1200 <= _MSC_VER
+# define assume(R) __assume (R)
+#elif (defined lint \
+       && (__has_builtin (__builtin_trap) \
+           || 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))))
+  /* Doing it this way helps various packages when configured with
+     --enable-gcc-warnings, which compiles with -Dlint.  It's nicer
+     when 'assume' silences warnings even with older GCCs.  */
+# define assume(R) ((R) ? (void) 0 : __builtin_trap ())
+#else
+# define assume(R) ((void) (0 && (R)))
+#endif
 
 /* @assert.h omit end@  */
 
index 933d622..d11b833 100644 (file)
@@ -61,6 +61,9 @@
 #ifndef _@GUARD_PREFIX@_WCTYPE_H
 #define _@GUARD_PREFIX@_WCTYPE_H
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef _GL_WCTYPE_INLINE
 # define _GL_WCTYPE_INLINE _GL_INLINE
index da7c4b6..6c9b53b 100644 (file)
@@ -22,6 +22,9 @@
 
 #include "xalloc-oversized.h"
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef XALLOC_INLINE
 # define XALLOC_INLINE _GL_INLINE
index c7acbd1..be11c1c 100644 (file)
@@ -1,4 +1,4 @@
-/* a wrapper for frepoen
+/* a wrapper for freopen
    Copyright (C) 2008-2013 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
index aabc5a5..4111e0c 100644 (file)
@@ -27,6 +27,9 @@
 # include <stdint.h>
 #endif
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef XSIZE_INLINE
 # define XSIZE_INLINE _GL_INLINE
index c38e9dc..4eb55ba 100644 (file)
@@ -20,6 +20,9 @@
 #ifndef XTIME_H_
 #define XTIME_H_ 1
 
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
 _GL_INLINE_HEADER_BEGIN
 #ifndef XTIME_INLINE
 # define XTIME_INLINE _GL_INLINE
index 5b1fb65..24b6e49 100644 (file)
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,5 +1,5 @@
 # acl.m4 - check for access control list (ACL) primitives
-# serial 15
+# serial 16
 
 # Copyright (C) 2002, 2004-2013 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -141,12 +141,14 @@ int type = ACL_TYPE_EXTENDED;]])],
 # -------------------------------------
 # If 'acl_get_file' works (does not have a particular bug),
 # run IF-WORKS, otherwise, IF-NOT.
-# This tests for a Darwin 8.7.0 bug, whereby acl_get_file returns NULL,
-# but sets errno = ENOENT for an existing file or directory.
+# When building natively, test for a Darwin 8.7.0 bug, whereby acl_get_file
+# returns NULL, but sets errno = ENOENT for an existing file or directory.
+# When cross-compiling, assume that this old bug no longer applies.
 AC_DEFUN([gl_ACL_GET_FILE],
 [
   AC_CACHE_CHECK([for working acl_get_file], [gl_cv_func_working_acl_get_file],
-    [AC_RUN_IFELSE(
+    [gl_cv_func_working_acl_get_file=no
+     AC_LINK_IFELSE(
        [AC_LANG_PROGRAM(
           [[#include <sys/types.h>
            #include <sys/acl.h>
@@ -156,9 +158,10 @@ AC_DEFUN([gl_ACL_GET_FILE],
               return 1;
             return 0;
           ]])],
-       [gl_cv_func_working_acl_get_file=yes],
-       [gl_cv_func_working_acl_get_file=no],
-       [gl_cv_func_working_acl_get_file=cross-compiling])])
-
-  AS_IF([test $gl_cv_func_working_acl_get_file = yes], [$1], [$2])
+       [if test $cross_compiling = yes; then
+          gl_cv_func_working_acl_get_file="guessing yes"
+        elif ./conftest$ac_exeext; then
+          gl_cv_func_working_acl_get_file=yes
+        fi])])
+  AS_IF([test "$gl_cv_func_working_acl_get_file" != no], [$1], [$2])
 ])
index 823ffc0..330f98d 100644 (file)
@@ -1,4 +1,4 @@
-# configmake.m4 serial 1
+# configmake.m4 serial 2
 dnl Copyright (C) 2010-2013 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,8 +7,9 @@ dnl with or without modifications, as long as this notice is preserved.
 # gl_CONFIGMAKE_PREP
 # ------------------
 # Guarantee all of the standard directory variables, even when used with
-# autoconf 2.59 (datarootdir wasn't supported until 2.59c) or automake
-# 1.9.6 (pkglibexecdir wasn't supported until 1.10b.).
+# autoconf 2.59 (datarootdir wasn't supported until 2.59c, and runstatedir
+# in 2.70) or automake 1.9.6 (pkglibexecdir wasn't supported until 1.10b,
+# and runstatedir in 1.14.1).
 AC_DEFUN([gl_CONFIGMAKE_PREP],
 [
   dnl Technically, datadir should default to datarootdir.  But if
@@ -43,6 +44,10 @@ AC_DEFUN([gl_CONFIGMAKE_PREP],
   if test "x$localedir" = x; then
     AC_SUBST([localedir], ['${datarootdir}/locale'])
   fi
+  dnl Added in autoconf 2.70
+  if test "x$runstatedir" = x; then
+    AC_SUBST([runstatedir], ['${localstatedir}/run'])
+  fi
 
   dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
   dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
diff --git a/m4/count-trailing-zeros.m4 b/m4/count-trailing-zeros.m4
new file mode 100644 (file)
index 0000000..b4a13c1
--- /dev/null
@@ -0,0 +1,12 @@
+# count-trailing-zeros.m4
+dnl Copyright (C) 2013 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_COUNT_TRAILING_ZEROS],
+[
+  dnl We don't need (and can't compile) count_trailing_zeros_ll
+  dnl unless the type 'unsigned long long int' exists.
+  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+])
index aab82c2..d093b3f 100644 (file)
@@ -1,4 +1,4 @@
-# serial 13
+# serial 14
 
 dnl From Jim Meyering.
 dnl
@@ -30,7 +30,7 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
              e = readdir (dp);
              if (! e)
                return 2;
-             if (stat (e->d_name, &st) != 0)
+             if (lstat (e->d_name, &st) != 0)
                return 3;
              if (e->d_ino != st.st_ino)
                return 4;
index 269cfdc..dc3070c 100644 (file)
@@ -1,4 +1,4 @@
-#serial 19
+#serial 20
 dnl Copyright (C) 2002, 2005, 2007, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -39,9 +39,11 @@ AC_DEFUN([gl_FUNC_DUP2],
             /* Many gnulib modules require POSIX conformance of EBADF.  */
             if (dup2 (2, 1000000) == -1 && errno != EBADF)
               result |= 16;
-            /* Flush out a cygwin core dump.  */
+            /* Flush out some cygwin core dumps.  */
             if (dup2 (2, -1) != -1 || errno != EBADF)
               result |= 32;
+            dup2 (2, 255);
+            dup2 (2, 256);
             return result;
            ])
         ],
@@ -65,6 +67,7 @@ AC_DEFUN([gl_FUNC_DUP2],
       *yes) ;;
       *)
         REPLACE_DUP2=1
+        AC_CHECK_FUNCS([setdtablesize])
         ;;
     esac
   fi
index 706d726..23b6bb1 100644 (file)
@@ -1,4 +1,4 @@
-# dup3.m4 serial 4
+# dup3.m4 serial 5
 dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,7 @@ AC_DEFUN([gl_FUNC_DUP3],
   dnl Persuade glibc <unistd.h> to declare dup3().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_CHECK_FUNCS_ONCE([dup3])
+  AC_CHECK_FUNCS_ONCE([dup3 setdtablesize])
   if test $ac_cv_func_dup3 != yes; then
     HAVE_DUP3=0
   fi
index 94b46dd..9f93c29 100644 (file)
@@ -8,15 +8,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_EXTERN_INLINE],
 [
   AH_VERBATIM([extern_inline],
-[/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
-   _GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
-   _GL_INLINE_HEADER_BEGIN contains useful stuff to put
-     in an include file, before uses of _GL_INLINE.
-     It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic,
-     when FOO is an inline function in the header; see
-     <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
-   _GL_INLINE_HEADER_END contains useful stuff to put
-     in the same include file, after uses of _GL_INLINE.
+[/* Please see the Gnulib manual for how to use these macros.
 
    Suppress extern inline with HP-UX cc, as it appears to be broken; see
    <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
@@ -27,26 +19,41 @@ AC_DEFUN([gl_EXTERN_INLINE],
    'reference to static identifier "f" in extern inline function'.
    This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
 
-   Suppress the use of extern inline on Apple's platforms, as Libc at least
-   through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
+   Suppress the use of extern inline on problematic Apple configurations.
+   OS X 10.8 and earlier mishandle it; see, e.g.,
    <http://lists.gnu.org/archive/html/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 <http://trac.macports.org/ticket/41033>.
    Perhaps Apple will fix this some day.  */
+#if (defined __APPLE__ \
+     && (defined __header_inline \
+         ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
+            && ! defined __clang__) \
+         : ((! defined _DONT_USE_CTYPE_INLINE_ \
+             && (defined __GNUC__ || defined __cplusplus)) \
+            || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
+                && defined __GNUC__ && ! defined __cplusplus))))
+# define _GL_EXTERN_INLINE_APPLE_BUG
+#endif
 #if ((__GNUC__ \
       ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
       : (199901L <= __STDC_VERSION__ \
          && !defined __HP_cc \
          && !(defined __SUNPRO_C && __STDC__))) \
-     && !defined __APPLE__)
+     && !defined _GL_EXTERN_INLINE_APPLE_BUG)
 # define _GL_INLINE inline
 # define _GL_EXTERN_INLINE extern inline
-#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__
-# if __GNUC_GNU_INLINE__
+# define _GL_EXTERN_INLINE_IN_USE
+#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
+       && !defined _GL_EXTERN_INLINE_APPLE_BUG)
+# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
    /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
 #  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
 # else
 #  define _GL_INLINE extern inline
 # endif
 # define _GL_EXTERN_INLINE extern
+# define _GL_EXTERN_INLINE_IN_USE
 #else
 # define _GL_INLINE static _GL_UNUSED
 # define _GL_EXTERN_INLINE static _GL_UNUSED
@@ -59,6 +66,10 @@ AC_DEFUN([gl_EXTERN_INLINE],
 #  define _GL_INLINE_HEADER_CONST_PRAGMA \
      _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
 # endif
+  /* Suppress GCC's bogus "no previous prototype for 'FOO'"
+     and "no previous declaration for 'FOO'"  diagnostics,
+     when FOO is an inline function in the header; see
+     <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.  */
 # define _GL_INLINE_HEADER_BEGIN \
     _Pragma ("GCC diagnostic push") \
     _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
index 2cc2e12..b306b6d 100644 (file)
@@ -1,4 +1,4 @@
-# fclose.m4 serial 5
+# fclose.m4 serial 6
 dnl Copyright (C) 2008-2013 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,7 +9,7 @@ AC_DEFUN([gl_FUNC_FCLOSE],
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
 
   gl_FUNC_FFLUSH_STDIN
-  if test $gl_cv_func_fflush_stdin = no; then
+  if test $gl_cv_func_fflush_stdin != yes; then
     REPLACE_FCLOSE=1
   fi
 
index 6df5173..c16b314 100644 (file)
@@ -1,4 +1,4 @@
-# fflush.m4 serial 14
+# fflush.m4 serial 15
 
 # Copyright (C) 2007-2013 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_FFLUSH],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   gl_FUNC_FFLUSH_STDIN
-  if test $gl_cv_func_fflush_stdin = no; then
+  if test $gl_cv_func_fflush_stdin != yes; then
     REPLACE_FFLUSH=1
   fi
 ])
@@ -72,10 +72,17 @@ AC_DEFUN([gl_FUNC_FFLUSH_STDIN],
            return 7;
          return 0;
        ]])], [gl_cv_func_fflush_stdin=yes], [gl_cv_func_fflush_stdin=no],
-     [dnl Pessimistically assume fflush is broken.
-      gl_cv_func_fflush_stdin=no])
+     [gl_cv_func_fflush_stdin=cross])
      rm conftest.txt
     ])
+  case $gl_cv_func_fflush_stdin in
+    yes) gl_func_fflush_stdin=1 ;;
+    no)  gl_func_fflush_stdin=0 ;;
+    *)   gl_func_fflush_stdin='(-1)' ;;
+  esac
+  AC_DEFINE_UNQUOTED([FUNC_FFLUSH_STDIN], [$gl_func_fflush_stdin],
+    [Define to 1 if fflush is known to work on stdin as per POSIX.1-2008,
+     0 if fflush is known to not work, -1 if unknown.])
 ])
 
 # Prerequisites of lib/fflush.c.
index 8f58562..669105b 100644 (file)
@@ -1,4 +1,4 @@
-# serial 19
+# serial 21
 
 # Copyright (C) 2000-2001, 2004-2013 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -16,14 +16,23 @@ dnl we have to grub around in the FILE struct.
 AC_DEFUN([gl_FUNC_FPENDING],
 [
   AC_CHECK_HEADERS_ONCE([stdio_ext.h])
-  AC_CHECK_FUNCS_ONCE([__fpending])
   fp_headers='
-#     include <stdio.h>
-#     if HAVE_STDIO_EXT_H
-#      include <stdio_ext.h>
-#     endif
-'
-  AC_CHECK_DECLS([__fpending], , , $fp_headers)
+    #include <stdio.h>
+    #if HAVE_STDIO_EXT_H
+    # include <stdio_ext.h>
+    #endif
+  '
+  AC_CACHE_CHECK([for __fpending], [gl_cv_func___fpending],
+    [
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM([$fp_headers],
+           [[return ! __fpending (stdin);]])],
+        [gl_cv_func___fpending=yes],
+        [gl_cv_func___fpending=no])
+    ])
+  if test $gl_cv_func___fpending = yes; then
+    AC_CHECK_DECLS([__fpending], [], [], [$fp_headers])
+  fi
 ])
 
 AC_DEFUN([gl_PREREQ_FPENDING],
index e0f2dfb..ca9da28 100644 (file)
@@ -1,4 +1,4 @@
-# fseeko.m4 serial 16
+# fseeko.m4 serial 17
 dnl Copyright (C) 2007-2013 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,7 +37,7 @@ AC_DEFUN([gl_FUNC_FSEEKO],
     fi
     m4_ifdef([gl_FUNC_FFLUSH_STDIN], [
       gl_FUNC_FFLUSH_STDIN
-      if test $gl_cv_func_fflush_stdin = no; then
+      if test $gl_cv_func_fflush_stdin != yes; then
         REPLACE_FSEEKO=1
       fi
     ])
diff --git a/m4/gc-hmac-sha256.m4 b/m4/gc-hmac-sha256.m4
new file mode 100644 (file)
index 0000000..574af42
--- /dev/null
@@ -0,0 +1,14 @@
+# gc-hmac-sha256.m4 serial 3
+dnl Copyright (C) 2005, 2007, 2009-2013 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_GC_HMAC_SHA256],
+[
+  AC_REQUIRE([gl_GC])
+  if test "$ac_cv_libgcrypt" != yes; then
+    gl_SHA256
+    gl_MEMXOR
+  fi
+])
diff --git a/m4/gc-hmac-sha512.m4 b/m4/gc-hmac-sha512.m4
new file mode 100644 (file)
index 0000000..e213358
--- /dev/null
@@ -0,0 +1,14 @@
+# gc-hmac-sha512.m4 serial 3
+dnl Copyright (C) 2005, 2007, 2009-2013 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_GC_HMAC_SHA512],
+[
+  AC_REQUIRE([gl_GC])
+  if test "$ac_cv_libgcrypt" != yes; then
+    gl_SHA512
+    gl_MEMXOR
+  fi
+])
diff --git a/m4/gc-sha256.m4 b/m4/gc-sha256.m4
new file mode 100644 (file)
index 0000000..ab98bfb
--- /dev/null
@@ -0,0 +1,10 @@
+# gc-sha256.m4 serial 1
+dnl Copyright (C) 2005, 2007, 2009-2013 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_GC_SHA256],
+[
+  AC_REQUIRE([gl_GC])
+])
diff --git a/m4/gc-sha512.m4 b/m4/gc-sha512.m4
new file mode 100644 (file)
index 0000000..33f76f4
--- /dev/null
@@ -0,0 +1,10 @@
+# gc-sha512.m4 serial 1
+dnl Copyright (C) 2005, 2007, 2009-2013 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_GC_SHA512],
+[
+  AC_REQUIRE([gl_GC])
+])
index b352e33..66736b8 100644 (file)
--- a/m4/gc.m4
+++ b/m4/gc.m4
@@ -6,6 +6,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_GC],
 [
+  AC_SUBST([LIB_CRYPTO])
   AC_ARG_WITH([libgcrypt],
     AS_HELP_STRING([--with-libgcrypt], [use libgcrypt for low-level crypto]),
     libgcrypt=$withval, libgcrypt=no)
index 9b3b563..544b037 100644 (file)
@@ -27,6 +27,7 @@ AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG],
      AC_RUN_IFELSE(
        [AC_LANG_SOURCE(
           [[
+#include <errno.h>
 #include <stdlib.h>
 #if HAVE_UNISTD_H
 # include <unistd.h>
index 8f04b3b..b3fa1af 100644 (file)
@@ -1,4 +1,4 @@
-# getdtablesize.m4 serial 4
+# getdtablesize.m4 serial 5
 dnl Copyright (C) 2008-2013 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,8 +7,35 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_GETDTABLESIZE],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST])
   AC_CHECK_FUNCS_ONCE([getdtablesize])
-  if test $ac_cv_func_getdtablesize != yes; then
+  if test $ac_cv_func_getdtablesize = yes; then
+    # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit
+    # up to an unchangeable hard limit; all other platforms correctly
+    # require setrlimit before getdtablesize() can report a larger value.
+    AC_CACHE_CHECK([whether getdtablesize works],
+      [gl_cv_func_getdtablesize_works],
+      [AC_RUN_IFELSE([
+        AC_LANG_PROGRAM([[#include <unistd.h>]],
+          [int size = getdtablesize();
+           if (dup2 (0, getdtablesize()) != -1)
+             return 1;
+           if (size != getdtablesize())
+             return 2;
+          ])],
+        [gl_cv_func_getdtablesize_works=yes],
+        [gl_cv_func_getdtablesize_works=no],
+        [case "$host_os" in
+          cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
+            gl_cv_func_getdtablesize_works="guessing no" ;;
+          *) gl_cv_func_getdtablesize_works="guessing yes" ;;
+         esac])
+      ])
+    case "$gl_cv_func_getdtablesize_works" in
+      *yes) ;;
+      *) REPLACE_GETDTABLESIZE=1 ;;
+    esac
+  else
     HAVE_GETDTABLESIZE=0
   fi
 ])
index 3c05e59..f48ef43 100644 (file)
@@ -1,4 +1,4 @@
-# serial 20
+# serial 21
 
 # Copyright (C) 2001-2003, 2005, 2007, 2009-2013 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -127,10 +127,8 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
 ])
 
 AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
-  AC_DEFINE([gmtime], [rpl_gmtime],
-    [Define to rpl_gmtime if the replacement function should be used.])
-  AC_DEFINE([localtime], [rpl_localtime],
-    [Define to rpl_localtime if the replacement function should be used.])
+  REPLACE_GMTIME=1
+  REPLACE_LOCALTIME=1
 ])
 
 # Prerequisites of lib/gettimeofday.c.
diff --git a/m4/gl-openssl.m4 b/m4/gl-openssl.m4
new file mode 100644 (file)
index 0000000..0434c4c
--- /dev/null
@@ -0,0 +1,51 @@
+# gl-openssl.m4 serial 3
+dnl Copyright (C) 2013 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_SET_CRYPTO_CHECK_DEFAULT],
+[
+  m4_define([gl_CRYPTO_CHECK_DEFAULT], [$1])
+])
+gl_SET_CRYPTO_CHECK_DEFAULT([no])
+
+AC_DEFUN([gl_CRYPTO_CHECK],
+[
+  dnl gnulib users set this before gl_INIT with gl_SET_CRYPTO_CHECK_DEFAULT()
+  m4_divert_once([DEFAULTS], [with_openssl_default='gl_CRYPTO_CHECK_DEFAULT'])
+
+  dnl Only clear once, so crypto routines can be checked for individually
+  m4_divert_once([DEFAULTS], [LIB_CRYPTO=])
+
+  AC_ARG_WITH([openssl],
+    [AS_HELP_STRING([--with-openssl],
+      [use libcrypto hash routines. Valid ARGs are:
+       'yes', 'no', 'auto' => use if available,
+       'optional' => use if available and warn if not available;
+       default is ']gl_CRYPTO_CHECK_DEFAULT['])],
+    [],
+    [with_openssl=$with_openssl_default])
+
+  if test "x$1" = xMD5; then
+    ALG_header=md5.h
+  else
+    ALG_header=sha.h
+  fi
+
+  AC_SUBST([LIB_CRYPTO])
+  if test "x$with_openssl" != xno; then
+    AC_CHECK_LIB([crypto], [$1],
+      [AC_CHECK_HEADERS([openssl/$ALG_header],
+         [LIB_CRYPTO=-lcrypto
+          AC_DEFINE([HAVE_OPENSSL_$1], [1],
+            [Define to 1 if libcrypto is used for $1.])])])
+    if test "x$LIB_CRYPTO" = x; then
+      if test "x$with_openssl" = xyes; then
+        AC_MSG_ERROR([openssl development library not found for $1])
+      elif test "x$with_openssl" = xoptional; then
+        AC_MSG_WARN([openssl development library not found for $1])
+      fi
+    fi
+  fi
+])
index 108d945..f09dbe6 100644 (file)
@@ -192,56 +192,9 @@ dnl until we can assume autoconf 2.64 or newer.
              if test AS_VAR_GET(gl_header_exists) = yes; then
              AS_VAR_POPDEF([gl_header_exists])
             ])
-               AC_LANG_CONFTEST(
-                 [AC_LANG_SOURCE(
-                    [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
-                  )])
-               dnl AIX "xlc -E" and "cc -E" omit #line directives for header
-               dnl files that contain only a #include of other header files and
-               dnl no non-comment tokens of their own. This leads to a failure
-               dnl to detect the absolute name of <dirent.h>, <signal.h>,
-               dnl <poll.h> and others. The workaround is to force preservation
-               dnl of comments through option -C. This ensures all necessary
-               dnl #line directives are present. GCC supports option -C as well.
-               case "$host_os" in
-                 aix*) gl_absname_cpp="$ac_cpp -C" ;;
-                 *)    gl_absname_cpp="$ac_cpp" ;;
-               esac
-changequote(,)
-               case "$host_os" in
-                 mingw*)
-                   dnl For the sake of native Windows compilers (excluding gcc),
-                   dnl treat backslash as a directory separator, like /.
-                   dnl Actually, these compilers use a double-backslash as
-                   dnl directory separator, inside the
-                   dnl   # line "filename"
-                   dnl directives.
-                   gl_dirsep_regex='[/\\]'
-                   ;;
-                 *)
-                   gl_dirsep_regex='\/'
-                   ;;
-               esac
-               dnl A sed expression that turns a string into a basic regular
-               dnl expression, for use within "/.../".
-               gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-changequote([,])
-               gl_header_literal_regex=`echo ']m4_defn([gl_HEADER_NAME])[' \
-                                        | sed -e "$gl_make_literal_regex_sed"`
-               gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-                   s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-changequote(,)dnl
-                   s|^/[^/]|//&|
-changequote([,])dnl
-                   p
-                   q
-                 }'
-               dnl eval is necessary to expand gl_absname_cpp.
-               dnl Ultrix and Pyramid sh refuse to redirect output of eval,
-               dnl so use subshell.
-               AS_VAR_SET(gl_next_header,
-                 ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
-                      sed -n "$gl_absolute_header_sed"`'"'])
+           gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME)
+           AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME))
+           AS_VAR_SET(gl_next_header, ['"'$gl_header'"'])
           m4_if([$2], [check],
             [else
                AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
index 486b5cc..dffcd88 100644 (file)
@@ -1,4 +1,4 @@
-# intl.m4 serial 22 (gettext-0.18.2)
+# intl.m4 serial 24 (gettext-0.18.3)
 dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -61,15 +61,13 @@ AC_DEFUN([AM_INTL_SUBDIR],
 
   dnl Use the _snprintf function only if it is declared (because on NetBSD it
   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
-  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
-  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
+  AC_CHECK_DECLS([_snprintf, _snwprintf], , , [#include <stdio.h>])
 
   dnl Use the *_unlocked functions only if they are declared.
   dnl (because some of them were defined without being declared in Solaris
   dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
   dnl on Solaris 2.5.1 to run on Solaris 2.6).
-  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
-  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
+  AC_CHECK_DECLS([getc_unlocked], , , [#include <stdio.h>])
 
   case $gt_cv_func_printf_posix in
     *yes) HAVE_POSIX_PRINTF=1 ;;
@@ -236,9 +234,7 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
   dnl (because some of them were defined without being declared in Solaris
   dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
   dnl on Solaris 2.5.1 to run on Solaris 2.6).
-  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
-  gt_CHECK_DECL([feof_unlocked], [#include <stdio.h>])
-  gt_CHECK_DECL([fgets_unlocked], [#include <stdio.h>])
+  AC_CHECK_DECLS([feof_unlocked, fgets_unlocked], , , [#include <stdio.h>])
 
   AM_ICONV
 
@@ -273,28 +269,3 @@ changequote([,])dnl
     INTLBISON=:
   fi
 ])
-
-
-dnl gt_CHECK_DECL(FUNC, INCLUDES)
-dnl Check whether a function is declared.
-AC_DEFUN([gt_CHECK_DECL],
-[
-  AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1],
-    [AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-          [[$2]],
-          [[
-#ifndef $1
-  char *p = (char *) $1;
-#endif
-          ]])],
-       [ac_cv_have_decl_$1=yes],
-       [ac_cv_have_decl_$1=no])])
-  if test $ac_cv_have_decl_$1 = yes; then
-    gt_value=1
-  else
-    gt_value=0
-  fi
-  AC_DEFINE_UNQUOTED([HAVE_DECL_]m4_translit($1, [a-z], [A-Z]), [$gt_value],
-    [Define to 1 if you have the declaration of '$1', and to 0 if you don't.])
-])
index 3b483d3..b06c777 100644 (file)
@@ -148,6 +148,7 @@ AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
   HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
   HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
   REPLACE_STRTOIMAX=0;   AC_SUBST([REPLACE_STRTOIMAX])
+  REPLACE_STRTOUMAX=0;   AC_SUBST([REPLACE_STRTOUMAX])
   INT32_MAX_LT_INTMAX_MAX=1;  AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
   INT64_MAX_EQ_LONG_MAX='defined _LP64';  AC_SUBST([INT64_MAX_EQ_LONG_MAX])
   PRI_MACROS_BROKEN=0;   AC_SUBST([PRI_MACROS_BROKEN])
index be6d4c9..80b2476 100644 (file)
@@ -1,4 +1,4 @@
-# manywarnings.m4 serial 5
+# manywarnings.m4 serial 6
 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -204,6 +204,8 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wvla \
     -Wvolatile-register-var \
     -Wwrite-strings \
+    -fdiagnostics-show-option \
+    -funit-at-a-time \
     \
     ; do
     gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
index 0ad6f50..541a26b 100644 (file)
--- a/m4/md5.m4
+++ b/m4/md5.m4
@@ -1,4 +1,4 @@
-# md5.m4 serial 13
+# md5.m4 serial 14
 dnl Copyright (C) 2002-2006, 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,5 +8,7 @@ AC_DEFUN([gl_MD5],
 [
   dnl Prerequisites of lib/md5.c.
   AC_REQUIRE([gl_BIGENDIAN])
-  :
+
+  dnl Determine HAVE_OPENSSL_MD5 and LIB_CRYPTO
+  gl_CRYPTO_CHECK([MD5])
 ])
index f395723..1c70b6c 100644 (file)
--- a/m4/po.m4
+++ b/m4/po.m4
@@ -1,4 +1,4 @@
-# po.m4 serial 20 (gettext-0.18.2)
+# po.m4 serial 21 (gettext-0.18.3)
 dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -25,6 +25,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
   AC_REQUIRE([AC_PROG_INSTALL])dnl
   AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+  AC_REQUIRE([AC_PROG_SED])dnl
   AC_REQUIRE([AM_NLS])dnl
 
   dnl Release version of the gettext macros. This is used to ensure that
index f889831..7184d23 100644 (file)
--- a/m4/pty.m4
+++ b/m4/pty.m4
@@ -1,4 +1,4 @@
-# pty.m4 serial 12
+# pty.m4 serial 13
 dnl Copyright (C) 2010-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -72,6 +72,8 @@ AC_DEFUN([gl_FUNC_FORKPTY],
     dnl The system does not have forkpty.
     HAVE_FORKPTY=0
   fi
+  AC_DEFINE_UNQUOTED([HAVE_FORKPTY], [$HAVE_FORKPTY],
+    [Define to 1 if the system has the 'forkpty' function.])
 ])
 
 AC_DEFUN([gl_FUNC_OPENPTY],
index 6d29dcf..795d720 100644 (file)
@@ -1,4 +1,4 @@
-# serial 64
+# serial 65
 
 # Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc.
 #
@@ -28,6 +28,7 @@ AC_DEFUN([gl_REGEX],
     # If cross compiling, assume the test would fail and use the included
     # regex.c.
     AC_CHECK_DECLS_ONCE([alarm])
+    AC_CHECK_HEADERS_ONCE([malloc.h])
     AC_CACHE_CHECK([for working re_compile_pattern],
                    [gl_cv_func_re_compile_pattern_working],
       [AC_RUN_IFELSE(
@@ -37,9 +38,19 @@ AC_DEFUN([gl_REGEX],
             #include <locale.h>
             #include <limits.h>
             #include <string.h>
-            #if HAVE_DECL_ALARM
-            # include <unistd.h>
+
+            #if defined M_CHECK_ACTION || HAVE_DECL_ALARM
             # include <signal.h>
+            # include <unistd.h>
+            #endif
+
+            #if HAVE_MALLOC_H
+            # include <malloc.h>
+            #endif
+
+            #ifdef M_CHECK_ACTION
+            /* Exit with distinguishable exit code.  */
+            static void sigabrt_no_core (int sig) { raise (SIGTERM); }
             #endif
           ]],
           [[int result = 0;
@@ -49,11 +60,18 @@ AC_DEFUN([gl_REGEX],
             const char *s;
             struct re_registers regs;
 
+            /* Some builds of glibc go into an infinite loop on this
+               test.  Use alarm to force death, and mallopt to avoid
+               malloc recursion in diagnosing the corrupted heap. */
 #if HAVE_DECL_ALARM
-            /* Some builds of glibc go into an infinite loop on this test.  */
             signal (SIGALRM, SIG_DFL);
             alarm (2);
 #endif
+#ifdef M_CHECK_ACTION
+            signal (SIGABRT, sigabrt_no_core);
+            mallopt (M_CHECK_ACTION, 2);
+#endif
+
             if (setlocale (LC_ALL, "en_US.UTF-8"))
               {
                 {
@@ -266,7 +284,8 @@ AC_DEFUN([gl_PREREQ_REGEX],
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   AC_REQUIRE([gl_EEMALLOC])
+  AC_REQUIRE([gl_GLIBC21])
   AC_CHECK_HEADERS([libintl.h])
-  AC_CHECK_FUNCS_ONCE([isblank iswctype wcscoll])
+  AC_CHECK_FUNCS_ONCE([isblank iswctype])
   AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
 ])
index 17cccff..eb005fc 100644 (file)
@@ -61,9 +61,11 @@ AC_DEFUN([gl_LIBSELINUX],
   AC_SUBST([LIB_SELINUX])
 
   # Warn if SELinux is found but libselinux is absent;
-  if test "$ac_cv_search_setfilecon" = no &&
-     test "$host" = "$build" && test -d /selinux; then
-    AC_MSG_WARN([This system supports SELinux but libselinux is missing.])
-    AC_MSG_WARN([AC_PACKAGE_NAME will be compiled without SELinux support.])
+  if test "$ac_cv_search_setfilecon" = no; then
+    if test "$host" = "$build" && test -d /selinux; then
+      AC_MSG_WARN([This system supports SELinux but libselinux is missing.])
+      AC_MSG_WARN([AC_PACKAGE_NAME will be compiled without SELinux support.])
+    fi
+    with_selinux=no
   fi
 ])
index 21c775e..57d5256 100644 (file)
@@ -1,4 +1,4 @@
-# sha1.m4 serial 11
+# sha1.m4 serial 12
 dnl Copyright (C) 2002-2006, 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,5 +8,7 @@ AC_DEFUN([gl_SHA1],
 [
   dnl Prerequisites of lib/sha1.c.
   AC_REQUIRE([gl_BIGENDIAN])
-  :
+
+  dnl Determine HAVE_OPENSSL_SHA1 and LIB_CRYPTO
+  gl_CRYPTO_CHECK([SHA1])
 ])
index 7eede32..3a19467 100644 (file)
@@ -1,4 +1,4 @@
-# sha256.m4 serial 6
+# sha256.m4 serial 8
 dnl Copyright (C) 2005, 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,4 +8,7 @@ AC_DEFUN([gl_SHA256],
 [
   dnl Prerequisites of lib/sha256.c.
   AC_REQUIRE([gl_BIGENDIAN])
+
+  dnl Determine HAVE_OPENSSL_SHA256 and LIB_CRYPTO
+  gl_CRYPTO_CHECK([SHA256])
 ])
index 46c0895..d929195 100644 (file)
@@ -1,4 +1,4 @@
-# sha512.m4 serial 7
+# sha512.m4 serial 9
 dnl Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,4 +8,7 @@ AC_DEFUN([gl_SHA512],
 [
   dnl Prerequisites of lib/sha512.c.
   AC_REQUIRE([gl_BIGENDIAN])
+
+  dnl Determine HAVE_OPENSSL_SHA512 and LIB_CRYPTO
+  gl_CRYPTO_CHECK([SHA512])
 ])
index a866ff6..20be01a 100644 (file)
@@ -31,7 +31,8 @@ AC_DEFUN([gl_STDALIGN_H],
 
             /* Test _Alignas only on platforms where gnulib can help.  */
             #if \
-                (__GNUC__ || __IBMC__ || __IBMCPP__ \
+                ((defined __cplusplus && 201103 <= __cplusplus) \
+                 || __GNUC__ || __IBMC__ || __IBMCPP__ || __ICC \
                  || 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER)
               struct alignas_test { char c; char alignas (8) alignas_8; };
               char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
index bee93b2..20454dc 100644 (file)
@@ -1,4 +1,4 @@
-# strtoimax.m4 serial 13
+# strtoimax.m4 serial 14
 dnl Copyright (C) 2002-2004, 2006, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,7 @@ AC_DEFUN([gl_FUNC_STRTOIMAX],
     HAVE_DECL_STRTOIMAX=0
   fi
 
-  if test $ac_cv_func_strtoimax = yes; then
+  if test "$ac_cv_func_strtoimax" = yes; then
     HAVE_STRTOIMAX=1
     dnl On AIX 5.1, strtoimax() fails for values outside the 'int' range.
     AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
@@ -72,6 +72,10 @@ int main ()
       *no) REPLACE_STRTOIMAX=1 ;;
     esac
   else
+    if test "$ac_cv_have_decl_strtoimax" = yes; then
+      # HP-UX 11.11 has "#define strtoimax(...) ..." but no function.
+      REPLACE_STRTOIMAX=1
+    fi
     HAVE_STRTOIMAX=0
   fi
 ])
index 6a6aeb5..9c8ff17 100644 (file)
@@ -1,4 +1,4 @@
-# strtoumax.m4 serial 11
+# strtoumax.m4 serial 12
 dnl Copyright (C) 2002-2004, 2006, 2009-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,12 @@ AC_DEFUN([gl_FUNC_STRTOUMAX],
   dnl On OSF/1 5.1 with cc, this function is declared but not defined.
   AC_CHECK_FUNCS_ONCE([strtoumax])
   AC_CHECK_DECLS_ONCE([strtoumax])
-  if test "$ac_cv_have_decl_strtoumax" != yes; then
+  if test "$ac_cv_have_decl_strtoumax" = yes; then
+    if test "$ac_cv_func_strtoumax" != yes; then
+      # HP-UX 11.11 has "#define strtoimax(...) ..." but no function.
+      REPLACE_STRTOUMAX=1
+    fi
+  else
     HAVE_DECL_STRTOUMAX=0
   fi
 ])
index 3b83900..3fefb01 100644 (file)
@@ -2,7 +2,7 @@
 
 # Copyright (C) 2000-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc.
 
-# serial 7
+# serial 8
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -106,4 +106,13 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
   REPLACE_MKTIME=GNULIB_PORTCHECK;       AC_SUBST([REPLACE_MKTIME])
   REPLACE_NANOSLEEP=GNULIB_PORTCHECK;    AC_SUBST([REPLACE_NANOSLEEP])
   REPLACE_TIMEGM=GNULIB_PORTCHECK;       AC_SUBST([REPLACE_TIMEGM])
+
+  dnl Hack so that the time module doesn't depend on the sys_time module.
+  dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent.
+  : ${GNULIB_GETTIMEOFDAY=0};            AC_SUBST([GNULIB_GETTIMEOFDAY])
+  dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME
+  dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier
+  dnl is no longer a big deal.
+  REPLACE_GMTIME=0;                      AC_SUBST([REPLACE_GMTIME])
+  REPLACE_LOCALTIME=0;                   AC_SUBST([REPLACE_LOCALTIME])
 ])
index 32dcfa5..4231578 100644 (file)
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 66
+# unistd_h.m4 serial 67
 dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -160,6 +160,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_FTRUNCATE=0;    AC_SUBST([REPLACE_FTRUNCATE])
   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
   REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
+  REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE])
   REPLACE_GETLOGIN_R=0;   AC_SUBST([REPLACE_GETLOGIN_R])
   REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
   REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
index 1848732..e3d239b 100644 (file)
@@ -1,4 +1,4 @@
-# warnings.m4 serial 8
+# warnings.m4 serial 11
 dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -25,15 +25,24 @@ m4_ifdef([AS_VAR_APPEND],
 AC_DEFUN([gl_COMPILER_OPTION_IF],
 [AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
 AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
+AS_LITERAL_IF([$1],
+  [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))],
+  [gl_positive="$1"
+case $gl_positive in
+  -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
+esac
+m4_pushdef([gl_Positive], [$gl_positive])])dnl
 AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
   gl_save_compiler_FLAGS="$gl_Flags"
-  gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $gl_unknown_warnings_are_errors $1"])
-  AC_COMPILE_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
-                    [AS_VAR_SET(gl_Warn, [yes])],
-                    [AS_VAR_SET(gl_Warn, [no])])
+  gl_AS_VAR_APPEND(m4_defn([gl_Flags]),
+    [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["])
+  AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
+                 [AS_VAR_SET(gl_Warn, [yes])],
+                 [AS_VAR_SET(gl_Warn, [no])])
   gl_Flags="$gl_save_compiler_FLAGS"
 ])
 AS_VAR_IF(gl_Warn, [yes], [$2], [$3])
+m4_popdef([gl_Positive])dnl
 AS_VAR_POPDEF([gl_Flags])dnl
 AS_VAR_POPDEF([gl_Warn])dnl
 ])
index 845e0f4..5a60f4f 100644 (file)
@@ -11,7 +11,7 @@ gl_CONFIGMAKE_PREP
 
 Makefile.am:
 # Listed in the same order as the GNU makefile conventions, and
-# provided by autoconf 2.59c+.
+# provided by autoconf 2.59c+ or 2.70.
 # The Automake-defined pkg* macros are appended, in the order
 # listed in the Automake 1.10a+ documentation.
 configmake.h: Makefile
@@ -27,6 +27,7 @@ configmake.h: Makefile
          echo '#define SYSCONFDIR "$(sysconfdir)"'; \
          echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
          echo '#define LOCALSTATEDIR "$(localstatedir)"'; \
+         echo '#define RUNSTATEDIR "$(runstatedir)"'; \
          echo '#define INCLUDEDIR "$(includedir)"'; \
          echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \
          echo '#define DOCDIR "$(docdir)"'; \
index 3922d85..7bb18bd 100644 (file)
@@ -8,7 +8,6 @@ m4/count-one-bits.m4
 
 Depends-on:
 extern-inline
-verify
 
 configure.ac:
 gl_COUNT_ONE_BITS
diff --git a/modules/count-trailing-zeros b/modules/count-trailing-zeros
new file mode 100644 (file)
index 0000000..841cfda
--- /dev/null
@@ -0,0 +1,25 @@
+Description:
+Counts the number of trailing 0-bits in a word.
+
+Files:
+lib/count-trailing-zeros.c
+lib/count-trailing-zeros.h
+m4/count-trailing-zeros.m4
+
+Depends-on:
+extern-inline
+
+configure.ac:
+gl_COUNT_TRAILING_ZEROS
+
+Makefile.am:
+lib_SOURCES += count-trailing-zeros.c
+
+Include:
+"count-trailing-zeros.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+all
diff --git a/modules/count-trailing-zeros-tests b/modules/count-trailing-zeros-tests
new file mode 100644 (file)
index 0000000..88b2d0a
--- /dev/null
@@ -0,0 +1,11 @@
+Files:
+tests/test-count-trailing-zeros.c
+tests/macros.h
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-count-trailing-zeros
+check_PROGRAMS += test-count-trailing-zeros
index e9851db..a041a1c 100644 (file)
@@ -8,3 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-gc-des
 check_PROGRAMS += test-gc-des
+test_gc_des_LDADD = $(LDADD) @LIB_CRYPTO@
index 699ccf9..7ae3d2f 100644 (file)
@@ -8,3 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-gc-hmac-md5
 check_PROGRAMS += test-gc-hmac-md5
+test_gc_hmac_md5_LDADD = $(LDADD) @LIB_CRYPTO@
index 2795ee9..9cc23ae 100644 (file)
@@ -8,3 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-gc-hmac-sha1
 check_PROGRAMS += test-gc-hmac-sha1
+test_gc_hmac_sha1_LDADD = $(LDADD) @LIB_CRYPTO@
diff --git a/modules/crypto/gc-hmac-sha256 b/modules/crypto/gc-hmac-sha256
new file mode 100644 (file)
index 0000000..bbf5591
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+Generic crypto wrappers for HMAC-SHA256 functions.
+
+Files:
+m4/gc-hmac-sha256.m4
+
+Depends-on:
+crypto/gc
+crypto/hmac-sha256 [test "$ac_cv_libgcrypt" != yes]
+
+configure.ac:
+gl_GC_HMAC_SHA256
+gl_MODULE_INDICATOR([gc-hmac-sha256])
+
+Makefile.am:
+
+Include:
+"gc.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+Simon Josefsson
diff --git a/modules/crypto/gc-hmac-sha256-tests b/modules/crypto/gc-hmac-sha256-tests
new file mode 100644 (file)
index 0000000..82f0b44
--- /dev/null
@@ -0,0 +1,11 @@
+Files:
+tests/test-gc-hmac-sha256.c
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-gc-hmac-sha256
+check_PROGRAMS += test-gc-hmac-sha256
+test_gc_hmac_sha256_LDADD = $(LDADD) @LIB_CRYPTO@
diff --git a/modules/crypto/gc-hmac-sha512 b/modules/crypto/gc-hmac-sha512
new file mode 100644 (file)
index 0000000..3d9e618
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+Generic crypto wrappers for HMAC-SHA512 functions.
+
+Files:
+m4/gc-hmac-sha512.m4
+
+Depends-on:
+crypto/gc
+crypto/hmac-sha512 [test "$ac_cv_libgcrypt" != yes]
+
+configure.ac:
+gl_GC_HMAC_SHA512
+gl_MODULE_INDICATOR([gc-hmac-sha512])
+
+Makefile.am:
+
+Include:
+"gc.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+Simon Josefsson
diff --git a/modules/crypto/gc-hmac-sha512-tests b/modules/crypto/gc-hmac-sha512-tests
new file mode 100644 (file)
index 0000000..e308f98
--- /dev/null
@@ -0,0 +1,11 @@
+Files:
+tests/test-gc-hmac-sha512.c
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-gc-hmac-sha512
+check_PROGRAMS += test-gc-hmac-sha512
+test_gc_hmac_sha512_LDADD = $(LDADD) @LIB_CRYPTO@
index a271971..865e77e 100644 (file)
@@ -8,3 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-gc-md5
 check_PROGRAMS += test-gc-md5
+test_gc_md5_LDADD = $(LDADD) @LIB_CRYPTO@
index d0f79ba..d88b541 100644 (file)
@@ -8,3 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-gc-pbkdf2-sha1
 check_PROGRAMS += test-gc-pbkdf2-sha1
+test_gc_pbkdf2_sha1_LDADD = $(LDADD) @LIB_CRYPTO@
index e438aa2..7cfef60 100644 (file)
@@ -8,3 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-gc-sha1
 check_PROGRAMS += test-gc-sha1
+test_gc_sha1_LDADD = $(LDADD) @LIB_CRYPTO@
index 6ce252f..7b153d1 100644 (file)
@@ -8,3 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-gc
 check_PROGRAMS += test-gc
+test_gc_LDADD = $(LDADD) @LIB_CRYPTO@
index 738ee51..7de2d59 100644 (file)
@@ -8,3 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-hmac-md5
 check_PROGRAMS += test-hmac-md5
+test_hmac_md5_LDADD = $(LDADD) @LIB_CRYPTO@
index ddebc58..ae8a0df 100644 (file)
@@ -8,3 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-hmac-sha1
 check_PROGRAMS += test-hmac-sha1
+test_hmac_sha1_LDADD = $(LDADD) @LIB_CRYPTO@
diff --git a/modules/crypto/hmac-sha256 b/modules/crypto/hmac-sha256
new file mode 100644 (file)
index 0000000..ee347bd
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+Compute hashed message authentication codes with SHA256.
+
+Files:
+lib/hmac.h
+lib/hmac-sha256.c
+
+Depends-on:
+memxor
+crypto/sha256
+
+configure.ac:
+
+Makefile.am:
+lib_SOURCES += hmac-sha256.c
+
+Include:
+"hmac.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+Simon Josefsson
diff --git a/modules/crypto/hmac-sha256-tests b/modules/crypto/hmac-sha256-tests
new file mode 100644 (file)
index 0000000..c5483da
--- /dev/null
@@ -0,0 +1,11 @@
+Files:
+tests/test-hmac-sha256.c
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-hmac-sha256
+check_PROGRAMS += test-hmac-sha256
+test_hmac_sha256_LDADD = $(LDADD) @LIB_CRYPTO@
diff --git a/modules/crypto/hmac-sha512 b/modules/crypto/hmac-sha512
new file mode 100644 (file)
index 0000000..cd302b8
--- /dev/null
@@ -0,0 +1,24 @@
+Description:
+Compute hashed message authentication codes with SHA512.
+
+Files:
+lib/hmac.h
+lib/hmac-sha512.c
+
+Depends-on:
+memxor
+crypto/sha512
+
+configure.ac:
+
+Makefile.am:
+lib_SOURCES += hmac-sha512.c
+
+Include:
+"hmac.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+Simon Josefsson
diff --git a/modules/crypto/hmac-sha512-tests b/modules/crypto/hmac-sha512-tests
new file mode 100644 (file)
index 0000000..877dd3b
--- /dev/null
@@ -0,0 +1,11 @@
+Files:
+tests/test-hmac-sha512.c
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-hmac-sha512
+check_PROGRAMS += test-hmac-sha512
+test_hmac_sha512_LDADD = $(LDADD) @LIB_CRYPTO@
index 4ae0c57..e5fb39c 100644 (file)
@@ -2,11 +2,14 @@ Description:
 Compute MD5 checksum.
 
 Files:
+lib/gl_openssl.h
 lib/md5.h
 lib/md5.c
+m4/gl-openssl.m4
 m4/md5.m4
 
 Depends-on:
+extern-inline
 stdalign
 stdint
 
@@ -19,6 +22,9 @@ lib_SOURCES += md5.c
 Include:
 "md5.h"
 
+Link:
+$(LIB_CRYPTO)
+
 License:
 LGPLv2+
 
index 94bc3e4..3b4bd63 100644 (file)
@@ -8,3 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-md5
 check_PROGRAMS += test-md5
+test_md5_LDADD = $(LDADD) @LIB_CRYPTO@
index 8d00f31..d65f994 100644 (file)
@@ -2,11 +2,14 @@ Description:
 Compute SHA1 checksum.
 
 Files:
+lib/gl_openssl.h
 lib/sha1.h
 lib/sha1.c
+m4/gl-openssl.m4
 m4/sha1.m4
 
 Depends-on:
+extern-inline
 stdalign
 stdint
 
@@ -19,6 +22,9 @@ lib_SOURCES += sha1.c
 Include:
 "sha1.h"
 
+Link:
+$(LIB_CRYPTO)
+
 License:
 LGPLv2+
 
index 6da04d6..df83721 100644 (file)
@@ -8,3 +8,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-sha1
 check_PROGRAMS += test-sha1
+test_sha1_LDADD = $(LDADD) @LIB_CRYPTO@
index f3f1d64..37fabfd 100644 (file)
@@ -2,11 +2,14 @@ Description:
 Compute SHA224 and SHA256 checksums.
 
 Files:
+lib/gl_openssl.h
 lib/sha256.h
 lib/sha256.c
+m4/gl-openssl.m4
 m4/sha256.m4
 
 Depends-on:
+extern-inline
 stdalign
 stdint
 
@@ -19,6 +22,9 @@ lib_SOURCES += sha256.c
 Include:
 "sha256.h"
 
+Link:
+$(LIB_CRYPTO)
+
 License:
 LGPLv2+
 
index a5065c4..4c97604 100644 (file)
@@ -2,11 +2,14 @@ Description:
 Compute SHA384 and SHA512 checksums.
 
 Files:
+lib/gl_openssl.h
 lib/sha512.h
 lib/sha512.c
+m4/gl-openssl.m4
 m4/sha512.m4
 
 Depends-on:
+extern-inline
 stdalign
 stdint
 u64
@@ -20,6 +23,9 @@ lib_SOURCES += sha512.c
 Include:
 "sha512.h"
 
+Link:
+$(LIB_CRYPTO)
+
 License:
 LGPLv2+
 
index ec000dc..90ed9cb 100644 (file)
@@ -6,6 +6,7 @@ lib/ctype.in.h
 m4/ctype.m4
 
 Depends-on:
+extern-inline
 include_next
 snippet/c++defs
 snippet/warn-on-use
index f867617..c78e7fe 100644 (file)
@@ -12,6 +12,7 @@ lib/error.c
 m4/error.m4
 
 Depends-on:
+stdio           [test $ac_cv_lib_error_at_line = no]
 strerror        [test $ac_cv_lib_error_at_line = no]
 unistd          [test $ac_cv_lib_error_at_line = no]
 msvc-nothrow    [test $ac_cv_lib_error_at_line = no]
index 0b14898..1375eb1 100644 (file)
@@ -10,7 +10,7 @@ Depends-on:
 
 configure.ac:
 gl_FUNC_FPENDING
-if test $ac_cv_func___fpending = no; then
+if test $gl_cv_func___fpending = no; then
   AC_LIBOBJ([fpending])
   gl_PREREQ_FPENDING
 fi
index 109be1f..1c2d642 100644 (file)
@@ -7,11 +7,12 @@ m4/getdtablesize.m4
 
 Depends-on:
 unistd
+extensions
 msvc-inval      [test $HAVE_GETDTABLESIZE = 0]
 
 configure.ac:
 gl_FUNC_GETDTABLESIZE
-if test $HAVE_GETDTABLESIZE = 0; then
+if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
   AC_LIBOBJ([getdtablesize])
   gl_PREREQ_GETDTABLESIZE
 fi
@@ -26,5 +27,5 @@ License:
 LGPLv2+
 
 Maintainer:
-Bruno Haible
+Bruno Haible, Eric Blake
 
index 57585e1..42502e7 100644 (file)
@@ -20,7 +20,7 @@ Include:
 "hash.h"
 
 License:
-GPL
+LGPLv2+
 
 Maintainer:
 Jim Meyering
index 3d01928..bf0b00d 100644 (file)
@@ -5,6 +5,7 @@ Files:
 m4/include_next.m4
 
 Depends-on:
+absolute-header
 
 configure.ac:
 
index 5943dae..8c29a29 100644 (file)
@@ -43,6 +43,7 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
              -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
              -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
              -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
+             -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
              -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
              -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
              -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
index 92f528f..33b5365 100644 (file)
@@ -12,6 +12,7 @@ lib/memcpy.c
 m4/memcpy.m4
 
 Depends-on:
+string
 
 configure.ac:
 gl_FUNC_MEMCPY
@@ -30,4 +31,3 @@ GPL
 
 Maintainer:
 Jim Meyering
-
index a6fdff4..b4ded41 100644 (file)
@@ -12,6 +12,7 @@ lib/memmove.c
 m4/memmove.m4
 
 Depends-on:
+string
 
 configure.ac:
 gl_FUNC_MEMMOVE
index 9fb1a5d..9594137 100644 (file)
@@ -12,6 +12,7 @@ lib/memset.c
 m4/memset.m4
 
 Depends-on:
+string
 
 configure.ac:
 gl_FUNC_MEMSET
index 76eee01..f401cdf 100644 (file)
@@ -9,7 +9,7 @@ m4/mgetgroups.m4
 Depends-on:
 getgroups
 getugroups
-realloc-gnu
+realloc-posix
 xalloc-oversized
 
 configure.ac:
index 8f5eda0..9d2e4d2 100644 (file)
@@ -18,6 +18,7 @@ ssize_t
 alloca-opt      [test $ac_use_included_regex = yes]
 btowc           [test $ac_use_included_regex = yes]
 gettext-h       [test $ac_use_included_regex = yes]
+lock      [test "$ac_cv_gnu_library_2_1:$ac_use_included_regex" = no:yes]
 malloc-gnu      [test $ac_use_included_regex = yes]
 memcmp          [test $ac_use_included_regex = yes]
 memmove         [test $ac_use_included_regex = yes]
index cfff7bf..638dba9 100644 (file)
@@ -10,4 +10,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-regex
 check_PROGRAMS += test-regex
-test_regex_LDADD = $(LDADD) @LIBINTL@
+test_regex_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD) $(LIB_PTHREAD)
index 2f5471b..c7b942a 100644 (file)
@@ -7,6 +7,7 @@ m4/string_h.m4
 
 Depends-on:
 extensions
+extern-inline
 include_next
 snippet/arg-nonnull
 snippet/c++defs
index 2517603..36a96de 100644 (file)
@@ -8,13 +8,13 @@ m4/longlong.m4
 
 Depends-on:
 inttypes-incomplete
-verify          [test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1]
-stdint          [test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1]
-strtoll         [{ test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes]
+verify          [test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1]
+stdint          [test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1]
+strtoll         [{ test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes]
 
 configure.ac:
 gl_FUNC_STRTOIMAX
-if test $HAVE_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
+if test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; then
   AC_LIBOBJ([strtoimax])
   gl_PREREQ_STRTOIMAX
 fi
index dc72a0a..725f523 100644 (file)
@@ -9,13 +9,13 @@ m4/strtoumax.m4
 
 Depends-on:
 inttypes-incomplete
-verify          [test $ac_cv_func_strtoumax = no]
-stdint          [test $ac_cv_func_strtoumax = no]
-strtoull        [test $ac_cv_func_strtoumax = no && test $ac_cv_type_unsigned_long_long_int = yes]
+verify          [test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1]
+stdint          [test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1]
+strtoull        [{ test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; } && test $ac_cv_type_unsigned_long_long_int = yes]
 
 configure.ac:
 gl_FUNC_STRTOUMAX
-if test $ac_cv_func_strtoumax = no; then
+if test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; then
   AC_LIBOBJ([strtoumax])
   gl_PREREQ_STRTOUMAX
 fi
index 8e946fc..fd3c05d 100644 (file)
@@ -7,6 +7,7 @@ m4/time_h.m4
 
 Depends-on:
 extensions
+gettimeofday
 include_next
 snippet/arg-nonnull
 snippet/c++defs
@@ -29,6 +30,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
              -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
              -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
              -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
@@ -38,6 +40,8 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
              -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
              -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+             -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
+             -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
              -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
              -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
              -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
index c887d4f..c470ba6 100644 (file)
@@ -137,6 +137,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
              -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
+             -e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \
              -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
              -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
              -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
index e41b2a6..dcc48e0 100644 (file)
@@ -1,5 +1,5 @@
 Description:
-a wrapper for frepoen
+a wrapper for freopen
 
 Files:
 lib/xfreopen.c
index 60ba894..1ceb815 100644 (file)
@@ -48,8 +48,8 @@
     {                                                                        \
       if (!(expr))                                                           \
         {                                                                    \
-          fprintf (ASSERT_STREAM, "%s:%d: assertion failed\n",               \
-                   __FILE__, __LINE__);                                      \
+          fprintf (ASSERT_STREAM, "%s:%d: assertion '%s' failed\n",     \
+                   __FILE__, __LINE__, #expr);                          \
           fflush (ASSERT_STREAM);                                            \
           abort ();                                                          \
         }                                                                    \
diff --git a/tests/test-count-trailing-zeros.c b/tests/test-count-trailing-zeros.c
new file mode 100644 (file)
index 0000000..98a5f87
--- /dev/null
@@ -0,0 +1,71 @@
+/* Test counting of trailing zeros.
+   Copyright (C) 2013 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include "count-trailing-zeros.h"
+
+#include <limits.h>
+#include <stdio.h>
+
+#include "macros.h"
+
+#define UINT_BIT (sizeof (unsigned int) * CHAR_BIT)
+#define ULONG_BIT (sizeof (unsigned long int) * CHAR_BIT)
+#define ULLONG_BIT (sizeof (unsigned long long int) * CHAR_BIT)
+
+#ifndef ULLONG_MAX
+# define HALF (1ULL << (sizeof (unsigned long long int) * CHAR_BIT - 1))
+# define ULLONG_MAX (HALF - 1 + HALF)
+#endif
+
+int
+main (int argc, char *argv[])
+{
+  int i, j;
+
+#define TEST_COUNT_TRAILING_ZEROS(FUNC, TYPE, BITS, MAX, ONE)   \
+  ASSERT (FUNC (0) == BITS);                                    \
+  for (i = 0; i < BITS; i++)                                    \
+    {                                                           \
+      ASSERT (FUNC (ONE << i) == i);                            \
+      for (j = 0; j < i; j++)                                   \
+        ASSERT (FUNC ((ONE << i) | (ONE << j)) == j);           \
+    }                                                           \
+  for (i = 0; i < 1000; i++)                                    \
+    {                                                           \
+      TYPE value = rand () ^ (rand () << 31 << 1);              \
+      int count = 0;                                            \
+      for (j = BITS - 1; 0 <= j; j--)                           \
+        if (value & (ONE << j))                                 \
+          count = j;                                            \
+      ASSERT (count == FUNC (value));                           \
+    }                                                           \
+  ASSERT (FUNC (MAX) == 0);
+
+  TEST_COUNT_TRAILING_ZEROS (count_trailing_zeros, unsigned int,
+                             UINT_BIT, UINT_MAX, 1U);
+  TEST_COUNT_TRAILING_ZEROS (count_trailing_zeros_l, unsigned long int,
+                             ULONG_BIT, ULONG_MAX, 1UL);
+#ifdef HAVE_UNSIGNED_LONG_LONG_INT
+  TEST_COUNT_TRAILING_ZEROS (count_trailing_zeros_ll, unsigned long long int,
+                             ULLONG_BIT, ULLONG_MAX, 1ULL);
+#endif
+
+  return 0;
+}
index ecb2692..44039f1 100644 (file)
@@ -150,6 +150,15 @@ main (void)
   errno = 0;
   ASSERT (dup2 (fd, -2) == -1);
   ASSERT (errno == EBADF);
+  if (bad_fd > 256)
+    {
+      ASSERT (dup2 (fd, 255) == 255);
+      ASSERT (dup2 (fd, 256) == 256);
+      ASSERT (close (255) == 0);
+      ASSERT (close (256) == 0);
+    }
+  ASSERT (dup2 (fd, bad_fd - 1) == bad_fd - 1);
+  ASSERT (close (bad_fd - 1) == 0);
   errno = 0;
   ASSERT (dup2 (fd, bad_fd) == -1);
   ASSERT (errno == EBADF);
index eb26c8f..5a4aa6d 100644 (file)
@@ -124,6 +124,15 @@ main ()
       errno = 0;
       ASSERT (dup3 (fd, -2, o_flags) == -1);
       ASSERT (errno == EBADF);
+      if (bad_fd > 256)
+        {
+          ASSERT (dup3 (fd, 255, 0) == 255);
+          ASSERT (dup3 (fd, 256, 0) == 256);
+          ASSERT (close (255) == 0);
+          ASSERT (close (256) == 0);
+        }
+      ASSERT (dup3 (fd, bad_fd - 1, 0) == bad_fd - 1);
+      ASSERT (close (bad_fd - 1) == 0);
       errno = 0;
       ASSERT (dup3 (fd, bad_fd, o_flags) == -1);
       ASSERT (errno == EBADF);
diff --git a/tests/test-gc-hmac-sha256.c b/tests/test-gc-hmac-sha256.c
new file mode 100644 (file)
index 0000000..edb8d7d
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2005, 2010-2013 Free Software Foundation, Inc.
+ * Written by Simon Josefsson
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <string.h>
+#include "gc.h"
+
+int
+main (int argc, char *argv[])
+{
+  Gc_rc rc;
+
+  rc = gc_init ();
+  if (rc != GC_OK)
+    {
+      printf ("gc_init() failed\n");
+      return 1;
+    }
+
+  {
+    char *key =
+      "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
+    size_t key_len = 20;
+    char *data = "Hi There";
+    size_t data_len = 8;
+    char *digest =
+      "\xb0\x34\x4c\x61\xd8\xdb\x38\x53\x5c\xa8\xaf\xce\xaf\x0b\xf1\x2b\x88\x1d\xc2\x00\xc9\x83\x3d\xa7\x26\xe9\x37\x6c\x2e\x32\xcf\xf7";
+    char out[GC_SHA256_DIGEST_SIZE];
+
+    if (gc_hmac_sha256 (key, key_len, data, data_len, out) != 0)
+      {
+        printf ("call failure\n");
+        return 1;
+      }
+
+    if (memcmp (digest, out, GC_SHA256_DIGEST_SIZE) != 0)
+      {
+        size_t i;
+        printf ("hash 1 mismatch. expected:\n");
+        for (i = 0; i < GC_SHA256_DIGEST_SIZE; i++)
+          printf ("%02x ", digest[i] & 0xFF);
+        printf ("\ncomputed:\n");
+        for (i = 0; i < GC_SHA256_DIGEST_SIZE; i++)
+          printf ("%02x ", out[i] & 0xFF);
+        printf ("\n");
+        return 1;
+      }
+  }
+
+  gc_done ();
+
+  return 0;
+}
diff --git a/tests/test-gc-hmac-sha512.c b/tests/test-gc-hmac-sha512.c
new file mode 100644 (file)
index 0000000..c9bbf1a
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2005, 2010-2013 Free Software Foundation, Inc.
+ * Written by Simon Josefsson
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <string.h>
+#include "gc.h"
+
+int
+main (int argc, char *argv[])
+{
+  Gc_rc rc;
+
+  rc = gc_init ();
+  if (rc != GC_OK)
+    {
+      printf ("gc_init() failed\n");
+      return 1;
+    }
+
+  {
+    char *key =
+      "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
+    size_t key_len = 20;
+    char *data = "Hi There";
+    size_t data_len = 8;
+    char *digest =
+      "\x87\xaa\x7c\xde\xa5\xef\x61\x9d\x4f\xf0\xb4\x24\x1a\x1d\x6c\xb0\x23\x79\xf4\xe2\xce\x4e\xc2\x78\x7a\xd0\xb3\x05\x45\xe1\x7c\xde\xda\xa8\x33\xb7\xd6\xb8\xa7\x02\x03\x8b\x27\x4e\xae\xa3\xf4\xe4\xbe\x9d\x91\x4e\xeb\x61\xf1\x70\x2e\x69\x6c\x20\x3a\x12\x68\x54";
+    char out[GC_SHA512_DIGEST_SIZE];
+
+    if (gc_hmac_sha512 (key, key_len, data, data_len, out) != 0)
+      {
+        printf ("call failure\n");
+        return 1;
+      }
+
+    if (memcmp (digest, out, GC_SHA512_DIGEST_SIZE) != 0)
+      {
+        size_t i;
+        printf ("hash 1 mismatch. expected:\n");
+        for (i = 0; i < GC_SHA512_DIGEST_SIZE; i++)
+          printf ("%02x ", digest[i] & 0xFF);
+        printf ("\ncomputed:\n");
+        for (i = 0; i < GC_SHA512_DIGEST_SIZE; i++)
+          printf ("%02x ", out[i] & 0xFF);
+        printf ("\n");
+        return 1;
+      }
+  }
+
+  gc_done ();
+
+  return 0;
+}
index 7046481..b371ccf 100644 (file)
@@ -29,6 +29,8 @@ int
 main (int argc, char *argv[])
 {
   ASSERT (getdtablesize () >= 3);
+  ASSERT (dup2 (0, getdtablesize() - 1) == getdtablesize () - 1);
+  ASSERT (dup2 (0, getdtablesize()) == -1);
 
   return 0;
 }
diff --git a/tests/test-hmac-sha256.c b/tests/test-hmac-sha256.c
new file mode 100644 (file)
index 0000000..4eaa83d
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2005, 2010-2013 Free Software Foundation, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Simon Josefsson.  Test vectors from RFC 4231.  */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <string.h>
+#include "hmac.h"
+
+int
+main (int argc, char *argv[])
+{
+  {
+    char *key =
+      "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
+    size_t key_len = 20;
+    char *data = "Hi There";
+    size_t data_len = 8;
+    char *digest =
+      "\xb0\x34\x4c\x61\xd8\xdb\x38\x53\x5c\xa8\xaf\xce\xaf\x0b\xf1\x2b\x88\x1d\xc2\x00\xc9\x83\x3d\xa7\x26\xe9\x37\x6c\x2e\x32\xcf\xf7";
+    char out[32];
+
+    if (hmac_sha256 (key, key_len, data, data_len, out) != 0)
+      {
+        printf ("call failure\n");
+        return 1;
+      }
+
+    if (memcmp (digest, out, 32) != 0)
+      {
+        size_t i;
+        printf ("hash 1 mismatch. expected:\n");
+        for (i = 0; i < 32; i++)
+          printf ("%02x ", digest[i] & 0xFF);
+        printf ("\ncomputed:\n");
+        for (i = 0; i < 32; i++)
+          printf ("%02x ", out[i] & 0xFF);
+        printf ("\n");
+        return 1;
+      }
+  }
+
+  {
+    char *key = "Jefe";
+    size_t key_len = 4;
+    char *data = "what do ya want for nothing?";
+    size_t data_len = 28;
+    char *digest =
+      "\x5b\xdc\xc1\x46\xbf\x60\x75\x4e\x6a\x04\x24\x26\x08\x95\x75\xc7\x5a\x00\x3f\x08\x9d\x27\x39\x83\x9d\xec\x58\xb9\x64\xec\x38\x43";
+    char out[32];
+
+    if (hmac_sha256 (key, key_len, data, data_len, out) != 0)
+      {
+        printf ("call failure\n");
+        return 1;
+      }
+
+    if (memcmp (digest, out, 32) != 0)
+      {
+        size_t i;
+        printf ("hash 2 mismatch. expected:\n");
+        for (i = 0; i < 32; i++)
+          printf ("%02x ", digest[i] & 0xFF);
+        printf ("\ncomputed:\n");
+        for (i = 0; i < 32; i++)
+          printf ("%02x ", out[i] & 0xFF);
+        printf ("\n");
+        return 1;
+      }
+  }
+
+  {
+    char *key =
+      "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA";
+    size_t key_len = 20;
+    char *data = "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+      "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+      "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+      "\xDD\xDD";
+    size_t data_len = 50;
+    char *digest =
+      "\x77\x3e\xa9\x1e\x36\x80\x0e\x46\x85\x4d\xb8\xeb\xd0\x91\x81\xa7\x29\x59\x09\x8b\x3e\xf8\xc1\x22\xd9\x63\x55\x14\xce\xd5\x65\xfe";
+    char out[32];
+
+    if (hmac_sha256 (key, key_len, data, data_len, out) != 0)
+      {
+        printf ("call failure\n");
+        return 1;
+      }
+
+    if (memcmp (digest, out, 32) != 0)
+      {
+        size_t i;
+        printf ("hash 3 mismatch. expected:\n");
+        for (i = 0; i < 32; i++)
+          printf ("%02x ", digest[i] & 0xFF);
+        printf ("\ncomputed:\n");
+        for (i = 0; i < 32; i++)
+          printf ("%02x ", out[i] & 0xFF);
+        printf ("\n");
+        return 1;
+      }
+  }
+
+  return 0;
+}
diff --git a/tests/test-hmac-sha512.c b/tests/test-hmac-sha512.c
new file mode 100644 (file)
index 0000000..f403ff1
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2005, 2010-2013 Free Software Foundation, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Simon Josefsson.  Test vectors from RFC 4231.  */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <string.h>
+#include "hmac.h"
+
+int
+main (int argc, char *argv[])
+{
+  {
+    char *key =
+      "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
+    size_t key_len = 20;
+    char *data = "Hi There";
+    size_t data_len = 8;
+    char *digest =
+      "\x87\xaa\x7c\xde\xa5\xef\x61\x9d\x4f\xf0\xb4\x24\x1a\x1d\x6c\xb0\x23\x79\xf4\xe2\xce\x4e\xc2\x78\x7a\xd0\xb3\x05\x45\xe1\x7c\xde\xda\xa8\x33\xb7\xd6\xb8\xa7\x02\x03\x8b\x27\x4e\xae\xa3\xf4\xe4\xbe\x9d\x91\x4e\xeb\x61\xf1\x70\x2e\x69\x6c\x20\x3a\x12\x68\x54";
+    char out[64];
+
+    if (hmac_sha512 (key, key_len, data, data_len, out) != 0)
+      {
+        printf ("call failure\n");
+        return 1;
+      }
+
+    if (memcmp (digest, out, 64) != 0)
+      {
+        size_t i;
+        printf ("hash 1 mismatch. expected:\n");
+        for (i = 0; i < 64; i++)
+          printf ("%02x ", digest[i] & 0xFF);
+        printf ("\ncomputed:\n");
+        for (i = 0; i < 64; i++)
+          printf ("%02x ", out[i] & 0xFF);
+        printf ("\n");
+        return 1;
+      }
+  }
+
+  {
+    char *key = "Jefe";
+    size_t key_len = 4;
+    char *data = "what do ya want for nothing?";
+    size_t data_len = 28;
+    char *digest =
+      "\x16\x4b\x7a\x7b\xfc\xf8\x19\xe2\xe3\x95\xfb\xe7\x3b\x56\xe0\xa3\x87\xbd\x64\x22\x2e\x83\x1f\xd6\x10\x27\x0c\xd7\xea\x25\x05\x54\x97\x58\xbf\x75\xc0\x5a\x99\x4a\x6d\x03\x4f\x65\xf8\xf0\xe6\xfd\xca\xea\xb1\xa3\x4d\x4a\x6b\x4b\x63\x6e\x07\x0a\x38\xbc\xe7\x37";
+    char out[64];
+
+    if (hmac_sha512 (key, key_len, data, data_len, out) != 0)
+      {
+        printf ("call failure\n");
+        return 1;
+      }
+
+    if (memcmp (digest, out, 64) != 0)
+      {
+        size_t i;
+        printf ("hash 2 mismatch. expected:\n");
+        for (i = 0; i < 64; i++)
+          printf ("%02x ", digest[i] & 0xFF);
+        printf ("\ncomputed:\n");
+        for (i = 0; i < 64; i++)
+          printf ("%02x ", out[i] & 0xFF);
+        printf ("\n");
+        return 1;
+      }
+  }
+
+  {
+    char *key =
+      "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA";
+    size_t key_len = 20;
+    char *data = "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+      "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+      "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD"
+      "\xDD\xDD";
+    size_t data_len = 50;
+    char *digest =
+      "\xfa\x73\xb0\x08\x9d\x56\xa2\x84\xef\xb0\xf0\x75\x6c\x89\x0b\xe9\xb1\xb5\xdb\xdd\x8e\xe8\x1a\x36\x55\xf8\x3e\x33\xb2\x27\x9d\x39\xbf\x3e\x84\x82\x79\xa7\x22\xc8\x06\xb4\x85\xa4\x7e\x67\xc8\x07\xb9\x46\xa3\x37\xbe\xe8\x94\x26\x74\x27\x88\x59\xe1\x32\x92\xfb";
+    char out[64];
+
+    if (hmac_sha512 (key, key_len, data, data_len, out) != 0)
+      {
+        printf ("call failure\n");
+        return 1;
+      }
+
+    if (memcmp (digest, out, 64) != 0)
+      {
+        size_t i;
+        printf ("hash 3 mismatch. expected:\n");
+        for (i = 0; i < 64; i++)
+          printf ("%02x ", digest[i] & 0xFF);
+        printf ("\ncomputed:\n");
+        for (i = 0; i < 64; i++)
+          printf ("%02x ", out[i] & 0xFF);
+        printf ("\n");
+        return 1;
+      }
+  }
+
+  return 0;
+}
index 5adbf08..834d39f 100644 (file)
@@ -43,7 +43,10 @@ test_mkfifo (int (*func) (char const *, mode_t), bool print)
   ASSERT (errno == ENOENT);
   errno = 0;
   ASSERT (func (".", 0600) == -1);
-  ASSERT (errno == EEXIST || errno == EINVAL);
+  /* Allow HP-UX 11.11's EISDIR, even though POSIX says it's wrong,
+     since it doesn't really hurt anything and we lack the energy to
+     fix it.  */
+  ASSERT (errno == EEXIST || errno == EINVAL || errno == EISDIR);
   errno = 0;
   ASSERT (func (BASE "fifo", 0600) == -1);
   ASSERT (errno == EEXIST);
index babb239..2e634de 100644 (file)
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
+/* Make test_open always inline if we're using Fortify, which defines
+   __always_inline to do that.  Do nothing otherwise.  This works
+   around a glibc bug whereby 'open' cannot be used as a function
+   pointer when _FORTIFY_SOURCE is positive.  */
+
+#ifndef __always_inline
+#define __always_inline
+#endif
+
 /* This file is designed to test both open(n,buf[,mode]) and
    openat(AT_FDCWD,n,buf[,mode]).  FUNC is the function to test.
    Assumes that BASE and ASSERT are already defined, and that
    appropriate headers are already included.  If PRINT, warn before
    skipping symlink tests with status 77.  */
 
-static int
+static __always_inline int
 test_open (int (*func) (char const *, int, ...), bool print)
 {
   int fd;
index 6389e15..3351233 100644 (file)
@@ -83,6 +83,7 @@ main ()
   /* father */
   else
     {
+      ASSERT (close (pair[1]) == 0);
       fd = recvfd (pair[0], 0);
       if (fd == -1)
         {
@@ -116,6 +117,13 @@ main ()
           perror ("fstat");
           return 80;
         }
+
+      /* Check behavior when sender no longer around */
+      errno = 0;
+      fd = recvfd (pair[0], 0);
+      ASSERT (fd == -1);
+      ASSERT (errno == ENOTCONN);
+
       return 0;
     }
 #else
index cd84c01..1604699 100644 (file)
@@ -40,8 +40,9 @@ SIGNATURE_CHECK (FD_ZERO, void, (fd_set *));
 /* Check that the 'struct timeval' type is defined.  */
 struct timeval a;
 
-/* Check that &a.tv_sec is a 'time_t *', ignoring signedness issues.  */
-typedef int verify_tv_sec_type[sizeof (a.tv_sec) == sizeof (time_t) ? 1 : -1];
+/* Check that a.tv_sec is wide enough to hold a time_t, ignoring
+   signedness issues.  */
+typedef int verify_tv_sec_type[sizeof (time_t) <= sizeof (a.tv_sec) ? 1 : -1];
 
 /* Check that sigset_t is defined.  */
 sigset_t t2;
index 1389b52..8062842 100644 (file)
@@ -23,8 +23,9 @@
 /* Check that the 'struct timeval' type is defined.  */
 struct timeval a;
 
-/* Check that &a.tv_sec is a 'time_t *', ignoring signedness issues.  */
-typedef int verify_tv_sec_type[sizeof (a.tv_sec) == sizeof (time_t) ? 1 : -1];
+/* Check that a.tv_sec is wide enough to hold a time_t, ignoring
+   signedness issues.  */
+typedef int verify_tv_sec_type[sizeof (time_t) <= sizeof (a.tv_sec) ? 1 : -1];
 
 int
 main (void)
index 5b02664..8e3672f 100644 (file)
@@ -181,6 +181,17 @@ main (void)
         }
     }
 
+  /* Ensure NULL parameters are ignored.  */
+  {
+    uid_t uid = (uid_t) -1;
+    char const *diag = parse_user_spec ("", &uid, NULL, NULL, NULL);
+    if (diag)
+      {
+        printf ("unexpected error: %s\n", diag);
+        fail = 1;
+      }
+  }
+
   return fail;
 }
 
index 0a2f1b8..0987225 100644 (file)
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
+/* Tell GCC not to warn about the specific edge cases tested here.  */
+#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wformat-zero-length"
+# pragma GCC diagnostic ignored "-Wformat-nonliteral"
+# pragma GCC diagnostic ignored "-Wformat-security"
+#endif
+
 #include <config.h>
 
 #include "xvasprintf.h"
@@ -93,9 +100,11 @@ test_xasprintf (void)
     }
 
   {
-    /* Silence gcc warning about zero-length format string.  */
+    /* Silence gcc warning about zero-length format string,
+       and about "format not a string literal and no format"
+       (whatever that means) .  */
     const char *empty = "";
-    result = xasprintf (empty);
+    result = xasprintf (empty, empty);
     ASSERT (result != NULL);
     ASSERT (strcmp (result, "") == 0);
     free (result);
index c1b786f..9c02ed4 100644 (file)
@@ -1283,15 +1283,17 @@ vc-diff-check:
 rel-files = $(DIST_ARCHIVES)
 
 gnulib_dir ?= $(srcdir)/gnulib
-gnulib-version = $$(cd $(gnulib_dir) && git describe)
+gnulib-version = $$(cd $(gnulib_dir)                           \
+                    && { git describe || git rev-parse --short=10 HEAD; } )
 bootstrap-tools ?= autoconf,automake,gnulib
 
+gpgv = $$(gpgv2 --version >/dev/null && echo gpgv2 || echo gpgv)
 # If it's not already specified, derive the GPG key ID from
 # the signed tag we've just applied to mark this release.
 gpg_key_ID ?=                                                          \
   $$(cd $(srcdir)                                                      \
      && git cat-file tag v$(VERSION)                                   \
-        | gpgv --status-fd 1 --keyring /dev/null - - 2>/dev/null       \
+        | $(gpgv) --status-fd 1 --keyring /dev/null - - 2>/dev/null    \
         | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
 
 translation_project_ ?= coordinator@translationproject.org
@@ -1424,6 +1426,7 @@ alpha beta stable: $(local-check) writable-files $(submodule-checks)
        $(AM_V_at)$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
 
 release:
+       $(AM_V_GEN)$(MAKE) _version
        $(AM_V_GEN)$(MAKE) $(release-type)
 
 # Override this in cfg.mk if you follow different procedures.