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] [PATCH 1 of 3] Use a global build configuration file, and re

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 1 of 3] Use a global build configuration file, and rework libxc Makefile for PowerPC
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Tue, 30 May 2006 17:19:00 -0500
Cc: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 30 May 2006 15:23:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1149027539@xxxxxxxxxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
15 files changed, 90 insertions(+), 102 deletions(-)
Config.mk                         |   14 ------
config/ia64.mk                    |    5 ++
config/x86_32.mk                  |    9 ++++
config/x86_64.mk                  |    9 ++++
extras/mini-os/Makefile           |    3 -
tools/Makefile                    |   45 ++++++++++------------
tools/Rules.mk                    |    2 
tools/libxc/Makefile              |   75 +++++++++++++++----------------------
tools/libxc/xc_core.c             |    2 
tools/libxc/xc_linux_build.c      |    8 ---
tools/libxc/xc_load_elf.c         |    8 ---
tools/misc/Makefile               |    2 
tools/python/xen/lowlevel/xc/xc.c |    4 +
xen/tools/Makefile                |    3 -
xen/tools/figlet/Makefile         |    3 -


# HG changeset patch
# User Hollis Blanchard <hollisb@xxxxxxxxxx>
# Node ID 93e96a7b38df8b168c8ed0386abaf64fbc5f7ddb
# Parent  22d92d7fa04ac6b9ef1028658b7128a8bb1cd056
Use a global build configuration file, and rework libxc Makefile for PowerPC.

Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>

diff -r 22d92d7fa04a -r 93e96a7b38df Config.mk
--- a/Config.mk Tue May 30 17:17:28 2006 -0500
+++ b/Config.mk Tue May 30 17:17:30 2006 -0500
@@ -38,19 +38,7 @@ CFLAGS    += -g
 CFLAGS    += -g
 endif
 
-ifeq ($(XEN_TARGET_ARCH),x86_32)
-CFLAGS  += -m32 -march=i686
-endif
-
-ifeq ($(XEN_TARGET_ARCH),x86_64)
-CFLAGS  += -m64
-endif
-
-ifeq ($(XEN_TARGET_ARCH),x86_64)
-LIBDIR = lib64
-else
-LIBDIR = lib
-endif
+include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
 
 ifneq ($(EXTRA_PREFIX),)
 EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
diff -r 22d92d7fa04a -r 93e96a7b38df extras/mini-os/Makefile
--- a/extras/mini-os/Makefile   Tue May 30 17:17:28 2006 -0500
+++ b/extras/mini-os/Makefile   Tue May 30 17:17:30 2006 -0500
@@ -1,7 +1,8 @@ debug ?= y
 debug ?= y
 pae ?= n
 
-include $(CURDIR)/../../Config.mk
+XEN_ROOT = ../..
+include $(XEN_ROOT)/Config.mk
 
 # Set TARGET_ARCH
 override TARGET_ARCH     := $(XEN_TARGET_ARCH)
diff -r 22d92d7fa04a -r 93e96a7b38df tools/Makefile
--- a/tools/Makefile    Tue May 30 17:17:28 2006 -0500
+++ b/tools/Makefile    Tue May 30 17:17:30 2006 -0500
@@ -1,39 +1,38 @@ XEN_ROOT = ../
 XEN_ROOT = ../
 include $(XEN_ROOT)/tools/Rules.mk
 
-SUBDIRS :=
-SUBDIRS += libxc
-SUBDIRS += xenstore
-SUBDIRS += misc
-SUBDIRS += examples
-SUBDIRS += xentrace
-SUBDIRS += xcutils
-SUBDIRS += firmware
-SUBDIRS += security
-SUBDIRS += console
-SUBDIRS += xenmon
-SUBDIRS += guest-headers
-ifeq ($(VTPM_TOOLS),y)
-SUBDIRS += vtpm_manager
-SUBDIRS += vtpm
-endif
-SUBDIRS += xenstat
+SUBDIRS-y :=
+SUBDIRS-y += libxc
+SUBDIRS-y += xenstore
+SUBDIRS-y += misc
+SUBDIRS-y += examples
+SUBDIRS-y += xentrace
+SUBDIRS-$(CONFIG_X86) += xcutils
+SUBDIRS-y += firmware
+SUBDIRS-y += security
+SUBDIRS-y += console
+SUBDIRS-y += xenmon
+SUBDIRS-y += guest-headers
+SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
+SUBDIRS-$(VTPM_TOOLS) += vtpm
+SUBDIRS-y += xenstat
+
 # These don't cross-compile
 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
