Skip to content

Commit

Permalink
Merge pull request #130 from n-peugnet/fix-libgps-3.24
Browse files Browse the repository at this point in the history
Fix build with libgps <= 3.24 using pkg-config
  • Loading branch information
mathiashro authored Oct 5, 2024
2 parents d72be9a + 60dbf0b commit d741726
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ BISON ?= bison
FLEX ?= flex
LDCONFIG ?= /sbin/ldconfig
TAGCMD ?= etags
PKG_CONFIG ?= pkg-config

# target directories and names
DESTDIR ?=
Expand Down
3 changes: 3 additions & 0 deletions lib/pud/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ include $(TOPDIR)/Makefile.inc
PUD_NMEALIB_STATICALLY_LINKED ?=
CFLAGS += -D_GNU_SOURCE

LIBGPS_VERSION := $(shell $(PKG_CONFIG) --modversion libgps)
CFLAGS += -DLIBGPS_VERSION_MAJOR=$(word 1,$(subst ., ,$(LIBGPS_VERSION)))
CFLAGS += -DLIBGPS_VERSION_MINOR=$(word 2,$(subst ., ,$(LIBGPS_VERSION)))

RESOURCESDIR = ./resources
NMEALIB_LIB = $(NMEALIB_PATH)/lib
Expand Down
14 changes: 14 additions & 0 deletions lib/pud/src/gpsdclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ struct GpsdConnectionState {
struct devconfig_t dev[MAXUSERDEVS];
};

/**
* describe a data source
*
* Starting with gpsd 3.25, this is now provided in gps.h.
*/
#if LIBGPS_VERSION_MAJOR <= 3 && LIBGPS_VERSION_MINOR <= 24
struct fixsource_t {
char spec[PATH_MAX]; /* working space, will be modified */
char *server; /* pointer into spec field */
char *port; /* pointer into spec field */
char *device; /* pointer into spec field */
};
#endif

/**
* The gpsd daemon spec
*/
Expand Down

0 comments on commit d741726

Please sign in to comment.