+
+# find default_llvm value
+if 'LLVM' in os.environ:
+ default_llvm = 'yes'
+else:
+ # Search sys.argv[] for a "platform=foo" argument since we don't have
+ # an 'env' variable at this point.
+ platform = default_platform
+ pattern = re.compile("(platform=)(.*)")
+ for arg in sys.argv:
+ m = pattern.match(arg)
+ if m:
+ platform = m.group(2)
+
+ default_llvm = 'no'
+ try:
+ if platform != 'windows' and subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
+ default_llvm = 'yes'
+ except:
+ pass
+
+
+# find default_dri value
+if default_platform in ('linux', 'freebsd'):