diff --git a/common/build-style/meson.sh b/common/build-style/meson.sh index f0e076fa285..5d71c7c289a 100644 --- a/common/build-style/meson.sh +++ b/common/build-style/meson.sh @@ -4,6 +4,54 @@ do_configure() { : ${meson_cmd:=meson} : ${meson_builddir:=build} + : ${meson_crossfile:=xbps_meson.cross} + + if [ "$CROSS_BUILD" ]; then + _MESON_TARGET_ENDIAN=little + _MESON_TARGET_CPU=${XBPS_TARGET_MACHINE} + case "$XBPS_TARGET_MACHINE" in + mips|mips-musl) + _MESON_TARGET_ENDIAN=big + ;; + esac + + # Record cross-compiling information in cross file. + # CFLAGS and LDFLAGS must be set as c_args and c_link_args. + cat > ${meson_crossfile} <