From ee8e6018640754bfca99605e9752c9053777f43a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Mon, 31 Dec 2012 11:36:57 +0100
Subject: Add scan-build support.

Change-Id: Ife69d84147946b41875792cb90189542c3130bc3

diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index d218d9a..2ca5281 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -118,6 +118,14 @@ if env["PLATFORM"] == "darwin" :
 		if platform.machine() == "x86_64" :
 			env.Append(LINKFLAGS = ["-arch", "x86_64"])
 
+# Check whether we are running inside scan-build, and override compiler if so
+if "CCC_ANALYZER_HTML" in os.environ :
+	for key, value in os.environ.items() :
+		if key.startswith("CCC_") or key.startswith("CLANG") :
+			env["ENV"][key] = value
+	env["CC"] = os.environ["CC"]
+	env["CXX"] = os.environ["CXX"]
+
 # Override the compiler with custom variables set at config time
 if "cc" in env :
 	env["CC"] = env["cc"]
-- 
cgit v0.10.2-6-g49f6