aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2015-07-01 18:10:33 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2015-07-08 13:11:01 +0200
commit62893b67cd82bbd48b013c1cec25f0d863612c80 (patch)
treefdcded03d2afd85f14e082d1264808ac8b0e4abb /configure
parentca38a4cc9e36647437b837b346a41981fb8880cd (diff)
crypto: add a gcrypt cipher implementation
If we are linking to gnutls already and gnutls is built against gcrypt, then we should use gcrypt as a cipher backend in preference to our built-in backend. This will be used when linking against GNUTLS 1.x and many GNUTLS 2.x versions. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1435770638-25715-6-git-send-email-berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure29
1 files changed, 29 insertions, 0 deletions
diff --git a/configure b/configure
index 61a749edf3..f3c7ca62cf 100755
--- a/configure
+++ b/configure
@@ -2126,6 +2126,7 @@ fi
##########################################
# GNUTLS probe
+gnutls_gcrypt=no
if test "$gnutls" != "no"; then
if $pkg_config --exists "gnutls"; then
gnutls_cflags=`$pkg_config --cflags gnutls`
@@ -2141,6 +2142,18 @@ if test "$gnutls" != "no"; then
else
gnutls_hash="no"
fi
+
+ if $pkg_config --exists 'gnutls >= 3.0'; then
+ gnutls_gcrypt=no
+ elif $pkg_config --exists 'gnutls >= 2.12'; then
+ case `$pkg_config --libs --static gnutls` in
+ *gcrypt*) gnutls_gcrypt=yes ;;
+ *nettle*) gnutls_gcrypt=no ;;
+ *) gnutls_gcrypt=yes ;;
+ esac
+ else
+ gnutls_gcrypt=yes
+ fi
elif test "$gnutls" = "yes"; then
feature_not_found "gnutls" "Install gnutls devel"
else
@@ -2151,6 +2164,18 @@ else
gnutls_hash="no"
fi
+if test "$gnutls_gcrypt" != "no"; then
+ if has "libgcrypt-config"; then
+ gcrypt_cflags=`libgcrypt-config --cflags`
+ gcrypt_libs=`libgcrypt-config --libs`
+ libs_softmmu="$gcrypt_libs $libs_softmmu"
+ libs_tools="$gcrypt_libs $libs_tools"
+ QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags"
+ else
+ feature_not_found "gcrypt" "Install gcrypt devel"
+ fi
+fi
+
##########################################
# VTE probe
@@ -4463,6 +4488,7 @@ echo "SDL support $sdl"
echo "GTK support $gtk"
echo "GNUTLS support $gnutls"
echo "GNUTLS hash $gnutls_hash"
+echo "GNUTLS gcrypt $gnutls_gcrypt"
echo "VTE support $vte"
echo "curses support $curses"
echo "curl support $curl"
@@ -4827,6 +4853,9 @@ fi
if test "$gnutls_hash" = "yes" ; then
echo "CONFIG_GNUTLS_HASH=y" >> $config_host_mak
fi
+if test "$gnutls_gcrypt" = "yes" ; then
+ echo "CONFIG_GNUTLS_GCRYPT=y" >> $config_host_mak
+fi
if test "$vte" = "yes" ; then
echo "CONFIG_VTE=y" >> $config_host_mak
echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak