summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-05-30 16:59:48 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-05-31 20:54:02 +0200
commit2fd2c9199026883c396371e2ebdc816d0fe55160 (patch)
tree5cf5e243a9461504ee9e5c9bae01d004d306b2f1
parent82bc0cea6df23d7ba9ede3dbe4a0427c372280bd (diff)
downloadgnutls-2fd2c9199026883c396371e2ebdc816d0fe55160.tar.gz
use pkg-config to detect nettle
-rw-r--r--configure.ac1
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/gnutls.pc.in2
-rw-r--r--m4/hooks.m452
4 files changed, 18 insertions, 39 deletions
diff --git a/configure.ac b/configure.ac
index 41e5f62c0e..61a5b7e655 100644
--- a/configure.ac
+++ b/configure.ac
@@ -256,7 +256,6 @@ fi
AC_DEFINE_UNQUOTED([UNBOUND_ROOT_KEY_FILE],
["$unbound_root_key_file"], [The DNSSEC root key file])
-
dnl Check for p11-kit
AC_ARG_WITH(p11-kit,
AS_HELP_STRING([--without-p11-kit],
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 2ddec34da4..f1e672c47d 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -140,7 +140,7 @@ thirdparty_libadd += $(LIBTASN1_LIBS)
endif
if ENABLE_NETTLE
-thirdparty_libadd += $(LTLIBNETTLE)
+thirdparty_libadd += $(NETTLE_LIBS) $(HOGWEED_LIBS)
libgnutls_la_LIBADD += nettle/libcrypto.la
endif
diff --git a/lib/gnutls.pc.in b/lib/gnutls.pc.in
index 7305fb127e..13f2d3ba1e 100644
--- a/lib/gnutls.pc.in
+++ b/lib/gnutls.pc.in
@@ -19,6 +19,6 @@ Description: Transport Security Layer implementation for the GNU system
URL: http://www.gnutls.org/
Version: @VERSION@
Libs: -L${libdir} -lgnutls
-Libs.private: @LTLIBNETTLE@ @LTLIBZ@ @LTLIBINTL@ @LIBSOCKET@ @LTLIBPTHREAD@ @LTLIBICONV@ @P11_KIT_LIBS@ @LIB_SELECT@ @TSS_LIBS@
+Libs.private: @LTLIBZ@ @LTLIBINTL@ @LIBSOCKET@ @LTLIBPTHREAD@ @LTLIBICONV@ @P11_KIT_LIBS@ @LIB_SELECT@ @TSS_LIBS@
@GNUTLS_REQUIRES_PRIVATE@
Cflags: -I${includedir}
diff --git a/m4/hooks.m4 b/m4/hooks.m4
index 3173d8dba8..3439edb2a8 100644
--- a/m4/hooks.m4
+++ b/m4/hooks.m4
@@ -65,43 +65,23 @@ AC_DEFUN([LIBGNUTLS_HOOKS],
DLL_VERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
AC_SUBST(DLL_VERSION)
- cryptolib="nettle"
-
-dnl AC_ARG_WITH(libgcrypt,
-dnl AS_HELP_STRING([--with-libgcrypt], [use libgcrypt as crypto library]),
-dnl libgcrypt=$withval,
-dnl libgcrypt=no)
-dnl if test "$libgcrypt" = "yes"; then
-dnl cryptolib=libgcrypt
-dnl AC_DEFINE([HAVE_GCRYPT], 1, [whether the gcrypt library is in use])
-dnl AC_LIB_HAVE_LINKFLAGS([gcrypt], [gpg-error], [#include <gcrypt.h>],
-dnl [enum gcry_cipher_algos i = GCRY_CIPHER_CAMELLIA128])
-dnl if test "$ac_cv_libgcrypt" != yes; then
-dnl AC_MSG_ERROR([[
-dnl***
-dnl*** Libgcrypt v1.4.0 or later was not found. You may want to get it from
-dnl*** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
-dnl***
-dnl ]])
-dnl fi
-dnl fi
-
- AC_MSG_CHECKING([whether to use nettle])
-if test "$cryptolib" = "nettle";then
- AC_MSG_RESULT(yes)
- AC_LIB_HAVE_LINKFLAGS([nettle], [hogweed gmp], [#include <nettle/umac.h>],
- [nettle_umac96_set_nonce (0,0,0)])
- if test "$ac_cv_libnettle" != yes; then
- AC_MSG_ERROR([[
+ PKG_CHECK_MODULES(NETTLE, [nettle >= 2.7], [cryptolib="nettle"], [
+AC_MSG_ERROR([[
***
- *** Libnettle 2.7 was not found. Note that you must compile nettle with gmp support.
- ]])
- fi
-else
- AC_MSG_RESULT(no)
-fi
+ *** Libnettle 2.7 was not found.
+]])
+ ])
+ PKG_CHECK_MODULES(HOGWEED, [hogweed >= 2.7], [], [
+AC_MSG_ERROR([[
+ ***
+ *** Libhogweed (nettle's companion library) was not found. Note that you must compile nettle with gmp support.
+]])
+ ])
AM_CONDITIONAL(ENABLE_NETTLE, test "$cryptolib" = "nettle")
-
+ AC_DEFINE([HAVE_LIBNETTLE], 1, [nettle is enabled])
+
+ GNUTLS_REQUIRES_PRIVATE="Requires.private: nettle, hogweed"
+
AC_ARG_WITH(included-libtasn1,
AS_HELP_STRING([--with-included-libtasn1], [use the included libtasn1]),
included_libtasn1=$withval,
@@ -120,7 +100,7 @@ fi
AM_CONDITIONAL(ENABLE_MINITASN1, test "$included_libtasn1" = "yes")
if test "$included_libtasn1" = "no"; then
- GNUTLS_REQUIRES_PRIVATE="Requires.private: libtasn1"
+ GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, libtasn1"
fi
AC_MSG_CHECKING([whether C99 macros are supported])