2007-05-17 18:27:54 +02:00
|
|
|
{ stdenv, fetchurl, noSysDirs
|
|
|
|
, langC ? true, langCC ? true, langF77 ? false
|
|
|
|
, profiledCompiler ? false
|
|
|
|
, staticCompiler ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert langC;
|
|
|
|
|
2007-05-20 22:27:55 +02:00
|
|
|
with import ../../../lib;
|
|
|
|
|
2007-05-17 18:27:54 +02:00
|
|
|
stdenv.mkDerivation {
|
2007-11-15 16:19:58 +01:00
|
|
|
name = "gcc-4.2.2";
|
2007-05-17 18:27:54 +02:00
|
|
|
builder = ./builder.sh;
|
|
|
|
|
|
|
|
src =
|
2007-08-27 14:44:01 +02:00
|
|
|
optional /*langC*/ true (fetchurl {
|
2007-11-15 16:19:58 +01:00
|
|
|
url = mirror://gnu/gcc/gcc-4.2.2/gcc-core-4.2.2.tar.bz2;
|
|
|
|
sha256 = "01hdwd4im2xzg159fk022zqyhlxphqvpmabd25bqb8fjbs2yi80a";
|
2007-08-27 14:44:01 +02:00
|
|
|
}) ++
|
2007-11-21 20:28:54 +01:00
|
|
|
optional langCC (fetchurl {
|
2007-11-15 16:19:58 +01:00
|
|
|
url = mirror://gnu/gcc/gcc-4.2.2/gcc-g++-4.2.2.tar.bz2;
|
|
|
|
sha256 = "04xankxi3bi4gvgv8rq9h6w3bdx59bg9zh0zv6lyw373gy26ygmq";
|
2007-08-27 14:44:01 +02:00
|
|
|
}) ++
|
|
|
|
optional langF77 (fetchurl {
|
2007-11-15 16:19:58 +01:00
|
|
|
url = mirror://gnu/gcc/gcc-4.2.2/gcc-fortran-4.2.2.tar.bz2;
|
|
|
|
sha256 = "1fybl88w0l99cqppx18i6hnq5dsrssx3qd7vr2ybmmk3nfx8pziq";
|
2007-08-27 14:44:01 +02:00
|
|
|
});
|
2007-05-17 18:27:54 +02:00
|
|
|
|
|
|
|
patches =
|
|
|
|
[./pass-cxxcpp.patch]
|
2007-05-20 22:27:55 +02:00
|
|
|
++ optional noSysDirs [./no-sys-dirs.patch];
|
2007-05-17 18:27:54 +02:00
|
|
|
|
2007-05-20 22:27:55 +02:00
|
|
|
inherit noSysDirs profiledCompiler staticCompiler;
|
2007-05-17 18:27:54 +02:00
|
|
|
|
|
|
|
configureFlags = "
|
|
|
|
--disable-multilib
|
|
|
|
--disable-libstdcxx-pch
|
2007-05-20 22:27:55 +02:00
|
|
|
--with-system-zlib
|
|
|
|
--enable-languages=${
|
|
|
|
concatStrings (intersperse ","
|
|
|
|
( optional langC "c"
|
|
|
|
++ optional langCC "c++"
|
|
|
|
++ optional langF77 "f77"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
${if stdenv.isi686 then "--with-arch=i686" else ""}
|
2007-05-17 18:27:54 +02:00
|
|
|
";
|
|
|
|
|
2007-11-21 20:28:54 +01:00
|
|
|
NIX_EXTRA_LDFLAGS = if staticCompiler then "-static" else "";
|
2007-05-17 18:27:54 +02:00
|
|
|
|
2007-05-20 22:27:55 +02:00
|
|
|
passthru = { inherit langC langCC langF77; };
|
|
|
|
|
2007-05-17 18:27:54 +02:00
|
|
|
meta = {
|
|
|
|
homepage = "http://gcc.gnu.org/";
|
|
|
|
license = "GPL/LGPL";
|
2007-05-20 22:27:55 +02:00
|
|
|
description = "GNU Compiler Collection, 4.2.x";
|
2007-05-17 18:27:54 +02:00
|
|
|
};
|
|
|
|
}
|