@@ -245,7 +245,6 @@ ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
-mpc8544ds.dtb \
multiboot.bin linuxboot.bin \
s390-zipl.rom \
spapr-rtas.bin slof.bin
@@ -253,6 +252,20 @@ else
BLOBS=
endif
+ifdef INSTALL_DTBS
+DTBS=$(SRC_PATH)/pc-bios/mpc8544ds.dtb
+
+%.dtb: %.dts
+ $(call quiet-command,$(DTC) -I dts -O dtb -b 0 -o $@ $<, " DTC $@")
+
+install-dtbs: $(DTBS)
+ $(INSTALL_DIR) "$(DESTDIR)$(datadir)"
+ set -e; for x in $(DTBS); do \
+ $(INSTALL_DATA) $$x "$(DESTDIR)$(datadir)"; \
+ done
+
+endif
+
install-doc: $(DOCS)
$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
$(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
@@ -267,7 +280,7 @@ install-sysconfig:
$(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
-install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
+install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig $(if $(INSTALL_DTBS),install-dtbs)
$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
ifneq ($(TOOLS),)
$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
@@ -182,6 +182,7 @@ usb_redir=""
opengl=""
zlib="yes"
guest_agent="yes"
+dtc=dtc
# parse CC options first
for opt do
@@ -728,6 +729,12 @@ for opt do
;;
--disable-blobs) blobs="no"
;;
+ --enable-dtbs) install_dtbs="yes"
+ ;;
+ --disable-dtbs) install_dtbs="no"
+ ;;
+ --with-dtc=*) dtc=$optarg
+ ;;
--with-pkgversion=*) pkgversion=" ($optarg)"
;;
--disable-docs) docs="no"
@@ -771,6 +778,13 @@ for opt do
esac
done
+# set default for $install_dtbs, may be overriden by command line
+if has $dtc; then
+ install_dtbs="yes"
+else
+ install_dtbs="no"
+fi
+
#
# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
# QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
@@ -1028,6 +1042,9 @@ echo " --enable-linux-aio enable Linux AIO support"
echo " --disable-attr disables attr and xattr support"
echo " --enable-attr enable attr and xattr support"
echo " --disable-blobs disable installing provided firmware blobs"
+echo " --enable-dtbs build/install provided device trees (requires dtc)"
+echo " --disable-dtbs don't build/install provided device trees"
+echo " --with-dtc full path to device tree compiler (overrides default)"
echo " --enable-docs enable documentation build"
echo " --disable-docs disable documentation build"
echo " --disable-vhost-net disable vhost-net acceleration support"
@@ -2713,6 +2730,7 @@ echo "vde support $vde"
echo "Linux AIO support $linux_aio"
echo "ATTR/XATTR support $attr"
echo "Install blobs $blobs"
+echo "Install dtbs $install_dtbs"
echo "KVM support $kvm"
echo "fdt support $fdt"
echo "preadv support $preadv"
@@ -2982,6 +3000,9 @@ fi
if test "$blobs" = "yes" ; then
echo "INSTALL_BLOBS=yes" >> $config_host_mak
fi
+if test "$install_dtbs" = "yes" ; then
+ echo "INSTALL_DTBS=yes" >> $config_host_mak
+fi
if test "$iovec" = "yes" ; then
echo "CONFIG_IOVEC=y" >> $config_host_mak
fi
@@ -3122,6 +3143,9 @@ echo "ARLIBS_END=$arlibs_end" >> $config_host_mak
echo "LIBS+=$LIBS" >> $config_host_mak
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
echo "EXESUF=$EXESUF" >> $config_host_mak
+if test "$install_dtbs" = "yes" ; then
+ echo "DTC=$dtc" >> $config_host_mak
+fi
echo "LIBS_QGA+=$libs_qga" >> $config_host_mak
# generate list of library paths for linker script