]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
use pkg-config to detect nettle
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 30 May 2013 14:59:48 +0000 (16:59 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 31 May 2013 18:54:02 +0000 (20:54 +0200)
configure.ac
lib/Makefile.am
lib/gnutls.pc.in
m4/hooks.m4

index 41e5f62c0effc85741c26cd8e11a9ab66b4e39c6..61a5b7e655ea1629131c156e0abdfd8e8011d12f 100644 (file)
@@ -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],
index 2ddec34da453aa19c62b6b29f6df611aa5a967a3..f1e672c47dee03852a50e4bb5a6b8f8139fb257a 100644 (file)
@@ -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
 
index 7305fb127e10ff9af03e2456200df55e47acd00d..13f2d3ba1e0acd51897ef4823807e485c9346853 100644 (file)
@@ -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}
index 3173d8dba8d8c4b4ca39675f47f5c1a7239dc234..3439edb2a8e1efb455d9a7e5b9cedb54ad8c3be6 100644 (file)
@@ -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])