All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>
Subject: [PULL 03/55] configure: add --without-default-features
Date: Mon, 21 Dec 2020 15:43:55 +0100	[thread overview]
Message-ID: <20201221144447.26161-4-pbonzini@redhat.com> (raw)
In-Reply-To: <20201221144447.26161-1-pbonzini@redhat.com>

From: Alex Bennée <alex.bennee@linaro.org>

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. On
it's own I go from:

  $ ls -lh qemu-system-aarch64
  -rwxr-xr-x 1 alex alex 120M Dec 10 12:45 qemu-system-aarch64*
  $ ldd qemu-system-aarch64 | wc -l
  170

to:

  $ ls -lh qemu-aarch64
  -rwxr-xr-x 1 alex alex 43M Dec 10 12:41 qemu-aarch64*
  $ ldd qemu-system-aarch64 | wc -l
  57

which is still able to run my default Debian ARM64 machine with a lot
less fat involved.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Thomas Huth <thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201210190417.31673-5-alex.bennee@linaro.org>
---
 configure | 155 ++++++++++++++++++++++++++++++------------------------
 1 file changed, 85 insertions(+), 70 deletions(-)

diff --git a/configure b/configure
index 134f5de5ab..a5ee2d2a06 100755
--- a/configure
+++ b/configure
@@ -293,8 +293,19 @@ unset target_list_exclude
 # 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.
 
-brlapi=""
-curl=""
+default_feature=""
+# parse CC options second
+for opt do
+  optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
+  case "$opt" in
+      --without-default-features)
+          default_feature="no"
+  ;;
+  esac
+done
+
+brlapi="$default_feature"
+curl="$default_feature"
 iconv="auto"
 curses="auto"
 docs="auto"
@@ -303,52 +314,52 @@ netmap="no"
 sdl="auto"
 sdl_image="auto"
 virtiofsd="auto"
-virtfs=""
+virtfs="$default_feature"
 libudev="auto"
 mpath="auto"
 vnc="enabled"
 sparse="auto"
-vde=""
+vde="$default_feature"
 vnc_sasl="auto"
 vnc_jpeg="auto"
 vnc_png="auto"
 xkbcommon="auto"
-xen=""
-xen_ctrl_version=""
+xen="$default_feature"
+xen_ctrl_version="$default_feature"
 xen_pci_passthrough="auto"
-linux_aio=""
-linux_io_uring=""
-cap_ng=""
-attr=""
-libattr=""
-xfs=""
+linux_aio="$default_feature"
+linux_io_uring="$default_feature"
+cap_ng="$default_feature"
+attr="$default_feature"
+libattr="$default_feature"
+xfs="$default_feature"
 tcg="enabled"
-membarrier=""
-vhost_net=""
-vhost_crypto=""
-vhost_scsi=""
-vhost_vsock=""
+membarrier="$default_feature"
+vhost_net="$default_feature"
+vhost_crypto="$default_feature"
+vhost_scsi="$default_feature"
+vhost_vsock="$default_feature"
 vhost_user="no"
 vhost_user_blk_server="auto"
-vhost_user_fs=""
+vhost_user_fs="$default_feature"
 kvm="auto"
 hax="auto"
 hvf="auto"
 whpx="auto"
-rdma=""
-pvrdma=""
+rdma="$default_feature"
+pvrdma="$default_feature"
 gprof="no"
 debug_tcg="no"
 debug="no"
 sanitizers="no"
 tsan="no"
-fortify_source=""
+fortify_source="$default_feature"
 strip_opt="yes"
 tcg_interpreter="no"
 bigendian="no"
 mingw32="no"
 gcov="no"
-EXESUF=""
+EXESUF="$default_feature"
 HOST_DSOSUF=".so"
 modules="no"
 module_upgrades="no"
@@ -370,81 +381,81 @@ pie=""
 qom_cast_debug="yes"
 trace_backends="log"
 trace_file="trace"
-spice=""
-rbd=""
-smartcard=""
+spice="$default_feature"
+rbd="$default_feature"
+smartcard="$default_feature"
 u2f="auto"
-libusb=""
-usb_redir=""
-opengl=""
+libusb="$default_feature"
+usb_redir="$default_feature"
+opengl="$default_feature"
 opengl_dmabuf="no"
 cpuid_h="no"
-avx2_opt=""
+avx2_opt="$default_feature"
 capstone="auto"
-lzo=""
-snappy=""
-bzip2=""
-lzfse=""
-zstd=""
-guest_agent=""
+lzo="$default_feature"
+snappy="$default_feature"
+bzip2="$default_feature"
+lzfse="$default_feature"
+zstd="$default_feature"
+guest_agent="$default_feature"
 guest_agent_with_vss="no"
 guest_agent_ntddscsi="no"
