aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mingw-w64-gcc/APKBUILD
blob: fa07b69c5b87f6b8574e397e51efa19b18dc6052 (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
73
74
75
76
77
78
79
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=mingw-w64-gcc
pkgver=9.2.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="a12dff52af876aee0fd89a8d09cdc455f35ec46845e154023202392adc164848faf8ee881b59b681b696e27c69fd143a214014db4214db62f9891a1c8365c040  mingw-w64-gcc-9.2.0.tar.xz
48f3b8d90550e8ab28837b5757f87bf99cddec67769877e04942abef69bbe526ef4c863951d55dd89a6027dc09df48988c8df6029782f990aa4d5b67e65f6d53  isl-0.21"