qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] libtasn1: check if static library is present


From: Laurent Vivier
Subject: [Qemu-devel] [PATCH] libtasn1: check if static library is present
Date: Fri, 2 Oct 2015 23:46:52 +0200

Some distros [1] don't ship systematically static libraries,
and pkg-config doesn't give us the information.

This is the case for libtasn1, so add a check in configure
to see if linker is able to find the library.

[1] https://fedoraproject.org/wiki/Archive:PackagingDrafts/StaticLibraryPolicy

Signed-off-by: Laurent Vivier <address@hidden>
---
 configure | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index f14454e..99d4269 100755
--- a/configure
+++ b/configure
@@ -2284,9 +2284,20 @@ fi
 tasn1=yes
 if $pkg_config --exists "libtasn1"; then
     tasn1_cflags=`$pkg_config --cflags libtasn1`
-    tasn1_libs=`$pkg_config --libs libtasn1`
-    test_cflags="$test_cflags $tasn1_cflags"
-    test_libs="$test_libs $tasn1_libs"
+    if test "$static" = "yes" ; then
+        # some distros (fedora) don't ship all static libraries
+        tasn1_libs=`$pkg_config --static --libs libtasn1`
+        if compile_prog "$tasn1_cflags" "$tasn1_libs" ; then
+            test_cflags="$test_cflags $tasn1_cflags"
+            test_libs="$test_libs $tasn1_libs"
+        else
+            tasn1=no
+        fi
+    else
+        tasn1_libs=`$pkg_config --libs libtasn1`
+        test_cflags="$test_cflags $tasn1_cflags"
+        test_libs="$test_libs $tasn1_libs"
+    fi
 else
     tasn1=no
 fi
-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]