File tree Expand file tree Collapse file tree 1 file changed +38
-23
lines changed Expand file tree Collapse file tree 1 file changed +38
-23
lines changed Original file line number Diff line number Diff line change @@ -972,29 +972,44 @@ if [ ! -z "$CFG_ENABLE_CLANG" ]
972
972
then
973
973
case " $CC " in
974
974
(' ' |* clang)
975
- CFG_CLANG_VERSION=$( $CFG_CC \
976
- --version \
977
- | grep version \
978
- | sed ' s/.*\(version .*\)/\1/; s/.*based on \(LLVM .*\))/\1/' \
979
- | cut -d ' ' -f 2)
980
-
981
- case $CFG_CLANG_VERSION in
982
- (3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7* )
983
- step_msg " found ok version of CLANG: $CFG_CLANG_VERSION "
984
- if [ -z " $CC " ]
985
- then
986
- CFG_CC=" clang"
987
- CFG_CXX=" clang++"
988
- fi
989
- ;;
990
- (* )
991
- err " bad CLANG version: $CFG_CLANG_VERSION , need >=3.0svn"
992
- ;;
993
- esac
994
- ;;
995
- (* )
996
- msg " skipping CFG_ENABLE_CLANG version check; provided CC=$CC "
997
- ;;
975
+ CFG_CLANG_REPORTED_VERSION=$( $CFG_CC --version | grep version)
976
+
977
+ if [[ $CFG_CLANG_REPORTED_VERSION == * " (based on LLVM " * ]]
978
+ then
979
+ CFG_CLANG_VERSION=$( echo $CFG_CLANG_REPORTED_VERSION | sed ' s/.*(based on LLVM \(.*\))/\1/' )
980
+ elif [[ $CFG_CLANG_REPORTED_VERSION == " Apple LLVM" * ]]
981
+ then
982
+ CFG_OSX_CLANG_VERSION=$( echo $CFG_CLANG_REPORTED_VERSION | sed ' s/.*version \(.*\) .*/\1/' )
983
+ else
984
+ CFG_CLANG_VERSION=$( echo $CFG_CLANG_REPORTED_VERSION | sed ' s/.*version \(.*\) .*/\1/' )
985
+ fi
986
+
987
+ if [ ! -z " $CFG_OSX_CLANG_VERSION " ]
988
+ then
989
+ case $CFG_OSX_CLANG_VERSION in
990
+ (7.0* )
991
+ step_msg " found ok version of APPLE CLANG: $CFG_OSX_CLANG_VERSION "
992
+ ;;
993
+ (* )
994
+ err " bad APPLE CLANG version: $CFG_OSX_CLANG_VERSION , need >=7.0"
995
+ ;;
996
+ esac
997
+ else
998
+ case $CFG_CLANG_VERSION in
999
+ (3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7* )
1000
+ step_msg " found ok version of CLANG: $CFG_CLANG_VERSION "
1001
+ ;;
1002
+ (* )
1003
+ err " bad CLANG version: $CFG_CLANG_VERSION , need >=3.0svn"
1004
+ ;;
1005
+ esac
1006
+ fi
1007
+
1008
+ if [ -z " $CC " ]
1009
+ then
1010
+ CFG_CC=" clang"
1011
+ CFG_CXX=" clang++"
1012
+ fi
998
1013
esac
999
1014
fi
1000
1015
You can’t perform that action at this time.
0 commit comments