Merged revisions 107408 via svnmerge from
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 11 Mar 2008 14:09:49 +0000 (14:09 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 11 Mar 2008 14:09:49 +0000 (14:09 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r107408 | kpfleming | 2008-03-11 09:07:59 -0500 (Tue, 11 Mar 2008) | 5 lines

check for compiler support for -fno-strict-overflow before using it (tested with Debian's gcc 4.3, 4.1 and 3.4)

(closes issue #12179)
Reported by: Netview

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107409 65c4cc65-6c06-0410-ace0-fbb531ad65f3

configure
configure.ac
main/Makefile
makeopts.in

index b913c42..8421948 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 104045 .
+# From configure.ac Revision: 107406 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.6.
 #
@@ -964,6 +964,7 @@ HAS_POLL
 GC_CFLAGS
 GC_LDFLAGS
 AST_DECLARATION_AFTER_STATEMENT
+AST_NO_STRICT_OVERFLOW
 GSM_INTERNAL
 CONFIG_NETSNMP
 PG_CONFIG
@@ -17508,6 +17509,18 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
+{ echo "$as_me:$LINENO: checking for -fno-strict-overflow" >&5
+echo $ECHO_N "checking for -fno-strict-overflow... $ECHO_C" >&6; }
+if $(${CC} -O2 -fno-strict-overflow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+   { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+   AST_NO_STRICT_OVERFLOW=-fno-strict-overflow
+else
+       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       AST_NO_STRICT_OVERFLOW=
+fi
+
 
 { echo "$as_me:$LINENO: checking for sysinfo" >&5
 echo $ECHO_N "checking for sysinfo... $ECHO_C" >&6; }
@@ -50944,6 +50957,7 @@ HAS_POLL!$HAS_POLL$ac_delim
 GC_CFLAGS!$GC_CFLAGS$ac_delim
 GC_LDFLAGS!$GC_LDFLAGS$ac_delim
 AST_DECLARATION_AFTER_STATEMENT!$AST_DECLARATION_AFTER_STATEMENT$ac_delim
+AST_NO_STRICT_OVERFLOW!$AST_NO_STRICT_OVERFLOW$ac_delim
 GSM_INTERNAL!$GSM_INTERNAL$ac_delim
 CONFIG_NETSNMP!$CONFIG_NETSNMP$ac_delim
 PG_CONFIG!$PG_CONFIG$ac_delim
@@ -50967,7 +50981,7 @@ CURL_CONFIG!$CURL_CONFIG$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 74; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 75; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index 3834a16..13d6c72 100644 (file)
@@ -478,6 +478,15 @@ else
 fi
 AC_SUBST(AST_DECLARATION_AFTER_STATEMENT)
 
+AC_MSG_CHECKING(for -fno-strict-overflow)
+if $(${CC} -O2 -fno-strict-overflow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+   AC_MSG_RESULT(yes)
+   AST_NO_STRICT_OVERFLOW=-fno-strict-overflow
+else
+       AC_MSG_RESULT(no)
+       AST_NO_STRICT_OVERFLOW=
+fi
+AC_SUBST(AST_NO_STRICT_OVERFLOW)
 
 AC_MSG_CHECKING(for sysinfo)
 AC_LINK_IFELSE(
index 13ac5e6..91e8783 100644 (file)
@@ -132,7 +132,7 @@ testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
 
 channel.o: ASTCFLAGS+=$(ZAPTEL_INCLUDE)
 
-stdtime/localtime.o: ASTCFLAGS+=-fno-strict-overflow
+stdtime/localtime.o: ASTCFLAGS+=$(AST_NO_STRICT_OVERFLOW)
 
 AST_EMBED_LDSCRIPTS:=$(sort $(EMBED_LDSCRIPTS))
 AST_EMBED_LDFLAGS:=$(foreach dep,$(EMBED_LDFLAGS),$(value $(dep)))
index 1b150a9..8cce876 100644 (file)
@@ -64,6 +64,7 @@ sysconfdir = @sysconfdir@
 AST_DEVMODE=@AST_DEVMODE@
 
 AST_DECLARATION_AFTER_STATEMENT=@AST_DECLARATION_AFTER_STATEMENT@
+AST_NO_STRICT_OVERFLOW=@AST_NO_STRICT_OVERFLOW@
 
 ASOUND_INCLUDE=@ALSA_INCLUDE@
 ASOUND_LIB=@ALSA_LIB@