summaryrefslogtreecommitdiffstats
path: root/package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch
diff options
context:
space:
mode:
authorRahul Bedarkar <rahul.bedarkar@imgtec.com>2016-08-25 22:31:06 +0530
committerPeter Korsgaard <peter@korsgaard.com>2016-08-25 23:58:32 +0200
commit3f9c5fb096ad10d03832d9e0cd05ad4d02adf8c0 (patch)
treecebc49e69a515b4b2e6e037f63cf96a48bd9474e /package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch
parent791e35f222da58e815a657d07b620635b78a80e8 (diff)
downloadbuildroot-3f9c5fb096ad10d03832d9e0cd05ad4d02adf8c0.tar.gz
buildroot-3f9c5fb096ad10d03832d9e0cd05ad4d02adf8c0.zip
domoticz: fix build with uClibc
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. This commit adds patch for detecting presence of <execinfo.h> and guards code accordingly. Fixes: http://autobuild.buildroot.net/results/393/393f839e160b51ca12ac36058718ad2f0c1b50a6/ Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch')
-rw-r--r--package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch b/package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch
new file mode 100644
index 0000000000..c4d88a479b
--- /dev/null
+++ b/package/domoticz/0001-add-proper-check-for-detecting-header-execinfo.h.patch
@@ -0,0 +1,61 @@
+From 5409696dfcbb05d6e4e67e74c97487b1987639e1 Mon Sep 17 00:00:00 2001
+From: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
+Date: Thu, 25 Aug 2016 17:23:38 +0530
+Subject: [PATCH 1/1] add proper check for detecting header <execinfo.h>
+
+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(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d3113f4..ef32f7b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -61,6 +61,13 @@ SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL
+ "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:
+diff --git a/main/domoticz.cpp b/main/domoticz.cpp
+index 69d2ef6..c52e5ac 100644
+--- a/main/domoticz.cpp
++++ b/main/domoticz.cpp
+@@ -44,7 +44,7 @@
+ #include <string.h>
+ #endif
+
+-#ifdef __gnu_linux__
++#ifdef HAVE_EXECINFO_H
+ #include <execinfo.h>
+ static void dumpstack(void) {
+ // Notes :
+--
+2.6.2
+
OpenPOWER on IntegriCloud