From fd6bd4839d2316bd74903d2fa2a3eeb58b4fec1d Mon Sep 17 00:00:00 2001 From: Johann Friedrichs Date: Fri, 29 Jan 2021 11:53:00 +0100 Subject: Make the call to pkg_config configurable via the PKG_CONFIG macro --- Makefile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a6837b9..0fe780c 100644 --- a/Makefile +++ b/Makefile @@ -63,8 +63,11 @@ VERSION = $(shell grep 'static const char VERSION\[\] *=' $(PLUGIN).c | awk '{ p ### The directory environment: # Use package data if installed...otherwise assume we're under the VDR source directory: -#PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) -PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell PKG_CONFIG_PATH="$$PKG_CONFIG_PATH:../../.." pkg-config --variable=$(1) vdr)) + +PKG_CONFIG ?= pkg-config + +#PKGCFG = $(if $(VDRDIR),$(shell $(PKG_CONFIG) --variable=$(1) $(VDRDIR)/vdr.pc),$(shell $(PKG_CONFIG) --variable=$(1) vdr || $(PKG_CONFIG) --variable=$(1) ../../../vdr.pc)) +PKGCFG = $(if $(VDRDIR),$(shell $(PKG_CONFIG) --variable=$(1) $(VDRDIR)/vdr.pc),$(shell PKG_CONFIG_PATH="$$PKG_CONFIG_PATH:../../.." $(PKG_CONFIG) --variable=$(1) vdr)) LIBDIR = $(call PKGCFG,libdir) LOCDIR = $(call PKGCFG,locdir) @@ -84,9 +87,9 @@ export CXXFLAGS = $(call PKGCFG,cxxflags) ### configuring modules ifeq ($(AUTOCONFIG),1) - ifeq (exists, $(shell pkg-config libpcre && echo exists)) + ifeq (exists, $(shell $(PKG_CONFIG) libpcre && echo exists)) REGEXLIB = pcre - else ifeq (exists, $(shell pkg-config tre && echo exists)) + else ifeq (exists, $(shell $(PKG_CONFIG) tre && echo exists)) REGEXLIB = tre endif ifeq (exists, $(shell test -e ../pin && echo exists)) @@ -140,10 +143,10 @@ LIBS += $(shell pcre-config --libs-posix) INCLUDE += $(shell pcre-config --cflags) DEFINES += -DHAVE_PCREPOSIX else ifeq ($(REGEXLIB), tre) -LIBS += -L$(shell pkg-config --variable=libdir tre) $(shell pkg-config --libs tre) +LIBS += -L$(shell $(PKG_CONFIG) --variable=libdir tre) $(shell $(PKG_CONFIG) --libs tre) #LIBS += -L/usr/lib -ltre DEFINES += -DHAVE_LIBTRE -INCLUDE += $(shell pkg-config --cflags tre) +INCLUDE += $(shell $(PKG_CONFIG) --cflags tre) endif ifdef USE_PINPLUGIN -- cgit v1.2.3