summaryrefslogtreecommitdiff
path: root/skip/mingw-w64-gcc/mingw-w64-gcc.xibuild
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-02-02 14:10:02 +0000
committerdavidovski <david@davidovski.xyz>2023-02-02 14:10:02 +0000
commitf29d569cd33a73da5ad675f43a34ad53c5cc9bc6 (patch)
tree76fe6267f8307e7630fc6f53ff99a9767ad40de0 /skip/mingw-w64-gcc/mingw-w64-gcc.xibuild
parent05d004dfe0c9a9d898fac8a4a0292ca2a74ca391 (diff)
Work
Diffstat (limited to 'skip/mingw-w64-gcc/mingw-w64-gcc.xibuild')
-rw-r--r--skip/mingw-w64-gcc/mingw-w64-gcc.xibuild72
1 files changed, 72 insertions, 0 deletions
diff --git a/skip/mingw-w64-gcc/mingw-w64-gcc.xibuild b/skip/mingw-w64-gcc/mingw-w64-gcc.xibuild
new file mode 100644
index 0000000..285a7cb
--- /dev/null
+++ b/skip/mingw-w64-gcc/mingw-w64-gcc.xibuild
@@ -0,0 +1,72 @@
+#!/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.*
+}
+