Respect PKG_CONFIG variable when building

This is particularly useful in cross-compile situations, where a wrapper
around pkg-config is sometimes needed.
This commit is contained in:
James Le Cuirot 2022-09-22 21:37:41 +01:00
parent b812365d1a
commit 5ca1924ace
No known key found for this signature in database
GPG Key ID: 1226415D00DD3137
2 changed files with 6 additions and 4 deletions

View File

@ -77,6 +77,8 @@ TARGETS += ot-recorder ocat
GIT_VERSION := $(shell git describe --long --abbrev=10 --dirty --tags 2>/dev/null || echo "tarball")
CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
PKG_CONFIG ?= pkg-config
all: $(TARGETS)
ot-recorder: recorder.o $(OTR_OBJS) $(OTR_EXTRA_OBJS)

View File

@ -105,8 +105,8 @@ GEOCODE_TIMEOUT = 4000
# and in particular could require you to add the lua+version (e.g lua-5.2)
# to both pkg-config invocations
LUA_CFLAGS = `pkg-config --cflags lua`
LUA_LIBS = `pkg-config --libs lua`
LUA_CFLAGS = `$(PKG_CONFIG) --cflags lua`
LUA_LIBS = `$(PKG_CONFIG) --libs lua`
SODIUM_CFLAGS = `pkg-config --cflags libsodium`
SODIUM_LIBS = `pkg-config --libs libsodium`
SODIUM_CFLAGS = `$(PKG_CONFIG) --cflags libsodium`
SODIUM_LIBS = `$(PKG_CONFIG) --libs libsodium`