From ed46a24f582f22f2e1f4e621d119acddc8d398f3 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 11 Mar 2018 16:52:07 +0100 Subject: [PATCH] re-enable backtraces on linux. --- CMakeLists.txt | 4 ++++ src/CMakeLists.txt | 4 ++++ src/main.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b14e2cf1f..19e49c9c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,9 +13,13 @@ include(MSVC) set (HAVE_STRDUP 0) set (HAVE_STRLCAT 0) set (HAVE_LIBBSD 0) +set (HAVE_SIGNAL_H 0) +set (HAVE_EXECINFO_H 0) else (MSVC) INCLUDE (CheckIncludeFile) +CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H) +CHECK_INCLUDE_FILE(execinfo.h HAVE_EXECINFO_H) CHECK_INCLUDE_FILE(bsd/string.h HAVE_LIBBSD) INCLUDE (CheckFunctionExists) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 653e036bd..bdf0465d2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -261,6 +261,10 @@ add_test(server test_eressea) install(TARGETS eressea DESTINATION "bin") +if (HAVE_EXECINFO_H AND HAVE_SIGNAL_H) + add_definitions(-DHAVE_BACKTRACE) +endif () + if (HAVE_LIBBSD) add_definitions(-DHAVE_LIBBSD) endif (HAVE_LIBBSD) diff --git a/src/main.c b/src/main.c index 489d0d868..b2fb23a96 100644 --- a/src/main.c +++ b/src/main.c @@ -257,7 +257,7 @@ static int parse_args(int argc, char **argv) return 0; } -#if defined(HAVE_SIGACTION) && defined(HAVE_EXECINFO) +#if defined(HAVE_BACKTRACE) #include #include