tools/configure: add options to pass EXTRA_CLFAGS
PATCH 1/1 tools/configure: add options to pass EXTRA_CLFAGS
# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1331817547 -3600
# Node ID 994ac398f4dc639ad0ca8aaabc4172ab72eb1358 # Parent 6dd1395c07cbc0f1408048f916bc6674dad19ef5 tools/configure: add options to pass EXTRA_CLFAGS
Currently qemu-xen gets build with CFLAGS only if CFLAGS was already in the environment during make invocation. If CFLAGS is in environment then make will append all of the various flags specified in xen Makefiles to this environment variable, which is then used in qemu configure. Since qemu-xen is not ready for compiler flags like -std=gnu99 compilation will fail. If CFLAGS is not in environment, then configure will use just "-O2 -g" because make does not export its own CFLAGS variable.
Quoted 1 line
From a distro perspective, its required to build libraries and binaries
with certain global cflags. Up to the point when qemu-xen was imported it worked as expected by exporting CFLAGS before 'make tools'. Now qemu-upstream reuses these CFLAGS, but it cant deal with the result.
This patch extends configure to recognize three environment variables which will be written to config/Tools.mk so they will be reused with each make invocation:
EXTRA_CFLAGS_XEN_TOOLS= specifies CFLAGS for the tools build. EXTRA_CFLAGS_QEMU_TRADITIONAL= specifies CFLAGS for old qemu. EXTRA_CFLAGS_QEMU_XEN= specifies CFLAGS for new qemu.
The new feature can be used like this in a rpm xen.spec file:
env \
EXTRA_CFLAGS_XEN_TOOLS="${RPM_OPT_FLAGS}" \
EXTRA_CFLAGS_QEMU_TRADITIONAL="${RPM_OPT_FLAGS}" \
EXTRA_CFLAGS_QEMU_XEN="${RPM_OPT_FLAGS}" \
./configure \
--libdir=%{_libdir} \
--prefix=/usr
makeTo make sure the EXTRA_CFLAGS appear first in the command line tools/Rules.mk must include config/Tools.mk before Config.mk.
config/Tools.mk.in +4 -0
@@ -22,6 +22,10 @@ PREPEND_LIB := @PREPEND_LIB@ APPEND_INCLUDES := @APPEND_INCLUDES@ APPEND_LIB := @APPEND_LIB@ +CFLAGS += @EXTRA_CFLAGS_XEN_TOOLS@ +EXTRA_CFLAGS_QEMU_TRADITIONAL += @EXTRA_CFLAGS_QEMU_TRADITIONAL@ +EXTRA_CFLAGS_QEMU_XEN += @EXTRA_CFLAGS_QEMU_XEN@ + # Download GIT repositories via HTTP or GIT's own protocol? # GIT's protocol is faster and more robust, when it works at all (firewalls # may block it). We make it the default, but if your GIT repository downloads
tools/Makefile +2 -0
@@ -122,6 +122,7 @@ subdir-all-qemu-xen-traditional-dir subd set -e; \ $(buildmakevars2shellvars); \ cd qemu-xen-traditional-dir; \ + env CFLAGS="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \ $(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \ $(MAKE) install
@@ -146,6 +147,7 @@ subdir-all-qemu-xen-dir subdir-install-q source=.; \ fi; \ cd qemu-xen-dir; \ + env CFLAGS="$(EXTRA_CFLAGS_QEMU_XEN)" \ $$source/configure --enable-xen --target-list=i386-softmmu \ --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \
tools/Rules.mk +1 -1
@@ -3,8 +3,8 @@ # `all' is the default target all: +include $(XEN_ROOT)/config/Tools.mk include $(XEN_ROOT)/Config.mk -include $(XEN_ROOT)/config/Tools.mk export _INSTALL := $(INSTALL) INSTALL = $(XEN_ROOT)/tools/cross-install
tools/configure.ac +6 -0
@@ -55,6 +55,12 @@ AC_ARG_VAR([APPEND_INCLUDES], [List of include folders to append to CFLAGS (without -I)]) AC_ARG_VAR([APPEND_LIB], [List of library folders to append to LDFLAGS (without -L)]) +AC_ARG_VAR([EXTRA_CFLAGS_XEN_TOOLS], + [Extra CFLAGS to build tools]) +AC_ARG_VAR([EXTRA_CFLAGS_QEMU_TRADITIONAL], + [Extra CFLAGS to build qemu-traditional]) +AC_ARG_VAR([EXTRA_CFLAGS_QEMU_XEN], + [Extra CFLAGS to build qemu-xen]) AX_SET_FLAGS
PATCH 1/1 tools/configure: add options to pass EXTRA_CLFAGS
Quoted 38 lines
Quoted 1 line
Quoted 1 line · Olaf Hering
# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1331817547 -3600
# Node ID994ac398f4dc639ad0ca8aaabc4172ab72eb1358# Parent6dd1395c07cbc0f1408048f916bc6674dad19ef5tools/configure: add options to passEXTRA_CLFAGSCurrently qemu-xen gets build with CFLAGS only if CFLAGS was already in the environment during make invocation. If CFLAGS is in environment then make will append all of the various flags specified in xen Makefiles to this environment variable, which is then used in qemu configure. Since qemu-xen is not ready for compiler flags like -std=gnu99 compilation will fail. If CFLAGS is not in environment, then configure will use just "-O2 -g" because make does not export its own CFLAGS variable.
From a distro perspective, its required to build libraries and binaries with certain global cflags. Up to the point when qemu-xen was imported it worked as expected by exporting CFLAGS before 'make tools'. Now qemu-upstream reuses these CFLAGS, but it cant deal with the result.
This patch extends configure to recognize three environment variables which will be written to
config/Tools.mkso they will be reused with each make invocation:
EXTRA_CFLAGS_XEN_TOOLS= specifies CFLAGS for the tools build. EXTRA_CFLAGS_QEMU_TRADITIONAL= specifies CFLAGS for old qemu. EXTRA_CFLAGS_QEMU_XEN= specifies CFLAGS for new qemu.
The new feature can be used like this in a rpm xen.spec file:env \ EXTRA_CFLAGS_XEN_TOOLS="${RPM_OPT_FLAGS}" \ EXTRA_CFLAGS_QEMU_TRADITIONAL="${RPM_OPT_FLAGS}" \ EXTRA_CFLAGS_QEMU_XEN="${RPM_OPT_FLAGS}" \ ./configure \ --libdir=%{_libdir} \ --prefix=/usr make
Quoted 1 line
To make sure the
EXTRA_CFLAGSappear first in the command line
Wouldn't one rather want them to appear last (to eventually override other settings, namely the optimization level)?
Jan
Quoted 72 lines
tools/Rules.mkmust includeconfig/Tools.mkbefore Config.mk.Signed-off-by Olaf Hering <[email protected]>diff -r
6dd1395c07cb-r994ac398f4dcconfig/Tools.mk.inconfig/Tools.mk.in +4
-0@@ -22,6 +22,10 @@ PREPEND_LIB := @PREPEND_LIB@ APPEND_INCLUDES := @APPEND_INCLUDES@ APPEND_LIB := @APPEND_LIB@ +CFLAGS += @EXTRA_CFLAGS_XEN_TOOLS@ +EXTRA_CFLAGS_QEMU_TRADITIONAL += @EXTRA_CFLAGS_QEMU_TRADITIONAL@ +EXTRA_CFLAGS_QEMU_XEN += @EXTRA_CFLAGS_QEMU_XEN@ + # Download GIT repositories via HTTP or GIT's own protocol? # GIT's protocol is faster and more robust, when it works at all (firewalls # may block it). We make it the default, but if your GIT repositorydownloads
diff -r6dd1395c07cb-r994ac398f4dctools/Makefiletools/Makefile +2
-0@@ -122,6 +122,7 @@ subdir-all-qemu-xen-traditional-dir subd set -e; \ $(buildmakevars2shellvars); \ cd qemu-xen-traditional-dir; \ + env CFLAGS="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \ $(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \ $(MAKE) install@@ -146,6 +147,7 @@ subdir-all-qemu-xen-dir subdir-install-q source=.; \ fi; \ cd qemu-xen-dir; \ + env CFLAGS="$(EXTRA_CFLAGS_QEMU_XEN)" \ $$source/configure --enable-xen --target-list=i386-softmmu \ --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \diff -r
6dd1395c07cb-r994ac398f4dctools/Rules.mktools/Rules.mk +1
-1@@ -3,8 +3,8 @@ # `all' is the default target all: +include $(XEN_ROOT)/config/Tools.mk include $(XEN_ROOT)/Config.mk -include $(XEN_ROOT)/config/Tools.mk export _INSTALL := $(INSTALL) INSTALL = $(XEN_ROOT)/tools/cross-installdiff -r
6dd1395c07cb-r994ac398f4dctools/configure.actools/configure.ac +6
-0@@ -55,6 +55,12 @@ AC_ARG_VAR([APPEND_INCLUDES], [List of include folders to append to CFLAGS (without -I)]) AC_ARG_VAR([APPEND_LIB], [List of library folders to append to LDFLAGS (without -L)]) +AC_ARG_VAR([EXTRA_CFLAGS_XEN_TOOLS], + [Extra CFLAGS to build tools]) +AC_ARG_VAR([EXTRA_CFLAGS_QEMU_TRADITIONAL], + [Extra CFLAGS to build qemu-traditional]) +AC_ARG_VAR([EXTRA_CFLAGS_QEMU_XEN], + [Extra CFLAGS to build qemu-xen]) AX_SET_FLAGS_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 17 lines · Jan Beulich
Quoted 17 lines
This patch extends configure to recognize three environment variables which will be written to
config/Tools.mkso they will be reused with each make invocation:
EXTRA_CFLAGS_XEN_TOOLS= specifies CFLAGS for the tools build. EXTRA_CFLAGS_QEMU_TRADITIONAL= specifies CFLAGS for old qemu. EXTRA_CFLAGS_QEMU_XEN= specifies CFLAGS for new qemu.
The new feature can be used like this in a rpm xen.spec file:env \ EXTRA_CFLAGS_XEN_TOOLS="${RPM_OPT_FLAGS}" \ EXTRA_CFLAGS_QEMU_TRADITIONAL="${RPM_OPT_FLAGS}" \ EXTRA_CFLAGS_QEMU_XEN="${RPM_OPT_FLAGS}" \ ./configure \ --libdir=%{_libdir} \ --prefix=/usr make
Quoted 4 lines
Quoted 1 line
To make sure the
EXTRA_CFLAGSappear first in the command lineWouldn't one rather want them to appear last (to eventually override other settings, namely the optimization level)?
If thats desired then the EXTRA_CFLAGS_XEN_TOOLS part is not needed, APPEND_CFLAGS= could be used for that purpose. But this variable is not yet handled as autoconf variable.
Olaf
2012/3/15 Olaf Hering <[email protected]>:
Quoted 82 lines
# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1331817547 -3600
# Node ID994ac398f4dc639ad0ca8aaabc4172ab72eb1358# Parent 6dd1395c07cbc0f1408048f916bc6674dad19ef5tools/configure: add options to passEXTRA_CLFAGSCurrently qemu-xen gets build with CFLAGS only if CFLAGS was already in the environment during make invocation. If CFLAGS is in environment then make will append all of the various flags specified in xen Makefiles to this environment variable, which is then used in qemu configure. Since qemu-xen is not ready for compiler flags like -std=gnu99 compilation will fail. If CFLAGS is not in environment, then configure will use just "-O2 -g" because make does not export its own CFLAGS variable.
From a distro perspective, its required to build libraries and binaries with certain global cflags. Up to the point when qemu-xen was imported it worked as expected by exporting CFLAGS before 'make tools'. Now qemu-upstream reuses these CFLAGS, but it cant deal with the result.
This patch extends configure to recognize three environment variables which will be written to
config/Tools.mkso they will be reused with each make invocation:
EXTRA_CFLAGS_XEN_TOOLS= specifies CFLAGS for the tools build. EXTRA_CFLAGS_QEMU_TRADITIONAL= specifies CFLAGS for old qemu. EXTRA_CFLAGS_QEMU_XEN= specifies CFLAGS for new qemu.
The new feature can be used like this in a rpm xen.spec file:env \
EXTRA_CFLAGS_XEN_TOOLS="${RPM_OPT_FLAGS}" \
EXTRA_CFLAGS_QEMU_TRADITIONAL="${RPM_OPT_FLAGS}" \
EXTRA_CFLAGS_QEMU_XEN="${RPM_OPT_FLAGS}" \
./configure \
--libdir=%{_libdir} \
--prefix=/usr
makeTo make sure the
EXTRA_CFLAGSappear first in the command linetools/Rules.mkmust includeconfig/Tools.mkbefore Config.mk.Signed-off-by Olaf Hering <[email protected]>diff -r
6dd1395c07cb-r994ac398f4dcconfig/Tools.mk.inconfig/Tools.mk.in +0
-0@@ -22,6 +22,10 @@ PREPEND_LIB := @PREPEND_LIB@APPEND_INCLUDES := @APPEND_INCLUDES@
APPEND_LIB := @APPEND_LIB@config/Tools.mk.in +4
-0+CFLAGS += @EXTRA_CFLAGS_XEN_TOOLS@ +EXTRA_CFLAGS_QEMU_TRADITIONAL += @EXTRA_CFLAGS_QEMU_TRADITIONAL@ +EXTRA_CFLAGS_QEMU_XEN += @EXTRA_CFLAGS_QEMU_XEN@ +# Download GIT repositories via HTTP or GIT's own protocol?
# GIT's protocol is faster and more robust, when it works at all (firewalls# may block it). We make it the default, but if your GIT repository downloads diff -r 6dd1395c07cb -r 994ac398f4dc tools/Makefiletools/Makefile +1
-0@@ -122,6 +122,7 @@ subdir-all-qemu-xen-traditional-dir subd set -e; \ $(buildmakevars2shellvars); \ cd qemu-xen-traditional-dir; \ + env CFLAGS="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \ $(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \$(MAKE) install
tools/Makefile +1
-0@@ -146,6 +147,7 @@ subdir-all-qemu-xen-dir subdir-install-q source=.; \ fi; \ cd qemu-xen-dir; \ + env CFLAGS="$(EXTRA_CFLAGS_QEMU_XEN)" \ $$source/configure --enable-xen --target-list=i386-softmmu \ --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \diff -r
6dd1395c07cb-r994ac398f4dctools/Rules.mktools/Rules.mk +0
-0@@ -3,8 +3,8 @@ # `all' is the default targetall:
Quoted 3 lines
+include $(XEN_ROOT)/config/Tools.mk
include $(XEN_ROOT)/Config.mk
-include $(XEN_ROOT)/config/Tools.mk
Do we really need to change the order? User-defined flags should appear after necessary tools build flags, if not a user might use some flags that break the build without knowing.
Quoted 6 lines
export
_INSTALL:= $(INSTALL)
INSTALL = $(XEN_ROOT)/tools/cross-install diff -r6dd1395c07cb-r994ac398f4dctools/configure.ac
tools/configure.ac AC_ARG_VAR([APPEND_INCLUDES], · line 63
Quoted 9 lines
tools/configure.ac +6
-0@@ -55,6 +55,12 @@ AC_ARG_VAR([APPEND_INCLUDES], [List of include folders to append to CFLAGS (without -I)]) AC_ARG_VAR([APPEND_LIB], [List of library folders to append to LDFLAGS (without -L)]) +AC_ARG_VAR([EXTRA_CFLAGS_XEN_TOOLS], + [Extra CFLAGS to build tools]) +AC_ARG_VAR([EXTRA_CFLAGS_QEMU_TRADITIONAL], + [Extra CFLAGS to build qemu-traditional]) +AC_ARG_VAR([EXTRA_CFLAGS_QEMU_XEN], + [Extra CFLAGS to build qemu-xen])
The change looks good to me in terms of configure modifications, but I'm not sure of the names, shouldn't qemu-traditional be qemu-xen(-traditional) and qemu-xen be qemu-(xen-)upstream?
Quoted 7 lines
AX_SET_FLAGS
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 8 lines · Roger Pau Monné
Quoted 8 lines
To make sure the
EXTRA_CFLAGSappear first in the command linetools/Rules.mkmust includeconfig/Tools.mkbefore Config.mk.+++
b/tools/Rules.mktools/Rules.mk +0
-0@@ -3,8 +3,8 @@ # `all' is the default targetall:
Quoted 7 lines
Quoted 3 lines
+include $(XEN_ROOT)/config/Tools.mk
include $(XEN_ROOT)/Config.mk
-include $(XEN_ROOT)/config/Tools.mkDo we really need to change the order? User-defined flags should appear after necessary tools build flags, if not a user might use some flags that break the build without knowing.
This affects the tools build. If the extra flags really should go to the end, then APPEND_CFLAGS can be reused and the ordering change above can be removed.
Quoted 11 lines
Quoted 11 lines
export
_INSTALL:= $(INSTALL)
INSTALL = $(XEN_ROOT)/tools/cross-install diff -r6dd1395c07cb-r994ac398f4dctools/configure.actools/configure.ac +2
-0@@ -55,6 +55,12 @@ AC_ARG_VAR([APPEND_INCLUDES], [List of include folders to append to CFLAGS (without -I)]) AC_ARG_VAR([APPEND_LIB], [List of library folders to append to LDFLAGS (without -L)]) +AC_ARG_VAR([EXTRA_CFLAGS_XEN_TOOLS], + [Extra CFLAGS to build tools])
Quoted 8 lines
tools/configure.ac AC_ARG_VAR([APPEND_INCLUDES], · line 63
Quoted 4 lines
tools/configure.ac +4
-0+AC_ARG_VAR([EXTRA_CFLAGS_QEMU_TRADITIONAL], + [Extra CFLAGS to build qemu-traditional]) +AC_ARG_VAR([EXTRA_CFLAGS_QEMU_XEN], + [Extra CFLAGS to build qemu-xen])The change looks good to me in terms of configure modifications, but I'm not sure of the names, shouldn't qemu-traditional be qemu-xen(-traditional) and qemu-xen be qemu-(xen-)upstream?
I cant comment on that.
What I have seen right now is that other external tools may need their own EXTRA_CFLAGS_xx variable. Like gcc47 is currently unhappy with ipxe at least.
Olaf
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel