summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2011-03-11 15:09:23 +0000
committerKevin P. Fleming <kpfleming@digium.com>2011-03-11 15:09:23 +0000
commit7cf70df99941b006f0117acd89e3eba139d00d6c (patch)
treeb7253545524f3ee28717d20a1e3066a31f7f767d /Makefile
parentc7c0664bc4554efd21d491e2d4e09c66c9a9bae1 (diff)
Use "-march=native" when possible.
Recent versions of GCC have a tuning option value of 'native', which causes the compiler to optimize the build for the CPU the compile is performed on. Since most people are building Asterisk on the machine they plan to run it on, the configure script and build system will now use this value unless a different value is specified by the user in CFLAGS when the configure script is executed. In addition, this value will be used for building the GSM and LPC10 codecs as well, in preference to the logic that has been in their Makefiles forever to optimize for certain types of CPUs. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@310332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 10 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 55b10baa8..6221c4ea9 100644
--- a/Makefile
+++ b/Makefile
@@ -223,8 +223,12 @@ ifneq ($(findstring BSD,$(OSARCH)),)
endif
ifeq ($(findstring -march,$(_ASTCFLAGS) $(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)
+ ifneq ($(AST_MARCH_NATIVE),)
+ _ASTCFLAGS+=$(AST_MARCH_NATIVE)
+ else
+ 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
endif
@@ -233,8 +237,10 @@ ifeq ($(PROC),ppc)
endif
ifeq ($(OSARCH),FreeBSD)
- ifeq ($(PROC),i386)
- _ASTCFLAGS+=-march=i686
+ ifeq ($(findstring -march,$(_ASTCFLAGS) $(ASTCFLAGS)),)
+ ifeq ($(PROC),i386)
+ _ASTCFLAGS+=-march=i686
+ endif
endif
# -V is understood by BSD Make, not by GNU make.
BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)