From patchwork Fri May 10 17:30:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 163907 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:142:0:0:0:0 with SMTP id j2csp2669671ilr; Fri, 10 May 2019 10:34:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyp3cbYsdcDa7ncEMUTmIo4rAnlpoabzF4D9aqrTUIHqXZyXvX9+GcaqQ7poy5/gGNXmOyl X-Received: by 2002:a17:906:b2d3:: with SMTP id cf19mr9969360ejb.8.1557509665398; Fri, 10 May 2019 10:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557509665; cv=none; d=google.com; s=arc-20160816; b=rAgtsVoW+eJA4VyPqBr5pafwnfIIDBzMKZfwOc0m6lPr6dID8fkTAsHqx0j+5G4BiV xzSvhg9IOdOGS63IyJXKGAFXwF8UK4TbRR873xSu7lkRu6iMXt+kyq39P0yaeUql/S7f r2LgkfIVDo+/HySxO1kmWRteF5f05OVh7UuksPQ7FGaZcH4l6CLM/wFVjy05u7rTHscA TCzK9hea9R0lFo0AxUfgtTRekZKY2JK6CW70B6fOnmQc6JhwXUSBYXYdsh0i+dsJzwyI gbOAQbLzy2E64UiJiCPfQbjXhGJ2hKRu8qdRpdaHvJj+gSst9umK45o+S+6n/iwbnuHX Z+/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=p3cfnV5JbT6H/nwjKGY4Kezh5D3MhbPkpcQaspyBazo=; b=ALSISzUHfHbjYjWPRVnU7VP1rDjNfbBV5PLvUjW9x9s5tkL/YDKdcXmqpj8yajI7v8 JkzG5qwqXeqMiuczw41SQ97mlQmHR/m44wNBWAubSRRHub19di7LQsMPFMlqNbSYgxG+ ouwXAUW7lvtLHC5dnlRTrmayxQrB/EcNEVBAAnvTpLANa0x7AsLFLjJpwq1mumvpg8Gs NbV2YkrCbjoooxo3MJk3qfh3FRY9Y29eK35vpRCvGwxUnQWeR3LTLjydknJ4+IE+w7LG 3qtplV40FpnaUGBwbkmqVHLpdyPcO/u7moOUQ9yHe+jDBOIvjLByrKHJAe0LoWFprRVz nS8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Xv1QtOJy; 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 ot8si1933120ejb.275.2019.05.10.10.34.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 10 May 2019 10:34:25 -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=Xv1QtOJy; 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]:47500 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP9Pc-00021F-5L for patch@linaro.org; Fri, 10 May 2019 13:34:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP9MF-0007IC-Ci for qemu-devel@nongnu.org; Fri, 10 May 2019 13:30:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hP9ME-0005y4-3Y for qemu-devel@nongnu.org; Fri, 10 May 2019 13:30:55 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:42598) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hP9MD-0005xX-Tu for qemu-devel@nongnu.org; Fri, 10 May 2019 13:30:54 -0400 Received: by mail-pl1-x642.google.com with SMTP id x15so3127194pln.9 for ; Fri, 10 May 2019 10:30:53 -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:mime-version :content-transfer-encoding; bh=p3cfnV5JbT6H/nwjKGY4Kezh5D3MhbPkpcQaspyBazo=; b=Xv1QtOJyGKmPVc5wOfKNqKuFiKfEoYGPwYdml96HohiJdk/ZKN2BjqJn2iT3b52BYg jADBwofGV5ksLI6TP4E1x1osCpftbDAX7ld9yK2znpfGwI+nvoXJm56iMcezni1w4zJE SFhtsHob0ooKXnH2uR5p0vb1G/NhtOXgk8WW044lvQOyRvQDdrsz65heiQIf2nHpKhD3 tPKfzQZdRs6PBiPHb/755Pn5GGw9Mt1zVv/eYrgw+jTBnjw7I10U5M+xIc0X5ItoCMET h8H62b0S2Z1D5QdqMCfxdbZEZhvPqzeA92urnqUmBxLI7JbDJbRnkUXLIwOfmFyWbTf7 CzXw== 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:mime-version:content-transfer-encoding; bh=p3cfnV5JbT6H/nwjKGY4Kezh5D3MhbPkpcQaspyBazo=; b=bvbMwOn9ZQHIak3ZEmsrTBkdnD2kQp/FtCBcmW7JfKAD8YQmixvwyNuReUsG1KXfWL hifDG73xXeRksOXlZwBgpsWem2YNFnTDA38nk8Bwd2HURGz1eOdlQJI3uvDsPx1nFWm2 EhPDZzB4Eul+bAdeFG2BJqS7fd1j5WQAG0KBFquen34VfzVKzuPNwgr11+YHUpshbR3W eCwm9PU8o2f5tqLwl1SgQlAx5jPRtR8WAqK/mX5YqEExZKknugvSnBj3HZS74ljTrsAy mx11ZzOzk5TjoWfH8cL/jQ8lsiubHsKP00Wj9mqH5kHOgmNU+U0ptutj7j0pjHUXcS5h oZRw== X-Gm-Message-State: APjAAAVFNK79vo9+ahMuX7m5f+l26fiUPVAQDsTRYGftciYA3B5vJ9lJ SPKp+T0+bZ5UV90+W1MmcE8nkK2Ufh0= X-Received: by 2002:a17:902:263:: with SMTP id 90mr14917245plc.257.1557509452590; Fri, 10 May 2019 10:30:52 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id v64sm7936792pfv.106.2019.05.10.10.30.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 May 2019 10:30:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 10 May 2019 10:30:25 -0700 Message-Id: <20190510173049.28171-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190510173049.28171-1-richard.henderson@linaro.org> References: <20190510173049.28171-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 v6 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: , 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. Tested-by: Laurent Vivier Reviewed-by: Laurent Vivier Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- v5: Include nettle, gcrypt. --- configure | 72 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 28 deletions(-) -- 2.17.1 diff --git a/configure b/configure index 63f312bd1f..c4f27ed453 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