gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-users] FreeBSD and sys/timepps.h


From: O'Connor, Daniel
Subject: Re: [gpsd-users] FreeBSD and sys/timepps.h
Date: Tue, 13 Jan 2015 11:36:25 +1030

> On 10 Jan 2015, at 00:49, Greg Troxel <address@hidden> wrote:
> "O'Connor, Daniel" <address@hidden> writes:
>>> I think it's best to avoid os-specific kludges.  It would be far better
>>> to make scons do the right thing, perhaps by checking for sys/types
>>> earlier.   I wouldn't be surprised if it's ok to always include
>>> sys/types.h before sys/timepps.h, on all platforms.
>> 
>> I couldn't find a way to do it with scons :(
> 
> I actually looked, and found that:
> 
>  1) on NetBSD, one needs sys/time.h before sys/timepps.h
> 
>  2) SConstruct seems to deal with this as the test:
> 
>    if config.CheckHeader(["sys/time.h", "sys/timepps.h"]):
>        confdefs.append("#define HAVE_SYS_TIMEPPS_H 1\n")
>        kpps = True
> 
>    So, there seems to be a mechanism to check a string of headers, at
>    least two.

Oh I didn't see that - I only looked at the tar ball for 3.9 not git.

The following works on FreeBSD and Linux
if env['pps'] and env['ntpshm'] and config.CheckHeader(["sys/types.h", 
"sys/time.h", "sys/timepps.h"]):

I expect it would work on NetBSD but I don't have an install to test with.

>>> You will find that pps won't work once you get past this, though,
>>> because the current code assumes the Linux flavor of PPS (not the
>>> IETF-specificed one) is always present.  (It will build, because I fixed
>>> the ifdefs, but the logic is still wrong.)   There are comments in the
>>> file about this.
>> 
>> OK, turns out FreeBSD kernel PPS isn't enabled in the USB UART code anyway :)
> 
> It's not just that.  It's also the gpsd code.
> 
> To get PPS working over usb serial, apply this patch (of course it won't
> apply, but it's a clue):
> 
> http://mail-index.netbsd.org/source-changes/2014/07/25/msg056749.html

Yeah, I was looking at adding something like that - the PPS interface seems 
pretty trivial.

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C




reply via email to

[Prev in Thread] Current Thread [Next in Thread]