gcc: Handle CPATH and LIBRARY_PATH purely in Nix

This commit is contained in:
John Ericson
2017-12-06 19:12:51 -05:00
parent d4595b38e9
commit d96cf0f46c
8 changed files with 240 additions and 235 deletions
+5 -13
View File
@@ -22,10 +22,10 @@ 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 -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
@@ -82,15 +82,7 @@ if test "$noSysDirs" = "1"; then
done
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
else
if test -z "${targetConfig-}"; then
# host = target, so the flags are the same
EXTRA_TARGET_FLAGS="$EXTRA_FLAGS"
EXTRA_TARGET_LDFLAGS="$EXTRA_LDFLAGS"