diff --git a/Makefile b/Makefile index 97f21639..a2c13a33 100644 --- a/Makefile +++ b/Makefile @@ -285,7 +285,17 @@ bin_path=$(shell which $(1) 2> /dev/null) # set PKG_CONFIG_PATH or PKG_CONFIG to influence this, e.g. # PKG_CONFIG_PATH=/opt/cross/i386-mingw32msvc/lib/pkgconfig or # PKG_CONFIG=arm-linux-gnueabihf-pkg-config -PKG_CONFIG ?= pkg-config +ifeq ($(CROSS_COMPILING),0) + PKG_CONFIG ?= pkg-config +else +ifneq ($(PKG_CONFIG_PATH),) + PKG_CONFIG ?= pkg-config +else + # Don't use host pkg-config when cross-compiling. + # (unknown-pkg-config is meant to be a non-existant command.) + PKG_CONFIG ?= unknown-pkg-config +endif +endif ifneq ($(call bin_path, $(PKG_CONFIG)),) CURL_CFLAGS ?= $(shell $(PKG_CONFIG) --silence-errors --cflags libcurl) @@ -1360,6 +1370,7 @@ targets: makedirs @echo " COMPILE_PLATFORM: $(COMPILE_PLATFORM)" @echo " COMPILE_ARCH: $(COMPILE_ARCH)" @echo " HAVE_VM_COMPILED: $(HAVE_VM_COMPILED)" + @echo " PKG_CONFIG: $(PKG_CONFIG)" @echo " CC: $(CC)" ifeq ($(PLATFORM),mingw32) @echo " WINDRES: $(WINDRES)"