diff options
author | Matt Housh <jaeger@crux.ninja> | 2021-06-20 17:37:32 -0500 |
---|---|---|
committer | Matt Housh <jaeger@crux.ninja> | 2021-06-20 17:37:32 -0500 |
commit | 5467fdeee7cbc53404ab56d37f690d17219367a2 (patch) | |
tree | 497184b8dadc9a85f675213d7507da4f5b0e6ad9 /mingw-w64-crt/Pkgfile | |
parent | 750d5f07b059867112dcbeb16eddf88c3dd08d90 (diff) | |
download | opt-5467fdeee7cbc53404ab56d37f690d17219367a2.tar.gz opt-5467fdeee7cbc53404ab56d37f690d17219367a2.tar.xz |
mingw-w64-{binutils,crt,gcc,headers}: moved from contrib
Diffstat (limited to 'mingw-w64-crt/Pkgfile')
-rw-r--r-- | mingw-w64-crt/Pkgfile | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/mingw-w64-crt/Pkgfile b/mingw-w64-crt/Pkgfile new file mode 100644 index 000000000..dc56edc44 --- /dev/null +++ b/mingw-w64-crt/Pkgfile @@ -0,0 +1,62 @@ +# Description: C runtime (crt) for mingw-w64 toolchain +# URL: http://mingw-w64.org/ +# Maintainer: Matt Housh, jaeger at crux dot ninja + +name=mingw-w64-crt +version=8.0.0 +release=1 +source=(https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v$version.tar.bz2 \ + http://ftpmirror.gnu.org/gnu/binutils/binutils-2.35.1.tar.xz \ + http://gcc.gnu.org/pub/gcc/releases/gcc-10.2.0/gcc-10.2.0.tar.xz) + +build() { + + # build a stub sysroot gcc if mingw-w64-gcc isn't already installed; if it is, that will be used instead + if [ ! -x /usr/bin/x86_64-w64-mingw32-gcc ]; then + + export SYSROOT="--with-sysroot=$SRC/sysroot" + + for T in {i686,x86_64}-w64-mingw32; do + mkdir build-binutils-$T + cd build-binutils-$T + ../binutils-2.35.1/configure --target=$T --disable-multilib --prefix=$SRC/sysroot $SYSROOT + make + make install + cd .. + done + + export PATH=$SRC/sysroot/bin:$PATH + + for T in {i686,x86_64}-w64-mingw32; do + mkdir build-headers-$T + cd build-headers-$T + ../mingw-w64-v$version/mingw-w64-headers/configure --host=$T --prefix=$SRC/sysroot/$T + make install + if [ "$T" = "x86_64-w64-mingw32" ]; then + ln -sv $SRC/sysroot/$T $SRC/sysroot/mingw + ln -sv $SRC/sysroot/$T/lib $SRC/sysroot/$T/lib64 + fi + cd .. + done + + for T in {i686,x86_64}-w64-mingw32; do + mkdir build-gcc-$T + cd build-gcc-$T + ../gcc-10.2.0/configure --target=$T --disable-multilib --disable-nls --enable-threads=posix --prefix=$SRC/sysroot $SYSROOT + make all-gcc + make install-gcc + cd .. + done + fi + + # now build the crt + for T in {x86_64,i686}-w64-mingw32; do + mkdir build-$T + cd build-$T + [[ "$T" = "x86_64-w64-mingw32" ]] && OPTS="--enable-lib64 --disable-lib32" || OPTS="--enable-lib32 --disable-lib64" + ../mingw-w64-v$version/mingw-w64-crt/configure --prefix=/usr/$T --host=$T $OPTS --enable-wildcard $SYSROOT + make + make DESTDIR=$PKG install + cd .. + done +} |