summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ec72e0c51078f0dcfe414849b5dbe40aa6c074d7 (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
# Maintainer: Geronimo Bareiro <gero dot bare at gmail dot com>

_target="mips-harvard-os161"
pkgname=${_target}-binutils
_pkgver=2.24+os161-2.1
pkgver=${_pkgver/os161-/os161_}
pkgrel=1
pkgdesc="A set of programs to assemble and manipulate binary and object files for ${_target} arquitecture. This is part of toolset for the course os161 from Harvard."
arch=('i686' 'x86_64')
url="http://os161.eecs.harvard.edu/"
license=('GPL')
groups=('mips-harvard-os161-toolchain')
depends=('glibc>=2.24' 'zlib')
options=('staticlibs' '!distcc' '!ccache')
source=(http://os161.eecs.harvard.edu/download/binutils-${_pkgver}.tar.gz)
md5sums=('89fb5251c8fac189551f30550e6c4d0b')

prepare() {
  cd binutils-${_pkgver}

  sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure

  mkdir ${srcdir}/binutils-build
}

build() {
  cd binutils-build

  ../binutils-${_pkgver}/configure --prefix=/usr \
      --program-prefix=${_target}- \
      --with-lib-path=/usr/lib/binutils/${_target} \
      --with-local-prefix=/usr/lib/${_target} \
      --with-sysroot=/usr/${_target} \
      --target=${_target} --host=${CHOST} --build=${CHOST} \
      --disable-nls --nfp \
      --disable-shared --disable-threads \
      --disable-werror

  make configure-host

  make tooldir=/usr
}

check() {
  cd binutils-build
  
  # unset LDFLAGS as testsuite makes assumptions about which ones are active
  # ignore failures in gold testsuite...
  make -k LDFLAGS="" check || true
}

package() {
  cd binutils-build
  make prefix=${pkgdir}/usr tooldir=${pkgdir}/usr install

  # Remove unwanted files
  rm -rf ${pkgdir}/usr/share
  rm -f ${pkgdir}/usr/bin/{ar,as,ld,nm,objdump,ranlib,readelf,strip,objcopy}
}