build-style/meson: update for new env var behaviour

meson 0.54 now honors _FOR_BUILD env vars, and we don't have to set CC
and friends to the host system vars. Setting PKG_CONFIG_FOR_BUILD is
needed since otherwise it would pickup our cross wrapper
This commit is contained in:
John 2020-03-31 15:53:48 +02:00
parent a22f3ab06c
commit f4d315aaa8
No known key found for this signature in database
GPG Key ID: 5FDE97AF468A09B7
1 changed files with 1 additions and 16 deletions

View File

@ -85,22 +85,7 @@ do_configure() {
if [ "$CROSS_BUILD" ]; then
configure_args+=" --cross-file=${meson_crossfile}"
# Meson tries to compile natively with CC, CXX, LD, AR
# so when cross compiling, we need to set those to the
# host versions.
export CC=${CC_host} CXX=${CXX_host} LD=${LD_host} AR=${AR_host}
# Meson tries to use CFLAGS, CXXFLAGS, CPPFLAGS and LDFLAGS when compiling under
# native: true, so we use XBPS_CFLAGS, XBPS_CXXFLAGS, XBPS_CPPFLAGS and XBPS_LDFLAGS
# which are set to (C|CXX|CPP|LD)FLAGS_host
export CFLAGS=${CFLAGS_host} CXXFLAGS=${CXXFLAGS_host} CPPFLAGS=${CPPFLAGS_host} LDFLAGS=${LDFLAGS_host}
# Meson tries to use our wrapped cross-only pkg-config to find
# libraries even when 'native: true' (build against the host platform)
# is set, so set the PKG_CONFIG variable to tell Meson which pkg-config
# it should use when searching for stuff in the build machine
export PKG_CONFIG="/usr/bin/pkg-config"
export PKG_CONFIG_FOR_BUILD="/usr/bin/pkg-config"
fi
${meson_cmd} \