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))
60 #######################################################################
64 env.Prepend(CPPPATH = [
67 env.Append(CPPPATH = [
68 '#/src/gallium/include',
69 '#/src/gallium/auxiliary',
70 '#/src/gallium/drivers',
71 '#/src/gallium/winsys',
75 env.Append(CPPPATH = ['#include/c99'])
78 if env['platform'] == 'embedded':
79 env.Append(CPPDEFINES = [
81 ('_POSIX_C_SOURCE', '199309L'),
95 if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'):
96 env.Append(CPPDEFINES = [
98 ('_POSIX_C_SOURCE', '199309L'),
103 'HAVE_POSIX_MEMALIGN',
106 env.Append(CFLAGS = ['-fvisibility=hidden'])
107 if env['platform'] == 'darwin':
108 env.Append(CPPDEFINES = ['_DARWIN_C_SOURCE'])
121 #######################################################################
122 # Invoke host SConscripts
124 # For things that are meant to be run on the native host build machine, instead
125 # of the target machine.
128 # Create host environent
129 if env['platform'] != common.host_platform:
130 host_env = Environment(
134 toolpath = ['#scons'],
139 host_env['platform'] = common.host_platform
140 host_env['machine'] = common.host_machine
141 host_env['toolchain'] = 'default'
142 host_env['llvm'] = False
144 host_env.Tool('gallium')
147 'src/glsl/SConscript',
148 variant_dir = host_env['build_dir'],
149 duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
150 exports={'env':host_env},
154 #######################################################################
157 # TODO: Build several variants at the same time?
158 # http://www.scons.org/wiki/SimultaneousVariantBuilds
162 variant_dir = env['build_dir'],
163 duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html