X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=common.py;h=742dabf4c45d38d269b5935375297c314436f14d;hb=bd771cda8e11a5f9a8bc5b8eab9ef4293df316e0;hp=97389ed5001b04e3f0c07c86c0ae8d6af0e1ebfb;hpb=711f6428bcc4838abb3f62a2971ee8c53c90eff5;p=profile%2Fivi%2Fmesa.git diff --git a/common.py b/common.py index 97389ed..742dabf 100644 --- a/common.py +++ b/common.py @@ -3,6 +3,7 @@ import os import os.path +import subprocess import sys import platform as _platform @@ -33,6 +34,16 @@ else: default_machine = _platform.machine() default_machine = _machine_map.get(default_machine, 'generic') +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' elif default_platform in ('winddk', 'windows', 'wince', 'darwin'): @@ -53,7 +64,7 @@ def AddOptions(opts): from SCons.Variables.EnumVariable import EnumVariable as EnumOption except ImportError: from SCons.Options.EnumOption import EnumOption - opts.Add(BoolOption('debug', 'debug build', 'no')) + opts.Add(BoolOption('debug', 'debug build', 'yes')) opts.Add(BoolOption('profile', 'profile build', 'no')) opts.Add(BoolOption('quiet', 'quiet command lines', 'yes')) opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine, @@ -61,5 +72,5 @@ def AddOptions(opts): opts.Add(EnumOption('platform', 'target platform', default_platform, allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded'))) opts.Add('toolchain', 'compiler toolchain', 'default') - opts.Add(BoolOption('llvm', 'use LLVM', 'no')) + opts.Add(BoolOption('llvm', 'use LLVM', default_llvm)) opts.Add(BoolOption('dri', 'build DRI drivers', default_dri))