# Contributor: Leo # Maintainer: Leo pkgname=mingw-w64-gcc pkgver=9.1.0 pkgrel=0 _islver=0.21 pkgdesc="Cross GCC for the MinGW-w64 cross-compiler" options="!static" url="https://gcc.gnu.org" arch="x86_64 x86" license="GPL-3.0-or-later" depends=" mingw-w64-binutils mingw-w64-winpthreads mingw-w64-headers mingw-w64-crt" makedepends="zlib-dev mpc1-dev gmp-dev mpfr-dev" source=" $pkgname-$pkgver.tar.xz::https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz isl-${_islver}::http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2 " builddir="$srcdir/gcc-$pkgver" case "$CARCH" in x86_64) _target="x86_64-w64-mingw32" ;; x86) _target="i686-w64-mingw32" ;; esac # Directory for our out-of-tree builds _gccdir="$srcdir"/gcc-build-${_target} prepare() { default_prepare mkdir -p "$_gccdir" } build() { cd "$_gccdir" "$builddir"/configure \ --prefix=/usr \ --libexecdir=/usr/libexec \ --target=${_target} \ --enable-languages=c,lto,c++ \ --enable-shared --enable-static \ --enable-threads=posix --enable-fully-dynamic-string \ --enable-libstdcxx-time=yes --enable-libstdcxx-filesystem=yes \ --with-system-zlib --enable-cloog-backend=isl \ --enable-lto --disable-dw2-exceptions --enable-libgomp \ --disable-multilib --enable-checking=release \ --disable-nls --disable-werror make } package() { cd "$_gccdir" make DESTDIR="$pkgdir" install ${_target}-strip "$pkgdir"/usr/${_target}/lib/*.dll strip "$pkgdir"/usr/bin/${_target}-* strip "$pkgdir"/usr/libexec/gcc/${_target}/$pkgver/cc1* strip "$pkgdir"/usr/libexec/gcc/${_target}/$pkgver/collect2 strip "$pkgdir"/usr/libexec/gcc/${_target}/$pkgver/lto* ln -s ${_target}-gcc "$pkgdir"/usr/bin/${_target}-cc # Move DLLs mkdir -p "$pkgdir"/usr/${_target}/bin mv "$pkgdir"/usr/${_target}/lib/*.dll "$pkgdir"/usr/${_target}/bin strip "$pkgdir"/usr/bin/* # Unnecessary files rm -rf "$pkgdir"/usr/share rm "$pkgdir"/usr/lib/libcc1.* } sha512sums="b6134df027e734cee5395afd739fcfa4ea319a6017d662e54e89df927dea19d3fff7a6e35d676685383034e3db01c9d0b653f63574c274eeb15a2cb0bc7a1f28 mingw-w64-gcc-9.1.0.tar.xz 48f3b8d90550e8ab28837b5757f87bf99cddec67769877e04942abef69bbe526ef4c863951d55dd89a6027dc09df48988c8df6029782f990aa4d5b67e65f6d53 isl-0.21"