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

parts =
  gcc

[mpfr]
recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/gnu/mpfr/mpfr-3.1.3.tar.xz
md5sum = 6969398cd2fbc56a6af570b5273c56a9
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.3.tar.gz
md5sum = d6a1d5f8ddea3abd2cc3e98f58352d26
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.16.1.tar.bz2
md5sum = ac1f25a0677912952718a51f5bc20f32
configure-options =
  --with-gmp-prefix=${gmp:location}
  --disable-static
environment =
  LDFLAGS=-Wl,-rpath=${gmp:location}/lib

[gcc-common]
recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.bz2
md5sum = 4c626ac2a83ef30dfb9260e6f59c2b30
# 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}
environment =
  LDFLAGS=-Wl,-rpath=${gmp:location}/lib -Wl,-rpath=${isl:location}/lib -Wl,-rpath=${mpc:location}/lib -Wl,-rpath=${mpfr:location}/lib
  PATH=${perl:location}/bin:${tar:location}/bin:%(PATH)s

[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
  PATH=${perl:location}/bin:${tar:location}/bin:%(PATH)s

[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}
environment =
  LDFLAGS=-Wl,-rpath=${gmp:location}/lib -Wl,-rpath=${isl:location}/lib -Wl,-rpath=${mpc:location}/lib -Wl,-rpath=${mpfr:location}/lib
  PATH=${perl:location}/bin:${tar:location}/bin:%(PATH)s