2016-08-26 10:52:11 +02:00
|
|
|
From f0da50118f7bd01ed7fa97e75b790a8232d8d4dc Mon Sep 17 00:00:00 2001
|
2016-08-25 19:01:06 +02:00
|
|
|
From: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
|
|
|
|
Date: Thu, 25 Aug 2016 17:23:38 +0530
|
2016-08-26 10:52:11 +02:00
|
|
|
Subject: [PATCH] add proper check for detecting header <execinfo.h>
|
2016-08-25 19:01:06 +02:00
|
|
|
|
|
|
|
domoticz.cpp currently assumes that on GNU/Linux systems header
|
|
|
|
<execinfo.h> is available. But that is not true. Since it provided by
|
|
|
|
C library and uClibc can be built without backtrace support. And in
|
|
|
|
such cases we get following build error.
|
|
|
|
|
|
|
|
domoticz-3.4834/main/domoticz.cpp:48:22: fatal error: execinfo.h: No such file or directory
|
|
|
|
#include <execinfo.h>
|
|
|
|
^
|
|
|
|
compilation terminated.
|
|
|
|
|
|
|
|
Instead of depending on __gnu_linux__, add check for detecting
|
|
|
|
presence of <execinfo.h> and guard code for dumpstack accordingly.
|
|
|
|
|
|
|
|
This build failure is detected by Buildroot autobuilder.
|
|
|
|
http://autobuild.buildroot.net/results/393/393f839e160b51ca12ac36058718ad2f0c1b50a6/
|
|
|
|
|
|
|
|
Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
|
|
|
|
---
|
|
|
|
CMakeLists.txt | 7 +++++++
|
|
|
|
main/domoticz.cpp | 2 +-
|
|
|
|
2 files changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
|
2016-08-26 10:52:11 +02:00
|
|
|
Index: b/CMakeLists.txt
|
|
|
|
===================================================================
|
2016-08-25 19:01:06 +02:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2016-08-26 10:52:11 +02:00
|
|
|
@@ -61,6 +61,13 @@
|
2016-08-25 19:01:06 +02:00
|
|
|
"Where to put the executables for Domoticz"
|
|
|
|
)
|
|
|
|
|
|
|
|
+INCLUDE(CheckIncludeFiles)
|
|
|
|
+CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H)
|
|
|
|
+
|
|
|
|
+IF(HAVE_EXECINFO_H)
|
|
|
|
+ ADD_DEFINITIONS(-DHAVE_EXECINFO_H)
|
|
|
|
+ENDIF(HAVE_EXECINFO_H)
|
|
|
|
+
|
|
|
|
#set(CMAKE_EXE_LINKER_FLAGS "-static")
|
|
|
|
|
|
|
|
# Macro for setting up precompiled headers. Usage:
|
2016-08-26 10:52:11 +02:00
|
|
|
Index: b/main/domoticz.cpp
|
|
|
|
===================================================================
|
2016-08-25 19:01:06 +02:00
|
|
|
--- a/main/domoticz.cpp
|
|
|
|
+++ b/main/domoticz.cpp
|
|
|
|
@@ -44,7 +44,7 @@
|
2016-08-26 10:52:11 +02:00
|
|
|
#include <string.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef __gnu_linux__
|
|
|
|
+#ifdef HAVE_EXECINFO_H
|
|
|
|
#include <execinfo.h>
|
|
|
|
static void dumpstack(void) {
|
|
|
|
// Notes :
|