1 #######################################################################
8 import platform as _platform
11 #######################################################################
19 default_platform = sys.platform
20 default_platform = _platform_map.get(default_platform, default_platform)
31 if 'PROCESSOR_ARCHITECTURE' in os.environ:
32 default_machine = os.environ['PROCESSOR_ARCHITECTURE']
34 default_machine = _platform.machine()
35 default_machine = _machine_map.get(default_machine, 'generic')
37 if 'LLVM' in os.environ:
42 if subprocess.call(['llvm-config', '--version'], stdout=subprocess.PIPE) == 0:
47 if default_platform in ('linux', 'freebsd'):
49 elif default_platform in ('winddk', 'windows', 'wince', 'darwin'):
55 #######################################################################
60 from SCons.Variables.BoolVariable import BoolVariable as BoolOption
62 from SCons.Options.BoolOption import BoolOption
64 from SCons.Variables.EnumVariable import EnumVariable as EnumOption
66 from SCons.Options.EnumOption import EnumOption
67 opts.Add(BoolOption('debug', 'debug build', 'yes'))
68 opts.Add(BoolOption('profile', 'profile build', 'no'))
69 opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
70 opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
71 allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
72 opts.Add(EnumOption('platform', 'target platform', default_platform,
73 allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded')))
74 opts.Add('toolchain', 'compiler toolchain', 'default')
75 opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
76 opts.Add(BoolOption('dri', 'build DRI drivers', default_dri))