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