ia64/xen-unstable

annotate Config.mk @ 18824:0b8c6c91c5a4

pv-on-hvm drivers: build fixes for Linux 2.6.27+

Make the drivers build properly in a 2.6.27 environment as well as
against a kernel with pv-ops Xen configured on (in the latter case
more work would be needed to also make the drivers work, as there's a
large number of duplicate exports).

Portions from Charles Arnold <carnold@novell.com>.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Nov 24 11:11:20 2008 +0000 (2008-11-24)
parents 71d3d3ac23b8
children d6889b3b6423
rev   line source
kaf24@4252 1 # -*- mode: Makefile; -*-
cl349@4443 2
kaf24@9213 3 # A debug build of Xen and tools?
kaf24@9213 4 debug ?= n
kaf24@9213 5
kaf24@10742 6 XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
keir@17617 7 -e s/i86pc/x86_32/ -e s/amd64/x86_64/)
kaf24@4252 8 XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH)
kfraser@11840 9 XEN_OS ?= $(shell uname -s)
kaf24@4252 10
kfraser@11847 11 CONFIG_$(XEN_OS) := y
kfraser@11847 12
ack@13291 13 SHELL ?= /bin/sh
ack@13291 14
kaf24@4444 15 # Tools to run on system hosting the build
keir@15533 16 HOSTCC = gcc
keir@15533 17 HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
keir@15533 18 HOSTCFLAGS += -fno-strict-aliasing
kaf24@4252 19
kaf24@7225 20 DISTDIR ?= $(XEN_ROOT)/dist
kaf24@9652 21 DESTDIR ?= /
keir@18270 22 DOCDIR ?= /usr/share/doc/xen
keir@18270 23 MANDIR ?= /usr/share/man
kaf24@7216 24
keir@17303 25 # Allow phony attribute to be listed as dependency rather than fake target
keir@17303 26 .PHONY: .phony
keir@17303 27
kfraser@11840 28 include $(XEN_ROOT)/config/$(XEN_OS).mk
kfraser@10229 29 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
katzj@4544 30
kaf24@4252 31 ifneq ($(EXTRA_PREFIX),)
kaf24@4252 32 EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
keir@16952 33 EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBLEAFDIR)
kaf24@4252 34 endif
kaf24@4252 35
kfraser@14589 36 # cc-option: Check if compiler supports first option, else fall back to second.
kfraser@11893 37 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
kfraser@11893 38 cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
kfraser@11893 39 /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;)
kaf24@7991 40
kfraser@14589 41 # cc-ver: Check compiler is at least specified version. Return boolean 'y'/'n'.
keir@14451 42 # Usage: ifeq ($(call cc-ver,$(CC),0x030400),y)
keir@14451 43 cc-ver = $(shell if [ $$((`$(1) -dumpversion | awk -F. \
keir@14451 44 '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -ge $$(($(2))) ]; \
keir@14451 45 then echo y; else echo n; fi ;)
keir@14451 46
kfraser@14589 47 # cc-ver-check: Check compiler is at least specified version, else fail.
kfraser@14589 48 # Usage: $(call cc-ver-check,CC,0x030400,"Require at least gcc-3.4")
kfraser@14589 49 cc-ver-check = $(eval $(call cc-ver-check-closure,$(1),$(2),$(3)))
kfraser@14589 50 define cc-ver-check-closure
kfraser@14589 51 ifeq ($$(call cc-ver,$$($(1)),$(2)),n)
kfraser@14589 52 override $(1) = echo "*** FATAL BUILD ERROR: "$(3) >&2; exit 1;
kfraser@14589 53 cc-option := n
kfraser@14589 54 endif
kfraser@14589 55 endef
kfraser@14589 56
keir@18488 57 define absolutify_xen_root
keir@18488 58 case "$(XEN_ROOT)" in \
keir@18488 59 /*) XEN_ROOT=$(XEN_ROOT) ;; \
keir@18488 60 *) xen_root_lhs=`pwd`; \
keir@18488 61 xen_root_rhs=$(XEN_ROOT)/; \
keir@18488 62 while [ "x$${xen_root_rhs#../}" != "x$$xen_root_rhs" ]; do \
keir@18488 63 xen_root_rhs="$${xen_root_rhs#../}"; \
keir@18488 64 xen_root_rhs="$${xen_root_rhs#/}"; \
keir@18488 65 xen_root_rhs="$${xen_root_rhs#/}"; \
keir@18488 66 xen_root_lhs="$${xen_root_lhs%/*}"; \
keir@18488 67 done; \
keir@18488 68 XEN_ROOT="$$xen_root_lhs/$$xen_root_rhs" ;; \
keir@18488 69 esac; \
keir@18488 70 export XEN_ROOT
keir@18488 71 endef
keir@18488 72
keir@16722 73 ifeq ($(debug),y)
kfraser@11840 74 CFLAGS += -g
kfraser@11840 75 endif
kfraser@11840 76
keir@15533 77 CFLAGS += -fno-strict-aliasing
keir@15533 78
kfraser@11872 79 CFLAGS += -std=gnu99
kfraser@11872 80
kaf24@9224 81 CFLAGS += -Wall -Wstrict-prototypes
kaf24@9212 82
kfraser@11835 83 # -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
kfraser@11835 84 # result of any casted expression causes a warning.
kfraser@11835 85 CFLAGS += -Wno-unused-value
kfraser@11835 86
kfraser@11893 87 HOSTCFLAGS += $(call cc-option,$(HOSTCC),-Wdeclaration-after-statement,)
kfraser@11893 88 CFLAGS += $(call cc-option,$(CC),-Wdeclaration-after-statement,)
kaf24@7989 89
kaf24@4252 90 LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i))
kaf24@4252 91 CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
iap10@5507 92
kfraser@15815 93 # Enable XSM security module. Enabling XSM requires selection of an
kfraser@15819 94 # XSM security module (FLASK_ENABLE or ACM_SECURITY).
kfraser@15815 95 XSM_ENABLE ?= n
kfraser@15816 96 FLASK_ENABLE ?= n
kaf24@7935 97 ACM_SECURITY ?= n
kaf24@7935 98
keir@18007 99 QEMU_REMOTE=http://xenbits.xensource.com/git-http/qemu-xen-unstable.git
keir@17956 100
keir@17956 101 # Specify which qemu-dm to use. This may be `ioemu' to use the old
keir@17956 102 # Mercurial in-tree version, or a local directory, or a git URL.
keir@18514 103 # CONFIG_QEMU ?= ../qemu-xen.git
keir@18514 104 CONFIG_QEMU ?= $(QEMU_REMOTE)
keir@17956 105
josht@6335 106 # Optional components
kfraser@14281 107 XENSTAT_XENTOP ?= y
kfraser@14281 108 VTPM_TOOLS ?= n
jfehlig@12637 109 LIBXENAPI_BINDINGS ?= n
kfraser@14281 110 PYTHON_TOOLS ?= y
keir@16742 111 CONFIG_MINITERM ?= n
keir@16742 112 CONFIG_LOMOUNT ?= n
kaf24@7216 113
kaf24@7216 114 -include $(XEN_ROOT)/.config