#See https://mesonbuild.com/Cross-compilation.html
#and https://mesonbuild.com/Machine-files.html
#and https://mesonbuild.com/Reference-tables.html#cpu-families
#NOTE: This may work with debian as well.
#example usage of this file:
#    meson --buildtype=release --cross-file=./meson_crosscompile/mipsel-linux-musl-cross.txt crossbuild_mipselmusl
#    ninja -C crossbuild_mipselmusl

#NOTE: This script requires the musl cross compiler to be installed in /opt/muslcc
#      the install_muslcc.sh script in this same directory will do this for you!


[binaries]
c = '/opt/muslcc/mipsel-linux-musl-cross/usr/bin/mipsel-linux-musl-gcc'
ar = '/opt/muslcc/mipsel-linux-musl-cross/usr/bin/mipsel-linux-musl-gcc-ar'
strip = '/opt/muslcc/mipsel-linux-musl-cross/usr/bin/mipsel-linux-musl-strip'
pkgconfig = '/opt/muslcc/mipsel-linux-musl-cross/usr/bin/mipsel-linux-musl-pkg-config'
ld = '/opt/muslcc/mipsel-linux-musl-cross/usr/bin/mipsel-linux-musl-ld'

[properties]
root = '/opt/muslcc/mipsel-linux-musl-cross/usr/mipsel-linux-musl'
has_function_printf = true
skip_sanity_check = true

[host_machine]
system = 'linux'
cpu_family = 'mips'
cpu = 'mipsel'
endian = 'little'

[built-in options]
#since this is the musl cross-compiler, we want to statically link the executable
#This is MIT licensed and compatible to do. It will also make this super portable!
#
default_library='static'
c_link_args='-static'
libc_musl=true