-SUBDIRS += python
-SUBDIRS += pygrub
+SUBDIRS-y += python
+SUBDIRS-y += pygrub
 endif
 
 .PHONY: all
 all: check
-       @set -e; for subdir in $(SUBDIRS); do \
+       @set -e; for subdir in $(SUBDIRS-y); do \
                $(MAKE) -C $$subdir $@; \
        done
        $(MAKE) ioemu
 
 .PHONY: install
 install: check
-       @set -e; for subdir in $(SUBDIRS); do \
+       @set -e; for subdir in $(SUBDIRS-y); do \
                $(MAKE) -C $$subdir $@; \
        done
        $(MAKE) ioemuinstall
@@ -41,7 +40,7 @@ install: check
 
 .PHONY: clean
 clean: check_clean
-       @set -e; for subdir in $(SUBDIRS); do \
+       @set -e; for subdir in $(SUBDIRS-y); do \
                $(MAKE) -C $$subdir $@; \
        done
        $(MAKE) ioemuclean
@@ -55,7 +54,7 @@ check_clean:
        $(MAKE) -C check clean
 
 .PHONY: ioemu ioemuinstall ioemuclean
-ifndef XEN_NO_IOEMU
+ifdef CONFIG_IOEMU
 ioemu ioemuinstall ioemuclean:
        [ -f ioemu/config-host.h ] || \
        (cd ioemu; ./configure --prefix=usr)
diff -r 22d92d7fa04a -r 93e96a7b38df tools/Rules.mk
--- a/tools/Rules.mk    Tue May 30 17:17:28 2006 -0500
+++ b/tools/Rules.mk    Tue May 30 17:17:30 2006 -0500
@@ -4,6 +4,8 @@ all:
 all:
 
 include $(XEN_ROOT)/Config.mk
+
+CONFIG_$(shell uname -s) := y
 
 XEN_XC             = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
diff -r 22d92d7fa04a -r 93e96a7b38df tools/libxc/Makefile
--- a/tools/libxc/Makefile      Tue May 30 17:17:28 2006 -0500
+++ b/tools/libxc/Makefile      Tue May 30 17:17:30 2006 -0500
@@ -10,43 +10,30 @@ XEN_ROOT = ../..
 XEN_ROOT = ../..
 include $(XEN_ROOT)/tools/Rules.mk
 
-SRCS       :=
-SRCS       += xc_bvtsched.c
-SRCS       += xc_core.c
-SRCS       += xc_domain.c
-SRCS       += xc_evtchn.c
-SRCS       += xc_misc.c
-SRCS       += xc_acm.c   
-SRCS       += xc_physdev.c
-SRCS       += xc_private.c
-SRCS       += xc_sedf.c
-SRCS       += xc_csched.c
-SRCS       += xc_tbuf.c
+CTRL_SRCS-y       :=
+CTRL_SRCS-y       += xc_bvtsched.c
+CTRL_SRCS-y       += xc_core.c
+CTRL_SRCS-y       += xc_domain.c
+CTRL_SRCS-y       += xc_evtchn.c
+CTRL_SRCS-y       += xc_misc.c
+CTRL_SRCS-y       += xc_acm.c   
+CTRL_SRCS-y       += xc_physdev.c
+CTRL_SRCS-y       += xc_private.c
+CTRL_SRCS-y       += xc_sedf.c
+CTRL_SRCS-y       += xc_csched.c
+CTRL_SRCS-y       += xc_tbuf.c
+CTRL_SRCS-$(CONFIG_X86) += xc_ptrace.c xc_ptrace_core.c xc_pagetab.c
+CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
 
-ifeq ($(patsubst x86%,x86,$(XEN_TARGET_ARCH)),x86)
-SRCS       += xc_ptrace.c
-SRCS       += xc_ptrace_core.c
-SRCS       += xc_pagetab.c
-endif
-
-SRCS_Linux += xc_linux.c
-
-SRCS       += $(SRCS_Linux)
-
-BUILD_SRCS :=
-BUILD_SRCS += xc_linux_build.c
-BUILD_SRCS += xc_load_bin.c
-BUILD_SRCS += xc_load_elf.c
-BUILD_SRCS += xg_private.c
-
-ifeq ($(XEN_TARGET_ARCH),ia64)
-BUILD_SRCS += xc_ia64_stubs.c
-else
-BUILD_SRCS += xc_load_aout9.c
-BUILD_SRCS += xc_linux_restore.c
-BUILD_SRCS += xc_linux_save.c
-BUILD_SRCS += xc_hvm_build.c
-endif
+GUEST_SRCS-y :=
+GUEST_SRCS-y += xc_linux_build.c
+GUEST_SRCS-y += xc_load_bin.c
+GUEST_SRCS-y += xc_load_elf.c
+GUEST_SRCS-y += xg_private.c
+GUEST_SRCS-$(CONFIG_IA64) += xc_ia64_stubs.c
+GUEST_SRCS-$(CONFIG_PLAN9) += xc_load_aout9.c
+GUEST_SRCS-$(CONFIG_MIGRATE) += xc_linux_restore.c xc_linux_save.c
+GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
 
 CFLAGS   += -Werror
 CFLAGS   += -fno-strict-aliasing
