Adding first built version of the gnat compiler for gcc 4.4.

Some things don't work:
- The ghdl expression (it still needs the gcc 4.3.4 src, ...)
- The gnat wrappers need to be more generic - now they work only for the
  given gnatboot (taken from gentoo) and gnats installed to their $out
  store path.
- Using the cloogppl and ppl. We will need our own gnatboot built with c++
  libraries for that.


svn path=/nixpkgs/branches/stdenv-updates/; revision=19060
This commit is contained in:
Lluís Batlle i Rossell
2009-12-21 07:49:31 +00:00
parent 224b3e0f0d
commit fb82bac2fc
14 changed files with 905 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
{ stdenv, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false, langTreelang ? false
, langJava ? false
, langAda ? false
, profiledCompiler ? false
, staticCompiler ? false
, enableShared ? true
@@ -13,6 +14,7 @@
, libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
, libXrender ? null, xproto ? null, renderproto ? null, xextproto ? null
, libXrandr ? null, libXi ? null, inputproto ? null, randrproto ? null
, gnatboot ? null
, enableMultilib ? false
, name ? "gcc"
, cross ? null
@@ -24,6 +26,7 @@
assert langTreelang -> bison != null && flex != null;
assert langJava -> zip != null && unzip != null
&& zlib != null && boehmgc != null;
assert langAda -> gnatboot != null;
with stdenv.lib;
@@ -83,7 +86,7 @@ stdenv.mkDerivation ({
src = (import ./sources.nix) {
inherit fetchurl optional version;
inherit langC langCC langFortran langJava;
inherit langC langCC langFortran langJava langAda;
};
patches =
@@ -97,7 +100,10 @@ stdenv.mkDerivation ({
# (fixed in gcc 4.4.3) bad mixture of build/target flags
./libstdc++-target.patch
]
++ optional noSysDirs ./no-sys-dirs.patch;
++ optional noSysDirs ./no-sys-dirs.patch
# The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
# target libraries and tools.
++ optional langAda ./gnat-cflags.patch;
inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
libcCross;
@@ -111,6 +117,7 @@ stdenv.mkDerivation ({
++ (optionals langJava [zip unzip])
++ (optionals javaAwtGtk [gtk pkgconfig libart_lgpl] ++ xlibs)
++ (optionals (cross != null) [binutilsCross])
++ (optionals langAda [gnatboot])
;
configureFlags = "
@@ -133,9 +140,11 @@ stdenv.mkDerivation ({
++ optional langFortran "fortran"
++ optional langJava "java"
++ optional langTreelang "treelang"
++ optional langAda "ada"
)
)
}
${if langAda then " --enable-libada" else ""}
${if stdenv.isi686 then "--with-arch=i686" else ""}
${if cross != null then crossConfigureFlags else ""}
";
@@ -169,7 +178,7 @@ stdenv.mkDerivation ({
++ optionals javaAwtGtk [ gmp mpfr ])));
passthru = { inherit langC langCC langFortran langTreelang enableMultilib; };
passthru = { inherit langC langCC langAda langFortran langTreelang enableMultilib; };
meta = {
homepage = http://gcc.gnu.org/;

View File

@@ -1,6 +1,6 @@
/* Automatically generated by `update-gcc.sh', do not edit.
For GCC 4.4.2. */
{ fetchurl, optional, version, langC, langCC, langFortran, langJava }:
{ fetchurl, optional, version, langC, langCC, langFortran, langJava, langAda }:
assert version == "4.4.2";
optional /* langC */ true (fetchurl {
@@ -19,4 +19,8 @@ optional langJava (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-java-${version}.tar.bz2";
sha256 = "0ydk0qyhi1fdyz2xvj6m6l7cav4wg3962a1jxpf2j3nppm0p1dvp";
}) ++
optional langAda (fetchurl {
url = "mirror://gcc/releases/gcc-${version}/gcc-ada-${version}.tar.bz2";
sha256 = "1isz90b772j7ar5d4265fxzwiwgljssi0kpmrkybsj545615s0wi";
}) ++
[]

View File

@@ -0,0 +1,50 @@
{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "gentoo-gnatboot-4.1";
src = if (stdenv.system == "i686-linux") then
fetchurl {
url = "mirror://gentoo/distfiles/gnatboot-4.1-i386.tar.bz2";
sha256 = "0665zk71598204bf521vw68i5y6ccqarq9fcxsqp7ccgycb4lysr";
}
else if (stdenv.system == "x86_64-linux") then
fetchurl {
url = "mirror://gentoo/distfiles/gnatboot-4.1-amd64.tar.bz2";
sha256 = "1li4d52lmbnfs6llcshlbqyik2q2q4bvpir0f7n38nagp0h6j0d4";
} else throw "Platform not supported";
dontStrip=1;
installPhase = ''
ensureDir $out
cp -R * $out
cd $out/bin
set +e
for a in *; do
patchelf --interpreter $(cat $NIX_GCC/nix-support/dynamic-linker) \
--set-rpath $(cat $NIX_GCC/nix-support/orig-libc)/lib:$(cat
$NIX_GCC/nix-support/orig-gcc) $a
done
set -e
mv $out/bin/gnatgcc_2wrap $out/bin/gnatgcc
ln -s $out/bin/gnatgcc $out/bin/gcc
'';
passthru = {
langC = true; /* TRICK for gcc-wrapper to wrap it */
langCC = false;
langFortran = false;
langAda = true;
};
meta = {
homepage = http://gentoo.org;
license = "GPLv3+"; # runtime support libraries are typically LGPLv3+
maintainers = [
stdenv.lib.maintainers.viric
];
platforms = stdenv.lib.platforms.linux;
};
}