Merge pull request #1318 from JonathonHall-Purism/fix-pkg-config-cross-compilation

Makefile: Fix cross compilation variables for pkg-config
This commit is contained in:
tlaurion 2023-02-22 11:46:36 -05:00 committed by GitHub
commit c4b964c80f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,6 +125,9 @@ heads_cc := $(CROSS)gcc \
-isystem $(INSTALL)/include \
-L$(INSTALL)/lib \
# Cross-compiling with pkg-config requires clearing PKG_CONFIG_PATH and setting
# both PKG_CONFIG_LIBDIR and PKG_CONFIG_SYSROOT_DIR.
# https://autotools.info/pkgconfig/cross-compiling.html
CROSS_TOOLS_NOCC := \
AR="$(CROSS)ar" \
LD="$(CROSS)ld" \
@ -132,7 +135,8 @@ CROSS_TOOLS_NOCC := \
NM="$(CROSS)nm" \
OBJCOPY="$(CROSS)objcopy" \
OBJDUMP="$(CROSS)objdump" \
PKG_CONFIG_PATH="$(INSTALL)/lib/pkgconfig" \
PKG_CONFIG_PATH= \
PKG_CONFIG_LIBDIR="$(INSTALL)/lib/pkgconfig" \
PKG_CONFIG_SYSROOT_DIR="$(INSTALL)" \
CROSS_TOOLS := \