aboutsummaryrefslogtreecommitdiffstats
path: root/testing/binutils-cross-embedded/APKBUILD
blob: 79a3ebcac1b78daaae438c3a2974ede493449dca (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
97
98
99
100
101
# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
# Based on binutils-avr
_pkgbase=binutils
_targets="
	arm-none-eabi
	mips-mti-elf
	msp430-elf
	"
pkgname="$_pkgbase-cross-embedded"
pkgver=2.33.1
pkgrel=0
pkgdesc="Tools necessary to build programs for embedded targets"
url="http://www.gnu.org/software/$_pkgbase/"
makedepends="gettext libtool autoconf automake bison zlib-dev"
arch="all"
license="GPL-2.0 GPL-3.0-or-later LGPL-2.0 BSD"
for target in $_targets; do
	targetnorm="${target//-/_}"
	subpackages="$_pkgbase-$target:$targetnorm $subpackages"
done
source="http://ftp.gnu.org/gnu/$_pkgbase/$_pkgbase-$pkgver.tar.bz2"

builddir="$srcdir/$_pkgbase-$pkgver"

build() {
	for target in $_targets; do
		workingdir="$srcdir/build-$target"
		mkdir "$workingdir"
		cd "$workingdir"
		"$builddir"/configure \
			--target=${target} \
			--with-sysroot=/usr/$target \
			--prefix=/usr/ \
			--infodir=/deleteme/info \
			--htmldir=/deleteme/html \
			--pdfdir=/deleteme/pdf \
			--mandir=/deleteme/man \
			--with-gnu-as \
			--with-gnu-ld \
			--enable-deterministic-archieves \
			--enable-interwork \
			--enable-multilib \
			--enable-plugins \
			--enable-ld=default \
			--disable-nls
		make tooldir=/usr -j 16
	done
}

check() {
	for target in $_targets; do
		workingdir="$srcdir/build-$target"
		cd "$workingdir"
		make check
	done
}

package() {
	for target in $_targets; do
		depends="$depends $_pkgbase-$target"
	done
	mkdir -p "$pkgdir"
}

_install_subpkg() {
	target="${subpkgname#$_pkgbase-}"
	pkgdesc="Tools necessary to build programs for $target"
	workingdir="$srcdir/build-$target"
	cd "$workingdir"
	make install DESTDIR="$subpkgdir"
	rm -rf "$subpkgdir"/deleteme
	for bin in ar as nm objcopy objdump ranlib strip readelf; do
		rm -f "$subpkgdir"/usr/bin/"$bin"
	done
}

arm_none_eabi() {
	_install_subpkg
}

avr() {
	_install_subpkg
}

mips_mti_elf() {
	_install_subpkg
}

msp430_elf() {
	_install_subpkg
}

xtensa_esp32_elf() {
	_install_subpkg
}

xtensa_lx106_elf() {
	_install_subpkg
}

sha512sums="bfdbb49a9002dd9bae8ab3c9347e05bd968ad97837c3e71b046eb8721c45a73db01f880dbdf0911bb37a97be37d6cc3b26d0855964a011f593ccbf1d08641c87  binutils-2.33.1.tar.bz2"