From 5c2c5961a6142fc0bf0c9f992ff76b4a32ad65e4 Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Tue, 16 Oct 2018 16:42:07 -0700 Subject: Enable building with Clang 7 (#20417) The Clang 7 is the first version in which only the major version is used in file names and paths. So the change needed to massage the build files a bit more than what was needed for the previous versions. --- src/pal/tools/gen-buildsys-clang.sh | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'src/pal/tools') diff --git a/src/pal/tools/gen-buildsys-clang.sh b/src/pal/tools/gen-buildsys-clang.sh index 32a217f301..a644653350 100755 --- a/src/pal/tools/gen-buildsys-clang.sh +++ b/src/pal/tools/gen-buildsys-clang.sh @@ -20,21 +20,24 @@ fi # Set up the environment to be used for building with clang. if command -v "clang-$2.$3" > /dev/null then - export CC="$(command -v clang-$2.$3)" - export CXX="$(command -v clang++-$2.$3)" + desired_llvm_version="-$2.$3" elif command -v "clang$2$3" > /dev/null then - export CC="$(command -v clang$2$3)" - export CXX="$(command -v clang++$2$3)" + desired_llvm_version="$2$3" +elif command -v "clang-$2$3" > /dev/null + then + desired_llvm_version="-$2$3" elif command -v clang > /dev/null then - export CC="$(command -v clang)" - export CXX="$(command -v clang++)" + desired_llvm_version= else echo "Unable to find Clang Compiler" exit 1 fi +export CC="$(command -v clang$desired_llvm_version)" +export CXX="$(command -v clang++$desired_llvm_version)" + build_arch="$4" buildtype=DEBUG code_coverage=OFF @@ -79,19 +82,6 @@ else exit 1 fi -desired_llvm_major_version=$2 -desired_llvm_minor_version=$3 -if [ $OS = "FreeBSD" ]; then - desired_llvm_version="$desired_llvm_major_version$desired_llvm_minor_version" -elif [ $OS = "OpenBSD" ]; then - desired_llvm_version="" -elif [ $OS = "NetBSD" ]; then - desired_llvm_version="" -elif [ $OS = "SunOS" ]; then - desired_llvm_version="" -else - desired_llvm_version="-$desired_llvm_major_version.$desired_llvm_minor_version" -fi locate_llvm_exec() { if command -v "$llvm_prefix$1$desired_llvm_version" > /dev/null 2>&1 then -- cgit v1.2.3