mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 16:42:09 +00:00
40bc2cc9b6
where we don't use any tools from outside the Nix environment. For this we need the basic POSIX utilities (e.g., GNU coreutils), a shell, GCC, and the binutils. Normal packages just need to include stdenv/stdenv.fix, which on Linux will use the Nixified environment. However, for the tools in the build environment itself we have a bootstrapping problem. Therefore, these depend on the external environment (and include stdenv-linux/stdenv-nativetools). The package `baseenv' provides some generic setup and GCC wrappers used by both fully Nixified and native environments. svn path=/nixpkgs/trunk/; revision=305
38 lines
591 B
Bash
38 lines
591 B
Bash
#! /bin/sh
|
|
|
|
IFS=
|
|
|
|
realgcc=@GCC@
|
|
|
|
justcompile=0
|
|
for i in $@; do
|
|
if test "$i" == "-c"; then
|
|
justcompile=1
|
|
fi
|
|
if test "$i" == "-S"; then
|
|
justcompile=1
|
|
fi
|
|
if test "$i" == "-E"; then
|
|
justcompile=1
|
|
fi
|
|
done
|
|
|
|
IFS=" "
|
|
extra=($NIX_CFLAGS)
|
|
if test "$justcompile" != "1"; then
|
|
extra=(${extra[@]} $NIX_LDFLAGS)
|
|
if test "$NIX_STRIP_DEBUG" == "1"; then
|
|
extra=(${extra[@]} -Wl,-s)
|
|
fi
|
|
fi
|
|
|
|
if test "$NIX_DEBUG" == "1"; then
|
|
echo "extra gcc flags:" >&2
|
|
for i in ${extra[@]}; do
|
|
echo " $i" >&2
|
|
done
|
|
fi
|
|
|
|
IFS=
|
|
exec $realgcc $@ ${extra[@]}
|