2007-05-17 18:27:54 +02:00
|
|
|
{ stdenv, fetchurl, noSysDirs
|
2009-04-09 17:24:33 +02:00
|
|
|
, langC ? true, langCC ? true, langFortran ? false
|
2007-05-17 18:27:54 +02:00
|
|
|
, profiledCompiler ? false
|
|
|
|
, staticCompiler ? false
|
2009-04-09 17:24:33 +02:00
|
|
|
, gmp ? null
|
|
|
|
, mpfr ? null
|
2008-02-21 16:34:56 +01:00
|
|
|
, texinfo ? null
|
2009-04-09 17:24:33 +02:00
|
|
|
, name ? "gcc"
|
2007-05-17 18:27:54 +02:00
|
|
|
}:
|
|
|
|
|
2009-04-09 17:24:33 +02:00
|
|
|
with stdenv.lib;
|
2007-05-20 22:27:55 +02:00
|
|
|
|
2008-05-26 09:36:32 +02:00
|
|
|
let version = "4.2.4"; in
|
2008-02-04 16:15:06 +01:00
|
|
|
|
2007-05-17 18:27:54 +02:00
|
|
|
stdenv.mkDerivation {
|
2009-04-09 17:24:33 +02:00
|
|
|
name = "${name}-${version}";
|
|
|
|
|
2007-05-17 18:27:54 +02:00
|
|
|
builder = ./builder.sh;
|
|
|
|
|
|
|
|
src =
|
2007-08-27 14:44:01 +02:00
|
|
|
optional /*langC*/ true (fetchurl {
|
2008-02-04 16:15:06 +01:00
|
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-core-${version}.tar.bz2";
|
2008-05-26 09:36:32 +02:00
|
|
|
sha256 = "0cm5yzhqhgdfk03aayakmdj793sya42xkkqhslj7s2b697hygjfg";
|
2007-08-27 14:44:01 +02:00
|
|
|
}) ++
|
2007-11-21 20:28:54 +01:00
|
|
|
optional langCC (fetchurl {
|
2008-02-04 16:15:06 +01:00
|
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-g++-${version}.tar.bz2";
|
2008-05-26 09:36:32 +02:00
|
|
|
sha256 = "0gq8ikci0qqgck71qqlhfld6zkwn9179x6z15vdd9blkdig55nxg";
|
2007-08-27 14:44:01 +02:00
|
|
|
}) ++
|
2009-04-09 17:24:33 +02:00
|
|
|
optional langFortran (fetchurl {
|
2008-02-04 16:15:06 +01:00
|
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-fortran-${version}.tar.bz2";
|
2008-05-26 09:36:32 +02:00
|
|
|
sha256 = "013yqiqhdavgxzjryvylgf3lcnknmw89fx41jf2v4899srn0bhkg";
|
2007-08-27 14:44:01 +02:00
|
|
|
});
|
2013-04-10 14:46:50 +02:00
|
|
|
|
2007-05-17 18:27:54 +02:00
|
|
|
patches =
|
2013-04-10 14:46:50 +02:00
|
|
|
[./pass-cxxcpp.patch ./siginfo_t.patch]
|
2007-05-20 22:27:55 +02:00
|
|
|
++ optional noSysDirs [./no-sys-dirs.patch];
|
2013-04-10 14:46:50 +02:00
|
|
|
|
2007-05-20 22:27:55 +02:00
|
|
|
inherit noSysDirs profiledCompiler staticCompiler;
|
2007-05-17 18:27:54 +02:00
|
|
|
|
2009-04-09 17:24:33 +02:00
|
|
|
buildInputs = [gmp mpfr texinfo];
|
2008-02-21 16:34:56 +01:00
|
|
|
|
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 ","
|
2009-04-09 17:24:33 +02:00
|
|
|
( optional langC "c"
|
|
|
|
++ optional langCC "c++"
|
|
|
|
++ optional langFortran "fortran"
|
2007-05-20 22:27:55 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
${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
|
|
|
|
2009-04-09 17:24:33 +02:00
|
|
|
passthru = { inherit langC langCC langFortran; };
|
2007-05-20 22:27:55 +02:00
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|