]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: avoid gcrypt deprecation warnings
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sat, 11 May 2013 14:27:26 +0000 (18:27 +0400)
committerEric Blake <eblake@redhat.com>
Mon, 13 May 2013 22:07:26 +0000 (16:07 -0600)
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 <eblake@redhat.com>
configure.ac

index 53f78de11babc2eda3f899398300ff904bfdc50c..4a813cc13caf241357c81116d86503e358999817 100644 (file)
@@ -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