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 with
open("VERSION") as f
:
73 mesa_version
= f
.read().strip()
74 env
.Append(CPPDEFINES
= [
75 ('PACKAGE_VERSION', '\\"%s\\"' % mesa_version
),
76 ('PACKAGE_BUGREPORT', '\\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\\"'),
80 env
.Prepend(CPPPATH
= [
83 env
.Append(CPPPATH
= [
84 '#/src/gallium/include',
85 '#/src/gallium/auxiliary',
86 '#/src/gallium/drivers',
87 '#/src/gallium/winsys',
91 env
.Append(CPPPATH
= ['#include/c99'])
97 #######################################################################
98 # Invoke host SConscripts
100 # For things that are meant to be run on the native host build machine, instead
101 # of the target machine.
104 # Create host environent
105 if env
['crosscompile'] and not env
['embedded']:
106 host_env
= Environment(
110 toolpath
= ['#scons'],
115 host_env
['platform'] = common
.host_platform
116 host_env
['machine'] = common
.host_machine
117 host_env
['toolchain'] = 'default'
118 host_env
['llvm'] = False
120 host_env
.Tool('gallium')
122 host_env
['hostonly'] = True
123 assert host_env
['crosscompile'] == False
126 host_env
.Append(CPPPATH
= ['#include/c99'])
134 variant_dir
= host_env
['build_dir'],
135 duplicate
= 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
142 #######################################################################
145 # TODO: Build several variants at the same time?
146 # http://www.scons.org/wiki/SimultaneousVariantBuilds
150 variant_dir
= env
['build_dir'],
151 duplicate
= 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
155 ########################################################################
159 from SCons
.Node
.Alias
import default_ans
163 aliases
= default_ans
.keys()
166 env
.Help('Recognized targets:\n')
167 for alias
in aliases
:
168 env
.Help(' %s\n' % alias
)