d3993b18fb
svn path=/nixpkgs/branches/stdenv-updates/; revision=10499
62 lines
1.6 KiB
Nix
62 lines
1.6 KiB
Nix
{ stdenv, fetchurl, noSysDirs
|
|
, langC ? true, langCC ? true, langF77 ? false
|
|
, profiledCompiler ? false
|
|
, staticCompiler ? false
|
|
}:
|
|
|
|
assert langC;
|
|
|
|
with import ../../../lib;
|
|
|
|
let version = "4.2.3"; in
|
|
|
|
stdenv.mkDerivation {
|
|
name = "gcc-${version}";
|
|
builder = ./builder.sh;
|
|
|
|
src =
|
|
optional /*langC*/ true (fetchurl {
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-core-${version}.tar.bz2";
|
|
sha256 = "04y84s46wzy4h44hpacf7vyla7b5zfc1qvdq3myvrhp82cp0bv4r";
|
|
}) ++
|
|
optional langCC (fetchurl {
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-g++-${version}.tar.bz2";
|
|
sha256 = "0spzz549fifwv02ym33azzwizl0zkq5m1fgy88ccmcyzmwpgyzfq";
|
|
}) ++
|
|
optional langF77 (fetchurl {
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-fortran-${version}.tar.bz2";
|
|
sha256 = "1l3ww6qymrkcfqlssb41a5fdnh6w2hqk0v2ijx56jgjbdnzawyp0";
|
|
});
|
|
|
|
patches =
|
|
[./pass-cxxcpp.patch]
|
|
++ optional noSysDirs [./no-sys-dirs.patch];
|
|
|
|
inherit noSysDirs profiledCompiler staticCompiler;
|
|
|
|
configureFlags = "
|
|
--disable-multilib
|
|
--disable-libstdcxx-pch
|
|
--with-system-zlib
|
|
--enable-languages=${
|
|
concatStrings (intersperse ","
|
|
( optional langC "c"
|
|
++ optional langCC "c++"
|
|
++ optional langF77 "f77"
|
|
)
|
|
)
|
|
}
|
|
${if stdenv.isi686 then "--with-arch=i686" else ""}
|
|
";
|
|
|
|
NIX_EXTRA_LDFLAGS = if staticCompiler then "-static" else "";
|
|
|
|
passthru = { inherit langC langCC langF77; };
|
|
|
|
meta = {
|
|
homepage = "http://gcc.gnu.org/";
|
|
license = "GPL/LGPL";
|
|
description = "GNU Compiler Collection, 4.2.x";
|
|
};
|
|
}
|