configure: Improve toolchain validation

* Seeing an issue on our builders where the toolchain directory
  exists, but the gcc binaries do not.
* Check for the path, as well as the actual compiler binaries
  to improve detection of need to rebuild toolchain.

Change-Id: I54fd5789e3255c8295136bb0614e72c5393718fe
This commit is contained in:
Alexander von Gluck IV 2018-03-01 09:37:57 -06:00
parent f9492b5f11
commit e5d446fcc9

23
configure vendored
View File

@ -212,6 +212,27 @@ real_path()
perl -MCwd=realpath -e'print realpath($ARGV[0]), "\n"' "$1"
}
# valid_toolchain
#
# check if toolchain is valid
#
valid_toolchain()
{
TRIPLET="$1"
BASE="$2"
if [ ! -d "$BASE" ]; then
return 1;
fi
if [ -f "$BASE/bin/$TRIPLET-gcc" ]; then
return 0;
fi
# TODO: Check this!
if [ -f "$BASE/bin/$TRIPLET-clang" ]; then
return 0;
fi
return 1;
}
# standard_gcc_settings
#
# Sets the variables for a GCC platform.
@ -884,7 +905,7 @@ else
*) MAKE=make;;
esac
if [ ! -d "$crossToolsDir" ]; then
if ! valid_toolchain "${targetMachine}" "${crossToolsDir}"; then
MAKE=$MAKE \
SECONDARY_ARCH=$secondaryArch \
HAIKU_USE_GCC_GRAPHITE=`get_variable \