nixpkgs/pkgs/build-support/gcc-wrapper/default.nix
Eelco Dolstra 946a2d4a48 * gcc-wrapper now filters out -L and -I flags referring to paths
outside the store (in pure builds).

svn path=/nixpkgs/trunk/; revision=817
2004-03-08 18:29:08 +00:00

25 lines
993 B
Nix

# The Nix `gcc' derivation is not directly usable, since it doesn't
# know where the C library and standard header files are. Therefore
# the compiler produced by that package cannot be installed directly
# in a user environment and used from the command line. This
# derivation provides a wrapper that sets up the right environment
# variables so that the compiler and the linker just "work".
{name, stdenv, isNative, gcc ? null, glibc ? null, binutils ? null}:
assert isNative -> gcc != "";
assert !isNative -> gcc != null && glibc != null && binutils != null;
derivation {
system = stdenv.system;
builder = ./builder.sh;
setupHook = ./setup-hook.sh;
gccWrapper = ./gcc-wrapper.sh;
ldWrapper = ./ld-wrapper.sh;
inherit name stdenv isNative gcc glibc binutils;
enforcePurity = if isNative then false else gcc.noSysDirs;
langC = if isNative then true else gcc.langC;
langCC = if isNative then true else gcc.langCC;
langF77 = if isNative then false else gcc.langF77;
}