diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2017-07-06 17:19:53 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2017-08-07 03:05:50 -0400 |
commit | 42f35503b56e293759685e9fb2a66ba75a55c339 (patch) | |
tree | 9fdd4bb2215fd0d1b290527a932371046f7b9fd8 /pkgs/stdenv/generic | |
parent | 9f1e009975dc2d58541de435c74a26afe011542a (diff) | |
download | nixlib-42f35503b56e293759685e9fb2a66ba75a55c339.tar nixlib-42f35503b56e293759685e9fb2a66ba75a55c339.tar.gz nixlib-42f35503b56e293759685e9fb2a66ba75a55c339.tar.bz2 nixlib-42f35503b56e293759685e9fb2a66ba75a55c339.tar.lz nixlib-42f35503b56e293759685e9fb2a66ba75a55c339.tar.xz nixlib-42f35503b56e293759685e9fb2a66ba75a55c339.tar.zst nixlib-42f35503b56e293759685e9fb2a66ba75a55c339.zip |
cc-wrapper: Make hygienic
See the added comments for what exactly has been done.
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r-- | pkgs/stdenv/generic/setup.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index dc3369f6611c..81ed1c635e17 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -336,8 +336,20 @@ fi # Set the relevant environment variables to point to the build inputs # found above. +# +# These `depOffset`s tell the env hook what sort of dependency +# (ignoring propagatedness) is being passed to the env hook. In a real +# language, we'd append a closure with this information to the +# relevant env hook array, but bash doesn't have closures, so it's +# easier to just pass this in. + _addToNativeEnv() { local pkg="$1" + if [[ -n "${crossConfig:-}" ]]; then + local -i depOffset=-1 + else + local -i depOffset=0 + fi # Run the package-specific hooks set by the setup-hook scripts. runHook envHook "$pkg" @@ -349,6 +361,7 @@ done _addToCrossEnv() { local pkg="$1" + local -i depOffset=0 # Run the package-specific hooks set by the setup-hook scripts. runHook crossEnvHook "$pkg" |