From nobody Wed Nov 27 19:38:29 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=1697438037; cv=none; d=zohomail.com; s=zohoarc; b=IhGL+ThWuyqaXRoi+7OU2yignQpk9P6iuX5x+RBKP4A/GuHjbZU47gfu77M6kpLFq4bOSYLmG6BuUcH6LCUh/TlZG6+bIxg4XR0QBG4PGwYUBt2z+QmuV+CBtsmt4swEV7EGGYgHKPkDRcxQbfR8eYI+WRnI20dW3QjB1vOJKpM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697438037; 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=QEBhg/nis2v2E6TOtez7OB+wequT7+FUk6KnJtqVqLQ=; b=hFIHOikVA1rFeRXaPTNpIbWpCveJEGm8g3CDh7peKrFOcak7petFzPHW0i7fOQYnC54RMwnrOMvS5Kj6aaMyN4wgufaHJlPqwOaI+MbOL6xm5d1p/IVuoCEZX7WXHMIG8cE7sjCIHoOvBCWSvxrQws73AejsJmlbevMtDKgCzKU= 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 1697438037638743.6331475555897; Sun, 15 Oct 2023 23:33:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qsH8z-00041K-JO; Mon, 16 Oct 2023 02:32:01 -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 1qsH8x-000405-IK for qemu-devel@nongnu.org; Mon, 16 Oct 2023 02:31:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qsH8u-0005TD-Va for qemu-devel@nongnu.org; Mon, 16 Oct 2023 02:31:59 -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-462-20BsEUevO1eosAyHqBxjrA-1; Mon, 16 Oct 2023 02:31:48 -0400 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-9bf8678af70so79786566b.2 for ; Sun, 15 Oct 2023 23:31:48 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id jz28-20020a17090775fc00b009b29553b648sm3285597ejc.206.2023.10.15.23.31.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 23:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697437916; 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=QEBhg/nis2v2E6TOtez7OB+wequT7+FUk6KnJtqVqLQ=; b=XBIIPSh2p7wHw/8KxUKuNtEwuOmcCUbUSMDoXuoR1awGxbcBRUS3QOfhe//2i4tpTv2q5/ v9+4EaMvOj56dDDNo5WIftjc0Zmany4JvSg78WXTDjh7IYlvRiQqdXBXRFUzoavYUBWyJG xc5+oKqfF+3Sudbm+oLgWG6DuwItO2A= X-MC-Unique: 20BsEUevO1eosAyHqBxjrA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697437907; x=1698042707; 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=QEBhg/nis2v2E6TOtez7OB+wequT7+FUk6KnJtqVqLQ=; b=r0d7YNi2/GwbOPLbe/AGcV55jghIJNOXteqUafLwgHE4aZrz2Ro40gITaiRo1JhSwm J2m049HdJbrxzyTUMdDiHcdErPXEFiD1NPMsJSwt7HGrtUne2K5zxVFZ1ObydUbfP18s jZxX2YhcMSYomJCtJSYvVdvp9GRKF+1GvMq/LfNtVWex/DRHTF/2QoydFcDsbFHpFH7T SKiUaprvXbZoHKZv6cTbDeIZCGePnloljKX3e1QBHTg2PpssQIt89HeG8TV3KTjKo1Ma WO7PREWndrDGg2fDdxieG+i8zKIfbNEOfWIRJculfo5+9pGZJu2e3Q/UDlaU9N32haEC 7RBA== X-Gm-Message-State: AOJu0YwObkRu6hBnCDY3Rlv5Vl+FFfqMoM/Ir+3OOsVGMmn3jEGrZQ0Y 6tRBEqDbXEBG+YW/xNSvki/fz5zuJOkKS3UbPB1ym+sA/b/Nsa7sGUyCL6moKc/uCwpGUJDWGda fA6rh7tUccwhV0EFYm5q+8LUUQETv+VZm07eHwc/UTDPhPWzwWbLJ8aT+LZPVaMP6FYXidunFAa E= X-Received: by 2002:a17:906:1092:b0:9bd:8cfd:e588 with SMTP id u18-20020a170906109200b009bd8cfde588mr9430116eju.27.1697437907116; Sun, 15 Oct 2023 23:31:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8iKsTJyQLe9NFzfJuJFc04u+LWkH7wByxPCpsdCjH86lkpHt8yWbA1G7Jd7O3KRQAVN8/8w== X-Received: by 2002:a17:906:1092:b0:9bd:8cfd:e588 with SMTP id u18-20020a170906109200b009bd8cfde588mr9430104eju.27.1697437906806; Sun, 15 Oct 2023 23:31:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 09/17] configure: clean up plugin option handling Date: Mon, 16 Oct 2023 08:31:19 +0200 Message-ID: <20231016063127.161204-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231016063127.161204-1-pbonzini@redhat.com> References: <20231016063127.161204-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.133.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_H3=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: 1697438039382100019 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 732220fdd45..7dad78f329b 100755 --- a/configure +++ b/configure @@ -377,7 +377,6 @@ fi =20 case $targetos in windows) - plugins=3D"no" pie=3D"no" ;; haiku) @@ -737,7 +736,6 @@ for opt do default_cflags=3D'-O0 -g' ;; --disable-tcg) tcg=3D"disabled" - plugins=3D"no" ;; --enable-tcg) tcg=3D"enabled" ;; @@ -774,11 +772,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" ;; @@ -804,11 +798,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 @@ -919,8 +908,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] @@ -1062,15 +1049,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 @@ -1713,10 +1712,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