configure: add --without-default-features

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>
This commit is contained in:
Alex Bennée 2020-12-10 19:04:13 +00:00 committed by Paolo Bonzini
parent 0e8e77d487
commit c87ea11631
1 changed files with 85 additions and 70 deletions

155
configure vendored
View File

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