This is a follow up to the "default y" patch series at
https://lore.kernel.org/qemu-devel/20240423131612.28362-1-pbonz...@redhat.com/
and shows an example of what that series enables.

With this change, individual boards will be enabled/disabled depending
on whether libfdt is present or not.  In particular, x86 will simply
disable microvm and build the "traditional" chipsets if libfdt is not
found.

All boards or targets that need libfdt now have an explicit "depends on
FDT" (sometimes the boards delegate that to the target).  TARGET_NEED_FDT
is only used for targets that absolutely cannot build without libfdt,
or for which all boards require it.

For simplicity, patch 1 simplifies the libfdt handling in meson.build,
removing the ability to force use of the subproject.  There is no
use case that I can imagine, if you want to use the subproject just
delete libfdt from your OS installation.

Paolo

v1->v2:
- use libfdt CPPFLAGS when building target-specific files
- limited scope of libfdt detection changes: keep it enabled when building
  --without-default-features (see commit message for 0577e84d374,
  "configure: Disable capstone and slirp in the --without-default-features
  mode", 2022-02-21)
- patch 6 does not 
- split patch 3 in two parts
- fix compilation errors due to missing qmp_dumpdtb/hmp_dumpdtb
- make MIPS_BOSTON depend on FDT

Paolo Bonzini (6):
  meson: pick libfdt from common_ss when building target-specific files
  meson: move libfdt together with other dependencies
  kconfig: allow compiling out QEMU device tree code per target
  kconfig: express dependency of individual boards on libfdt
  hw/xtensa: require libfdt
  configs: disable emulators that require it if libfdt is not found

 configs/targets/aarch64-softmmu.mak      |   1 +
 configs/targets/arm-softmmu.mak          |   1 +
 configs/targets/i386-softmmu.mak         |   1 -
 configs/targets/loongarch64-softmmu.mak  |   1 +
 configs/targets/microblaze-softmmu.mak   |   1 +
 configs/targets/microblazeel-softmmu.mak |   1 +
 configs/targets/mips64el-softmmu.mak     |   1 -
 configs/targets/or1k-softmmu.mak         |   1 +
 configs/targets/ppc-softmmu.mak          |   1 -
 configs/targets/ppc64-softmmu.mak        |   1 +
 configs/targets/riscv32-softmmu.mak      |   1 +
 configs/targets/riscv64-softmmu.mak      |   1 +
 configs/targets/rx-softmmu.mak           |   1 +
 configs/targets/x86_64-softmmu.mak       |   1 -
 meson.build                              | 100 +++++++++++++----------
 include/monitor/hmp.h                    |   1 +
 include/sysemu/device_tree.h             |   1 -
 hw/xtensa/xtfpga.c                       |   9 --
 monitor/hmp-cmds.c                       |  17 ++++
 system/device_tree-stub.c                |  10 +++
 system/device_tree.c                     |  14 ----
 .gitlab-ci.d/buildtest.yml               |   8 +-
 Kconfig.host                             |   3 +
 hw/arm/Kconfig                           |   5 ++
 hw/arm/meson.build                       |   2 +-
 hw/core/Kconfig                          |   9 +-
 hw/core/meson.build                      |   2 +-
 hw/i386/Kconfig                          |   3 +-
 hw/loongarch/Kconfig                     |   3 +-
 hw/loongarch/meson.build                 |   2 +-
 hw/mips/Kconfig                          |   3 +-
 hw/mips/meson.build                      |   2 +-
 hw/openrisc/Kconfig                      |   2 +
 hw/openrisc/meson.build                  |   4 +-
 hw/ppc/Kconfig                           |  15 ++--
 hw/ppc/meson.build                       |   4 +-
 hw/riscv/Kconfig                         |   4 +
 hw/riscv/meson.build                     |   2 +-
 hw/rx/Kconfig                            |   3 +-
 hw/xtensa/Kconfig                        |   3 +-
 system/meson.build                       |   4 +-
 target/arm/Kconfig                       |   2 +
 target/microblaze/Kconfig                |   1 +
 target/openrisc/Kconfig                  |   1 +
 target/riscv/Kconfig                     |   2 +
 45 files changed, 154 insertions(+), 101 deletions(-)
 create mode 100644 system/device_tree-stub.c

-- 
2.45.0


Reply via email to