[Buildroot] [PATCH 1/1] domoticz: fix build with gcc <= 4.7

Fabrice Fontaine fontaine.fabrice at gmail.com
Mon Sep 17 16:55:47 UTC 2018


sleep_for is not always defined with gcc <= 4.7, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52680

To fix this issue, add -D_GLIBCXX_USE_NANOSLEEP if gcc version is lower
than 4.8

Fixes:
 - http://autobuild.buildroot.net/results/0dada8dd727f32a4500670f6620adb05943ed0b7

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
---
 package/domoticz/domoticz.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/domoticz/domoticz.mk b/package/domoticz/domoticz.mk
index 7f094d0976..832774a147 100644
--- a/package/domoticz/domoticz.mk
+++ b/package/domoticz/domoticz.mk
@@ -18,6 +18,12 @@ DOMOTICZ_DEPENDENCIES = \
 	sqlite \
 	zlib
 
+# sleep_for, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52680
+ifneq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_8),y)
+DOMOTICZ_CONF_OPTS += \
+	-DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -D_GLIBCXX_USE_NANOSLEEP"
+endif
+
 # Due to the dependency on mosquitto, domoticz depends on
 # !BR2_STATIC_LIBS so set USE_STATIC_BOOST and USE_OPENSSL_STATIC to OFF
 DOMOTICZ_CONF_OPTS += \
-- 
2.17.1



More information about the buildroot mailing list