qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 3/6] configure: add --without-default-features


From: Paolo Bonzini
Subject: Re: [PATCH v1 3/6] configure: add --without-default-features
Date: Thu, 10 Dec 2020 01:08:17 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]