diff options
Diffstat (limited to 'pkgs/build-support/cc-wrapper/add-flags')
-rw-r--r-- | pkgs/build-support/cc-wrapper/add-flags | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/build-support/cc-wrapper/add-flags b/pkgs/build-support/cc-wrapper/add-flags new file mode 100644 index 000000000000..d48361539047 --- /dev/null +++ b/pkgs/build-support/cc-wrapper/add-flags @@ -0,0 +1,28 @@ +# `-B@out@/bin' forces gcc to use ld-wrapper.sh when calling ld. +export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE" + +if [ -e @out@/nix-support/libc-cflags ]; then + export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE" +fi + +if [ -e @out@/nix-support/gcc-cflags ]; then + export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/cc-cflags) $NIX_CFLAGS_COMPILE" +fi + +if [ -e @out@/nix-support/gnat-cflags ]; then + export NIX_GNATFLAGS_COMPILE="$(cat @out@/nix-support/gnat-cflags) $NIX_GNATFLAGS_COMPILE" +fi + +if [ -e @out@/nix-support/libc-ldflags ]; then + export NIX_LDFLAGS+=" $(cat @out@/nix-support/libc-ldflags)" +fi + +if [ -e @out@/nix-support/gcc-ldflags ]; then + export NIX_LDFLAGS+=" $(cat @out@/nix-support/cc-ldflags)" +fi + +if [ -e @out@/nix-support/libc-ldflags-before ]; then + export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE" +fi + +export NIX_CC_WRAPPER_FLAGS_SET=1 |