gcc: Deduplicate preConfigure
This commit is contained in:
parent
ca341c2d5b
commit
f666c61d20
|
@ -228,12 +228,10 @@ stdenv.mkDerivation ({
|
|||
++ (optional hostPlatform.isDarwin gnused)
|
||||
;
|
||||
|
||||
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.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 = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langJava langGo;
|
||||
};
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
|
|
|
@ -234,16 +234,10 @@ stdenv.mkDerivation ({
|
|||
++ (optional hostPlatform.isDarwin gnused)
|
||||
;
|
||||
|
||||
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
|
||||
sed -i -e "s/-lrt//g" libstdc++-v3/configure
|
||||
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 (langJava || langGo) ''
|
||||
export lib=$out;
|
||||
'';
|
||||
preConfigure = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langJava langGo;
|
||||
};
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
|
|
|
@ -242,12 +242,10 @@ stdenv.mkDerivation ({
|
|||
|
||||
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
|
||||
|
||||
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.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 = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langJava langGo;
|
||||
};
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
|
|
|
@ -244,15 +244,10 @@ stdenv.mkDerivation ({
|
|||
|
||||
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
|
||||
|
||||
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.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 (langJava || langGo) ''
|
||||
export lib=$out;
|
||||
'';
|
||||
preConfigure = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langJava langGo;
|
||||
};
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
|
|
|
@ -220,12 +220,10 @@ stdenv.mkDerivation ({
|
|||
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument";
|
||||
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
|
||||
|
||||
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.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 = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langGo;
|
||||
};
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
|
|
|
@ -206,12 +206,10 @@ stdenv.mkDerivation ({
|
|||
|
||||
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
|
||||
|
||||
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.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 = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langGo;
|
||||
};
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
|
|
|
@ -205,12 +205,10 @@ stdenv.mkDerivation ({
|
|||
|
||||
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
|
||||
|
||||
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.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 = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langGo;
|
||||
};
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{ lib, version, hostPlatform, langJava ? false, langGo }:
|
||||
|
||||
assert langJava -> lib.versionOlder version "7";
|
||||
|
||||
lib.optionalString (hostPlatform.isSunOS && hostPlatform.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"
|
||||
'' + lib.optionalString (lib.versionOlder version "7" && (langJava || langGo)) ''
|
||||
export lib=$out;
|
||||
''
|
|
@ -177,12 +177,10 @@ stdenv.mkDerivation ({
|
|||
|
||||
NIX_LDFLAGS = stdenv.lib.optionalString hostPlatform.isSunOS "-lm -ldl";
|
||||
|
||||
preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.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 = import ../common/pre-configure.nix {
|
||||
inherit (stdenv) lib;
|
||||
inherit version hostPlatform langGo;
|
||||
};
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue