diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2023-09-18 11:06:48 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-10-18 10:01:01 +0200 |
commit | 39fb3cfc28baac007ea8dafaf7a2c22c44faba19 (patch) | |
tree | dacce5278a28bc79b1bf5968569022981dda60b6 /scripts | |
parent | a47dd5c516ed7fff768554ac1ec4cba2145c5ea9 (diff) | |
download | qemu-39fb3cfc28baac007ea8dafaf7a2c22c44faba19.zip qemu-39fb3cfc28baac007ea8dafaf7a2c22c44faba19.tar.gz qemu-39fb3cfc28baac007ea8dafaf7a2c22c44faba19.tar.bz2 |
configure: clean up plugin option handling
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>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/meson-buildoptions.py | 17 | ||||
-rw-r--r-- | scripts/meson-buildoptions.sh | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py index 8d2e526..b787c84 100644 --- a/scripts/meson-buildoptions.py +++ b/scripts/meson-buildoptions.py @@ -44,6 +44,11 @@ OPTION_NAMES = { "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 d4b89e6..22d69966 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' |