diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2004-06-29 08:25:55 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2004-06-29 08:25:55 +0000 |
commit | 62981b617d4929b66cdf52df508a24605f3f66d9 (patch) | |
tree | 0bff59bbf2c28d8fc889c7d1af260f8001da5e51 /pkgs/development/compilers/gcc-3.4 | |
parent | 49c1176ec6b6ce65d34d0ae7ca212d65ddbcc607 (diff) |
* Started adding gcc 3.4.
svn path=/nixpkgs/trunk/; revision=1103
Diffstat (limited to 'pkgs/development/compilers/gcc-3.4')
-rw-r--r-- | pkgs/development/compilers/gcc-3.4/builder.sh | 84 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc-3.4/default.nix | 18 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc-3.4/no-sys-dirs.patch | 16 |
3 files changed, 118 insertions, 0 deletions
diff --git a/pkgs/development/compilers/gcc-3.4/builder.sh b/pkgs/development/compilers/gcc-3.4/builder.sh new file mode 100644 index 0000000000000..d7fb9ca875809 --- /dev/null +++ b/pkgs/development/compilers/gcc-3.4/builder.sh @@ -0,0 +1,84 @@ +. $stdenv/setup + + +FIXINC_DUMMY=$NIX_BUILD_TOP/dummy +mkdir $FIXINC_DUMMY + + +preConfigure() { + + # Determine the frontends to build. + langs="c" + if test -n "$langCC"; then + langs="$langs,c++" + fi + if test -n "$langF77"; then + langs="$langs,f77" + fi + + # Perform the build in a different directory. + mkdir ../build + cd ../build + + configureScript=../$sourceRoot/configure + configureFlags="--enable-languages=$langs" +} + +preConfigure=preConfigure + + +postConfigure() { + if test "$noSysDirs" = "1"; then + # Patch some of the makefiles to force linking against our own + # glibc. + if test -e $NIX_GCC/nix-support/orig-glibc; then + glibc=$(cat $NIX_GCC/nix-support/orig-glibc) + # Ugh. Copied from gcc-wrapper/builder.sh. We can't just + # source in $NIX_GCC/nix-support/add-flags, since that + # would cause *this* GCC to be linked against the + # *previous* GCC. Need some more modularity there. + extraFlags="-Wl,-s -B$glibc/lib -isystem $glibc/include \ + -L$glibc/lib -Wl,-dynamic-linker -Wl,$glibc/lib/ld-linux.so.2" + + # Oh, what a hack. I should be shot for this. + # In stage 1, we should link against the previous GCC, but + # not afterwards. Otherwise we retain a dependency. + # However, ld-wrapper, which adds the linker flags for the + # previous GCC, is also used in stage 2/3. We can prevent + # it from adding them by NIX_GLIBC_FLAGS_SET, but then + # gcc-wrapper will also not add them, thereby causing + # stage 1 to fail. So we use a trick to only set the + # flags in gcc-wrapper. + hook=$(pwd)/ld-wrapper-hook + echo "NIX_GLIBC_FLAGS_SET=1" > $hook + export NIX_LD_WRAPPER_START_HOOK=$hook + fi + +# mf=Makefile +# sed \ +# -e "s^FLAGS_FOR_TARGET =\(.*\)^FLAGS_FOR_TARGET = \1 $extraFlags^" \ +# < $mf > $mf.tmp +# mv $mf.tmp $mf + +# mf=gcc/Makefile +# sed \ +# -e "s^X_CFLAGS =\(.*\)^X_CFLAGS = \1 $extraFlags^" \ +# < $mf > $mf.tmp +# mv $mf.tmp $mf + + # Patch gcc/Makefile to prevent fixinc.sh from "fixing" system + # header files from /usr/include. +# mf=gcc/Makefile +# sed \ +# -e "s^NATIVE_SYSTEM_HEADER_DIR =\(.*\)^NATIVE_SYSTEM_HEADER_DIR = $FIXINC_DUMMY^" \ +# < $mf > $mf.tmp +# mv $mf.tmp $mf + fi +} + +postConfigure=postConfigure + + +makeFlags="bootstrap" + +genericBuild diff --git a/pkgs/development/compilers/gcc-3.4/default.nix b/pkgs/development/compilers/gcc-3.4/default.nix new file mode 100644 index 0000000000000..c7fcd6218068a --- /dev/null +++ b/pkgs/development/compilers/gcc-3.4/default.nix @@ -0,0 +1,18 @@ +{ stdenv, fetchurl, patch, noSysDirs +, langC ? true, langCC ? true, langF77 ? false +}: + +assert langC; + +stdenv.mkDerivation { + name = "gcc-3.4.0"; + builder = ./builder.sh; + src = fetchurl { + url = ftp://ftp.nluug.nl/mirror/languages/gcc/releases/gcc-3.4.0/gcc-3.4.0.tar.bz2; + md5 = "85c6fc83d51be0fbb4f8205accbaff59"; + }; + # !!! apply only if noSysDirs is set + patches = [./no-sys-dirs.patch]; + buildInputs = [patch]; + inherit noSysDirs langC langCC langF77; +} diff --git a/pkgs/development/compilers/gcc-3.4/no-sys-dirs.patch b/pkgs/development/compilers/gcc-3.4/no-sys-dirs.patch new file mode 100644 index 0000000000000..dcbef5b53d6e1 --- /dev/null +++ b/pkgs/development/compilers/gcc-3.4/no-sys-dirs.patch @@ -0,0 +1,16 @@ +diff -rc gcc-orig/gcc/cppdefault.c gcc-patched/gcc/cppdefault.c +*** gcc-orig/gcc/cppdefault.c 2003-03-01 15:31:12.000000000 +0100 +--- gcc-patched/gcc/cppdefault.c 2004-06-29 10:08:45.000000000 +0200 +*************** +*** 41,46 **** +--- 41,50 ---- + # undef CROSS_INCLUDE_DIR + #endif + ++ #undef LOCAL_INCLUDE_DIR ++ #undef SYSTEM_INCLUDE_DIR ++ #undef STANDARD_INCLUDE_DIR ++ + const struct default_include cpp_include_defaults[] + #ifdef INCLUDE_DEFAULTS + = INCLUDE_DEFAULTS; |