summaryrefslogtreecommitdiff
path: root/scons/llvm.py
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2009-09-07 15:16:25 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-09-07 15:16:25 +0100
commit79f48c9f9e739a1f6b0810072e41bc826f2b789d (patch)
tree3069798347d6be789bea1a8d5a653341781c9923 /scons/llvm.py
parentb481fb2c6d8a8def0956acb0bf9083f5441edd07 (diff)
scons: Don't set LLVM_VERSION if one of the llvm-config calls fails.
Ubuntu 8.10 has llvm-config version 2.2, which doesn't have nativecodegen. This triggers an exception.
Diffstat (limited to 'scons/llvm.py')
-rw-r--r--scons/llvm.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/scons/llvm.py b/scons/llvm.py
index 702f1e354f..46a8d829ca 100644
--- a/scons/llvm.py
+++ b/scons/llvm.py
@@ -56,15 +56,17 @@ def generate(env):
env.PrependENVPath('PATH', llvm_bin_dir)
if env.Detect('llvm-config'):
- try:
- env['LLVM_VERSION'] = env.backtick('llvm-config --version')
- except AttributeError:
- env['LLVM_VERSION'] = 'X.X'
+ version = env.backtick('llvm-config --version').rstrip()
- env.ParseConfig('llvm-config --cppflags')
- env.ParseConfig('llvm-config --libs jit interpreter nativecodegen bitwriter')
- env.ParseConfig('llvm-config --ldflags')
- env['LINK'] = env['CXX']
+ try:
+ env.ParseConfig('llvm-config --cppflags')
+ env.ParseConfig('llvm-config --libs jit interpreter nativecodegen bitwriter')
+ env.ParseConfig('llvm-config --ldflags')
+ except OSError:
+ print 'llvm-config version %s failed' % version
+ else:
+ env['LINK'] = env['CXX']
+ env['LLVM_VERSION'] = version
def exists(env):
return True