Skip to content

Commit

Permalink
fix build issue for SmartOS, the testing log is here: NetBSD#79
Browse files Browse the repository at this point in the history
  • Loading branch information
tozhu committed Dec 29, 2020
1 parent 7c0c153 commit fb05ed5
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
3 changes: 3 additions & 0 deletions geography/gpsd/distinfo
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ SHA1 (gpsd-3.21.tar.gz) = f32d7b18c7be98c4a1385af789b61be55a64c433
RMD160 (gpsd-3.21.tar.gz) = 3c521009854e2ae19bcd4f7fb0f0c33c334bcbc5
SHA512 (gpsd-3.21.tar.gz) = 7fbff3698a44ef24ce4631f1d0c5192b70c2e47f28e61372d8d0c437a6b4aeee459b08dcd69d9dc02bbda7b56949fd01ac57460fb922b5f807455f4ab3e91f2d
Size (gpsd-3.21.tar.gz) = 3984157 bytes
SHA1 (patch-serial.c) = 2f947976a7df43789c9d06d2f6b3f6c652f36aa0
SHA1 (patch-gpsd.h) = 140862d581fa1c605254063011bca13861910af4
SHA1 (patch-gpspipe.c) = 59b897d1642365612833924a74bf82c251beeadf
11 changes: 11 additions & 0 deletions geography/gpsd/patches/patch-gpsd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- gpsd.h-orig Tue Dec 29 05:25:00 2020
+++ gpsd.h Tue Dec 29 05:25:50 2020
@@ -1077,7 +1077,7 @@
#define NAN (0.0f/0.0f)
#endif

-#if !defined(HAVE_CFMAKERAW)
+#if !defined(HAVE_CFMAKERAW) || defined(__sun)
/*
* POSIX does not specify cfmakeraw, but it is pretty common. We
* provide an implementation in serial.c for systems that lack it.
17 changes: 17 additions & 0 deletions geography/gpsd/patches/patch-gpspipe.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- gpspipe.c-orig Tue Dec 29 05:30:39 2020
+++ gpspipe.c Tue Dec 29 05:32:35 2020
@@ -85,7 +85,15 @@
memset(&newtio, 0, 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 */
(void)cfsetospeed(&newtio, BAUDRATE);
20 changes: 20 additions & 0 deletions geography/gpsd/patches/patch-serial.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- serial.c-orig Tue Dec 29 05:16:05 2020
+++ serial.c Tue Dec 29 05:17:32 2020
@@ -178,7 +178,7 @@
session->reawake = (time_t)0;
}

-#if !defined(HAVE_CFMAKERAW)
+#if !defined(HAVE_CFMAKERAW) || defined(__sun)
/*
* Local implementation of cfmakeraw (which is not specified by
* POSIX; see matching declaration in gpsd.h).
@@ -187,7 +187,7 @@
void cfmakeraw(struct termios *termios_p)
{
termios_p->c_iflag &=
- ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
+ ~(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
termios_p->c_oflag &= ~OPOST;
termios_p->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
termios_p->c_cflag &= ~(CSIZE | PARENB);

0 comments on commit fb05ed5

Please sign in to comment.