WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH] Make $(XEN_ROOT) be absolute for make clean in i

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Re: [PATCH] Make $(XEN_ROOT) be absolute for make clean in ioemu-dir
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Fri, 12 Sep 2008 12:22:00 +0100
Delivery-date: Fri, 12 Sep 2008 04:22:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <18634.14672.266842.985810@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <18634.14672.266842.985810@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
iwj writes ("[PATCH] Make $(XEN_ROOT) be absolute for make clean in ioemu-dir"):
> This prevents a problem where `make clean' fails because qemu's
> (ioemu-remote's) build system wants to run `make clean' in `tests' but
> XEN_ROOT is a confection involving ../'s.

Here's a revised version:


$(XEN_ROOT) absolutification fixes for ioemu-remote (incl stubdom)

 * Move code for generating an absolute version of XEN_ROOT
   into a common make variable set in Config.mk
 * Use this common code when invoking make -C ioemu-dir clean
   from tools/, which avoids a problem where `make clean' fails
   because qemu's (ioemu-remote's) build system wants to run
   `make clean' in `tests' but XEN_ROOT is a confection involving ../'s.
 * Use this common code in stubdom/Makefile, instead of $(abspath...)
   as the latter is a relatively new feature in GNU make and is not
   available in all the places that we want to be able to build
   (cf c/s 17997:3f23e01d31985899dbd1660b166f229f1ee74292)

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>


diff -r 31e06b3ccf53 Config.mk
--- a/Config.mk Fri Sep 12 10:41:51 2008 +0100
+++ b/Config.mk Fri Sep 12 12:18:55 2008 +0100
@@ -54,6 +54,22 @@ define cc-ver-check-closure
     endif
 endef
 
+define absolutify_xen_root
+       case "$(XEN_ROOT)" in                                              \
+       /*)     XEN_ROOT=$(XEN_ROOT) ;;                                    \
+       *)      xen_root_lhs=`pwd`;                                        \
+               xen_root_rhs=$(XEN_ROOT)/;                                 \
+               while [ "x$${xen_root_rhs#../}" != "x$$xen_root_rhs" ]; do \
+                       xen_root_rhs="$${xen_root_rhs#../}";               \
+                       xen_root_rhs="$${xen_root_rhs#/}";                 \
+                       xen_root_rhs="$${xen_root_rhs#/}";                 \
+                       xen_root_lhs="$${xen_root_lhs%/*}";                \
+               done;                                                      \
+               XEN_ROOT="$$xen_root_lhs/$$xen_root_rhs" ;;                \
+       esac;                                                              \
+       export XEN_ROOT
+endef
+
 ifeq ($(debug),y)
 CFLAGS += -g
 endif
diff -r 31e06b3ccf53 stubdom/Makefile
--- a/stubdom/Makefile  Fri Sep 12 10:41:51 2008 +0100
+++ b/stubdom/Makefile  Fri Sep 12 12:21:40 2008 +0100
@@ -232,8 +232,9 @@ ifeq ($(CONFIG_QEMU),ioemu)
        CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu 
LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) TOOLS=
 else
        [ -f ioemu/config-host.mak ] || \
-         ( cd ioemu ; \
-          CONFIG_STUBDOM=yes XEN_ROOT=$(abspath $(XEN_ROOT)) 
XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) CFLAGS="$(TARGET_CFLAGS)" sh ./xen-setup 
--cc=$(CC) --disable-gcc-check $(IOEMU_OPTIONS))
+         ( $(absolutify_xen_root); \
+           cd ioemu ; \
+          CONFIG_STUBDOM=yes XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) 
CFLAGS="$(TARGET_CFLAGS)" sh ./xen-setup --cc=$(CC) --disable-gcc-check 
$(IOEMU_OPTIONS))
        CPPFLAGS= TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C ioemu 
LWIPDIR=$(CURDIR)/lwip-$(XEN_TARGET_ARCH) TOOLS= CONFIG_STUBDOM=yes
 endif
 
diff -r 31e06b3ccf53 tools/Makefile
--- a/tools/Makefile    Fri Sep 12 10:41:51 2008 +0100
+++ b/tools/Makefile    Fri Sep 12 10:53:27 2008 +0100
@@ -93,17 +93,14 @@ ioemu-dir-find:
                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; \
+               $(absolutify_xen_root); \
                cd ioemu-dir; \
                ./xen-setup $(IOEMU_CONFIGURE_CROSS)
 
 subdir-all-ioemu-dir subdir-install-ioemu-dir: ioemu-dir-find
 
 subdir-clean-ioemu-dir:
-       if test -d ioemu-dir/.; then \
+       set -e; if test -d ioemu-dir/.; then \
+               $(absolutify_xen_root); \
                $(MAKE) -C ioemu-dir clean; \
        fi

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>