]> Savannah Git Hosting - gnulib.git/commitdiff
gc: fix detection of installed libgcrypt version
authorMats Erik Andersson <gnu@gisladisker.se>
Fri, 25 Sep 2015 12:18:24 +0000 (14:18 +0200)
committerPádraig Brady <P@draigBrady.com>
Fri, 25 Sep 2015 14:16:03 +0000 (15:16 +0100)
* m4/gc.m4: Use AM_PATH_LIBCRYPT to test for libcrypt versions
at least as recent as 1.4.4.  The previously used macro is not
available now, since modules were removed in version 1.6.0.

ChangeLog
m4/gc.m4

index 3768f3dd874a01472523d54ea97ce512532dce4a..b42d31aaeb9b001b742d01cbdc241718fd799fa1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-09-25  Mats Erik Andersson  <gnu@gisladisker.se>
+
+       gc: fix detection of installed libgcrypt version
+       * m4/gc.m4: Use AM_PATH_LIBCRYPT to test for libcrypt versions
+       at least as recent as 1.4.4.  The previously used macro is not
+       available now, since modules were removed in version 1.6.0.
+
 2015-09-25  Paul Eggert  <eggert@cs.ucla.edu>
 
        c-ctype: rewrite to use inline functions
index 8f7d1d06b8d00b4b296b80db6e3eb56aab83d7b7..42ed827d4619bb89654f4e8a9e20bc7db7b2f0e9 100644 (file)
--- a/m4/gc.m4
+++ b/m4/gc.m4
@@ -1,4 +1,4 @@
-# gc.m4 serial 9
+# gc.m4 serial 10
 dnl Copyright (C) 2005-2015 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,14 +11,16 @@ AC_DEFUN([gl_GC],
     AS_HELP_STRING([--with-libgcrypt], [use libgcrypt for low-level crypto]),
     libgcrypt=$withval, libgcrypt=no)
   if test "$libgcrypt" != no; then
-    AC_LIB_HAVE_LINKFLAGS([gcrypt], [gpg-error], [
-#include <gcrypt.h>
-/* GCRY_MODULE_ID_USER was added in 1.4.4 and gc-libgcrypt.c
-   will fail on startup if we don't have 1.4.4 or later, so
-   test for it early. */
-#if !defined GCRY_MODULE_ID_USER
-error too old libgcrypt
-#endif
-])
+    # gc-libgcrypt.c will fail on startup if we don't have
+    # version 1.4.4 or later, so test for it early. */
+    gl_good_gcrypt=no
+    m4_ifdef([AM_PATH_LIBGCRYPT],
+      [AM_PATH_LIBGCRYPT([1.4.4], [gl_good_gcrypt=yes],
+       [AC_MSG_ERROR([libgcrypt is too old])])])
+    if test "x$gl_good_gcrypt" != xno; then
+      AC_LIB_HAVE_LINKFLAGS([gcrypt], [gpg-error], [#include <gcrypt.h>])
+    else
+      AC_MSG_ERROR([libgcrypt not found])
+    fi
   fi
 ])