mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 06:03:40 +00:00
b8b4f9ce4b
set. * Various bug fixes. svn path=/nixpkgs/trunk/; revision=824
26 lines
1.0 KiB
Nix
26 lines
1.0 KiB
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, nativePrefix ? ""
|
|
, gcc ? null, glibc ? null, binutils ? null}:
|
|
|
|
assert isNative -> nativePrefix != "";
|
|
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 nativePrefix gcc glibc binutils;
|
|
enforcePurity = if isNative then false else gcc.enforcePurity;
|
|
langC = if isNative then true else gcc.langC;
|
|
langCC = if isNative then true else gcc.langCC;
|
|
langF77 = if isNative then false else gcc.langF77;
|
|
}
|