@@ -61,11 +48,11 @@ LDFLAGS  += -L.
 LDFLAGS  += -L.
 DEPS     = .*.d
 
-LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
-PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
+CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
+CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
 
-LIB_BUILD_OBJS := $(patsubst %.c,%.o,$(BUILD_SRCS))
-PIC_BUILD_OBJS := $(patsubst %.c,%.opic,$(BUILD_SRCS))
+GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
+GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
 
 LIB := libxenctrl.a
 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
@@ -125,7 +112,7 @@ rpm: build
 
 # libxenctrl
 
-libxenctrl.a: $(LIB_OBJS)
+libxenctrl.a: $(CTRL_LIB_OBJS)
        $(AR) rc $@ $^
 
 libxenctrl.so: libxenctrl.so.$(MAJOR)
@@ -133,12 +120,12 @@ libxenctrl.so.$(MAJOR): libxenctrl.so.$(
 libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
        ln -sf $< $@
 
-libxenctrl.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
+libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
        $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenctrl.so.$(MAJOR) 
-shared -o $@ $^
 
 # libxenguest
 
-libxenguest.a: $(LIB_BUILD_OBJS)
+libxenguest.a: $(GUEST_LIB_OBJS)
        $(AR) rc $@ $^
 
 libxenguest.so: libxenguest.so.$(MAJOR)
@@ -146,7 +133,7 @@ libxenguest.so.$(MAJOR): libxenguest.so.
 libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
        ln -sf $< $@
 
-libxenguest.so.$(MAJOR).$(MINOR): $(PIC_BUILD_OBJS) libxenctrl.so
+libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
        $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenguest.so.$(MAJOR) 
-shared -o $@ $^ -lz -lxenctrl
 
 -include $(DEPS)
diff -r 22d92d7fa04a -r 93e96a7b38df tools/libxc/xc_core.c
--- a/tools/libxc/xc_core.c     Tue May 30 17:17:28 2006 -0500
+++ b/tools/libxc/xc_core.c     Tue May 30 17:17:30 2006 -0500
@@ -1,6 +1,4 @@
 #include "xg_private.h"
-#define ELFSIZE 32
-#include "xc_elf.h"
 #include <stdlib.h>
 #include <unistd.h>
 
diff -r 22d92d7fa04a -r 93e96a7b38df tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c      Tue May 30 17:17:28 2006 -0500
+++ b/tools/libxc/xc_linux_build.c      Tue May 30 17:17:30 2006 -0500
@@ -5,14 +5,6 @@
 #include "xg_private.h"
 #include "xc_private.h"
 #include <xenctrl.h>
-
-#if defined(__i386__)
-#define ELFSIZE 32
-#endif
-
-#if defined(__x86_64__) || defined(__ia64__)
-#define ELFSIZE 64
-#endif
 
 #include "xc_elf.h"
 #include "xc_aout9.h"
diff -r 22d92d7fa04a -r 93e96a7b38df tools/libxc/xc_load_elf.c
--- a/tools/libxc/xc_load_elf.c Tue May 30 17:17:28 2006 -0500
+++ b/tools/libxc/xc_load_elf.c Tue May 30 17:17:30 2006 -0500
@@ -3,14 +3,6 @@
  */
 
 #include "xg_private.h"
-
-#if defined(__i386__)
-#define ELFSIZE 32
-#endif
-#if defined(__x86_64__) || defined(__ia64__)
-#define ELFSIZE 64
-#endif
-
 #include "xc_elf.h"
 #include <stdlib.h>
 #include <endian.h>
diff -r 22d92d7fa04a -r 93e96a7b38df tools/misc/Makefile
--- a/tools/misc/Makefile       Tue May 30 17:17:28 2006 -0500
+++ b/tools/misc/Makefile       Tue May 30 17:17:30 2006 -0500
@@ -25,7 +25,7 @@ build: $(TARGETS)
 build: $(TARGETS)
        $(MAKE) -C miniterm
        $(MAKE) -C cpuperf
-ifneq ($(XEN_TARGET_ARCH),ia64)
+ifeq ($(CONFIG_MBOOTPACK),y)
        $(MAKE) -C mbootpack
 endif
        $(MAKE) -C lomount
diff -r 22d92d7fa04a -r 93e96a7b38df tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Tue May 30 17:17:28 2006 -0500
+++ b/tools/python/xen/lowlevel/xc/xc.c Tue May 30 17:17:30 2006 -0500
@@ -359,6 +359,7 @@ static PyObject *pyxc_linux_build(XcObje
                         "console_mfn", console_mfn);
 }
 
