From a2cc3dd19a5722db649432ec83059294a1a13879 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Sun, 16 Jan 2022 11:10:36 +0000 Subject: [PATCH] Makefile: Specify `pkg-config` via a variable. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In cross-build situations this allows for `«triplet»-pkg-config` to be passed in so that target libraries are used instead of host ones. Unless `PKG_CONFIG` is overridden by the person doing the build then there is no semantic change. Signed-off-by: Ian Campbell --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a4fa649..d4676de 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,8 @@ endif DEFAULT_CFLAGS += -Iinclude/ +PKG_CONFIG ?= pkg-config + # Tools useful on host and target TOOLS = sunxi-fexc sunxi-bootinfo sunxi-fel sunxi-nand-part sunxi-pio @@ -116,12 +118,12 @@ sunxi-fexc: fexc.h script.h script.c \ script_fex.h script_fex.c LIBUSB = libusb-1.0 -LIBUSB_CFLAGS ?= `pkg-config --cflags $(LIBUSB)` -LIBUSB_LIBS ?= `pkg-config --libs $(LIBUSB)` +LIBUSB_CFLAGS ?= `$(PKG_CONFIG) --cflags $(LIBUSB)` +LIBUSB_LIBS ?= `$(PKG_CONFIG) --libs $(LIBUSB)` ZLIB = zlib -ZLIB_CFLAGS ?= `pkg-config --cflags $(ZLIB)` -ZLIB_LIBS ?= `pkg-config --libs $(ZLIB)` +ZLIB_CFLAGS ?= `$(PKG_CONFIG) --cflags $(ZLIB)` +ZLIB_LIBS ?= `$(PKG_CONFIG) --libs $(ZLIB)` ifeq ($(OS),Windows_NT) # Windows lacks mman.h / mmap()