From patchwork Fri Sep 11 16:45:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 33481 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 bilbo.ozlabs.org (Postfix) with ESMTPS id B9364B6EDF for ; Sat, 12 Sep 2009 03:06:09 +1000 (EST) Received: from localhost ([127.0.0.1]:36619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm9ZW-0008OB-Oz for incoming@patchwork.ozlabs.org; Fri, 11 Sep 2009 13:06:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mm9Ft-0005l7-BO for qemu-devel@nongnu.org; Fri, 11 Sep 2009 12:45:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mm9Fo-0005eN-5F for qemu-devel@nongnu.org; Fri, 11 Sep 2009 12:45:48 -0400 Received: from [199.232.76.173] (port=55532 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm9Fo-0005eG-02 for qemu-devel@nongnu.org; Fri, 11 Sep 2009 12:45:44 -0400 Received: from mail.corp.accelance.fr ([213.162.48.15]:52133) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mm9Fn-0005wj-KN for qemu-devel@nongnu.org; Fri, 11 Sep 2009 12:45:43 -0400 Received: from tmonjalo-laptop (LPuteaux-156-15-47-90.w82-127.abo.wanadoo.fr [82.127.74.90]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.corp.accelance.fr (Postfix) with ESMTP id 51B901B0B9 for ; Fri, 11 Sep 2009 18:42:52 +0200 (CEST) To: qemu-devel@nongnu.org Content-Disposition: inline From: Thomas Monjalon Date: Fri, 11 Sep 2009 18:45:40 +0200 MIME-Version: 1.0 Message-Id: <200909111845.40392.thomas_ml@monjalon.net> X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH] restore CFLAGS check for conflict and fix recursive CFLAGS issue 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 cc-option uses more make-syntax to replace the shell "if/else". Issue with recursive += is fixed by doing the first assignment simply-expanded, as explained in http://www.gnu.org/software/make/manual/html_node/Appending.html Signed-off-by: Thomas Monjalon --- pc-bios/optionrom/Makefile | 4 ++-- rules.mak | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 78ce684..d9b6639 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -7,9 +7,9 @@ include $(SRC_PATH)/rules.mak VPATH=$(SRC_PATH)/pc-bios/optionrom -CFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin +CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin CFLAGS += -I$(SRC_PATH) -CFLAGS += $(call cc-option, -fno-stack-protector,"") +CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector) QEMU_CFLAGS = $(CFLAGS) build-all: multiboot.bin diff --git a/rules.mak b/rules.mak index 3fdbfd3..54ac88a 100644 --- a/rules.mak +++ b/rules.mak @@ -21,5 +21,5 @@ quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1)) # cc-option # Usage: CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0) -cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) +cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \ + >/dev/null 2>&1 && echo OK), $2, $3)