* [Qemu-devel] [PATCH] configure: allow user to override cflags.
@ 2011-02-07 14:05 Tristan Gingold
2011-02-07 14:57 ` Anthony Liguori
0 siblings, 1 reply; 4+ messages in thread
From: Tristan Gingold @ 2011-02-07 14:05 UTC (permalink / raw)
To: qemu-devel; +Cc: Tristan Gingold
In order to allow user to override cflags, predefined flags must be inserted
before user cflags.
Signed-off-by: Tristan Gingold <gingold@adacore.com>
---
configure | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 598e8e1..f18ed0d 100755
--- a/configure
+++ b/configure
@@ -939,8 +939,10 @@ cat > $TMPC << EOF
int main(void) { return 0; }
EOF
for flag in $gcc_flags; do
- if compile_prog "-Werror $QEMU_CFLAGS" "-Werror $flag" ; then
- QEMU_CFLAGS="$QEMU_CFLAGS $flag"
+ if compile_prog "-Werror $flag $QEMU_CFLAGS" "" ; then
+ # Note: flag must be prepended so that they could be overriden by
+ # user flags (such as -fno-stack-protector)
+ QEMU_CFLAGS="$flag $QEMU_CFLAGS"
fi
done
--
1.7.3.GIT
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: allow user to override cflags.
2011-02-07 14:05 [Qemu-devel] [PATCH] configure: allow user to override cflags Tristan Gingold
@ 2011-02-07 14:57 ` Anthony Liguori
2011-02-07 15:08 ` Markus Armbruster
0 siblings, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2011-02-07 14:57 UTC (permalink / raw)
To: Tristan Gingold; +Cc: qemu-devel
On 02/07/2011 08:05 AM, Tristan Gingold wrote:
> In order to allow user to override cflags, predefined flags must be inserted
> before user cflags.
>
> Signed-off-by: Tristan Gingold<gingold@adacore.com>
>
I think there's a very specific reason we do it this way but I cannot
remember at the moment.
Regards,
Anthony Liguori
> ---
> configure | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 598e8e1..f18ed0d 100755
> --- a/configure
> +++ b/configure
> @@ -939,8 +939,10 @@ cat> $TMPC<< EOF
> int main(void) { return 0; }
> EOF
> for flag in $gcc_flags; do
> - if compile_prog "-Werror $QEMU_CFLAGS" "-Werror $flag" ; then
> - QEMU_CFLAGS="$QEMU_CFLAGS $flag"
> + if compile_prog "-Werror $flag $QEMU_CFLAGS" "" ; then
> + # Note: flag must be prepended so that they could be overriden by
> + # user flags (such as -fno-stack-protector)
> + QEMU_CFLAGS="$flag $QEMU_CFLAGS"
> fi
> done
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: allow user to override cflags.
2011-02-07 14:57 ` Anthony Liguori
@ 2011-02-07 15:08 ` Markus Armbruster
2011-02-07 15:13 ` Tristan Gingold
0 siblings, 1 reply; 4+ messages in thread
From: Markus Armbruster @ 2011-02-07 15:08 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Tristan Gingold, qemu-devel
Anthony Liguori <anthony@codemonkey.ws> writes:
> On 02/07/2011 08:05 AM, Tristan Gingold wrote:
>> In order to allow user to override cflags, predefined flags must be inserted
>> before user cflags.
>>
>> Signed-off-by: Tristan Gingold<gingold@adacore.com>
>>
>
> I think there's a very specific reason we do it this way but I cannot
> remember at the moment.
Commit 1e027be7e91d854d7a0132e4a32bdf222c33dcfe perhaps?
>
> Regards,
>
> Anthony Liguori
>
>> ---
>> configure | 6 ++++--
>> 1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 598e8e1..f18ed0d 100755
>> --- a/configure
>> +++ b/configure
>> @@ -939,8 +939,10 @@ cat> $TMPC<< EOF
>> int main(void) { return 0; }
>> EOF
>> for flag in $gcc_flags; do
>> - if compile_prog "-Werror $QEMU_CFLAGS" "-Werror $flag" ; then
>> - QEMU_CFLAGS="$QEMU_CFLAGS $flag"
>> + if compile_prog "-Werror $flag $QEMU_CFLAGS" "" ; then
>> + # Note: flag must be prepended so that they could be overriden by
>> + # user flags (such as -fno-stack-protector)
>> + QEMU_CFLAGS="$flag $QEMU_CFLAGS"
>> fi
>> done
>>
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: allow user to override cflags.
2011-02-07 15:08 ` Markus Armbruster
@ 2011-02-07 15:13 ` Tristan Gingold
0 siblings, 0 replies; 4+ messages in thread
From: Tristan Gingold @ 2011-02-07 15:13 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel
On Feb 7, 2011, at 4:08 PM, Markus Armbruster wrote:
> Anthony Liguori <anthony@codemonkey.ws> writes:
>
>> On 02/07/2011 08:05 AM, Tristan Gingold wrote:
>>> In order to allow user to override cflags, predefined flags must be inserted
>>> before user cflags.
>>>
>>> Signed-off-by: Tristan Gingold<gingold@adacore.com>
>>>
>>
>> I think there's a very specific reason we do it this way but I cannot
>> remember at the moment.
>
> Commit 1e027be7e91d854d7a0132e4a32bdf222c33dcfe perhaps?
Ah, thanks. I then have to deal with -Wall.
Tristan.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-02-07 15:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-07 14:05 [Qemu-devel] [PATCH] configure: allow user to override cflags Tristan Gingold
2011-02-07 14:57 ` Anthony Liguori
2011-02-07 15:08 ` Markus Armbruster
2011-02-07 15:13 ` Tristan Gingold
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).