2007-05-17 17:27:54 +01:00
|
|
|
{ stdenv, fetchurl, noSysDirs
|
|
|
|
, langC ? true, langCC ? true, langF77 ? false
|
|
|
|
, profiledCompiler ? false
|
|
|
|
, staticCompiler ? false
|
2008-02-21 15:34:56 +00:00
|
|
|
, texinfo ? null
|
2007-05-17 17:27:54 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert langC;
|
|
|
|
|
2007-05-20 21:27:55 +01:00
|
|
|
with import ../../../lib;
|
|
|
|
|
2008-02-04 15:15:06 +00:00
|
|
|
let version = "4.2.3"; in
|
|
|
|
|
2007-05-17 17:27:54 +01:00
|
|
|
stdenv.mkDerivation {
|
2008-02-04 15:15:06 +00:00
|
|
|
name = "gcc-${version}";
|
2007-05-17 17:27:54 +01:00
|
|
|
builder = ./builder.sh;
|
|
|
|
|
|
|
|
src =
|
2007-08-27 13:44:01 +01:00
|
|
|
optional /*langC*/ true (fetchurl {
|
2008-02-04 15:15:06 +00:00
|
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-core-${version}.tar.bz2";
|
|
|
|
sha256 = "04y84s46wzy4h44hpacf7vyla7b5zfc1qvdq3myvrhp82cp0bv4r";
|
2007-08-27 13:44:01 +01:00
|
|
|
}) ++
|
2007-11-21 19:28:54 +00:00
|
|
|
optional langCC (fetchurl {
|
2008-02-04 15:15:06 +00:00
|
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-g++-${version}.tar.bz2";
|
|
|
|
sha256 = "0spzz549fifwv02ym33azzwizl0zkq5m1fgy88ccmcyzmwpgyzfq";
|
2007-08-27 13:44:01 +01:00
|
|
|
}) ++
|
|
|
|
optional langF77 (fetchurl {
|
2008-02-04 15:15:06 +00:00
|
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-fortran-${version}.tar.bz2";
|
|
|
|
sha256 = "1l3ww6qymrkcfqlssb41a5fdnh6w2hqk0v2ijx56jgjbdnzawyp0";
|
2007-08-27 13:44:01 +01:00
|
|
|
});
|
2007-05-17 17:27:54 +01:00
|
|
|
|
|
|
|
patches =
|
|
|
|
[./pass-cxxcpp.patch]
|
2007-05-20 21:27:55 +01:00
|
|
|
++ optional noSysDirs [./no-sys-dirs.patch];
|
2007-05-17 17:27:54 +01:00
|
|
|
|
2007-05-20 21:27:55 +01:00
|
|
|
inherit noSysDirs profiledCompiler staticCompiler;
|
2007-05-17 17:27:54 +01:00
|
|
|
|
2008-02-21 17:34:03 +00:00
|
|
|
buildInputs = [texinfo];
|
2008-02-21 15:34:56 +00:00
|
|
|
|
2007-05-17 17:27:54 +01:00
|
|
|
configureFlags = "
|
|
|
|
--disable-multilib
|
|
|
|
--disable-libstdcxx-pch
|
2007-05-20 21:27:55 +01: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 17:27:54 +01:00
|
|
|
";
|
|
|
|
|
2007-11-21 19:28:54 +00:00
|
|
|
NIX_EXTRA_LDFLAGS = if staticCompiler then "-static" else "";
|
2007-05-17 17:27:54 +01:00
|
|
|
|
2007-05-20 21:27:55 +01:00
|
|
|
passthru = { inherit langC langCC langF77; };
|
|
|
|
|
2007-05-17 17:27:54 +01:00
|
|
|
meta = {
|
|
|
|
homepage = "http://gcc.gnu.org/";
|
|
|
|
license = "GPL/LGPL";
|
2007-05-20 21:27:55 +01:00
|
|
|
description = "GNU Compiler Collection, 4.2.x";
|
2007-05-17 17:27:54 +01:00
|
|
|
};
|
|
|
|
}
|