ia64/xen-unstable

changeset 10229:414dabe82a31

Use a global build configuration file, and rework libxc Makefile for PPC.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author kfraser@dhcp93.uk.xensource.com
date Wed May 31 11:31:52 2006 +0100 (2006-05-31)
parents 9e207a5cf589
children 94947f282fa2
files Config.mk config/ia64.mk config/x86_32.mk config/x86_64.mk extras/mini-os/Makefile tools/Makefile tools/Rules.mk tools/libxc/Makefile tools/libxc/xc_core.c tools/libxc/xc_hvm_build.c tools/libxc/xc_linux_build.c tools/libxc/xc_load_elf.c tools/libxc/xg_private.c tools/libxc/xg_private.h tools/misc/Makefile xen/tools/Makefile xen/tools/figlet/Makefile
line diff
     1.1 --- a/Config.mk	Wed May 31 09:30:40 2006 +0100
     1.2 +++ b/Config.mk	Wed May 31 11:31:52 2006 +0100
     1.3 @@ -39,19 +39,7 @@ else
     1.4  CFLAGS    += -g
     1.5  endif
     1.6  
     1.7 -ifeq ($(XEN_TARGET_ARCH),x86_32)
     1.8 -CFLAGS  += -m32 -march=i686
     1.9 -endif
    1.10 -
    1.11 -ifeq ($(XEN_TARGET_ARCH),x86_64)
    1.12 -CFLAGS  += -m64
    1.13 -endif
    1.14 -
    1.15 -ifeq ($(XEN_TARGET_ARCH),x86_64)
    1.16 -LIBDIR = lib64
    1.17 -else
    1.18 -LIBDIR = lib
    1.19 -endif
    1.20 +include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
    1.21  
    1.22  ifneq ($(EXTRA_PREFIX),)
    1.23  EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/config/ia64.mk	Wed May 31 11:31:52 2006 +0100
     2.3 @@ -0,0 +1,4 @@
     2.4 +CONFIG_IA64 := y
     2.5 +CONFIG_IOEMU := y
     2.6 +
     2.7 +LIBDIR := lib
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/config/x86_32.mk	Wed May 31 11:31:52 2006 +0100
     3.3 @@ -0,0 +1,9 @@
     3.4 +CONFIG_X86 := y
     3.5 +CONFIG_PLAN9 := y
     3.6 +CONFIG_HVM := y
     3.7 +CONFIG_MIGRATE := y
     3.8 +CONFIG_IOEMU := y
     3.9 +CONFIG_MBOOTPACK := y
    3.10 +
    3.11 +CFLAGS += -m32 -march=i686
    3.12 +LIBDIR := lib
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/config/x86_64.mk	Wed May 31 11:31:52 2006 +0100
     4.3 @@ -0,0 +1,9 @@
     4.4 +CONFIG_X86 := y
     4.5 +CONFIG_PLAN9 := y
     4.6 +CONFIG_HVM := y
     4.7 +CONFIG_MIGRATE := y
     4.8 +CONFIG_IOEMU := y
     4.9 +CONFIG_MBOOTPACK := y
    4.10 +
    4.11 +CFLAGS += -m64
    4.12 +LIBDIR = lib64
     5.1 --- a/extras/mini-os/Makefile	Wed May 31 09:30:40 2006 +0100
     5.2 +++ b/extras/mini-os/Makefile	Wed May 31 11:31:52 2006 +0100
     5.3 @@ -1,7 +1,8 @@
     5.4  debug ?= y
     5.5  pae ?= n
     5.6  
     5.7 -include $(CURDIR)/../../Config.mk
     5.8 +XEN_ROOT = ../..
     5.9 +include $(XEN_ROOT)/Config.mk
    5.10  
    5.11  # Set TARGET_ARCH
    5.12  override TARGET_ARCH     := $(XEN_TARGET_ARCH)
     6.1 --- a/tools/Makefile	Wed May 31 09:30:40 2006 +0100
     6.2 +++ b/tools/Makefile	Wed May 31 11:31:52 2006 +0100
     6.3 @@ -1,39 +1,38 @@
     6.4  XEN_ROOT = ../
     6.5  include $(XEN_ROOT)/tools/Rules.mk
     6.6  
     6.7 -SUBDIRS :=
     6.8 -SUBDIRS += libxc
     6.9 -SUBDIRS += xenstore
    6.10 -SUBDIRS += misc
    6.11 -SUBDIRS += examples
    6.12 -SUBDIRS += xentrace
    6.13 -SUBDIRS += xcutils
    6.14 -SUBDIRS += firmware
    6.15 -SUBDIRS += security
    6.16 -SUBDIRS += console
    6.17 -SUBDIRS += xenmon
    6.18 -SUBDIRS += guest-headers
    6.19 -ifeq ($(VTPM_TOOLS),y)
    6.20 -SUBDIRS += vtpm_manager
    6.21 -SUBDIRS += vtpm
    6.22 -endif
    6.23 -SUBDIRS += xenstat
    6.24 +SUBDIRS-y :=
    6.25 +SUBDIRS-y += libxc
    6.26 +SUBDIRS-y += xenstore
    6.27 +SUBDIRS-y += misc
    6.28 +SUBDIRS-y += examples
    6.29 +SUBDIRS-y += xentrace
    6.30 +SUBDIRS-$(CONFIG_X86) += xcutils
    6.31 +SUBDIRS-y += firmware
    6.32 +SUBDIRS-y += security
    6.33 +SUBDIRS-y += console
    6.34 +SUBDIRS-y += xenmon
    6.35 +SUBDIRS-y += guest-headers
    6.36 +SUBDIRS-$(VTPM_TOOLS) += vtpm_manager
    6.37 +SUBDIRS-$(VTPM_TOOLS) += vtpm
    6.38 +SUBDIRS-y += xenstat
    6.39 +
    6.40  # These don't cross-compile
    6.41  ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
    6.42 -SUBDIRS += python
    6.43 -SUBDIRS += pygrub
    6.44 +SUBDIRS-y += python
    6.45 +SUBDIRS-y += pygrub
    6.46  endif
    6.47  
    6.48  .PHONY: all
    6.49  all: check
    6.50 -	@set -e; for subdir in $(SUBDIRS); do \
    6.51 +	@set -e; for subdir in $(SUBDIRS-y); do \
    6.52  		$(MAKE) -C $$subdir $@; \
    6.53  	done
    6.54  	$(MAKE) ioemu
    6.55  
    6.56  .PHONY: install
    6.57  install: check
    6.58 -	@set -e; for subdir in $(SUBDIRS); do \
    6.59 +	@set -e; for subdir in $(SUBDIRS-y); do \
    6.60  		$(MAKE) -C $$subdir $@; \
    6.61  	done
    6.62  	$(MAKE) ioemuinstall
    6.63 @@ -41,7 +40,7 @@ install: check
    6.64  
    6.65  .PHONY: clean
    6.66  clean: check_clean
    6.67 -	@set -e; for subdir in $(SUBDIRS); do \
    6.68 +	@set -e; for subdir in $(SUBDIRS-y); do \
    6.69  		$(MAKE) -C $$subdir $@; \
    6.70  	done
    6.71  	$(MAKE) ioemuclean
    6.72 @@ -55,7 +54,7 @@ check_clean:
    6.73  	$(MAKE) -C check clean
    6.74  
    6.75  .PHONY: ioemu ioemuinstall ioemuclean
    6.76 -ifndef XEN_NO_IOEMU
    6.77 +ifdef CONFIG_IOEMU
    6.78  ioemu ioemuinstall ioemuclean:
    6.79  	[ -f ioemu/config-host.h ] || \
    6.80  	(cd ioemu; sh ./configure --prefix=usr)
     7.1 --- a/tools/Rules.mk	Wed May 31 09:30:40 2006 +0100
     7.2 +++ b/tools/Rules.mk	Wed May 31 11:31:52 2006 +0100
     7.3 @@ -5,6 +5,8 @@ all:
     7.4  
     7.5  include $(XEN_ROOT)/Config.mk
     7.6  
     7.7 +CONFIG_$(shell uname -s) := y
     7.8 +
     7.9  XEN_XC             = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
    7.10  XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
    7.11  XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
     8.1 --- a/tools/libxc/Makefile	Wed May 31 09:30:40 2006 +0100
     8.2 +++ b/tools/libxc/Makefile	Wed May 31 11:31:52 2006 +0100
     8.3 @@ -10,43 +10,30 @@ MINOR    = 0
     8.4  XEN_ROOT = ../..
     8.5  include $(XEN_ROOT)/tools/Rules.mk
     8.6  
     8.7 -SRCS       :=
     8.8 -SRCS       += xc_bvtsched.c
     8.9 -SRCS       += xc_core.c
    8.10 -SRCS       += xc_domain.c
    8.11 -SRCS       += xc_evtchn.c
    8.12 -SRCS       += xc_misc.c
    8.13 -SRCS       += xc_acm.c   
    8.14 -SRCS       += xc_physdev.c
    8.15 -SRCS       += xc_private.c
    8.16 -SRCS       += xc_sedf.c
    8.17 -SRCS       += xc_csched.c
    8.18 -SRCS       += xc_tbuf.c
    8.19 +CTRL_SRCS-y       :=
    8.20 +CTRL_SRCS-y       += xc_bvtsched.c
    8.21 +CTRL_SRCS-y       += xc_core.c
    8.22 +CTRL_SRCS-y       += xc_domain.c
    8.23 +CTRL_SRCS-y       += xc_evtchn.c
    8.24 +CTRL_SRCS-y       += xc_misc.c
    8.25 +CTRL_SRCS-y       += xc_acm.c   
    8.26 +CTRL_SRCS-y       += xc_physdev.c
    8.27 +CTRL_SRCS-y       += xc_private.c
    8.28 +CTRL_SRCS-y       += xc_sedf.c
    8.29 +CTRL_SRCS-y       += xc_csched.c
    8.30 +CTRL_SRCS-y       += xc_tbuf.c
    8.31 +CTRL_SRCS-$(CONFIG_X86) += xc_ptrace.c xc_ptrace_core.c xc_pagetab.c
    8.32 +CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
    8.33  
    8.34 -ifeq ($(patsubst x86%,x86,$(XEN_TARGET_ARCH)),x86)
    8.35 -SRCS       += xc_ptrace.c
    8.36 -SRCS       += xc_ptrace_core.c
    8.37 -SRCS       += xc_pagetab.c
    8.38 -endif
    8.39 -
    8.40 -SRCS_Linux += xc_linux.c
    8.41 -
    8.42 -SRCS       += $(SRCS_Linux)
    8.43 -
    8.44 -BUILD_SRCS :=
    8.45 -BUILD_SRCS += xc_linux_build.c
    8.46 -BUILD_SRCS += xc_load_bin.c
    8.47 -BUILD_SRCS += xc_load_elf.c
    8.48 -BUILD_SRCS += xg_private.c
    8.49 -
    8.50 -ifeq ($(XEN_TARGET_ARCH),ia64)
    8.51 -BUILD_SRCS += xc_ia64_stubs.c
    8.52 -else
    8.53 -BUILD_SRCS += xc_load_aout9.c
    8.54 -BUILD_SRCS += xc_linux_restore.c
    8.55 -BUILD_SRCS += xc_linux_save.c
    8.56 -BUILD_SRCS += xc_hvm_build.c
    8.57 -endif
    8.58 +GUEST_SRCS-y :=
    8.59 +GUEST_SRCS-y += xc_linux_build.c
    8.60 +GUEST_SRCS-y += xc_load_bin.c
    8.61 +GUEST_SRCS-y += xc_load_elf.c
    8.62 +GUEST_SRCS-y += xg_private.c
    8.63 +GUEST_SRCS-$(CONFIG_IA64) += xc_ia64_stubs.c
    8.64 +GUEST_SRCS-$(CONFIG_PLAN9) += xc_load_aout9.c
    8.65 +GUEST_SRCS-$(CONFIG_MIGRATE) += xc_linux_restore.c xc_linux_save.c
    8.66 +GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
    8.67  
    8.68  CFLAGS   += -Werror
    8.69  CFLAGS   += -fno-strict-aliasing
    8.70 @@ -61,11 +48,11 @@ CFLAGS   += -Wp,-MD,.$(@F).d
    8.71  LDFLAGS  += -L.
    8.72  DEPS     = .*.d
    8.73  
    8.74 -LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
    8.75 -PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
    8.76 +CTRL_LIB_OBJS := $(patsubst %.c,%.o,$(CTRL_SRCS-y))
    8.77 +CTRL_PIC_OBJS := $(patsubst %.c,%.opic,$(CTRL_SRCS-y))
    8.78  
    8.79 -LIB_BUILD_OBJS := $(patsubst %.c,%.o,$(BUILD_SRCS))
    8.80 -PIC_BUILD_OBJS := $(patsubst %.c,%.opic,$(BUILD_SRCS))
    8.81 +GUEST_LIB_OBJS := $(patsubst %.c,%.o,$(GUEST_SRCS-y))
    8.82 +GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
    8.83  
    8.84  LIB := libxenctrl.a
    8.85  LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
    8.86 @@ -125,7 +112,7 @@ rpm: build
    8.87  
    8.88  # libxenctrl
    8.89  
    8.90 -libxenctrl.a: $(LIB_OBJS)
    8.91 +libxenctrl.a: $(CTRL_LIB_OBJS)
    8.92  	$(AR) rc $@ $^
    8.93  
    8.94  libxenctrl.so: libxenctrl.so.$(MAJOR)
    8.95 @@ -133,12 +120,12 @@ libxenctrl.so: libxenctrl.so.$(MAJOR)
    8.96  libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
    8.97  	ln -sf $< $@
    8.98  
    8.99 -libxenctrl.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
   8.100 +libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
   8.101  	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenctrl.so.$(MAJOR) -shared -o $@ $^
   8.102  
   8.103  # libxenguest
   8.104  
   8.105 -libxenguest.a: $(LIB_BUILD_OBJS)
   8.106 +libxenguest.a: $(GUEST_LIB_OBJS)
   8.107  	$(AR) rc $@ $^
   8.108  
   8.109  libxenguest.so: libxenguest.so.$(MAJOR)
   8.110 @@ -146,7 +133,7 @@ libxenguest.so: libxenguest.so.$(MAJOR)
   8.111  libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
   8.112  	ln -sf $< $@
   8.113  
   8.114 -libxenguest.so.$(MAJOR).$(MINOR): $(PIC_BUILD_OBJS) libxenctrl.so
   8.115 +libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
   8.116  	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenguest.so.$(MAJOR) -shared -o $@ $^ -lz -lxenctrl
   8.117  
   8.118  -include $(DEPS)
     9.1 --- a/tools/libxc/xc_core.c	Wed May 31 09:30:40 2006 +0100
     9.2 +++ b/tools/libxc/xc_core.c	Wed May 31 11:31:52 2006 +0100
     9.3 @@ -1,6 +1,4 @@
     9.4  #include "xg_private.h"
     9.5 -#define ELFSIZE 32
     9.6 -#include "xc_elf.h"
     9.7  #include <stdlib.h>
     9.8  #include <unistd.h>
     9.9  
    10.1 --- a/tools/libxc/xc_hvm_build.c	Wed May 31 09:30:40 2006 +0100
    10.2 +++ b/tools/libxc/xc_hvm_build.c	Wed May 31 11:31:52 2006 +0100
    10.3 @@ -2,9 +2,9 @@
    10.4   * xc_hvm_build.c
    10.5   */
    10.6  
    10.7 +#define ELFSIZE 32
    10.8  #include <stddef.h>
    10.9  #include "xg_private.h"
   10.10 -#define ELFSIZE 32
   10.11  #include "xc_elf.h"
   10.12  #include <stdlib.h>
   10.13  #include <unistd.h>
    11.1 --- a/tools/libxc/xc_linux_build.c	Wed May 31 09:30:40 2006 +0100
    11.2 +++ b/tools/libxc/xc_linux_build.c	Wed May 31 11:31:52 2006 +0100
    11.3 @@ -6,14 +6,6 @@
    11.4  #include "xc_private.h"
    11.5  #include <xenctrl.h>
    11.6  
    11.7 -#if defined(__i386__)
    11.8 -#define ELFSIZE 32
    11.9 -#endif
   11.10 -
   11.11 -#if defined(__x86_64__) || defined(__ia64__)
   11.12 -#define ELFSIZE 64
   11.13 -#endif
   11.14 -
   11.15  #include "xc_elf.h"
   11.16  #include "xc_aout9.h"
   11.17  #include <stdlib.h>
    12.1 --- a/tools/libxc/xc_load_elf.c	Wed May 31 09:30:40 2006 +0100
    12.2 +++ b/tools/libxc/xc_load_elf.c	Wed May 31 11:31:52 2006 +0100
    12.3 @@ -3,14 +3,6 @@
    12.4   */
    12.5  
    12.6  #include "xg_private.h"
    12.7 -
    12.8 -#if defined(__i386__)
    12.9 -#define ELFSIZE 32
   12.10 -#endif
   12.11 -#if defined(__x86_64__) || defined(__ia64__)
   12.12 -#define ELFSIZE 64
   12.13 -#endif
   12.14 -
   12.15  #include "xc_elf.h"
   12.16  #include <stdlib.h>
   12.17  
    13.1 --- a/tools/libxc/xg_private.c	Wed May 31 09:30:40 2006 +0100
    13.2 +++ b/tools/libxc/xg_private.c	Wed May 31 11:31:52 2006 +0100
    13.3 @@ -145,3 +145,18 @@ unsigned long csum_page(void *page)
    13.4  
    13.5      return sum ^ (sum>>32);
    13.6  }
    13.7 +
    13.8 +__attribute__((weak)) int xc_hvm_build(
    13.9 +    int xc_handle,
   13.10 +    uint32_t domid,
   13.11 +    int memsize,
   13.12 +    const char *image_name,
   13.13 +    unsigned int vcpus,
   13.14 +    unsigned int pae,
   13.15 +    unsigned int acpi,
   13.16 +    unsigned int apic,
   13.17 +    unsigned int store_evtchn,
   13.18 +    unsigned long *store_mfn)
   13.19 +{
   13.20 +    return -ENOSYS;
   13.21 +}
    14.1 --- a/tools/libxc/xg_private.h	Wed May 31 09:30:40 2006 +0100
    14.2 +++ b/tools/libxc/xg_private.h	Wed May 31 11:31:52 2006 +0100
    14.3 @@ -25,6 +25,14 @@
    14.4  #define DECLARE_DOM0_OP dom0_op_t op
    14.5  #endif
    14.6  
    14.7 +#ifndef ELFSIZE
    14.8 +#include <limits.h>
    14.9 +#if UINT_MAX == ULONG_MAX
   14.10 +#define ELFSIZE 32
   14.11 +#else
   14.12 +#define ELFSIZE 64
   14.13 +#endif
   14.14 +#endif
   14.15  
   14.16  char *xc_read_image(const char *filename, unsigned long *size);
   14.17  char *xc_inflate_buffer(const char *in_buf,
    15.1 --- a/tools/misc/Makefile	Wed May 31 09:30:40 2006 +0100
    15.2 +++ b/tools/misc/Makefile	Wed May 31 11:31:52 2006 +0100
    15.3 @@ -25,7 +25,7 @@ all: build
    15.4  build: $(TARGETS)
    15.5  	$(MAKE) -C miniterm
    15.6  	$(MAKE) -C cpuperf
    15.7 -ifneq ($(XEN_TARGET_ARCH),ia64)
    15.8 +ifeq ($(CONFIG_MBOOTPACK),y)
    15.9  	$(MAKE) -C mbootpack
   15.10  endif
   15.11  	$(MAKE) -C lomount
    16.1 --- a/xen/tools/Makefile	Wed May 31 09:30:40 2006 +0100
    16.2 +++ b/xen/tools/Makefile	Wed May 31 11:31:52 2006 +0100
    16.3 @@ -1,5 +1,6 @@
    16.4  
    16.5 -include $(BASEDIR)/../Config.mk
    16.6 +XEN_ROOT = $(BASEDIR)/..
    16.7 +include $(XEN_ROOT)/Config.mk
    16.8  
    16.9  .PHONY: default
   16.10  default:
    17.1 --- a/xen/tools/figlet/Makefile	Wed May 31 09:30:40 2006 +0100
    17.2 +++ b/xen/tools/figlet/Makefile	Wed May 31 11:31:52 2006 +0100
    17.3 @@ -1,5 +1,6 @@
    17.4  
    17.5 -include $(BASEDIR)/../Config.mk
    17.6 +XEN_ROOT = $(BASEDIR)/..
    17.7 +include $(XEN_ROOT)/Config.mk
    17.8  
    17.9  figlet: figlet.c
   17.10  	$(HOSTCC) -o $@ $<