From 97be2f0e0a0daad2f9058377c7dbee62cc7a8718 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 24 Apr 2011 11:40:58 -0500 Subject: Allow conditional compilation with GPGME MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it possible to omit usage of -lgpgme, just as we can do for -lcurl and -lcrypto. Thanks to Rémy Oudompheng for an initial stab at this. Signed-off-by: Dan McGee --- configure.ac | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b5fdfff8..738cd7fa 100644 --- a/configure.ac +++ b/configure.ac @@ -93,6 +93,11 @@ AC_ARG_WITH(openssl, AS_HELP_STRING([--with-openssl], [use OpenSSL crypto implementations instead of internal routines]), [], [with_openssl=check]) +# Help line for using gpgme +AC_ARG_WITH(gpgme, + AS_HELP_STRING([--with-gpgme], [use GPGME for PGP signature verification]), + [], [with_gpgme=check]) + # Check for useable libcurl LIBCURL_CHECK_CONFIG([yes], [7.19.4]) @@ -151,8 +156,17 @@ AS_IF([test "x$with_openssl" != "xno"], AM_CONDITIONAL([HAVE_LIBSSL], [test "x$ac_cv_lib_ssl_MD5_Final" = "xyes"]) # Check for gpgme -AC_CHECK_LIB([gpgme], [gpgme_check_version], , - AC_MSG_ERROR([gpgme is needed to compile pacman!])) +AC_MSG_CHECKING(whether to link with libgpgme) +AS_IF([test "x$with_gpgme" != "xno"], + [AC_MSG_RESULT(yes) + AC_CHECK_LIB([gpgme], [gpgme_check_version], , + [if test "x$with_gpgme" != "xcheck"; then + AC_MSG_FAILURE([--with-ggpme was given, but -lgpgme was not found]) + fi], + [-lgpgme]) + with_gpgme=$ac_cv_lib_gpgme_gpgme_check_version], + AC_MSG_RESULT(no)) +AM_CONDITIONAL([HAVE_LIBGPGME], [test "x$with_gpgme" = "xyes"]) # Checks for header files. AC_CHECK_HEADERS([fcntl.h glob.h libintl.h locale.h mntent.h string.h \ -- cgit v1.2.3-70-g09d2