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>.
maint.mk: get current gnulib revision correctly.

* top/maint.mk (gnulib-version): Use git rev-parse to get the
current HEAD revision.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
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.
Revert "error: make the module depend on vfprintf-posix"

This reverts commit 88e5b4d4641f294d8f824d770c9c55a1abe49768.

The GPL 'error' module is used by some of the gnulib testsuites;
and for some projects that use LGPL 'vasnprintf' in their lib/
directory, having 'error' depend on GPL 'vfprintf-posix' meant
that compilation breaks for those projects:

autoreconf: running: aclocal -I m4 --force -I m4
missing file gnulib/tests/vasnprintf.c
configure.ac:135: error: expected source file, required through
AC_LIBSOURCES, not found
m4/gnulib-comp.m4:518: gl_INIT is expanded from...
configure.ac:135: the top level
autom4te: /usr/bin/m4 failed with exit status: 1

I suspect that the problem encountered on OS/x was a warning from
gcc complaining about inconsistent use of __attribute__((__format__
__printf__)) vs. ((__format__ __gnu_printf__)); so perhaps the
real fix is to teach error.h to copy the extra care taken by
stdio.h with regards to whether merely system or full GNU printf
specifiers are being handled.  But without actually reproducing
that situation myself, the easiest action for now is to just revert
the dependency that violates the 'Comment' section of vfprintf-posix.
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.
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.
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.
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.
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.
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.
hash: relax license to LGPLv2+, for libguestfs

* modules/hash (License): Change from GPL to LGPLv2+.
fpending: fix regression on DragonFly BSD

Commit 3f5bf99e claimed that it is safe to declare __fpending twice,
but in reality this caused a regression on Dragonfly BSD.  Reported by
GW in <https://lists.gnu.org/archive/html/bug-m4/2013-11/msg00000.html>,
<https://lists.gnu.org/archive/html/bug-gnulib/2013-11/msg00022.html>.

* m4/fpending.m4 (gl_FUNC_FPENDING): Check for declaration.
* lib/fpending.h (__fpending): Don't declare twice.

Signed-off-by: Eric Blake <eblake@redhat.com>
fpending: fix typo

Use correct witness macro name (reported by Paul Eggert).

* lib/fpending.h (__fpending): s/DECL_FPENDING/DECL___FPENDING/.

Signed-off-by: Eric Blake <eblake@redhat.com>
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>.
base64: provide a fast path for encoding well sized buffers

Avoid conditionals in the base64 encoding loop,
which was seen to give a 60% throughput improvement
with the base64 utility from coreutils:

$ truncate -s100MiB file.in
$ time base64-old -w0 < file.in >/dev/null
real  0m0.302s
$ time base64-new -w0 < file.in >/dev/null
real  0m0.182s

* 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.
* 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>.
Fix indentation in previous patch.
doc: Improve wording in relocatable-maint.texi.

Reported by Reuben Thomas <rrt@sc3d.org>.
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.
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.
Co-authored-by: Paul Eggert <eggert@cs.ucla.edu>