updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / crossgcc-ppc32 / PKGBUILD
blobecd98cb427c2cd2463da0e17fdf4af8f309fd09f
1 # Contributor: Vojtech Horky <vojta . horky at-symbol seznam . cz>
2 pkgname=crossgcc-ppc32
3 _pkgname=gcc
4 _target="powerpc-unknown-linux-gnu"
5 pkgver=4.5.2
6 pkgrel=1
7 pkgdesc="The GNU Compiler Collection for the PowerPC (32 bit) architecture"
8 url="http://www.gnu.org/software/binutils/"
9 arch=('i686' 'x86_64')
10 license=('GPL')
11 depends=('mpfr' 'gmp' 'libmpc' 'sh' "crossbinutils-ppc32" 'cloog-ppl')
12 options=('!ccache' '!distcc' '!emptydirs' '!libtool' '!strip')
13 source=(ftp://ftp.gnu.org/gnu/gcc/gcc-${pkgver}/${_pkgname}-{core,g++}-${pkgver}.tar.bz2)
14 _sysroot="/usr/lib/cross-${_target}"
16 build() {
17         cd ${srcdir}/${_pkgname}-${pkgver}
18         
19                 #"--with-sysroot=${_sysroot}" \
20                 #"--prefix=${_sysroot}" \
21         ./configure \
22                 --prefix=/usr \
23                 "--bindir=/usr/bin" "--program-prefix=${_target}-" \
24                 "--target=${_target}" "--build=$CHOST" "--host=$CHOST" \
25                 --with-libs --with-headers \
26                 --with-as=/usr/bin/${_target}-as --with-ld=/usr/bin/${_target}-ld \
27                 --with-ar=/usr/bin/${_target}-ar --with-ranlib=/usr/bin/${_target}-ranlib \
28                 --disable-nls --disable-threads \
29                 --enable-languages=c,c++ --disable-libgcj \
30                 --enable-shared --enable-threads=posix \
31                 --enable-lto --enable-gnu-unique-object \
32                 --disable-libstdcxx-pch \
33                 --with-system-zlib --with-ppl --with-cloog \
34                 || return 1
35         
36         make all-gcc "inhibit_libc=true" || return 1
38 package() {
39         cd  ${srcdir}/${_pkgname}-${pkgver}
40         make DESTDIR=${pkgdir} install-gcc || return 1
41         
42         msg "Removing duplicit files..."
43         # remove these files as they are already in the system
44         # (with native gcc)
45         rm -Rf ${pkgdir}/usr/share/{man,info}
46         # remove conflicting binaries
47         find ${pkgdir}/usr/bin/ -type f -not -name 'powerpc-unknown-linux-gnu-*' -delete
48         
49         msg "Creating out-of-path executables..."
50         # symlink executables to single directory with no-arch-prefix name
51         mkdir -p ${pkgdir}/usr/bin/cross/${_target}/;
52         cd ${pkgdir}/usr/bin/cross/${_target}/;
53         for bin in ${pkgdir}/usr/bin/${_target}-*; do
54                 bbin=`basename "$bin"`;
55                 ln -s "/usr/bin/${bbin}" `echo "$bbin" | sed "s#^${_target}-##"`;
56         done
59 md5sums=('aa9e36bec080452372bfba793428ee82'
60          '9821f1c61e43755866861485ff364e90')