Fix clang compiler detection on OS X
check-tools.pl was hard-wired to expect the Apple compiler version string which
doesn't make much sense, especially for a LLVM project.
The correctness and value of these compiler version checks still isn't clear
following this build fix but they are retained for now.
llvm-svn: 202029
diff --git a/openmp/runtime/tools/check-tools.pl b/openmp/runtime/tools/check-tools.pl
index c58817d..f36d51a 100755
--- a/openmp/runtime/tools/check-tools.pl
+++ b/openmp/runtime/tools/check-tools.pl
@@ -296,15 +296,14 @@
     $rc = run( [ $tool, "--version" ], $stdout, $stderr );
     if ( $rc >= 0 ) {
         my ( $ver, $bld );
-        if ( $target_os eq "mac" ) {
+        if ( $target_os eq "mac" and $stdout =~ m{^.*? (\d+\.\d+) \(.*-(\d+\.\d+\.\d+)\)}m ) {
             # Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
-            $stdout =~ m{^.*? (\d+\.\d+) \(.*-(\d+\.\d+\.\d+)\)}m;
             ( $ver, $bld ) = ( $1, $2 );
         } else {
             if ( 0 ) {
-            } elsif ( $stdout =~ m{^.*? (\d+\.\d+) \((.*)\)}m ) {
+            } elsif ( $stdout =~ m{^.*? (\d+\.\d+)( \((.*)\))?}m ) {
                 # clang version 3.3 (tags/RELEASE_33/final)
-                ( $ver, $bld ) = ( $1, $2 );
+                ( $ver, $bld ) = ( $1, $3 );
             } 
         }; # if
         if ( defined( $ver ) ) {