Commit ad06484063972abdf3f426412af9aa101bea26a8

Authored by pbrook
1 parent 115defd1

Fix out of tree builds.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1814 c046a42c-6fe2-441c-8c8c-71466251a162
Makefile
1   --include config-host.mak
  1 +include config-host.mak
2 2  
3   -CFLAGS=-Wall -O2 -g -fno-strict-aliasing
  3 +CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I.
4 4 ifdef CONFIG_DARWIN
5 5 CFLAGS+= -mdynamic-no-pic
6 6 endif
... ... @@ -47,18 +47,19 @@ install: all
47 47 mkdir -p "$(DESTDIR)$(bindir)"
48 48 install -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
49 49 mkdir -p "$(DESTDIR)$(datadir)"
50   - install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
51   - pc-bios/vgabios-cirrus.bin \
52   - pc-bios/ppc_rom.bin pc-bios/video.x \
53   - pc-bios/proll.elf \
54   - pc-bios/linux_boot.bin "$(DESTDIR)$(datadir)"
  50 + for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
  51 + video.x proll.elf linux_boot.bin; do \
  52 + install -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
  53 + done
55 54 mkdir -p "$(DESTDIR)$(docdir)"
56 55 install -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
57 56 ifndef CONFIG_WIN32
58 57 mkdir -p "$(DESTDIR)$(mandir)/man1"
59 58 install qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
60 59 mkdir -p "$(DESTDIR)$(datadir)/keymaps"
61   - install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(DESTDIR)$(datadir)/keymaps"
  60 + for x in $(KEYMAPS); do \
  61 + install -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
  62 + done
62 63 endif
63 64 for d in $(TARGET_DIRS); do \
64 65 $(MAKE) -C $$d $@ || exit 1 ; \
... ... @@ -81,11 +82,11 @@ cscope:
81 82 texi2html -monolithic -number $<
82 83  
83 84 qemu.1: qemu-doc.texi
84   - ./texi2pod.pl $< qemu.pod
  85 + $(SRC_PATH)/texi2pod.pl $< qemu.pod
85 86 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
86 87  
87 88 qemu-img.1: qemu-img.texi
88   - ./texi2pod.pl $< qemu-img.pod
  89 + $(SRC_PATH)/texi2pod.pl $< qemu-img.pod
89 90 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
90 91  
91 92 FILE=qemu-$(shell cat VERSION)
... ...
Makefile.target
... ... @@ -12,7 +12,7 @@ TARGET_BASE_ARCH:=sparc
12 12 endif
13 13 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
14 14 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
15   -DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH)
  15 +DEFINES=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH)
16 16 ifdef CONFIG_USER_ONLY
17 17 VPATH+=:$(SRC_PATH)/linux-user
18 18 DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
... ...
configure
... ... @@ -139,14 +139,16 @@ if [ &quot;$bsd&quot; = &quot;yes&quot; ] ; then
139 139 fi
140 140  
141 141 # find source path
142   -# XXX: we assume an absolute path is given when launching configure,
143   -# except in './configure' case.
144   -source_path=${0%configure}
145   -source_path=${source_path%/}
146   -source_path_used="yes"
147   -if test -z "$source_path" -o "$source_path" = "." ; then
  142 +source_path=`dirname "$0"`
  143 +if [ -z "$source_path" ]; then
148 144 source_path=`pwd`
  145 +else
  146 + source_path=`cd "$source_path"; pwd`
  147 +fi
  148 +if test "$source_path" = `pwd` ; then
149 149 source_path_used="no"
  150 +else
  151 + source_path_used="yes"
150 152 fi
151 153  
152 154 for opt do
... ... @@ -158,6 +160,7 @@ for opt do
158 160 --interp-prefix=*) interp_prefix=`echo $opt | cut -d '=' -f 2`
159 161 ;;
160 162 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
  163 + source_path_used="yes"
161 164 ;;
162 165 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
163 166 ;;
... ... @@ -615,6 +618,9 @@ head $source_path/VERSION &gt;&gt; $config_h
615 618 echo "\"" >> $config_h
616 619  
617 620 echo "SRC_PATH=$source_path" >> $config_mak
  621 +if [ "$source_path_used" = "yes" ]; then
  622 + echo "VPATH=$source_path" >> $config_mak
  623 +fi
618 624 echo "TARGET_DIRS=$target_list" >> $config_mak
619 625  
620 626 # XXX: suppress that
... ...