Replace all patches with Make options or sed to improve maintainability. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>lilik-openwrt-22.03
@ -1,28 +0,0 @@ | |||||
From eab45f0959ccb1deb662c6f8c036651088e2e8d6 Mon Sep 17 00:00:00 2001 | |||||
From: Stijn Tintel <stijn@linux-ipv6.be> | |||||
Date: Fri, 17 Feb 2017 05:42:25 +0100 | |||||
Subject: [PATCH] unix: fix compilation against musl libc (#1127) | |||||
POSIX.1-2001 requires sys/select.h for select() and friends. | |||||
Compile-tested on glibc and musl, runtime tested on musl. | |||||
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> | |||||
--- | |||||
cpp/src/platform/unix/SerialControllerImpl.cpp | 1 + | |||||
1 file changed, 1 insertion(+) | |||||
diff --git a/cpp/src/platform/unix/SerialControllerImpl.cpp b/cpp/src/platform/unix/SerialControllerImpl.cpp | |||||
index d95f848..b52b74f 100644 | |||||
--- a/cpp/src/platform/unix/SerialControllerImpl.cpp | |||||
+++ b/cpp/src/platform/unix/SerialControllerImpl.cpp | |||||
@@ -25,6 +25,7 @@ | |||||
// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>. | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
+#include <sys/select.h> | |||||
#include <unistd.h> | |||||
#include <pthread.h> | |||||
#include "Defs.h" | |||||
-- | |||||
2.10.2 | |||||
@ -1,29 +0,0 @@ | |||||
--- a/cpp/build/Makefile | |||||
+++ b/cpp/build/Makefile | |||||
@@ -15,7 +15,7 @@ | |||||
# what flags we will use for compiling in debug mode | |||||
DEBUG_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -Werror -Wno-error=sequence-point -Wno-sequence-point -ggdb -DDEBUG -fPIC -DSYSCONFDIR="\"$(PREFIX)/etc/openzwave/\"" | |||||
# what flags we will use for compiling in release mode | |||||
-RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Werror -Wno-format -Wno-error=sequence-point -Wno-sequence-point -O3 -DNDEBUG -fPIC -DSYSCONFDIR="\"$(PREFIX)/etc/openzwave/\"" | |||||
+RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-error=sequence-point -Wno-sequence-point -DNDEBUG -fPIC -DSYSCONFDIR="\"/etc/openzwave/\"" | |||||
#what flags we will use for linking in debug mode | |||||
DEBUG_LDFLAGS := -g | |||||
@@ -139,7 +139,7 @@ $(LIBDIR)/libopenzwave.a: $(patsubst %.c | |||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(indep)) \ | |||||
$(OBJDIR)/vers.o | |||||
@echo "Linking Static Library" | |||||
- @$(AR) $@ $+ | |||||
+ @$(AR) q $@ $+ | |||||
@$(RANLIB) $@ | |||||
$(LIBDIR)/$(SHARED_LIB_NAME): $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \ | |||||
@@ -161,7 +161,7 @@ $(top_builddir)/libopenzwave.pc: $(top_s | |||||
-e 's|[@]exec_prefix@|$(PREFIX)/bin|g' \ | |||||
-e 's|[@]libdir@|$(instlibdir)|g' \ | |||||
-e 's|[@]includedir@|$(PREFIX)/include/openzwave/|g' \ | |||||
- -e 's|[@]sysconfdir@|$(PREFIX)/etc/openzwave/|g' \ | |||||
+ -e 's|[@]sysconfdir@|/etc/openzwave/|g' \ | |||||
-e 's|[@]gitversion@|$(GITVERSION)|g' \ | |||||
-e 's|[@]docdir@|$(docdir)/|g' \ | |||||
-e 's|[@]VERSION@|$(VERSION)|g' \ |
@ -1,89 +0,0 @@ | |||||
--- a/cpp/src/Driver.cpp | |||||
+++ b/cpp/src/Driver.cpp | |||||
@@ -37,11 +37,6 @@ | |||||
#include "platform/Event.h" | |||||
#include "platform/Mutex.h" | |||||
#include "platform/SerialController.h" | |||||
-#ifdef WINRT | |||||
-#include "platform/winRT/HidControllerWinRT.h" | |||||
-#else | |||||
-#include "platform/HidController.h" | |||||
-#endif | |||||
#include "platform/Thread.h" | |||||
#include "platform/Log.h" | |||||
#include "platform/TimeStamp.h" | |||||
@@ -223,14 +218,7 @@ m_nonceReportSentAttempt( 0 ) | |||||
initNetworkKeys(false); | |||||
- if( ControllerInterface_Hid == _interface ) | |||||
- { | |||||
- m_controller = new HidController(); | |||||
- } | |||||
- else | |||||
- { | |||||
- m_controller = new SerialController(); | |||||
- } | |||||
+ m_controller = new SerialController(); | |||||
m_controller->SetSignalThreshold( 1 ); | |||||
Options::Get()->GetOptionAsBool( "NotifyTransactions", &m_notifytransactions ); | |||||
--- a/cpp/build/Makefile | |||||
+++ b/cpp/build/Makefile | |||||
@@ -66,16 +66,7 @@ CFLAGS += $(CPPFLAGS) | |||||
#where to put the temporary library | |||||
LIBDIR ?= $(top_builddir) | |||||
-INCLUDES := -I $(top_srcdir)/cpp/src -I $(top_srcdir)/cpp/tinyxml/ -I $(top_srcdir)/cpp/hidapi/hidapi/ | |||||
- | |||||
-ifeq ($(UNAME),Darwin) | |||||
-SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/mac | |||||
-else ifeq ($(UNAME),FreeBSD) | |||||
-SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/libusb | |||||
-else | |||||
-SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/linux | |||||
-endif | |||||
- | |||||
+INCLUDES := -I $(top_srcdir)/cpp/src -I $(top_srcdir)/cpp/tinyxml/ | |||||
SOURCES := $(top_srcdir)/cpp/src $(top_srcdir)/cpp/src/command_classes $(top_srcdir)/cpp/tinyxml \ | |||||
$(top_srcdir)/cpp/src/value_classes $(top_srcdir)/cpp/src/platform $(top_srcdir)/cpp/src/platform/unix $(SOURCES_HIDAPI) $(top_srcdir)/cpp/src/aes/ | |||||
@@ -85,14 +76,6 @@ VPATH = $(top_srcdir)/cpp/src:$(top_srcd | |||||
tinyxml := $(notdir $(wildcard $(top_srcdir)/cpp/tinyxml/*.cpp)) | |||||
-ifeq ($(UNAME),Darwin) | |||||
-hidapi := $(notdir $(wildcard $(top_srcdir)/cpp/hidapi/mac/*.c)) | |||||
-else ifeq ($(UNAME),FreeBSD) | |||||
-hidapi := $(notdir $(wildcard $(top_srcdir)/cpp/hidapi/libusb/*.c)) | |||||
-else | |||||
-hidapi := $(notdir $(wildcard $(top_srcdir)/cpp/hidapi/linux/*.c)) # we do not want the libusb version | |||||
-endif | |||||
- | |||||
cclasses := $(notdir $(wildcard $(top_srcdir)/cpp/src/command_classes/*.cpp)) | |||||
vclasses := $(notdir $(wildcard $(top_srcdir)/cpp/src/value_classes/*.cpp)) | |||||
pform := $(notdir $(wildcard $(top_srcdir)/cpp/src/platform/*.cpp)) \ | |||||
@@ -111,7 +94,6 @@ printversion: | |||||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(tinyxml)) | |||||
--include $(patsubst %.c,$(DEPDIR)/%.d,$(hidapi)) | |||||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(cclasses)) | |||||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(vclasses)) | |||||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(pform)) | |||||
@@ -131,7 +113,6 @@ $(top_srcdir)/cpp/src/vers.cpp: | |||||
#$(OBJDIR)/vers.o: $(top_builddir)/vers.cpp | |||||
$(LIBDIR)/libopenzwave.a: $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \ | |||||
- $(patsubst %.c,$(OBJDIR)/%.o,$(hidapi)) \ | |||||
$(patsubst %.c,$(OBJDIR)/%.o,$(aes)) \ | |||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(cclasses)) \ | |||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(vclasses)) \ | |||||
@@ -143,7 +124,6 @@ $(LIBDIR)/libopenzwave.a: $(patsubst %.c | |||||
@$(RANLIB) $@ | |||||
$(LIBDIR)/$(SHARED_LIB_NAME): $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \ | |||||
- $(patsubst %.c,$(OBJDIR)/%.o,$(hidapi)) \ | |||||
$(patsubst %.c,$(OBJDIR)/%.o,$(aes)) \ | |||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(cclasses)) \ | |||||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(vclasses)) \ |
@ -1,24 +0,0 @@ | |||||
--- a/cpp/src/platform/unix/SerialControllerImpl.cpp | |||||
+++ b/cpp/src/platform/unix/SerialControllerImpl.cpp | |||||
@@ -34,10 +34,6 @@ | |||||
#include "SerialControllerImpl.h" | |||||
#include "platform/Log.h" | |||||
-#ifdef __linux__ | |||||
-#include <libudev.h> | |||||
-#endif | |||||
- | |||||
using namespace OpenZWave; | |||||
//----------------------------------------------------------------------------- | |||||
--- a/cpp/build/Makefile | |||||
+++ b/cpp/build/Makefile | |||||
@@ -59,7 +59,7 @@ endif | |||||
else | |||||
LDFLAGS += -shared -Wl,-soname,libopenzwave.so.$(VERSION) | |||||
-LIBS += -ludev | |||||
+LIBS += | |||||
endif | |||||
CFLAGS += $(CPPFLAGS) | |||||
@ -1,15 +0,0 @@ | |||||
diff --git a/cpp/build/Makefile b/cpp/build/Makefile | |||||
index 666472d..41dc58c 100644 | |||||
--- a/cpp/build/Makefile | |||||
+++ b/cpp/build/Makefile | |||||
@@ -139,8 +139,8 @@ $(top_builddir)/libopenzwave.pc: $(top_srcdir)/cpp/build/libopenzwave.pc.in $(PK | |||||
@$(SED) \ | |||||
-e 's|[@]prefix@|$(PREFIX)|g' \ | |||||
-e 's|[@]exec_prefix@|$(PREFIX)/bin|g' \ | |||||
- -e 's|[@]libdir@|$(instlibdir)|g' \ | |||||
- -e 's|[@]includedir@|$(PREFIX)/include/openzwave/|g' \ | |||||
+ -e 's|[@]libdir@|$${prefix}/lib|g' \ | |||||
+ -e 's|[@]includedir@|$${prefix}/include/openzwave/|g' \ | |||||
-e 's|[@]sysconfdir@|/etc/openzwave/|g' \ | |||||
-e 's|[@]gitversion@|$(GITVERSION)|g' \ | |||||
-e 's|[@]docdir@|$(docdir)/|g' \ |