aboutsummaryrefslogtreecommitdiff
path: root/pc-bios/meson.build
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-08-28 11:43:06 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2023-09-07 13:32:14 +0200
commit6e0dc9d2a88aa26062db368bc90f81ac24cc8b9c (patch)
treee79d04d0f5ab63968aac758f6027d5014d2b2494 /pc-bios/meson.build
parent3c7ee49b81d2fc2930c09f9e0206227516d406e1 (diff)
meson: compile bundled device trees
If dtc is available, compile the .dts files in the pc-bios directory instead of using the precompiled binaries. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'pc-bios/meson.build')
-rw-r--r--pc-bios/meson.build25
1 files changed, 21 insertions, 4 deletions
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index a7224ef469..e67fa433a1 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -57,10 +57,6 @@ blobs = [
'efi-e1000e.rom',
'efi-vmxnet3.rom',
'qemu-nsis.bmp',
- 'bamboo.dtb',
- 'canyonlands.dtb',
- 'petalogix-s3adsp1800.dtb',
- 'petalogix-ml605.dtb',
'multiboot.bin',
'multiboot_dma.bin',
'linuxboot.bin',
@@ -84,6 +80,27 @@ blobs = [
'vof-nvram.bin',
]
+dtc = find_program('dtc', required: false)
+foreach f : [
+ 'bamboo.dts',
+ 'canyonlands.dts',
+ 'petalogix-s3adsp1800.dts',
+ 'petalogix-ml605.dts',
+]
+ out = fs.replace_suffix(f, '.dtb')
+ if dtc.found()
+ custom_target(f,
+ build_by_default: have_system,
+ input: files(f),
+ output: out,
+ install: get_option('install_blobs'),
+ install_dir: qemu_datadir,
+ command: [ dtc, '-I', 'dts', '-O', 'dtb', '-o', '@OUTPUT@', '@INPUT0@' ])
+ else
+ blobs += out
+ endif
+endforeach
+
if get_option('install_blobs')
install_data(blobs, install_dir: qemu_datadir)
endif