diff --git a/scripts/generate-meson-crossfile.sh b/scripts/generate-meson-crossfile.sh new file mode 100755 index 0000000..31fc0e0 --- /dev/null +++ b/scripts/generate-meson-crossfile.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +set -eu + +_target_endianess=little +_target_cpu="$CARCH" + +case "$CARCH" in + mips*) + _target_endianness=big + _target_cpu_family=mips + ;; + arm*) + _target_cpu_family=arm + ;; + ppc64le) + _target_cpu_family=ppc64 + ;; + aarch64|x86*) + # $CARCH maps 1:1 to _cpu_family for meson for these arches + _target_cpu_family="$CARCH" + ;; +esac + +# Keep in mind that CC, CXX etc. are the binaries to compile from host +# to target, not from host to host! +cat > apk.cross <