Skip to content

Commit e871424

Browse files
committed
Merge pull request #169 from GuillaumeBibaut/patch-1
FreeBSD: Search for newest clang compatible candidate
2 parents a2d9b10 + 5690a1b commit e871424

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

utils/build-script-impl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,19 @@ if [ -z "${HOST_CC}" ] ; then
10161016
if [ "$(uname -s)" == "Darwin" ] ; then
10171017
HOST_CC="$(xcrun_find_tool clang)"
10181018
HOST_CXX="$(xcrun_find_tool clang++)"
1019+
elif [ "$(uname -s)" == "FreeBSD" ]; then
1020+
if [ $(sysctl -n kern.osreldate) -ge 1100000 ]; then
1021+
HOST_CC="clang"
1022+
HOST_CXX="clang++"
1023+
else
1024+
for clang_candidate_suffix in "38" "37" "36" "35" ; do
1025+
if which "clang${clang_candidate_suffix}" > /dev/null ; then
1026+
HOST_CC="clang${clang_candidate_suffix}"
1027+
HOST_CXX="clang++${clang_candidate_suffix}"
1028+
break
1029+
fi
1030+
done
1031+
fi
10191032
else
10201033
for clang_candidate_suffix in "" "-3.8" "-3.7" "-3.6" "-3.5" ; do
10211034
if which "clang${clang_candidate_suffix}" > /dev/null ; then

0 commit comments

Comments
 (0)