qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Cc: fam@euphon.net, berrange@redhat.com, stefanb@linux.vnet.ibm.com,
	richard.henderson@linaro.org, f4bug@amsat.org, cota@braap.org,
	stefanha@redhat.com, marcandre.lureau@redhat.com,
	aurelien@aurel32.net
Subject: Re: [PATCH v1 3/6] configure: add --without-default-features
Date: Thu, 10 Dec 2020 01:08:17 +0100	[thread overview]
Message-ID: <3605142c-6815-b2a1-1008-69bd791d6a6d@redhat.com> (raw)
In-Reply-To: <20201209170059.20742-4-alex.bennee@linaro.org>

On 09/12/20 18:00, Alex Bennée wrote:
> By default QEMU enables a lot of features if it can probe and find the
> support libraries. It also enables a bunch of features by default.
> This patch adds the ability to build --without-default-features which
> can be paired with a --without-default-devices for a barely functional
> build.
> 
> The main use case for this is testing our build assumptions and for
> minimising the amount of stuff you build if you just want to test a
> particular feature on your relatively slow emulated test system.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   configure | 159 ++++++++++++++++++++++++++++++------------------------
>   1 file changed, 88 insertions(+), 71 deletions(-)
> 
> diff --git a/configure b/configure
> index 8f2095a2db..a08e6c96e0 100755
> --- a/configure
> +++ b/configure
> @@ -291,10 +291,24 @@ unset target_list_exclude
>   #
>   # Always add --enable-foo and --disable-foo command line args.
>   # Distributions want to ensure that several features are compiled in, and it
> -# is impossible without a --enable-foo that exits if a feature is not found.
> +# is impossible without a --enable-foo that exits if a feature is not
> +# found.
>   
> -brlapi=""
> -curl=""
> +default_feature=""
> +default_yes_feature="yes"
> +# parse CC options second
> +for opt do
> +  optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
> +  case "$opt" in
> +      --without-default-features)
> +          default_feature="no"
> +          default_yes_feature="no"

default_yes_features can be replaced with ${default_feature:-yes} if you 
wish.

> +  ;;
> +  esac
> +done

Since Meson has equivalent functionality to --without-default-features, 
you also want to add -Dauto_features=disabled to the meson command line.

Also, the gettext feature is true/false/empty rather than yes/no, so 
it's not being adjusted.  I suggest you change it (in meson_options.txt) 
from "boolean" to "feature" (auto/enabled/disabled) and move the 
detection code from configure to po/meson.build.  It should be as simple as

-if get_option('gettext')
+if find_program('xgettext', required: get_option('gettext')).found()

and then it will also get the functionality from -Dauto_features.

Paolo

> @@ -453,7 +467,7 @@ gettext=""
>   bogus_os="no"
>   malloc_trim="auto"
>   
> -# parse CC options first
> +# parse CC options second
>   for opt do
>     optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
>     case "$opt" in
> @@ -796,7 +810,7 @@ Linux)
>     audio_possible_drivers="oss alsa sdl pa"
>     linux="yes"
>     linux_user="yes"
> -  vhost_user="yes"
> +  vhost_user="$default_yes_feature"
>   ;;
>   esac
>   
> @@ -940,6 +954,8 @@ for opt do
>     ;;
>     --without-default-devices) default_devices="no"
>     ;;
> +  --without-default-features) # processed above
> +  ;;
>     --enable-gprof) gprof="yes"
>     ;;
>     --enable-gcov) gcov="yes"
> @@ -1737,7 +1753,8 @@ Advanced options (experts only):
>     --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:
> +disabled with --disable-FEATURE, default is enabled if available
> +(unless built with --without-default-features):
>   
>     system          all system emulation targets
>     user            supported user emulation targets
> 



  reply	other threads:[~2020-12-10  0:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09 17:00 [PATCH v1 0/6] testing/next (without-features, gitlab, python) Alex Bennée
2020-12-09 17:00 ` [PATCH v1 1/6] configure: include moxie-softmmu in deprecated_targets_list Alex Bennée
2020-12-09 17:00 ` [PATCH v1 2/6] gitlab: include aarch64-softmmu and ppc64-softmmu cross-system-build Alex Bennée
2020-12-09 17:08   ` Thomas Huth
2020-12-09 18:19     ` Richard Henderson
2020-12-09 17:00 ` [PATCH v1 3/6] configure: add --without-default-features Alex Bennée
2020-12-10  0:08   ` Paolo Bonzini [this message]
2020-12-09 17:00 ` [PATCH v1 4/6] python: add __repr__ to ConsoleSocket to aid debugging Alex Bennée
2020-12-09 17:00 ` [PATCH v1 5/6] gitlab: move --without-default-devices build from Travis Alex Bennée
2020-12-09 17:10   ` Thomas Huth
2020-12-09 17:00 ` [PATCH v1 6/6] gitlab: add --without-default-features build Alex Bennée
2020-12-09 17:13   ` Thomas Huth
2020-12-09 18:32     ` Alex Bennée
2020-12-10  5:51       ` Thomas Huth

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=3605142c-6815-b2a1-1008-69bd791d6a6d@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --cc=cota@braap.org \
    --cc=f4bug@amsat.org \
    --cc=fam@euphon.net \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=stefanha@redhat.com \
    /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).