GCC 4.5: Unset $CPATH and $LIBRARY_PATH if and only if they are empty.

svn path=/nixpkgs/trunk/; revision=21904
This commit is contained in:
Ludovic Courtès 2010-05-19 21:31:49 +00:00
parent aa26710b44
commit 91e3147622

View file

@ -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"