diff options
author | Adrian Knoth <adi@drcomp.erfurt.thur.de> | 2017-01-10 22:18:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-10 22:18:11 +0100 |
commit | a96111a7a3bed8a0bacd1af64748c652defb5a5e (patch) | |
tree | e4e1c8693397f2e69a9dd7f84f08d30f4a79f31a | |
parent | be36f54b0ef258606c06e06054e6a524d51e6555 (diff) | |
parent | 8ac6bf1b4a13899c3a7dbb04bb69117b82f65136 (diff) | |
download | jack2-a96111a7a3bed8a0bacd1af64748c652defb5a5e.tar.gz |
Merge pull request #206 from tSed/fix-build-when-execinfo.b-is-not-available
Make backtrace support depend on execinfo.h's existence
-rw-r--r-- | dbus/sigsegv.c | 8 | ||||
-rw-r--r-- | wscript | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/dbus/sigsegv.c b/dbus/sigsegv.c index 7216fcb7..ead08e7d 100644 --- a/dbus/sigsegv.c +++ b/dbus/sigsegv.c @@ -27,7 +27,9 @@ #include <stdio.h> #include <signal.h> #include <dlfcn.h> -#include <execinfo.h> +#ifdef HAVE_EXECINFO_H +# include <execinfo.h> +#endif #include <errno.h> #ifndef NO_CPP_DEMANGLE char * __cxa_demangle(const char * __mangled_name, char * __output_buffer, size_t * __length, int * __status); @@ -161,12 +163,16 @@ static void signal_segv(int signum, siginfo_t* info, void*ptr) { bp = (void**)bp[0]; } #else +# ifdef HAVE_EXECINFO_H jack_error("Stack trace (non-dedicated):"); sz = backtrace(bt, 20); strings = backtrace_symbols(bt, sz); for(i = 0; i < sz; ++i) jack_error("%s", strings[i]); +# else + jack_error("Stack trace not available"); +# endif #endif jack_error("End of stack trace"); exit (-1); @@ -488,6 +488,12 @@ def configure(conf): defines=['_GNU_SOURCE'], mandatory=False) + # Check for backtrace support + conf.check( + header_name='execinfo.h', + define_name='HAVE_EXECINFO_H', + mandatory=False) + conf.recurse('common') if Options.options.dbus: conf.recurse('dbus') |