* Regularize the treatment of the "gcc" attributes in

all-packages.nix.  All "gcc*" attributes are wrapped GCC instances
  now.

svn path=/nixpkgs/trunk/; revision=5671
This commit is contained in:
Eelco Dolstra 2006-07-10 15:42:19 +00:00
parent d05cdd8064
commit 02e13f0eb4
3 changed files with 60 additions and 82 deletions

View File

@ -73,7 +73,7 @@ rec {
md5 = "9c134038b7f1894a4b307d600207047c"; md5 = "9c134038b7f1894a4b307d600207047c";
}; };
gcc = (downloadAndUnpack { staticGCC = (downloadAndUnpack {
url = http://nix.cs.uu.nl/dist/tarballs/stdenv-linux/gcc-3.4.2-static.tar.bz2; url = http://nix.cs.uu.nl/dist/tarballs/stdenv-linux/gcc-3.4.2-static.tar.bz2;
pkgname = "gcc"; pkgname = "gcc";
md5 = "600452fac470a49a41ea81d39c209f35"; md5 = "600452fac470a49a41ea81d39c209f35";
@ -90,6 +90,17 @@ rec {
}; };
# A helper function to call gcc-wrapper.
wrapGCC =
{gcc ? staticGCC, glibc, binutils, shell ? ""}:
(import ../../build-support/gcc-wrapper) {
nativeTools = false;
nativeGlibc = false;
inherit gcc binutils glibc shell;
stdenv = stdenvInitial;
};
# The "fake" standard environment used to build "real" standard # The "fake" standard environment used to build "real" standard
# environments. It consists of just the basic statically linked # environments. It consists of just the basic statically linked
# tools. # tools.
@ -115,7 +126,7 @@ rec {
# This function builds the various standard environments used during # This function builds the various standard environments used during
# the bootstrap. # the bootstrap.
stdenvBootFun = stdenvBootFun =
{glibc, gcc, binutils, staticGlibc, extraAttrs ? {}}: {gcc, staticGlibc, extraAttrs ? {}}:
import ../generic { import ../generic {
name = "stdenv-linux-boot"; name = "stdenv-linux-boot";
@ -123,16 +134,10 @@ rec {
preHook = ./prehook.sh; preHook = ./prehook.sh;
stdenv = stdenvInitial; stdenv = stdenvInitial;
shell = ./tools/bash; shell = ./tools/bash;
gcc = (import ../../build-support/gcc-wrapper) {
stdenv = stdenvInitial;
nativeTools = false;
nativeGlibc = false;
inherit gcc glibc binutils;
};
initialPath = [ initialPath = [
staticTools staticTools
]; ];
inherit extraAttrs; inherit gcc extraAttrs;
}; };
@ -141,7 +146,7 @@ rec {
# the gcc configure script happy. # the gcc configure script happy.
stdenvLinuxBoot1 = stdenvBootFun { stdenvLinuxBoot1 = stdenvBootFun {
# Use the statically linked, downloaded glibc/gcc/binutils. # Use the statically linked, downloaded glibc/gcc/binutils.
inherit glibc gcc binutils; gcc = wrapGCC {inherit glibc binutils;};
staticGlibc = true; staticGlibc = true;
extraAttrs = {inherit curl;}; extraAttrs = {inherit curl;};
}; };
@ -159,12 +164,11 @@ rec {
# 4) Construct a second stdenv identical to the first, except that # 4) Construct a second stdenv identical to the first, except that
# this one uses the Glibc built in step 3. It still uses # this one uses the Glibc built in step 3. It still uses
# statically linked tools. # statically linked tools.
stdenvLinuxBoot2 = stdenvBootFun { stdenvLinuxBoot2 = removeAttrs (stdenvBootFun {
glibc = stdenvLinuxGlibc;
staticGlibc = false; staticGlibc = false;
inherit gcc binutils; gcc = wrapGCC {inherit binutils; glibc = stdenvLinuxGlibc;};
extraAttrs = {inherit curl;}; extraAttrs = {inherit curl; glibc = stdenvLinuxGlibc;};
}; }) ["gcc" "binutils"];
# 5) The packages that can be built using the second stdenv. # 5) The packages that can be built using the second stdenv.
stdenvLinuxBoot2Pkgs = allPackages { stdenvLinuxBoot2Pkgs = allPackages {
@ -175,9 +179,12 @@ rec {
# this one uses the dynamically linked GCC and Binutils from step # this one uses the dynamically linked GCC and Binutils from step
# 5. The other tools (e.g. coreutils) are still static. # 5. The other tools (e.g. coreutils) are still static.
stdenvLinuxBoot3 = stdenvBootFun { stdenvLinuxBoot3 = stdenvBootFun {
glibc = stdenvLinuxGlibc;
staticGlibc = false; staticGlibc = false;
inherit (stdenvLinuxBoot2Pkgs) gcc binutils; gcc = wrapGCC {
inherit (stdenvLinuxBoot2Pkgs) binutils;
glibc = stdenvLinuxGlibc;
gcc = stdenvLinuxBoot2Pkgs.gcc.gcc;
};
extraAttrs = {inherit curl;}; extraAttrs = {inherit curl;};
}; };
@ -199,12 +206,10 @@ rec {
stdenv = stdenvInitial; stdenv = stdenvInitial;
gcc = (import ../../build-support/gcc-wrapper) { gcc = wrapGCC {
stdenv = stdenvInitial; inherit (stdenvLinuxBoot2Pkgs) binutils;
nativeTools = false;
nativeGlibc = false;
inherit (stdenvLinuxBoot2Pkgs) gcc binutils;
glibc = stdenvLinuxGlibc; glibc = stdenvLinuxGlibc;
gcc = stdenvLinuxBoot2Pkgs.gcc.gcc;
shell = stdenvLinuxBoot3Pkgs.bash ~ /bin/sh; shell = stdenvLinuxBoot3Pkgs.bash ~ /bin/sh;
}; };
@ -212,7 +217,7 @@ rec {
extraAttrs = { extraAttrs = {
curl = stdenvLinuxBoot3Pkgs.realCurl; curl = stdenvLinuxBoot3Pkgs.realCurl;
inherit (stdenvLinuxBoot2Pkgs) binutils /* gcc */; inherit (stdenvLinuxBoot2Pkgs) binutils /* gcc */ glibc;
inherit (stdenvLinuxBoot3Pkgs) inherit (stdenvLinuxBoot3Pkgs)
gzip bzip2 bash coreutils diffutils findutils gawk gzip bzip2 bash coreutils diffutils findutils gawk
gnumake gnused gnutar gnugrep patch patchelf; gnumake gnused gnutar gnugrep patch patchelf;

View File

@ -577,13 +577,7 @@ rec {
m4 = gnum4; m4 = gnum4;
}; };
gcc = (import ../development/compilers/gcc-4.1) { gcc = useFromStdenv (stdenv ? gcc) stdenv.gcc gcc41;
inherit fetchurl stdenv noSysDirs;
langCC = gccWithCC;
profiledCompiler = gccWithProfiling;
};
gccWrapped = stdenv.gcc;
gcc_static = (import ../development/compilers/gcc-static-3.4) { gcc_static = (import ../development/compilers/gcc-static-3.4) {
inherit fetchurl stdenv; inherit fetchurl stdenv;
@ -603,25 +597,34 @@ rec {
inherit stdenv; inherit stdenv;
}; };
gcc33 = (import ../build-support/gcc-wrapper) { wrapGCC = baseGCC: (import ../build-support/gcc-wrapper) {
nativeTools = false; nativeTools = false;
nativeGlibc = false; nativeGlibc = false;
gcc = (import ../development/compilers/gcc-3.3) { gcc = baseGCC;
inherit fetchurl stdenv noSysDirs; inherit stdenv binutils glibc;
};
inherit (stdenv.gcc) binutils glibc;
inherit stdenv;
}; };
gcc34 = (import ../build-support/gcc-wrapper) { gcc295 = wrapGCC (import ../development/compilers/gcc-2.95 {
nativeTools = false; inherit fetchurl stdenv noSysDirs;
nativeGlibc = false; });
gcc = (import ../development/compilers/gcc-3.4) {
inherit fetchurl stdenv noSysDirs; gcc33 = wrapGCC (import ../development/compilers/gcc-3.3 {
}; inherit fetchurl stdenv noSysDirs;
inherit (stdenv.gcc) binutils glibc; });
inherit stdenv;
}; gcc34 = wrapGCC (import ../development/compilers/gcc-3.4 {
inherit fetchurl stdenv noSysDirs;
});
gcc40 = wrapGCC (import ../development/compilers/gcc-4.0 {
inherit fetchurl stdenv noSysDirs;
profiledCompiler = true;
});
gcc41 = wrapGCC (import ../development/compilers/gcc-4.1 {
inherit fetchurl stdenv noSysDirs;
profiledCompiler = true;
});
gcc40sparc = (import ../build-support/gcc-cross-wrapper) { gcc40sparc = (import ../build-support/gcc-cross-wrapper) {
nativeTools = false; nativeTools = false;
@ -677,38 +680,6 @@ rec {
inherit stdenv; inherit stdenv;
}; };
gcc40 = (import ../build-support/gcc-wrapper) {
nativeTools = false;
nativeGlibc = false;
gcc = (import ../development/compilers/gcc-4.0) {
inherit fetchurl stdenv noSysDirs;
profiledCompiler = true;
};
inherit (stdenv.gcc) binutils glibc;
inherit stdenv;
};
gcc41 = (import ../build-support/gcc-wrapper) {
nativeTools = false;
nativeGlibc = false;
gcc = (import ../development/compilers/gcc-4.1) {
inherit fetchurl stdenv noSysDirs;
profiledCompiler = true;
};
inherit (stdenv.gcc) binutils glibc;
inherit stdenv;
};
gcc295 = (import ../build-support/gcc-wrapper) {
nativeTools = false;
nativeGlibc = false;
gcc = (import ../development/compilers/gcc-2.95) {
inherit fetchurl stdenv noSysDirs;
};
inherit (stdenv.gcc) binutils glibc;
inherit stdenv;
};
g77 = (import ../build-support/gcc-wrapper) { g77 = (import ../build-support/gcc-wrapper) {
name = "g77"; name = "g77";
nativeTools = false; nativeTools = false;
@ -1028,10 +999,11 @@ rec {
inherit fetchurl stdenv; inherit fetchurl stdenv;
}; };
glibc = (import ../development/libraries/glibc) { glibc = useFromStdenv (stdenv ? glibc) stdenv.glibc
inherit fetchurl stdenv kernelHeaders; (import ../development/libraries/glibc {
installLocales = true; inherit fetchurl stdenv kernelHeaders;
}; installLocales = true;
});
aterm = (import ../development/libraries/aterm) { aterm = (import ../development/libraries/aterm) {
inherit fetchurl stdenv; inherit fetchurl stdenv;

View File

@ -40,8 +40,9 @@ let {
flexnew flexnew
gaim gaim
gawk gawk
gcc
gcc34
gcc40 gcc40
gccWrapped
ghcWrapper ghcWrapper
ghostscript ghostscript
gnugrep gnugrep