ia64/xen-unstable

view Config.mk @ 19835:edfdeb150f27

Fix buildsystem to detect udev > version 124

udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.

Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:02:37 2009 +0100 (2009-06-25)
parents 415505139333
children d9890e67d2b7
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 PYTHON ?= python
39 PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)"
40 # The above requires that PREFIX contains *no spaces*. This variable is here
41 # to permit the user to set PYTHON_PREFIX_ARG to '' to workaround this bug:
42 # https://bugs.launchpad.net/ubuntu/+bug/362570
44 # cc-option: Check if compiler supports first option, else fall back to second.
45 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
46 cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
47 /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;)
49 # cc-option-add: Add an option to compilation flags, but only if supported.
50 # Usage: $(call cc-option-add CFLAGS,CC,-march=winchip-c6)
51 cc-option-add = $(eval $(call cc-option-add-closure,$(1),$(2),$(3)))
52 define cc-option-add-closure
53 ifneq ($$(call cc-option,$$($(2)),$(3),n),n)
54 $(1) += $(3)
55 endif
56 endef
58 # cc-ver: Check compiler is at least specified version. Return boolean 'y'/'n'.
59 # Usage: ifeq ($(call cc-ver,$(CC),0x030400),y)
60 cc-ver = $(shell if [ $$((`$(1) -dumpversion | awk -F. \
61 '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -ge $$(($(2))) ]; \
62 then echo y; else echo n; fi ;)
64 # cc-ver-check: Check compiler is at least specified version, else fail.
65 # Usage: $(call cc-ver-check,CC,0x030400,"Require at least gcc-3.4")
66 cc-ver-check = $(eval $(call cc-ver-check-closure,$(1),$(2),$(3)))
67 define cc-ver-check-closure
68 ifeq ($$(call cc-ver,$$($(1)),$(2)),n)
69 override $(1) = echo "*** FATAL BUILD ERROR: "$(3) >&2; exit 1;
70 cc-option := n
71 endif
72 endef
74 define absolutify_xen_root
75 case "$(XEN_ROOT)" in \
76 /*) XEN_ROOT=$(XEN_ROOT) ;; \
77 *) xen_root_lhs=`pwd`; \
78 xen_root_rhs=$(XEN_ROOT)/; \
79 while [ "x$${xen_root_rhs#../}" != "x$$xen_root_rhs" ]; do \
80 xen_root_rhs="$${xen_root_rhs#../}"; \
81 xen_root_rhs="$${xen_root_rhs#/}"; \
82 xen_root_rhs="$${xen_root_rhs#/}"; \
83 xen_root_lhs="$${xen_root_lhs%/*}"; \
84 done; \
85 XEN_ROOT="$$xen_root_lhs/$$xen_root_rhs" ;; \
86 esac; \
87 export XEN_ROOT
88 endef
90 define buildmakevars2shellvars
91 PREFIX="$(PREFIX)"; \
92 XEN_SCRIPT_DIR="$(XEN_SCRIPT_DIR)"; \
93 export PREFIX; \
94 export XEN_SCRIPT_DIR
95 endef
97 buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
98 define buildmakevars2file-closure
99 .PHONY: genpath
100 genpath:
101 rm -f $(1); \
102 echo "SBINDIR=\"$(SBINDIR)\"" >> $(1); \
103 echo "BINDIR=\"$(BINDIR)\"" >> $(1); \
104 echo "LIBEXEC=\"$(LIBEXEC)\"" >> $(1); \
105 echo "LIBDIR=\"$(LIBDIR)\"" >> $(1); \
106 echo "PRIVATE_BINDIR=\"$(PRIVATE_BINDIR)\"" >> $(1); \
107 echo "XENFIRMWAREDIR=\"$(XENFIRMWAREDIR)\"" >> $(1); \
108 echo "XEN_CONFIG_DIR=\"$(XEN_CONFIG_DIR)\"" >> $(1); \
109 echo "XEN_SCRIPT_DIR=\"$(XEN_SCRIPT_DIR)\"" >> $(1)
110 endef
112 ifeq ($(debug),y)
113 CFLAGS += -g
114 endif
116 CFLAGS += -fno-strict-aliasing
118 CFLAGS += -std=gnu99
120 CFLAGS += -Wall -Wstrict-prototypes
122 # -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
123 # result of any casted expression causes a warning.
124 CFLAGS += -Wno-unused-value
126 $(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
127 $(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
129 LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i))
130 CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
132 # Enable XSM security module. Enabling XSM requires selection of an
133 # XSM security module (FLASK_ENABLE or ACM_SECURITY).
134 XSM_ENABLE ?= n
135 FLASK_ENABLE ?= n
136 ACM_SECURITY ?= n
138 XEN_EXTFILES_URL=http://xenbits.xensource.com/xen-extfiles
139 # All the files at that location were downloaded from elsewhere on
140 # the internet. The original download URL is preserved as a comment
141 # near the place in the Xen Makefiles where the file is used.
143 QEMU_REMOTE=http://xenbits.xensource.com/git-http/qemu-xen-unstable.git
145 # Specify which qemu-dm to use. This may be `ioemu' to use the old
146 # Mercurial in-tree version, or a local directory, or a git URL.
147 # CONFIG_QEMU ?= ../qemu-xen.git
148 CONFIG_QEMU ?= $(QEMU_REMOTE)
150 QEMU_TAG ?= e0bb6b8df60863bca0163a1688baf4854e931e55
151 # Mon Jun 8 17:45:42 2009 +0100
152 # stdvga + videoram config option
154 OCAML_XENSTORED_REPO=http://xenbits.xensource.com/ext/xen-ocaml-tools.hg
156 # Build OCAML version of xenstored instead of the in-tree C version?
157 # This will cause $(OCAML_XENSTORED_REPO) to be cloned.
158 CONFIG_OCAML_XENSTORED ?= n
160 # Optional components
161 XENSTAT_XENTOP ?= y
162 VTPM_TOOLS ?= n
163 LIBXENAPI_BINDINGS ?= n
164 PYTHON_TOOLS ?= y
165 CONFIG_MINITERM ?= n
166 CONFIG_LOMOUNT ?= n
168 -include $(XEN_ROOT)/.config