From patchwork Fri Oct 2 21:46:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 525824 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EC315140D79 for ; Sat, 3 Oct 2015 07:51:34 +1000 (AEST) Received: from localhost ([::1]:35348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi8Em-0002BX-Fh for incoming@patchwork.ozlabs.org; Fri, 02 Oct 2015 17:51:32 -0400 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 Received: from Quad.localdomain (unknown [78.238.229.36]) by smtp4-g21.free.fr (Postfix) with ESMTPS id BA59C4C8049; Fri, 2 Oct 2015 23:46:59 +0200 (CEST) From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 2 Oct 2015 23:46:52 +0200 Message-Id: <1443822412-29479-1-git-send-email-laurent@vivier.eu> X-Mailer: git-send-email 2.4.3 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 212.27.42.4 Cc: Paolo Bonzini , Laurent Vivier Subject: [Qemu-devel] [PATCH] libtasn1: check if static library is present X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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