source: trunk/packages/xen-common/xen-common/Config.mk @ 34

Last change on this file since 34 was 34, checked in by hartmans, 17 years ago

Add xen and xen-common

File size: 2.9 KB
RevLine 
[34]1# -*- mode: Makefile; -*-
2
3# A debug build of Xen and tools?
4debug ?= n
5
6XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
7                         -e s/ppc/powerpc/ -e s/i86pc/x86_32/)
8XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
9XEN_OS              ?= $(shell uname -s)
10
11ifeq ($(XEN_TARGET_ARCH),x86_32)
12XEN_TARGET_X86_PAE  ?= y
13endif
14
15CONFIG_$(XEN_OS) := y
16
17SHELL     ?= /bin/sh
18
19# Tools to run on system hosting the build
20HOSTCC     = gcc
21HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
22
23DISTDIR     ?= $(XEN_ROOT)/dist
24DESTDIR     ?= /
25
26include $(XEN_ROOT)/config/$(XEN_OS).mk
27include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
28
29ifneq ($(EXTRA_PREFIX),)
30EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
31EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBDIR)
32endif
33
34# cc-option: Check if compiler supports first option, else fall back to second.
35# Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
36cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
37              /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;)
38
39# cc-ver: Check compiler is at least specified version. Return boolean 'y'/'n'.
40# Usage: ifeq ($(call cc-ver,$(CC),0x030400),y)
41cc-ver = $(shell if [ $$((`$(1) -dumpversion | awk -F. \
42           '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -ge $$(($(2))) ]; \
43           then echo y; else echo n; fi ;)
44
45# cc-ver-check: Check compiler is at least specified version, else fail.
46# Usage: $(call cc-ver-check,CC,0x030400,"Require at least gcc-3.4")
47cc-ver-check = $(eval $(call cc-ver-check-closure,$(1),$(2),$(3)))
48define cc-ver-check-closure
49    ifeq ($$(call cc-ver,$$($(1)),$(2)),n)
50        override $(1) = echo "*** FATAL BUILD ERROR: "$(3) >&2; exit 1;
51        cc-option := n
52    endif
53endef
54
55ifneq ($(debug),y)
56CFLAGS += -DNDEBUG
57else
58CFLAGS += -g
59endif
60
61CFLAGS += -std=gnu99
62
63CFLAGS += -Wall -Wstrict-prototypes
64
65# -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
66# result of any casted expression causes a warning.
67CFLAGS += -Wno-unused-value
68
69HOSTCFLAGS += $(call cc-option,$(HOSTCC),-Wdeclaration-after-statement,)
70CFLAGS     += $(call cc-option,$(CC),-Wdeclaration-after-statement,)
71
72LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
73CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
74
75# If ACM_SECURITY = y, then the access control module is compiled
76# into Xen and the policy type can be set by the boot policy file
77#        y - Build the Xen ACM framework
78#        n - Do not build the Xen ACM framework
79ACM_SECURITY ?= n
80
81# If ACM_SECURITY = y and no boot policy file is installed,
82# then the ACM defaults to the security policy set by
83# ACM_DEFAULT_SECURITY_POLICY
84# Supported models are:
85#       ACM_NULL_POLICY
86#       ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY
87ACM_DEFAULT_SECURITY_POLICY ?= ACM_NULL_POLICY
88
89# Optional components
90XENSTAT_XENTOP     ?= y
91VTPM_TOOLS         ?= n
92LIBXENAPI_BINDINGS ?= n
93XENFB_TOOLS        ?= n
94PYTHON_TOOLS       ?= y
95
96-include $(XEN_ROOT)/.config
Note: See TracBrowser for help on using the repository browser.