aboutsummaryrefslogtreecommitdiffstats
path: root/main/binutils/APKBUILD
blob: a85e84b0659e30aa30c5e1c87cdd1544052dc97b (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=binutils
pkgver=2.24
pkgrel=2
pkgdesc="Tools necessary to build programs"
url="http://www.gnu.org/software/binutils/"
depends=""
makedepends="bison flex texinfo zlib-dev"
arch="all"
license="GPL2 GPL3+ LGPL2 BSD"
subpackages="$pkgname-doc $pkgname-libs"

if [ "$CHOST" != "$CTARGET" ] && [ -n "$CHOST" -a -n "$CTARGET" ]; then
	pkgname="$pkgname-$CTARGET"
	subpackages=""
	somask="libbfd-$pkgver.so libopcodes-$pkgver.so"
fi

source="http://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2
	binutils-ld-fix-static-linking.patch
	02_fix-opcodes-configure-bfd-version-on-busybox-ash.patch
	bfd-version.patch
	"

_builddir="$srcdir/$pkgname-$pkgver"
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch|*.diff)
			msg "Applying $i..."
			patch -p1 -i "$srcdir"/$i || return 1
			;;
		esac
	done
}

build() {
	local _cross_configure=
	[ "$CHOST" != "$CTARGET" ] && _cross_configure="--with-sysroot=$CBUILDROOT"

	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--target=$CTARGET \
		--with-build-sysroot="$CBUILDROOT" \
		$_cross_configure \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-multilib \
		--enable-shared \
		--enable-64-bit-bfd \
		--disable-werror \
		--disable-nls \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make install DESTDIR="$pkgdir" || return 1
	if [ -d "$pkgdir"/usr/lib64 ]; then
		mv "$pkgdir"/usr/lib64/* "$pkgdir"/usr/lib/
		rmdir "$pkgdir"/usr/lib64
	fi
	if [ "$CHOST" != "$CTARGET" ]; then
		# creating cross tools: remove any files that would conflict
		# with the native tools, or other cross tools
		rm -r "$pkgdir"/usr/share
		rm -f "$pkgdir"/usr/lib/libiberty.a
	fi
	find "$pkgdir" -name "*.la" -delete
}

libs() {
       pkgdesc="Runtime libraries from binutils - libbfd and libopcodes"
       replaces="binutils"
       mkdir -p "$subpkgdir"/usr/lib
       mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/ || return 1
}

md5sums="e0f71a7b2ddab0f8612336ac81d9636b  binutils-2.24.tar.bz2
c9f308494b87c243f121a56d58f2da87  binutils-ld-fix-static-linking.patch
26210092adc0e0d7b236eb464dea543a  02_fix-opcodes-configure-bfd-version-on-busybox-ash.patch
56c179892fa33cd0bac127761834e5d9  bfd-version.patch"
sha256sums="e5e8c5be9664e7f7f96e0d09919110ab5ad597794f5b1809871177a0f0f14137  binutils-2.24.tar.bz2
d5c5581d0ba04ef2e3690f6fb57435bf7ce343f2376fe972a2a693c5429eec9c  binutils-ld-fix-static-linking.patch
0bbd84e3e761e482e5a78ca126964b2af3b492dad66f49b62603f653bb795ea5  02_fix-opcodes-configure-bfd-version-on-busybox-ash.patch
79cea3abac2fc544494853b03a5fbf92489969397286d201b25706359e0862bb  bfd-version.patch"
sha512sums="5ec95ad47d49b12c4558a8db0ca2109d3ee1955e3776057f3330c4506f8f4d1cf5e505fbf8a16b98403a0fcdeaaf986fe0a22be6456247dbdace63ce1f776b12  binutils-2.24.tar.bz2
ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49  binutils-ld-fix-static-linking.patch
f7c2d19c4fce831d5f2791e4daadde70a1286bcf27074e24e635224fc9f39f47b6d95cbf2860eea1be1362f995e348fca0a0c2d9fe2d491dfe5d674c82f83bfb  02_fix-opcodes-configure-bfd-version-on-busybox-ash.patch
2fce2bbb667e643d090898d221f896ef7c192e858edbda3d460cb2067b130ce6d44730a47e332cae4c7bacf1a858dcc33715246fd209c7d98d2eda4aeb3f5b6c  bfd-version.patch"