From patchwork Mon Feb 7 14:05:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 82136 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D1745B70E3 for ; Tue, 8 Feb 2011 07:49:09 +1100 (EST) Received: from localhost ([127.0.0.1]:51003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmRwZ-0002tj-Jw for incoming@patchwork.ozlabs.org; Mon, 07 Feb 2011 09:19:55 -0500 Received: from [140.186.70.92] (port=59239 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmRit-00052k-JU for qemu-devel@nongnu.org; Mon, 07 Feb 2011 09:05:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmRis-0003sF-Ct for qemu-devel@nongnu.org; Mon, 07 Feb 2011 09:05:47 -0500 Received: from mel.act-europe.fr ([194.98.77.210]:33740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmRis-0003ru-8S for qemu-devel@nongnu.org; Mon, 07 Feb 2011 09:05:46 -0500 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 48423CB0278; Mon, 7 Feb 2011 15:05:45 +0100 (CET) X-Virus-Scanned: amavisd-new at eu.adacore.com Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z9Y5tzkzZg1O; Mon, 7 Feb 2011 15:05:45 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) by mel.act-europe.fr (Postfix) with ESMTP id 35A3FCB0271; Mon, 7 Feb 2011 15:05:45 +0100 (CET) Received: by ulanbator.act-europe.fr (Postfix, from userid 501) id 2798CBBB21D; Mon, 7 Feb 2011 15:05:45 +0100 (CET) From: Tristan Gingold To: qemu-devel@nongnu.org Date: Mon, 7 Feb 2011 15:05:45 +0100 Message-Id: <1297087545-1942-1-git-send-email-gingold@adacore.com> X-Mailer: git-send-email 1.7.3.GIT X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 194.98.77.210 Cc: Tristan Gingold Subject: [Qemu-devel] [PATCH] configure: allow user to override cflags. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In order to allow user to override cflags, predefined flags must be inserted before user cflags. Signed-off-by: Tristan Gingold --- 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