nixpkgs/pkgs/build-support/gcc-wrapper/default.nix
Eelco Dolstra 2bf90b3fbf * gcc-wrapper: inherit gcc's name by default.
* gcc: upgraded to 3.4.1.

  Zie je wel, Martin, gcc is niet eng :-)

svn path=/nixpkgs/trunk/; revision=1128
2004-07-05 12:00:19 +00:00

29 lines
1.1 KiB
Nix

# The Nix `gcc' stdenv.mkDerivation 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
# stdenv.mkDerivation provides a wrapper that sets up the right environment
# variables so that the compiler and the linker just "work".
{ name ? "", stdenv, nativeTools, nativeGlibc, nativePrefix ? ""
, gcc ? null, glibc ? null, binutils ? null, shell ? ""
}:
assert nativeTools -> nativePrefix != "";
assert !nativeTools -> gcc != null && binutils != null;
assert !nativeGlibc -> glibc != null;
stdenv.mkDerivation {
builder = ./builder.sh;
setupHook = ./setup-hook.sh;
gccWrapper = ./gcc-wrapper.sh;
ldWrapper = ./ld-wrapper.sh;
utils = ./utils.sh;
inherit nativeTools nativeGlibc nativePrefix gcc glibc binutils;
name = if name == "" then gcc.name else name;
langC = if nativeTools then true else gcc.langC;
langCC = if nativeTools then true else gcc.langCC;
langF77 = if nativeTools then false else gcc.langF77;
shell = if shell == "" then stdenv.shell else shell;
}