#!/bin/sh NAME="mingw-w64-gcc" DESC="Cross GCC for the MinGW-w64 cross-compiler" MAKEDEPS=" zlib mpc1 gmp mpfr" PKG_VER=12.2.0 SOURCE="https://ftp.gnu.org/gnu/gcc/gcc-$PKG_VER/gcc-$PKG_VER.tar.xz" islver=0.25 ADDITIONAL=" http://libisl.sourceforge.io/isl-$islver.tar.bz2 0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch " target="x86_64-w64-mingw32" prepare() { apply_patches # link isl for in-tree builds tar xf isl-$islver.tar.bz2 ln -sf isl-$islver isl mkdir -p "$_gccdir" } build() { export CFLAGS="$CFLAGS -O2" export CXXFLAGS="$CXXFLAGS -O2" export CPPFLAGS="$CPPFLAGS -O2" "$BUILD_ROOT"/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-system-zlib make } package() { cd "$_gccdir" make DESTDIR="$PKG_DEST" install #$target-strip "$PKG_DEST"/usr/$target/lib/*.dll ln -s $target-gcc "$PKG_DEST"/usr/bin/$target-cc # Move DLLs mkdir -p "$PKG_DEST"/usr/$target/bin mv "$PKG_DEST"/usr/$target/lib/*.dll "$PKG_DEST"/usr/$target/bin # Unnecessary files rm -rf "$PKG_DEST"/usr/share rm "$PKG_DEST"/usr/lib/libcc1.* }