diff -uNr a/connman-1.15/config.h.in b/connman-1.15/config.h.in --- a/connman-1.15/config.h.in 2013-07-01 18:28:17.114258909 +0000 +++ b/connman-1.15/config.h.in 2013-07-01 18:45:12.614275054 +0000 @@ -3,6 +3,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H diff -uNr a/connman-1.15/configure b/connman-1.15/configure --- a/connman-1.15/configure 2013-07-01 18:28:17.119258909 +0000 +++ b/connman-1.15/configure 2013-07-01 18:45:08.534274989 +0000 @@ -12641,6 +12641,19 @@ fi +for ac_header in execinfo.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_execinfo_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_EXECINFO_H 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : diff -uNr a/connman-1.15/configure.ac b/connman-1.15/configure.ac --- a/connman-1.15/configure.ac 2013-07-01 18:28:17.114258909 +0000 +++ b/connman-1.15/configure.ac 2013-07-01 18:44:48.483274670 +0000 @@ -181,6 +181,8 @@ AC_CHECK_FUNC(signalfd, dummy=yes, AC_MSG_ERROR(signalfd support is required)) +AC_CHECK_HEADERS([execinfo.h], [], []) + AC_CHECK_LIB(dl, dlopen, dummy=yes, AC_MSG_ERROR(dynamic linking loader is required)) diff -uNr a/connman-1.15/src/log.c b/connman-1.15/src/log.c --- a/connman-1.15/src/log.c 2013-07-01 18:28:17.123258909 +0000 +++ b/connman-1.15/src/log.c 2013-07-01 18:39:21.981269479 +0000 @@ -30,7 +30,9 @@ #include #include #include +#ifdef HAVE_EXECINFO_H #include +#endif #include #include "connman.h" @@ -110,6 +112,7 @@ va_end(ap); } +#ifdef HAVE_EXECINFO_H static void print_backtrace(unsigned int offset) { void *frames[99]; @@ -211,12 +214,15 @@ close(outfd[1]); close(infd[0]); } +#endif static void signal_handler(int signo) { connman_error("Aborting (signal %d) [%s]", signo, program_exec); +#ifdef HAVE_EXECINFO_H print_backtrace(2); +#endif exit(EXIT_FAILURE); }