[asterisk-commits] tilghman: trunk r100628 - in /trunk: ./ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 28 12:27:30 CST 2008


Author: tilghman
Date: Mon Jan 28 12:27:29 2008
New Revision: 100628

URL: http://svn.digium.com/view/asterisk?view=rev&rev=100628
Log:
Normalize the detection for execinfo, so that Linux (glibc) and other platforms
with libexecinfo will generate inline stack backtraces correctly.

Modified:
    trunk/configure
    trunk/configure.ac
    trunk/include/asterisk/autoconfig.h.in
    trunk/main/logger.c

Modified: trunk/configure.ac
URL: http://svn.digium.com/view/asterisk/trunk/configure.ac?view=diff&rev=100628&r1=100627&r2=100628
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon Jan 28 12:27:29 2008
@@ -842,7 +842,10 @@
 
 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
 
+# Non-glibc platforms require libexecinfo for backtrace support
 AST_EXT_LIB_CHECK([BKTR], [execinfo], [backtrace], [execinfo.h])
+# Linux, however, has backtrace directly in glibc
+AST_EXT_LIB_CHECK([BKTR], [c], [backtrace], [execinfo.h])
 
 # possible places for oss definitions
 AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [linux/soundcard.h])

Modified: trunk/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=100628&r1=100627&r2=100628
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Mon Jan 28 12:27:29 2008
@@ -1163,9 +1163,6 @@
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
 
 /* Define like PROTOTYPES; this can be used by system headers. */
 #undef __PROTOTYPES

Modified: trunk/main/logger.c
URL: http://svn.digium.com/view/asterisk/trunk/main/logger.c?view=diff&rev=100628&r1=100627&r2=100628
==============================================================================
--- trunk/main/logger.c (original)
+++ trunk/main/logger.c Mon Jan 28 12:27:29 2008
@@ -41,7 +41,7 @@
 #include <time.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#if ((defined(AST_DEVMODE)) && (defined(linux)))
+#ifdef HAVE_BKTR
 #include <execinfo.h>
 #define MAX_BACKTRACE_FRAMES 20
 #endif
@@ -1082,8 +1082,7 @@
 
 void ast_backtrace(void)
 {
-#ifdef linux
-#ifdef AST_DEVMODE
+#ifdef HAVE_BKTR
 	int count=0, i=0;
 	void **addresses;
 	char **strings;
@@ -1106,10 +1105,7 @@
 		ast_free(addresses);
 	}
 #else
-	ast_log(LOG_WARNING, "Must run configure with '--enable-dev-mode' for stack backtraces.\n");
-#endif
-#else /* ndef linux */
-	ast_log(LOG_WARNING, "Inline stack backtraces are only available on the Linux platform.\n");
+	ast_log(LOG_WARNING, "Must run configure with '--with-execinfo' for stack backtraces.\n");
 #endif
 }
 




More information about the asterisk-commits mailing list