From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FIFiX-0007KO-E2 for qemu-devel@nongnu.org; Sat, 11 Mar 2006 20:49:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FIFiW-0007K4-ES for qemu-devel@nongnu.org; Sat, 11 Mar 2006 20:49:57 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FIFiW-0007K1-Az for qemu-devel@nongnu.org; Sat, 11 Mar 2006 20:49:56 -0500 Received: from [64.233.182.195] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FIFm9-0001Pp-T1 for qemu-devel@nongnu.org; Sat, 11 Mar 2006 20:53:42 -0500 Received: by nproxy.gmail.com with SMTP id x4so753335nfb for ; Sat, 11 Mar 2006 17:49:55 -0800 (PST) Message-ID: <5b5833aa0603111749m4d31ad66t93c8a0bd724e757c@mail.gmail.com> Date: Sat, 11 Mar 2006 21:49:55 -0400 From: "Anderson Lizardo" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_8810_22399883.1142128195140" Subject: [Qemu-devel] [PATCH] Add support for compiling outside the source tree (try #2) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ------=_Part_8810_22399883.1142128195140 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline It seems my first patch didn't go through the list. Anyway, the previous one was missing one modification, so here goes a new one. Original message: The attached patch adds (or, strictly speaking, fixes, as the source tree had already initial support for this) support for compiling QEMU outside the source tree (or in a subdir). As a side effect, it also removes the requirement to call configure with an absolute path. The changes are fairly small and don't affect the normal build. -- Anderson Lizardo Embedded Linux Lab - 10LE Nokia Institute of Technology - INdT Manaus - Brazil ------=_Part_8810_22399883.1142128195140 Content-Type: text/x-patch; name=qemu_build_outside_tree-2.patch; charset=us-ascii Content-Transfer-Encoding: 7bit X-Attachment-Id: f_ekopwe5v Content-Disposition: attachment; filename="qemu_build_outside_tree-2.patch" Index: Makefile =================================================================== RCS file: /sources/qemu/qemu/Makefile,v retrieving revision 1.93 diff -u -r1.93 Makefile --- Makefile 11 Mar 2006 14:51:13 -0000 1.93 +++ Makefile 12 Mar 2006 00:40:06 -0000 @@ -1,6 +1,6 @@ -include config-host.mak -CFLAGS=-Wall -O2 -g -fno-strict-aliasing +CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I. ifdef CONFIG_DARWIN CFLAGS+= -mdynamic-no-pic endif @@ -18,10 +18,10 @@ $(MAKE) -C $$d $@ || exit 1 ; \ done -qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c +qemu-img$(EXESUF): $(addprefix $(SRC_PATH)/,qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c) $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) -dyngen$(EXESUF): dyngen.c +dyngen$(EXESUF): $(SRC_PATH)/dyngen.c $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^ clean: @@ -58,7 +58,7 @@ mkdir -p "$(mandir)/man1" install qemu.1 qemu-img.1 "$(mandir)/man1" mkdir -p "$(datadir)/keymaps" - install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(datadir)/keymaps" + install -m 644 $(addprefix $(SRC_PATH)/keymaps/,$(KEYMAPS)) "$(datadir)/keymaps" endif for d in $(TARGET_DIRS); do \ $(MAKE) -C $$d $@ || exit 1 ; \ @@ -77,15 +77,15 @@ cscope -b # documentation -%.html: %.texi +%.html: $(SRC_PATH)/%.texi texi2html -monolithic -number $< -qemu.1: qemu-doc.texi - ./texi2pod.pl $< qemu.pod +qemu.1: $(SRC_PATH)/qemu-doc.texi + $(SRC_PATH)/texi2pod.pl $< qemu.pod pod2man --section=1 --center=" " --release=" " qemu.pod > $@ -qemu-img.1: qemu-img.texi - ./texi2pod.pl $< qemu-img.pod +qemu-img.1: $(SRC_PATH)/qemu-img.texi + $(SRC_PATH)/texi2pod.pl $< qemu-img.pod pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@ FILE=qemu-$(shell cat VERSION) Index: Makefile.target =================================================================== RCS file: /sources/qemu/qemu/Makefile.target,v retrieving revision 1.93 diff -u -r1.93 Makefile.target --- Makefile.target 6 Feb 2006 04:11:15 -0000 1.93 +++ Makefile.target 12 Mar 2006 00:40:11 -0000 @@ -17,7 +17,7 @@ VPATH+=:$(SRC_PATH)/linux-user DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) endif -CFLAGS=-Wall -O2 -g -fno-strict-aliasing +CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I.. #CFLAGS+=-Werror LDFLAGS=-g LIBS= Index: configure =================================================================== RCS file: /sources/qemu/qemu/configure,v retrieving revision 1.84 diff -u -r1.84 configure --- configure 11 Mar 2006 14:51:13 -0000 1.84 +++ configure 12 Mar 2006 00:40:16 -0000 @@ -136,13 +136,10 @@ fi # find source path -# XXX: we assume an absolute path is given when launching configure, -# except in './configure' case. source_path=${0%configure} -source_path=${source_path%/} +source_path=`cd $source_path; pwd` source_path_used="yes" -if test -z "$source_path" -o "$source_path" = "." ; then - source_path=`pwd` +if [ "$source_path" = "`pwd`" ] ; then source_path_used="no" fi ------=_Part_8810_22399883.1142128195140--