From 91e31476227c8783b616b3f72e8ad94f3c55aab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 19 May 2010 21:31:49 +0000 Subject: [PATCH] GCC 4.5: Unset $CPATH and $LIBRARY_PATH if and only if they are empty. svn path=/nixpkgs/trunk/; revision=21904 --- pkgs/development/compilers/gcc-4.5/builder.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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"