aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-09 22:49:19 +0000
committerpabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-09 22:49:19 +0000
commit85d139c11e4f8ad98ce1113e63d10ffb7c9ee4de (patch)
tree186ddc88252811338372ecd08ffbe227ec64a3e3
parent976abf87cbb0640663b3bb4b43709e03c6448fae (diff)
Merged revisions 285817 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r285817 | pabelanger | 2010-09-09 18:34:35 -0400 (Thu, 09 Sep 2010) | 8 lines GCC 4.2.x optimizations result in improper behavior of GSM codec (closes issue #17688) Reported by: pprindeville Patches: asterisk-trunk-bugid11243.patch uploaded by pprindeville (license 347) Tested by: mkeuter, pprindeville ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@285818 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--codecs/gsm/Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/codecs/gsm/Makefile b/codecs/gsm/Makefile
index 1153fee5d..cc23ed4a3 100644
--- a/codecs/gsm/Makefile
+++ b/codecs/gsm/Makefile
@@ -37,6 +37,14 @@ WAV49 = -DWAV49
######### ppro's, etc, as well as the AMD K6 and K7. The compile will
######### probably require gcc.
+# Due to the gsm codec beeing broken when compiled with gcc version 4.2
+# and optimization higher than -O2 we are checking for that version and
+# set the optimization to -O2 in this case.
+
+ifeq ($(shell $(CC) -v 2>&1 | awk '/^gcc version/ { split($$3, v, "."); printf "%s.%s\n", v[1], v[2]; }' ),4.2)
+OPTIMIZE=-O2
+endif
+
ifeq (,$(findstring $(OSARCH),Darwin SunOS))
ifeq (,$(strip $(findstring $(PROC) ,"x86_64 amd64 ultrasparc sparc64 arm armv5b armeb ppc powerpc ppc64 ia64 s390 bfin mipsel mips ")))
ifeq (,$(strip $(findstring $(shell uname -m) ,"ppc ppc64 alpha armv4l s390 ")))