From 5690a1b838bb6a5b1e1d458d07944f5206dff072 Mon Sep 17 00:00:00 2001 From: Guillaume Bibaut Date: Fri, 11 Dec 2015 08:43:14 +0100 Subject: [PATCH] Search for clang based on Swift requirements --- utils/build-script-impl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/build-script-impl b/utils/build-script-impl index b2d2954d2bb3f..02f7874af638b 100755 --- a/utils/build-script-impl +++ b/utils/build-script-impl @@ -1006,6 +1006,19 @@ if [ -z "${HOST_CC}" ] ; then if [ "$(uname -s)" == "Darwin" ] ; then HOST_CC="$(xcrun_find_tool clang)" HOST_CXX="$(xcrun_find_tool clang++)" + elif [ "$(uname -s)" == "FreeBSD" ]; then + if [ $(sysctl -n kern.osreldate) -ge 1100000 ]; then + HOST_CC="clang" + HOST_CXX="clang++" + else + for clang_candidate_suffix in "38" "37" "36" "35" ; do + if which "clang${clang_candidate_suffix}" > /dev/null ; then + HOST_CC="clang${clang_candidate_suffix}" + HOST_CXX="clang++${clang_candidate_suffix}" + break + fi + done + fi else for clang_candidate_suffix in "" "-3.8" "-3.7" "-3.6" "-3.5" ; do if which "clang${clang_candidate_suffix}" > /dev/null ; then