scons: Don't use scons internal functions.
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 4 Sep 2009 18:33:41 +0000 (19:33 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 4 Sep 2009 18:34:11 +0000 (19:34 +0100)
scons/llvm.py

index 14306bc0febd7726052e15dbd1e7947d250d17ae..53cf71c03f7b0d067ee9fbeb34e9836ed04919e4 100644 (file)
@@ -29,9 +29,7 @@ Tool-specific initialization for LLVM
 
 import os
 import os.path
-import subprocess
 
-import SCons.Action
 import SCons.Errors
 import SCons.Util
 
@@ -58,17 +56,10 @@ def generate(env):
         env.PrependENVPath('PATH', llvm_bin_dir)
 
     if env.Detect('llvm-config'):
-        pipe = SCons.Action._subproc(env, 
-                                     ['llvm-config', '--version'],
-                                     stdin = 'devnull',
-                                     stderr = 'devnull',
-                                     stdout = subprocess.PIPE)
-        if pipe.wait() != 0:
-            return
-        line = pipe.stdout.read().strip()
-        if not line:
-            return
-        env['LLVM_VERSION'] = line
+        try:
+            env['LLVM_VERSION'] = env.backtick('llvm-config --version')
+        except NameError:
+            env['LLVM_VERSION'] = 'X.X'
 
         env.ParseConfig('llvm-config --cppflags')
         env.ParseConfig('llvm-config --libs jit interpreter nativecodegen bitwriter')