aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rwxr-xr-xconfigure31
2 files changed, 36 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 67f19f2080..88375dcf90 100644
--- a/Makefile
+++ b/Makefile
@@ -145,6 +145,15 @@ pixman/Makefile: $(SRC_PATH)/pixman/configure
$(SRC_PATH)/pixman/configure:
(cd $(SRC_PATH)/pixman; autoreconf -v --install)
+DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
+DTC_CFLAGS=$(CFLAGS) $(extra_cflags) -I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
+
+subdir-dtc:dtc/libfdt dtc/tests
+ $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt,)
+
+dtc/%:
+ mkdir -p $@
+
$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y)
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
@@ -262,6 +271,7 @@ distclean: clean
rm -rf $$d || exit 1 ; \
done
if test -f pixman/config.log; then make -C pixman distclean; fi
+ if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
ar de en-us fi fr-be hr it lv nl pl ru th \
diff --git a/configure b/configure
index d5f151610a..7546799c90 100755
--- a/configure
+++ b/configure
@@ -2496,17 +2496,34 @@ if test "$fdt" != "no" ; then
int main(void) { return 0; }
EOF
if compile_prog "" "$fdt_libs" ; then
+ # system DTC is good - use it
fdt=yes
- libs_softmmu="$libs_softmmu $fdt_libs"
- else
- if test "$fdt" = "yes" ; then
- feature_not_found "fdt"
+ elif test -d ${source_path}/dtc/libfdt ; then
+ # have submodule DTC - use it
+ fdt=yes
+ dtc_internal="yes"
+ mkdir -p dtc
+ if [ "$source_path" != `pwd` ] ; then
+ symlink "$source_path/dtc/Makefile" "dtc/Makefile"
+ symlink "$source_path/dtc/scripts" "dtc/scripts"
fi
+ fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt"
+ fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
+ elif test "$fdt" = "yes" ; then
+ # have neither and want - prompt for system/submodule install
+ error_exit "ERROR: DTC not present. Your options:" \
+ " (1) Preferred: Install the DTC devel package" \
+ " (2) Fetch the DTC submodule, using:" \
+ " git submodule update --init dtc"
+ else
+ # don't have and don't want
fdt_libs=
fdt=no
fi
fi
+libs_softmmu="$libs_softmmu $fdt_libs"
+
##########################################
# GLX probe, used by milkymist-tmu2
if test "$glx" != "no" ; then
@@ -3452,7 +3469,7 @@ if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then
fi
# add pixman flags after all config tests are done
-QEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags"
+QEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags $fdt_cflags"
libs_softmmu="$libs_softmmu $pixman_libs"
echo "Install prefix $prefix"
@@ -4515,6 +4532,10 @@ if [ "$pixman" = "internal" ]; then
echo "config-host.h: subdir-pixman" >> $config_host_mak
fi
+if [ "$dtc_internal" = "yes" ]; then
+ echo "config-host.h: subdir-dtc" >> $config_host_mak
+fi
+
# build tree in object directory in case the source is not in the current directory
DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos"
DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas"