scons: Fix exception when llvm-config is not present.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 13 Apr 2010 10:40:48 +0000 (19:40 +0900)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 13 Apr 2010 10:42:29 +0000 (19:42 +0900)
common.py

index 8372176edd7b3d72a39e1ac8c0dca0b8b0d8bb05..742dabf4c45d38d269b5935375297c314436f14d 100644 (file)
--- a/common.py
+++ b/common.py
@@ -34,10 +34,15 @@ else:
        default_machine = _platform.machine()
 default_machine = _machine_map.get(default_machine, 'generic')
 
-if 'LLVM' in os.environ or subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
+if 'LLVM' in os.environ:
     default_llvm = 'yes'
 else:
     default_llvm = 'no'
+    try:
+        if subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
+            default_llvm = 'yes'
+    except:
+        pass
 
 if default_platform in ('linux', 'freebsd'):
        default_dri = 'yes'