From bf87b99d728c20c72dbb50696b825b4072f323f7 Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Sat, 11 May 2013 18:27:26 +0400 Subject: [PATCH] build: avoid gcrypt deprecation warnings When combining old gcc (4.2.1) and new gcrypt (1.5.2), such as when using the Ports repository on FreeBSD, the build fails with: CC libvirt_driver_la-libvirt.lo cc1: warnings being treated as errors In file included from libvirt.c:58: /usr/local/include/gcrypt.h:1336: warning: 'gcry_ac_io_mode_t' is deprecated [-Wdeprecated-declarations] Relevant part of gcrypt.h: 1333 typedef struct gcry_ac_io 1334 { 1335 /* This is an INTERNAL structure, do NOT use manually. */ 1336 gcry_ac_io_mode_t mode _GCRY_ATTR_INTERNAL; 1337 gcry_ac_io_type_t type _GCRY_ATTR_INTERNAL; 1338 union The sad part is that we aren't even using the deprecated symbols - their mere inclusion in the installed header is provoking the problems. It looks like newer gcc is a bit more tolerant (that is, this is a shortcoming of FreeBSD's use of an older compiler). Signed-off-by: Eric Blake --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 53f78de11b..4a813cc13c 100644 --- a/configure.ac +++ b/configure.ac @@ -1090,6 +1090,10 @@ 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 + GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DGCRYPT_NO_DEPRECATED" + with_gnutls=yes fi -- 2.47.2