dc5fd776a713bb4ce861b1df2996da68a77346de
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'] in ('posix', 'linux', 'freebsd', 'darwin'):
85 env
.Append(CPPDEFINES
= [
87 ('_POSIX_C_SOURCE', '199309L'),
92 'HAVE_POSIX_MEMALIGN',
95 env
.Append(CFLAGS
= ['-fvisibility=hidden'])
96 if env
['platform'] == 'darwin':
97 env
.Append(CPPDEFINES
= ['_DARWIN_C_SOURCE'])
108 #######################################################################
109 # Invoke host SConscripts
111 # For things that are meant to be run on the native host build machine, instead
112 # of the target machine.
115 # Create host environent
116 if env
['crosscompile'] and not env
['embedded']:
117 host_env
= Environment(
121 toolpath
= ['#scons'],
126 host_env
['platform'] = common
.host_platform
127 host_env
['machine'] = common
.host_machine
128 host_env
['toolchain'] = 'default'
129 host_env
['llvm'] = False
131 host_env
.Tool('gallium')
133 host_env
['hostonly'] = True
134 assert host_env
['crosscompile'] == False
137 host_env
.Append(CPPPATH
= ['#include/c99'])
145 variant_dir
= host_env
['build_dir'],
146 duplicate
= 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
153 #######################################################################
156 # TODO: Build several variants at the same time?
157 # http://www.scons.org/wiki/SimultaneousVariantBuilds
161 variant_dir
= env
['build_dir'],
162 duplicate
= 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html