2008-06-26 12:20:33 +02:00
|
|
|
{ stdenv, fetchurl, noSysDirs
|
2008-06-27 16:43:25 +02:00
|
|
|
, langC ? true, langCC ? true, langFortran ? false, langTreelang ? false
|
2008-06-26 12:20:33 +02:00
|
|
|
, profiledCompiler ? false
|
|
|
|
, staticCompiler ? false
|
|
|
|
, texinfo ? null
|
|
|
|
, gmp, mpfr
|
2008-06-27 16:43:25 +02:00
|
|
|
, bison ? null, flex ? null
|
2008-06-27 20:26:19 +02:00
|
|
|
, enableMultilib ? false
|
2008-06-26 12:20:33 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert langC;
|
2008-06-27 16:43:25 +02:00
|
|
|
assert langTreelang -> bison != null && flex != null;
|
2008-06-26 12:20:33 +02:00
|
|
|
|
|
|
|
with import ../../../lib;
|
|
|
|
|
2009-01-27 12:53:35 +01:00
|
|
|
let version = "4.3.3"; in
|
2008-06-26 12:20:33 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "gcc-${version}";
|
|
|
|
builder = ./builder.sh;
|
|
|
|
|
|
|
|
src =
|
|
|
|
optional /*langC*/ true (fetchurl {
|
2009-01-27 12:53:35 +01:00
|
|
|
url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
|
|
|
|
sha256 = "08yksvipnqmqbmif30rwjkg3y0m6ray5r84wa2argv8q0bpz9426";
|
2008-06-26 12:20:33 +02:00
|
|
|
}) ++
|
|
|
|
optional langCC (fetchurl {
|
2009-01-28 14:44:44 +01:00
|
|
|
url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
|
2009-01-27 12:53:35 +01:00
|
|
|
sha256 = "12z2zh03yq214qs2cqzh8c64jjfz544nk1lzi9rygjwm8yjsvzm9";
|
2008-06-26 12:20:33 +02:00
|
|
|
}) ++
|
2008-06-27 16:43:25 +02:00
|
|
|
optional langFortran (fetchurl {
|
2009-01-28 14:44:44 +01:00
|
|
|
url = "mirror://gcc/releases/gcc-${version}/gcc-fortran-${version}.tar.bz2";
|
2009-01-27 12:53:35 +01:00
|
|
|
sha256 = "1b2wbysviyh7l9fqbd6zy5y6y89xgysy99gr8wx8xkc1hy2nwdsq";
|
2008-06-26 12:20:33 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
patches =
|
|
|
|
[./pass-cxxcpp.patch]
|
2008-06-27 16:43:25 +02:00
|
|
|
++ optional noSysDirs ./no-sys-dirs.patch
|
|
|
|
++ optional (noSysDirs && langFortran) ./no-sys-dirs-fortran.patch;
|
2008-06-26 12:20:33 +02:00
|
|
|
|
|
|
|
inherit noSysDirs profiledCompiler staticCompiler;
|
|
|
|
|
2008-06-27 16:43:25 +02:00
|
|
|
buildInputs = [texinfo gmp mpfr]
|
|
|
|
++ optionals langTreelang [bison flex];
|
2008-06-26 12:20:33 +02:00
|
|
|
|
|
|
|
configureFlags = "
|
2008-06-27 20:26:19 +02:00
|
|
|
${if enableMultilib then "" else "--disable-multilib"}
|
2008-06-26 12:20:33 +02:00
|
|
|
--disable-libstdcxx-pch
|
|
|
|
--with-system-zlib
|
|
|
|
--enable-languages=${
|
|
|
|
concatStrings (intersperse ","
|
2008-06-27 16:43:25 +02:00
|
|
|
( optional langC "c"
|
|
|
|
++ optional langCC "c++"
|
|
|
|
++ optional langFortran "fortran"
|
|
|
|
++ optional langTreelang "treelang"
|
2008-06-26 12:20:33 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
${if stdenv.isi686 then "--with-arch=i686" else ""}
|
|
|
|
";
|
|
|
|
|
|
|
|
NIX_EXTRA_LDFLAGS = if staticCompiler then "-static" else "";
|
|
|
|
|
|
|
|
inherit gmp mpfr;
|
2008-06-27 20:26:19 +02:00
|
|
|
|
|
|
|
passthru = { inherit langC langCC langFortran langTreelang enableMultilib; };
|
2008-06-26 12:20:33 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://gcc.gnu.org/";
|
|
|
|
license = "GPL/LGPL";
|
|
|
|
description = "GNU Compiler Collection, 4.3.x";
|
|
|
|
};
|
|
|
|
}
|