qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PULL 23/32] configure: clean up plugin option handling
Date: Wed, 18 Oct 2023 10:27:43 +0200	[thread overview]
Message-ID: <20231018082752.322306-24-pbonzini@redhat.com> (raw)
In-Reply-To: <20231018082752.322306-1-pbonzini@redhat.com>

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 <pbonzini@redhat.com>
---
 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
 
 case $targetos in
 windows)
-  plugins="no"
   pie="no"
 ;;
 haiku)
@@ -741,7 +740,6 @@ for opt do
       default_cflags='-O0 -g'
   ;;
   --disable-tcg) tcg="disabled"
-                 plugins="no"
   ;;
   --enable-tcg) tcg="enabled"
   ;;
@@ -778,11 +776,7 @@ for opt do
   ;;
   --enable-download) download="enabled"; git_submodules_action=update;
   ;;
-  --enable-plugins) if test "$targetos" = "windows"; then
-                        error_exit "TCG plugins not currently supported on Windows platforms"
-                    else
-                        plugins="yes"
-                    fi
+  --enable-plugins) plugins="yes"
   ;;
   --disable-plugins) plugins="no"
   ;;
@@ -808,11 +802,6 @@ then
     git_submodules_action="validate"
 fi
 
-# test for any invalid configuration combinations
-if test "$plugins" = "yes" -a "$tcg" = "disabled"; then
-    error_exit "Can't enable plugins on non-TCG builds"
-fi
-
 if ! test -f "$source_path/subprojects/keycodemapdb/README" \
     && test "$download" = 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=CPU                Build for host CPU [$cpu]
-  --enable-plugins
-                           enable plugins via shared library loading
   --disable-containers     don't use containers for cross-building
   --container-engine=TYPE  which container engine to use [$container_engine]
   --gdb=GDB-path           gdb to use for gdbstub tests [$gdb_bin]
@@ -1066,15 +1053,27 @@ if test "$targetos" = "bogus"; then
     error_exit "Unrecognized host OS (uname -s reports '$(uname -s)')"
 fi
 
+# test for any invalid configuration combinations
+if test "$targetos" = "windows"; then
+  if test "$plugins" = "yes"; then
+    error_exit "TCG plugins not currently supported on Windows platforms"
+  fi
+  plugins="no"
+fi
+if test "$tcg" = "disabled" ; then
+  if test "$plugins" = "yes"; then
+    error_exit "Can't enable plugins on non-TCG builds"
+  fi
+  plugins="no"
+fi
 if test "$static" = "yes" ; then
   if test "$plugins" = "yes"; then
     error_exit "static and plugins are mutually incompatible"
-  else
-    plugins="no"
   fi
+  plugins="no"
 fi
-test "$plugins" = "" && plugins=yes
-if test "$plugins" = "yes"; then
+if test "$plugins" != "no"; then
+  plugins=yes
   subdirs="$subdirs contrib/plugins"
 fi
 
@@ -1717,10 +1716,6 @@ mkdir -p tests/tcg
 echo "# Automatically generated by configure - do not modify" > $config_host_mak
 echo "SRC_PATH=$source_path" >> $config_host_mak
 
-if test "$plugins" = "yes" ; then
-    echo "CONFIG_PLUGIN=y" >> $config_host_mak
-fi
-
 tcg_tests_targets=
 for target in $target_list; do
   arch=${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",
 }
 
