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