From 8a4023b3152a55fcf0dcea26fe3d455fc99e3eae Mon Sep 17 00:00:00 2001 From: Timo Gurr Date: Thu, 14 Dec 2017 15:20:38 +0100 Subject: use env var ${PKG_CONFIG} instead of hard coding pkg-config This allows building in cross environments e.g. using host triplet prefixed binaries (x86_64-pc-linux-gnu-pkg-config). --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c52bf06..c7b516a 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,9 @@ prefix = /usr CFLAGS ?= -g -O2 -PERL = perl -INSTALL = install +PKG_CONFIG ?= pkg-config +PERL ?= perl +INSTALL ?= install whois_OBJECTS := whois.o utils.o mkpasswd_OBJECTS := mkpasswd.o utils.o @@ -32,12 +33,12 @@ ifdef LOCALEDIR DEFS += -DLOCALEDIR=\"$(BASEDIR)$(prefix)/share/locale\" endif -ifeq ($(shell pkg-config --exists 'libidn2 >= 2.0.3' || echo NO),) -whois_LDADD += $(shell pkg-config --libs libidn2) -DEFS += -DHAVE_LIBIDN2 $(shell pkg-config --cflags libidn2) -else ifeq ($(shell pkg-config --exists 'libidn' || echo NO),) -whois_LDADD += $(shell pkg-config --libs libidn) -DEFS += -DHAVE_LIBIDN $(shell pkg-config --cflags libidn) +ifeq ($(shell $(PKG_CONFIG) --exists 'libidn2 >= 2.0.3' || echo NO),) +whois_LDADD += $(shell $(PKG_CONFIG) --libs libidn2) +DEFS += -DHAVE_LIBIDN2 $(shell $(PKG_CONFIG) --cflags libidn2) +else ifeq ($(shell $(PKG_CONFIG) --exists 'libidn' || echo NO),) +whois_LDADD += $(shell $(PKG_CONFIG) --libs libidn) +DEFS += -DHAVE_LIBIDN $(shell $(PKG_CONFIG) --cflags libidn) endif ifdef HAVE_ICONV -- cgit v1.2.3