[pacman-dev] [PATCH 05/11] buildsys: handle gpgme libs and cflags separately

Dave Reisner dreisner at archlinux.org
Mon Apr 2 17:15:50 EDT 2012


We should not attempt to modify the CFLAGS or LDFLAGS passed into the
environment. In the case of gpgme detection being wanted and successful,
use the variables defined by gpgme's m4 macro.

Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 configure.ac            |   10 +++++-----
 lib/libalpm/Makefile.am |    2 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 573cda3..1b95211 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,14 +203,14 @@ AS_IF([test "x$with_gpgme" != "xno"],
 				[[#include <gpgme.h>]],
 				[[const char *ver;
 ver = gpgme_check_version("1.2.4");]])],
+			LIBS="$LIBS_save"
+			CPPFLAGS="$CPPFLAGS_save"
+			CFLAGS="$CFLAGS_save"
 			[AC_MSG_RESULT([yes])
 			with_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])],
 		[with_gpgme=no])])
 AS_IF([test "x$with_gpgme" != "xyes"],
 	[AS_IF([test "x$require_gpgme" = "xyes"],
@@ -422,7 +422,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}
diff --git a/lib/libalpm/Makefile.am b/lib/libalpm/Makefile.am
index e2e5dc4..c316fca 100644
--- a/lib/libalpm/Makefile.am
+++ b/lib/libalpm/Makefile.am
@@ -67,6 +67,7 @@ libalpm_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_INFO)
 
 libalpm_la_CFLAGS = \
 	$(AM_CFLAGS) \
+	$(GPGME_CFLAGS) \
 	$(LIBARCHIVE_CFLAGS) \
 	$(LIBCURL_CFLAGS) \
 	$(LIBSSL_CFLAGS)
@@ -76,5 +77,6 @@ libalpm_la_LIBADD = \
 	$(LIBSSL_LIBS) \
 	$(LIBARCHIVE_LIBS) \
 	$(LIBCURL_LIBS) \
+	$(GPGME_LIBS)
 
 # vim:set ts=2 sw=2 noet:
-- 
1.7.9.5



More information about the pacman-dev mailing list