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