diff --git a/pkgs/development/compilers/gcc-4.5/builder.sh b/pkgs/development/compilers/gcc-4.5/builder.sh index 3be8e795162..be2a2b11c16 100644 --- a/pkgs/development/compilers/gcc-4.5/builder.sh +++ b/pkgs/development/compilers/gcc-4.5/builder.sh @@ -15,6 +15,12 @@ else EXTRA_LDFLAGS="" fi +# GCC interprets empty paths as ".", which we don't want. +if test -z "$CPATH"; then unset CPATH; fi +if test -z "$LIBRARY_PATH"; then unset LIBRARY_PATH; fi +echo "\$CPATH is \`$CPATH'" +echo "\$LIBRARY_PATH is \`$LIBRARY_PATH'" + if test "$noSysDirs" = "1"; then if test -e $NIX_GCC/nix-support/orig-libc; then @@ -49,13 +55,6 @@ if test "$noSysDirs" = "1"; then done if test -n "$targetConfig"; then - # Cross-compiling, we need gcc not to read ./specs in order to build - # the g++ compiler (after the specs for the cross-gcc are created). - # Having LIBRARY_PATH= makes gcc read the specs from ., and the build - # breaks. Having this variable comes from the default.nix code to bring - # gcj in. - unset LIBRARY_PATH - unset CPATH if test -z "$crossStageStatic" -o -n "$crossMingw"; then EXTRA_FLAGS_TARGET="-g0 -O2 -B${libcCross}/lib -idirafter ${libcCross}/include" EXTRA_LDFLAGS_TARGET="-Wl,-L${libcCross}/lib"