Use 'clang' binary in the same dir as scan-build; if it isn't there use the one in the path
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49933 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/scan-build b/utils/scan-build
index 362cad2..99262e4 100755
--- a/utils/scan-build
+++ b/utils/scan-build
@@ -537,8 +537,16 @@
die "$Prog: Executable 'ccc-analyzer' does not exist at '$Cmd'\n"
if (! -x $Cmd);
+
+my $Clang = "$RealBin/clang";
+
+if (! -x $Clang) {
+ print "$Prog: 'clang' executable not found in '$RealBin'. Using 'clang' from path.\n";
+ $Clang = "clang";
+}
$ENV{'CC'} = $Cmd;
+$ENV{'CLANG'} = $Clang;
if ($Verbose >= 2) {
$ENV{'CCC_ANALYZER_VERBOSE'} = 1;