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'])
84 if env['platform'] == 'embedded':
85 env.Append(CPPDEFINES = [
87 ('_POSIX_C_SOURCE', '199309L'),
101 if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
102 env.Append(CPPDEFINES = [
104 ('_POSIX_C_SOURCE', '199309L'),
109 'HAVE_POSIX_MEMALIGN',
112 env.Append(CFLAGS = ['-fvisibility=hidden'])
113 if env['platform'] == 'darwin':
114 env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
125 #######################################################################
126 # Invoke host SConscripts
128 # For things that are meant to be run on the native host build machine, instead
129 # of the target machine.
132 # Create host environent
133 if env['crosscompile'] and env['platform'] != 'embedded':
134 host_env = Environment(
138 toolpath = ['#scons'],
143 host_env['platform'] = common.host_platform
144 host_env['machine'] = common.host_machine
145 host_env['toolchain'] = 'default'
146 host_env['llvm'] = False
148 host_env.Tool('gallium')
150 host_env['hostonly'] = True
151 assert host_env['crosscompile'] == False
153 Export(env = host_env)
157 variant_dir = host_env['build_dir'],
158 duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
163 #######################################################################
166 # TODO: Build several variants at the same time?
167 # http://www.scons.org/wiki/SimultaneousVariantBuilds
171 variant_dir = env['build_dir'],
172 duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html