aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-04 21:12:18 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-04 21:12:18 -0700
commitd79e23b630c76f628b9f183106912d1f47b14d22 (patch)
tree546a3cb2bd91c80a9f13ababf720f4de0fbcc153 /tools/shared.py
parentef96768ac8a4ef3af360e0d0ad32706e21eb4d11 (diff)
parent1e30c181f04612e8be2dbcea8ae67f4698c1b0bc (diff)
Merge branch 'ag/clang-add-version' of github.com:agladysh/emscripten into agladysh-ag/clang-add-version2
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 61779c59..a13c20a6 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -257,6 +257,7 @@ def check_sanity(force=False):
# Tools/paths
LLVM_ADD_VERSION = os.getenv('LLVM_ADD_VERSION')
+CLANG_ADD_VERSION = os.getenv('CLANG_ADD_VERSION')
# Some distributions ship with multiple llvm versions so they add
# the version to the binaries, cope with that
@@ -266,8 +267,16 @@ def build_llvm_tool_path(tool):
else:
return os.path.join(LLVM_ROOT, tool)
-CLANG_CC=os.path.expanduser(os.path.join(LLVM_ROOT, 'clang'))
-CLANG_CPP=os.path.expanduser(os.path.join(LLVM_ROOT, 'clang++'))
+# Some distributions ship with multiple clang versions so they add
+# the version to the binaries, cope with that
+def build_clang_tool_path(tool):
+ if CLANG_ADD_VERSION:
+ return os.path.join(LLVM_ROOT, tool + "-" + CLANG_ADD_VERSION)
+ else:
+ return os.path.join(LLVM_ROOT, tool)
+
+CLANG_CC=os.path.expanduser(build_clang_tool_path('clang'))
+CLANG_CPP=os.path.expanduser(build_clang_tool_path('clang++'))
CLANG=CLANG_CPP
LLVM_LINK=build_llvm_tool_path('llvm-link')
LLVM_AR=build_llvm_tool_path('llvm-ar')