-guest_agent_msi=""
-vss_win32_sdk=""
+guest_agent_msi="$default_feature"
+vss_win32_sdk="$default_feature"
 win_sdk="no"
-want_tools=""
-libiscsi=""
-libnfs=""
+want_tools="$default_feature"
+libiscsi="$default_feature"
+libnfs="$default_feature"
 coroutine=""
-coroutine_pool=""
+coroutine_pool="$default_feature"
 debug_stack_usage="no"
 crypto_afalg="no"
-seccomp=""
-glusterfs=""
+seccomp="$default_feature"
+glusterfs="$default_feature"
 glusterfs_xlator_opt="no"
 glusterfs_discard="no"
 glusterfs_fallocate="no"
 glusterfs_zerofill="no"
 glusterfs_ftruncate_has_stat="no"
 glusterfs_iocb_has_stat="no"
-gtk=""
+gtk="$default_feature"
 gtk_gl="no"
 tls_priority="NORMAL"
-gnutls=""
-nettle=""
+gnutls="$default_feature"
+nettle="$default_feature"
 nettle_xts="no"
-gcrypt=""
+gcrypt="$default_feature"
 gcrypt_hmac="no"
 gcrypt_xts="no"
 qemu_private_xts="yes"
-auth_pam=""
-vte=""
-virglrenderer=""
-tpm=""
-libssh=""
-live_block_migration="yes"
-numa=""
+auth_pam="$default_feature"
+vte="$default_feature"
+virglrenderer="$default_feature"
+tpm="$default_feature"
+libssh="$default_feature"
+live_block_migration=${default_feature:-yes}
+numa="$default_feature"
 tcmalloc="no"
 jemalloc="no"
-replication="yes"
-bochs="yes"
-cloop="yes"
-dmg="yes"
-qcow1="yes"
-vdi="yes"
-vvfat="yes"
-qed="yes"
-parallels="yes"
+replication=${default_feature:-yes}
+bochs=${default_feature:-yes}
+cloop=${default_feature:-yes}
+dmg=${default_feature:-yes}
+qcow1=${default_feature:-yes}
+vdi=${default_feature:-yes}
+vvfat=${default_feature:-yes}
+qed=${default_feature:-yes}
+parallels=${default_feature:-yes}
 sheepdog="no"
-libxml2=""
+libxml2="$default_feature"
 debug_mutex="no"
-libpmem=""
+libpmem="$default_feature"
 default_devices="yes"
 plugins="no"
 fuzzing="no"
 rng_none="no"
-secret_keyring=""
-libdaxctl=""
+secret_keyring="$default_feature"
+libdaxctl="$default_feature"
 meson=""
 ninja=""
 skip_meson=no
@@ -455,7 +466,7 @@ fuse_lseek="auto"
 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
@@ -798,7 +809,7 @@ Linux)
   audio_possible_drivers="oss alsa sdl pa"
   linux="yes"
   linux_user="yes"
-  vhost_user="yes"
+  vhost_user=${default_feature:-yes}
 ;;
 esac
 
@@ -942,6 +953,8 @@ for opt do
   ;;
   --without-default-devices) default_devices="no"
   ;;
+  --without-default-features) # processed above
+  ;;
   --enable-gprof) gprof="yes"
   ;;
   --enable-gcov) gcov="yes"
@@ -1747,7 +1760,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
@@ -6957,6 +6971,7 @@ NINJA=$ninja $meson setup \
         -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
         -Dvhost_user_blk_server=$vhost_user_blk_server \
         -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
+        $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \
         $cross_arg \
         "$PWD" "$source_path"
 
