diff options
Diffstat (limited to 'common.py')
-rw-r--r-- | common.py | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -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,14 +64,13 @@ 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, allowed_values=('generic', 'ppc', 'x86', 'x86_64'))) opts.Add(EnumOption('platform', 'target platform', default_platform, allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded'))) - opts.Add(EnumOption('toolchain', 'compiler toolchain', 'default', - allowed_values=('default', 'crossmingw', 'winsdk', 'winddk'))) - opts.Add(BoolOption('llvm', 'use LLVM', 'no')) + opts.Add('toolchain', 'compiler toolchain', 'default') + opts.Add(BoolOption('llvm', 'use LLVM', default_llvm)) opts.Add(BoolOption('dri', 'build DRI drivers', default_dri)) |