[systemd-devel] [PATCH] configure.ac: check if AM_PATH_LIBGCRYPT is a defined macro

Elia Pinto gitter.spiros at gmail.com
Mon May 6 09:46:38 PDT 2013


To search the libgcrypt support the developer are advised
to use the automake macro AM_PATH_LIBGCRYPT. But if libgcrypt-devel
is not installed the macro does not exist yet and so
configure goes wrong. This patch test first whether the macro is defined,
and if not it set  have_lgcrypt to false.

Signed-off-by: Elia Pinto <gitter.spiros at gmail.com>
---
 configure.ac |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 285fc44..688e393 100644
--- a/configure.ac
+++ b/configure.ac
@@ -454,12 +454,13 @@ AC_ARG_ENABLE([gcrypt],
                 [have_gcrypt=auto])
 
 if test "x${have_gcrypt}" != xno ; then
-        AM_PATH_LIBGCRYPT(
-                [1.4.5],
-                [have_gcrypt=yes],
-                [if test "x$have_gcrypt" = xyes ; then
+        m4_ifdef([AM_PATH_LIBGCRYPT],
+                  [AM_PATH_LIBGCRYPT(
+                  [1.4.5],
+                  [have_gcrypt=yes],
+                  [if test "x$have_gcrypt" = xyes ; then
                         AC_MSG_ERROR([*** GCRYPT headers not found.])
-                fi])
+                  fi]],[have_gcrypt=no])
 
         if test "x$have_gcrypt" = xyes ; then
                 GCRYPT_LIBS="$LIBGCRYPT_LIBS"
-- 
1.7.9.5



More information about the systemd-devel mailing list