-
-
Save slokhorst/029aa3c86bdb897cb47acc3f137aa11c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $Id$ | |
# Maintainer: Ruben Van Boxem <vanboxem.ruben@gmail.com> | |
# Contributor: Sebastiaan Lokhorst <sebastiaanlokhorst@gmail.com> | |
# Contributor: Allan McRae <allan@archlinux.org> | |
pkgname=('gcc49') | |
_pkgver=4.9 | |
_pkgver_minor=3 | |
pkgver=${_pkgver}.${_pkgver_minor} | |
_islver=0.12.2 | |
_cloogver=0.18.1 | |
pkgrel=1 | |
_snapshot=4.9-20160504 | |
pkgdesc="The GNU Compiler Collection" | |
arch=('i686' 'x86_64') | |
license=('GPL' 'LGPL' 'FDL' 'custom') | |
url="http://gcc.gnu.org" | |
makedepends=('binutils>=2.25' 'libmpc' 'doxygen') | |
checkdepends=('dejagnu' 'inetutils') | |
options=('!emptydirs') | |
source=(#ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2 | |
ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-${_snapshot}.tar.bz2 | |
http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2 | |
http://www.bastoul.net/cloog/pages/download/cloog-${_cloogver}.tar.gz) | |
md5sums=('85b384c7cdbe8221d42d637b2a67b3df' | |
'e039bfcfb6c2ab039b8ee69bf883e824' | |
'e34fca0540d840e5d0f6427e98c92252') | |
#_basedir=gcc-${pkgver} | |
_basedir=gcc-${_snapshot} | |
prepare() { | |
cd ${srcdir}/${_basedir} | |
# link isl/cloog for in-tree builds | |
ln -s ../isl-${_islver} isl | |
ln -s ../cloog-${_cloogver} cloog | |
# Do not run fixincludes | |
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in | |
# Arch Linux installs x86_64 libraries /lib | |
[[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64 | |
echo ${pkgver} > gcc/BASE-VER | |
# hack! - some configure tests for header files using "$CPP $CPPFLAGS" | |
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure | |
mkdir ${srcdir}/gcc-build | |
} | |
build() { | |
cd ${srcdir}/gcc-build | |
# using -pipe causes spurious test-suite failures | |
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565 | |
CFLAGS=${CFLAGS/-pipe/} | |
CXXFLAGS=${CXXFLAGS/-pipe/} | |
${srcdir}/${_basedir}/configure --prefix=/usr \ | |
--libdir=/usr/lib --libexecdir=/usr/lib \ | |
--mandir=/usr/share/man --infodir=/usr/share/info \ | |
--with-bugurl=https://bugs.archlinux.org/ \ | |
--enable-languages=c,c++,fortran,go,lto,objc,obj-c++ \ | |
--enable-shared --enable-threads=posix \ | |
--with-system-zlib --enable-__cxa_atexit \ | |
--disable-libunwind-exceptions --enable-clocale=gnu \ | |
--disable-libstdcxx-pch --disable-libssp \ | |
--enable-gnu-unique-object --enable-linker-build-id \ | |
--enable-cloog-backend=isl \ | |
--enable-lto --enable-plugin \ | |
--with-linker-hash-style=gnu \ | |
--disable-multilib --disable-werror \ | |
--program-suffix=-${_pkgver} --enable-version-specific-runtime-libs \ | |
--enable-checking=release | |
#--enable-install-libiberty | |
export LD_PRELOAD=/usr/lib/libstdc++.so | |
make | |
} | |
package() { | |
cd ${srcdir}/gcc-build | |
make -j1 DESTDIR=${pkgdir} install | |
# Lazy way of dealing with conflicting man and info pages and locales... | |
rm -rf ${pkgdir}/usr/share/{info,locale,man} | |
# Move potentially conflicting stuff to version specific subdirectory | |
$(ls "$pkgdir"/usr/lib/gcc/$CHOST/lib* &> /dev/null) && mv "$pkgdir"/usr/lib/gcc/$CHOST/lib* "$pkgdir/usr/lib/gcc/$CHOST/$pkgver/" | |
# Install Runtime Library Exception | |
install -Dm644 ${srcdir}/${_basedir}/COPYING.RUNTIME \ | |
${pkgdir}/usr/share/licenses/$pkgname/RUNTIME.LIBRARY.EXCEPTION | |
# create symlinks | |
cd ${pkgdir}/usr/bin | |
for ii in c++ cpp g++ gcc gcc-ar gcc-nm gcc-ranlib gfortran; do | |
ln -s ${ii}-${_pkgver} ${ii}-${pkgver} | |
ln -s ${CHOST}-${ii}-${_pkgver} ${CHOST}-${ii}-${pkgver} | |
done | |
ln -s gcov-${_pkgver} gcov-${pkgver} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment