# Maintainer: Anatol Pomozov # Contributor: Martin Schmölzer _target=arm-none-eabi pkgname=$_target-gcc pkgver=4.9.1 pkgrel=1 #_snapshot=4.9-20140604 _newlibver=2.1.0 pkgdesc='The GNU Compiler Collection - cross compiler for ARM EABI (bare-metal) target' arch=(i686 x86_64) url='http://gcc.gnu.org/' license=(GPL LGPL FDL) depends=($_target-binutils cloog libmpc zlib) makedepends=(gmp mpfr) #checkdepends=(dejagnu) options=(!emptydirs !strip staticlibs) source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2 #ftp://gcc.gnu.org/pub/gcc/snapshots/$_snapshot/gcc-$_snapshot.tar.bz2 ftp://sourceware.org/pub/newlib/newlib-$_newlibver.tar.gz gcc-multilib.patch gcc-no-exceptions.patch libgloss-configure-fix.patch) sha256sums=('d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e' '3e4d5ab9f0508942b6231b8ade4f8e5048cf92c96ed574c2bd6bd3320a599a48' '998d1face674cc8d1af5bf28ded15caaaa18936a28f278123448f29555a07775' '7f59b28475aa2018a7edfb81ea81444a6eb098fd3847d8e605809ae6fbeabde5' 'eac96c034d3d7d16080d9aef4749e4eda493563a3348e6a06f08e8a330b027ba') if [ -n "$_snapshot" ]; then _basedir=gcc-$_snapshot else _basedir=gcc-$pkgver fi prepare() { # Apply configure fix from newlib CVS cd "$srcdir/newlib-$_newlibver/libgloss/arm" patch -Np0 -i "$srcdir/libgloss-configure-fix.patch" autoreconf cd "$srcdir/$_basedir" echo $pkgver > gcc/BASE-VER patch -Np0 -i "$srcdir"/gcc-multilib.patch patch -Np0 -i "$srcdir"/gcc-no-exceptions.patch # Move newlib and libgloss to gcc source directory mv "$srcdir"/newlib-$_newlibver/newlib "$srcdir/$_basedir" mv "$srcdir"/newlib-$_newlibver/libgloss "$srcdir/$_basedir" # hack! - some configure tests for header files using "$CPP $CPPFLAGS" sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" "$srcdir"/$_basedir/{libiberty,gcc}/configure } build() { cd $_basedir mkdir build cd build export CFLAGS_FOR_TARGET='-O2 -g -pipe' export CXXFLAGS_FOR_TARGET='-O2 -g -pipe' ../configure --target=$_target \ --prefix=/usr \ --libexecdir=/usr/lib \ --with-pkgversion='Arch Repository' \ --with-bugurl='https://bugs.archlinux.org/' \ --enable-multilib \ --enable-interwork \ --enable-languages=c,c++ \ --with-newlib \ --with-gnu-as \ --with-gnu-ld \ --disable-nls \ --disable-shared \ --disable-threads \ --with-headers=newlib/libc/include \ --disable-libssp \ --disable-libstdcxx-pch \ --disable-libmudflap \ --disable-libgomp \ --with-system-zlib \ --disable-newlib-supplied-syscalls make } check() { cd $_basedir/build # TODO: enable gcc tests for arm target # make check RUNTESTFLAGS="--target_board=arm-sim\{-mhard-float,-msoft-float\}\{-O2,\}" # ../contrib/test_summary } package() { cd $_basedir/build make DESTDIR="$pkgdir" install -j1 # Strip host objects but do not touch target one find "$pkgdir" -executable -type f -exec /usr/bin/strip --strip-debug '{}' \; # Remove files that conflict with host gcc package rm -r "$pkgdir"/usr/share/man/man7 rm -r "$pkgdir"/usr/share/info rm -r "$pkgdir"/usr/share/gcc-$pkgver }