use pkg-config to check gnutls deps if available

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.
This commit is contained in:
Mike Frysinger 2014-10-27 14:55:25 -04:00 committed by Giuseppe Scrivano
parent 5ae5d2eaeb
commit f48be4e0c6
2 changed files with 21 additions and 10 deletions

View File

@ -12,6 +12,9 @@
* configure.ac: Use pkg-config to check for openssl presence and
fallback to the previous code if that doesn't work.
* configure.ac: Use pkg-config to check for gnutls presence and
fallback to the previous code if that doesn't work.
2014-07-28 Ángel González <keisial@gmail.com>
* contrib: Created contrib folder.
* contrib/tsocked-wget: Added wrapper for usage with socks proxy.

View File

@ -348,18 +348,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?