1 #######################################################################
4 # For example, invoke scons as
6 # scons build=debug llvm=yes machine=x86
8 # to set configuration variables. Or you can write those options to a file
20 # to get the full list of options. See scons manpage for more info.
30 #######################################################################
31 # Configuration options
33 opts
= Variables('config.py')
34 common
.AddOptions(opts
)
39 toolpath
= ['#scons'],
43 # XXX: This creates a many problems as it saves...
44 #opts.Save('config.py', env)
46 # Backwards compatability with old target configuration variable
48 targets
= ARGUMENTS
['targets']
52 targets
= targets
.split(',')
53 print 'scons: warning: targets option is deprecated; pass the targets on their own such as'
55 print ' scons %s' % ' '.join(targets
)
57 COMMAND_LINE_TARGETS
.append(targets
)
60 Help(opts
.GenerateHelpText(env
))
62 # fail early for a common error on windows
67 raise SCons
.Errors
.UserError
, "GLES requires libxml2-python to build"
69 #######################################################################
72 env
.Append(CPPDEFINES
= [
73 ('PACKAGE_VERSION', '\\"9.2-devel\\"'),
74 ('PACKAGE_BUGREPORT', '\\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\\"'),
78 env
.Prepend(CPPPATH
= [
81 env
.Append(CPPPATH
= [
82 '#/src/gallium/include',
83 '#/src/gallium/auxiliary',
84 '#/src/gallium/drivers',
85 '#/src/gallium/winsys',
89 env
.Append(CPPPATH
= ['#include/c99'])
95 #######################################################################
96 # Invoke host SConscripts
98 # For things that are meant to be run on the native host build machine, instead
99 # of the target machine.
102 # Create host environent
103 if env
['crosscompile'] and not env
['embedded']:
104 host_env
= Environment(
108 toolpath
= ['#scons'],
113 host_env
['platform'] = common
.host_platform
114 host_env
['machine'] = common
.host_machine
115 host_env
['toolchain'] = 'default'
116 host_env
['llvm'] = False
118 host_env
.Tool('gallium')
120 host_env
['hostonly'] = True
121 assert host_env
['crosscompile'] == False
124 host_env
.Append(CPPPATH
= ['#include/c99'])
132 variant_dir
= host_env
['build_dir'],
133 duplicate
= 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
140 #######################################################################
143 # TODO: Build several variants at the same time?
144 # http://www.scons.org/wiki/SimultaneousVariantBuilds
148 variant_dir
= env
['build_dir'],
149 duplicate
= 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
153 ########################################################################
157 from SCons
.Node
.Alias
import default_ans
161 aliases
= default_ans
.keys()
164 env
.Help('Recognized targets:\n')
165 for alias
in aliases
:
166 env
.Help(' %s\n' % alias
)