xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@entel.upc.edu>
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] tools/configure: add options to pass EXTRA_CLFAGS
Date: Thu, 15 Mar 2012 15:38:10 +0100	[thread overview]
Message-ID: <CAPLaKK72SQtNjsg9crpw51o37eaQMAzMXcxVhN34DXMt0_VB_Q@mail.gmail.com> (raw)
In-Reply-To: <994ac398f4dc639ad0ca.1331817586@probook.site>

2012/3/15 Olaf Hering <olaf@aepfle.de>:
> # HG changeset patch
> # User Olaf Hering <olaf@aepfle.de>
> # 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.
>
> 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
>   make
>
> To make sure the EXTRA_CFLAGS appear first in the command line
> tools/Rules.mk must include config/Tools.mk before Config.mk.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>
> diff -r 6dd1395c07cb -r 994ac398f4dc config/Tools.mk.in
> --- a/config/Tools.mk.in
> +++ b/config/Tools.mk.in
> @@ -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
> diff -r 6dd1395c07cb -r 994ac398f4dc tools/Makefile
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -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 -r 994ac398f4dc tools/Rules.mk
> --- a/tools/Rules.mk
> +++ b/tools/Rules.mk
> @@ -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

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.

>  export _INSTALL := $(INSTALL)
>  INSTALL = $(XEN_ROOT)/tools/cross-install
> diff -r 6dd1395c07cb -r 994ac398f4dc tools/configure.ac
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -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?

>  AX_SET_FLAGS
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2012-03-15 14:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-15 13:19 [PATCH] tools/configure: add options to pass EXTRA_CLFAGS Olaf Hering
2012-03-15 13:31 ` Jan Beulich
2012-03-15 13:46   ` Olaf Hering
2012-03-15 14:38 ` Roger Pau Monné [this message]
2012-03-15 15:32   ` Olaf Hering
  -- strict thread matches above, loose matches on Subject: below --
2012-03-27 12:42 Olaf Hering
2012-03-27 13:04 ` Olaf Hering
2012-03-28 18:56 Olaf Hering
2012-04-03 17:13 ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPLaKK72SQtNjsg9crpw51o37eaQMAzMXcxVhN34DXMt0_VB_Q@mail.gmail.com \
    --to=roger.pau@entel.upc.edu \
    --cc=olaf@aepfle.de \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).