From 8b3186528e6bf253fd55dae9edc181173b6789e3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 21 Nov 2007 19:28:54 +0000 Subject: [PATCH] * pcre: don't compile with C++ support when doing a dietlibc build. * GCC 4.2: restore the ability to build a statically linked compiler, needed for the Nixpkgs bootstrap. * GCC 4.2: use symlinks instead of hard links in $out/bin (NIXPKGS-62). svn path=/nixpkgs/branches/stdenv-updates/; revision=9771 --- .../development/compilers/gcc-4.1/default.nix | 12 ++++++------ pkgs/development/compilers/gcc-4.2/builder.sh | 19 +++++++++++++------ .../development/compilers/gcc-4.2/default.nix | 4 ++-- pkgs/development/libraries/pcre/default.nix | 7 ++++--- pkgs/stdenv/linux/make-bootstrap-tools.nix | 3 ++- pkgs/stdenv/linux/make-bootstrap-tools.sh | 2 +- pkgs/top-level/all-packages.nix | 5 +++-- 7 files changed, 31 insertions(+), 21 deletions(-) diff --git a/pkgs/development/compilers/gcc-4.1/default.nix b/pkgs/development/compilers/gcc-4.1/default.nix index e6d5452512e..621f96e49f9 100644 --- a/pkgs/development/compilers/gcc-4.1/default.nix +++ b/pkgs/development/compilers/gcc-4.1/default.nix @@ -15,18 +15,18 @@ stdenv.mkDerivation ({ builder = if langF77 then ./fortran.sh else ./builder.sh; src = - [(fetchurl { + optional /*langC*/ true (fetchurl { url = mirror://gnu/gcc/gcc-4.1.2/gcc-core-4.1.2.tar.bz2; sha256 = "07binc1hqlr0g387zrg5sp57i12yzd5ja2lgjb83bbh0h3gwbsbv"; - })] ++ - (if /*langCC*/ true then [(fetchurl { + }) ++ + optional /*langCC*/ true (fetchurl { url = mirror://gnu/gcc/gcc-4.1.2/gcc-g++-4.1.2.tar.bz2; sha256 = "1qm2izcxna10jai0v4s41myki0xkw9174qpl6k1rnrqhbx0sl1hc"; - })] else []) ++ - (if langF77 then [(fetchurl { + }) ++ + optional langF77 (fetchurl { url = mirror://gnu/gcc/gcc-4.1.2/gcc-fortran-4.1.2.tar.bz2; sha256 = "0772dhmm4gc10420h0d0mfkk2sirvjmjxz8j0ywm8wp5qf8vdi9z"; - })] else []); + }); patches = optional noSysDirs [./no-sys-dirs.patch]; diff --git a/pkgs/development/compilers/gcc-4.2/builder.sh b/pkgs/development/compilers/gcc-4.2/builder.sh index c17d0403702..4bbf00637ae 100644 --- a/pkgs/development/compilers/gcc-4.2/builder.sh +++ b/pkgs/development/compilers/gcc-4.2/builder.sh @@ -40,6 +40,7 @@ if test "$noSysDirs" = "1"; then done makeFlagsArray=( \ + "${makeFlagsArray[@]}" \ NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \ LIMITS_H_TEST=true \ @@ -68,18 +69,24 @@ postInstall() { # Remove `fixincl' to prevent a retained dependency on the # previous gcc. rm -rf $out/libexec/gcc/*/*/install-tools + rm -rf $out/lib/gcc/*/*/install-tools # Get rid of some "fixed" header files rm -rf $out/lib/gcc/*/*/include/root + + # Replace hard links for i686-pc-linux-gnu-gcc etc. with symlinks. + for i in $out/bin/*-gcc*; do + if cmp -s $out/bin/gcc $i; then + ln -sfn gcc $i + fi + done } -if test -z "$staticCompiler"; then - if test -z "$profiledCompiler"; then - buildFlags="bootstrap $buildFlags" - else - buildFlags="profiledbootstrap $buildFlags" - fi +if test -z "$profiledCompiler"; then + buildFlags="bootstrap $buildFlags" +else + buildFlags="profiledbootstrap $buildFlags" fi genericBuild diff --git a/pkgs/development/compilers/gcc-4.2/default.nix b/pkgs/development/compilers/gcc-4.2/default.nix index df0f3e5c48d..c763f8262c2 100644 --- a/pkgs/development/compilers/gcc-4.2/default.nix +++ b/pkgs/development/compilers/gcc-4.2/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation { url = mirror://gnu/gcc/gcc-4.2.2/gcc-core-4.2.2.tar.bz2; sha256 = "01hdwd4im2xzg159fk022zqyhlxphqvpmabd25bqb8fjbs2yi80a"; }) ++ - optional /*langCC*/ true (fetchurl { + optional langCC (fetchurl { url = mirror://gnu/gcc/gcc-4.2.2/gcc-g++-4.2.2.tar.bz2; sha256 = "04xankxi3bi4gvgv8rq9h6w3bdx59bg9zh0zv6lyw373gy26ygmq"; }) ++ @@ -47,7 +47,7 @@ stdenv.mkDerivation { ${if stdenv.isi686 then "--with-arch=i686" else ""} "; - makeFlags = if staticCompiler then "LDFLAGS=-static" else ""; + NIX_EXTRA_LDFLAGS = if staticCompiler then "-static" else ""; passthru = { inherit langC langCC langF77; }; diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index fef6d239ea0..cba26fae76c 100644 --- a/pkgs/development/libraries/pcre/default.nix +++ b/pkgs/development/libraries/pcre/default.nix @@ -1,4 +1,4 @@ -args: with args; +{stdenv, fetchurl, unicodeSupport ? false, cplusplusSupport ? true}: stdenv.mkDerivation { name = "pcre-7.4"; @@ -7,7 +7,8 @@ stdenv.mkDerivation { sha256 = "1rdks2h5f3p2d71c4jnxaic1c9gmgsfky80djnafcdbdrhzkiyx5"; }; configureFlags = - if unicodeSupport then + (if unicodeSupport then "--enable-unicode-properties --enable-shared --disable-static" - else ""; + else "") + + (if !cplusplusSupport then "--disable-cpp" else ""); } diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index db7c3d72e11..069b965ad76 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -48,11 +48,12 @@ let then pkgsDiet.gawk else pkgsStatic.gawk; - gcc = import ../../development/compilers/gcc-4.1 { + gcc = import ../../development/compilers/gcc-4.2 { inherit (pkgs) fetchurl stdenv; noSysDirs = true; langCC = false; staticCompiler = true; + profiledCompiled = true; }; curl = pkgsDiet.realCurl; diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.sh b/pkgs/stdenv/linux/make-bootstrap-tools.sh index 49bb5afe477..afc595861ca 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.sh +++ b/pkgs/stdenv/linux/make-bootstrap-tools.sh @@ -46,7 +46,7 @@ cp $findutils/bin/find tools/bin cp $findutils/bin/xargs tools/bin cp $diffutils/bin/* tools/bin cp $gnused/bin/* tools/bin -cp $gnugrep/bin/* tools/bin +cp $gnugrep/bin/grep tools/bin cp $gawk/bin/gawk tools/bin ln -s gawk tools/bin/awk cp $gnutar/bin/* tools/bin diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a318fdf442d..dc3b0adea32 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2155,11 +2155,12 @@ rec { pcre = import ../development/libraries/pcre { inherit fetchurl stdenv; unicodeSupport = getFlag "unicode" "pcre" false; + cplusplusSupport = !stdenv ? isDietLibC; }; poppler = import ../development/libraries/poppler { - inherit fetchurl stdenv qt4 cairo freetype fontconfig zlib libjpeg; - inherit (gtkLibs) glib gtk; + inherit fetchurl stdenv qt4 cairo freetype fontconfig zlib libjpeg; + inherit (gtkLibs) glib gtk; }; popt = import ../development/libraries/popt {