Support building of out-of-tree merged qemu from git
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 3 Jul 2008 09:44:13 +0000 (10:44 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 3 Jul 2008 09:44:13 +0000 (10:44 +0100)
This provides support for building the new merged qemu from
qemu-xen.git, or from a local checkout.

The default is still to use the in-tree version, because the patchman
infrastructure for testing, and propagation from staging to
xen-unstable, needs a small amount of work to cope with git.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
.hgignore
Config.mk
config/StdGNU.mk
tools/Makefile

index fa674adcafba26dfb14ce4685aea315eb156b8ae..9dcd7e6122df73cdbcc9006af9751ca259d4c2f1 100644 (file)
--- a/.hgignore
+++ b/.hgignore
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
+^tools/ioemu-remote
+^tools/ioemu-dir$
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
index 01ed02bd6a4e3d6392aeb02ed2246805846c6157..85bb50b8412d1787c1f9e15561abc11b36c2ff9f 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -78,6 +78,14 @@ XSM_ENABLE ?= n
 FLASK_ENABLE ?= n
 ACM_SECURITY ?= n
 
+QEMU_REMOTE=http://www.chiark.greenend.org.uk/~ijackson/qemu-xen.git
+
+# Specify which qemu-dm to use. This may be `ioemu' to use the old
+# Mercurial in-tree version, or a local directory, or a git URL.
+CONFIG_QEMU     ?= ioemu
+# CONFIG_QEMU   ?= ../qemu-xen.git
+# CONFIG_QEMU   ?= $(QEMU_REMOTE)
+
 # Optional components
 XENSTAT_XENTOP     ?= y
 VTPM_TOOLS         ?= n
index c020357654174415c193b139a7d6d9a8a4066ecf..aaa89a26643d0c1f758409d406c5c648daaafb34 100644 (file)
@@ -13,6 +13,9 @@ SIZEUTIL   = $(CROSS_COMPILE)size
 MSGFMT     = msgfmt
 MSGMERGE   = msgmerge
 
+# Allow git to be wrappered in the environment
+GIT        ?= git
+
 INSTALL      = install
 INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
index ace8a1a46a0976422b2b530ca37646c2fa2db7be..49140339972f888c35795f53f7b185d20b5ecc77 100644 (file)
@@ -22,7 +22,12 @@ SUBDIRS-y += libaio
 SUBDIRS-y += blktap
 SUBDIRS-y += libfsimage
 SUBDIRS-$(LIBXENAPI_BINDINGS) += libxen
+
+ifeq (ioemu,$(CONFIG_QEMU))
 SUBDIRS-$(CONFIG_IOEMU) += ioemu
+else
+SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir
+endif
 
 # These don't cross-compile
 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
@@ -62,3 +67,27 @@ subdir-all-ioemu subdir-install-ioemu: ioemu/config-host.mak
 subdir-clean-ioemu:
        $(MAKE) -C ioemu distclean
 
+ioemu-dir-find:
+       set -ex; \
+       if test -d $(CONFIG_QEMU); then \
+               rm -f ioemu-dir; \
+               ln -sf $(CONFIG_QEMU) ioemu-dir; \
+       else \
+               if [ ! -d ioemu-remote ]; then \
+                       rm -rf ioemu-remote ioemu-remote.tmp; \
+                       mkdir ioemu-remote.tmp; rmdir ioemu-remote.tmp; \
+                       $(GIT) clone $(CONFIG_QEMU) ioemu-remote.tmp; \
+                       mv ioemu-remote.tmp ioemu-remote; \
+               fi; \
+               ln -sf ioemu-remote ioemu-dir; \
+       fi
+       set -e; \
+               case "$XEN_ROOT" in \
+               /*)     XEN_ROOT=$(XEN_ROOT) ;; \
+               *)      XEN_ROOT=`pwd`/$(XEN_ROOT) ;; \
+               esac; \
+               export XEN_ROOT; \
+               cd ioemu-dir; \
+               ./xen-setup
+
+subdir-all-ioemu-dir subdir-install-ioemu-dir: ioemu-dir-find