qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, berrange@redhat.com,
	peter.maydell@linaro.org
Subject: Re: [PATCH 3/3] configure: automatically parse command line for meson -D options
Date: Mon, 14 Sep 2020 14:20:20 -0500	[thread overview]
Message-ID: <a4a800dc-1f7f-da5d-e7e5-ccbacc1f9bf3@redhat.com> (raw)
In-Reply-To: <20200913100534.22084-4-pbonzini@redhat.com>

On 9/13/20 5:05 AM, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@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



  reply	other threads:[~2020-09-14 19:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-13 10:05 [RFC PATCH 0/3] Automatically convert configure options to meson build options Paolo Bonzini
2020-09-13 10:05 ` [PATCH 1/3] configure: quote command line arguments in config.status Paolo Bonzini
2020-09-14 19:17   ` Eric Blake
2020-09-13 10:05 ` [PATCH 2/3] configure: early test for Python Paolo Bonzini
2020-09-13 10:05 ` [PATCH 3/3] configure: automatically parse command line for meson -D options Paolo Bonzini
2020-09-14 19:20   ` Eric Blake [this message]
2020-09-13 10:15 ` [RFC PATCH 0/3] Automatically convert configure options to meson build options 罗勇刚(Yonggang Luo)
2020-09-13 13:57   ` Paolo Bonzini
2020-09-14  9:12 ` Daniel P. Berrangé
2020-09-14 10:49   ` Paolo Bonzini
2020-09-14  9:57 ` Stefan Hajnoczi
2020-09-14 10:00   ` 罗勇刚(Yonggang Luo)
2020-09-16 11:24     ` Stefan Hajnoczi
2020-09-14 10:27   ` Paolo Bonzini
2020-09-16 11:25     ` Stefan Hajnoczi
2020-09-16 13:15       ` Paolo Bonzini

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=a4a800dc-1f7f-da5d-e7e5-ccbacc1f9bf3@redhat.com \
    --to=eblake@redhat.com \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).