~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to Config.mk

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- mode: Makefile; -*-
 
2
 
 
3
# A debug build of Xen and tools?
 
4
debug ?= n
 
5
 
 
6
XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
 
7
                         -e s/i86pc/x86_32/ -e s/amd64/x86_64/)
 
8
XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
 
9
XEN_OS              ?= $(shell uname -s)
 
10
 
 
11
CONFIG_$(XEN_OS) := y
 
12
 
 
13
SHELL     ?= /bin/sh
 
14
 
 
15
# Tools to run on system hosting the build
 
16
HOSTCC      = gcc
 
17
HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
 
18
HOSTCFLAGS += -fno-strict-aliasing
 
19
 
 
20
DISTDIR     ?= $(XEN_ROOT)/dist
 
21
DESTDIR     ?= /
 
22
 
 
23
# Allow phony attribute to be listed as dependency rather than fake target
 
24
.PHONY: .phony
 
25
 
 
26
include $(XEN_ROOT)/config/$(XEN_OS).mk
 
27
include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
 
28
 
 
29
SHAREDIR    ?= $(PREFIX)/share
 
30
DOCDIR      ?= $(SHAREDIR)/doc/xen
 
31
MANDIR      ?= $(SHAREDIR)/man
 
32
 
 
33
ifneq ($(EXTRA_PREFIX),)
 
34
EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
 
35
EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBLEAFDIR)
 
36
endif
 
37
 
 
38
BISON   ?= bison
 
39
FLEX    ?= flex
 
40
 
 
41
PYTHON      ?= python
 
42
PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)"
 
43
# The above requires that PREFIX contains *no spaces*. This variable is here
 
44
# to permit the user to set PYTHON_PREFIX_ARG to '' to workaround this bug:
 
45
#  https://bugs.launchpad.net/ubuntu/+bug/362570
 
46
 
 
47
# cc-option: Check if compiler supports first option, else fall back to second.
 
48
# Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
 
49
cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
 
50
              /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;)
 
51
 
 
52
# cc-option-add: Add an option to compilation flags, but only if supported.
 
53
# Usage: $(call cc-option-add CFLAGS,CC,-march=winchip-c6)
 
54
cc-option-add = $(eval $(call cc-option-add-closure,$(1),$(2),$(3)))
 
55
define cc-option-add-closure
 
56
    ifneq ($$(call cc-option,$$($(2)),$(3),n),n)
 
57
        $(1) += $(3)
 
58
    endif
 
59
endef
 
60
 
 
61
# cc-ver: Check compiler is at least specified version. Return boolean 'y'/'n'.
 
62
# Usage: ifeq ($(call cc-ver,$(CC),0x030400),y)
 
63
cc-ver = $(shell if [ $$((`$(1) -dumpversion | awk -F. \
 
64
           '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -ge $$(($(2))) ]; \
 
65
           then echo y; else echo n; fi ;)
 
66
 
 
67
# cc-ver-check: Check compiler is at least specified version, else fail.
 
68
# Usage: $(call cc-ver-check,CC,0x030400,"Require at least gcc-3.4")
 
69
cc-ver-check = $(eval $(call cc-ver-check-closure,$(1),$(2),$(3)))
 
70
define cc-ver-check-closure
 
71
    ifeq ($$(call cc-ver,$$($(1)),$(2)),n)
 
72
        override $(1) = echo "*** FATAL BUILD ERROR: "$(3) >&2; exit 1;
 
73
        cc-option := n
 
74
    endif
 
75
endef
 
76
 
 
77
define absolutify_xen_root
 
78
    case "$(XEN_ROOT)" in                                          \
 
79
    /*) XEN_ROOT=$(XEN_ROOT) ;;                                    \
 
80
    *)  xen_root_lhs=`pwd`;                                        \
 
81
        xen_root_rhs=$(XEN_ROOT)/;                                 \
 
82
        while [ "x$${xen_root_rhs#../}" != "x$$xen_root_rhs" ]; do \
 
83
            xen_root_rhs="$${xen_root_rhs#../}";                   \
 
84
            xen_root_rhs="$${xen_root_rhs#/}";                     \
 
85
            xen_root_rhs="$${xen_root_rhs#/}";                     \
 
86
            xen_root_lhs="$${xen_root_lhs%/*}";                    \
 
87
        done;                                                      \
 
88
        XEN_ROOT="$$xen_root_lhs/$$xen_root_rhs" ;;                \
 
89
    esac;                                                          \
 
90
    export XEN_ROOT
 
91
endef
 
92
 
 
93
define buildmakevars2shellvars
 
94
    PREFIX="$(PREFIX)";                                            \
 
95
    XEN_SCRIPT_DIR="$(XEN_SCRIPT_DIR)";                            \
 
96
    export PREFIX;                                                 \
 
97
    export XEN_SCRIPT_DIR
 
98
endef
 
99
 
 
100
buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
 
101
define buildmakevars2file-closure
 
102
    .PHONY: genpath
 
103
    genpath:
 
104
        rm -f $(1);                                                    \
 
105
        echo "SBINDIR=\"$(SBINDIR)\"" >> $(1);                         \
 
106
        echo "BINDIR=\"$(BINDIR)\"" >> $(1);                           \
 
107
        echo "LIBEXEC=\"$(LIBEXEC)\"" >> $(1);                         \
 
108
        echo "LIBDIR=\"$(LIBDIR)\"" >> $(1);                           \
 
109
        echo "SHAREDIR=\"$(SHAREDIR)\"" >> $(1);                       \
 
110
        echo "PRIVATE_BINDIR=\"$(PRIVATE_BINDIR)\"" >> $(1);           \
 
111
        echo "XENFIRMWAREDIR=\"$(XENFIRMWAREDIR)\"" >> $(1);           \
 
112
        echo "XEN_CONFIG_DIR=\"$(XEN_CONFIG_DIR)\"" >> $(1);           \
 
113
        echo "XEN_SCRIPT_DIR=\"$(XEN_SCRIPT_DIR)\"" >> $(1)
 
114
endef
 
115
 
 
116
ifeq ($(debug),y)
 
117
CFLAGS += -g
 
118
endif
 
119
 
 
120
CFLAGS += -fno-strict-aliasing
 
121
 
 
122
CFLAGS += -std=gnu99
 
123
 
 
124
CFLAGS += -Wall -Wstrict-prototypes
 
125
 
 
126
# -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
 
127
# result of any casted expression causes a warning.
 
128
CFLAGS += -Wno-unused-value
 
129
 
 
130
$(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
 
131
$(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
 
132
 
 
133
LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
 
134
CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
 
135
 
 
136
# Enable XSM security module.  Enabling XSM requires selection of an 
 
137
# XSM security module (FLASK_ENABLE or ACM_SECURITY).
 
138
XSM_ENABLE ?= n
 
139
FLASK_ENABLE ?= n
 
140
ACM_SECURITY ?= n
 
141
 
 
142
XEN_EXTFILES_URL=http://xenbits.xensource.com/xen-extfiles
 
143
# All the files at that location were downloaded from elsewhere on
 
144
# the internet.  The original download URL is preserved as a comment
 
145
# near the place in the Xen Makefiles where the file is used.
 
146
 
 
147
# GIT protocol can be faster than HTTP, if your firewall lets it through.
 
148
# QEMU_REMOTE=git://xenbits.xensource.com/qemu-xen-unstable.git
 
149
QEMU_REMOTE=http://xenbits.xensource.com/git-http/qemu-xen-4.0-testing.git
 
150
 
 
151
# Specify which qemu-dm to use. This may be `ioemu' to use the old
 
152
# Mercurial in-tree version, or a local directory, or a git URL.
 
153
# CONFIG_QEMU ?= ../qemu-xen.git
 
154
CONFIG_QEMU ?= $(QEMU_REMOTE)
 
155
 
 
156
QEMU_TAG := xen-4.0.0
 
157
#QEMU_TAG ?= f1d909f0f854194f5a40d850886d1413fb8b63c2
 
158
# Wed Mar 24 17:16:51 2010 +0000
 
159
# Make hweight32 function static
 
160
 
 
161
OCAML_XENSTORED_REPO=http://xenbits.xensource.com/ext/xen-ocaml-tools.hg
 
162
 
 
163
# Build OCAML version of xenstored instead of the in-tree C version?
 
164
# This will cause $(OCAML_XENSTORED_REPO) to be cloned.
 
165
CONFIG_OCAML_XENSTORED ?= n
 
166
 
 
167
# Optional components
 
168
XENSTAT_XENTOP     ?= y
 
169
VTPM_TOOLS         ?= n
 
170
LIBXENAPI_BINDINGS ?= n
 
171
PYTHON_TOOLS       ?= y
 
172
CONFIG_MINITERM    ?= n
 
173
CONFIG_LOMOUNT     ?= n
 
174
 
 
175
-include $(XEN_ROOT)/.config