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 #######################################################################
65 with
open("VERSION") as f
:
66 mesa_version
= f
.read().strip()
67 env
.Append(CPPDEFINES
= [
68 ('PACKAGE_VERSION', '\\"%s\\"' % mesa_version
),
69 ('PACKAGE_BUGREPORT', '\\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\\"'),
73 env
.Prepend(CPPPATH
= [
76 env
.Append(CPPPATH
= [
77 '#/src/gallium/include',
78 '#/src/gallium/auxiliary',
79 '#/src/gallium/drivers',
80 '#/src/gallium/winsys',
84 env
.Append(CPPPATH
= ['#include/c99'])
90 #######################################################################
91 # Invoke host SConscripts
93 # For things that are meant to be run on the native host build machine, instead
94 # of the target machine.
97 # Create host environent
98 if env
['crosscompile'] and not env
['embedded']:
99 host_env
= Environment(
103 toolpath
= ['#scons'],
108 host_env
['platform'] = common
.host_platform
109 host_env
['machine'] = common
.host_machine
110 host_env
['toolchain'] = 'default'
111 host_env
['llvm'] = False
113 host_env
.Tool('gallium')
115 host_env
['hostonly'] = True
116 assert host_env
['crosscompile'] == False
119 host_env
.Append(CPPPATH
= ['#include/c99'])
127 variant_dir
= host_env
['build_dir'],
128 duplicate
= 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
135 #######################################################################
138 # TODO: Build several variants at the same time?
139 # http://www.scons.org/wiki/SimultaneousVariantBuilds
143 variant_dir
= env
['build_dir'],
144 duplicate
= 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
148 ########################################################################
152 from SCons
.Node
.Alias
import default_ans
156 aliases
= default_ans
.keys()
159 env
.Help('Recognized targets:\n')
160 for alias
in aliases
:
161 env
.Help(' %s\n' % alias
)