From nobody Wed Nov 27 18:35:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1697617925; cv=none; d=zohomail.com; s=zohoarc; b=G10ARIYIPm04MSJ1DJ9hvRtwQBsbHnA3+gt8PSMDtM3pA9XO8A9k9v97IdsiLWEjMxQwUYqDEBOfKMRd/d32t0GWlt+QfOECn8XOuMf5YbmwbncPhUZKDhBQY5eLnNaHCJHw0koqlVSahUcicHls8YZZq4fFgp33q9ZZfq67YFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697617925; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=lOV11LHJmh8G61u7keMaCTfvvIJIPpPLJVUoEioDRH8=; b=giL1rFka+Z4lpulAVlBZOsSuSfFxIbmmEmKrimEFD/uiLa5xwfykf22goVIj33oRrBAr0/g5uAH2m8v7ObE9dQZOTzqiEBdo5pvZdan28J4GI/fUOf8yOKouMzC5RrxmFw31QdHJfPjmVTqM7wWoh3NwYossuKPVBXOap14z4BY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697617925489560.0116843677537; Wed, 18 Oct 2023 01:32:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt1vI-0002I4-6E; Wed, 18 Oct 2023 04:29:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt1vB-00027R-Kz for qemu-devel@nongnu.org; Wed, 18 Oct 2023 04:28:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt1v9-0003i6-NX for qemu-devel@nongnu.org; Wed, 18 Oct 2023 04:28:53 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-ulEYh87qMe6IJ8_uM8vhYw-1; Wed, 18 Oct 2023 04:28:39 -0400 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-9ba247e03aeso461812466b.1 for ; Wed, 18 Oct 2023 01:28:39 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id f27-20020a1709062c5b00b0098e78ff1a87sm1174541ejh.120.2023.10.18.01.28.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 01:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697617731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lOV11LHJmh8G61u7keMaCTfvvIJIPpPLJVUoEioDRH8=; b=WB+V/7O8p4t92y5TQO1swqCFT9PXIuZ2wKpNEgBK/x/340VKYX6SChgujx6QoNjDK8ZJRd a0zCBzIf6UcW9u7Dg1DNtP2aDOK0ZXVSnnxpXNH0Jy7kiztlOzDgi0lG9RUBGDqbMGdse1 tuhvyJbPOvRK7zbM93tVGU7zIVpYYVU= X-MC-Unique: ulEYh87qMe6IJ8_uM8vhYw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697617718; x=1698222518; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lOV11LHJmh8G61u7keMaCTfvvIJIPpPLJVUoEioDRH8=; b=axCO6Y/bzCulx0FDHl5RUq0oomV+HbeS5B3WgO1hNEHfUi9ySYt3wksTVNAO328daZ 1fvc5M23ZUxCH5shspRJLzIywX4fg/gYI5G1gMpwt2aBhFZlLJSdFf+QIyj3GWMpufy+ 3k8IduF6KXQ3oFYlRTt5VDivN+6L4hkukdKFPopUpgmK8wE/rHYAcMPveEldr6DSSGzB cUVIZzB1C6haJW3hgc12AV0Vp1ddIkZMjIAXz4A4sbCa+gzJlav0EKBGdFea9+zAe/m6 GFzbcqyhGE9uAcN79PoijPfLNPD7DVxWzX0V7K8vhe1YyAdbBw40ixz5SEzEnuHQmQMX gI1A== X-Gm-Message-State: AOJu0YxQ+GvSYWUKNWHNITwrOTDfaEhM7elUZFlRFhn4yvtsqRsYoFlz 3vpM1RlJlrpkyF+iDs2cK7s3CKlgOvnDVmhliK0tFWeFBCsve4klUYXukoFN4oyKhjgrPBiQOL8 DwEWKPAvbhc2L/HdF4keOoxxlJL+znAxNTTV9RGuM6J9kBxu17Va/EGiuT028BNV1WXqpJyQPfV o= X-Received: by 2002:a17:906:7955:b0:9bd:a73a:7a0a with SMTP id l21-20020a170906795500b009bda73a7a0amr3451320ejo.58.1697617717701; Wed, 18 Oct 2023 01:28:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQNuOfxYA1ZdyvPCXpqf/sSdHH+hG4Vcoy/3DqqTCPhz7cZCzpTOp1Sd6ylzTf7A2H5OYIig== X-Received: by 2002:a17:906:7955:b0:9bd:a73a:7a0a with SMTP id l21-20020a170906795500b009bda73a7a0amr3451307ejo.58.1697617717273; Wed, 18 Oct 2023 01:28:37 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 23/32] configure: clean up plugin option handling Date: Wed, 18 Oct 2023 10:27:43 +0200 Message-ID: <20231018082752.322306-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018082752.322306-1-pbonzini@redhat.com> References: <20231018082752.322306-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697617927714100003 Content-Type: text/plain; charset="utf-8" Keep together all the conditions that lead to disabling plugins, and remove now-dead code. Since the option was not in SKIP_OPTIONS, it was present twice in the help message, both from configure and from meson-buildoptions.sh. Remove the duplication and take the occasion to document the option as autodetected, which it is. Signed-off-by: Paolo Bonzini --- configure | 39 +++++++++++++++-------------------- scripts/meson-buildoptions.py | 17 ++++++++++----- scripts/meson-buildoptions.sh | 2 +- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/configure b/configure index ffcfabb8d36..688577bebd8 100755 --- a/configure +++ b/configure @@ -377,7 +377,6 @@ fi =20 case $targetos in windows) - plugins=3D"no" pie=3D"no" ;; haiku) @@ -741,7 +740,6 @@ for opt do default_cflags=3D'-O0 -g' ;; --disable-tcg) tcg=3D"disabled" - plugins=3D"no" ;; --enable-tcg) tcg=3D"enabled" ;; @@ -778,11 +776,7 @@ for opt do ;; --enable-download) download=3D"enabled"; git_submodules_action=3Dupdate; ;; - --enable-plugins) if test "$targetos" =3D "windows"; then - error_exit "TCG plugins not currently supported on= Windows platforms" - else - plugins=3D"yes" - fi + --enable-plugins) plugins=3D"yes" ;; --disable-plugins) plugins=3D"no" ;; @@ -808,11 +802,6 @@ then git_submodules_action=3D"validate" fi =20 -# test for any invalid configuration combinations -if test "$plugins" =3D "yes" -a "$tcg" =3D "disabled"; then - error_exit "Can't enable plugins on non-TCG builds" -fi - if ! test -f "$source_path/subprojects/keycodemapdb/README" \ && test "$download" =3D disabled then @@ -923,8 +912,6 @@ Advanced options (experts only): --enable-debug enable common debug build options --disable-werror disable compilation abort on warning --cpu=3DCPU Build for host CPU [$cpu] - --enable-plugins - enable plugins via shared library loading --disable-containers don't use containers for cross-building --container-engine=3DTYPE which container engine to use [$container_eng= ine] --gdb=3DGDB-path gdb to use for gdbstub tests [$gdb_bin] @@ -1066,15 +1053,27 @@ if test "$targetos" =3D "bogus"; then error_exit "Unrecognized host OS (uname -s reports '$(uname -s)')" fi =20 +# test for any invalid configuration combinations +if test "$targetos" =3D "windows"; then + if test "$plugins" =3D "yes"; then + error_exit "TCG plugins not currently supported on Windows platforms" + fi + plugins=3D"no" +fi +if test "$tcg" =3D "disabled" ; then + if test "$plugins" =3D "yes"; then + error_exit "Can't enable plugins on non-TCG builds" + fi + plugins=3D"no" +fi if test "$static" =3D "yes" ; then if test "$plugins" =3D "yes"; then error_exit "static and plugins are mutually incompatible" - else - plugins=3D"no" fi + plugins=3D"no" fi -test "$plugins" =3D "" && plugins=3Dyes -if test "$plugins" =3D "yes"; then +if test "$plugins" !=3D "no"; then + plugins=3Dyes subdirs=3D"$subdirs contrib/plugins" fi =20 @@ -1717,10 +1716,6 @@ mkdir -p tests/tcg echo "# Automatically generated by configure - do not modify" > $config_ho= st_mak echo "SRC_PATH=3D$source_path" >> $config_host_mak =20 -if test "$plugins" =3D "yes" ; then - echo "CONFIG_PLUGIN=3Dy" >> $config_host_mak -fi - tcg_tests_targets=3D for target in $target_list; do arch=3D${target%%-*} diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py index 8d2e526132a..b787c84e914 100644 --- a/scripts/meson-buildoptions.py +++ b/scripts/meson-buildoptions.py @@ -44,6 +44,11 @@ "trace_file": "with-trace-file", } =20 +# Options that configure autodetects, even though meson defines them as bo= olean +AUTO_OPTIONS =3D { + "plugins", +} + BUILTIN_OPTIONS =3D { "b_coverage", "b_lto", @@ -168,6 +173,7 @@ def cli_metavar(opt): =20 def print_help(options): print("meson_options_help() {") + feature_opts =3D [] for opt in sorted(options, key=3Dcli_help_key): key =3D cli_help_key(opt) # The first section includes options that have an arguments, @@ -176,7 +182,7 @@ def print_help(options): metavar =3D cli_metavar(opt) left =3D f"--{key}=3D{metavar}" help_line(left, opt, 27, True) - elif opt["type"] =3D=3D "boolean": + elif opt["type"] =3D=3D "boolean" and opt["name"] not in AUTO_OPTI= ONS: left =3D f"--{key}" help_line(left, opt, 27, False) elif allow_arg(opt): @@ -185,16 +191,17 @@ def print_help(options): else: left =3D f"--{key}=3DCHOICE" help_line(left, opt, 27, True) + else: + feature_opts.append(opt) =20 sh_print() sh_print("Optional features, enabled with --enable-FEATURE and") sh_print("disabled with --disable-FEATURE, default is enabled if avail= able") sh_print("(unless built with --without-default-features):") sh_print() - for opt in options: - key =3D opt["name"].replace("_", "-") - if opt["type"] !=3D "boolean" and not allow_arg(opt): - help_line(key, opt, 18, False) + for opt in sorted(feature_opts, key=3Dcli_option): + key =3D cli_option(opt) + help_line(key, opt, 18, False) print("}") =20 =20 diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index d4b89e6b443..22d69966606 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -40,7 +40,6 @@ meson_options_help() { printf "%s\n" ' jemalloc/system/tcmalloc)' printf "%s\n" ' --enable-module-upgrades try to load modules from alter= nate paths for' printf "%s\n" ' upgrades' - printf "%s\n" ' --enable-plugins TCG plugins via shared library= loading' printf "%s\n" ' --enable-rng-none dummy RNG, avoid using /dev/(u= )random and' printf "%s\n" ' getrandom()' printf "%s\n" ' --enable-safe-stack SafeStack Stack Smash Protecti= on (requires' @@ -149,6 +148,7 @@ meson_options_help() { printf "%s\n" ' pa PulseAudio sound support' printf "%s\n" ' parallels parallels image format support' printf "%s\n" ' pipewire PipeWire sound support' + printf "%s\n" ' plugins TCG plugins via shared library loading' printf "%s\n" ' png PNG support with libpng' printf "%s\n" ' pvrdma Enable PVRDMA support' printf "%s\n" ' qcow1 qcow1 image format support' --=20 2.41.0