gcc-4.9: Sync with changes made to the 4.8 expression

This commit is contained in:
Eelco Dolstra
2015-05-12 14:55:18 +02:00
parent bbefd04c89
commit e75b5351ac
3 changed files with 33 additions and 304 deletions
+33 -18
View File
@@ -1,5 +1,7 @@
{ stdenv, fetchurl, noSysDirs
, langC ? true, langCC ? true, langFortran ? false
, langObjC ? stdenv.isDarwin
, langObjCpp ? stdenv.isDarwin
, langJava ? false
, langAda ? false
, langVhdl ? false
@@ -13,10 +15,12 @@
, libelf # optional, for link-time optimizations (LTO)
, cloog ? null, isl ? null # optional, for the Graphite optimization framework.
, zlib ? null, boehmgc ? null
, zip ? null, unzip ? null, pkgconfig ? null, gtk ? null, libart_lgpl ? null
, zip ? null, unzip ? null, pkgconfig ? null
, gtk ? null, libart_lgpl ? null
, 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
, x11Support ? langJava
, gnatboot ? null
, enableMultilib ? false
, enablePlugin ? true # whether to support user-supplied plug-ins
@@ -62,7 +66,7 @@ let version = "4.9.2";
patches = [ ]
++ optional enableParallelBuilding ./parallel-bconfig.patch
++ optional (cross != null) ./libstdc++-target.patch
# ++ optional noSysDirs ./no-sys-dirs.patch
++ optional noSysDirs ../4.8/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
@@ -80,8 +84,8 @@ let version = "4.9.2";
# Antlr (optional) allows the Java `gjdoc' tool to be built. We want a
# binary distribution here to allow the whole chain to be bootstrapped.
javaAntlr = fetchurl {
url = http://www.antlr.org/download/antlr-3.1.3.jar;
sha256 = "1f41j0y4kjydl71lqlvr73yagrs2jsg1fjymzjz66mjy7al5lh09";
url = http://www.antlr.org/download/antlr-4.4-complete.jar;
sha256 = "02lda2imivsvsis8rnzmbrbp8rh1kb8vmq4i67pqhkwz7lf8y6dz";
};
xlibs = [
@@ -89,7 +93,7 @@ let version = "4.9.2";
xproto renderproto xextproto inputproto randrproto
];
javaAwtGtk = langJava && gtk != null;
javaAwtGtk = langJava && x11Support;
/* Platform flags */
platformFlags = let
@@ -156,6 +160,7 @@ let version = "4.9.2";
" --disable-libgomp " +
" --disable-libquadmath" +
" --disable-shared" +
" --disable-libatomic " + # libatomic requires libc
" --disable-decimal-float" # libdecnumber requires libc
else
(if crossDarwin then " --with-sysroot=${libcCross}/share/sysroot"
@@ -196,12 +201,12 @@ let version = "4.9.2";
in
# We need all these X libraries when building AWT with GTK+.
assert gtk != null -> (filter (x: x == null) xlibs) == [];
assert x11Support -> (filter (x: x == null) ([ gtk libart_lgpl ] ++ xlibs)) == [];
stdenv.mkDerivation ({
name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon;
builder = ./builder.sh;
builder = ../4.8/builder.sh;
src = fetchurl {
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
@@ -288,15 +293,21 @@ stdenv.mkDerivation ({
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl";
preConfigure = ''
${stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit)
''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
''}
'';
preConfigure = stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) ''
export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g`
export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET"
export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET"
export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
if SDKROOT=$(/usr/bin/xcrun --show-sdk-path); then
configureFlagsArray+=(--with-native-system-header-dir=$SDKROOT/usr/include)
makeFlagsArray+=( \
CFLAGS_FOR_BUILD=-F$SDKROOT/System/Library/Frameworks \
CFLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
FLAGS_FOR_TARGET=-F$SDKROOT/System/Library/Frameworks \
)
fi
'';
dontDisableStatic = true;
@@ -338,6 +349,8 @@ stdenv.mkDerivation ({
++ optional langAda "ada"
++ optional langVhdl "vhdl"
++ optional langGo "go"
++ optional langObjC "objc"
++ optional langObjCpp "obj-c++"
++ optionals crossDarwin [ "objc" "obj-c++" ]
)
)
@@ -475,9 +488,11 @@ stdenv.mkDerivation ({
else null;
passthru =
{ inherit langC langCC langAda langFortran langVhdl langGo enableMultilib version; isGNU = true; };
{ inherit langC langCC langObjC langObjCpp langAda langFortran langVhdl langGo version; isGNU = true; };
inherit enableParallelBuilding;
inherit enableParallelBuilding enableMultilib;
inherit (stdenv) is64bit;
meta = {
homepage = http://gcc.gnu.org/;