# Maintainer: Natanael Copa pkgname=binutils pkgver=2.25 pkgrel=1 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 $pkgname-gold" 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 " _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 _sysroot=/ [ "$CHOST" != "$CTARGET" ] && _sysroot="$CBUILDROOT" cd "$_builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ --target=$CTARGET \ --with-build-sysroot="$CBUILDROOT" \ --with-sysroot=$_sysroot \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --disable-multilib \ --enable-shared \ --enable-ld=default \ --enable-gold=yes \ --enable-64-bit-bfd \ --enable-plugins \ --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" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/ || return 1 } gold() { pkgdesc="GNU binutils - gold linker" if [ -e "$pkgdir"/usr/bin/ld.gold ]; then mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/ld.gold "$subpkgdir"/usr/bin fi mkdir -p "$subpkgdir"/usr/$CTARGET/bin mv "$pkgdir"/usr/$CTARGET/bin/ld.gold "$subpkgdir"/usr/$CTARGET/bin/ld.gold } md5sums="d9f3303f802a5b6b0bb73a335ab89d66 binutils-2.25.tar.bz2 c9f308494b87c243f121a56d58f2da87 binutils-ld-fix-static-linking.patch" sha256sums="22defc65cfa3ef2a3395faaea75d6331c6e62ea5dfacfed3e2ec17b08c882923 binutils-2.25.tar.bz2 d5c5581d0ba04ef2e3690f6fb57435bf7ce343f2376fe972a2a693c5429eec9c binutils-ld-fix-static-linking.patch" sha512sums="49438970642f379978aba988e3d2e7b63dab6fd0b46d91f4100f083e87a84d242089daca58572245fe620457a77bbbe2d78588ff3fb79314e500d1a39bf96f30 binutils-2.25.tar.bz2 ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch"