mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
configure: check gnutls related stuff only if gnutls was found
This fixes a build issue with old gnutls. Broken by commit 680d2f49da. Reported-by: Olga Krishtal <okrishtal@virtuozzo.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
e8861f6971
commit
a55fdc3f25
@ -20,41 +20,43 @@ dnl
|
|||||||
AC_DEFUN([LIBVIRT_CHECK_GNUTLS],[
|
AC_DEFUN([LIBVIRT_CHECK_GNUTLS],[
|
||||||
LIBVIRT_CHECK_PKG([GNUTLS], [gnutls], [2.2.0])
|
LIBVIRT_CHECK_PKG([GNUTLS], [gnutls], [2.2.0])
|
||||||
|
|
||||||
dnl Double probe: gnutls >= 2.12 had a configure option for gcrypt and
|
if test "$with_gnutls" = "yes" ; then
|
||||||
dnl gnutls >= 3.0 uses only nettle. Our goal is to avoid gcrypt if we
|
dnl Double probe: gnutls >= 2.12 had a configure option for gcrypt and
|
||||||
dnl can prove gnutls uses nettle, but it is a safe fallback to use gcrypt
|
dnl gnutls >= 3.0 uses only nettle. Our goal is to avoid gcrypt if we
|
||||||
dnl if we can't prove anything.
|
dnl can prove gnutls uses nettle, but it is a safe fallback to use gcrypt
|
||||||
|
dnl if we can't prove anything.
|
||||||
|
|
||||||
GNUTLS_GCRYPT=
|
GNUTLS_GCRYPT=
|
||||||
if $PKG_CONFIG --exists 'gnutls >= 3.0'; then
|
if $PKG_CONFIG --exists 'gnutls >= 3.0'; then
|
||||||
GNUTLS_GCRYPT="no"
|
GNUTLS_GCRYPT="no"
|
||||||
else
|
else
|
||||||
GNUTLS_GCRYPT="probe"
|
GNUTLS_GCRYPT="probe"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$GNUTLS_GCRYPT" = "probe"; then
|
||||||
|
case $($PKG_CONFIG --libs --static gnutls) in
|
||||||
|
*gcrypt*) GNUTLS_GCRYPT=yes ;;
|
||||||
|
*nettle*) GNUTLS_GCRYPT=no ;;
|
||||||
|
*) GNUTLS_GCRYPT=unknown ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$GNUTLS_GCRYPT" = "yes" || test "$GNUTLS_GCRYPT" = "unknown"; then
|
||||||
|
GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
|
||||||
|
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"
|
||||||
|
AC_DEFINE_UNQUOTED([WITH_GNUTLS_GCRYPT], 1,
|
||||||
|
[set to 1 if it is known or assumed that GNUTLS uses gcrypt])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_HEADERS([gnutls/crypto.h], [], [], [[
|
||||||
|
#include <gnutls/gnutls.h>
|
||||||
|
]])
|
||||||
|
|
||||||
|
AC_CHECK_FUNC([gnutls_rnd])
|
||||||
|
AC_CHECK_FUNC([gnutls_cipher_encrypt])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$GNUTLS_GCRYPT" = "probe"; then
|
|
||||||
case $($PKG_CONFIG --libs --static gnutls) in
|
|
||||||
*gcrypt*) GNUTLS_GCRYPT=yes ;;
|
|
||||||
*nettle*) GNUTLS_GCRYPT=no ;;
|
|
||||||
*) GNUTLS_GCRYPT=unknown ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$GNUTLS_GCRYPT" = "yes" || test "$GNUTLS_GCRYPT" = "unknown"; then
|
|
||||||
GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
|
|
||||||
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"
|
|
||||||
AC_DEFINE_UNQUOTED([WITH_GNUTLS_GCRYPT], 1,
|
|
||||||
[set to 1 if it is known or assumed that GNUTLS uses gcrypt])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_CHECK_HEADERS([gnutls/crypto.h], [], [], [[
|
|
||||||
#include <gnutls/gnutls.h>
|
|
||||||
]])
|
|
||||||
|
|
||||||
AC_CHECK_FUNC([gnutls_rnd])
|
|
||||||
AC_CHECK_FUNC([gnutls_cipher_encrypt])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([LIBVIRT_RESULT_GNUTLS],[
|
AC_DEFUN([LIBVIRT_RESULT_GNUTLS],[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user