Advertisement
Guest User

bartus

a guest
Jul 22nd, 2017
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.09 KB | None | 0 0
  1. # $Id$
  2. # Maintainer: Ruben Van Boxem <vanboxem.ruben@gmail.com>
  3. # Contributor: Allan McRae <allan@archlinux.org>
  4.  
  5. pkgname=('gcc49')
  6. _pkgver=4.9
  7. _pkgver_minor=4
  8. pkgver=${_pkgver}.${_pkgver_minor}
  9. _islver=0.12.2
  10. _cloogver=0.18.1
  11. pkgrel=1
  12. pkgdesc="The GNU Compiler Collection"
  13. arch=('i686' 'x86_64')
  14. license=('GPL' 'LGPL' 'FDL' 'custom')
  15. url="http://gcc.gnu.org"
  16. makedepends=('binutils>=2.25' 'libmpc' 'doxygen')
  17. checkdepends=('dejagnu' 'inetutils')
  18. options=(!emptydirs !buildflags)
  19. # remove -fno-plt as this flag was not supported in gcc49 and including it breaks libgcc build
  20. CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong"
  21. CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong"
  22. source=("ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2"
  23. "ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-${_islver}.tar.bz2"
  24. "ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-${_cloogver}.tar.gz")
  25. md5sums=('87c24a4090c1577ba817ec6882602491'
  26. 'e039bfcfb6c2ab039b8ee69bf883e824'
  27. 'e34fca0540d840e5d0f6427e98c92252')
  28.  
  29. _basedir=gcc-${pkgver}
  30. _libdir="usr/lib/gcc/$CHOST/$pkgver"
  31.  
  32. prepare() {
  33. cd ${srcdir}/${_basedir}
  34.  
  35. # link isl/cloog for in-tree builds
  36. ln -s ../isl-${_islver} isl
  37. ln -s ../cloog-${_cloogver} cloog
  38.  
  39. # Do not run fixincludes
  40. sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
  41.  
  42. # Arch Linux installs x86_64 libraries /lib
  43. [[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
  44.  
  45. echo ${pkgver} > gcc/BASE-VER
  46.  
  47. # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
  48. sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
  49.  
  50. msg "remove -V and -qversion as their aren't supported in latest gcc"
  51. cd ${srcdir}
  52. for file in $(grep -rl '\-V -qversion') ; do
  53. sed -i 's/ -V -qversion/ /g' $file
  54. done
  55.  
  56. mkdir ${srcdir}/gcc-build
  57. }
  58.  
  59. build() {
  60. cd ${srcdir}/gcc-build
  61.  
  62. # using -pipe causes spurious test-suite failures
  63. # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
  64. CFLAGS=${CFLAGS/-pipe/}
  65. CXXFLAGS=${CXXFLAGS/-pipe/}
  66.  
  67. ${srcdir}/${_basedir}/configure --prefix=/usr \
  68. --build=${CHOST} \
  69. --libdir=/usr/lib --libexecdir=/usr/lib \
  70. --mandir=/usr/share/man --infodir=/usr/share/info \
  71. --with-bugurl=https://bugs.archlinux.org/ \
  72. --enable-languages=c,c++,fortran,go,lto,objc,obj-c++ \
  73. --enable-shared --enable-threads=posix \
  74. --with-system-zlib --enable-__cxa_atexit \
  75. --disable-libunwind-exceptions --enable-clocale=gnu \
  76. --disable-libstdcxx-pch --disable-libssp \
  77. --enable-gnu-unique-object --enable-linker-build-id \
  78. --enable-cloog-backend=isl \
  79. --enable-lto --enable-plugin --enable-install-libiberty \
  80. --with-linker-hash-style=gnu \
  81. --disable-multilib --disable-werror \
  82. --program-suffix=-${_pkgver} --enable-version-specific-runtime-libs \
  83. --enable-checking=release
  84.  
  85. # gcc-5.0 changes
  86. # --with-default-libstdcxx-abi=c++98 - before gcc-5.0 c++ rebuild
  87. # --enable-gnu-indirect-function
  88. # --with-isl - cloog no longer needed
  89.  
  90. export LD_PRELOAD=/usr/lib/libstdc++.so
  91. make
  92.  
  93. # make documentation
  94. make -C $CHOST/libstdc++-v3/doc doc-man-doxygen
  95. }
  96.  
  97. package()
  98. {
  99. cd ${srcdir}/gcc-build
  100.  
  101. make -j1 DESTDIR=${pkgdir} install
  102.  
  103. ## Lazy way of dealing with conflicting man and info pages and locales...
  104. rm -rf ${pkgdir}/usr/share/
  105. rm -rf ${pkgdir}/usr/include/
  106. find ${pkgdir}/ -name \*iberty\* | xargs rm
  107.  
  108. # Move potentially conflicting stuff to version specific subdirectory
  109. $(ls "$pkgdir"/usr/lib/gcc/$CHOST/lib* &> /dev/null) && mv "$pkgdir"/usr/lib/gcc/$CHOST/lib* "$pkgdir/usr/lib/gcc/$CHOST/$pkgver/"
  110.  
  111. # Install Runtime Library Exception
  112. install -Dm644 ${srcdir}/gcc-${pkgver}/COPYING.RUNTIME \
  113. ${pkgdir}/usr/share/licenses/$pkgname/RUNTIME.LIBRARY.EXCEPTION
  114.  
  115. # create symlinks
  116. cd ${pkgdir}/usr/bin
  117. rm ${CHOST}-gcc-${pkgver}
  118. for ii in c++ cpp g++ gcc gcc-ar gcc-nm gcc-ranlib gfortran; do
  119. ln -s ${ii}-${_pkgver} ${ii}-${pkgver}
  120. ln -s ${CHOST}-${ii}-${_pkgver} ${CHOST}-${ii}-${pkgver}
  121. done
  122. ln -s gcov-${_pkgver} gcov-${pkgver}
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement