From 7d21d6b6975991c85e10aa4a9252286a0eb72bf2 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 28 May 2013 21:15:08 -0600 Subject: [PATCH] build: fix build with newer gnutls Building with gnutls 3.2.0 (such as shipped with current cygwin) fails with: rpc/virnettlscontext.c: In function 'virNetTLSSessionGetKeySize': rpc/virnettlscontext.c:1358:5: error: implicit declaration of function 'gnutls_cipher_get_key_size' [-Wimplicit-function-declaration] Yeah, it's stupid that gnutls broke API by moving their declaration into a new header without including that header from the old one, but it's easy enough to work around, all without breaking on gnutls 1.4.1 (hello RHEL 5) that lacked the new header. * configure.ac (gnutls): Check for . * src/rpc/virnettlscontext.c (includes): Include additional header. Signed-off-by: Eric Blake --- configure.ac | 9 +++++++-- src/rpc/virnettlscontext.c | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 2055637d7f..a9ee0bb6cc 100644 --- a/configure.ac +++ b/configure.ac @@ -1103,10 +1103,15 @@ if test "x$with_gnutls" != "xno"; then dnl it explicitly for the calls to gcry_control/check_version GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt" - dnl We're not using gcrypt deprecated features so define GCRYPT_NO_DEPRECATED - dnl to avoid deprecated warnings + dnl We're not using gcrypt deprecated features so define + dnl GCRYPT_NO_DEPRECATED to avoid deprecated warnings GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DGCRYPT_NO_DEPRECATED" + dnl gnutls 3.x moved some declarations to a new header + AC_CHECK_HEADERS([gnutls/crypto.h], [], [], [[ + #include + ]]) + with_gnutls=yes fi diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c index e29c4392b2..f2ac5510d4 100644 --- a/src/rpc/virnettlscontext.c +++ b/src/rpc/virnettlscontext.c @@ -25,6 +25,9 @@ #include #include +#if HAVE_GNULTLS_CRYPTO_H +# include +#endif #include #include "gnutls_1_0_compat.h" -- 2.39.5