This version provides __cxa_thread_atexit, for supporting destructors for TLS objects.
75 lines
1.7 KiB
Bash
Executable File
75 lines
1.7 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
if [ $# -lt 1 ]; then
|
|
echo $0 dest
|
|
exit 1
|
|
fi
|
|
PREFIX="$1"
|
|
export PATH=$PREFIX/bin:$PATH
|
|
|
|
: ${CORES:=4}
|
|
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
|
|
|
|
if [ ! -d mingw-w64 ]; then
|
|
git clone git://git.code.sf.net/p/mingw-w64/mingw-w64
|
|
CHECKOUT=1
|
|
fi
|
|
|
|
cd mingw-w64
|
|
|
|
if [ -n "$SYNC" ] || [ -n "$CHECKOUT" ]; then
|
|
[ -z "$SYNC" ] || git fetch
|
|
git checkout 691566fc6febc2b0be33253b9f4d2256b52ddb1e
|
|
fi
|
|
|
|
cd mingw-w64-headers
|
|
mkdir -p build
|
|
cd build
|
|
../configure --prefix=$PREFIX/generic-w64-mingw32 \
|
|
--enable-secure-api --enable-idl --with-default-win32-winnt=0x600 --with-default-msvcrt=ucrt INSTALL="install -C"
|
|
make install
|
|
cd ../..
|
|
for arch in $ARCHS; do
|
|
mkdir -p $PREFIX/$arch-w64-mingw32
|
|
ln -sfn ../generic-w64-mingw32/include $PREFIX/$arch-w64-mingw32/include
|
|
done
|
|
|
|
cd mingw-w64-crt
|
|
for arch in $ARCHS; do
|
|
mkdir -p build-$arch
|
|
cd build-$arch
|
|
case $arch in
|
|
armv7)
|
|
FLAGS="--disable-lib32 --disable-lib64 --enable-libarm32"
|
|
;;
|
|
aarch64)
|
|
FLAGS="--disable-lib32 --disable-lib64 --enable-libarm64"
|
|
;;
|
|
i686)
|
|
FLAGS="--enable-lib32 --disable-lib64"
|
|
;;
|
|
x86_64)
|
|
FLAGS="--disable-lib32 --enable-lib64"
|
|
;;
|
|
esac
|
|
FLAGS="$FLAGS --with-default-msvcrt=ucrt"
|
|
../configure --host=$arch-w64-mingw32 --prefix=$PREFIX/$arch-w64-mingw32 $FLAGS \
|
|
CC=$arch-w64-mingw32-clang AR=llvm-ar RANLIB=llvm-ranlib DLLTOOL=llvm-dlltool
|
|
make -j$CORES
|
|
make install
|
|
cd ..
|
|
done
|
|
cd ..
|
|
|
|
cd mingw-w64-tools/widl
|
|
for arch in $ARCHS; do
|
|
mkdir -p build-$arch
|
|
cd build-$arch
|
|
../configure --prefix=$PREFIX --target=$arch-w64-mingw32 INSTALL="install -s"
|
|
make -j$CORES
|
|
make install
|
|
cd ..
|
|
done
|