PKGBUILD 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Maintainer: Parabola Hackers <dev@lists.parabola.nu>
  2. _target=x86_64-pc-linux-gnu
  3. pkgname=$_target-gcc
  4. _pkgver=9.2.0
  5. #_snapshot=8-20180824
  6. pkgver=$_pkgver${_snapshot/*-/+}
  7. _islver=0.21
  8. pkgrel=1
  9. pkgdesc='The GNU Compiler Collection - cross compiler for x86_64 target'
  10. arch=(i686 armv7h)
  11. url='http://gcc.gnu.org/'
  12. license=(GPL LGPL FDL)
  13. depends=($_target-binutils libmpc zlib)
  14. makedepends=(gmp mpfr)
  15. options=(!emptydirs !strip)
  16. source=(https://gcc.gnu.org/pub/gcc/releases/gcc-$_pkgver/gcc-$_pkgver.tar.xz{,.sig}
  17. #https://gcc.gnu.org/pub/gcc/snapshots/$_snapshot/gcc-$_snapshot.tar.xz
  18. http://isl.gforge.inria.fr/isl-$_islver.tar.bz2)
  19. sha512sums=('b6134df027e734cee5395afd739fcfa4ea319a6017d662e54e89df927dea19d3fff7a6e35d676685383034e3db01c9d0b653f63574c274eeb15a2cb0bc7a1f28'
  20. 'SKIP'
  21. 'a12dff52af876aee0fd89a8d09cdc455f35ec46845e154023202392adc164848faf8ee881b59b681b696e27c69fd143a214014db4214db62f9891a1c8365c040')
  22. validpgpkeys=(33C235A34C46AA3FFB293709A328C3A2C3C45C06) # Jakub Jelinek <jakub@redhat.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. --enable-languages=c,c++ \
  48. --enable-plugins \
  49. --enable-shared \
  50. --disable-decimal-float \
  51. --disable-libffi \
  52. --disable-libgomp \
  53. --disable-libmudflap \
  54. --disable-libquadmath \
  55. --disable-libssp \
  56. --disable-libstdcxx-pch \
  57. --disable-nls \
  58. --disable-threads \
  59. --disable-tls \
  60. --disable-multilib \
  61. --with-gnu-as \
  62. --with-gnu-ld \
  63. --with-system-zlib \
  64. --with-gmp \
  65. --with-mpfr \
  66. --with-mpc \
  67. --with-isl \
  68. --with-libelf \
  69. --enable-gnu-indirect-function
  70. make $MAKEFLAGS all-gcc
  71. }
  72. package() {
  73. cd gcc-build
  74. make DESTDIR="$pkgdir" install-gcc
  75. # strip target binaries
  76. find "$pkgdir"/usr/lib/gcc/$_target/ -type f -and \( -name \*.a -or -name \*.o \) -exec $_target-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line -R .debug_str -R .debug_ranges -R .debug_loc '{}' \;
  77. # strip host binaries
  78. find "$pkgdir"/usr/bin/ "$pkgdir"/usr/lib/gcc/$_target/ -type f -and \( -executable \) -exec strip '{}' \;
  79. # Remove files that conflict with host gcc package
  80. rm -r "$pkgdir"/usr/share/man/man7
  81. rm -r "$pkgdir"/usr/share/info
  82. }