configure: Check for HAVE_BACKTRACE and HAVE_EXECINFO_H.

This commit is contained in:
Pierre d'Herbemont 2008-05-31 14:04:33 +02:00
parent 4af9b5114e
commit e68398dc86
3 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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)
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);

View File

@ -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,
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);