updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / ppc64-xenon-gcc-elf-git / PKGBUILD
blobb3b5dfb1c83ff40a7fac7e11f70f1302403b662d
1 # Maintainer: Moritz Fischer <aur@pure-entropy.org>
2 pkgname=ppc64-xenon-gcc-elf-git
3 pkgver=20110915
4 pkgrel=1
5 pkgdesc="The GNU Compiler Collection - Cross compiler for ppc64-xenon target"
6 arch=('i686' 'x86_64')
7 license=('GPL')
8 depends=()
9 makedepends=('git' 'libmpc' 'mpfr' 'gettext' 'ppc64-xenon-binutils' 'ppc64-xenon-gcc-base' 'ppc64-xenon-newlib')
10 provides=('ppc64-xenon-gcc-elf')
11 url="http://gcc.gnu.org/"
12 options=(!strip !buildflags)
14 target=xenon
15 gcc=gcc-4.6.1
17 source=(ftp://ftp.gnu.org/gnu/gcc/${gcc}/${gcc}.tar.bz2)
19 md5sums=('c57a9170c677bf795bdc04ed796ca491')
20 conflicts=(ppc64-xenon-gcc-base)
22 _gitroot=git://free60.git.sourceforge.net/gitroot/free60/free60
23 _gitname=free60
27 build() {
28         cd ${srcdir}
30         if [ -d $_gitname ]; then
31                 cd $_gitname && git reset HEAD --hard && git clean -x -d -f && git pull origin
32                 msg "Updated the local files."
33         else
34                 git clone $_gitroot
35                 msg "GIT checkout done or server timeout"
36         fi
38         cd ${srcdir}
40         if [ -d build ]; then
41                 rm -rf build/*
42         else
43                 mkdir build
44         fi
46         msg "Patching gcc"
47         cat free60/toolchain/gcc-4.6.1.diff | patch -p0 || return 1
48         cd build
50         msg "Configuring gcc for second pass compilation."
51         ../$gcc/configure --target=$target --prefix=/usr \
52                 --with-cpu=cell --disable-decimal-float --disable-libquadmath \
53                 --enable-languages=c,c++ --disable-libssp --with-newlib --enable-cxx-flags="-G0" \
54                 --disable-libmudflap --disable-nls --disable-shared --disable-linux-futex \
55                 --enable-altivec --disable-threads --disable-libgomp || return 1
56         msg "Building gcc second pass."
57         make || return 1
58         make DESTDIR=${pkgdir} install || return 1
59         msg "Cleaning all build remainders"
60         cd ${srcdir} && rm -rf build/* && rm -r build
62         rm -f ${pkgdir}/usr/lib/libiberty.a
63         rm -f ${pkgdir}/usr/share/info/dir
64         rm -r ${pkgdir}/usr/share/gcc-4.6.1/python/libstdcxx/
65         rm -rf ${pkgdir}/usr/share/man/man7
67         cd ${pkgdir}/usr/share/info
68         for file in cpp cppinternals gcc gccinstall gccint; do
69                 mv ${file}.info "xenon-${file}.info"
70         done
71