Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/cpp/build/Makefile b/cpp/build/Makefile
- index 078c733f..28d04076 100644
- --- a/cpp/build/Makefile
- +++ b/cpp/build/Makefile
- @@ -23,6 +23,9 @@ top_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../../)
- include $(top_srcdir)/cpp/build/support.mk
- +# Used to detect SmartOS (variable will be "joyent")
- +UNAME_V := $(shell uname -v 2>/dev/null | sed -e 's/_.*//')
- +
- #Mac prefers a dylib, not a so
- ifeq ($(UNAME),Darwin)
- SHARED_LIB_NAME=libopenzwave-$(VERSION).dylib
- @@ -60,6 +63,9 @@ endif
- else ifeq ($(UNAME),NetBSD)
- CFLAGS += -I/usr/pkg/include/libusb-1.0
- LDFLAGS+= -shared -L/usr/pkg/lib -lusb-1.0 -Wl,-rpath=/usr/pkg/lib
- +else ifeq ($(UNAME_V),joyent)
- +CFLAGS+= -I/opt/local/include/libusb-1.0
- +LDFLAGS+= -shared -L/opt/local/lib -lusb-1.0 -Wl,-rpath=/opt/local/lib -liconv
- else
- LDFLAGS += -shared -Wl,-soname,$(SHARED_LIB_NAME)
- LIBS += -ludev
- @@ -77,6 +83,8 @@ else ifeq ($(UNAME),FreeBSD)
- SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/libusb
- else ifeq ($(UNAME),NetBSD)
- SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/libusb
- +else ifeq ($(UNAME_V),joyent)
- +SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/libusb
- else
- SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/linux
- endif
- @@ -95,6 +103,8 @@ else ifeq ($(UNAME),FreeBSD)
- hidapi := $(notdir $(wildcard $(top_srcdir)/cpp/hidapi/libusb/*.c))
- else ifeq ($(UNAME),NetBSD)
- hidapi := $(notdir $(wildcard $(top_srcdir)/cpp/hidapi/libusb/*.c))
- +else ifeq ($(UNAME_V),joyent)
- +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
- diff --git a/cpp/examples/MinOZW/Makefile b/cpp/examples/MinOZW/Makefile
- index 8403bd79..b4ad5909 100644
- --- a/cpp/examples/MinOZW/Makefile
- +++ b/cpp/examples/MinOZW/Makefile
- @@ -17,6 +17,9 @@ DEBUG_LDFLAGS := -g
- top_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../../../)
- +# Used to detect SmartOS (variable will be "joyent")
- +UNAME_V := $(shell uname -v 2>/dev/null | sed -e 's/_.*//')
- +
- #where is put the temporary library
- LIBDIR ?= $(top_builddir)
- @@ -55,6 +58,8 @@ endif
- else ifeq ($(UNAME),NetBSD)
- LDFLAGS+= -L/usr/pkg/lib -lusb-1.0
- +else ifeq ($(UNAME_V),joyent)
- +LDFLAGS += -L/opt/local/lib -R/opt/local/lib -lusb-1.0
- endif
- $(OBJDIR)/MinOZW: $(patsubst %.cpp,$(OBJDIR)/%.o,$(minozwsrc))
- diff --git a/cpp/hidapi/libusb/hid.c b/cpp/hidapi/libusb/hid.c
- index c1244253..bea64c05 100644
- --- a/cpp/hidapi/libusb/hid.c
- +++ b/cpp/hidapi/libusb/hid.c
- @@ -369,7 +369,7 @@ static wchar_t *get_usb_string(libusb_device_handle *dev, uint8_t idx)
- inbytes = len-2;
- outptr = (char*) wbuf;
- outbytes = sizeof(wbuf);
- - res = iconv(ic, (const char ** restrict)&inptr, &inbytes, &outptr, &outbytes);
- + res = iconv(ic, (const char **)&inptr, &inbytes, &outptr, &outbytes);
- if (res == (size_t)-1) {
- LOG("iconv() failed\n");
- goto err;
- diff --git a/cpp/src/platform/unix/SerialControllerImpl.cpp b/cpp/src/platform/unix/SerialControllerImpl.cpp
- index d68c73e4..75fd1cf6 100644
- --- a/cpp/src/platform/unix/SerialControllerImpl.cpp
- +++ b/cpp/src/platform/unix/SerialControllerImpl.cpp
- @@ -38,6 +38,15 @@
- #include <libudev.h>
- #endif
- +#ifdef __sun
- +// SunOS doesn't have the cfsetspeed convenience function.
- +int
- +cfsetspeed(struct termios *tios, speed_t speed)
- +{
- + return (cfsetispeed(tios, speed) || cfsetospeed(tios, speed));
- +}
- +#endif
- +
- using namespace OpenZWave;
- //-----------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment