aboutsummaryrefslogtreecommitdiffstats
path: root/tools/Makefile
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-01-22 09:43:53 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-01-22 09:43:53 +0000
commit036e6bd11be95e3e78d2316b0cf0847740b539bc (patch)
tree9cd2ca74318038be67b98edc7ce53785a42303cd /tools/Makefile
parentc7ee45b34e361a8f4db226d3802472fcd0e277df (diff)
downloadxen-036e6bd11be95e3e78d2316b0cf0847740b539bc.tar.gz
xen-036e6bd11be95e3e78d2316b0cf0847740b539bc.tar.bz2
xen-036e6bd11be95e3e78d2316b0cf0847740b539bc.zip
Make tools/Makefile cross-friendly
Pass Xen cross-compilation options through to ioemu. Export CROSS_SYS_ROOT for use by scripts. Unexport IOEMU_DIR since it isn't used outside of the Makefile. Signed-off-by: Aron Griffis <aron@hp.com>
Diffstat (limited to 'tools/Makefile')
-rw-r--r--tools/Makefile15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/Makefile b/tools/Makefile
index f023fbb500..14abf6026d 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -28,6 +28,12 @@ SUBDIRS-$(PYTHON_TOOLS) += python
SUBDIRS-$(PYTHON_TOOLS) += pygrub
endif
+# For the sake of linking, set the sys-root
+ifneq ($(CROSS_COMPILE),)
+CROSS_SYS_ROOT ?= /usr/$(CROSS_COMPILE:-=)/sys-root
+export CROSS_SYS_ROOT
+endif
+
.PHONY: all
all: check
@set -e; for subdir in $(SUBDIRS-y); do \
@@ -65,10 +71,15 @@ check_clean:
.PHONY: ioemu ioemuinstall ioemuclean
ifeq ($(CONFIG_IOEMU),y)
-export IOEMU_DIR ?= ioemu
+IOEMU_DIR ?= ioemu
+ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
+IOEMU_CONFIGURE_CROSS ?= --cross-prefix=$(CROSS_COMPILE) \
+ --interp-prefix=$(CROSS_SYS_ROOT)
+endif
ioemu ioemuinstall:
[ -f $(IOEMU_DIR)/config-host.mak ] || \
- (cd $(IOEMU_DIR) && sh configure --prefix=/usr)
+ ( cd $(IOEMU_DIR) && sh configure --prefix=/usr \
+ $(IOEMU_CONFIGURE_CROSS) )
$(MAKE) -C $(IOEMU_DIR) $(patsubst ioemu%,%,$@)
ioemuclean:
$(MAKE) -C $(IOEMU_DIR) distclean