[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH for-xen-4.5] Add configure --with-extra-cflags-*

Since commit 338c4375153e39b95ddc82f2ed95f85dd73e0245 ("tools: pass
EXTRA_CFLAGS via environment") it was possible to specify additional
CFLAGS in the environment. That commit gives a good explanation how that
is useful.

Now that we have configure move the knobs from the middle of the source
code to a more prominent place. If the variables are set once via
configure it is possible to rerun make from another shell which may not
have these environment variables. That can happen if one tries to resume
a failed build with either doing chroot into a rpmbuild tree or from
another xterm.

This change adds the configure options --with-extra-cflags-tools=,
--with-extra-cflags-qemu-traditional= and
--with-extra-cflags-qemu-upstream= which will assign their values to the
existing make variables.

It is now required to use configure instead of environment variables to
have a consistent set of CFLAGS across make invocations.

A new knob "skip_extra_cflags" in Rules.mk is recognized to turn off the
assignment to CFLAGS. This is required to build the firmware.

Please rerun autogen.sh after applying this patch.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
 config/Tools.mk.in      |  3 +++
 tools/Rules.mk          |  2 ++
 tools/configure.ac      | 21 +++++++++++++++++++++
 tools/firmware/Rules.mk |  2 +-
 4 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 89de5bd..6d0ac1a 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -59,6 +59,9 @@ CONFIG_QEMU_TRAD    := @qemu_traditional@
 CONFIG_QEMU_XEN     := @qemu_xen@
 CONFIG_BLKTAP1      := @blktap1@
 CONFIG_BLKTAP2      := @blktap2@
 CONFIG_REMUS_NETBUF := @remus_netbuf@
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 87a56dc..228f9a2 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -88,7 +88,9 @@ endif
 CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs)
+ifneq ($(skip_extra_cflags),y)
        $(XEN_ROOT)/tools/python/install-wrap "$(PYTHON_PATH)" $(INSTALL_PROG)
diff --git a/tools/configure.ac b/tools/configure.ac
index 98b2455..0fe9f85 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -223,6 +223,27 @@ AC_ARG_WITH([system-ovmf],
+    AS_HELP_STRING([--with-extra-cflags-tools="EXTRA_CFLAGS"],
+       [Additional CFLAGS to be used to build tools.]),
+       [EXTRA_CFLAGS_XEN_TOOLS=$withval],
+    AS_HELP_STRING([--with-extra-cflags-qemu-traditional="EXTRA_CFLAGS"],
+       [Additional CFLAGS to be used to build qemu-traditional.]),
+    AS_HELP_STRING([--with-extra-cflags-qemu-upstream="EXTRA_CFLAGS"],
+       [Additional CFLAGS to be used to build qemu-upstream.]),
+       [EXTRA_CFLAGS_QEMU_XEN=$withval],
     AS_HELP_STRING([--with-extra-qemuu-configure-args@<:@="--ARG1 ..."@:>@],
        [List of additional configure options for upstream qemu]),[
diff --git a/tools/firmware/Rules.mk b/tools/firmware/Rules.mk
index 26bbddc..e3bf480 100644
--- a/tools/firmware/Rules.mk
+++ b/tools/firmware/Rules.mk
@@ -3,7 +3,7 @@ override XEN_TARGET_ARCH = x86_32
 # User-supplied CFLAGS are not useful here.
+skip_extra_cflags := y
 include $(XEN_ROOT)/tools/Rules.mk

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.