-- 
2.29.2




  parent reply	other threads:[~2020-12-21 14:52 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21 14:43 [PULL 00/55] Misc patches for 2020-12-21 Paolo Bonzini
2020-12-21 14:43 ` [PULL 01/55] gitlab: include aarch64-softmmu and ppc64-softmmu cross-system-build Paolo Bonzini
2020-12-21 14:43 ` [PULL 02/55] configure: move gettext detection to meson.build Paolo Bonzini
2020-12-21 14:43 ` Paolo Bonzini [this message]
2020-12-21 14:43 ` [PULL 04/55] python: add __repr__ to ConsoleSocket to aid debugging Paolo Bonzini
2020-12-21 14:43 ` [PULL 05/55] gitlab: move --without-default-devices build from Travis Paolo Bonzini
2020-12-21 14:43 ` [PULL 06/55] gitlab: add --without-default-features build Paolo Bonzini
2020-12-21 14:43 ` [PULL 07/55] tests/tcg: build tests with -Werror Paolo Bonzini
2020-12-21 14:44 ` [PULL 08/55] gitlab-CI: Test 32-bit builds with the fedora-i386-cross container Paolo Bonzini
2020-12-21 14:44 ` [PULL 09/55] tests/docker: Remove the remainders of debian9 containers from the Makefile Paolo Bonzini
2020-12-21 14:44 ` [PULL 10/55] tests: update for rename of CentOS8 PowerTools repo Paolo Bonzini
2020-12-21 14:44 ` [PULL 11/55] configure: document --without-default-{features, devices} Paolo Bonzini
2020-12-21 14:44 ` [PULL 12/55] vl: initialize displays _after_ exiting preconfiguration Paolo Bonzini
2020-12-21 14:44 ` [PULL 13/55] test-char: Destroy chardev correctly at char_file_test_internal() Paolo Bonzini
2020-12-21 14:44 ` [PULL 14/55] qom: Assert that objects being destroyed have no parent Paolo Bonzini
2020-12-21 14:44 ` [PULL 15/55] target/i386: Check privilege level for protected mode 'int N' task gate Paolo Bonzini
2020-12-21 14:44 ` [PULL 16/55] configure,meson: add option to enable LTO Paolo Bonzini
2020-12-21 14:44 ` [PULL 17/55] cfi: Initial support for cfi-icall in QEMU Paolo Bonzini
2020-12-21 14:44 ` [PULL 18/55] check-block: enable iotests with cfi-icall Paolo Bonzini
2020-12-21 14:44 ` [PULL 19/55] configure,meson: support Control-Flow Integrity Paolo Bonzini
2020-12-21 14:44 ` [PULL 20/55] docs: Add CFI Documentation Paolo Bonzini
2020-12-21 14:44 ` [PULL 21/55] build-sys: fix -static linking of libvhost-user Paolo Bonzini
2020-12-21 14:44 ` [PULL 22/55] remove TCG includes from common code Paolo Bonzini
2020-12-21 14:44 ` [PULL 23/55] util: Extract flush_icache_range to cacheflush.c Paolo Bonzini
2020-12-21 14:44 ` [PULL 24/55] trace: do not include TCG helper tracepoints in no-TCG builds Paolo Bonzini
2020-12-21 14:44 ` [PULL 25/55] Makefile: add dummy target for build.ninja dependencies Paolo Bonzini
2020-12-21 14:44 ` [PULL 26/55] meson: update submodule to 0.56.0 Paolo Bonzini
2020-12-21 14:44 ` [PULL 27/55] meson: switch minimum meson version " Paolo Bonzini
2020-12-21 14:44 ` [PULL 28/55] meson: fix detection of curses with pkgconfig Paolo Bonzini
2020-12-21 14:44 ` [PULL 29/55] meson: use pkg-config method for libudev Paolo Bonzini
2020-12-21 14:44 ` [PULL 30/55] meson: use dependency to gate block modules Paolo Bonzini
2020-12-21 14:44 ` [PULL 31/55] meson: cleanup Kconfig.host handling Paolo Bonzini
2020-12-21 14:44 ` [PULL 32/55] configure: remove useless code to check for Xen PCI passthrough Paolo Bonzini
2020-12-21 14:44 ` [PULL 33/55] configure: remove variable bogus_os Paolo Bonzini
2020-12-21 14:44 ` [PULL 34/55] configure: accept --enable-slirp Paolo Bonzini
2020-12-21 14:44 ` [PULL 35/55] configure: remove CONFIG_FILEVERSION and CONFIG_PRODUCTVERSION Paolo Bonzini
2020-12-21 14:44 ` [PULL 36/55] brlapi: convert to meson Paolo Bonzini
2020-12-21 14:44 ` [PULL 37/55] curl: remove compatibility code, require 7.29.0 Paolo Bonzini
2020-12-21 14:44 ` [PULL 38/55] curl: convert to meson Paolo Bonzini
2020-12-21 14:44 ` [PULL 39/55] glusterfs: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 40/55] bzip2: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 41/55] libiscsi: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 42/55] libnfs: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 43/55] libssh: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 44/55] rbd: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 45/55] lzo: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 46/55] snappy: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 47/55] lzfse: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 48/55] zstd: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 49/55] seccomp: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 50/55] virtfs: " Paolo Bonzini
2021-01-07 13:58   ` Bruce Rogers
2021-01-07 14:49     ` Paolo Bonzini
2021-01-07 15:31       ` Bruce Rogers
2020-12-21 14:44 ` [PULL 51/55] cap_ng: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 52/55] libattr: " Paolo Bonzini
2020-12-21 14:44 ` [PULL 53/55] meson.build: convert --with-default-devices " Paolo Bonzini
2020-12-21 14:44 ` [PULL 54/55] configure: move tests/qemu-iotests/common.env generation " Paolo Bonzini
2020-12-21 14:44 ` [PULL 55/55] win32: drop fd registration to the main-loop on setting non-block Paolo Bonzini
2021-01-01 17:05 ` [PULL 00/55] Misc patches for 2020-12-21 Peter Maydell
2021-01-01 19:59   ` 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=20201221144447.26161-4-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.