+# Options that configure autodetects, even though meson defines them as boolean
+AUTO_OPTIONS = {
+    "plugins",
+}
+
 BUILTIN_OPTIONS = {
     "b_coverage",
     "b_lto",
@@ -168,6 +173,7 @@ def cli_metavar(opt):
 
 def print_help(options):
     print("meson_options_help() {")
+    feature_opts = []
     for opt in sorted(options, key=cli_help_key):
         key = cli_help_key(opt)
         # The first section includes options that have an arguments,
@@ -176,7 +182,7 @@ def print_help(options):
             metavar = cli_metavar(opt)
             left = f"--{key}={metavar}"
             help_line(left, opt, 27, True)
-        elif opt["type"] == "boolean":
+        elif opt["type"] == "boolean" and opt["name"] not in AUTO_OPTIONS:
             left = f"--{key}"
             help_line(left, opt, 27, False)
         elif allow_arg(opt):
@@ -185,16 +191,17 @@ def print_help(options):
             else:
                 left = f"--{key}=CHOICE"
             help_line(left, opt, 27, True)
+        else:
+            feature_opts.append(opt)
 
     sh_print()
     sh_print("Optional features, enabled with --enable-FEATURE and")
     sh_print("disabled with --disable-FEATURE, default is enabled if available")
     sh_print("(unless built with --without-default-features):")
     sh_print()
-    for opt in options:
-        key = opt["name"].replace("_", "-")
-        if opt["type"] != "boolean" and not allow_arg(opt):
-            help_line(key, opt, 18, False)
+    for opt in sorted(feature_opts, key=cli_option):
+        key = cli_option(opt)
+        help_line(key, opt, 18, False)
     print("}")
 
 
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 alternate 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 Protection (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'
-- 
2.41.0



  parent reply	other threads:[~2023-10-18  8:32 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18  8:27 [PULL 00/32] x86 and build system changes for 2023-10-18 Paolo Bonzini
2023-10-18  8:27 ` [PULL 01/32] iotests: get rid of '..' in path environment output Paolo Bonzini
2023-10-18  8:27 ` [PULL 02/32] iotests: use the correct python to run linters Paolo Bonzini
2023-10-18  8:27 ` [PULL 03/32] Revert "configure: Add workaround for ccache and clang" Paolo Bonzini
2023-10-18  8:27 ` [PULL 04/32] target/i386/cpu: Fix CPUID_HT exposure Paolo Bonzini
2023-10-18  8:27 ` [PULL 05/32] target/i386: check intercept for XSETBV Paolo Bonzini
2023-10-18  8:27 ` [PULL 06/32] tests/vm: netbsd: install dtc Paolo Bonzini
2023-10-18  8:27 ` [PULL 07/32] scripts: Mark feature_to_c.py as non-executable to fix a build issue Paolo Bonzini
2023-10-18  8:27 ` [PULL 08/32] scripts/get_maintainer.pl: don't print parentheses Paolo Bonzini
2023-10-18  8:27 ` [PULL 09/32] tests/docker: avoid invalid escape in Python string Paolo Bonzini
2023-10-18  8:27 ` [PULL 10/32] docs/sphinx: " Paolo Bonzini
2023-10-18  8:27 ` [PULL 11/32] target/hexagon: " Paolo Bonzini
2023-10-18  8:27 ` [PULL 12/32] tests/avocado: " Paolo Bonzini
2023-10-18  8:27 ` [PULL 13/32] tests/vm: " Paolo Bonzini
2023-10-18  8:27 ` [PULL 14/32] tracetool: " Paolo Bonzini
2023-10-18  8:27 ` [PULL 15/32] meson: do not build shaders by default Paolo Bonzini
2023-10-18  8:27 ` [PULL 16/32] meson: do not use set10 Paolo Bonzini
2023-10-18  8:27 ` [PULL 17/32] meson, cutils: allow non-relocatable installs Paolo Bonzini
2023-10-18 11:37   ` Michael Tokarev
2023-10-18  8:27 ` [PULL 18/32] configure: clean up handling of CFI option Paolo Bonzini
2023-10-18  8:27 ` [PULL 19/32] hw/xen: cleanup sourcesets Paolo Bonzini
2023-10-18  8:27 ` [PULL 20/32] hw/remote: move stub vfu_object_set_bus_irq out of stubs/ Paolo Bonzini
2023-10-18  8:27 ` [PULL 21/32] tests/tcg/arm: move non-SVE tests out of conditional Paolo Bonzini
2023-10-18  8:27 ` [PULL 22/32] configure, tests/tcg: simplify GDB conditionals Paolo Bonzini
2023-10-18  8:27 ` Paolo Bonzini [this message]
2023-10-18  8:27 ` [PULL 24/32] configure: clean up PIE option handling Paolo Bonzini
2023-10-18  8:27 ` [PULL 25/32] configure: remove some dead cruft Paolo Bonzini
2023-10-18  8:27 ` [PULL 26/32] configure: move target-specific defaults to an external machine file Paolo Bonzini
2023-10-18  8:27 ` [PULL 27/32] configure: move environment-specific defaults to config-meson.cross Paolo Bonzini
2023-10-18  8:27 ` [PULL 28/32] configure: unify handling of several Debian cross containers Paolo Bonzini
2023-10-18  8:27 ` [PULL 29/32] configure, meson: use command line options to configure qemu-ga Paolo Bonzini
2023-10-18  8:27 ` [PULL 30/32] meson-buildoptions: document the data at the top Paolo Bonzini
2023-10-18  8:27 ` [PULL 31/32] meson: add a note on why we use config_host for program paths Paolo Bonzini
2023-10-18  8:27 ` [PULL 32/32] configure: define "pkg-config" in addition to "pkgconfig" Paolo Bonzini
2023-10-18 22:32 ` [PULL 00/32] x86 and build system changes for 2023-10-18 Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231018082752.322306-24-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).