2007-05-17 17:27:54 +01:00
|
|
|
{ stdenv, fetchurl, noSysDirs
|
2009-04-09 16:24:33 +01:00
|
|
|
, langC ? true, langCC ? true, langFortran ? false
|
2007-05-17 17:27:54 +01:00
|
|
|
, profiledCompiler ? false
|
|
|
|
, staticCompiler ? false
|
2009-04-09 16:24:33 +01: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"
|
2007-05-17 17:27:54 +01:00
|
|
|
}:
|
|
|
|
|
2009-04-09 16:24:33 +01:00
|
|
|
with stdenv.lib;
|
2007-05-20 21:27:55 +01:00
|
|
|
|
2008-05-26 08:36:32 +01:00
|
|
|
let version = "4.2.4"; in
|
2008-02-04 15:15:06 +00:00
|
|
|
|
2007-05-17 17:27:54 +01:00
|
|
|
stdenv.mkDerivation {
|
2009-04-09 16:24:33 +01:00
|
|
|
name = "${name}-${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";
|
2008-05-26 08:36:32 +01:00
|
|
|
sha256 = "0cm5yzhqhgdfk03aayakmdj793sya42xkkqhslj7s2b697hygjfg";
|
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";
|
2008-05-26 08:36:32 +01:00
|
|
|
sha256 = "0gq8ikci0qqgck71qqlhfld6zkwn9179x6z15vdd9blkdig55nxg";
|
2007-08-27 13:44:01 +01:00
|
|
|
}) ++
|
2009-04-09 16:24:33 +01:00
|
|
|
optional langFortran (fetchurl {
|
2008-02-04 15:15:06 +00:00
|
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-fortran-${version}.tar.bz2";
|
2008-05-26 08:36:32 +01:00
|
|
|
sha256 = "013yqiqhdavgxzjryvylgf3lcnknmw89fx41jf2v4899srn0bhkg";
|
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
|
|
|
|
2009-04-09 16:24:33 +01:00
|
|
|
buildInputs = [gmp mpfr 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 ","
|
2009-04-09 16:24:33 +01:00
|
|
|
( optional langC "c"
|
|
|
|
++ optional langCC "c++"
|
|
|
|
++ optional langFortran "fortran"
|
2007-05-20 21:27:55 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
${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
|
|
|
|
2009-04-09 16:24:33 +01:00
|
|
|
passthru = { inherit langC langCC langFortran; };
|
2007-05-20 21:27:55 +01:00
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|