diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-10-07 15:08:28 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-10-14 09:50:57 +0200 |
commit | 61d63097bec3a11f64e14a05a81401f9af7cea11 (patch) | |
tree | d6ec5765517fd4302f33e74c9056174cc194e6e0 /configure | |
parent | 03a3c0b3c59e93beeb7ca72cba632f78eb060253 (diff) |
configure: prepare for auto-generated option parsing
Prepare the configure script and Makefile for automatically generated
help and parsing.
Because we need to run the script to generate the full help, we
cannot rely on the user supplying the path to a Python interpreter
with --python; therefore, the introspection output is parsed into
shell functions and stored in scripts/. The converter is written
in Python as standard for QEMU, and this commit contains a stub.
Tested-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20211007130829.632254-18-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 31 |
1 files changed, 22 insertions, 9 deletions
@@ -789,6 +789,18 @@ fi werror="" +. $source_path/scripts/meson-buildoptions.sh + +meson_options= +meson_option_parse() { + meson_options="$meson_options $(_meson_option_parse "$@")" + if test $? -eq 1; then + echo "ERROR: unknown option $1" + echo "Try '$0 --help' for more information" + exit 1 + fi +} + for opt do optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') case "$opt" in @@ -1548,6 +1560,8 @@ for opt do ;; --disable-slirp-smbd) slirp_smbd=no ;; + --enable-* | --disable-*) meson_option_parse "$opt" "$optarg" + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -1804,11 +1818,9 @@ Advanced options (experts only): enable plugins via shared library loading --disable-containers don't use containers for cross-building --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin] - -Optional features, enabled with --enable-FEATURE and -disabled with --disable-FEATURE, default is enabled if available -(unless built with --without-default-features): - +EOF + meson_options_help +cat << EOF system all system emulation targets user supported user emulation targets linux-user all linux usermode emulation targets @@ -4489,7 +4501,8 @@ if test "$skip_meson" = no; then mv $cross config-meson.cross rm -rf meson-private meson-info meson-logs - NINJA=$ninja $meson setup \ + run_meson() { + NINJA=$ninja $meson setup \ --prefix "$prefix" \ --libdir "$libdir" \ --libexecdir "$libexecdir" \ @@ -4534,9 +4547,9 @@ if test "$skip_meson" = no; then -Dpa=$pa -Daudio_drv_list=$audio_drv_list -Dtcg_interpreter=$tcg_interpreter \ -Dtrace_backends=$trace_backends -Dtrace_file=$trace_file -Dlinux_aio=$linux_aio \ -Dnetmap=$netmap -Dvde=$vde \ - $cross_arg \ - "$PWD" "$source_path" - + "$@" $cross_arg "$PWD" "$source_path" + } + eval run_meson $meson_options if test "$?" -ne 0 ; then error_exit "meson setup failed" fi |