Received: from [140.186.70.92] (port=41699 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmSiV-0002BG-PL for qemu-devel@nongnu.org; Mon, 07 Feb 2011 10:09:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmSiU-0001ec-Gc for qemu-devel@nongnu.org; Mon, 07 Feb 2011 10:09:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmSiU-0001eX-8a for qemu-devel@nongnu.org; Mon, 07 Feb 2011 10:09:26 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH] configure: allow user to override cflags. References: <1297087545-1942-1-git-send-email-gingold@adacore.com> <4D500877.2020503@codemonkey.ws> Date: Mon, 07 Feb 2011 16:08:50 +0100 In-Reply-To: <4D500877.2020503@codemonkey.ws> (Anthony Liguori's message of "Mon, 07 Feb 2011 08:57:59 -0600") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Tristan Gingold , qemu-devel@nongnu.org Anthony Liguori 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 >> > > 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 >> >>