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.
autoupdate
autoupdate
base64: fix recent compilation regression on some compilers

This fixes a compile failure with
  "Sun C 5.8 Patch 121015-05 2007/08/01"
which returns:
  "base64.c", line 99: void function cannot return value

* lib/base64.c: Don't return the void function,
instead split to a separate return statement.
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.
regex: avoid glibc deadlock during configure

glibc has a known bug where certain corruptions of the heap can
cause malloc to default to printing a debug message that includes
a backtrace, but the act of getting the backtrace uses dlopen
which in turn calls into malloc, causing a recursive lock ending
in deadlock.  Thus, when configure is probing for a known glibc
heap corruption bug, the overall configure would hang.

The solution suggested by glibc developers is to force malloc
to quit printing debug messages, which avoids recursive malloc.

* m4/regex.m4 (gl_REGEX): Avoid recursive malloc deadlock when
glibc bug 15078 in turn triggers bug 16159.
Reported by Michal Privoznik.

Signed-off-by: Eric Blake <eblake@redhat.com>
test-xvasprintf: disable some -Wformat-security diagnostics

* tests/test-xvasprintf.c: Disable -Wformat-zero-length and
-Wformat-nonliteral checks, as these edge cases are part of the test.
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.
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.
getcwd: fix compile error in configure check

Introduced in commit ca369c8d, 2013-02-03

* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Include errno.h
include_next: minimize code duplication

I noticed some code duplication while trying to resolve a bug
originally reported by Rhys Ulerich:
https://lists.gnu.org/archive/html/bug-gnulib/2013-10/msg00049.html

* 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.

Signed-off-by: Eric Blake <eblake@redhat.com>
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.
bootstrap: warn about BSD toolchain snafu

With my help on IRC, Roman Bogorodskiy identified a bug where the
BSD autoconf wrapper script eats stdin[1], which in turn causes
autopoint from gettext 0.18.3 to fail to find AM_GNU_GETTEXT_VERSION
out of configure.ac[2], with this error:

./bootstrap: autopoint --force
autopoint: *** Missing version: please specify in configure.ac through a line 'AM_GNU_GETTEXT_VERSION(x.yy.zz)' the gettext version the package is using

[1] http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/184479
[2] http://git.sv.gnu.org/cgit/gettext.git/commit/gettext-tools/misc/autopoint.in?id=eea2dddde

The workaround would be painful to automate (because gettext
hardcodes the use of autom4te rather than honoring ${AUTOM4TE},
we'd have to create a temporary wrapper earlier in $PATH that
forwards to the real autom4te-x.yz - basically, repeating the
logic of what a wrapper script was supposed to do).  Further,
while the broken autom4te definitely hurts gettext 0.18.3, it
tends to have no issues with gettext 0.18.2; and since the
problem has been identified, it will not be long before fixed
autom4te and/or improved gettext that is not so stubborn
about using exactly 'autom4te' will be available.  Therefore,
for now we just warn about the situation.

* build-aux/bootstrap: Alert users to a broken autom4te.

Signed-off-by: Eric Blake <eblake@redhat.com>
autoupdate
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.
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: 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.
open-tests: fix build failure with -Werror=old-style-declaration

* tests/test-open.h: Reorder the inline to avoid the issue.