summaryrefslogtreecommitdiffstats
path: root/tools/scan-build/set-xcode-analyzer
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-04-14 14:01:31 +0000
committerdim <dim@FreeBSD.org>2012-04-14 14:01:31 +0000
commit50b73317314e889cf39c7b1d6cbf419fa7502f22 (patch)
treebe1815eb79b42ff482a8562b13c2dcbf0c5dcbee /tools/scan-build/set-xcode-analyzer
parentdc04cb328508e61aad809d9b53b12f9799a00e7d (diff)
downloadFreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.zip
FreeBSD-src-50b73317314e889cf39c7b1d6cbf419fa7502f22.tar.gz
Vendor import of clang trunk r154661:
http://llvm.org/svn/llvm-project/cfe/trunk@r154661
Diffstat (limited to 'tools/scan-build/set-xcode-analyzer')
-rwxr-xr-xtools/scan-build/set-xcode-analyzer16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/scan-build/set-xcode-analyzer b/tools/scan-build/set-xcode-analyzer
index cc068a5..06e1d85 100755
--- a/tools/scan-build/set-xcode-analyzer
+++ b/tools/scan-build/set-xcode-analyzer
@@ -1,6 +1,11 @@
-#!/usr/bin/env python
+#!/usr/bin/python
+
+# [PR 11661] Note that we hardwire to /usr/bin/python because we
+# want to the use the system version of Python on Mac OS X.
+# This one has the scripting bridge enabled.
import os
+import subprocess
import sys
import re
import tempfile
@@ -9,6 +14,7 @@ import stat
from AppKit import *
def FindClangSpecs(path):
+ print "(+) Searching for xcspec file in: ", path
for root, dirs, files in os.walk(path):
for f in files:
if f.endswith(".xcspec") and f.startswith("Clang LLVM"):
@@ -69,7 +75,13 @@ def main():
print "(+) Using the Clang bundled with Xcode"
path = options.default
- for x in FindClangSpecs('/Developer'):
+ xcode_path = subprocess.check_output(["xcode-select", "-print-path"])
+ if (re.search("Xcode.app", xcode_path)):
+ # Cut off the 'Developer' dir, as the xcspec lies in another part
+ # of the Xcode.app subtree.
+ xcode_path = os.path.dirname(xcode_path)
+
+ for x in FindClangSpecs(xcode_path):
ModifySpec(x, path)
if __name__ == '__main__':
OpenPOWER on IntegriCloud