On 12/10/2021 13.13, Paolo Bonzini wrote:
Right now meson_options.txt lists about 90 options. Each option
needs code in configure to parse it and pass the option down to Meson as
a -D command-line argument; in addition the default must be duplicated
between configure and meson_options.txt. This series tries to remove
the code duplication by generating the case statement for those --enable
and --disable options, as well as the corresponding help text.
About 80% of the options can be handled completely by the new mechanism.
Eight meson options are not of the --enable/--disable kind. Six more need
to be parsed in configure for various reasons documented in the patch,
but they still have their help automatically generated.
The advantages are:
- less code in configure
- parsing and help is more consistent (for example --enable-blobs was
not supported)
- options are described entirely in one place, meson_options.txt.
This make it more attractive to use Meson options instead of
hand-crafted configure options and config-host.mak
A few options change name: --enable-tcmalloc and --enable-jemalloc
become --enable-malloc={tcmalloc,jemalloc}; --disable-blobs becomes
--disable-install-blobs; --enable-trace-backend becomes
--enable-trace-backends.
... and you provide compatibility wrappers now - maybe worth to mention it here.
...
@@ -1793,18 +1427,12 @@ Advanced options (experts only):
(by default affects only QEMU, not tools like
qemu-img)
--enable-block-drv-whitelist-in-tools
use block whitelist also in tools instead of only
QEMU
- --enable-trace-backends=B Set trace backend
- Available backends: $trace_backend_list
Old output with --help:
--enable-trace-backend=B Set trace backend
Available backends: nop, dtrace, ftrace, simple,
stderr, ust
New output:
--enable-trace-backends=CHOICE
Set available tracing backends [log]
Why does it fail to list the choices here? ... it works for the other
options like "--enable-malloc"?
Thomas