Merge pull request #588 from marckleinebudde/makefile-detect-libgps

Makefile: rely on pkg-config to detect presence of libgps
pull/591/head
Marc Kleine-Budde 2025-03-03 13:24:18 +01:00 committed by GitHub
commit 31a59be02f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -46,6 +46,7 @@ MAKEFLAGS := -k
CFLAGS := -O2 -Wall -Wno-parentheses -Wsign-compare
HAVE_FORK := $(shell ./check_cc.sh "$(CC)" fork_test.c)
HAVE_LIBGPS := $(shell test -x "`which pkg-config`" && pkg-config --exists libgps && echo 1 || echo 0)
CPPFLAGS += \
-I. \
@ -67,8 +68,10 @@ PROGRAMS_J1939_TIMEDATE := \
j1939-timedate-srv \
j1939-timedate-cli
ifeq ($(HAVE_LIBGPS),1)
PROGRAMS_J1939_VEHICLE_POSITION := \
j1939-vehicle-position-srv
endif
PROGRAMS_ISOBUSFS := \
isobusfs-srv \
@ -194,7 +197,7 @@ j1939-vehicle-position-srv: \
lib.o \
libj1939.o \
j1939_vehicle_position/j1939_vehicle_position_srv.o
$(CC) $(LDFLAGS) $^ $(LDLIBS) -lgps -o $@
$(CC) $(LDFLAGS) $^ $(LDLIBS) $(shell pkg-config --libs libgps) -o $@
isobusfs-srv: lib.o \
libj1939.o \