From b598922541e0a7f92a2aa98c4a48c1a7ee10a5b9 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 17 Mar 2011 10:36:25 +0000 Subject: [PATCH] build: Make XEN_ROOT an absolute path. Otherwise make can search the path relative to certain standard paths such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in Config.mk suffers from this). Signed-off-by: Keir Fraser --- Makefile | 31 +++++++++++++++---------------- c/Makefile | 2 +- caml/Makefile | 2 +- grub/Makefile | 2 +- pciutils.patch | 2 +- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index d1c6b0a..938fc0a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -XEN_ROOT = .. +XEN_ROOT = $(CURDIR)/.. MINI_OS = $(XEN_ROOT)/extras/mini-os export XEN_OS=MiniOS @@ -64,7 +64,7 @@ $(call cc-options-add,TARGET_CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) GCC_INSTALL = $(shell LANG=C gcc -print-search-dirs | sed -n -e 's/install: \(.*\)/\1/p') TARGET_CPPFLAGS += -U __linux__ -U __FreeBSD__ -U __sun__ TARGET_CPPFLAGS += -nostdinc -TARGET_CPPFLAGS += -isystem $(CURDIR)/$(MINI_OS)/include/posix +TARGET_CPPFLAGS += -isystem $(MINI_OS)/include/posix TARGET_CPPFLAGS += -isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include TARGET_CPPFLAGS += -isystem $(GCC_INSTALL)include TARGET_CPPFLAGS += -isystem $(CURDIR)/lwip-$(XEN_TARGET_ARCH)/src/include @@ -224,7 +224,7 @@ $(XEN_ROOT)/tools/ioemu-dir: ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/ioemu-dir mkdir -p ioemu set -e; \ - $(absolutify_xen_root); \ + $(buildmakevars2shellvars); \ cd ioemu; \ src="$$XEN_ROOT/tools/ioemu-dir"; export src; \ (cd $$src && find * -type d -print) | xargs mkdir -p; \ @@ -244,24 +244,24 @@ endif mk-headers-$(XEN_TARGET_ARCH): ioemu/linkfarm.stamp mkdir -p include/xen && \ - ln -sf $(addprefix ../../,$(wildcard $(XEN_ROOT)/xen/include/public/*.h)) include/xen && \ - ln -sf $(addprefix ../../$(XEN_ROOT)/xen/include/public/,arch-ia64 arch-x86 hvm io xsm) include/xen && \ - ( [ -h include/xen/sys ] || ln -sf ../../$(XEN_ROOT)/tools/include/xen-sys/MiniOS include/xen/sys ) && \ - ( [ -h include/xen/libelf ] || ln -sf ../../$(XEN_ROOT)/tools/include/xen/libelf include/xen/libelf ) && \ + ln -sf $(wildcard $(XEN_ROOT)/xen/include/public/*.h) include/xen && \ + ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-ia64 arch-x86 hvm io xsm) include/xen && \ + ( [ -h include/xen/sys ] || ln -sf $(XEN_ROOT)/tools/include/xen-sys/MiniOS include/xen/sys ) && \ + ( [ -h include/xen/libelf ] || ln -sf $(XEN_ROOT)/tools/include/xen/libelf include/xen/libelf ) && \ mkdir -p include/xen-foreign && \ - ln -sf $(addprefix ../../,$(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*)) include/xen-foreign/ && \ + ln -sf $(wildcard $(XEN_ROOT)/tools/include/xen-foreign/*) include/xen-foreign/ && \ $(CROSS_MAKE) -C include/xen-foreign/ && \ ( [ -h include/xen/foreign ] || ln -sf ../xen-foreign include/xen/foreign ) mkdir -p libxc-$(XEN_TARGET_ARCH) [ -h libxc-$(XEN_TARGET_ARCH)/Makefile ] || ( cd libxc-$(XEN_TARGET_ARCH) && \ - ln -sf ../$(XEN_ROOT)/tools/libxc/*.h . && \ - ln -sf ../$(XEN_ROOT)/tools/libxc/*.c . && \ - ln -sf ../$(XEN_ROOT)/tools/libxc/Makefile . ) + ln -sf $(XEN_ROOT)/tools/libxc/*.h . && \ + ln -sf $(XEN_ROOT)/tools/libxc/*.c . && \ + ln -sf $(XEN_ROOT)/tools/libxc/Makefile . ) mkdir -p libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) [ -h libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) ] || ( cd libxc-$(XEN_TARGET_ARCH)/$(XEN_TARGET_ARCH) && \ - ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.c . && \ - ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.h . && \ - ln -sf ../$(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/Makefile . ) + ln -sf $(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.c . && \ + ln -sf $(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/*.h . && \ + ln -sf $(XEN_ROOT)/tools/libxc/$(XEN_TARGET_ARCH)/Makefile . ) $(CROSS_MAKE) -C $(MINI_OS) links touch mk-headers-$(XEN_TARGET_ARCH) @@ -290,8 +290,7 @@ libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: cross-zlib .PHONY: ioemu ioemu: cross-zlib cross-libpci libxc [ -f ioemu/config-host.mak ] || \ - ( $(absolutify_xen_root); \ - $(buildmakevars2shellvars); \ + ( $(buildmakevars2shellvars); \ cd ioemu ; \ LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) \ TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \ diff --git a/c/Makefile b/c/Makefile index b5cb8e2..c646c26 100644 --- a/c/Makefile +++ b/c/Makefile @@ -1,4 +1,4 @@ -XEN_ROOT = ../.. +XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/Config.mk diff --git a/caml/Makefile b/caml/Makefile index 5f27db6..e79c98d 100644 --- a/caml/Makefile +++ b/caml/Makefile @@ -1,4 +1,4 @@ -XEN_ROOT = ../.. +XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/Config.mk diff --git a/grub/Makefile b/grub/Makefile index 77e5eb9..d6e3a1e 100644 --- a/grub/Makefile +++ b/grub/Makefile @@ -1,4 +1,4 @@ -XEN_ROOT = ../.. +XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/Config.mk vpath %.c ../grub-upstream diff --git a/pciutils.patch b/pciutils.patch index ce9e987..5ab84d6 100644 --- a/pciutils.patch +++ b/pciutils.patch @@ -38,7 +38,7 @@ diff -urN pciutils-2.2.9.orig/lib/access.c pciutils-2.2.9/lib/access.c endif +ifdef PCI_OS_MINIOS -+XEN_ROOT=../../.. ++XEN_ROOT=$(CURDIR)/../../.. +include $(XEN_ROOT)/Config.mk +OBJS += minios.o +endif -- 2.39.5