From nobody Tue Feb 10 20:48:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1558060909; cv=none; d=zoho.com; s=zohoarc; b=lKLdp+eXzA9eOVT/Ojin1T0ZrYnhM5Az4BQu7o9cHEkTcuxGFdLABY8z4pROEkTRoYnsbPlFCfmey0RHPQNo/vNn5oQFstQhk51fmJi1Cxax7Tue3BYWvPxCqOpjMuHCRa2z/PBwGF/t8vY9PCDTweRfDKtUKfFgYh7vyJm/eI0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558060909; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=SGUkafzowNhGfO198gJSyccXFDaCJeH5m43hyisADpc=; b=oeqpL6cJtBnvLh4hEbC2gGUqaDR63f+vFRtC7dYdLaECPBEnyBNi7JS36PaA2dfXz4Uz7CBM6Lvuz4IiHFhl5TcX61mvF0uZRBOBUA+yCe3vR6pO+EV2v9AV93DBUwmB1vpi3KYbPJKYCJlgitOMmQRKjVJ4OBs5xAM0DZvBwrA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558060909142394.4899755541783; Thu, 16 May 2019 19:41:49 -0700 (PDT) Received: from localhost ([127.0.0.1]:40124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRSoP-0006mD-NS for importer@patchew.org; Thu, 16 May 2019 22:41:33 -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) 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) 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-Google-Smtp-Source: APXvYqzP7rMm9/kUhfkfUPsKbsNF+CLHj+FhTr8DlNfOc0KNw+YMCUEk5fPPQTxAa+f5HNHHSlsxjw== X-Received: by 2002:a17:902:24e:: with SMTP id 72mr7945996plc.168.1558060768225; Thu, 16 May 2019 19:39:28 -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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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=C3=A9 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(-) diff --git a/configure b/configure index 8999698bc2..f8345368bf 100755 --- a/configure +++ b/configure @@ -2784,17 +2784,24 @@ fi # GNUTLS probe =20 if test "$gnutls" !=3D "no"; then + pass=3D"no" if $pkg_config --exists "gnutls >=3D 3.1.18"; then gnutls_cflags=3D$($pkg_config --cflags gnutls) gnutls_libs=3D$($pkg_config --libs gnutls) - libs_softmmu=3D"$gnutls_libs $libs_softmmu" - libs_tools=3D"$gnutls_libs $libs_tools" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $gnutls_cflags" - gnutls=3D"yes" - elif test "$gnutls" =3D "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=3D"$gnutls_libs $libs_softmmu" + libs_tools=3D"$gnutls_libs $libs_tools" + QEMU_CFLAGS=3D"$QEMU_CFLAGS $gnutls_cflags" + pass=3D"yes" + fi + fi + if test "$pass" =3D "no" && test "$gnutls" =3D "yes"; then feature_not_found "gnutls" "Install gnutls devel >=3D 3.1.18" else - gnutls=3D"no" + gnutls=3D"$pass" fi fi =20 @@ -2849,43 +2856,54 @@ has_libgcrypt() { =20 =20 if test "$nettle" !=3D "no"; then + pass=3D"no" if $pkg_config --exists "nettle >=3D 2.7.1"; then nettle_cflags=3D$($pkg_config --cflags nettle) nettle_libs=3D$($pkg_config --libs nettle) nettle_version=3D$($pkg_config --modversion nettle) - libs_softmmu=3D"$nettle_libs $libs_softmmu" - libs_tools=3D"$nettle_libs $libs_tools" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $nettle_cflags" - nettle=3D"yes" - - if test -z "$gcrypt"; then - gcrypt=3D"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=3D"$nettle_libs $libs_softmmu" + libs_tools=3D"$nettle_libs $libs_tools" + QEMU_CFLAGS=3D"$QEMU_CFLAGS $nettle_cflags" + if test -z "$gcrypt"; then + gcrypt=3D"no" + fi + pass=3D"yes" fi + fi + if test "$pass" =3D "no" && test "$nettle" =3D "yes"; then + feature_not_found "nettle" "Install nettle devel >=3D 2.7.1" else - if test "$nettle" =3D "yes"; then - feature_not_found "nettle" "Install nettle devel >=3D 2.7.1" - else - nettle=3D"no" - fi + nettle=3D"$pass" fi fi =20 if test "$gcrypt" !=3D "no"; then + pass=3D"no" if has_libgcrypt; then gcrypt_cflags=3D$(libgcrypt-config --cflags) gcrypt_libs=3D$(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" =3D "yes" then gcrypt_libs=3D"$gcrypt_libs -lgpg-error" fi - libs_softmmu=3D"$gcrypt_libs $libs_softmmu" - libs_tools=3D"$gcrypt_libs $libs_tools" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $gcrypt_cflags" - gcrypt=3D"yes" =20 + # Link test to make sure the given libraries work (e.g for static). + write_c_skeleton + if compile_prog "" "$gcrypt_libs" ; then + libs_softmmu=3D"$gcrypt_libs $libs_softmmu" + libs_tools=3D"$gcrypt_libs $libs_tools" + QEMU_CFLAGS=3D"$QEMU_CFLAGS $gcrypt_cflags" + pass=3D"yes" + fi + fi + if test "$pass" =3D "yes"; then + gcrypt=3D"yes" cat > $TMPC << EOF #include int main(void) { @@ -2898,12 +2916,10 @@ EOF if compile_prog "$gcrypt_cflags" "$gcrypt_libs" ; then gcrypt_hmac=3Dyes fi + elif test "$gcrypt" =3D "yes"; then + feature_not_found "gcrypt" "Install gcrypt devel >=3D 1.5.0" else - if test "$gcrypt" =3D "yes"; then - feature_not_found "gcrypt" "Install gcrypt devel >=3D 1.5.0" - else - gcrypt=3D"no" - fi + gcrypt=3D"no" fi fi =20 --=20 2.17.1