From nobody Tue Feb 10 06:58:37 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=1558553256; cv=none; d=zoho.com; s=zohoarc; b=b4hTOhIC+3m+Sbyl+TwMhkthCVlMKHojmk3Y+f2cV1x96I5HkoEQKH99rq7K/WGH9WIB4Gsyb26w+l578xTDmlxtmp3RLr9f86MPLbW/rvW7dsehSNDTKomf+o0NxDTCp6ODpOUOYCD5imPErAp7f6QeMqJ16O1xb1bbajdobhM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558553256; 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=9dAwC0S3G/OFyRgp8E8i1RIZB4naA10HcRt0yDU2T20=; b=M/6eJnMj7o3aZ93R5d5961MDvRwoU3aBn6QiZ4sYClvRoQsSTNsFUHjJKASX2r6V9nZqi3CGE1S7OvnKUu8/0aThU5pq46cqbOJIQHDY6w3zpqSoceCfyL9Tva9WC5ylV44llYK0q5zctnRl2AkhsUWDY4q11xwsPt5vd9D4Px4= 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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558553256074950.5527598829304; Wed, 22 May 2019 12:27:36 -0700 (PDT) Received: from localhost ([127.0.0.1]:50122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTWtX-0002ps-1b for importer@patchew.org; Wed, 22 May 2019 15:27:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTWOt-0008Eq-7n for qemu-devel@nongnu.org; Wed, 22 May 2019 14:55:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTWC6-00080U-97 for qemu-devel@nongnu.org; Wed, 22 May 2019 14:42:31 -0400 Received: from mail-yw1-xc41.google.com ([2607:f8b0:4864:20::c41]:43108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTWC6-00080L-43 for qemu-devel@nongnu.org; Wed, 22 May 2019 14:42:30 -0400 Received: by mail-yw1-xc41.google.com with SMTP id t5so1232445ywf.10 for ; Wed, 22 May 2019 11:42:30 -0700 (PDT) Received: from localhost.localdomain ([71.46.56.17]) by smtp.gmail.com with ESMTPSA id 206sm1299445ywq.74.2019.05.22.11.42.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 11:42:28 -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=9dAwC0S3G/OFyRgp8E8i1RIZB4naA10HcRt0yDU2T20=; b=LYa5PPQMjqAQwlc9/adtwJJpve/N0/a8ZNAdtgKWrLFDagkdPwQrMxI6hY75aCkaaF z0HOpjZ9c1HQ+L6TXYfyGmJJi407J7R1pxpQ69mp0oL9Nl4urdzgsaKq5PnQ81BY9t+b x14XEvjY5L9YpUTd68XgawcXCwAWH8UQrlbNPIWcHiRVqCKetMmA/c4KC4Dw1P8xJxUn idGd4oPoWmdV0tncwe5lRICjyFkKSywsPZdtOyJt2JAp1gZbV6srbJgBNrCgymoTiY4K Kdm8CBp1ptBEgCRQ8CSr5oLLEAWONlNs6ZseTDWZwl/PnH+aAH7aTbN/voW5nG4BvwEu 4G5g== 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=9dAwC0S3G/OFyRgp8E8i1RIZB4naA10HcRt0yDU2T20=; b=Al8MvI7nJcmNMDkLU5teuD2qM4nsJVG0YLGw9b+M4ksr1FjCdWDcN5R8QWyJFMzb0J 9rUd7kjfJlUCRWkkw2ytlHgacytrirJq2ywIIF+ACZeO4OENJdSbiD+p2Krgywp3fN6+ SGos9WWjRvO5CdB1T2/ybPdCqCCDfCHZbqxi87t99dTUiLJcBl1ZZFiP5+P1OnwMxGmE xKKSluztghZvTIGYGj+T/tR7xIBmP3hXffvAgQIUg2rhOgX1OnXRp+HSKijiO0f+nyB9 PopnAs/I0DBR/LZFF69/jCbCrYW/xW2w2U7AwXK2CA9qKkq8DAC9PzHa8PDKLT6SduK1 DNpA== X-Gm-Message-State: APjAAAWWtBKOZcuuwS/VjvXrcG/WKNSXqacuQkt2E3wVtqHYFlEKOTom M7uWFB+7/41IJ398zzy6On+OD6jeCBI= X-Google-Smtp-Source: APXvYqz9VjPXzuNCnHARFaSV36tXY9E9tSU6yPyjYjUW9o2Aeq/cmQuRC47ovZ49Ku0+6PkstO0itg== X-Received: by 2002:a81:8606:: with SMTP id w6mr41845008ywf.344.1558550549179; Wed, 22 May 2019 11:42:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 14:42:02 -0400 Message-Id: <20190522184226.17871-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190522184226.17871-1-richard.henderson@linaro.org> References: <20190522184226.17871-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::c41 Subject: [Qemu-devel] [PULL 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: peter.maydell@linaro.org 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 d2fc346302..571dd94ee2 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