debuggers.hg

view Config.mk @ 21067:b4a1832a916f

Update Xen version to 4.0.0-rc6
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 09 18:18:05 2010 +0000 (2010-03-09)
parents e6f751ed8e38
children c5e1a0b720ba
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
33 ifneq ($(EXTRA_PREFIX),)
34 EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
35 EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBLEAFDIR)
36 endif
38 BISON ?= bison
39 FLEX ?= flex
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
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 ;)
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
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 ;)
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
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
93 define buildmakevars2shellvars
94 PREFIX="$(PREFIX)"; \
95 XEN_SCRIPT_DIR="$(XEN_SCRIPT_DIR)"; \
96 export PREFIX; \
97 export XEN_SCRIPT_DIR
98 endef
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
116 ifeq ($(debug),y)
117 CFLAGS += -g
118 endif
120 CFLAGS += -fno-strict-aliasing
122 CFLAGS += -std=gnu99
124 CFLAGS += -Wall -Wstrict-prototypes
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
130 $(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
131 $(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
133 LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i))
134 CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
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
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.
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-unstable.git
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)
156 QEMU_TAG := xen-4.0.0-rc6
157 #QEMU_TAG ?= e5d14857cd67490bf956d97c8888c0be95ed3f78
158 # Thu Feb 18 15:36:29 2010 +0000
159 # When xen_platform_pci=0 also disable fixed Xen platform ioports
161 OCAML_XENSTORED_REPO=http://xenbits.xensource.com/ext/xen-ocaml-tools.hg
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
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
175 -include $(XEN_ROOT)/.config