# GNU C Compiler
# Mostly required to support languages different than C or C++
[buildout]
extends =
  ../gmp/buildout.cfg
  ../xz-utils/buildout.cfg

parts =
  gcc

[mpfr]
recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/gnu/mpfr/mpfr-3.1.2.tar.xz
md5sum = e3d203d188b8fe60bb6578dd3152e05c
configure-options =
  --with-gmp=${gmp:location}
  --disable-static
environment =
  PATH=${xz-utils:location}/bin:%(PATH)s
  LDFLAGS=-Wl,-rpath=${gmp:location}/lib

[mpc]
recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/gnu/mpc/mpc-1.0.2.tar.gz
md5sum = 68fadff3358fb3e7976c7a398a0af4c3
configure-options =
  --with-gmp=${gmp:location}
  --with-mpfr=${mpfr:location}
  --disable-static
environment =
  LDFLAGS=-Wl,-rpath=${gmp:location}/lib -Wl,-rpath=${mpfr:location}/lib

[isl]
recipe = slapos.recipe.cmmi
url = ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.12.2.tar.bz2
md5sum = e039bfcfb6c2ab039b8ee69bf883e824
configure-options =
  --with-gmp-prefix=${gmp:location}
  --disable-static
environment =
  LDFLAGS=-Wl,-rpath=${gmp:location}/lib

[cloog]
recipe = slapos.recipe.cmmi
url = ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1.tar.gz
md5sum = e34fca0540d840e5d0f6427e98c92252
configure-options =
  --with-gmp-prefix=${gmp:location}
  --with-isl-prefix=${isl:location}
  --disable-static
environment =
  LDFLAGS=-Wl,-rpath=${gmp:location}/lib -Wl,-rpath=${isl:location}/lib

[gcc-common]
recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/gnu/gcc/gcc-4.9.2/gcc-4.9.2.tar.bz2
md5sum = 4df8ee253b7f3863ad0b86359cd39c43
# make install does not work when several core are used
make-targets = install -j1

[gcc]
<= gcc-common
configure-options =
  --disable-bootstrap
  --disable-multilib
  --with-gmp=${gmp:location}
  --with-mpfr=${mpfr:location}
  --with-mpc=${mpc:location}
  --enable-languages="c,c++"
  --with-isl=${isl:location}
  --with-cloog=${cloog:location}
environment =
  LDFLAGS=-Wl,-rpath=${cloog:location}/lib -Wl,-rpath=${gmp:location}/lib -Wl,-rpath=${isl:location}/lib -Wl,-rpath=${mpc:location}/lib -Wl,-rpath=${mpfr:location}/lib

[gcc-minimal]
<= gcc-common
configure-options =
  --disable-bootstrap
  --disable-multilib
  --with-gmp=${gmp:location}
  --with-mpfr=${mpfr:location}
  --with-mpc=${mpc:location}
  --enable-languages=c
  --without-isl
  --without-cloog
environment =
  LDFLAGS=-Wl,-rpath=${gmp:location}/lib -Wl,-rpath=${mpc:location}/lib -Wl,-rpath=${mpfr:location}/lib

[gcc-fortran]
<= gcc-common
configure-options =
  --disable-bootstrap
  --disable-multilib
  --with-gmp=${gmp:location}
  --with-mpfr=${mpfr:location}
  --with-mpc=${mpc:location}
  --enable-languages="c,c++,fortran"
  --with-isl=${isl:location}
  --with-cloog=${cloog:location}
environment =
  LDFLAGS=-Wl,-rpath=${cloog:location}/lib -Wl,-rpath=${gmp:location}/lib -Wl,-rpath=${isl:location}/lib -Wl,-rpath=${mpc:location}/lib -Wl,-rpath=${mpfr:location}/lib