about summary refs log tree commit diff
path: root/pkgs/build-support/bintools-wrapper/add-flags.sh
blob: e99beb381586e46c2d84c5a16bbed4c3cdd23499 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# See cc-wrapper for comments.
var_templates_list=(
    NIX_IGNORE_LD_THROUGH_GCC
    NIX_LDFLAGS
    NIX_LDFLAGS_BEFORE
    NIX_LDFLAGS_AFTER
    NIX_LDFLAGS_HARDEN
    NIX_HARDENING_ENABLE
)
var_templates_bool=(
    NIX_SET_BUILD_ID
    NIX_DONT_SET_RPATH
)

accumulateRoles

for var in "${var_templates_list[@]}"; do
    mangleVarList "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
done
for var in "${var_templates_bool[@]}"; do
    mangleVarBool "$var" ${role_suffixes[@]+"${role_suffixes[@]}"}
done

if [ -e @out@/nix-support/libc-ldflags ]; then
    NIX_LDFLAGS_@suffixSalt@+=" $(< @out@/nix-support/libc-ldflags)"
fi

if [ -e @out@/nix-support/libc-ldflags-before ]; then
    NIX_LDFLAGS_BEFORE_@suffixSalt@="$(< @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE_@suffixSalt@"
fi

export NIX_BINTOOLS_WRAPPER_FLAGS_SET_@suffixSalt@=1