From patchwork Fri Jul 24 17:28:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 51462 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 4E61022D94 for ; Fri, 24 Jul 2015 17:28:12 +0000 (UTC) Received: by lbbvz8 with SMTP id vz8sf9557396lbb.2 for ; Fri, 24 Jul 2015 10:28:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Jl+t4r0t6/PTRz3uG0kaamyZwkHGYrOJIZ9Rjv3tLbM=; b=LSBJXWukTF5H/ZvwjPYsb1EqTLpX2uVksvHuXCwAmVDPHUyNweYaDF+gv1UDy9fHV0 qMBxi8hnGLdZNa710YUA3DeYejvxS8hlRJEpdAPKpUng1mfYahENfaQvZHhvNBe+CCuI EsnPbq1MjWAkwRpfWElzhGOcE4mfQqlSgSQqug+aeveYNQsIoeQECuyQGrPM9lt2TIIW 2WkePglsh9DplUl8W9VlYQ0yFwOfQ1WBcoedUjaCwSJmJK0R2pDzytQxmDS3UxSuAv75 GF0T8bo4nIIPlMnpQiqg3Td44PVpaJ+bF3zjfNldQJjldmMTCCw0SlJToxF/sqSG8oBS Kgig== X-Gm-Message-State: ALoCoQkdIiiyzjGpgC8l3/DUznMCDWaQfIY2JbnxKtbAX35JujrlKOAj7CskKnPAbwMasChBT3x9 X-Received: by 10.194.173.3 with SMTP id bg3mr6607576wjc.5.1437758891128; Fri, 24 Jul 2015 10:28:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.35 with SMTP id s3ls436036lae.29.gmail; Fri, 24 Jul 2015 10:28:10 -0700 (PDT) X-Received: by 10.152.238.2 with SMTP id vg2mr4115889lac.12.1437758890880; Fri, 24 Jul 2015 10:28:10 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id zd10si8071019lbb.169.2015.07.24.10.28.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2015 10:28:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbqi7 with SMTP id qi7so19462433lbb.3 for ; Fri, 24 Jul 2015 10:28:10 -0700 (PDT) X-Received: by 10.152.1.66 with SMTP id 2mr15085141lak.56.1437758890737; Fri, 24 Jul 2015 10:28:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.7.198 with SMTP id l6csp126159lba; Fri, 24 Jul 2015 10:28:10 -0700 (PDT) X-Received: by 10.180.77.40 with SMTP id p8mr9606613wiw.29.1437758889938; Fri, 24 Jul 2015 10:28:09 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id eu13si5421873wid.52.2015.07.24.10.28.09 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 24 Jul 2015 10:28:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZIglU-0005r9-2A; Fri, 24 Jul 2015 18:28:08 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Paolo Bonzini , "Daniel P. Berrange" Subject: [PATCH] configure: Work around broken static pkg-config info for Ubuntu gnutls Date: Fri, 24 Jul 2015 18:28:08 +0100 Message-Id: <1437758888-22486-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Unfortunately Ubuntu's pkg-config information for gnutls is broken for the static linking case, and outputs --libs options which the compiler does not recognize. Work around this problem by testing that the --cflags/--libs output will at least allow compilation before enabling gnutls support. Signed-off-by: Peter Maydell --- configure | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/configure b/configure index cc0338d..704b34c 100755 --- a/configure +++ b/configure @@ -2116,10 +2116,26 @@ fi ########################################## # GNUTLS probe +gnutls_works() { + # Unfortunately some distros have bad pkg-config information for gnutls + # such that it claims to exist but you get a compiler error if you try + # to use the options returned by --libs. Specifically, Ubuntu for --static + # builds doesn't work: + # https://bugs.launchpad.net/ubuntu/+source/gnutls26/+bug/1478035 + # + # So sanity check the cflags/libs before assuming gnutls can be used. + if ! $pkg_config --exists "gnutls"; then + return 1 + fi + + write_c_skeleton + compile_prog "$($pkg_config --cflags gnutls)" "$($pkg_config --libs gnutls)" +} + gnutls_gcrypt=no gnutls_nettle=no if test "$gnutls" != "no"; then - if $pkg_config --exists "gnutls"; then + if gnutls_works; then gnutls_cflags=`$pkg_config --cflags gnutls` gnutls_libs=`$pkg_config --libs gnutls` libs_softmmu="$gnutls_libs $libs_softmmu"