aboutsummaryrefslogtreecommitdiffstats
path: root/community/mingw-w64-binutils/APKBUILD
blob: e18296ec6dd1c3319ba187f6b46510f3e2567024 (plain) (blame)
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
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=mingw-w64-binutils
pkgver=2.35
pkgrel=0
pkgdesc="Cross binutils for the MinGW-w64 cross-compiler"
url="http://www.gnu.org/software/binutils"
arch="x86_64 x86"
license="GPL-3.0-or-later"
makedepends="zlib-dev perl texinfo"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.gz"
builddir="$srcdir/binutils-$pkgver"

case "$CARCH" in
	x86_64) _target="x86_64-w64-mingw32" ;;
	x86) _target="i686-w64-mingw32" ;;
esac

# Directory for out-of-tree builds
_binutilsdir="$srcdir/binutils-$_target"

prepare() {
	default_prepare

	# Do not install libiberty
	sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
	# hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure

	mkdir -p "$_binutilsdir"
}

build() {
	cd "$_binutilsdir"
	"$builddir"/configure \
		--prefix=/usr \
		--target=$_target \
		--infodir=/usr/share/info/$_target \
		--enable-lto --enable-plugins \
		--enable-deterministic-archives \
		--disable-multilib --disable-nls \
		--disable-werror
	make
}

package() {
	cd "$_binutilsdir"
	make DESTDIR="$pkgdir" install
}

sha512sums="bf1b0da63fa0410d4a55d9ee8e4f8e40f2d001704a7ad8eeab61f289c9f85a61c33953a4c4a5c4250f9644f6b5423eb5103fb4e89790ce210242ae6f6e94c56b  mingw-w64-binutils-2.35.tar.gz"