PKGBUILD 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # Maintainer: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
  2. # Feel free to push modifications or take over maintainership
  3. _target=powerpc64le-linux-gnu
  4. pkgname=$_target-gcc-initial
  5. _pkgver=9.3.0
  6. pkgver=$_pkgver
  7. _islver=0.22
  8. pkgrel=1
  9. pkgrel+=parabola1
  10. pkgdesc='The GNU Compiler Collection - cross compiler for powerpc64le target'
  11. arch=(x86_64 i686 armv7h)
  12. url='http://gcc.gnu.org/'
  13. license=(GPL LGPL FDL)
  14. depends=($_target-binutils libmpc zlib)
  15. makedepends=(gmp mpfr)
  16. provides+=("${_target}-gcc")
  17. conflicts+=("${_target}-gcc")
  18. replaces+=("${_target}-gcc")
  19. options=(!emptydirs !strip)
  20. source=(https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgver/gcc-$_pkgver.tar.xz{,.sig}
  21. http://isl.gforge.inria.fr/isl-$_islver.tar.bz2)
  22. sha512sums=('4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de'
  23. 'SKIP'
  24. 'fc2c9796979610dd51143dcefe4f5c989c4354571cc5a1fcc6b932fd41f42a54f6b43adfd289af61be7bd06f3a523fa6a7d7ee56680e32d8036beb4c188fa668')
  25. validpgpkeys=(33C235A34C46AA3FFB293709A328C3A2C3C45C06) # Jakub Jelinek <jakub@redhat.com>
  26. if [ -n "$_snapshot" ]; then
  27. _basedir=gcc-$_snapshot
  28. else
  29. _basedir=gcc-$_pkgver
  30. fi
  31. prepare() {
  32. cd $_basedir
  33. # link isl for in-tree builds
  34. ln -sf ../isl-$_islver isl
  35. echo $_pkgver > gcc/BASE-VER
  36. # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
  37. sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" "$srcdir"/$_basedir/{libiberty,gcc}/configure
  38. mkdir $srcdir/gcc-build
  39. }
  40. build() {
  41. cd gcc-build
  42. # using -pipe causes spurious test-suite failures
  43. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
  44. CFLAGS=${CFLAGS/-pipe/}
  45. CXXFLAGS=${CXXFLAGS/-pipe/}
  46. $srcdir/$_basedir/configure \
  47. --target=$_target \
  48. --prefix=/usr \
  49. --libexecdir=/usr/lib \
  50. --enable-languages=c,c++ \
  51. --enable-plugins \
  52. --enable-shared \
  53. --disable-decimal-float \
  54. --disable-libffi \
  55. --disable-libgomp \
  56. --disable-libmudflap \
  57. --disable-libquadmath \
  58. --disable-libssp \
  59. --disable-libstdcxx-pch \
  60. --disable-nls \
  61. --disable-threads \
  62. --disable-tls \
  63. --disable-multilib \
  64. --with-gnu-as \
  65. --with-gnu-ld \
  66. --with-system-zlib \
  67. --with-gmp \
  68. --with-mpfr \
  69. --with-mpc \
  70. --with-isl \
  71. --with-libelf \
  72. --enable-gnu-indirect-function
  73. make all-gcc
  74. }
  75. package() {
  76. make -C gcc-build DESTDIR="$pkgdir" install-gcc
  77. # strip target binaries
  78. find "$pkgdir"/usr/lib/gcc/$_target/ \
  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. }