build-mingw-w64-libraries.sh 652 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#!/bin/sh

set -e

if [ $# -lt 1 ]; then
    echo $0 dest
    exit 1
fi
PREFIX="$1"
export PATH=$PREFIX/bin:$PATH

12 13
: ${CORES:=$(nproc 2>/dev/null)}
: ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
14 15 16 17
: ${CORES:=4}
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}

cd mingw-w64/mingw-w64-libraries
18
for lib in winstorecompat; do
19 20 21 22 23 24 25 26 27 28 29 30
    cd $lib
    for arch in $ARCHS; do
        mkdir -p build-$arch
        cd build-$arch
        ../configure --host=$arch-w64-mingw32 --prefix=$PREFIX/$arch-w64-mingw32 \
            CC=$arch-w64-mingw32-clang AR=llvm-ar RANLIB=llvm-ranlib
        make -j$CORES
        make install
        cd ..
    done
    cd ..
done