PKGBUILD 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # Maintainer: David P. <megver83@parabola.nu>
  2. _target=arm-linux-gnueabi
  3. pkgname=$_target-gcc
  4. _pkgver=10.2.0
  5. pkgver=$_pkgver
  6. _islver=0.22
  7. pkgrel=1
  8. pkgdesc='The GNU Compiler Collection - cross compiler for ARM GNU EABI little-endian target'
  9. arch=(x86_64 i686 armv7h)
  10. url='http://gcc.gnu.org/'
  11. license=(GPL LGPL FDL)
  12. depends=($_target-binutils libmpc zlib)
  13. makedepends=(gmp mpfr)
  14. options=(!emptydirs !strip)
  15. source=(https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgver/gcc-$_pkgver.tar.xz{,.sig}
  16. http://isl.gforge.inria.fr/isl-$_islver.tar.bz2)
  17. sha512sums=('42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e'
  18. 'SKIP'
  19. 'fc2c9796979610dd51143dcefe4f5c989c4354571cc5a1fcc6b932fd41f42a54f6b43adfd289af61be7bd06f3a523fa6a7d7ee56680e32d8036beb4c188fa668')
  20. validpgpkeys=(33C235A34C46AA3FFB293709A328C3A2C3C45C06 # Jakub Jelinek <jakub@redhat.com>
  21. 13975A70E63C361C73AE69EF6EEB81F8981C74C7) # Richard Guenther <richard.guenther@gmail.com>
  22. if [ -n "$_snapshot" ]; then
  23. _basedir=gcc-$_snapshot
  24. else
  25. _basedir=gcc-$_pkgver
  26. fi
  27. prepare() {
  28. cd $_basedir
  29. # link isl for in-tree builds
  30. ln -sf ../isl-$_islver isl
  31. echo $_pkgver > gcc/BASE-VER
  32. # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
  33. sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" "$srcdir"/$_basedir/{libiberty,gcc}/configure
  34. mkdir $srcdir/gcc-build
  35. }
  36. build() {
  37. cd gcc-build
  38. # using -pipe causes spurious test-suite failures
  39. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
  40. CFLAGS=${CFLAGS/-pipe/}
  41. CXXFLAGS=${CXXFLAGS/-pipe/}
  42. $srcdir/$_basedir/configure \
  43. --target=$_target \
  44. --prefix=/usr \
  45. --libexecdir=/usr/lib \
  46. --enable-languages=c,c++ \
  47. --enable-plugins \
  48. --enable-shared \
  49. --disable-decimal-float \
  50. --disable-libffi \
  51. --disable-libgomp \
  52. --disable-libmudflap \
  53. --disable-libquadmath \
  54. --disable-libssp \
  55. --disable-libstdcxx-pch \
  56. --disable-nls \
  57. --disable-threads \
  58. --disable-tls \
  59. --disable-multilib \
  60. --with-gnu-as \
  61. --with-gnu-ld \
  62. --with-system-zlib \
  63. --with-gmp \
  64. --with-mpfr \
  65. --with-mpc \
  66. --with-isl \
  67. --with-libelf \
  68. --enable-gnu-indirect-function
  69. make all-gcc
  70. }
  71. package() {
  72. make -C gcc-build DESTDIR="$pkgdir" install-gcc
  73. # strip target binaries
  74. find "$pkgdir"/usr/lib/gcc/$_target/ \
  75. -type f -and \( -name \*.a -or -name \*.o \) \
  76. -exec $_target-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges \
  77. -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line \
  78. -R .debug_str -R .debug_ranges -R .debug_loc '{}' \;
  79. # strip host binaries
  80. find "$pkgdir/usr/bin/" "$pkgdir/usr/lib/gcc/$_target/" -type f \
  81. -and \( -executable \) -exec strip '{}' \;
  82. # Remove files that conflict with host gcc package
  83. rm -r "$pkgdir/usr/share/"{man/man7,info}
  84. }