summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2013-12-08 23:19:29 +0000
committerPádraig Brady <P@draigBrady.com>2013-12-09 12:32:09 +0000
commit8b5510050ddbf5bdee4a7cb89f8ee32e08aecd94 (patch)
tree5610bf39c3fa4d584f3716e33809db562f54ba35 /m4
parent43593319b31e6b0175b8eec4433bac744959822d (diff)
downloadgnulib-8b5510050ddbf5bdee4a7cb89f8ee32e08aecd94.tar.gz
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.
Diffstat (limited to 'm4')
-rw-r--r--m4/gc.m41
-rw-r--r--m4/gl-openssl.m45
2 files changed, 4 insertions, 2 deletions
diff --git a/m4/gc.m4 b/m4/gc.m4
index 3d133540ef..66736b8032 100644
--- a/m4/gc.m4
+++ b/m4/gc.m4
@@ -6,7 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_GC],
[
- LIB_CRYPTO=
AC_SUBST([LIB_CRYPTO])
AC_ARG_WITH([libgcrypt],
AS_HELP_STRING([--with-libgcrypt], [use libgcrypt for low-level crypto]),
diff --git a/m4/gl-openssl.m4 b/m4/gl-openssl.m4
index c8f9dd95e6..0434c4c872 100644
--- a/m4/gl-openssl.m4
+++ b/m4/gl-openssl.m4
@@ -12,8 +12,12 @@ 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:
@@ -29,7 +33,6 @@ AC_DEFUN([gl_CRYPTO_CHECK],
ALG_header=sha.h
fi
- LIB_CRYPTO=
AC_SUBST([LIB_CRYPTO])
if test "x$with_openssl" != xno; then
AC_CHECK_LIB([crypto], [$1],