Guest User

or32-elf-gcc PKGBUILD

a guest
Feb 9th, 2012
115
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Maintainer: Roman Lapin <lampus.lapin@@gmail.com>
  2.  
  3. pkgname='or32-elf-gcc-base-git'
  4. pkgver=20120209
  5. pkgrel=2
  6. pkgdesc="The GNU Compiler Collection for OpenRISC target"
  7. arch=('i686' 'x86_64')
  8. license=('GPL' 'LGPL')
  9. url="http://openrisc.southpole.se/cgit.cgi/jonas/gcc/"
  10. depends=('or32-elf-binutils' 'libmpc' 'libelf')
  11. makedepends=('git')
  12. conflicts=('or32-elf-gcc-base')
  13. provides=('or32-elf-gcc-base')
  14. options=(!libtool !emptydirs zipman docs !strip)
  15.  
  16. _gitroot=git://openrisc.net/jonas/gcc
  17. _gitname=gcc
  18.  
  19. source=()
  20. md5sums=()
  21.  
  22. build() {
  23. cd $srcdir
  24. msg "Connecting to git server...."
  25.  
  26. if [ -d $srcdir/$_git haveitname ] ; then
  27. cd $_gitname && git pull origin
  28. msg "The local files are updated."
  29. else
  30. git clone $_gitroot
  31. fi
  32. msg "GIT checkout done or server timeout"
  33.  
  34. cd ${srcdir}/${_gitname}
  35. export CFLAGS="-O2 -pipe"
  36. export CXXFLAGS="-O2 -pipe"
  37.  
  38. [ $NOEXTRACT -eq 1 ] || rm -rf build
  39. git checkout or1k-4.5.1
  40. mkdir -p build
  41. cd build
  42.  
  43. [ $NOEXTRACT -eq 1 ] || ../configure --prefix=/usr \
  44. --target=or32-elf \
  45. --host=$CHOST \
  46. --build=$CHOST \
  47. --disable-shared \
  48. --disable-nls \
  49. --enable-languages=c,c++ \
  50. --disable-multilib \
  51. --with-local-prefix=/usr/lib/or32-elf \
  52. --with-as=/usr/bin/or32-elf-as \
  53. --with-ld=/usr/bin/or32-elf-ld \
  54. --disable-libssp \
  55. --with-newlib \
  56. --with-sysroot=/usr/$CHOST/or32-elf
  57.  
  58. make all-gcc all-target-libgcc all-target-libstdc++-v3 all-target-newlib all-target-libgloss
  59. }
  60.  
  61. package() {
  62. cd ${srcdir}/${_gitname}/build
  63.  
  64. export CFLAGS="-O2 -pipe"
  65. export CXXFLAGS="-O2 -pipe"
  66.  
  67. make DESTDIR=$pkgdir install-gcc install-target-libgcc install-target-libstdc++-v3 \
  68. install-target-newlib install-target-libgloss
  69.  
  70. rm -f $pkgdir/usr/share/man/man7/fsf-funding.7*
  71. rm -f $pkgdir/usr/share/man/man7/gfdl.7*
  72. rm -f $pkgdir/usr/share/man/man7/gpl.7*
  73. rm -rf $pkgdir/usr/share/info
  74.  
  75. cp -r $pkgdir/usr/libexec/* $pkgdir/usr/lib/
  76. rm -rf $pkgdir/usr/libexec
  77.  
  78. # strip it manually
  79. strip $pkgdir/usr/bin/* 2>/dev/null || true
  80. find $pkgdir/usr/lib -type f -exec or32-elf-strip {} \; 2>/dev/null || true
  81. }
RAW Paste Data