1 #######################################################################
9 import platform
as _platform
12 #######################################################################
20 default_platform
= sys
.platform
21 default_platform
= _platform_map
.get(default_platform
, default_platform
)
34 # find default_machine value
35 if 'PROCESSOR_ARCHITECTURE' in os
.environ
:
36 default_machine
= os
.environ
['PROCESSOR_ARCHITECTURE']
38 default_machine
= _platform
.machine()
39 default_machine
= _machine_map
.get(default_machine
, 'generic')
42 # find default_llvm value
43 if 'LLVM' in os
.environ
:
46 # Search sys.argv[] for a "platform=foo" argument since we don't have
47 # an 'env' variable at this point.
48 platform
= default_platform
49 pattern
= re
.compile("(platform=)(.*)")
51 m
= pattern
.match(arg
)
57 if platform
!= 'windows' and subprocess
.call(['llvm-config', '--version'], stdout
=subprocess
.PIPE
) == 0:
63 # find default_dri value
64 if default_platform
in ('linux', 'freebsd'):
66 elif default_platform
in ('winddk', 'windows', 'wince', 'darwin'):
72 #######################################################################
77 from SCons
.Variables
.BoolVariable
import BoolVariable
as BoolOption
79 from SCons
.Options
.BoolOption
import BoolOption
81 from SCons
.Variables
.EnumVariable
import EnumVariable
as EnumOption
83 from SCons
.Options
.EnumOption
import EnumOption
84 opts
.Add(BoolOption('debug', 'debug build', 'yes'))
85 opts
.Add(BoolOption('profile', 'profile build', 'no'))
86 opts
.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
87 opts
.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine
,
88 allowed_values
=('generic', 'ppc', 'x86', 'x86_64')))
89 opts
.Add(EnumOption('platform', 'target platform', default_platform
,
90 allowed_values
=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos5', 'freebsd8')))
91 opts
.Add('toolchain', 'compiler toolchain', 'default')
92 opts
.Add(BoolOption('llvm', 'use LLVM', default_llvm
))
93 opts
.Add(BoolOption('dri', 'build DRI drivers', default_dri
))