updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / crossbinutils-ppc32 / PKGBUILD
blob29a82b8ac3e524cb08cb2edbf3eb4e57f4570df3
1 # Contributor: DaNiMoTh <jjdanimoth@gmail.com>
2 pkgname=crossbinutils-ppc32
3 _pkgname=binutils
4 _target="powerpc-unknown-linux-gnu"
5 pkgver=2.21
6 pkgrel=1
7 pkgdesc="A set of programs to assemble and manipulate binary and object files for PowerPC (32 bit) architecture"
8 url="http://www.gnu.org/software/binutils/"
9 arch=('i686' 'x86_64')
10 license=('GPL')
11 depends=('glibc')
12 source=("ftp://ftp.gnu.org/gnu/binutils/${_pkgname}-${pkgver}.tar.bz2")
13 _sysroot="/usr/lib/cross-${_target}"
15 build() {
16         cd ${srcdir}/${_pkgname}-${pkgver}
17         
18         ./configure \
19                 "--prefix=${_sysroot}" \
20                 "--bindir=/usr/bin" "--program-prefix=${_target}-" \
21                 "--with-sysroot=${_sysroot}" \
22                 "--target=${_target}" "--build=$CHOST" "--host=$CHOST" \
23                 "--disable-nls" \
24                 --with-gcc --with-gnu-as --with-gnu-ld \
25                 --without-included-gettext \
26                 || return 1
27                 
28         make all || return 1
29         make DESTDIR=${pkgdir} install || return 1
30         
31         msg "Removing duplicit files..."
32         # remove these files as they are already in the system
33         # (with native binutils)
34         rm -Rf ${pkgdir}${_sysroot}/share/{man,info}
35         # remove conflicting binaries
36         find ${pkgdir}/usr/bin/ -type f -not -name 'powerpc-unknown-linux-gnu-*' -delete
37         
38         msg "Creating out-of-path executables..."
39         # symlink executables to single directory with no-arch-prefix name
40         mkdir -p ${pkgdir}/usr/bin/cross/${_target}/;
41         cd ${pkgdir}/usr/bin/cross/${_target}/;
42         for bin in ${pkgdir}/usr/bin/${_target}-*; do
43                 bbin=`basename "$bin"`;
44                 ln -s "/usr/bin/${bbin}" `echo "$bbin" | sed "s#^${_target}-##"`;
45         done
48 md5sums=('c84c5acc9d266f1a7044b51c85a823f5')