LuaJIT: simplify cross-compiling/wordsize match logic

This commit is contained in:
q66 2020-03-31 16:05:43 +02:00
parent fed4493af0
commit 4fe7159591

View file

@ -13,38 +13,14 @@ homepage="http://www.luajit.org"
distfiles="http://luajit.org/download/${pkgname}-${_dist_version}.tar.gz"
checksum=1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3
if [ "$CROSS_BUILD" -a "$XBPS_MACHINE" = "x86_64" ]; then
hostmakedepends+=" gcc-multilib"
fi
_cross_cc="cc"
if [ "$CROSS_BUILD" ]; then
# cross toolchains are only for x86_64, ppc64 and i686 hosts
# luajit needs matching bitness for host and target
# on x86_64 we can multilib, on others we can't
case "$XBPS_MACHINE" in
x86_64)
case "$XBPS_TARGET_MACHINE" in
ppc64*) ;;
arm*|i686*|mips*|ppc*) _cross_cc="cc -m32";;
esac
;;
ppc64*|x86_64-musl)
case "$XBPS_TARGET_MACHINE" in
ppc64*) ;;
arm*|i686*|mips*|ppc*)
broken="Mismatched bitness on non-multilib host"
;;
esac
;;
i686*)
case "$XBPS_TARGET_MACHINE" in
x86_64*|ppc64*|aarch64*)
broken="Mismatched bitness on non-multilib host"
;;
esac
;;
esac
if [ "$CROSS_BUILD" -a "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
if [ "$XBPS_MACHINE" = "x86_64" ]; then
hostmakedepends+=" gcc-multilib"
_cross_cc="cc -m32"
else
broken="Host and target wordsize must match"
fi
fi
# the ppc64 patchset subtly breaks ppc, needs investigation; for