From nobody Mon Feb 9 23:03:48 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=1557452486; cv=none; d=zoho.com; s=zohoarc; b=P2+ZlqYgfkcG5murb4ajQbtvKJ5zrJtRmYfGQWt7wU8fNim3wIXvC/e9C/LrrmTPitRj/jivZ9X6ZLcIyh0okFsPkNaMNjPkoHddUr1D8AJuLT81Czhv9DSeztE1n71y0XqkWmg1r+Jlcf4/i2Yb00AQiwnAmpS9GskH3NqxW/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557452486; h=Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=5jZKWwQgoaRofSd9MpX36fg/EnNSkz9sJL+VHY1E4dI=; b=WpA4gIyrc8p0pu644B3RkJPIqbOxPW3l1iOPYMR6Z5Nf04JIP0loCkA+eyHX5p7QuOpoj3n+6xltpEisajC9LPHMTF+V1QBr0+DHcokMo8vlkE9kMSvcDYgRudTig9Gu15dHe/NJ7DshusQNjZwvJZnVmWA3hv5Dlhzk1kFVAxQ= 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 15574524866470.21476658086714906; Thu, 9 May 2019 18:41:26 -0700 (PDT) Received: from localhost ([127.0.0.1]:35229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOuXK-0003ic-LP for importer@patchew.org; Thu, 09 May 2019 21:41:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOuHk-0006Iw-K5 for qemu-devel@nongnu.org; Thu, 09 May 2019 21:25:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOuHj-00014L-6x for qemu-devel@nongnu.org; Thu, 09 May 2019 21:25:16 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:41833) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hOuHj-0000tH-04 for qemu-devel@nongnu.org; Thu, 09 May 2019 21:25:15 -0400 Received: by mail-pf1-x444.google.com with SMTP id l132so2251967pfc.8 for ; Thu, 09 May 2019 18:25:02 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id n18sm8252700pfi.48.2019.05.09.18.25.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 May 2019 18:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=5jZKWwQgoaRofSd9MpX36fg/EnNSkz9sJL+VHY1E4dI=; b=Jlw2BOZlKaGi4oH9ckPffXjBPBWonfzGjuoLuJCXqBKIfZo1izQxjfnMkEUDtp2eqe sNODli5s71TxhSrvKmTWjD1HB08x7h1IrNQkDfmFEQymsvdzubDehDiSiIn++6NptVwU CCS/Dz4S+pKOJUDPMhnrBVtiJHNivHUKt908SKDe9rOC7hlvsD4JfFJUillV24psR4zj d+AgUynHsDNpamr4I+Mnb0z5h40LeWLosjNr/cr/qUi7EDejRx0wWCArI440gvqlZmK3 LcxHhRrG992xIZgAvXugzILeT9vbbH50j1dq6mbJLrP/s8vA96nZ2k9ntn/e+QZIVhcQ wQfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=5jZKWwQgoaRofSd9MpX36fg/EnNSkz9sJL+VHY1E4dI=; b=hSu5S39RR+6GU1hECNcpUfuwV6kVRvX9PK0xP7seU2VLLyUlpt9y1FFsAhx4HF1rz4 pkB53UakX4pGakBIiRgfKJWspX+N2ssk2vKt70NkWk9jdayLSI25s7Irg0akDvyPx0IP NVLt04C92UPArKPENqAHyK7oWST179lX3+bmin/SS3AIuBH7GCN+jwmMFVoY9tEUoI8s 1qGoD5xaY6H9+AxG6J8M+zNtfLXJ38HfYDspXaWuSr5SvZBRFrgy18FcPQS+9mWrsaCc NCEj24DcVQuXt/tzyNzdkmOZdQPAnAr1w7lPoRS2Ndi4ixUlFU+Aakh15RMpBuiLVzU5 zagw== X-Gm-Message-State: APjAAAUlkEYdBWAyB+/k7+G1rZKKXE6GqoJrNiPTQaH/Meib9E8CuVOn H0ScnfJexY71QNJVTmqwvWfkI9I6pAA= X-Google-Smtp-Source: APXvYqyhmQH8QbpGJVycUlEjGb/NQnnmJVCjjY/iiyANrl8s/KQ/JQ3ku44IgqBYilCTMjWaHy3erQ== X-Received: by 2002:a63:682:: with SMTP id 124mr10106503pgg.243.1557451501382; Thu, 09 May 2019 18:25:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 9 May 2019 18:24:35 -0700 Message-Id: <20190510012458.22706-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190510012458.22706-1-richard.henderson@linaro.org> References: <20190510012458.22706-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 Subject: [Qemu-devel] [PATCH v5 01/24] 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" At least ubuntu 18.04 does not package static gnutls libraries. At least Fedora 30 does not ship static nettle and gcrypt libraries. Signed-off-by: Richard Henderson Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier --- v5: Include nettle, gcrypt. --- configure | 72 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 28 deletions(-) diff --git a/configure b/configure index 63f312bd1f..c4f27ed453 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