Commit e68398dc authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

configure: Check for HAVE_BACKTRACE and HAVE_EXECINFO_H.

parent 4af9b511
...@@ -1137,6 +1137,10 @@ case "${host_cpu}" in ...@@ -1137,6 +1137,10 @@ case "${host_cpu}" in
;; ;;
esac esac
dnl Check for backtrace() support
AC_CHECK_HEADERS(execinfo.h)
AC_CHECK_FUNCS(backtrace)
dnl dnl
dnl Enable profiling dnl Enable profiling
dnl dnl
......
...@@ -1482,7 +1482,7 @@ static void ListChildren( vlc_list_t *p_list, vlc_object_t *p_this, int i_type ) ...@@ -1482,7 +1482,7 @@ static void ListChildren( vlc_list_t *p_list, vlc_object_t *p_this, int i_type )
} }
#ifndef NDEBUG #ifndef NDEBUG
# if defined(__GLIBC__) || defined(__APPLE__) # ifdef (HAVE_EXECINFO_H)
# include <execinfo.h> # include <execinfo.h>
# endif # endif
...@@ -1541,7 +1541,7 @@ void vlc_refcheck (vlc_object_t *obj) ...@@ -1541,7 +1541,7 @@ void vlc_refcheck (vlc_object_t *obj)
obj->psz_object_type); obj->psz_object_type);
fflush (stderr); fflush (stderr);
#if defined(__GLIBC__) || defined(__APPLE__) #ifdef HAVE_BACKTRACE
void *stack[20]; void *stack[20];
int stackdepth = backtrace (stack, sizeof (stack) / sizeof (stack[0])); int stackdepth = backtrace (stack, sizeof (stack) / sizeof (stack[0]));
backtrace_symbols_fd (stack, stackdepth, 2); backtrace_symbols_fd (stack, stackdepth, 2);
......
...@@ -83,7 +83,7 @@ static inline unsigned long vlc_threadid (void) ...@@ -83,7 +83,7 @@ static inline unsigned long vlc_threadid (void)
return v.i; return v.i;
} }
#if defined(__GLIBC__) || defined(__APPLE__) #if HAVE_EXECINFO_H
# include <execinfo.h> # include <execinfo.h>
#endif #endif
...@@ -125,7 +125,7 @@ void vlc_pthread_fatal (const char *action, int error, ...@@ -125,7 +125,7 @@ void vlc_pthread_fatal (const char *action, int error,
fflush (stderr); fflush (stderr);
#endif #endif
#if defined(__GLIBC__) || defined(__APPLE__) #ifdef HAVE_BACKTRACE
void *stack[20]; void *stack[20];
int len = backtrace (stack, sizeof (stack) / sizeof (stack[0])); int len = backtrace (stack, sizeof (stack) / sizeof (stack[0]));
backtrace_symbols_fd (stack, len, 2); backtrace_symbols_fd (stack, len, 2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment