bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] [PATCH 5/5] use pkg-config to check gnutls deps if available


From: Mike Frysinger
Subject: [Bug-wget] [PATCH 5/5] use pkg-config to check gnutls deps if available
Date: Mon, 27 Oct 2014 14:55:25 -0400

Newer versions of these packages ship with pkg-config files, so if we can
detect it via those, do so.  If that fails, fall back to the old methods.
---
 configure.ac | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index ec55fbb..3ca39be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -329,18 +329,26 @@ AS_IF([test x"$with_ssl" = xopenssl], [
     with_ssl=gnutls
 
     dnl Now actually check for -lgnutls
-    AC_LIB_HAVE_LINKFLAGS([gnutls], [], [
-#include <gnutls/gnutls.h>
-    ], [gnutls_global_init()])
-    if test x"$LIBGNUTLS" != x
-    then
-      ssl_found=yes
+    PKG_CHECK_MODULES([GNUTLS], [gnutls], [
       AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
       AC_LIBOBJ([gnutls])
-      LIBS="$LIBGNUTLS $LIBS"
-    else
-      AC_MSG_ERROR([--with-ssl=gnutls was given, but GNUTLS is not available.])
-    fi
+      LIBS="$GNUTLS_LIBS $LIBS"
+      CFLAGS="$GNUTLS_CFLAGS -DHAVE_LIBGNUTLS $CFLAGS"
+      AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define if using gnutls.])
+    ], [
+      AC_LIB_HAVE_LINKFLAGS([gnutls], [], [
+#include <gnutls/gnutls.h>
+      ], [gnutls_global_init()])
+      if test x"$LIBGNUTLS" != x
+      then
+        ssl_found=yes
+        AC_MSG_NOTICE([compiling in support for SSL via GnuTLS])
+        AC_LIBOBJ([gnutls])
+        LIBS="$LIBGNUTLS $LIBS"
+      else
+        AC_MSG_ERROR([--with-ssl=gnutls was given, but GNUTLS is not 
available.])
+      fi
+    ])
 
     AC_CHECK_FUNCS(gnutls_priority_set_direct)
   ]) # endif: --with-ssl != no?
-- 
2.1.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]