gcc: Deduplicate preConfigure

This commit is contained in:
John Ericson
2019-11-10 15:15:04 -05:00
parent ca341c2d5b
commit f666c61d20
9 changed files with 44 additions and 55 deletions
+4 -9
View File
@@ -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;