diff --git a/Makefile b/Makefile index f84bc3e..e1e9a46 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,8 @@ else else ifneq ($(filter $(UNAME_S),FreeBSD DragonFly),) OS_CFLAGS = -pthread OS_LIBS = -lpthread + else ifneq ($(filter $(UNAME_S),SunOS),) + OS_LIBS = -lpthread -ldl -lresolv -lsocket -lnsl else OS_LIBS = -lpthread -ldl endif diff --git a/transport/rf2500.c b/transport/rf2500.c index 6da9bf5..281cf2f 100644 --- a/transport/rf2500.c +++ b/transport/rf2500.c @@ -192,7 +192,7 @@ static int usbtr_flush(transport_t tr_base) { struct rf2500_transport *tr = (struct rf2500_transport *)tr_base; -#ifndef __APPLE__ +#if !defined(__APPLE__) && !defined(__sun__) char buf[64]; /* Flush out lingering data. diff --git a/util/sport.c b/util/sport.c index a474591..0c90a13 100644 --- a/util/sport.c +++ b/util/sport.c @@ -122,7 +122,17 @@ sport_t sport_open(const char *device, int rate, int flags) return -1; tcgetattr(fd, &attr); + +#ifdef __sun__ + attr.c_iflag &= ~(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | + INLCR | IGNCR | ICRNL | IXON); + attr.c_oflag &= ~OPOST; + attr.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); + attr.c_cflag &= ~(CSIZE | PARENB); + attr.c_cflag |= CS8; +#else cfmakeraw(&attr); +#endif if (rate_code >= 0) { cfsetispeed(&attr, rate_code);