xcp-1.6-updates/xen-4.1.hg

view Config.mk @ 23322:5cdcfed7b5b1

Update Xen version to 4.1.3-rc3
author Keir Fraser <keir@xen.org>
date Sun Jul 22 16:38:46 2012 +0100 (2012-07-22)
parents acbd36176913
children ce7195d2b80e
line source
1 # -*- mode: Makefile; -*-
3 # A debug build of Xen and tools?
4 debug ?= n
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)
11 CONFIG_$(XEN_OS) := y
13 SHELL ?= /bin/sh
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
20 DISTDIR ?= $(XEN_ROOT)/dist
21 DESTDIR ?= /
23 # Allow phony attribute to be listed as dependency rather than fake target
24 .PHONY: .phony
26 include $(XEN_ROOT)/config/$(XEN_OS).mk
27 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
29 SHAREDIR ?= $(PREFIX)/share
30 DOCDIR ?= $(SHAREDIR)/doc/xen
31 MANDIR ?= $(SHAREDIR)/man
32 BASH_COMPLETION_DIR ?= $(CONFIG_DIR)/bash_completion.d
34 # arguments: variable, common path part, path to test, if yes, if no
35 define setvar_dir
36 ifndef $(1)
37 ifneq (,$(wildcard $(2)$(3)))
38 $(1) ?= $(2)$(4)
39 else
40 $(1) ?= $(2)$(5)
41 endif
42 endif
43 endef
45 # See distro_mapping.txt for other options
46 $(eval $(call setvar_dir,CONFIG_LEAF_DIR,,/etc/sysconfig,sysconfig,default))
47 $(eval $(call setvar_dir,SUBSYS_DIR,/var/run,/subsys,/subsys,))
48 $(eval $(call setvar_dir,INITD_DIR,/etc,/rc.d/init.d,/rc.d/init.d,/init.d))
50 ifneq ($(EXTRA_PREFIX),)
51 EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
52 EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBLEAFDIR)
53 endif
55 BISON ?= bison
56 FLEX ?= flex
58 PYTHON ?= python
59 PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)"
60 # The above requires that PREFIX contains *no spaces*. This variable is here
61 # to permit the user to set PYTHON_PREFIX_ARG to '' to workaround this bug:
62 # https://bugs.launchpad.net/ubuntu/+bug/362570
64 # cc-option: Check if compiler supports first option, else fall back to second.
65 #
66 # This is complicated by the fact that unrecognised -Wno-* options:
67 # (a) are ignored unless the compilation emits a warning; and
68 # (b) even then produce a warning rather than an error
69 # To handle this we do a test compile, passing the option-under-test, on a code
70 # fragment that will always produce a warning (integer assigned to pointer).
71 # We then grep for the option-under-test in the compiler's output, the presence
72 # of which would indicate an "unrecognized command-line option" warning/error.
73 #
74 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
75 cc-option = $(shell if test -z "`echo 'void*p=1;' | \
76 $(1) $(2) -S -o /dev/null -xc - 2>&1 | grep -- $(2) -`"; \
77 then echo "$(2)"; else echo "$(3)"; fi ;)
79 # cc-option-add: Add an option to compilation flags, but only if supported.
80 # Usage: $(call cc-option-add CFLAGS,CC,-march=winchip-c6)
81 cc-option-add = $(eval $(call cc-option-add-closure,$(1),$(2),$(3)))
82 define cc-option-add-closure
83 ifneq ($$(call cc-option,$$($(2)),$(3),n),n)
84 $(1) += $(3)
85 endif
86 endef
88 cc-options-add = $(foreach o,$(3),$(call cc-option-add,$(1),$(2),$(o)))
90 # cc-ver: Check compiler is at least specified version. Return boolean 'y'/'n'.
91 # Usage: ifeq ($(call cc-ver,$(CC),0x030400),y)
92 cc-ver = $(shell if [ $$((`$(1) -dumpversion | awk -F. \
93 '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -ge $$(($(2))) ]; \
94 then echo y; else echo n; fi ;)
96 # cc-ver-check: Check compiler is at least specified version, else fail.
97 # Usage: $(call cc-ver-check,CC,0x030400,"Require at least gcc-3.4")
98 cc-ver-check = $(eval $(call cc-ver-check-closure,$(1),$(2),$(3)))
99 define cc-ver-check-closure
100 ifeq ($$(call cc-ver,$$($(1)),$(2)),n)
101 override $(1) = echo "*** FATAL BUILD ERROR: "$(3) >&2; exit 1;
102 cc-option := n
103 endif
104 endef
106 define buildmakevars2shellvars
107 export PREFIX="$(PREFIX)"; \
108 export XEN_SCRIPT_DIR="$(XEN_SCRIPT_DIR)"; \
109 export XEN_ROOT="$(XEN_ROOT)"
110 endef
112 buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
113 define buildmakevars2file-closure
114 .PHONY: genpath
115 genpath:
116 rm -f $(1).tmp; \
117 echo "SBINDIR=\"$(SBINDIR)\"" >> $(1).tmp; \
118 echo "BINDIR=\"$(BINDIR)\"" >> $(1).tmp; \
119 echo "LIBEXEC=\"$(LIBEXEC)\"" >> $(1).tmp; \
120 echo "LIBDIR=\"$(LIBDIR)\"" >> $(1).tmp; \
121 echo "SHAREDIR=\"$(SHAREDIR)\"" >> $(1).tmp; \
122 echo "PRIVATE_BINDIR=\"$(PRIVATE_BINDIR)\"" >> $(1).tmp; \
123 echo "XENFIRMWAREDIR=\"$(XENFIRMWAREDIR)\"" >> $(1).tmp; \
124 echo "XEN_CONFIG_DIR=\"$(XEN_CONFIG_DIR)\"" >> $(1).tmp; \
125 echo "XEN_SCRIPT_DIR=\"$(XEN_SCRIPT_DIR)\"" >> $(1).tmp; \
126 echo "XEN_LOCK_DIR=\"$(XEN_LOCK_DIR)\"" >> $(1).tmp; \
127 if ! cmp $(1).tmp $(1); then mv -f $(1).tmp $(1); fi
128 endef
130 ifeq ($(debug),y)
131 CFLAGS += -g
132 endif
134 CFLAGS += -fno-strict-aliasing
136 CFLAGS += -std=gnu99
138 CFLAGS += -Wall -Wstrict-prototypes
140 # -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
141 # result of any casted expression causes a warning.
142 CFLAGS += -Wno-unused-value
144 $(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
145 $(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
146 $(call cc-option-add,CFLAGS,CC,-Wno-unused-but-set-variable)
148 LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i))
149 CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
151 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
152 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
154 # Enable XSM security module. Enabling XSM requires selection of an
155 # XSM security module (FLASK_ENABLE or ACM_SECURITY).
156 XSM_ENABLE ?= n
157 FLASK_ENABLE ?= n
158 ACM_SECURITY ?= n
160 # Download GIT repositories via HTTP or GIT's own protocol?
161 # GIT's protocol is faster and more robust, when it works at all (firewalls
162 # may block it). We make it the default, but if your GIT repository downloads
163 # fail or hang, please specify GIT_HTTP=y in your environment.
164 GIT_HTTP ?= n
166 XEN_EXTFILES_URL=http://xenbits.xensource.com/xen-extfiles
167 # All the files at that location were downloaded from elsewhere on
168 # the internet. The original download URL is preserved as a comment
169 # near the place in the Xen Makefiles where the file is used.
171 ifeq ($(GIT_HTTP),y)
172 QEMU_REMOTE=http://xenbits.xensource.com/git-http/qemu-xen-4.1-testing.git
173 else
174 QEMU_REMOTE=git://xenbits.xensource.com/qemu-xen-4.1-testing.git
175 endif
177 # Specify which qemu-dm to use. This may be `ioemu' to use the old
178 # Mercurial in-tree version, or a local directory, or a git URL.
179 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
180 CONFIG_QEMU ?= $(QEMU_REMOTE)
182 QEMU_TAG ?= xen-4.1.3-rc3
183 # Mon Apr 2 17:55:05 2012 +0100
184 # qemu-xen-traditional: QDISK fixes
186 # Optional components
187 XENSTAT_XENTOP ?= y
188 VTPM_TOOLS ?= n
189 LIBXENAPI_BINDINGS ?= n
190 PYTHON_TOOLS ?= y
191 OCAML_TOOLS ?= y
192 CONFIG_MINITERM ?= n
193 CONFIG_LOMOUNT ?= n
195 ifeq ($(OCAML_TOOLS),y)
196 OCAML_TOOLS := $(shell ocamlopt -v > /dev/null 2>&1 && echo "y" || echo "n")
197 endif
199 -include $(XEN_ROOT)/.config