5c343db
From d0667633dd063013592eee40a52b1af0af340420 Mon Sep 17 00:00:00 2001
729de3c
From: Jeffrey C. Ollie <jcollie@pc21224.campus.dmacc.edu>
729de3c
Date: Thu, 8 Nov 2007 16:42:14 -0600
729de3c
Subject: [PATCH] Pick proper optimization flags for Fedora.
729de3c
729de3c
---
729de3c
 Makefile |   16 ++++++++++++----
729de3c
 1 files changed, 12 insertions(+), 4 deletions(-)
729de3c
729de3c
diff --git a/Makefile b/Makefile
a4d0f79
index 04a7b44..e8fae1d 100644
729de3c
--- a/Makefile
729de3c
+++ b/Makefile
a4d0f79
@@ -196,10 +196,16 @@ ifeq ($(OSARCH),linux-gnu)
729de3c
 endif
729de3c
 
729de3c
 ifeq ($(findstring -save-temps,$(ASTCFLAGS)),)
729de3c
-ASTCFLAGS+=-pipe
729de3c
+  ifeq ($(findstring -pipe,$(ASTCFLAGS)),)
729de3c
+    ASTCFLAGS+=-pipe
729de3c
+  endif
729de3c
+endif
729de3c
+
729de3c
+ifeq ($(findstring -Wall,$(ASTCFLAGS)),)
729de3c
+  ASTCFLAGS+=-Wall
729de3c
 endif
729de3c
 
729de3c
-ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
729de3c
+ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
729de3c
 
729de3c
 ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h
729de3c
 
a4d0f79
@@ -212,8 +218,10 @@ ifneq ($(findstring BSD,$(OSARCH)),)
729de3c
   ASTLDFLAGS+=-L/usr/local/lib
729de3c
 endif
729de3c
 
729de3c
-ifneq ($(PROC),ultrasparc)
729de3c
-  ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
729de3c
+ifeq ($(findstring -march,$(ASTCFLAGS)),)
729de3c
+  ifneq ($(PROC),ultrasparc)
729de3c
+    ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
729de3c
+  endif
729de3c
 endif
729de3c
 
729de3c
 ifeq ($(PROC),ppc)
729de3c
-- 
5c343db
1.5.3.7
729de3c