direct-io.hg

changeset 4252:486217f3ad4f

bitkeeper revision 1.1236.1.105 (423fdeaeuXmbQUj74cWh1nItpSKUjw)

Improved cross-compilation support.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Mar 22 09:00:30 2005 +0000 (2005-03-22)
parents c378c32a9538
children db5cb5193ffc
files .rootkeys Config.mk Makefile tools/Rules.mk tools/libxc/Makefile tools/libxutil/Makefile tools/misc/Makefile tools/xentrace/Makefile xen/Rules.mk xen/arch/x86/Rules.mk xen/tools/figlet/Makefile
line diff
     1.1 --- a/.rootkeys	Mon Mar 21 21:32:31 2005 +0000
     1.2 +++ b/.rootkeys	Tue Mar 22 09:00:30 2005 +0000
     1.3 @@ -3,6 +3,7 @@ 3eba336c4BUxP3H1DjQl8sInORf1Yw BitKeeper
     1.4  3ddb6b0buTaC5zg1_a8FoAR9FWi_mw BitKeeper/etc/ignore
     1.5  3ddb79c9_hgSp-gsQm8HqWM_9W3B_A BitKeeper/etc/logging_ok
     1.6  4177dbbfqsi01p2zgZa0geUOgScONw COPYING
     1.7 +423fdd91sxkCMaKFcDsEdhsZer54vA Config.mk
     1.8  3eb788d6Kleck_Cut0ouGneviGzliQ Makefile
     1.9  3f5ef5a24IaQasQE2tyMxrfxskMmvw README
    1.10  41880852AtdVfSsfKGtrLdajX1vEXQ buildconfigs/Rules.mk
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Config.mk	Tue Mar 22 09:00:30 2005 +0000
     2.3 @@ -0,0 +1,33 @@
     2.4 +# -*- mode: Makefile; -*-
     2.5 +# Currently supported architectures: x86_32, x86_64
     2.6 +XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
     2.7 +XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
     2.8 +
     2.9 +#
    2.10 +# Tool configuration Makefile fragment
    2.11 +#
    2.12 +HOSTCC     = gcc
    2.13 +HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 
    2.14 +
    2.15 +AS         = $(CROSS_COMPILE)as
    2.16 +LD         = $(CROSS_COMPILE)ld
    2.17 +CC         = $(CROSS_COMPILE)gcc
    2.18 +CPP        = $(CROSS_COMPILE)gcc -E
    2.19 +AR         = $(CROSS_COMPILE)ar
    2.20 +NM         = $(CROSS_COMPILE)nm
    2.21 +STRIP      = $(CROSS_COMPILE)strip
    2.22 +OBJCOPY    = $(CROSS_COMPILE)objcopy
    2.23 +OBJDUMP    = $(CROSS_COMPILE)objdump
    2.24 +
    2.25 +
    2.26 +ifneq ($(EXTRA_PREFIX),)
    2.27 +EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
    2.28 +EXTRA_LIB += $(EXTRA_PREFIX)/lib
    2.29 +endif
    2.30 +
    2.31 +LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
    2.32 +CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
    2.33 +
    2.34 +CFLAGS += -g
    2.35 +
    2.36 +
     3.1 --- a/Makefile	Mon Mar 21 21:32:31 2005 +0000
     3.2 +++ b/Makefile	Tue Mar 22 09:00:30 2005 +0000
     3.3 @@ -27,6 +27,7 @@ SUBARCH := $(subst x86_32,i386,$(XEN_TAR
     3.4  export XEN_TARGET_ARCH SUBARCH
     3.5  endif
     3.6  
     3.7 +include Config.mk
     3.8  include buildconfigs/Rules.mk
     3.9  
    3.10  .PHONY:	all dist install xen tools kernels docs world clean mkpatches mrproper
     4.1 --- a/tools/Rules.mk	Mon Mar 21 21:32:31 2005 +0000
     4.2 +++ b/tools/Rules.mk	Tue Mar 22 09:00:30 2005 +0000
     4.3 @@ -1,12 +1,11 @@
     4.4  #  -*- mode: Makefile; -*-
     4.5  
     4.6 +include $(XEN_ROOT)/Config.mk
     4.7 +
     4.8  XEN_XC             = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
     4.9  XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
    4.10  XEN_LIBXUTIL       = $(XEN_ROOT)/tools/libxutil
    4.11  
    4.12 -XEN_COMPILE_ARCH  ?= $(shell uname -m | sed -e s/i.86/x86_32/)
    4.13 -XEN_TARGET_ARCH   ?= $(XEN_COMPILE_ARCH)
    4.14 -
    4.15  ifeq ($(XEN_TARGET_ARCH),x86_32)
    4.16  CFLAGS  += -m32 -march=i686
    4.17  LDFLAGS += -m elf_i386
     5.1 --- a/tools/libxc/Makefile	Mon Mar 21 21:32:31 2005 +0000
     5.2 +++ b/tools/libxc/Makefile	Tue Mar 22 09:00:30 2005 +0000
     5.3 @@ -105,6 +105,6 @@ libxc.so.$(MAJOR): libxc.so.$(MAJOR).$(M
     5.4  	ln -sf $< $@
     5.5  
     5.6  libxc.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
     5.7 -	$(CC) $(CFLAGS) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz
     5.8 +	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz
     5.9  
    5.10  -include $(DEPS)
     6.1 --- a/tools/libxutil/Makefile	Mon Mar 21 21:32:31 2005 +0000
     6.2 +++ b/tools/libxutil/Makefile	Tue Mar 22 09:00:30 2005 +0000
     6.3 @@ -7,8 +7,6 @@ INSTALL_DIR	= $(INSTALL) -d -m0755
     6.4  
     6.5  include $(XEN_ROOT)/tools/Rules.mk
     6.6  
     6.7 -CC = gcc
     6.8 -
     6.9  LIB_SRCS :=
    6.10  LIB_SRCS += allocate.c
    6.11  LIB_SRCS += enum.c
     7.1 --- a/tools/misc/Makefile	Mon Mar 21 21:32:31 2005 +0000
     7.2 +++ b/tools/misc/Makefile	Tue Mar 22 09:00:30 2005 +0000
     7.3 @@ -5,7 +5,6 @@ INSTALL_DIR	= $(INSTALL) -d -m0755
     7.4  XEN_ROOT=../..
     7.5  include $(XEN_ROOT)/tools/Rules.mk
     7.6  
     7.7 -CC        = gcc
     7.8  CFLAGS   += -Wall -Werror -O3 
     7.9  
    7.10  INCLUDES += -I $(XEN_XC)
     8.1 --- a/tools/xentrace/Makefile	Mon Mar 21 21:32:31 2005 +0000
     8.2 +++ b/tools/xentrace/Makefile	Tue Mar 22 09:00:30 2005 +0000
     8.3 @@ -6,7 +6,6 @@ INSTALL_DATA	= $(INSTALL) -m0644
     8.4  XEN_ROOT=../..
     8.5  include $(XEN_ROOT)/tools/Rules.mk
     8.6  
     8.7 -CC       = gcc
     8.8  CFLAGS  += -Wall -Werror -O3
     8.9  
    8.10  CFLAGS  += -I $(XEN_XC)
     9.1 --- a/xen/Rules.mk	Mon Mar 21 21:32:31 2005 +0000
     9.2 +++ b/xen/Rules.mk	Tue Mar 22 09:00:30 2005 +0000
     9.3 @@ -7,9 +7,7 @@ optimize    ?= y
     9.4  domu_debug  ?= n
     9.5  crash_debug ?= n
     9.6  
     9.7 -# Currently supported architectures: x86_32, x86_64
     9.8 -XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
     9.9 -XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
    9.10 +include $(BASEDIR)/../Config.mk
    9.11  
    9.12  # Set ARCH/SUBARCH appropriately.
    9.13  override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH)
    9.14 @@ -39,10 +37,8 @@ ALL_OBJS += $(BASEDIR)/drivers/acpi/driv
    9.15  ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o
    9.16  ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARCH)/arch.o
    9.17  
    9.18 -HOSTCC     = gcc
    9.19 -HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 
    9.20  
    9.21 -test-gcc-flag = $(shell gcc -v --help 2>&1 | grep -q " $(1) " && echo $(1))
    9.22 +test-gcc-flag = $(shell $(CC) -v --help 2>&1 | grep -q " $(1) " && echo $(1))
    9.23  
    9.24  include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
    9.25  
    10.1 --- a/xen/arch/x86/Rules.mk	Mon Mar 21 21:32:31 2005 +0000
    10.2 +++ b/xen/arch/x86/Rules.mk	Tue Mar 22 09:00:30 2005 +0000
    10.3 @@ -1,10 +1,7 @@
    10.4  ########################################
    10.5  # x86-specific definitions
    10.6  
    10.7 -CC := gcc
    10.8 -LD := ld
    10.9 -
   10.10 -CFLAGS  := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing
   10.11 +CFLAGS  += -nostdinc -fno-builtin -fno-common -fno-strict-aliasing
   10.12  CFLAGS  += -iwithprefix include -Wall -Werror -Wno-format -pipe
   10.13  CFLAGS  += -I$(BASEDIR)/include -Wno-pointer-arith -Wredundant-decls
   10.14  
   10.15 @@ -24,13 +21,13 @@ CFLAGS  += $(call test-gcc-flag,-fno-sta
   10.16  
   10.17  ifeq ($(TARGET_SUBARCH),x86_32)
   10.18  CFLAGS  += -m32 -march=i686
   10.19 -LDFLAGS := -m elf_i386 
   10.20 +LDFLAGS += -m elf_i386 
   10.21  endif
   10.22  
   10.23  ifeq ($(TARGET_SUBARCH),x86_64)
   10.24  CFLAGS  += -m64 -mno-red-zone -fpic -fno-reorder-blocks
   10.25  CFLAGS  += -fno-asynchronous-unwind-tables
   10.26 -LDFLAGS := -m elf_x86_64
   10.27 +LDFLAGS += -m elf_x86_64
   10.28  endif
   10.29  
   10.30  # Test for at least GCC v3.2.x.
    11.1 --- a/xen/tools/figlet/Makefile	Mon Mar 21 21:32:31 2005 +0000
    11.2 +++ b/xen/tools/figlet/Makefile	Tue Mar 22 09:00:30 2005 +0000
    11.3 @@ -1,8 +1,8 @@
    11.4  
    11.5 -CC := gcc
    11.6 +include ../../Config.mk
    11.7  
    11.8  figlet: figlet.c
    11.9 -	$(CC) -o $@ $<
   11.10 +	$(HOSTCC) -o $@ $<
   11.11  
   11.12  clean:
   11.13  	rm -f *.o figlet