From patchwork Fri Sep 11 15:26:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 33479 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 EF15DB7067 for ; Sat, 12 Sep 2009 02:48:05 +1000 (EST) Received: from localhost ([127.0.0.1]:41667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm9I2-00009R-Nn for incoming@patchwork.ozlabs.org; Fri, 11 Sep 2009 12:48:02 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mm817-0000ez-4s for qemu-devel@nongnu.org; Fri, 11 Sep 2009 11:26:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mm812-0000dg-Jh for qemu-devel@nongnu.org; Fri, 11 Sep 2009 11:26:28 -0400 Received: from [199.232.76.173] (port=35117 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm812-0000dc-AC for qemu-devel@nongnu.org; Fri, 11 Sep 2009 11:26:24 -0400 Received: from mail.corp.accelance.fr ([213.162.48.15]:51333) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mm811-00009D-Ub for qemu-devel@nongnu.org; Fri, 11 Sep 2009 11:26:24 -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 3F3C01B0B9 for ; Fri, 11 Sep 2009 17:23:32 +0200 (CEST) From: Thomas Monjalon To: qemu-devel@nongnu.org Date: Fri, 11 Sep 2009 17:26:19 +0200 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200909111726.19719.thomas@monjalon.net> X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Fri, 11 Sep 2009 12:29:51 -0400 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)