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 opts.Save('config.py', env)
45 # Backwards compatability with old target configuration variable
47 targets = ARGUMENTS['targets']
51 targets = targets.split(',')
52 print 'scons: warning: targets option is deprecated; pass the targets on their own such as'
54 print ' scons %s' % ' '.join(targets)
56 COMMAND_LINE_TARGETS.append(targets)
59 Help(opts.GenerateHelpText(env))
61 # fail early for a common error on windows
66 raise SCons.Errors.UserError, "GLES requires libxml2-python to build"
68 #######################################################################
72 env.Prepend(CPPPATH = [
75 env.Append(CPPPATH = [
76 '#/src/gallium/include',
77 '#/src/gallium/auxiliary',
78 '#/src/gallium/drivers',
79 '#/src/gallium/winsys',
83 env.Append(CPPPATH = ['#include/c99'])
89 #######################################################################
90 # Invoke host SConscripts
92 # For things that are meant to be run on the native host build machine, instead
93 # of the target machine.
96 # Create host environent
97 if env['crosscompile'] and not env['embedded']:
98 host_env = Environment(
102 toolpath = ['#scons'],
107 host_env['platform'] = common.host_platform
108 host_env['machine'] = common.host_machine
109 host_env['toolchain'] = 'default'
110 host_env['llvm'] = False
112 host_env.Tool('gallium')
114 host_env['hostonly'] = True
115 assert host_env['crosscompile'] == False
118 host_env.Append(CPPPATH = ['#include/c99'])
126 variant_dir = host_env['build_dir'],
127 duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
134 #######################################################################
137 # TODO: Build several variants at the same time?
138 # http://www.scons.org/wiki/SimultaneousVariantBuilds
142 variant_dir = env['build_dir'],
143 duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
147 ########################################################################
151 from SCons.Node.Alias import default_ans
155 aliases = default_ans.keys()
158 env.Help('Recognized targets:\n')
159 for alias in aliases:
160 env.Help(' %s\n' % alias)