summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-03-30 23:08:31 -0400
committerDave Reisner <dreisner@archlinux.org>2012-04-08 22:28:41 -0400
commitcb5b66367ddf4af05953a9486bddaaf105fb4f38 (patch)
treece786ce2390ec37634bb946c4d99c25c46e8be37
parentb2226ed11bca158ab32199b5899802a78a42f5aa (diff)
buildsys: cleanup gpgme compile time check
- handle gpgme libs and cflags separately rather than appending to CFLAGS and LDFLAGS - be consistent in AC_LINK_IFELSE check for gpgme 1.3.0 (though this is irrelephant since we don't actually run) - be consistent with usage of "have" and "with" variables (this actually ends up reducing SLOC) - when voluntary detection fails, unset GPGME_CFLAGS and GPGME_LIBS - when requested support fails the version check, complain about the min version. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r--configure.ac41
-rw-r--r--lib/libalpm/Makefile.am2
2 files changed, 23 insertions, 20 deletions
diff --git a/configure.ac b/configure.ac
index ddcf535d..ac25a9d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,11 +186,9 @@ AS_IF([test "x$with_gpgme" != "xno"],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
-require_gpgme=no
+have_gpgme=no
AS_IF([test "x$with_gpgme" != "xno"],
- [AS_IF([test "x$with_gpgme" = "xyes"],
- [require_gpgme=yes])
- AM_PATH_GPGME([1.3.0],
+ [AM_PATH_GPGME([1.3.0],
[LIBS_save="$LIBS"
CPPFLAGS_save="$CPPFLAGS"
CFLAGS_save="$CFLAGS"
@@ -203,23 +201,26 @@ AS_IF([test "x$with_gpgme" != "xno"],
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <gpgme.h>]],
- [[const char *ver;
-ver = gpgme_check_version("1.2.4");]])],
+ [[return gpgme_check_version("1.3.0");]])],
[AC_MSG_RESULT([yes])
- with_gpgme=yes
+ have_gpgme=yes
AC_DEFINE([HAVE_LIBGPGME], [1], [Define if gpgme should be used to provide GPG signature support.])],
[AC_MSG_RESULT([no])
- with_gpgme=no
- LIBS="$LIBS_save"
- CPPFLAGS="$CPPFLAGS_save"
- CFLAGS="$CFLAGS_save"])],
- [with_gpgme=no])])
-AS_IF([test "x$with_gpgme" != "xyes"],
- [AS_IF([test "x$require_gpgme" = "xyes"],
- [AC_MSG_FAILURE([--with-gpgme was given, but gpgme was not found])])
- with_gpgme=no])
-
-AM_CONDITIONAL([HAVE_LIBGPGME], [test "x$with_gpgme" = "xyes"])
+ have_gpgme=no
+ unset GPGME_LIBS
+ unset GPGME_CFLAGS]
+ AS_IF([test "x$with_gpgme" = "xyes"],
+ [AC_MSG_FAILURE([*** gpgme >= 1.3.0 is needed for GPG signature support])])
+ )],
+ [with_gpgme=no])]
+ [LIBS="$LIBS_save"
+ CPPFLAGS="$CPPFLAGS_save"
+ CFLAGS="$CFLAGS_save"
+ unset CPPFLAGS_save
+ unset CFLAGS_save])
+AS_IF([test "x$have_gpgme" = xno -a "x$with_gpgme" = xyes],
+ [AC_MSG_FAILURE([--with-gpgme was given, but gpgme was not found])])
+AM_CONDITIONAL([HAVE_LIBGPGME], [test "x$have_gpgme" = "xyes"])
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h float.h glob.h libintl.h limits.h locale.h \
@@ -425,7 +426,7 @@ ${PACKAGE_NAME}:
preprocessor flags : ${CPPFLAGS}
compiler flags : ${CFLAGS}
defines : ${DEFS}
- library flags : ${LIBS} ${LIBSSL_LIBS} ${LIBARCHIVE_LIBS} ${LIBCURL_LIBS}
+ library flags : ${LIBS} ${LIBSSL_LIBS} ${LIBARCHIVE_LIBS} ${LIBCURL_LIBS} ${GPGME_LIBS}
linker flags : ${LDFLAGS}
Architecture : ${CARCH}
@@ -446,7 +447,7 @@ ${PACKAGE_NAME}:
Compilation options:
Use libcurl : ${have_libcurl}
- Use GPGME : ${with_gpgme}
+ Use GPGME : ${have_gpgme}
Use OpenSSL : ${have_openssl}
Run make in doc/ dir : ${wantdoc} ${asciidoc}
Doxygen support : ${usedoxygen}
diff --git a/lib/libalpm/Makefile.am b/lib/libalpm/Makefile.am
index c34079c7..31de62e3 100644
--- a/lib/libalpm/Makefile.am
+++ b/lib/libalpm/Makefile.am
@@ -67,12 +67,14 @@ libalpm_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_INFO)
libalpm_la_CFLAGS = \
$(AM_CFLAGS) \
+ $(GPGME_CFLAGS) \
$(LIBARCHIVE_CFLAGS) \
$(LIBCURL_CFLAGS) \
$(LIBSSL_CFLAGS)
libalpm_la_LIBADD = \
$(LTLIBINTL) \
+ $(GPGME_LIBS) \
$(LIBARCHIVE_LIBS) \
$(LIBCURL_LIBS) \
$(LIBSSL_LIBS)