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

View File

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

View File

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