From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi8AU-0000zt-Ui for qemu-devel@nongnu.org; Fri, 02 Oct 2015 17:47:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zi8AP-0001P7-6h for qemu-devel@nongnu.org; Fri, 02 Oct 2015 17:47:06 -0400 Received: from smtp4-g21.free.fr ([212.27.42.4]:21550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi8AP-0001Nv-0y for qemu-devel@nongnu.org; Fri, 02 Oct 2015 17:47:01 -0400 From: Laurent Vivier Date: Fri, 2 Oct 2015 23:46:52 +0200 Message-Id: <1443822412-29479-1-git-send-email-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] libtasn1: check if static library is present List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Laurent Vivier 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]=C2=A0https://fedoraproject.org/wiki/Archive:PackagingDrafts/StaticLib= raryPolicy Signed-off-by: Laurent Vivier --- 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=3Dyes if $pkg_config --exists "libtasn1"; then tasn1_cflags=3D`$pkg_config --cflags libtasn1` - tasn1_libs=3D`$pkg_config --libs libtasn1` - test_cflags=3D"$test_cflags $tasn1_cflags" - test_libs=3D"$test_libs $tasn1_libs" + if test "$static" =3D "yes" ; then + # some distros (fedora) don't ship all static libraries + tasn1_libs=3D`$pkg_config --static --libs libtasn1` + if compile_prog "$tasn1_cflags" "$tasn1_libs" ; then + test_cflags=3D"$test_cflags $tasn1_cflags" + test_libs=3D"$test_libs $tasn1_libs" + else + tasn1=3Dno + fi + else + tasn1_libs=3D`$pkg_config --libs libtasn1` + test_cflags=3D"$test_cflags $tasn1_cflags" + test_libs=3D"$test_libs $tasn1_libs" + fi else tasn1=3Dno fi --=20 2.4.3