summaryrefslogtreecommitdiff
path: root/codecs/lpc10
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 /codecs/lpc10
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 'codecs/lpc10')
-rw-r--r--codecs/lpc10/Makefile41
1 files changed, 23 insertions, 18 deletions
diff --git a/codecs/lpc10/Makefile b/codecs/lpc10/Makefile
index a85046d8c..e7d52a9de 100644
--- a/codecs/lpc10/Makefile
+++ b/codecs/lpc10/Makefile
@@ -27,30 +27,35 @@ CFLAGS+= -fPIC -Wno-comment
# fails miserably. Remove it for the time being.
_ASTCFLAGS:=$(_ASTCFLAGS:-Werror=)
-#fix for PPC processors and ALPHA, And UltraSparc too
-ifneq ($(OSARCH),Darwin)
- ifneq ($(findstring BSD,${OSARCH}),BSD)
- ifneq ($(PROC),ppc)
- ifneq ($(PROC),x86_64)
- ifneq ($(PROC),alpha)
-#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
-#This works for even old (2.96) versions of gcc and provides a small boost either way.
-#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn.t support it.
-#So we go lowest common available by gcc and go a step down, still a step up from
-#the default as we now have a better instruction set to work with. - Belgarath
- ifeq ($(PROC),ultrasparc)
- CFLAGS+= -mtune=$(PROC) -mcpu=v8 -O3 -fomit-frame-pointer
- else
- ifneq ($(OSARCH),SunOS)
- ifneq ($(OSARCH),arm)
-# CFLAGS+= -march=$(PROC)
+# If the compiler's '-march' flag has been specified already, then assume it's a value
+# that is what the user wants (or has been determined by the configure script). If not,
+# do some simple logic to set a decent value
+ifeq ($(findstring -march,$(_ASTCFLAGS) $(ASTCFLAGS)),)
+ #fix for PPC processors and ALPHA, And UltraSparc too
+ ifneq ($(OSARCH),Darwin)
+ ifneq ($(findstring BSD,${OSARCH}),BSD)
+ ifneq ($(PROC),ppc)
+ ifneq ($(PROC),x86_64)
+ ifneq ($(PROC),alpha)
+ #The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
+ #This works for even old (2.96) versions of gcc and provides a small boost either way.
+ #A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn.t support it.
+ #So we go lowest common available by gcc and go a step down, still a step up from
+ #the default as we now have a better instruction set to work with. - Belgarath
+ ifeq ($(PROC),ultrasparc)
+ CFLAGS+= -mtune=$(PROC) -mcpu=v8 -O3 -fomit-frame-pointer
+ else
+ ifneq ($(OSARCH),SunOS)
+ ifneq ($(OSARCH),arm)
+ # CFLAGS+= -march=$(PROC)
+ endif
+ endif
endif
endif
endif
endif
endif
endif
- endif
endif
LIB = $(LIB_TARGET_DIR)/liblpc10.a