blob: 285a7cb1203d21056afdb8ff7c4cdb3304e24eae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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.*
}
|