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 # Backwards compatability with old target configuration variable
45 targets = ARGUMENTS['targets']
49 targets = targets.split(',')
50 print 'scons: warning: targets option is deprecated; pass the targets on their own such as'
52 print ' scons %s' % ' '.join(targets)
54 COMMAND_LINE_TARGETS.append(targets)
57 Help(opts.GenerateHelpText(env))
59 # fail early for a common error on windows
64 raise SCons.Errors.UserError, "GLES requires libxml2-python to build"
66 #######################################################################
70 env.Prepend(CPPPATH = [
73 env.Append(CPPPATH = [
74 '#/src/gallium/include',
75 '#/src/gallium/auxiliary',
76 '#/src/gallium/drivers',
77 '#/src/gallium/winsys',
81 env.Append(CPPPATH = ['#include/c99'])
87 #######################################################################
88 # Invoke host SConscripts
90 # For things that are meant to be run on the native host build machine, instead
91 # of the target machine.
94 # Create host environent
95 if env['crosscompile'] and not env['embedded']:
96 host_env = Environment(
100 toolpath = ['#scons'],
105 host_env['platform'] = common.host_platform
106 host_env['machine'] = common.host_machine
107 host_env['toolchain'] = 'default'
108 host_env['llvm'] = False
110 host_env.Tool('gallium')
112 host_env['hostonly'] = True
113 assert host_env['crosscompile'] == False
116 host_env.Append(CPPPATH = ['#include/c99'])
124 variant_dir = host_env['build_dir'],
125 duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
132 #######################################################################
135 # TODO: Build several variants at the same time?
136 # http://www.scons.org/wiki/SimultaneousVariantBuilds
140 variant_dir = env['build_dir'],
141 duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html