On 9/13/20 5:05 AM, Paolo Bonzini wrote:
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
Makefile | 6 ++
configure | 71 +++++--------
docs/devel/build-system.rst | 35 +------
meson-buildoptions.json | 130 ++++++++++++++++++++++++
scripts/configure-parse-buildoptions.py | 94 +++++++++++++++++
5 files changed, 258 insertions(+), 78 deletions(-)
create mode 100644 meson-buildoptions.json
create mode 100644 scripts/configure-parse-buildoptions.py
diff --git a/Makefile b/Makefile
index d6c5c9fdef..b22e5b272e 100644
--- a/Makefile
+++ b/Makefile
@@ -80,6 +80,12 @@ ifneq ($(MESON),)
Makefile.mtest: build.ninja scripts/mtest2make.py
$(MESON) introspect --tests --benchmarks | $(PYTHON) scripts/mtest2make.py
> $@
-include Makefile.mtest
+
+# jq is used to keep the result stable
+meson-buildoptions.json: meson_options.txt
+ $(MESON) introspect --buildoptions . | \
+ jq 'map(select(.section == "user")) | sort_by(.name)' \
+ > $(SRC_PATH)/meson-buildoptions.json
Are we guaranteed to have jq on the system? This appears to be the
first use of it in qemu.git.
@@ -108,6 +78,11 @@ In meson.build::
# Summary
summary_info += {'SDL image support': sdl_image.found()}
+The configure script automatically converts command line options to
+Meson options as long as the `meson-buildoptions.json` file in the
+root source directory is up-to-date. You can simply type
+`make meson-buildoptions.json` to update it; the `jq` program
+is needed.
Oh, you're using it for an optional step, that most people don't have to
run, but where a developer needing to regenerate things can be likely to
understand how to get it.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org