[PATCH 1/2] configure: Move check for <gnutls/crypto.h>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Checking for the availability of this header, just like checking
for the availability of gnutls_rnd(), requires CFLAGS and LIBS to
be set appropriately.

Fixes the following compilation errors on FreeBSD:

  qemu/qemu_domain.c:640:16: error: implicit declaration of function
   'gnutls_rnd' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      if ((ret = gnutls_rnd(GNUTLS_RND_RANDOM, key, nbytes)) < 0) {
                 ^
  qemu/qemu_domain.c:640:27: error: use of undeclared identifier
   'GNUTLS_RND_RANDOM'; did you mean 'GNUTLS_CRD_ANON'?
      if ((ret = gnutls_rnd(GNUTLS_RND_RANDOM, key, nbytes)) < 0) {
                            ^~~~~~~~~~~~~~~~~
                            GNUTLS_CRD_ANON
---
 configure.ac | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index c8c2895..1eb19ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1281,11 +1281,6 @@ if test "x$with_gnutls" != "xno"; then
         [set to 1 if it is known or assumed that GNUTLS uses gcrypt])
     fi
 
-    dnl gnutls 3.x moved some declarations to a new header
-    AC_CHECK_HEADERS([gnutls/crypto.h], [], [], [[
-      #include <gnutls/gnutls.h>
-    ]])
-
     with_gnutls=yes
   fi
 
@@ -1294,6 +1289,11 @@ if test "x$with_gnutls" != "xno"; then
   CFLAGS="$old_CFLAGS $GNUTLS_CFLAGS"
   LIBS="$old_LIBS $GNUTLS_LIBS"
 
+  dnl gnutls 3.x moved some declarations to a new header
+  AC_CHECK_HEADERS([gnutls/crypto.h], [], [], [[
+    #include <gnutls/gnutls.h>
+  ]])
+
   AC_CHECK_FUNCS([gnutls_rnd])
 
   CFLAGS="$old_CFLAGS"
-- 
2.5.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]