build: Fix build without libgcrypt
authorStef Walter <stefw@gnome.org>
Wed, 8 Aug 2012 05:57:09 +0000 (07:57 +0200)
committerStef Walter <stefw@gnome.org>
Wed, 8 Aug 2012 05:57:09 +0000 (07:57 +0200)
 * Needed to use m4_ifdef on the libgcrypt autoconf macro

https://bugzilla.gnome.org/show_bug.cgi?id=681330

configure.ac

index 70295b8..138149e 100644 (file)
@@ -95,13 +95,19 @@ AC_ARG_ENABLE(gcrypt,
               ])
 
 if test "$enable_gcrypt" != "no"; then
-       AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_VERSION,,
-                         AC_MSG_ERROR([[
+
+       have_gcrypt="no"
+       m4_ifdef([AM_PATH_LIBGCRYPT],
+                [AM_PATH_LIBGCRYPT($GCRYPT_LIBVER:$GCRYPT_VERSION, have_gcrypt=yes)])
+
+       if test $have_gcrypt != "yes"; then
+               AC_MSG_ERROR([[
 ***
 *** libgcrypt was not found. You may want to get it from
 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
 ***
-                         ]]))
+               ]])
+       fi
 
        AC_DEFINE(WITH_GCRYPT, 1, [Build with libgcypt and transport encryption])
        AC_DEFINE_UNQUOTED(LIBGCRYPT_VERSION, "$GCRYPT_VERSION",