PKGBUILD 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Maintainer: David P. <megver83@parabola.nu>
  2. _target=sh-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 SuperH (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 $_target-newlib)
  14. optdepends=("$_target-newlib: Standard C library ($_target target)")
  15. options=(!emptydirs !strip)
  16. source=(https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgver/gcc-$_pkgver.tar.xz{,.sig}
  17. http://isl.gforge.inria.fr/isl-$_islver.tar.bz2)
  18. sha512sums=('42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e'
  19. 'SKIP'
  20. 'fc2c9796979610dd51143dcefe4f5c989c4354571cc5a1fcc6b932fd41f42a54f6b43adfd289af61be7bd06f3a523fa6a7d7ee56680e32d8036beb4c188fa668')
  21. validpgpkeys=(33C235A34C46AA3FFB293709A328C3A2C3C45C06 # Jakub Jelinek <jakub@redhat.com>
  22. 13975A70E63C361C73AE69EF6EEB81F8981C74C7) # Richard Guenther <richard.guenther@gmail.com>
  23. if [ -n "$_snapshot" ]; then
  24. _basedir=gcc-$_snapshot
  25. else
  26. _basedir=gcc-$_pkgver
  27. fi
  28. prepare() {
  29. cd $_basedir
  30. # link isl for in-tree builds
  31. ln -sf ../isl-$_islver isl
  32. echo $_pkgver > gcc/BASE-VER
  33. # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
  34. sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" "$srcdir"/$_basedir/{libiberty,gcc}/configure
  35. mkdir $srcdir/gcc-build
  36. }
  37. build() {
  38. cd gcc-build
  39. # using -pipe causes spurious test-suite failures
  40. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
  41. CFLAGS=${CFLAGS/-pipe/}
  42. CXXFLAGS=${CXXFLAGS/-pipe/}
  43. $srcdir/$_basedir/configure \
  44. --target=$_target \
  45. --prefix=/usr \
  46. --libexecdir=/usr/lib \
  47. --with-sysroot=/usr/$_target \
  48. --with-native-system-header-dir=/include \
  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. --with-gnu-as \
  63. --with-gnu-ld \
  64. --with-system-zlib \
  65. --with-newlib \
  66. --with-python-dir=share/gcc-$_target \
  67. --with-gmp \
  68. --with-mpfr \
  69. --with-mpc \
  70. --with-isl \
  71. --with-libelf \
  72. --enable-gnu-indirect-function
  73. make
  74. }
  75. package() {
  76. make -C gcc-build DESTDIR="$pkgdir" install-gcc install-target-{libgcc,libstdc++-v3}
  77. # strip target binaries
  78. find "$pkgdir"/usr/lib/gcc/$_target/ "$pkgdir"/usr/$_target/lib \
  79. -type f -and \( -name \*.a -or -name \*.o \) \
  80. -exec $_target-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges \
  81. -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line \
  82. -R .debug_str -R .debug_ranges -R .debug_loc '{}' \;
  83. # strip host binaries
  84. find "$pkgdir/usr/bin/" "$pkgdir/usr/lib/gcc/$_target/" -type f \
  85. -and \( -executable \) -exec strip '{}' \;
  86. # Remove files that conflict with host gcc package
  87. rm -r "$pkgdir/usr/share/"{man/man7,info}
  88. }