From 90b2e80fb5f7cf7c455a01b0a0de8abe366bd39b Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Thu, 24 Sep 2020 15:59:22 +0100 Subject: Fix detection of installed clang Any clang is fine as long as it is the right version. The current assumption is that it is suffixed with version. --- scripts/build/p-clang-linux.inc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/build/p-clang-linux.inc b/scripts/build/p-clang-linux.inc index ff9b8b81..f3dfbb6e 100644 --- a/scripts/build/p-clang-linux.inc +++ b/scripts/build/p-clang-linux.inc @@ -6,7 +6,9 @@ setup_artifact_variables_clang() { [[ "${LLVM_VERSION_MAJOR}" -ge 7 ]] && version="-${LLVM_VERSION_MAJOR}" # Only set LLVM_CONFIG if not set yet - [[ -z ${LLVM_CONFIG+x} ]] && LLVM_CONFIG=$(which "llvm-config${version}") + if [[ -z "${LLVM_CONFIG-}" ]]; then + LLVM_CONFIG=$(which "llvm-config${version}") + fi local bin_path="" @@ -23,6 +25,12 @@ setup_artifact_variables_clang() { # Check if the binary artifact is installed is_installed_clang() { - # Check if llvm-config with the right version exists - which "llvm-config-${LLVM_VERSION}" + local LLVM_VERSION_MAJOR="${LLVM_VERSION/.*/}" + local LLVM_VERSION_MINOR="${LLVM_VERSION/*./}" + local version="" + [[ "${LLVM_VERSION_MAJOR}" -le 6 ]] && version="${LLVM_VERSION}" + [[ "${LLVM_VERSION_MAJOR}" -ge 7 ]] && version="${LLVM_VERSION_MAJOR}" + + # Check if clang with the right version exists + which "clang-${version}" } \ No newline at end of file -- cgit 1.4.1