Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
988
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.38 KB | None | 0 0
  1. # Contributor: Alexander 'hatred' Drozdov <adrozdoff@gmail.com>
  2. # Contributor: toha257 <toha257@gmail.com>
  3. # Contributor: Allan McRae <allan@archlinux.org>
  4. # Contributor: Kevin Mihelich <kevin@archlinuxarm.org>
  5. # Maintainer: Tavian Barnes <tavianator@tavianator.com>
  6.  
  7. _target="arm-linux-gnueabihf"
  8. pkgname=${_target}-gcc-stage2
  9. pkgver=7.1.1
  10. _pkgver=${pkgver:0:1}
  11. _islver=0.18
  12. pkgrel=4
  13. _commit=d791474f3fc2133fa0c310e566988b0cbdff321e
  14. pkgdesc="The GNU Compiler Collection. Stage 2 for toolchain building (${_target})"
  15. arch=('i686' 'x86_64')
  16. license=('GPL' 'LGPL' 'FDL' 'custom')
  17. url="http://gcc.gnu.org"
  18. depends=("${_target}-binutils>=2.28.0-4" "${_target}-glibc-headers>=2.25-7" 'libmpc' 'zlib')
  19. options=('!emptydirs' '!distcc' '!strip')
  20. conflicts=("${_target}-gcc-stage1")
  21. replaces=("${_target}-gcc-stage1")
  22. provides=("${_target}-gcc-stage1=${pkgver}")
  23. source=(https://github.com/gcc-mirror/gcc/archive/${_commit}.tar.gz
  24.         http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2
  25.         Revert-eeb6872bf.patch)
  26. md5sums=('9a8b4ce493c5d311e28388ae3d023ce6'
  27.          '11436d6b205e516635b666090b94ab32'
  28.          'e4c9c8b498b04c0f51d219d025ca8407')
  29.  
  30. prepare() {
  31.   mv gcc-${_commit}* gcc
  32.   cd ${srcdir}/gcc
  33.  
  34.   # link isl for in-tree build
  35.   ln -s ../isl-${_islver} isl
  36.  
  37.   # Do not run fixincludes
  38.   sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
  39.  
  40.   # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
  41.   sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
  42.  
  43.   # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80717
  44.   patch -p1 -i ${srcdir}/Revert-eeb6872bf.patch
  45.  
  46.   mkdir ${srcdir}/gcc-build
  47. }
  48.  
  49. build() {
  50.   cd ${srcdir}/gcc-build
  51.  
  52.   # using -pipe causes spurious test-suite failures
  53.   # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
  54.   CFLAGS=${CFLAGS/-pipe/}
  55.   CXXFLAGS=${CXXFLAGS/-pipe/}
  56.  
  57.   ${srcdir}/gcc/configure --prefix=/usr \
  58.       --program-prefix=${_target}- \
  59.       --with-local-prefix=/usr/${_target} \
  60.       --with-sysroot=/usr/${_target} \
  61.       --with-build-sysroot=/usr/${_target} \
  62.       --with-as=/usr/bin/${_target}-as \
  63.       --with-ld=/usr/bin/${_target}-ld \
  64.       --libdir=/usr/lib \
  65.       --libexecdir=/usr/lib \
  66.       --disable-nls \
  67.       --enable-languages=c,c++ \
  68.       --disable-shared \
  69.       --disable-threads \
  70.       --with-system-zlib \
  71.       --with-isl \
  72.       --enable-__cxa_atexit \
  73.       --disable-libunwind-exceptions \
  74.       --enable-clocale=gnu \
  75.       --disable-libstdcxx-pch \
  76.       --disable-libssp \
  77.       --enable-gnu-unique-object \
  78.       --enable-linker-build-id \
  79.       --disable-lto \
  80.       --disable-plugin \
  81.       --enable-install-libiberty \
  82.       --with-linker-hash-style=gnu \
  83.       --enable-gnu-indirect-function \
  84.       --disable-multilib \
  85.       --disable-werror \
  86.       --enable-checking=release \
  87.       --enable-default-pie \
  88.       --enable-default-ssp \
  89.       --target=${_target} \
  90.       --host=${CHOST} \
  91.       --build=${CHOST} \
  92.       --with-arch=armv6 \
  93.       --with-float=hard \
  94.       --with-fpu=vfp
  95.  
  96.   make all-gcc all-target-libgcc
  97. }
  98.  
  99. package() {
  100.   cd ${srcdir}/gcc-build
  101.  
  102.   make DESTDIR=${pkgdir} install-gcc install-target-libgcc
  103.  
  104.   rm -rf ${pkgdir}/usr/share
  105.  
  106.   # strip it manually
  107.   strip ${pkgdir}/usr/bin/* 2>/dev/null || true
  108.   find ${pkgdir}/usr/lib -type f -exec /usr/bin/${_target}-strip \
  109.     --strip-unneeded {} \; 2>/dev/null || true
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement