Skip to content

Verify Apple LLVM versions independently #27006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 38 additions & 23 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -988,29 +988,44 @@ if [ ! -z "$CFG_ENABLE_CLANG" ]
then
case "$CC" in
(''|*clang)
CFG_CLANG_VERSION=$($CFG_CC \
--version \
| grep version \
| sed 's/.*\(version .*\)/\1/; s/.*based on \(LLVM .*\))/\1/' \
| cut -d ' ' -f 2)

case $CFG_CLANG_VERSION in
(3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7*)
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
if [ -z "$CC" ]
then
CFG_CC="clang"
CFG_CXX="clang++"
fi
;;
(*)
err "bad CLANG version: $CFG_CLANG_VERSION, need >=3.0svn"
;;
esac
;;
(*)
msg "skipping CFG_ENABLE_CLANG version check; provided CC=$CC"
;;
CFG_CLANG_REPORTED_VERSION=$($CFG_CC --version | grep version)

if [[ $CFG_CLANG_REPORTED_VERSION == *"(based on LLVM "* ]]
then
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*(based on LLVM \(.*\))/\1/')
elif [[ $CFG_CLANG_REPORTED_VERSION == "Apple LLVM"* ]]
then
CFG_OSX_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')
else
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')
fi

if [ ! -z "$CFG_OSX_CLANG_VERSION" ]
then
case $CFG_OSX_CLANG_VERSION in
(7.0*)
step_msg "found ok version of APPLE CLANG: $CFG_OSX_CLANG_VERSION"
;;
(*)
err "bad APPLE CLANG version: $CFG_OSX_CLANG_VERSION, need >=7.0"
;;
esac
else
case $CFG_CLANG_VERSION in
(3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7*)
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
;;
(*)
err "bad CLANG version: $CFG_CLANG_VERSION, need >=3.0svn"
;;
esac
fi

if [ -z "$CC" ]
then
CFG_CC="clang"
CFG_CXX="clang++"
fi
esac
fi

Expand Down