[vlc-devel] commit: configure: Check for HAVE_BACKTRACE and HAVE_EXECINFO_H. (Pierre d' Herbemont )

git version control git at videolan.org
Sat May 31 14:03:20 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sat May 31 14:04:33 2008 +0200| [e68398dc863a4eb87fcc804d32ab0d6eb3eae9c2]

configure: Check for HAVE_BACKTRACE and HAVE_EXECINFO_H.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e68398dc863a4eb87fcc804d32ab0d6eb3eae9c2
---

 configure.ac       |    4 ++++
 src/misc/objects.c |    4 ++--
 src/misc/threads.c |    4 ++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index e03cac8..7cfbe1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1137,6 +1137,10 @@ case "${host_cpu}" in
     ;;
 esac
 
+dnl Check for backtrace() support
+AC_CHECK_HEADERS(execinfo.h)
+AC_CHECK_FUNCS(backtrace)
+
 dnl
 dnl  Enable profiling
 dnl
diff --git a/src/misc/objects.c b/src/misc/objects.c
index 4b2e56d..d78c6d5 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -1482,7 +1482,7 @@ static void ListChildren( vlc_list_t *p_list, vlc_object_t *p_this, int i_type )
 }
 
 #ifndef NDEBUG
-# if defined(__GLIBC__) || defined(__APPLE__)
+# ifdef (HAVE_EXECINFO_H)
 #  include <execinfo.h>
 # endif
 
@@ -1541,7 +1541,7 @@ void vlc_refcheck (vlc_object_t *obj)
              obj->psz_object_type);
     fflush (stderr);
 
-#if defined(__GLIBC__) || defined(__APPLE__)
+#ifdef HAVE_BACKTRACE
     void *stack[20];
     int stackdepth = backtrace (stack, sizeof (stack) / sizeof (stack[0]));
     backtrace_symbols_fd (stack, stackdepth, 2);
diff --git a/src/misc/threads.c b/src/misc/threads.c
index c68dab7..57274d6 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -83,7 +83,7 @@ static inline unsigned long vlc_threadid (void)
      return v.i;
 }
 
-#if defined(__GLIBC__) || defined(__APPLE__)
+#if HAVE_EXECINFO_H
 # include <execinfo.h>
 #endif
 
@@ -125,7 +125,7 @@ void vlc_pthread_fatal (const char *action, int error,
     fflush (stderr);
 #endif
 
-#if defined(__GLIBC__) || defined(__APPLE__)
+#ifdef HAVE_BACKTRACE
     void *stack[20];
     int len = backtrace (stack, sizeof (stack) / sizeof (stack[0]));
     backtrace_symbols_fd (stack, len, 2);




More information about the vlc-devel mailing list