about summary refs log tree commit diff
path: root/nixpkgs/pkgs/build-support/cc-wrapper/setup-hook.sh
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-07-13 23:20:04 +0000
committerAlyssa Ross <hi@alyssa.is>2020-07-13 23:21:06 +0000
commita42c1d6d62656dcf9bd85de620f2e200a5ad22d8 (patch)
tree7d481fea9872f62a034452612be17f4494159baa /nixpkgs/pkgs/build-support/cc-wrapper/setup-hook.sh
parent55f69a6b0e53c1c4b3e0396937c53bf5662b5519 (diff)
parent9480bae337095fd24f61380bce3174fdfe926a00 (diff)
downloadnixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.gz
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.bz2
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.lz
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.xz
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.tar.zst
nixlib-a42c1d6d62656dcf9bd85de620f2e200a5ad22d8.zip
Merge commit '9480bae337095fd24f61380bce3174fdfe926a00'
This is the last nixos-unstable release before 13b2903169f, which I'm a
bit nervous about.  So I want the update including that one to be as
small as possible, hence going to this one first.
Diffstat (limited to 'nixpkgs/pkgs/build-support/cc-wrapper/setup-hook.sh')
-rw-r--r--nixpkgs/pkgs/build-support/cc-wrapper/setup-hook.sh26
1 files changed, 13 insertions, 13 deletions
diff --git a/nixpkgs/pkgs/build-support/cc-wrapper/setup-hook.sh b/nixpkgs/pkgs/build-support/cc-wrapper/setup-hook.sh
index 5b13f2683097..6a913cc4eac7 100644
--- a/nixpkgs/pkgs/build-support/cc-wrapper/setup-hook.sh
+++ b/nixpkgs/pkgs/build-support/cc-wrapper/setup-hook.sh
@@ -6,9 +6,9 @@
 # tools. For example:
 #
 #   # Flags for compiling (whether or not linking) C code for the...
-#   NIX_BUILD_CFLAGS_COMPILE  # ...build platform
-#   NIX_CFLAGS_COMPILE        # ...host platform
-#   NIX_TARGET_CFLAGS_COMPILE # ...target platform
+#   NIX_CFLAGS_COMPILE_FOR_BUILD  # ...build platform
+#   NIX_CFLAGS_COMPILE            # ...host platform
+#   NIX_CFLAGS_COMPILE_FOR_TARGET # ...target platform
 #
 # Notice that these platforms are the 3 *relative* to the package using
 # cc-wrapper, not absolute like `x86_64-pc-linux-gnu`.
@@ -33,12 +33,12 @@
 # The basic strategy is:
 #
 #  - Everyone exclusively *adds information* to relative-platform-specific
-#    environment variables, like `NIX_TARGET_CFLAGS_COMPILE`, to communicate
+#    environment variables, like `NIX_CFLAGS_COMPILE_FOR_TARGET`, to communicate
 #    with the wrapped binaries.
 #
 #  - The wrapped binaries will exclusively *read* cc-wrapper-derivation-specific
-#    environment variables distinguished with with `infixSalt`, like
-#    `NIX_@infixSalt@_CFLAGS_COMPILE`.
+#    environment variables distinguished with with `suffixSalt`, like
+#    `NIX_CFLAGS_COMPILE_@suffixSalt@`.
 #
 #  - `add-flags`, beyond its old task of reading extra flags stuck inside the
 #    cc-wrapper derivation, will convert the relative-platform-specific
@@ -65,15 +65,15 @@
 # function is guaranteed to be exactly the same.
 ccWrapper_addCVars () {
     # See ../setup-hooks/role.bash
-    local role_post role_pre
+    local role_post
     getHostRoleEnvHook
 
     if [ -d "$1/include" ]; then
-        export NIX_${role_pre}CFLAGS_COMPILE+=" -isystem $1/include"
+        export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"
     fi
 
     if [ -d "$1/Library/Frameworks" ]; then
-        export NIX_${role_pre}CFLAGS_COMPILE+=" -iframework $1/Library/Frameworks"
+        export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"
     fi
 }
 
@@ -105,10 +105,10 @@ fi
 
 # Export tool environment variables so various build systems use the right ones.
 
-export NIX_${role_pre}CC=@out@
+export NIX_CC${role_post}=@out@
 
-export ${role_pre}CC=@named_cc@
-export ${role_pre}CXX=@named_cxx@
+export CC${role_post}=@named_cc@
+export CXX${role_post}=@named_cxx@
 export CC${role_post}=@named_cc@
 export CXX${role_post}=@named_cxx@
 
@@ -117,4 +117,4 @@ export CXX${role_post}=@named_cxx@
 export NIX_HARDENING_ENABLE
 
 # No local scope in sourced file
-unset -v role_pre role_post
+unset -v role_post