# Contributor: Leo # Maintainer: pkgname=mingw-w64-gcc pkgver=12.2.0 pkgrel=2 _islver=0.25 pkgdesc="Cross GCC for the MinGW-w64 cross-compiler" 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 https://libisl.sourceforge.io/isl-$_islver.tar.bz2 0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch " 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 # link isl for in-tree builds ln -sf ../isl-$_islver isl mkdir -p "$_gccdir" } build() { export CFLAGS="$CFLAGS -O2" export CXXFLAGS="$CXXFLAGS -O2" export CPPFLAGS="$CPPFLAGS -O2" cd "$_gccdir" "$builddir"/configure \ --prefix=/usr \ --target=$_target \ --libexecdir=/usr/libexec \ --disable-dw2-exceptions \ --disable-multilib \ --disable-nls \ --disable-sjlj-exceptions \ --disable-werror \ --enable-checking=release \ --enable-cloog-backend=isl \ --enable-fully-dynamic-string \ --enable-languages=c,lto,c++ \ --enable-libgomp \ --enable-libstdcxx-time=yes \ --enable-lto \ --enable-shared \ --enable-static \ --enable-threads=posix \ --with-bugurl="https://gitlab.alpinelinux.org/alpine/aports/-/issues" \ --with-system-zlib make } package() { cd "$_gccdir" make DESTDIR="$pkgdir" install $_target-strip "$pkgdir"/usr/$_target/lib/*.dll 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 # Unnecessary files rm -rf "$pkgdir"/usr/share rm "$pkgdir"/usr/lib/libcc1.* } sha512sums=" e9e857bd81bf7a370307d6848c81b2f5403db8c7b5207f54bce3f3faac3bde63445684092c2bc1a2427cddb6f7746496d9fbbef05fbbd77f2810b2998f1f9173 mingw-w64-gcc-12.2.0.tar.xz d309388d7dc1c861fddf74dbcc0f15b0166b166d0ed694473445ec47eb7d3dfab96412554016b3e06292f01967441546783ab329829dc4df4b9813716e2ef9ed isl-0.25.tar.bz2 8266eae8b3be5557e8cd79c21b6326db7cd83604db6d6ad83923798650fcd8d0f9f1f4ed424c816a48e91f21fb1852ab9272c73100b219f07d3bbb566bfd6fae 0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch "