PKGBUILD 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Maintainer: David P. <megver83@parabola.nu>
  2. _target=xtensa-elf
  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 Xtensa (bare-metal) 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. gcc.patch)
  18. sha512sums=('42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e'
  19. 'SKIP'
  20. 'fc2c9796979610dd51143dcefe4f5c989c4354571cc5a1fcc6b932fd41f42a54f6b43adfd289af61be7bd06f3a523fa6a7d7ee56680e32d8036beb4c188fa668'
  21. '7637408259cef4b14a2f41690bbc769ad0dc6cf4d1c782405526aeb58f68193269af6882b23fb57c3521174e45709ed2d54f0af1f835646e70a3bfd9f626aad9')
  22. validpgpkeys=(33C235A34C46AA3FFB293709A328C3A2C3C45C06 # Jakub Jelinek <jakub@redhat.com>
  23. 13975A70E63C361C73AE69EF6EEB81F8981C74C7) # Richard Guenther <richard.guenther@gmail.com>
  24. if [ -n "$_snapshot" ]; then
  25. _basedir=gcc-$_snapshot
  26. else
  27. _basedir=gcc-$_pkgver
  28. fi
  29. prepare() {
  30. cd $_basedir
  31. patch -Np1 -i ../gcc.patch
  32. # link isl for in-tree builds
  33. ln -sf ../isl-$_islver isl
  34. echo $_pkgver > gcc/BASE-VER
  35. # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
  36. sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" "$srcdir"/$_basedir/{libiberty,gcc}/configure
  37. mkdir $srcdir/gcc-build
  38. }
  39. build() {
  40. cd gcc-build
  41. # using -pipe causes spurious test-suite failures
  42. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
  43. CFLAGS=${CFLAGS/-pipe/}
  44. CXXFLAGS=${CXXFLAGS/-pipe/}
  45. $srcdir/$_basedir/configure \
  46. --target=$_target \
  47. --prefix=/usr \
  48. --libexecdir=/usr/lib \
  49. --enable-languages=c,c++ \
  50. --enable-plugins \
  51. --enable-shared \
  52. --disable-decimal-float \
  53. --disable-libffi \
  54. --disable-libgomp \
  55. --disable-libmudflap \
  56. --disable-libquadmath \
  57. --disable-libssp \
  58. --disable-libstdcxx-pch \
  59. --disable-nls \
  60. --disable-threads \
  61. --disable-tls \
  62. --disable-multilib \
  63. --with-gnu-as \
  64. --with-gnu-ld \
  65. --with-system-zlib \
  66. --with-gmp \
  67. --with-mpfr \
  68. --with-mpc \
  69. --with-isl \
  70. --with-libelf \
  71. --enable-gnu-indirect-function
  72. make all-gcc
  73. }
  74. package() {
  75. make -C gcc-build DESTDIR="$pkgdir" install-gcc
  76. # strip target binaries
  77. find "$pkgdir"/usr/lib/gcc/$_target/ \
  78. -type f -and \( -name \*.a -or -name \*.o \) \
  79. -exec $_target-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges \
  80. -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line \
  81. -R .debug_str -R .debug_ranges -R .debug_loc '{}' \;
  82. # strip host binaries
  83. find "$pkgdir/usr/bin/" "$pkgdir/usr/lib/gcc/$_target/" -type f \
  84. -and \( -executable \) -exec strip '{}' \;
  85. # Remove files that conflict with host gcc package
  86. rm -r "$pkgdir/usr/share/"{man/man7,info}
  87. }