[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [qemu-xen-unstable] qemu-xen: build adjustments to support out-of-tree builds
commit ad78ccc35617610bc43112788d28a05878fac91f Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> Date: Tue Nov 23 16:40:08 2010 +0000 qemu-xen: build adjustments to support out-of-tree builds QEMU by itself can be built outside of its source directory. With the qemu repository being separate from the hypervisor/tools one it seems to make sense to make use of this feature, but doing so requires a couple of adjustments to the Xen changes to it. Basically, if CONFIG_QEMU is found to indicate an existing directory, this directory will be used rather than cloning the git repo into the build tree. [ This is the qemu-xen half. -iwj ] Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx> --- Makefile.target | 9 +++++---- i386-dm/hooks.mak | 2 +- i386-dm/hookstarget.mak | 2 +- i386-stubdom/hooks.mak | 2 +- i386-stubdom/hookslib.mak | 1 + i386-stubdom/hookstarget.mak | 1 + xen-config-host.mak | 6 +++--- xen-config.mak | 1 + xen-hooks.mak | 2 +- xen-setup | 12 ++++++------ xen-setup-stubdom | 18 +++++++++--------- 11 files changed, 30 insertions(+), 26 deletions(-) diff --git a/Makefile.target b/Makefile.target index cce537b..19bb0fd 100644 --- a/Makefile.target +++ b/Makefile.target @@ -23,7 +23,7 @@ endif ifeq ($(TARGET_ARCH), sparc64) TARGET_BASE_ARCH:=sparc endif -TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) +TARGET_PATH?=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H #CFLAGS+=-Werror @@ -210,8 +210,8 @@ endif # libqemu --include hookslib.mak --include hookstarget.mak +include $(QEMU_ROOT)/$(TARGET_DIRS)/hookslib.mak +include $(QEMU_ROOT)/$(TARGET_DIRS)/hookstarget.mak libqemu.a: $(LIBOBJS) @@ -730,7 +730,8 @@ LDFLAGS+=-p main.o: CFLAGS+=-p endif --include hooks.mak +include $(QEMU_ROOT)/$(TARGET_DIRS)/hooks.mak + all: $(PROGS) $(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) diff --git a/i386-dm/hooks.mak b/i386-dm/hooks.mak index 01a17da..6fc9e5d 100644 --- a/i386-dm/hooks.mak +++ b/i386-dm/hooks.mak @@ -3,4 +3,4 @@ CPPFLAGS += -DHAS_AUDIO endif QEMU_PROG=qemu-dm -include ../xen-hooks.mak +include $(QEMU_ROOT)/xen-hooks.mak diff --git a/i386-dm/hookstarget.mak b/i386-dm/hookstarget.mak index de2a670..0cce528 100644 --- a/i386-dm/hookstarget.mak +++ b/i386-dm/hookstarget.mak @@ -3,4 +3,4 @@ IOEMU_OS=$(shell uname -s) install-hook: $(INSTALL_DIR) "$(DESTDIR)/$(bindir)" $(INSTALL_DIR) "$(DESTDIR)/$(configdir)" - $(INSTALL_PROG) qemu-ifup-$(IOEMU_OS) "$(DESTDIR)/$(configdir)/qemu-ifup" + $(INSTALL_PROG) $(QEMU_ROOT)/i386-dm/qemu-ifup-$(IOEMU_OS) "$(DESTDIR)/$(configdir)/qemu-ifup" diff --git a/i386-stubdom/hooks.mak b/i386-stubdom/hooks.mak index 8cd761b..2dc1ff7 100644 --- a/i386-stubdom/hooks.mak +++ b/i386-stubdom/hooks.mak @@ -1,4 +1,4 @@ -include ../xen-hooks.mak +include $(QEMU_ROOT)/xen-hooks.mak OBJS += block-vbd.o diff --git a/i386-stubdom/hookslib.mak b/i386-stubdom/hookslib.mak new file mode 100644 index 0000000..8497304 --- /dev/null +++ b/i386-stubdom/hookslib.mak @@ -0,0 +1 @@ +include $(SRC_PATH)/i386-dm/hookslib.mak diff --git a/i386-stubdom/hookstarget.mak b/i386-stubdom/hookstarget.mak new file mode 100644 index 0000000..ac7b965 --- /dev/null +++ b/i386-stubdom/hookstarget.mak @@ -0,0 +1 @@ +VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/i386-dm:$(SRC_PATH)/hw diff --git a/xen-config-host.mak b/xen-config-host.mak index b1912e5..aea181f 100644 --- a/xen-config-host.mak +++ b/xen-config-host.mak @@ -3,12 +3,12 @@ XEN_ROOT ?= $(QEMU_ROOT)/../xen-unstable.hg include $(XEN_ROOT)/tools/Rules.mk ifdef CONFIG_STUBDOM -TARGET_DIRS=i386-stubdom +export TARGET_DIRS=i386-stubdom else -TARGET_DIRS=i386-dm +export TARGET_DIRS=i386-dm endif SUBDIR_RULES=subdir-$(TARGET_DIRS) subdir-$(TARGET_DIRS): libqemu_common.a --include $(QEMU_ROOT)/xen-hooks.mak +include $(QEMU_ROOT)/xen-hooks.mak diff --git a/xen-config.mak b/xen-config.mak index 40984bc..77fef4f 100644 --- a/xen-config.mak +++ b/xen-config.mak @@ -4,6 +4,7 @@ XEN_ROOT ?= $(QEMU_ROOT)/../xen-unstable.hg include ../config-host.mak TARGET_ARCH=i386 +TARGET_PATH:=$(SRC_PATH)/$(TARGET_DIRS) CONFIG_SOFTMMU=yes CFLAGS += -I$(QEMU_ROOT)/hw diff --git a/xen-hooks.mak b/xen-hooks.mak index 93f4402..291ade2 100644 --- a/xen-hooks.mak +++ b/xen-hooks.mak @@ -38,7 +38,7 @@ OBJS += battery_mgmt.o ifdef CONFIG_STUBDOM CPPFLAGS += $(TARGET_CPPFLAGS) -DNEED_CPU_H \ - -I$(QEMU_ROOT)/i386-dm -I$(QEMU_ROOT)/hw -I$(QEMU_ROOT)/fpu + -I$(TARGET_DIRS) -I$(QEMU_ROOT)/i386-dm -I$(QEMU_ROOT)/hw -I$(QEMU_ROOT)/fpu CONFIG_SDL= CONFIG_AUDIO= OBJS += xenfbfront.o diff --git a/xen-setup b/xen-setup index fde1568..c3af79b 100755 --- a/xen-setup +++ b/xen-setup @@ -3,6 +3,8 @@ set -e # git-clean -x -d && ./xen-setup && make prefix=/usr CMDLINE_CFLAGS='-O0 -g' -j4 && make install DESTDIR=`pwd`/dist/ prefix=/usr && rsync -a --stats --delete . thule:shadow/qemu-iwj.git/ && rsync -a --stats dist/. root@thule:/ +target=i386-dm +mkdir -p $target rm -f $target/Makefile rm -f $target/config.mak rm -f config-host.mak @@ -16,17 +18,15 @@ if test -z "${XEN_SCRIPT_DIR}"; then XEN_SCRIPT_DIR="/etc/xen/scripts" fi -./configure --disable-gfx-check --disable-curses --disable-slirp "$@" --prefix=${PREFIX} - -target=i386-dm +${QEMU_ROOT:-.}/configure --disable-gfx-check --disable-curses --disable-slirp "$@" --prefix=${PREFIX} if [ "x$XEN_ROOT" != x ]; then echo "XEN_ROOT=$XEN_ROOT" >>config-host.mak fi -ln -sf ../Makefile.target $target/Makefile -ln -sf ../xen-config.mak $target/config.mak -cat xen-config-host.mak >>config-host.mak +ln -sf ${QEMU_ROOT:-..}/Makefile.target $target/Makefile +ln -sf ${QEMU_ROOT:-..}/xen-config.mak $target/config.mak +cat ${QEMU_ROOT:-.}/xen-config-host.mak >>config-host.mak sed -e 's,qemu,xen/qemu,' config-host.h >config-host.h.new echo "#define DEFAULT_NETWORK_SCRIPT \"${XEN_SCRIPT_DIR}/qemu-ifup\"" >>config-host.h.new diff --git a/xen-setup-stubdom b/xen-setup-stubdom index 94b20a3..4f1b081 100755 --- a/xen-setup-stubdom +++ b/xen-setup-stubdom @@ -1,11 +1,11 @@ #!/bin/sh set -e -qemu_version=`head VERSION` - -ln -sf ../Makefile.target i386-stubdom/Makefile +qemu_version=`head ${QEMU_ROOT:-.}/VERSION` target=i386-stubdom +mkdir -p $target +ln -sf ${QEMU_ROOT:-..}/Makefile.target $target/Makefile #---------- cat <<END >$target/config.mak.new @@ -15,6 +15,7 @@ XEN_ROOT ?= \$(QEMU_ROOT)/../xen-unstable.hg include ../config-host.mak TARGET_ARCH=i386 +TARGET_PATH:=\$(SRC_PATH)/\$(TARGET_DIRS) CONFIG_SOFTMMU=yes TARGET_CPPFLAGS += $TARGET_CPPFLAGS -DCONFIG_STUBDOM -D__XEN_TOOLS__ @@ -26,8 +27,7 @@ END mv -f $target/config.mak.new $target/config.mak #---------- -ln -sf ../i386-dm/hookslib.mak $target/ -(cd $target ; ln -sf ../i386-dm/*.[ch] .) +test ${QEMU_ROOT:-..} != .. || (cd $target ; ln -sf ../i386-dm/*.[ch] .) #---------- cat <<END >config-host.h.new @@ -48,7 +48,7 @@ mv -f config-host.h.new config-host.h #---------- cat <<END >config-host.mak.new CONFIG_STUBDOM=yes -prefix=$(PREFIX) +prefix=$PREFIX bindir=\${prefix}/bin mandir=\$(MANDIR) datadir=\$(SHAREDIR)/qemu @@ -70,7 +70,7 @@ CONFIG_GDBSTUB= CONFIG_OSS= CONFIG_OSS_LIB= VERSION=$qemu_version -SRC_PATH=`pwd` +SRC_PATH=${QEMU_ROOT:-`pwd`} TARGET_DIRS=$target BUILD_DOCS= CONFIG_AIO= @@ -90,7 +90,7 @@ cat <<END >>config-host.mak.new include \$(XEN_ROOT)/tools/Rules.mk SUBDIR_RULES=subdir-\$(TARGET_DIRS) subdir-\$(TARGET_DIRS): libqemu_common.a --include \$(QEMU_ROOT)/xen-hooks.mak +include \$(QEMU_ROOT)/xen-hooks.mak HOST_USB=stub HOST_LDFLAGS= \$(LDFLAGS) -g -Wl,--warn-common @@ -101,7 +101,7 @@ LDFLAGS= $TARGET_LDFLAGS SUBDIR_RULES=subdir-\$(TARGET_DIRS) subdir-\$(TARGET_DIRS): libqemu_common.a --include \$(QEMU_ROOT)/xen-hooks.mak +include \$(QEMU_ROOT)/xen-hooks.mak END mv -f config-host.mak.new config-host.mak -- generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |