diff options
author | Olof Johansson <olofjn@axis.com> | 2015-09-17 10:42:55 +0200 |
---|---|---|
committer | Olof Johansson <olofjn@axis.com> | 2015-09-24 14:30:30 +0200 |
commit | 79e8bde40da4d18c553b64299ebb69f409260df4 (patch) | |
tree | eb1fc9d4b47497be5286e1557098204b0d23e917 | |
parent | 7ee7b225bd2fc3e7a3980f5fb7b10dfc6e205578 (diff) |
build-sys: only use AM_PATH_LIBGCRYPT macro if it exists
If gcrypt's m4 macro files aren't installed, with this change, gcrypt
will be disabled --- unless gcrypt support was explicitly requested by
passing --enable-gcrypt to configure, in which case it will fail.
Without this change, autoconf would fail either way with not being able
to resolve AM_PATH_LIBGCRYPT.
-rw-r--r-- | configure.ac | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 999f9f84d3..2505c62737 100644 --- a/configure.ac +++ b/configure.ac @@ -677,12 +677,21 @@ 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 - AC_MSG_ERROR([*** GCRYPT headers not found.]) - fi]) + m4_define([AM_PATH_LIBGCRYPT_FAIL], + [{ test "x$have_gcrypt" != xyes || AC_MSG_ERROR([*** GCRYPT headers not found.]); }] + ) + m4_ifdef([AM_PATH_LIBGCRYPT], [AM_PATH_LIBGCRYPT( + [1.4.5], + [have_gcrypt=yes], + dnl If we have the gcrypt m4 macros, but don't have + dnl gcrypt, throw an error if gcrypt is explicitly + dnl requested. + [AM_PATH_LIBGCRYPT_FAIL] + )], + dnl If we don't have the gcrypt m4 macros, but build with + dnl gcrypt explicitly requested, throw an error. + [AM_PATH_LIBGCRYPT_FAIL] + ) if test "x$have_gcrypt" = xyes ; then GCRYPT_LIBS="$LIBGCRYPT_LIBS" |