From 8ef4e53d0a689d18b77146ac224f8d56f4755cde Mon Sep 17 00:00:00 2001 From: Jeffrey C. Ollie Date: Thu, 8 Nov 2007 16:42:14 -0600 Subject: [PATCH] Don't override/duplicate optimization flags. 1) Don't add '-pipe' to ASTCFLAGS if it's already there. 2) Don't add '-Wall' to ASTCFLAGS if it's already there. 3) Don't add '-march' to ASTCFLAGS if it's already there. --- Makefile | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 58cc0e9..26d3781 100644 --- a/Makefile +++ b/Makefile @@ -221,10 +221,16 @@ ifeq ($(OSARCH),linux-gnu) endif ifeq ($(findstring -save-temps,$(ASTCFLAGS)),) -ASTCFLAGS+=-pipe + ifeq ($(findstring -pipe,$(ASTCFLAGS)),) + ASTCFLAGS+=-pipe + endif +endif + +ifeq ($(findstring -Wall,$(ASTCFLAGS)),) + ASTCFLAGS+=-Wall endif -ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) +ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h @@ -237,8 +243,10 @@ ifneq ($(findstring BSD,$(OSARCH)),) ASTLDFLAGS+=-L/usr/local/lib endif -ifneq ($(PROC),ultrasparc) - ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi) +ifeq ($(findstring -march,$(ASTCFLAGS)),) + ifneq ($(PROC),ultrasparc) + ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi) + endif endif ifeq ($(PROC),ppc) -- 1.5.5.2