From fdc17315b719320aae7e77a5f482b4865cd2f4d9 Mon Sep 17 00:00:00 2001 From: Stefan Gehn Date: Sat, 26 Nov 2011 20:00:53 +0100 Subject: [PATCH] Do not include gcrypt.h for newer GnuTLS versions Not linking against Libgcrypt is not enough, we also should not try to include headers. This fixes GnuTLS >= 2.12 detection when Libgcrypt headers are not installed/found. --- src/configure | 4 +++- src/mail.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/configure b/src/configure index 620f1e9..1be1c27 100755 --- a/src/configure +++ b/src/configure @@ -99,13 +99,15 @@ GNUTLS_INCLUDE="$(pkg-config gnutls --cflags 2>& 5 || true)" GNUTLS_LIBS="$(pkg-config gnutls --libs 2>& 5 || true) -lgnutls-openssl" # GnuTLS >= 2.12 does not need explicit gcrypt linking anymore +gcrypt_h="" if $(pkg-config --max-version=2.11.99 gnutls 2>& 5 || false); then GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt" + gcrypt_h="#include " fi cat << EOF > test.c #include -#include +$gcrypt_h #include int main() diff --git a/src/mail.c b/src/mail.c index 3ae5227..fa410a2 100644 --- a/src/mail.c +++ b/src/mail.c @@ -46,12 +46,13 @@ #if defined(HAVE_GNUTLS) #include -#include + #define MD5Init MD5_Init #define MD5Update MD5_Update #define MD5Final MD5_Final #if GNUTLS_VERSION_NUMBER <= 0x020b00 +#include /* gcrypt mutex setup is only needed for GnuTLS < 2.12 */ static int gk_gcry_glib_mutex_init (void **priv) {