blob: f3dfa626b2e17e7bf3de9a6796df5c5117116177 (
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
|
# Maintainer: Joey Dumont <joey.dumont@gmail.com>
_target=mips64-ultra-elf
pkgname=${_target}-binutils
_binutilsver=2.44
pkgver=2.44_r183.813f1ae
pkgrel=1
pkgdesc="A set of programs to assemble and manipulate binary and object files for ${_target}"
url="http://www.gnu.org/software/binutils/"
arch=('x86_64')
license=('GPL')
makedepends=('git')
depends=('libelf')
source=("ftp://ftp.gnu.org/gnu/binutils/binutils-${_binutilsver}.tar.bz2"
"git+https://github.com/glankk/n64.git#branch=n64-ultra"
)
sha256sums=('f66390a661faa117d00fab2e79cf2dc9d097b42cc296bf3f8677d1e7b452dc3a'
'SKIP')
pkgver() {
cd "${srcdir}/n64/"
printf "%s_r%s.%s" "${_binutilsver}" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "${srcdir}/binutils-${_binutilsver}"
# Hack - see native package for details
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
# -- Local variables.
CP_DIR="${srcdir}/binutils-${_binutilsver}"
# -- Copy files in binutils source.
cd "${srcdir}/n64/"
patch -d "${CP_DIR}/ld" -p 1 < "config/ld/ld.diff"
cp "config/ld/emulparams/"* "${CP_DIR}/ld/emulparams"
cp "config/ld/emultempl/"* "${CP_DIR}/ld/emultempl"
cat "config/ld/configure.tgt.ultra" >> "${CP_DIR}/ld/configure.tgt"
cd "${CP_DIR}"
# -- Configure n64. Note that the sysroot dir is set to $(prefix)$/(target)
# -- in the package itself.
cd "$srcdir/n64"
./configure --prefix=/usr/
}
build() {
cd "${srcdir}/binutils-${_binutilsver}"
export CFLAGS_FOR_TARGET="-Os -g -ffunction-sections -fdata-sections"
export CXXFLAGS_FOR_TARGET="-Os -g -ffunction-sections -fdata-sections"
./configure \
--target=${_target} \
--prefix=/usr \
--with-sysroot=/usr/${_target}/n64-sysroot/ \
--with-gnu-as \
--with-gnu-ld \
--enable-plugins \
--disable-gold \
--enable-multilib \
--disable-nls \
--disable-shared \
--disable-werror
make
}
check() {
cd "binutils-${_binutilsver}"
# unset LDFLAGS as testsuite makes assumptions about which ones are active
# do not abort on errors - manually check log files
make LDFLAGS="" -k check || true
}
package() {
cd "binutils-${_binutilsver}"
make DESTDIR="$pkgdir" install
# Remove file conflicting with host binutils and manpages for MS Windows tools
rm "$pkgdir"/usr/share/man/man1/$_target-{dlltool,windres,windmc}*
# Remove info documents that conflict with host version
rm -rf "$pkgdir"/usr/share/info
rm -rf "$pkgdir"/usr/lib/bfd-plugins/libdep*
# Install the library files in the sysroot.
cd "$srcdir/n64"
make DESTDIR="${pkgdir}" install-sys
}
|