PKGBUILD 2.9 KB

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