nixpkgs/pkgs/development/compilers/gcc/common/pre-configure.nix

20 lines
748 B
Nix
Raw Normal View History

2019-05-11 22:16:17 +01:00
{ lib, version, hostPlatform
, gnatboot ? null
, langAda ? false
, langJava ? false
, langGo }:
2019-11-10 20:05:59 +00:00
assert langJava -> lib.versionOlder version "7";
2019-05-11 22:16:17 +01:00
assert langAda -> gnatboot != null;
2019-11-10 20:05:59 +00:00
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;
2019-05-11 22:16:17 +01:00
'' + lib.optionalString langAda ''
export PATH=${gnatboot}/bin:$PATH
2019-11-10 20:05:59 +00:00
''