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'])
127 #######################################################################
128 # Invoke host SConscripts
130 # For things that are meant to be run on the native host build machine, instead
131 # of the target machine.
134 # Create host environent
135 if env
['platform'] != common
.host_platform
:
136 host_env
= Environment(
140 toolpath
= ['#scons'],
145 host_env
['platform'] = common
.host_platform
146 host_env
['machine'] = common
.host_machine
147 host_env
['toolchain'] = 'default'
148 host_env
['llvm'] = False
150 host_env
.Tool('gallium')
153 'src/glsl/SConscript',
154 variant_dir
= host_env
['build_dir'],
155 duplicate
= 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
156 exports
={'env':host_env
},
160 #######################################################################
163 # TODO: Build several variants at the same time?
164 # http://www.scons.org/wiki/SimultaneousVariantBuilds
168 variant_dir
= env
['build_dir'],
169 duplicate
= 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html