summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scons/llvm.py18
-rw-r--r--src/gallium/drivers/llvmpipe/SConscript2
2 files changed, 11 insertions, 9 deletions
diff --git a/scons/llvm.py b/scons/llvm.py
index 702f1e354f6..46a8d829ca4 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
diff --git a/src/gallium/drivers/llvmpipe/SConscript b/src/gallium/drivers/llvmpipe/SConscript
index ac1b5d6d1db..dea4b703c45 100644
--- a/src/gallium/drivers/llvmpipe/SConscript
+++ b/src/gallium/drivers/llvmpipe/SConscript
@@ -3,7 +3,7 @@ Import('*')
env = env.Clone()
env.Tool('llvm')
-if 'LLVM_VERSION' not in env:
+if env.has_key('LLVM_VERSION') is False:
print 'warning: LLVM not found: not building llvmpipe'
Return()