# Maintainer; Marcin (CTRL) Wieczorek # Contributor: Eole Dev pkgname=cross-mips-elf-binutils _pkgname=binutils _target="mips-elf" pkgver=2.37 pkgrel=1 pkgdesc="A set of programs to assemble and manipulate binary and object files for the MIPS architecture" url="http://www.gnu.org/software/binutils/" arch=('i686' 'x86_64') license=('GPL') depends=('zlib') source=("https://ftp.gnu.org/gnu/binutils/${_pkgname}-${pkgver}.tar.bz2") sha256sums=('67fc1a4030d08ee877a4867d3dcab35828148f87e1fd05da6db585ed5a166bd4') _sysroot="/usr/lib/cross-${_target}" prepare() { cd ${srcdir}/${_pkgname}-${pkgver} sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure } build() { cd ${srcdir}/${_pkgname}-${pkgver} ./configure \ "--prefix=${_sysroot}" \ "--bindir=/usr/bin" "--program-prefix=${_target}-" \ "--with-sysroot=${_sysroot}" \ "--target=${_target}" "--build=$CHOST" "--host=$CHOST" \ --disable-werror \ "--disable-nls" \ --with-gcc --with-gnu-as --with-gnu-ld \ --without-included-gettext make } package() { cd ${srcdir}/${_pkgname}-${pkgver} make DESTDIR=${pkgdir} install msg "Removing duplicit files..." # remove these files as they are already in the system # (with native binutils) rm -Rf ${pkgdir}${_sysroot}/share/{man,info} # remove conflicting binaries find ${pkgdir}/usr/bin/ -type f -not -name 'mips-elf-*' -delete msg "Creating out-of-path executables..." # symlink executables to single directory with no-arch-prefix name mkdir -p ${pkgdir}/usr/bin/cross/${_target}/; cd ${pkgdir}/usr/bin/cross/${_target}/; for bin in ${pkgdir}/usr/bin/${_target}-*; do bbin=`basename "$bin"`; ln -s "/usr/bin/${bbin}" `echo "$bbin" | sed "s#^${_target}-##"`; done }