Browse Source

Don't use host pkg-config when cross-compiling

Fix cross-compiling using mingw-w64 on Ubuntu 18.04.

pkg-config --cflags libcurl is now pulling in a Linux include directory
which breaks compiling.
pull/38/head
Zack Middleton sanecz 1 year ago
parent
commit
1330320258
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      Makefile

+ 12
- 1
Makefile View File

@@ -264,7 +264,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)
@@ -1264,6 +1274,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)"


Loading…
Cancel
Save