mirror of
https://github.com/owntracks/recorder.git
synced 2024-11-15 18:08:28 -07:00
Automatically detect when -luuid is needed (on Linux with tours enabled)
This is done in a cross-compile-friendly manner with cpp rather than uname. printf is used rather than echo due to inconsistent handling of the -e option across different shells.
This commit is contained in:
parent
5ca1924ace
commit
cac1b95be0
14
Makefile
14
Makefile
@ -23,6 +23,14 @@ CFLAGS += -DGHASHPREC=$(GHASHPREC)
|
||||
LIBS += -llmdb
|
||||
LIBS += -lpthread
|
||||
|
||||
define CPP_CONDITION
|
||||
printf '#if $(1) \n
|
||||
true \n
|
||||
#else \n
|
||||
#error false \n
|
||||
#endif' | $(CPP) -P - >/dev/null 2>&1 && echo yes
|
||||
endef
|
||||
|
||||
ifeq ($(WITH_MQTT),yes)
|
||||
CFLAGS += -DWITH_MQTT=1
|
||||
CFLAGS += $(MOSQUITTO_INC)
|
||||
@ -56,6 +64,12 @@ endif
|
||||
ifeq ($(WITH_TOURS),yes)
|
||||
CFLAGS += -DWITH_TOURS
|
||||
OTR_EXTRA_OBJS +=
|
||||
|
||||
# Debian requires uuid-dev
|
||||
# RHEL/CentOS needs libuuid-devel
|
||||
ifeq ($(shell $(call CPP_CONDITION,__linux__)),yes)
|
||||
LIBS += -luuid
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_GREENWICH),yes)
|
||||
|
@ -40,7 +40,7 @@ WITH_MQTT ?= yes
|
||||
WITH_HTTP ?= yes
|
||||
|
||||
# Do you want recorder support for shared views? Requires WITH_HTTP
|
||||
# also requires -luuid on Linux (see below at MORELIBS)
|
||||
# also requires -luuid on Linux.
|
||||
WITH_TOURS ?= yes
|
||||
|
||||
# Do you have Lua libraries installed and want the Lua hook integration?
|
||||
@ -93,10 +93,6 @@ CONFIGFILE = /etc/default/ot-recorder
|
||||
MOSQUITTO_INC = -I/usr/include
|
||||
MOSQUITTO_LIB = -L/usr/lib
|
||||
|
||||
# Debian requires uuid-dev
|
||||
# RHEL/CentOS needs libuuid-devel
|
||||
MORELIBS += -luuid # -lssl
|
||||
|
||||
# Milliseconds (ms) timeout for reverse geocoding
|
||||
GEOCODE_TIMEOUT = 4000
|
||||
|
||||
|
@ -19,7 +19,6 @@ GHASHPREC = 7
|
||||
JSON_INDENT ?= no
|
||||
MOSQUITTO_INC = -I/usr/include
|
||||
MOSQUITTO_LIB = -L/usr/lib
|
||||
MORELIBS = -luuid # -lssl
|
||||
LUA_CFLAGS = `pkg-config --cflags lua`
|
||||
LUA_LIBS = `pkg-config --libs lua`
|
||||
|
||||
|
@ -19,7 +19,6 @@ GHASHPREC = 7
|
||||
JSON_INDENT ?= no
|
||||
MOSQUITTO_INC = -I/usr/include
|
||||
MOSQUITTO_LIB = -L/usr/lib
|
||||
MORELIBS = -luuid # -lssl
|
||||
LUA_CFLAGS = `pkg-config --cflags lua`
|
||||
LUA_LIBS = `pkg-config --libs lua`
|
||||
SODIUM_CFLAGS = `pkg-config --cflags libsodium`
|
||||
|
@ -20,7 +20,6 @@ GHASHPREC = 7
|
||||
JSON_INDENT ?= no
|
||||
MOSQUITTO_INC = -I/usr/include
|
||||
MOSQUITTO_LIB = -L/usr/lib
|
||||
MORELIBS = -luuid # -lssl
|
||||
|
||||
LUA_CFLAGS = `pkg-config --cflags lua`
|
||||
LUA_LIBS = `pkg-config --libs lua`
|
||||
|
Loading…
Reference in New Issue
Block a user