# Maintainer: Natanael Copa pkgname=binutils pkgver=2.23.2 pkgrel=3 pkgdesc="Tools necessary to build programs" url="http://www.gnu.org/software/binutils/" depends= makedepends="bison flex texinfo zlib-dev" arch="all" license="GPL" _pkgname=$pkgname if [ "$CHOST" != "$CTARGET" ] && [ -n "$CHOST" -a -n "$CTARGET" ]; then pkgname="$pkgname-$CTARGET" somask="libbfd-$pkgver.so libopcodes-$pkgver.so" fi subpackages="$pkgname-doc $pkgname-libs" 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 update_config_sub || return 1 } build() { local _cross_configure= [ "$CHOST" != "$CTARGET" ] && _cross_configure="--with-sysroot=$CBUILDROOT" cd "$_builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ --target=$CTARGET \ --with-build-sysroot="$CBUILDROOT" \ $_cross_configure \ --prefix=/usr \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --disable-multilib \ --enable-shared \ --enable-64-bit-bfd \ --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 rm "$pkgdir"/usr/lib/libiberty.a find "$pkgdir" -name "*.la" -delete } libs() { pkgdesc="Runtime libraries from binutils - libbfd and libopcodes" replaces="binutils" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/ || return 1 } md5sums="4f8fa651e35ef262edc01d60fb45702e binutils-2.23.2.tar.bz2 6b744d0574338cc69d3096a890a7b609 binutils-ld-fix-static-linking.patch" sha256sums="fe914e56fed7a9ec2eb45274b1f2e14b0d8b4f41906a5194eac6883cfe5c1097 binutils-2.23.2.tar.bz2 a3ebf58f95fc6c1bfe05377d222d876593f692fa9098d1ccce43874ecbb0501d binutils-ld-fix-static-linking.patch" sha512sums="dec753bbba008f1526b89cf1bd85feba78f362f5333ffdf93953fd131eb755976dec82a0a4ba38c43d2434da007137780cfe674de5414be5cf7ce7fbc6af6d16 binutils-2.23.2.tar.bz2 d013566655041eee1e484d6f8b7168a2817839e88d370f064be3917c9c6be11d1b13e90fd9e769f5f095e6709520b6308d3cfca69c2956ada311c07ff697bab4 binutils-ld-fix-static-linking.patch"