From b3176535f0042090a454f22991d0ccacae238786 Mon Sep 17 00:00:00 2001 From: jperkin Date: Tue, 10 Dec 2013 12:22:52 +0000 Subject: Various patches to fix SunOS build, from Sebastian Wiedenroth. --- geography/gpsd/Makefile | 6 ++++-- geography/gpsd/distinfo | 5 ++++- geography/gpsd/patches/patch-gpsd.h-tail | 15 +++++++++++++++ geography/gpsd/patches/patch-gpspipe.c | 22 ++++++++++++++++++++++ geography/gpsd/patches/patch-serial.c | 15 +++++++++++++++ 5 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 geography/gpsd/patches/patch-gpsd.h-tail create mode 100644 geography/gpsd/patches/patch-gpspipe.c create mode 100644 geography/gpsd/patches/patch-serial.c diff --git a/geography/gpsd/Makefile b/geography/gpsd/Makefile index dad71b4fdb5..d72a11c661f 100644 --- a/geography/gpsd/Makefile +++ b/geography/gpsd/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.24 2013/04/06 19:42:42 rodent Exp $ +# $NetBSD: Makefile,v 1.25 2013/12/10 12:22:52 jperkin Exp $ DISTNAME= gpsd-2.96 PKGREVISION= 1 @@ -20,9 +20,11 @@ PY_PATCHPLIST= yes USE_TOOLS+= gmake USE_LIBTOOL= yes -USE_LANGUAGES= c c++ +USE_LANGUAGES= c99 c++ USE_NCURSES= yes +CFLAGS.SunOS= -DLOG_PERROR=0 + INSTALLATION_DIRS= sbin TEST_TARGET= check diff --git a/geography/gpsd/distinfo b/geography/gpsd/distinfo index 26e0402d9a1..25e9756e092 100644 --- a/geography/gpsd/distinfo +++ b/geography/gpsd/distinfo @@ -1,6 +1,9 @@ -$NetBSD: distinfo,v 1.20 2011/03/23 16:08:34 gdt Exp $ +$NetBSD: distinfo,v 1.21 2013/12/10 12:22:52 jperkin Exp $ SHA1 (gpsd-2.96.tar.gz) = a3674940e3325ccc1dc6d2890eb18d31a978425c RMD160 (gpsd-2.96.tar.gz) = cb37dc7811f8e7880a091fe7bec69a38efa4fda9 Size (gpsd-2.96.tar.gz) = 1554607 bytes SHA1 (patch-aa) = b77bd7491ee890fc66f807cbfe4c6d62423d67d5 +SHA1 (patch-gpsd.h-tail) = 00e60adb91758777ded2e8874e997990b7bc65a2 +SHA1 (patch-gpspipe.c) = 6ce6a212dd08abb563d5e88410dab92869e249c8 +SHA1 (patch-serial.c) = e6fb2be909efcb55fbdbbfa8a799a6dc79b6c99d diff --git a/geography/gpsd/patches/patch-gpsd.h-tail b/geography/gpsd/patches/patch-gpsd.h-tail new file mode 100644 index 00000000000..d31bb66d530 --- /dev/null +++ b/geography/gpsd/patches/patch-gpsd.h-tail @@ -0,0 +1,15 @@ +$NetBSD: patch-gpsd.h-tail,v 1.1 2013/12/10 12:22:52 jperkin Exp $ + +Need cfmakeraw on SunOS. + +--- gpsd.h-tail.orig 2011-03-21 22:03:35.000000000 +0000 ++++ gpsd.h-tail +@@ -758,7 +758,7 @@ extern struct tm *localtime_r(const time + #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0])) + + /* Cygwin, in addition to NAN, doesn't have cfmakeraw */ +-#if defined(__CYGWIN__) ++#if defined(__CYGWIN__) || defined(__sun) + void cfmakeraw(struct termios *); + #endif /* defined(__CYGWIN__) */ + diff --git a/geography/gpsd/patches/patch-gpspipe.c b/geography/gpsd/patches/patch-gpspipe.c new file mode 100644 index 00000000000..c99ee9b5168 --- /dev/null +++ b/geography/gpsd/patches/patch-gpspipe.c @@ -0,0 +1,22 @@ +$NetBSD: patch-gpspipe.c,v 1.1 2013/12/10 12:22:52 jperkin Exp $ + +cfmakeraw compatability for SunOS. + +--- gpspipe.c.orig 2011-01-13 13:36:18.000000000 +0000 ++++ gpspipe.c +@@ -77,7 +77,15 @@ static void open_serial(char *device) + /*@i@*/ bzero(&newtio, sizeof(newtio)); + + /* make it raw */ ++#if defined(__sun) ++ newtio.c_iflag &= ~(IMAXBEL|IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); ++ newtio.c_oflag &= ~OPOST; ++ newtio.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); ++ newtio.c_cflag &= ~(CSIZE|PARENB); ++ newtio.c_cflag |= CS8; ++#else + (void)cfmakeraw(&newtio); ++#endif + /* set speed */ + /*@i@*/ (void)cfsetospeed(&newtio, BAUDRATE); + diff --git a/geography/gpsd/patches/patch-serial.c b/geography/gpsd/patches/patch-serial.c new file mode 100644 index 00000000000..2e4d236d454 --- /dev/null +++ b/geography/gpsd/patches/patch-serial.c @@ -0,0 +1,15 @@ +$NetBSD: patch-serial.c,v 1.1 2013/12/10 12:22:52 jperkin Exp $ + +Need cfmakeraw on SunOS. + +--- serial.c.orig 2011-03-15 03:34:32.000000000 +0000 ++++ serial.c +@@ -125,7 +125,7 @@ void gpsd_tty_init(struct gps_device_t * + session->reawake = (timestamp_t)0; + } + +-#if defined(__CYGWIN__) ++#if defined(__CYGWIN__) || defined(__sun) + /* Workaround for Cygwin, which is missing cfmakeraw */ + /* Pasted from man page; added in serial.c arbitrarily */ + void cfmakeraw(struct termios *termios_p) -- cgit v1.2.3