2008-06-26 11:20:33 +01:00
|
|
|
{ stdenv, fetchurl, noSysDirs
|
2008-06-27 15:43:25 +01:00
|
|
|
, langC ? true, langCC ? true, langFortran ? false, langTreelang ? false
|
2008-06-26 11:20:33 +01:00
|
|
|
, profiledCompiler ? false
|
|
|
|
, staticCompiler ? false
|
|
|
|
, texinfo ? null
|
|
|
|
, gmp, mpfr
|
2008-06-27 15:43:25 +01:00
|
|
|
, bison ? null, flex ? null
|
2008-06-27 19:26:19 +01:00
|
|
|
, enableMultilib ? false
|
2008-06-26 11:20:33 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert langC;
|
2008-06-27 15:43:25 +01:00
|
|
|
assert langTreelang -> bison != null && flex != null;
|
2008-06-26 11:20:33 +01:00
|
|
|
|
|
|
|
with import ../../../lib;
|
|
|
|
|
|
|
|
let version = "4.3.1"; 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 = "18spk152j1vqa9bzhi93i7cgrmf7gncv0h1lm1mxxgn1ahrnnw67";
|
|
|
|
}) ++
|
|
|
|
optional langCC (fetchurl {
|
|
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-g++-${version}.tar.bz2";
|
|
|
|
sha256 = "0r74s60hylr8xrnb2j3x0dmf3cnxxg609g4h07r6ida8vk33bd25";
|
|
|
|
}) ++
|
2008-06-27 15:43:25 +01:00
|
|
|
optional langFortran (fetchurl {
|
2008-06-26 11:20:33 +01:00
|
|
|
url = "mirror://gnu/gcc/gcc-${version}/gcc-fortran-${version}.tar.bz2";
|
|
|
|
sha256 = "1fl76sajlz1ihnsmqsbs3i8g0h77w9hm35pwb1s2w6p4h5xy5dnb";
|
|
|
|
});
|
|
|
|
|
|
|
|
patches =
|
|
|
|
[./pass-cxxcpp.patch]
|
2008-06-27 15:43:25 +01:00
|
|
|
++ optional noSysDirs ./no-sys-dirs.patch
|
|
|
|
++ optional (noSysDirs && langFortran) ./no-sys-dirs-fortran.patch;
|
2008-06-26 11:20:33 +01:00
|
|
|
|
|
|
|
inherit noSysDirs profiledCompiler staticCompiler;
|
|
|
|
|
2008-06-27 15:43:25 +01:00
|
|
|
buildInputs = [texinfo gmp mpfr]
|
|
|
|
++ optionals langTreelang [bison flex];
|
2008-06-26 11:20:33 +01:00
|
|
|
|
|
|
|
configureFlags = "
|
2008-06-27 19:26:19 +01:00
|
|
|
${if enableMultilib then "" else "--disable-multilib"}
|
2008-06-26 11:20:33 +01:00
|
|
|
--disable-libstdcxx-pch
|
|
|
|
--with-system-zlib
|
|
|
|
--enable-languages=${
|
|
|
|
concatStrings (intersperse ","
|
2008-06-27 15:43:25 +01:00
|
|
|
( optional langC "c"
|
|
|
|
++ optional langCC "c++"
|
|
|
|
++ optional langFortran "fortran"
|
|
|
|
++ optional langTreelang "treelang"
|
2008-06-26 11:20:33 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
${if stdenv.isi686 then "--with-arch=i686" else ""}
|
|
|
|
";
|
|
|
|
|
|
|
|
NIX_EXTRA_LDFLAGS = if staticCompiler then "-static" else "";
|
|
|
|
|
|
|
|
inherit gmp mpfr;
|
2008-06-27 19:26:19 +01:00
|
|
|
|
|
|
|
passthru = { inherit langC langCC langFortran langTreelang enableMultilib; };
|
2008-06-26 11:20:33 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://gcc.gnu.org/";
|
|
|
|
license = "GPL/LGPL";
|
|
|
|
description = "GNU Compiler Collection, 4.3.x";
|
|
|
|
};
|
|
|
|
}
|