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: [RFC2] Add stubdomain support

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: [RFC2] Add stubdomain support
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Tue, 12 Feb 2008 14:57:50 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 12 Feb 2008 06:59:01 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C3D75E79.1C530%Keir.Fraser@xxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
References: <20080212140447.GB4951@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <C3D75E79.1C530%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
Keir Fraser, le Tue 12 Feb 2008 14:32:25 +0000, a écrit :
> Applied

Cool!

> please send another patch to override XEN_OS and hence present
> yourself as a new 'OS environment' to the overall build system. That'll
> clean up a good number of your Makefile changes outside stubdom/.

It does indeed, here it is.



Make stubdom/Makefile override XEN_OS to MiniOS, and add config/MiniOS.mk.
Add PTHREAD_LIBS to configs (usually holding -lpthread).

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

diff -r d0b12316994b Config.mk
--- a/Config.mk Tue Feb 12 14:47:14 2008 +0000
+++ b/Config.mk Tue Feb 12 14:51:43 2008 +0000
@@ -27,14 +27,6 @@ DESTDIR     ?= /
 
 include $(XEN_ROOT)/config/$(XEN_OS).mk
 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
-
-ifeq ($(stubdom),y)
-include $(XEN_ROOT)/extras/mini-os/Config.mk
-CFLAGS += $(DEF_CFLAGS) $(ARCH_CFLAGS)
-CPPFLAGS += $(DEF_CPPFLAGS) $(ARCH_CPPFLAGS) $(extra_incl)
-ASFLAGS += $(DEF_ASFLAGS) $(ARCH_ASFLAGS)
-LDFLAGS += $(DEF_LDFLAGS) $(ARCH_LDFLAGS)
-endif
 
 ifneq ($(EXTRA_PREFIX),)
 EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
diff -r d0b12316994b config/MiniOS.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/config/MiniOS.mk  Tue Feb 12 14:51:43 2008 +0000
@@ -0,0 +1,9 @@
+include $(XEN_ROOT)/config/StdGNU.mk
+include $(XEN_ROOT)/extras/mini-os/Config.mk
+CFLAGS += $(DEF_CFLAGS) $(ARCH_CFLAGS)
+CPPFLAGS += $(DEF_CPPFLAGS) $(ARCH_CPPFLAGS) $(extra_incl)
+ASFLAGS += $(DEF_ASFLAGS) $(ARCH_ASFLAGS)
+LDFLAGS += $(DEF_LDFLAGS) $(ARCH_LDFLAGS)
+
+# Override settings for this OS
+PTHREAD_LIBS =
diff -r d0b12316994b config/StdGNU.mk
--- a/config/StdGNU.mk  Tue Feb 12 14:47:14 2008 +0000
+++ b/config/StdGNU.mk  Tue Feb 12 14:51:43 2008 +0000
@@ -35,6 +35,7 @@ PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
 
 SOCKET_LIBS =
 CURSES_LIBS = -lncurses
+PTHREAD_LIBS = -lpthread
 UTIL_LIBS = -lutil
 SONAME_LDFLAG = -soname
 SHLIB_CFLAGS = -shared
diff -r d0b12316994b config/SunOS.mk
--- a/config/SunOS.mk   Tue Feb 12 14:47:14 2008 +0000
+++ b/config/SunOS.mk   Tue Feb 12 14:51:43 2008 +0000
@@ -39,6 +39,7 @@ SunOS_LIBDIR_x86_64 = /usr/sfw/lib/amd64
 
 SOCKET_LIBS = -lsocket
 CURSES_LIBS = -lcurses
+PTHREAD_LIBS = -lpthread
 UTIL_LIBS =
 SONAME_LDFLAG = -h
 SHLIB_CFLAGS = -R $(SunOS_LIBDIR) -shared
diff -r d0b12316994b stubdom/Makefile
--- a/stubdom/Makefile  Tue Feb 12 14:47:14 2008 +0000
+++ b/stubdom/Makefile  Tue Feb 12 14:51:43 2008 +0000
@@ -1,4 +1,6 @@ XEN_ROOT = ..
 XEN_ROOT = ..
+
+export XEN_OS=MiniOS
 
 include $(XEN_ROOT)/Config.mk
 export stubdom=y
diff -r d0b12316994b tools/libxc/Makefile
--- a/tools/libxc/Makefile      Tue Feb 12 14:47:14 2008 +0000
+++ b/tools/libxc/Makefile      Tue Feb 12 14:51:43 2008 +0000
@@ -25,13 +25,11 @@ CTRL_SRCS-y       += xc_resume.c
 CTRL_SRCS-y       += xc_resume.c
 endif
 CTRL_SRCS-$(CONFIG_X86) += xc_pagetab.c
-ifneq ($(stubdom),y)
 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
 CTRL_SRCS-$(CONFIG_SunOS) += xc_solaris.c
 CTRL_SRCS-$(CONFIG_X86_Linux) += xc_ptrace.c xc_ptrace_core.c
 CTRL_SRCS-$(CONFIG_NetBSD) += xc_netbsd.c
-endif
-CTRL_SRCS-$(stubdom) += xc_minios.c
+CTRL_SRCS-$(CONFIG_MiniOS) += xc_minios.c
 
 GUEST_SRCS-y :=
 GUEST_SRCS-y += xg_private.c
@@ -74,10 +72,6 @@ CFLAGS   += -Wp,-MD,.$(@F).d
 CFLAGS   += -Wp,-MD,.$(@F).d
 LDFLAGS  += -L.
 DEPS     = .*.d
-
-ifneq ($(stubdom),y)
-LDLIBS   = -lpthread
-endif
 
 CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
 CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
@@ -152,7 +146,7 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(
        ln -sf $< $@
 
 libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
-       $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) 
-Wl,libxenctrl.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ $(LDLIBS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) 
-Wl,libxenctrl.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ $(PTHREAD_LIBS)
 
 # libxenguest
 
@@ -165,7 +159,7 @@ libxenguest.so.$(MAJOR): libxenguest.so.
        ln -sf $< $@
 
 libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
-       $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) 
-Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz 
-lxenctrl $(LDLIBS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) 
-Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz 
-lxenctrl $(PTHREAD_LIBS)
 
 -include $(DEPS)
 

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