diff --git a/configure.ac b/configure.ac index f78f376e..9e9286a5 100644 --- a/configure.ac +++ b/configure.ac @@ -86,6 +86,9 @@ AC_DEFINE_UNQUOTED(CONFIGDIR, "/etc/iwd", [Configuration directory]) AC_CHECK_HEADERS(linux/types.h linux/if_alg.h) +AC_CHECK_HEADERS_ONCE(execinfo.h) +AC_CHECK_LIB(execinfo, backtrace) + if (test "${enable_client}" != "no"); then AC_CHECK_HEADERS(readline/readline.h, enable_readline=yes, AC_MSG_ERROR(readline header files are required)) diff --git a/plugins/ofono.c b/plugins/ofono.c index 58a60d3f..5d108de5 100644 --- a/plugins/ofono.c +++ b/plugins/ofono.c @@ -653,7 +653,9 @@ static void parse_modem(const char *path, struct l_dbus_message_iter *props) * has been seen to happen. */ l_error("modem %s already found", path); +#ifdef HAVE_EXECINFO_H __iwd_backtrace_print(2); +#endif exit(1); } diff --git a/src/backtrace.c b/src/backtrace.c index 759a8431..f7732a63 100644 --- a/src/backtrace.c +++ b/src/backtrace.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE #include -#ifdef __GLIBC__ +#ifdef HAVE_EXECINFO_H #include #include #include