PKGBUILD 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Maintainer: Parabola Hackers <dev@lists.parabola.nu>
  2. _target=powerpc64le-linux-gnu
  3. pkgname=$_target-gcc-initial
  4. _pkgver=9.3.0
  5. pkgver=$_pkgver
  6. _islver=0.22
  7. pkgrel=1
  8. pkgrel+=parabola1
  9. pkgdesc='The GNU Compiler Collection - cross compiler for powerpc64le target'
  10. arch=(x86_64 i686 armv7h)
  11. url='http://gcc.gnu.org/'
  12. license=(GPL LGPL FDL)
  13. depends=($_target-binutils libmpc zlib)
  14. makedepends=(gmp mpfr)
  15. provides+=("${_target}-gcc")
  16. conflicts+=("${_target}-gcc")
  17. replaces+=("${_target}-gcc")
  18. options=(!emptydirs !strip)
  19. source=(https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgver/gcc-$_pkgver.tar.xz{,.sig}
  20. http://isl.gforge.inria.fr/isl-$_islver.tar.bz2)
  21. sha512sums=('4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de'
  22. 'SKIP'
  23. 'fc2c9796979610dd51143dcefe4f5c989c4354571cc5a1fcc6b932fd41f42a54f6b43adfd289af61be7bd06f3a523fa6a7d7ee56680e32d8036beb4c188fa668')
  24. validpgpkeys=(33C235A34C46AA3FFB293709A328C3A2C3C45C06) # Jakub Jelinek <jakub@redhat.com>
  25. if [ -n "$_snapshot" ]; then
  26. _basedir=gcc-$_snapshot
  27. else
  28. _basedir=gcc-$_pkgver
  29. fi
  30. prepare() {
  31. cd $_basedir
  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. }