[Mesa-dev] [PATCH] scons: Use LLVM shared library if found.

Vinson Lee vlee at freedesktop.org
Fri May 10 23:10:00 PDT 2013


This patch fixes SCons builds on Fedora 18.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 scons/llvm.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scons/llvm.py b/scons/llvm.py
index 7cd609c..432ece6 100644
--- a/scons/llvm.py
+++ b/scons/llvm.py
@@ -198,7 +198,15 @@ def generate(env):
             if llvm_version >= distutils.version.LooseVersion('3.2'):
                 env.Append(CXXFLAGS = ('-fno-rtti',))
 
-            env.ParseConfig('llvm-config --libs ' + ' '.join(components))
+            llvm_shared_library = os.path.join(
+                env.backtick('llvm-config --libdir').strip(),
+                'libLLVM-%s%s' % (llvm_version, env['SHLIBSUFFIX'])
+            )
+            if os.path.exists(llvm_shared_library):
+                env.Append(LIBS = ['LLVM-%s' % llvm_version])
+            else:
+                env.ParseConfig('llvm-config --libs ' + ' '.join(components))
+
             env.ParseConfig('llvm-config --ldflags')
         except OSError:
             print 'scons: llvm-config version %s failed' % llvm_version
-- 
1.8.2.1



More information about the mesa-dev mailing list