diff options
author | Alexander Gladysh <agladysh@gmail.com> | 2013-04-03 18:34:49 +0400 |
---|---|---|
committer | Alexander Gladysh <agladysh@gmail.com> | 2013-04-04 00:24:47 +0400 |
commit | e2d60d14e9c0930ab44e4d4d096fe3a2cd92ea46 (patch) | |
tree | f496daed24acc9852c7824e480b4629687814377 /tools/shared.py | |
parent | 8408257cd66435af849f493c10c7f0e8d1d5fa3b (diff) |
Add ability to use versioned clang libraries
Just like LLVM_ADD_VERSION.
Diffstat (limited to 'tools/shared.py')
-rw-r--r-- | tools/shared.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/shared.py b/tools/shared.py index 55224ebb..4501faa9 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -254,6 +254,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 @@ -263,8 +264,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') |