Skip to content

fix the issue that compile gpsd failure on smartos / illumos #79

@tozhu

Description

@tozhu
  1. problem: compile gpsd failed on latest trunk build log is here:
    https://us-east.manta.joyent.com/pkgsrc/public/reports/upstream-trunk/20201223.2252/gpsd-3.21nb1/build.log

  2. the problem is 'cfmakeraw' missed some option cause. the fix is here:


-> cat distinfo
$NetBSD: distinfo,v 1.26 2020/08/18 17:37:48 gdt Exp $
 
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


-> cat patches/patch-serial.c
--- 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);


-> cat patches/gpsd.h
cat: cannot open patches/gpsd.h: No such file or directory
--<root@3df9235f-6db9-e525-b759-cc68ad7a8ade>-(/data/chroot/dev-trunk-x86_64)-</data/pkgsrc/geography/gpsd>--
-> cat patches/patch-gpsd.h
--- 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.


-> cat patches/patch-serial.c
--- 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);

  1. following is the testing log screen dump
    https://pastebin.com/qWzjjUEA

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions