[asterisk-commits] dlee: branch 1.8 r402192 - /branches/1.8/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 29 09:52:29 CDT 2013


Author: dlee
Date: Tue Oct 29 09:52:26 2013
New Revision: 402192

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402192
Log:
Backport r373119 from 11 to go along with RAII_VAR support.

In order to use nested functions on some versions of GCC (e.g. GCC on OS X),
the -fnested-functions flag must be passed to the compiler. This patch adds
detection logic to ./configure to add the flag if necessary.

Modified:
    branches/1.8/Makefile
    branches/1.8/configure
    branches/1.8/configure.ac
    branches/1.8/makeopts.in

Modified: branches/1.8/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/Makefile?view=diff&rev=402192&r1=402191&r2=402192
==============================================================================
--- branches/1.8/Makefile (original)
+++ branches/1.8/Makefile Tue Oct 29 09:52:26 2013
@@ -170,7 +170,7 @@
   _ASTCFLAGS+=-Wall
 endif
 
-_ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
+_ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_NESTED_FUNCTIONS) $(DEBUG)
 
 ifeq ($(AST_DEVMODE),yes)
   _ASTCFLAGS+=-Werror

Modified: branches/1.8/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/configure.ac?view=diff&rev=402192&r1=402191&r2=402192
==============================================================================
--- branches/1.8/configure.ac (original)
+++ branches/1.8/configure.ac Tue Oct 29 09:52:26 2013
@@ -998,6 +998,18 @@
 fi
 AC_SUBST(AST_NATIVE_ARCH)
 
+dnl Nested functions required for RAII implementation
+AC_MSG_CHECKING(for -fnested-functions)
+AC_COMPILE_IFELSE(
+        dnl Prototype needed due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36774
+        [AC_LANG_PROGRAM([], [auto void foo(void); void foo(void) {}])],
+        AC_MSG_RESULT(no)
+        [AST_NESTED_FUNCTIONS=],
+        AC_MSG_RESULT(required)
+        [AST_NESTED_FUNCTIONS=-fnested-functions]
+)
+AC_SUBST(AST_NESTED_FUNCTIONS)
+
 AC_MSG_CHECKING(for sysinfo)
 AC_LINK_IFELSE(
         [AC_LANG_PROGRAM([#include <sys/sysinfo.h>],

Modified: branches/1.8/makeopts.in
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/makeopts.in?view=diff&rev=402192&r1=402191&r2=402192
==============================================================================
--- branches/1.8/makeopts.in (original)
+++ branches/1.8/makeopts.in Tue Oct 29 09:52:26 2013
@@ -99,6 +99,7 @@
 AST_DECLARATION_AFTER_STATEMENT=@AST_DECLARATION_AFTER_STATEMENT@
 AST_NO_STRICT_OVERFLOW=@AST_NO_STRICT_OVERFLOW@
 AST_SHADOW_WARNINGS=@AST_SHADOW_WARNINGS@
+AST_NESTED_FUNCTIONS=@AST_NESTED_FUNCTIONS@
 AST_FORTIFY_SOURCE=@AST_FORTIFY_SOURCE@
 
 ALSA_INCLUDE=@ALSA_INCLUDE@




More information about the asterisk-commits mailing list