cat > "${T}/meson.${CHOST}" <<-EOF
[binaries]
- ar = '${AR}'
- c = '${CC}'
- cpp = '${CXX}'
- pkgconfig = '${PKG_CONFIG}'
- strip = '${STRIP}'
+ ar = '$(tc-getAR)'
+ c = '$(tc-getCC)'
+ cpp = '$(tc-getCXX)'
+ pkgconfig = '$(tc-getPKG_CONFIG)'
+ strip = '$(tc-getSTRIP)'
[properties]
c_args = $(_meson_env_array "${CFLAGS}")
--wrap-mode nodownload
)
- # Both meson(1) and _meson_create_cross_file need these
- local -x AR=$(tc-getAR)
- local -x CC=$(tc-getCC)
- local -x CXX=$(tc-getCXX)
- local -x PKG_CONFIG=$(tc-getPKG_CONFIG)
- local -x STRIP=$(tc-getSTRIP)
-
if tc-is-cross-compiler; then
_meson_create_cross_file || die "unable to write meson cross file"
- mesonargs+=(
- --cross-file "${T}/meson.${CHOST}"
- )
- # In cross mode, meson uses these as the native/build programs
- AR=$(tc-getBUILD_AR)
- CC=$(tc-getBUILD_CC)
- CXX=$(tc-getBUILD_CXX)
- PKG_CONFIG=$(tc-getBUILD_PKG_CONFIG)
- STRIP=$(tc-getBUILD_STRIP)
+ mesonargs+=( --cross-file "${T}/meson.${CHOST}" )
fi
# https://bugs.gentoo.org/625396
set -- meson "${mesonargs[@]}" "$@" \
"${EMESON_SOURCE:-${S}}" "${BUILD_DIR}"
echo "$@"
- "$@" || die
+ tc-env_build "$@" || die
}
# @FUNCTION: meson_src_compile