On 16/08/11 06:35, Rémy Oudompheng wrote:
The homemade check for libgpgme is kept because it is not included
in gpgme.m4. Additionnally, GPGME_CFLAGS (containing the include dirs)
is added to be CPPFLAGS variable, and GPGME_LIBS is added to the LIBADD
variable.

Signed-off-by: Rémy Oudompheng<[email protected]>
---
  configure.ac            |   15 ++-
  lib/libalpm/Makefile.am |    4 +-
  m4/gpgme.m4             |  307 +++++++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 319 insertions(+), 7 deletions(-)
  create mode 100644 m4/gpgme.m4

diff --git a/configure.ac b/configure.ac
index 2d52d6a..3a5cacc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,12 +160,15 @@ AM_CONDITIONAL([HAVE_LIBSSL], [test "x$with_openssl" = 
"xyes"])
  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],
+       AM_PATH_GPGME([],
+               [AC_CHECK_LIB([gpgme], [gpgme_check_version],
+                       [with_gpgme=yes],
+                       [AC_MSG_FAILURE([gpgme-config was found, but -lgpgme 
was not found, check your GPGME install])]
+                       [-lgpgme])],

This won't work. You check for the path to -lgpgme using AM_PATH_GPGME and then ignore it completely when checking for -lgpgme... We also need to test for gpgme.h.

The patch in the bug report (https://bugs.archlinux.org/task/24612) does this correctly but just needed adjusted to use AM_PATH_GPGME to get the initial path.


+               [if test "x$with_gpgme" != "xcheck"; then
+                       AC_MSG_FAILURE([--with-gpgme was given, but -lgpgme was 
not found])
+               fi
+               with_gpgme=no])],
        AC_MSG_RESULT(no))
  AM_CONDITIONAL([HAVE_LIBGPGME], [test "x$with_gpgme" = "xyes"])


Reply via email to