From patchwork Fri May 17 02:39:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164357 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1600900ili; Thu, 16 May 2019 19:42:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwM66lPvJkZ1h+B1OUITyXtUugC3DRhvdFioV0Wt2QC9gE0oORQK0GXCrJtEm+9bYmCHtsd X-Received: by 2002:a50:987c:: with SMTP id h57mr7453881edb.229.1558060946580; Thu, 16 May 2019 19:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558060946; cv=none; d=google.com; s=arc-20160816; b=SDGXYr4fvJZZmlw7bX34RR5bHKsGBAixmbuxQPXBCyFdZ3v1ALFIvcXt728qSsUPQ1 e+23c7opU+B/YaxaXoXdMWYdjrZXIMKn9JwAhVTY1Umsfmkng8ffOmsGv+hBs1smSF+A Jy7VifH9ijvYJnms10doX45BSVI532coNxDAqWNKP06eH3RpViZD8MTC1IArIOtG9yQ2 BRS4GSTQfypxJxF7qDfKO42R/rIF8RoJiGaAst5dqW4gr1XUjnLmfB2krtTzYAMEkaNB CK/i0LUXcYjAz1ppbohYg6F5FEcx6z3947RsOIzJRmtt7OJ5lYbM61H1byDLfbJVps0a N/Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=SGUkafzowNhGfO198gJSyccXFDaCJeH5m43hyisADpc=; b=JxhIXxWeSZUWLAfDlGcnmhRR1R5v/KJH5kGJglHtdmDawDXSOG0gF/keRvHcdHpHm+ mJGHZZUVqhLXd1JT0dxbJ3fK95zLAWM8Zh71E8fMmDG6VyetAnxoR9ssIli4m3V5Zni3 5tUIQlpqg9mO+OZUp02aqW+e8jJeIw4YgiphF38K3jc04Zb0Zt3h7E0Gl6AhTVuHokv+ OE+kdBVw6G/w0MCblGdNFwg8KG7q4NXQ8BWElTqzQPcTjELRUIVS9pTCVD2/3SD2naAt 9XE99HTz47Xbx31sZOefqiAB8vw/QNbDpe/DbXSxLuugbQQ+FJaJBBCXdZF9Ed5WHKzs ZjYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Pmpj2pAx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t46si721854edd.224.2019.05.16.19.42.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 16 May 2019 19:42:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Pmpj2pAx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:40132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRSpF-0008Ad-FI for patch@linaro.org; Thu, 16 May 2019 22:42:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRSmR-0005Mg-M5 for qemu-devel@nongnu.org; Thu, 16 May 2019 22:39:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRSmQ-0001xZ-62 for qemu-devel@nongnu.org; Thu, 16 May 2019 22:39:31 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:33028) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRSmP-0001w2-L8 for qemu-devel@nongnu.org; Thu, 16 May 2019 22:39:30 -0400 Received: by mail-pl1-x642.google.com with SMTP id y3so2604729plp.0 for ; Thu, 16 May 2019 19:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SGUkafzowNhGfO198gJSyccXFDaCJeH5m43hyisADpc=; b=Pmpj2pAxM5WczWEg8KtWkhrIds55/JPA7ZsnxUQCX5yCTljybBFBePbvTE4Qt9TzYa GlPLaW44l7ESDs9txelHlOvmRImXpC6teecA51/tQEEVAC9d9BXpleBcUcKFFmcJryq5 IKzagA/RZh62GGlToc5DHlQUdpiFd7SHZ2e+oIlhc7yVB0Jeu3aMrLr3PX6z8KOTUbQ2 SGKBs8h0BG6wAjGCyGhI0bcXwPHmwJKwXEzXMJMhothTVPIbm+0aiflPKmljbkdSydLq VcJX76lhdOgmIR8d2JaD3zRlXermRBzpiD8wPGHFeWtXa3sZczDVZb/EEOOtfMsDss5i /cYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SGUkafzowNhGfO198gJSyccXFDaCJeH5m43hyisADpc=; b=f63azmVYQbsO8N4ptP/21MY6UhExId1EnyHCpYZ7KhnQjKGApBNQzUnsaxxxmS/pXr EDRnVE7N8gtPHWsGlg+UqvLuuHJ+KqmUebzfU2FyiQWuBVcywJxoh9OKF+g79twvbq5S ieMIr5ylVycJ43McFmZNHik3FuJa/m+ROgenBOGG6lgx+s4SXaW82PkJ0nFTghZgK4yD 1uSnV0fBoNtV3cSK6VRxXkdeSFgvNd13q0JPbEVqah+PP4Q7hKPOGfxK+ncy0wHet8K0 I2hFdEyWBuSJNCTdsXPJhm0oi3ZPaRBRz8xXE2un76PoyCqDTU7ZmZlC8iGyBFFa3W1S SZ+g== X-Gm-Message-State: APjAAAW3ogYvbxRF8fGfhicuW4nXwPrP/dOTVZL9onJnDFfuu/k5+d2Q atAAOrCNo74yVOSuD9da/YGDSNqBACI= X-Received: by 2002:a17:902:24e:: with SMTP id 72mr7945996plc.168.1558060768225; Thu, 16 May 2019 19:39:28 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id w6sm6984152pge.30.2019.05.16.19.39.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 19:39:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 16 May 2019 19:39:00 -0700 Message-Id: <20190517023924.1686-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190517023924.1686-1-richard.henderson@linaro.org> References: <20190517023924.1686-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 Subject: [Qemu-devel] [PATCH v8 01/25] configure: Link test before auto-enabling crypto libraries X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, berrange@redhat.com, armbru@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" At least ubuntu 18.04 does not package static gnutls libraries. At least Fedora 30 does not ship static nettle and gcrypt libraries. Reviewed-by: Daniel P. Berrangé Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Message-Id: <20190510012458.22706-2-richard.henderson@linaro.org> Signed-off-by: Richard Henderson --- configure | 72 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 28 deletions(-) -- 2.17.1 diff --git a/configure b/configure index 8999698bc2..f8345368bf 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 @@ -2849,43 +2856,54 @@ has_libgcrypt() { if test "$nettle" != "no"; then + pass="no" if $pkg_config --exists "nettle >= 2.7.1"; then nettle_cflags=$($pkg_config --cflags nettle) nettle_libs=$($pkg_config --libs nettle) nettle_version=$($pkg_config --modversion nettle) - libs_softmmu="$nettle_libs $libs_softmmu" - libs_tools="$nettle_libs $libs_tools" - QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags" - nettle="yes" - - if test -z "$gcrypt"; then - gcrypt="no" + # Link test to make sure the given libraries work (e.g for static). + write_c_skeleton + if compile_prog "" "$nettle_libs" ; then + libs_softmmu="$nettle_libs $libs_softmmu" + libs_tools="$nettle_libs $libs_tools" + QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags" + if test -z "$gcrypt"; then + gcrypt="no" + fi + pass="yes" fi + fi + if test "$pass" = "no" && test "$nettle" = "yes"; then + feature_not_found "nettle" "Install nettle devel >= 2.7.1" else - if test "$nettle" = "yes"; then - feature_not_found "nettle" "Install nettle devel >= 2.7.1" - else - nettle="no" - fi + nettle="$pass" fi fi if test "$gcrypt" != "no"; then + pass="no" if has_libgcrypt; then gcrypt_cflags=$(libgcrypt-config --cflags) gcrypt_libs=$(libgcrypt-config --libs) - # Debian has remove -lgpg-error from libgcrypt-config + # Debian has removed -lgpg-error from libgcrypt-config # as it "spreads unnecessary dependencies" which in # turn breaks static builds... if test "$static" = "yes" then gcrypt_libs="$gcrypt_libs -lgpg-error" fi - libs_softmmu="$gcrypt_libs $libs_softmmu" - libs_tools="$gcrypt_libs $libs_tools" - QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags" - gcrypt="yes" + # Link test to make sure the given libraries work (e.g for static). + write_c_skeleton + if compile_prog "" "$gcrypt_libs" ; then + libs_softmmu="$gcrypt_libs $libs_softmmu" + libs_tools="$gcrypt_libs $libs_tools" + QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags" + pass="yes" + fi + fi + if test "$pass" = "yes"; then + gcrypt="yes" cat > $TMPC << EOF #include int main(void) { @@ -2898,12 +2916,10 @@ EOF if compile_prog "$gcrypt_cflags" "$gcrypt_libs" ; then gcrypt_hmac=yes fi + elif test "$gcrypt" = "yes"; then + feature_not_found "gcrypt" "Install gcrypt devel >= 1.5.0" else - if test "$gcrypt" = "yes"; then - feature_not_found "gcrypt" "Install gcrypt devel >= 1.5.0" - else - gcrypt="no" - fi + gcrypt="no" fi fi