diff mbox series

[v4,01/24] configure: Link test before auto-enabling gnutls

Message ID 20190506173353.32206-2-richard.henderson@linaro.org
State New
Headers show
Series Add qemu_getrandom and ARMv8.5-RNG etc | expand

Commit Message

Richard Henderson May 6, 2019, 5:33 p.m. UTC
At least ubuntu 18.04 does not package static gnutls libraries.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 configure | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

-- 
2.17.1

Comments

Laurent Vivier May 7, 2019, 8:28 a.m. UTC | #1
On 06/05/2019 19:33, Richard Henderson wrote:
> At least ubuntu 18.04 does not package static gnutls libraries.

> 

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>   configure | 19 +++++++++++++------

>   1 file changed, 13 insertions(+), 6 deletions(-)

> 


Reviewed-by: Laurent Vivier <lvivier@redhat.com>
diff mbox series

Patch

diff --git a/configure b/configure
index 5b183c2e39..daadfe9ad4 100755
--- a/configure
+++ b/configure
@@ -2784,17 +2784,24 @@  fi
 # GNUTLS probe
 
 if test "$gnutls" != "no"; then
+    pass="no"
     if $pkg_config --exists "gnutls >= 3.1.18"; then
         gnutls_cflags=$($pkg_config --cflags gnutls)
         gnutls_libs=$($pkg_config --libs gnutls)
-        libs_softmmu="$gnutls_libs $libs_softmmu"
-        libs_tools="$gnutls_libs $libs_tools"
-	QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags"
-        gnutls="yes"
-    elif test "$gnutls" = "yes"; then
+        # Packaging for the static libraries is not always correct.
+        # At least ubuntu 18.04 ships only shared libraries.
+        write_c_skeleton
+        if compile_prog "" "$gnutls_libs" ; then
+            libs_softmmu="$gnutls_libs $libs_softmmu"
+            libs_tools="$gnutls_libs $libs_tools"
+            QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags"
+            pass="yes"
+        fi
+    fi
+    if test "$pass" = "no" && test "$gnutls" = "yes"; then
 	feature_not_found "gnutls" "Install gnutls devel >= 3.1.18"
     else
-        gnutls="no"
+        gnutls="$pass"
     fi
 fi