2006-10-27 22:08:53 +02:00
|
|
|
{ stdenv, fetchurl, noSysDirs
|
2009-04-09 17:24:33 +02:00
|
|
|
, langC ? true, langCC ? true, langFortran ? false
|
2006-10-27 22:08:53 +02:00
|
|
|
, profiledCompiler ? false
|
|
|
|
, staticCompiler ? false
|
2007-10-28 21:19:43 +01:00
|
|
|
, gmp ? null
|
|
|
|
, mpfr ? null
|
2008-02-21 16:34:56 +01:00
|
|
|
, texinfo ? null
|
2009-04-09 17:24:33 +02:00
|
|
|
, name ? "gcc"
|
2006-10-27 22:08:53 +02:00
|
|
|
}:
|
|
|
|
|
2009-04-09 17:24:33 +02:00
|
|
|
assert langC || langFortran;
|
2006-10-27 22:08:53 +02:00
|
|
|
|
2012-02-17 22:47:08 +01:00
|
|
|
with stdenv.lib;
|
2007-05-24 15:30:09 +02:00
|
|
|
|
2008-02-21 18:34:03 +01:00
|
|
|
stdenv.mkDerivation {
|
2009-04-09 17:24:33 +02:00
|
|
|
name = "${name}-4.1.2";
|
|
|
|
|
|
|
|
builder = ./builder.sh;
|
2006-10-27 22:08:53 +02:00
|
|
|
|
|
|
|
src =
|
2007-11-21 20:28:54 +01:00
|
|
|
optional /*langC*/ true (fetchurl {
|
2007-08-27 14:44:01 +02:00
|
|
|
url = mirror://gnu/gcc/gcc-4.1.2/gcc-core-4.1.2.tar.bz2;
|
2007-05-24 15:30:09 +02:00
|
|
|
sha256 = "07binc1hqlr0g387zrg5sp57i12yzd5ja2lgjb83bbh0h3gwbsbv";
|
2007-11-21 20:28:54 +01:00
|
|
|
}) ++
|
|
|
|
optional /*langCC*/ true (fetchurl {
|
2007-08-27 14:44:01 +02:00
|
|
|
url = mirror://gnu/gcc/gcc-4.1.2/gcc-g++-4.1.2.tar.bz2;
|
2007-05-24 15:30:09 +02:00
|
|
|
sha256 = "1qm2izcxna10jai0v4s41myki0xkw9174qpl6k1rnrqhbx0sl1hc";
|
2007-11-21 20:28:54 +01:00
|
|
|
}) ++
|
2009-04-09 17:24:33 +02:00
|
|
|
optional langFortran (fetchurl {
|
2007-08-27 14:44:01 +02:00
|
|
|
url = mirror://gnu/gcc/gcc-4.1.2/gcc-fortran-4.1.2.tar.bz2;
|
2007-05-24 15:30:09 +02:00
|
|
|
sha256 = "0772dhmm4gc10420h0d0mfkk2sirvjmjxz8j0ywm8wp5qf8vdi9z";
|
2007-11-21 20:28:54 +01:00
|
|
|
});
|
2006-10-27 22:08:53 +02:00
|
|
|
|
|
|
|
patches =
|
2007-05-24 15:30:09 +02:00
|
|
|
optional noSysDirs [./no-sys-dirs.patch];
|
2006-10-27 22:08:53 +02:00
|
|
|
|
2007-05-24 15:30:09 +02:00
|
|
|
inherit noSysDirs profiledCompiler staticCompiler;
|
2006-10-27 22:08:53 +02:00
|
|
|
|
2008-02-21 18:34:03 +01:00
|
|
|
buildInputs = [gmp mpfr texinfo];
|
2011-08-02 18:02:53 +02:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2008-02-21 18:34:03 +01:00
|
|
|
|
2006-10-27 22:08:53 +02:00
|
|
|
configureFlags = "
|
|
|
|
--disable-multilib
|
|
|
|
--disable-libstdcxx-pch
|
2007-05-24 15:30:09 +02:00
|
|
|
--with-system-zlib
|
|
|
|
--enable-languages=${
|
|
|
|
concatStrings (intersperse ","
|
2009-04-09 17:24:33 +02:00
|
|
|
( optional langC "c"
|
|
|
|
++ optional langCC "c++"
|
|
|
|
++ optional langFortran "fortran"
|
2007-05-24 15:30:09 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
${if stdenv.isi686 then "--with-arch=i686" else ""}
|
2006-10-27 22:08:53 +02:00
|
|
|
";
|
|
|
|
|
|
|
|
makeFlags = if staticCompiler then "LDFLAGS=-static" else "";
|
|
|
|
|
2009-04-09 17:24:33 +02:00
|
|
|
passthru = { inherit langC langCC langFortran; };
|
2007-05-24 15:30:09 +02:00
|
|
|
|
2006-10-27 22:08:53 +02:00
|
|
|
meta = {
|
|
|
|
homepage = "http://gcc.gnu.org/";
|
|
|
|
license = "GPL/LGPL";
|
|
|
|
description = "GNU Compiler Collection, 4.1.x";
|
2007-05-31 15:00:49 +02:00
|
|
|
|
|
|
|
# Give the real GCC a lower priority than the GCC wrapper so that
|
|
|
|
# both can be installed at the same time.
|
|
|
|
priority = "7";
|
2006-10-27 22:08:53 +02:00
|
|
|
};
|
|
|
|
}
|