From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44030 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmSXV-00052P-SR for qemu-devel@nongnu.org; Mon, 07 Feb 2011 09:58:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmSXU-0007b3-MI for qemu-devel@nongnu.org; Mon, 07 Feb 2011 09:58:05 -0500 Received: from mail-bw0-f45.google.com ([209.85.214.45]:63476) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmSXU-0007au-Hl for qemu-devel@nongnu.org; Mon, 07 Feb 2011 09:58:04 -0500 Received: by bwz16 with SMTP id 16so5106965bwz.4 for ; Mon, 07 Feb 2011 06:58:03 -0800 (PST) Message-ID: <4D500877.2020503@codemonkey.ws> Date: Mon, 07 Feb 2011 08:57:59 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] configure: allow user to override cflags. References: <1297087545-1942-1-git-send-email-gingold@adacore.com> In-Reply-To: <1297087545-1942-1-git-send-email-gingold@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tristan Gingold Cc: qemu-devel@nongnu.org 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 > 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 > >