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