From 0439a9e667e90264d976a36291e2713998758da7 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Thu, 22 Sep 2022 22:45:26 +0100 Subject: [PATCH] Use Mosquitto's pkg-config file It has provided one since version 1.5. It erroneously hardcodes the libdir as "lib" (it may be lib64), but OwnTracks defaulted to "lib" anyway. I will fix Mosquitto shortly. --- Makefile | 4 ++-- config.mk.in | 4 ++-- etc/centos/config.mk.in | 4 ++-- etc/debian/config.mk.in | 4 ++-- etc/raspbian/config.mk.in | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 9a1612c..28ab45b 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,8 @@ endef ifeq ($(WITH_MQTT),yes) CFLAGS += -DWITH_MQTT=1 - CFLAGS += $(MOSQUITTO_INC) - LIBS += $(MOSQUITTO_LIB) -lmosquitto -lm + CFLAGS += $(MOSQUITTO_CFLAGS) + LIBS += $(MOSQUITTO_LIBS) -lm endif ifeq ($(WITH_PING),yes) diff --git a/config.mk.in b/config.mk.in index cba2d10..9def768 100644 --- a/config.mk.in +++ b/config.mk.in @@ -90,8 +90,8 @@ JSON_INDENT ?= no CONFIGFILE = /etc/default/ot-recorder # Optionally specify the path to the Mosquitto libs, include here -MOSQUITTO_INC = -I/usr/include -MOSQUITTO_LIB = -L/usr/lib +MOSQUITTO_CFLAGS = `$(PKG_CONFIG) --cflags libmosquitto` +MOSQUITTO_LIBS = `$(PKG_CONFIG) --libs libmosquitto` # Milliseconds (ms) timeout for reverse geocoding GEOCODE_TIMEOUT = 4000 diff --git a/etc/centos/config.mk.in b/etc/centos/config.mk.in index b224bf3..61da631 100644 --- a/etc/centos/config.mk.in +++ b/etc/centos/config.mk.in @@ -17,8 +17,8 @@ STORAGEDEFAULT = /var/spool/owntracks/recorder/store DOCROOT = /var/spool/owntracks/recorder/htdocs GHASHPREC = 7 JSON_INDENT ?= no -MOSQUITTO_INC = -I/usr/include -MOSQUITTO_LIB = -L/usr/lib +MOSQUITTO_CFLAGS = +MOSQUITTO_LIBS = -lmosquitto LUA_CFLAGS = `pkg-config --cflags lua` LUA_LIBS = `pkg-config --libs lua` diff --git a/etc/debian/config.mk.in b/etc/debian/config.mk.in index 4cd128a..4bceabf 100644 --- a/etc/debian/config.mk.in +++ b/etc/debian/config.mk.in @@ -17,8 +17,8 @@ STORAGEDEFAULT = /var/spool/owntracks/recorder/store DOCROOT = /usr/share/owntracks/recorder/htdocs GHASHPREC = 7 JSON_INDENT ?= no -MOSQUITTO_INC = -I/usr/include -MOSQUITTO_LIB = -L/usr/lib +MOSQUITTO_CFLAGS = +MOSQUITTO_LIBS = -lmosquitto LUA_CFLAGS = `pkg-config --cflags lua` LUA_LIBS = `pkg-config --libs lua` SODIUM_CFLAGS = `pkg-config --cflags libsodium` diff --git a/etc/raspbian/config.mk.in b/etc/raspbian/config.mk.in index dd9926c..ebf3fd2 100644 --- a/etc/raspbian/config.mk.in +++ b/etc/raspbian/config.mk.in @@ -18,8 +18,8 @@ STORAGEDEFAULT = /var/spool/owntracks/recorder/store DOCROOT = /usr/share/owntracks/recorder/htdocs GHASHPREC = 7 JSON_INDENT ?= no -MOSQUITTO_INC = -I/usr/include -MOSQUITTO_LIB = -L/usr/lib +MOSQUITTO_CFLAGS = +MOSQUITTO_LIBS = -lmosquitto LUA_CFLAGS = `pkg-config --cflags lua` LUA_LIBS = `pkg-config --libs lua`