+#ifdef CONFIG_HVM
 static PyObject *pyxc_hvm_build(XcObject *self,
                                 PyObject *args,
                                 PyObject *kwds)
@@ -387,6 +388,7 @@ static PyObject *pyxc_hvm_build(XcObject
 
     return Py_BuildValue("{s:i}", "store_mfn", store_mfn);
 }
+#endif
 
 static PyObject *pyxc_bvtsched_global_set(XcObject *self, PyObject *args)
 {
@@ -1012,6 +1014,7 @@ static PyMethodDef pyxc_methods[] = {
       " vcpus   [int, 1]:   Number of Virtual CPUS in domain.\n\n"
       "Returns: [int] 0 on success; -1 on error.\n" },
 
+#ifdef CONFIG_HVM
     { "hvm_build", 
       (PyCFunction)pyxc_hvm_build, 
       METH_VARARGS | METH_KEYWORDS, "\n"
@@ -1020,6 +1023,7 @@ static PyMethodDef pyxc_methods[] = {
       " image   [str]:      Name of HVM loader image file.\n"
       " vcpus   [int, 1]:   Number of Virtual CPUS in domain.\n\n"
       "Returns: [int] 0 on success; -1 on error.\n" },
+#endif
 
     { "bvtsched_global_set",
       (PyCFunction)pyxc_bvtsched_global_set,
diff -r 22d92d7fa04a -r 93e96a7b38df xen/tools/Makefile
--- a/xen/tools/Makefile        Tue May 30 17:17:28 2006 -0500
+++ b/xen/tools/Makefile        Tue May 30 17:17:30 2006 -0500
@@ -1,5 +1,6 @@
 
-include $(BASEDIR)/../Config.mk
+XEN_ROOT = $(BASEDIR)/..
+include $(XEN_ROOT)/Config.mk
 
 .PHONY: default
 default:
diff -r 22d92d7fa04a -r 93e96a7b38df xen/tools/figlet/Makefile
--- a/xen/tools/figlet/Makefile Tue May 30 17:17:28 2006 -0500
+++ b/xen/tools/figlet/Makefile Tue May 30 17:17:30 2006 -0500
@@ -1,5 +1,6 @@
 
-include $(BASEDIR)/../Config.mk
+XEN_ROOT = $(BASEDIR)/..
+include $(XEN_ROOT)/Config.mk
 
 figlet: figlet.c
        $(HOSTCC) -o $@ $<
diff -r 22d92d7fa04a -r 93e96a7b38df config/ia64.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/config/ia64.mk    Tue May 30 17:17:30 2006 -0500
@@ -0,0 +1,5 @@
+CONFIG_IA64 := y
+CONFIG_IOEMU := y
+
+CFLAGS += -DELFSIZE=64 -DCONFIG_HVM
+LIBDIR := lib
diff -r 22d92d7fa04a -r 93e96a7b38df config/x86_32.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/config/x86_32.mk  Tue May 30 17:17:30 2006 -0500
@@ -0,0 +1,9 @@
+CONFIG_X86 := y
+CONFIG_PLAN9 := y
+CONFIG_HVM := y
+CONFIG_MIGRATE := y
+CONFIG_IOEMU := y
+CONFIG_MBOOTPACK := y
+
+CFLAGS += -m32 -march=i686 -DELFSIZE=32 -DCONFIG_HVM
+LIBDIR := lib
diff -r 22d92d7fa04a -r 93e96a7b38df config/x86_64.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/config/x86_64.mk  Tue May 30 17:17:30 2006 -0500
@@ -0,0 +1,9 @@
+CONFIG_X86 := y
+CONFIG_PLAN9 := y
+CONFIG_HVM := y
+CONFIG_MIGRATE := y
+CONFIG_IOEMU := y
+CONFIG_MBOOTPACK := y
+
+CFLAGS += -m64 -DELFSIZE=64 -DCONFIG_HVM
+LIBDIR = lib64

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

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