From e5d446fcc90dfee2cbc87a10c4ecf32cf5c14296 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Thu, 1 Mar 2018 09:37:57 -0600 Subject: [PATCH] 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 --- configure | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 995304c2fc..0fba17eddb 100755 --- a/configure +++ b/configure @@ -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 \