[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 48/48] configure: allow the selection of alternate config in the b
From: |
Paolo Bonzini |
Subject: |
[PULL 48/48] configure: allow the selection of alternate config in the build |
Date: |
Thu, 8 Jul 2021 17:17:48 +0200 |
From: Alex Bennée <alex.bennee@linaro.org>
While the default config works well enough it does end up enabling a
lot of stuff. For more minimal builds we can select a different list
of devices and let Kconfig work out what we want. For example:
../../configure --without-default-features \
--target-list=arm-softmmu,aarch64-softmmu \
--with-devices-aarch64=minimal
will override the aarch64-softmmu default set of devices with a more
minimal set of devices that just enables the virt and sbsa-ref models.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210707131744.26027-6-alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configs/devices/aarch64-softmmu/minimal.mak | 9 ++++++++
configure | 24 ++++++++++++++++++++-
meson.build | 3 ++-
3 files changed, 34 insertions(+), 2 deletions(-)
create mode 100644 configs/devices/aarch64-softmmu/minimal.mak
diff --git a/configs/devices/aarch64-softmmu/minimal.mak
b/configs/devices/aarch64-softmmu/minimal.mak
new file mode 100644
index 0000000000..0ebc1dca56
--- /dev/null
+++ b/configs/devices/aarch64-softmmu/minimal.mak
@@ -0,0 +1,9 @@
+#
+# A minimal version of the config that only supports only a few
+# virtual machines. This avoids bringing in any of numerous legacy
+# features from the 32bit platform (although virt still supports 32bit
+# itself)
+#
+
+CONFIG_ARM_VIRT=y
+CONFIG_SBSA_REF=y
diff --git a/configure b/configure
index 4eba89f823..85db248ac1 100755
--- a/configure
+++ b/configure
@@ -915,6 +915,18 @@ for opt do
;;
--without-default-devices) default_devices="false"
;;
+ --with-devices-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --with-devices-FOO
option"
+ ;;
+ --with-devices-*) device_arch=${opt#--with-devices-};
+ device_arch=${device_arch%%=*}
+
cf=$source_path/configs/devices/$device_arch-softmmu/$optarg.mak
+ if test -f "$cf"; then
+ device_archs="$device_archs $device_arch"
+ eval "devices_${device_arch}=\$optarg"
+ else
+ error_exit "File $cf does not exist"
+ fi
+ ;;
--without-default-features) # processed above
;;
--enable-gprof) gprof="yes"
@@ -1764,7 +1776,8 @@ Advanced options (experts only):
--without-default-features default all --enable-* options to "disabled"
--without-default-devices do not include any device that is not needed to
start the emulator (only use if you are including
- desired devices in default-configs/devices/)
+ desired devices in configs/devices/)
+ --with-devices-ARCH=NAME override default configs/devices
--enable-debug enable common debug build options
--enable-sanitizers enable default sanitizers
--enable-tsan enable thread sanitizer
@@ -5082,6 +5095,15 @@ if test "$skip_meson" = no; then
echo "# Automatically generated by configure - do not modify" > $cross
echo "[properties]" >> $cross
+
+ # unroll any custom device configs
+ if test -n "$device_archs"; then
+ for a in $device_archs; do
+ eval "c=\$devices_${a}"
+ echo "${a}-softmmu = '$c'" >> $cross
+ done
+ fi
+
test -z "$cxx" && echo "link_language = 'c'" >> $cross
echo "[built-in options]" >> $cross
echo "c_args = [${CFLAGS:+$(meson_quote $CFLAGS)}]" >> $cross
diff --git a/meson.build b/meson.build
index 71c7462e89..651c3b114b 100644
--- a/meson.build
+++ b/meson.build
@@ -1595,9 +1595,10 @@ foreach target : target_dirs
configuration:
config_target_data)}
if target.endswith('-softmmu')
+ config_input = meson.get_external_property(target, 'default')
config_devices_mak = target + '-config-devices.mak'
config_devices_mak = configure_file(
- input: ['configs/devices' / target / 'default.mak', 'Kconfig'],
+ input: ['configs/devices' / target / config_input + '.mak', 'Kconfig'],
output: config_devices_mak,
depfile: config_devices_mak + '.d',
capture: true,
--
2.31.1
- [PULL 35/48] usb: drop usb_host_dev_is_scsi_storage hook, (continued)
- [PULL 35/48] usb: drop usb_host_dev_is_scsi_storage hook, Paolo Bonzini, 2021/07/08
- [PULL 37/48] usb: build usb-host as module, Paolo Bonzini, 2021/07/08
- [PULL 34/48] monitor: allow register hmp commands, Paolo Bonzini, 2021/07/08
- [PULL 33/48] accel: build tcg modular, Paolo Bonzini, 2021/07/08
- [PULL 26/48] modules: add module_obj() note to QOM docs, Paolo Bonzini, 2021/07/08
- [PULL 39/48] target/i386: Added MSRPM and IOPM size check, Paolo Bonzini, 2021/07/08
- [PULL 40/48] target/i386: Added DR6 and DR7 consistency checks, Paolo Bonzini, 2021/07/08
- [PULL 36/48] monitor/usb: register 'info usbhost' dynamically, Paolo Bonzini, 2021/07/08
- [PULL 38/48] monitor/tcg: move tcg hmp commands to accel/tcg, register them dynamically, Paolo Bonzini, 2021/07/08
- [PULL 45/48] hw/arm: add dependency on OR_IRQ for XLNX_VERSAL, Paolo Bonzini, 2021/07/08
- [PULL 48/48] configure: allow the selection of alternate config in the build,
Paolo Bonzini <=
- [PULL 31/48] accel: build qtest modular, Paolo Bonzini, 2021/07/08
- [PULL 41/48] target/i386: fix exceptions for MOV to DR, Paolo Bonzini, 2021/07/08
- [PULL 43/48] meson: switch function tests from compilation to linking, Paolo Bonzini, 2021/07/08
- [PULL 44/48] meson: Introduce target-specific Kconfig, Paolo Bonzini, 2021/07/08
- [PULL 47/48] configs: rename default-configs to configs and reorganise, Paolo Bonzini, 2021/07/08
- [PULL 42/48] vl: fix leak of qdict_crumple return value, Paolo Bonzini, 2021/07/08
- [PULL 46/48] hw/arm: move CONFIG_V7M out of default-devices, Paolo Bonzini, 2021/07/08
- Re: [PULL 00/48] Misc patches for QEMU 6.1 soft freeze, Peter Maydell, 2021/07/09