From 1d452fe1ab89bf9466d64f7a40640bd730eac6ef Mon Sep 17 00:00:00 2001 From: wb2osz Date: Sun, 15 Jan 2023 21:55:08 +0000 Subject: [PATCH] Tested compatibility with gpsd 3.25. --- src/dwgpsd.c | 49 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/src/dwgpsd.c b/src/dwgpsd.c index f8357ea..ae3a711 100644 --- a/src/dwgpsd.c +++ b/src/dwgpsd.c @@ -57,18 +57,35 @@ -// An incompatibility was introduced with version 7 -// and again with 9 and again with 10. +// An API incompatibility was introduced with API version 7. +// and again with 9. +// and again with 10. +// We deal with it by using a bunch of conditional code such as: +// #if GPSD_API_MAJOR_VERSION >= 9 -// release lib version API Raspberry Pi OS -// 3.22 28 11 bullseye -// 3.23 29 12 -// 3.24 14 Not tested yet. -#if GPSD_API_MAJOR_VERSION < 5 || GPSD_API_MAJOR_VERSION > 12 -#error libgps API version might be incompatible. +// release lib version API Raspberry Pi OS Testing status +// 3.22 28 11 bullseye OK. +// 3.23 29 12 OK. +// 3.25 30 14 OK, Jan. 2023 + +// Previously the compilation would fail if the API version was later +// than the last one tested. Now it is just a warning because it changes so +// often but more recent versions have not broken backward compatibility. + +#define MAX_TESTED_VERSION 14 + +#if (GPSD_API_MAJOR_VERSION < 5) || (GPSD_API_MAJOR_VERSION > MAX_TESTED_VERSION) +#pragma message "Your version of gpsd might be incompatible with this application." +#pragma message "The libgps application program interface (API) often" +#pragma message "changes to be incompatible with earlier versions." +// I could not figure out how to do value substitution here. +#pragma message "You have libgpsd API version GPSD_API_MAJOR_VERSION." +#pragma message "The last that has been tested is MAX_TESTED_VERSION." +#pragma message "Even if this builds successfully, it might not run properly." #endif + /* * Information for interface to gpsd daemon. */ @@ -168,6 +185,22 @@ static void * read_gpsd_thread (void *arg); * can't find it there. Solution is to define environment variable: * * export LD_LIBRARY_PATH=/use/local/lib + * + * January 2023: Now using 64 bit Raspberry Pi OS, bullseye. + * See https://gitlab.com/gpsd/gpsd/-/blob/master/build.adoc + * Try to install in proper library place so we don't have to mess with LD_LIBRARY_PATH. + * + * (Remove any existing gpsd first so we are not mixing mismatched pieces.) + * + * sudo apt-get install libncurses5-dev + * sudo apt-get install gtk+-3.0 + * + * git clone https://gitlab.com/gpsd/gpsd.git gpsd-gitlab + * cd gpsd-gitlab + * scons prefix=/usr libdir=lib/aarch64-linux-gnu + * [ scons check ] + * sudo scons udev-install + * */