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 @@ -988,29 +988,44 @@ if [ ! -z "$CFG_ENABLE_CLANG" ]
988
988
then
989
989
case " $CC " in
990
990
(' ' |* clang)
991
- CFG_CLANG_VERSION=$( $CFG_CC \
992
- --version \
993
- | grep version \
994
- | sed ' s/.*\(version .*\)/\1/; s/.*based on \(LLVM .*\))/\1/' \
995
- | cut -d ' ' -f 2)
996
-
997
- case $CFG_CLANG_VERSION in
998
- (3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7* )
999
- step_msg " found ok version of CLANG: $CFG_CLANG_VERSION "
1000
- if [ -z " $CC " ]
1001
- then
1002
- CFG_CC=" clang"
1003
- CFG_CXX=" clang++"
1004
- fi
1005
- ;;
1006
- (* )
1007
- err " bad CLANG version: $CFG_CLANG_VERSION , need >=3.0svn"
1008
- ;;
1009
- esac
1010
- ;;
1011
- (* )
1012
- msg " skipping CFG_ENABLE_CLANG version check; provided CC=$CC "
1013
- ;;
991
+ CFG_CLANG_REPORTED_VERSION=$( $CFG_CC --version | grep version)
992
+
993
+ if [[ $CFG_CLANG_REPORTED_VERSION == * " (based on LLVM " * ]]
994
+ then
995
+ CFG_CLANG_VERSION=$( echo $CFG_CLANG_REPORTED_VERSION | sed ' s/.*(based on LLVM \(.*\))/\1/' )
996
+ elif [[ $CFG_CLANG_REPORTED_VERSION == " Apple LLVM" * ]]
997
+ then
998
+ CFG_OSX_CLANG_VERSION=$( echo $CFG_CLANG_REPORTED_VERSION | sed ' s/.*version \(.*\) .*/\1/' )
999
+ else
1000
+ CFG_CLANG_VERSION=$( echo $CFG_CLANG_REPORTED_VERSION | sed ' s/.*version \(.*\) .*/\1/' )
1001
+ fi
1002
+
1003
+ if [ ! -z " $CFG_OSX_CLANG_VERSION " ]
1004
+ then
1005
+ case $CFG_OSX_CLANG_VERSION in
1006
+ (7.0* )
1007
+ step_msg " found ok version of APPLE CLANG: $CFG_OSX_CLANG_VERSION "
1008
+ ;;
1009
+ (* )
1010
+ err " bad APPLE CLANG version: $CFG_OSX_CLANG_VERSION , need >=7.0"
1011
+ ;;
1012
+ esac
1013
+ else
1014
+ case $CFG_CLANG_VERSION in
1015
+ (3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7* )
1016
+ step_msg " found ok version of CLANG: $CFG_CLANG_VERSION "
1017
+ ;;
1018
+ (* )
1019
+ err " bad CLANG version: $CFG_CLANG_VERSION , need >=3.0svn"
1020
+ ;;
1021
+ esac
1022
+ fi
1023
+
1024
+ if [ -z " $CC " ]
1025
+ then
1026
+ CFG_CC=" clang"
1027
+ CFG_CXX=" clang++"
1028
+ fi
1014
1029
esac
1015
1030
fi
1016
1031
You can’t perform that action at this time.
0 commit comments