#!/bin/bash -e prefix_dir=$PWD/mingw_prefix mkdir -p "$prefix_dir" ln -snf . "$prefix_dir/usr" ln -snf . "$prefix_dir/local" wget="wget -nc --progress=bar:force" gitclone="git clone --depth=1 --recursive --shallow-submodules" # -posix is Ubuntu's variant with pthreads support export CC=$TARGET-gcc-posix export AS=$TARGET-gcc-posix export CXX=$TARGET-g++-posix export AR=$TARGET-ar export NM=$TARGET-nm export RANLIB=$TARGET-ranlib export CFLAGS="-O2 -pipe -Wall -D_FORTIFY_SOURCE=2" export LDFLAGS="-fstack-protector-strong" # anything that uses pkg-config export PKG_CONFIG_SYSROOT_DIR="$prefix_dir" export PKG_CONFIG_LIBDIR="$PKG_CONFIG_SYSROOT_DIR/lib/pkgconfig" # autotools(-like) commonflags="--disable-static --enable-shared" # meson fam=x86_64 [[ "$TARGET" == "i686-"* ]] && fam=x86 cat >"$prefix_dir/crossfile" <