mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-27 08:04:14 +00:00
999ef20129
Also deduplicate more of the GCC derivations.
29 lines
893 B
Nix
29 lines
893 B
Nix
{ stdenv, crossStageStatic, libcCross }:
|
|
|
|
let
|
|
inherit (stdenv) lib hostPlatform targetPlatform;
|
|
in
|
|
|
|
{
|
|
EXTRA_TARGET_FLAGS = let
|
|
mkFlags = dep: lib.optionals (targetPlatform != hostPlatform && dep != null) ([
|
|
"-idirafter ${lib.getDev dep}${dep.incdir or "/include"}"
|
|
] ++ stdenv.lib.optionals (! crossStageStatic) [
|
|
"-B${lib.getLib dep}${dep.libdir or "/lib"}"
|
|
]);
|
|
in mkFlags libcCross
|
|
;
|
|
|
|
EXTRA_TARGET_LDFLAGS = let
|
|
mkFlags = dep: lib.optionals (targetPlatform != hostPlatform && dep != null) ([
|
|
"-Wl,-L${lib.getLib dep}${dep.libdir or "/lib"}"
|
|
] ++ (if crossStageStatic then [
|
|
"-B${lib.getLib dep}${dep.libdir or "/lib"}"
|
|
] else [
|
|
"-Wl,-rpath,${lib.getLib dep}${dep.libdir or "/lib"}"
|
|
"-Wl,-rpath-link,${lib.getLib dep}${dep.libdir or "/lib"}"
|
|
]));
|
|
in mkFlags libcCross
|
|
;
|
|
}
|