add_test(LayerManagerService LayerManagerService_Test )
endif(WITH_TESTS)
+
+
+#=============================================================
+# configuration depending on system
+#=============================================================
+include(CheckFunctionExists)
+check_function_exists(backtrace_symbols HAVE_BACKTRACE)
+
+include(CheckIncludeFiles)
+check_include_files(execinfo.h HAVE_EXECINFO_H)
#include "SignalHandler.h"
#include "Log.h"
+#include "config.h"
+
#include <signal.h>
-#include <execinfo.h> // stacktrace
#include <stdlib.h> // exit
+#ifdef HAVE_EXECINFO_H
+ #include <execinfo.h>
+#endif
+
+
+
//===========================================================================
// Prototypes
//===========================================================================
//===========================================================================
void printStackTrace()
{
+#ifdef HAVE_BACKTRACE
const int maxStackSize = 64;
void* stack[maxStackSize];
LOG_INFO("LayerManagerService", "Stack-Trace [" << i << "]: " << lines[i]);
}
LOG_INFO("LayerManagerService", "--------------------------------------------------");
-
+#endif
+
LOG_INFO("LayerManagerService", "Exiting application.")
exit(-1);
}
// build with native systemd support
#cmakedefine WITH_SYSTEMD
+
+//-----------------------------------------------------------------------------
+// platform configuration
+//-----------------------------------------------------------------------------
+// execinfo header file
+#cmakedefine HAVE_EXECINFO_H
+
+// backtrace available
+#cmakedefine HAVE_BACKTRACE
+
+
//-----------------------------------------------------------------------------
// human readable report
//-----------------------------------------------------------------------------