1 #######################################################################
4 # For example, invoke scons as
6 # scons debug=1 dri=0 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.
29 #######################################################################
30 # Configuration options
32 default_statetrackers = 'mesa'
34 if common.default_platform in ('linux', 'freebsd', 'darwin'):
35 default_drivers = 'softpipe,failover,svga,i915,i965,trace,identity,llvmpipe'
36 default_winsys = 'xlib'
37 elif common.default_platform in ('winddk',):
38 default_drivers = 'softpipe,svga,i915,i965,trace,identity'
39 default_winsys = 'all'
41 default_drivers = 'all'
42 default_winsys = 'all'
44 opts = Variables('config.py')
45 common.AddOptions(opts)
46 opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers,
47 ['mesa', 'python', 'xorg']))
48 opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers,
49 ['softpipe', 'failover', 'svga', 'i915', 'i965', 'cell', 'trace', 'r300', 'identity', 'llvmpipe']))
50 opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys,
51 ['xlib', 'vmware', 'intel', 'i965', 'gdi', 'radeon']))
53 opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
58 toolpath = ['#scons'],
62 Help(opts.GenerateHelpText(env))
64 # replicate options values in local variables
68 machine = env['machine']
69 platform = env['platform']
72 x86 = machine == 'x86'
73 ppc = machine == 'ppc'
74 gcc = platform in ('linux', 'freebsd', 'darwin')
75 msvc = platform in ('windows', 'winddk')
89 #######################################################################
93 env.Append(CPPPATH = [
95 '#/src/gallium/include',
96 '#/src/gallium/auxiliary',
97 '#/src/gallium/drivers',
102 if platform in ('posix', 'linux', 'freebsd', 'darwin'):
103 env.Append(CPPDEFINES = [
105 ('_POSIX_C_SOURCE', '199309L'),
111 'HAVE_POSIX_MEMALIGN',
113 env.Append(CPPPATH = ['/usr/X11R6/include'])
114 env.Append(LIBPATH = ['/usr/X11R6/lib'])
125 env.ParseConfig('pkg-config --cflags --libs libdrm')
126 env.Append(CPPDEFINES = [
127 ('USE_EXTERNAL_DXTN_LIB', '1'),
129 'GLX_DIRECT_RENDERING',
130 'GLX_INDIRECT_RENDERING',
135 # See also http://www.scons.org/wiki/UsingPkgConfig
136 env.ParseConfig('llvm-config --cflags --ldflags --libs backend bitreader engine instrumentation interpreter ipo')
137 env.Append(CPPDEFINES = ['MESA_LLVM'])
139 env['LINK'] = env['CXX']
142 if platform in ('linux', 'freebsd', 'darwin'):
157 #######################################################################
160 # TODO: Build several variants at the same time?
161 # http://www.scons.org/wiki/SimultaneousVariantBuilds
163 if env['platform'] != common.default_platform:
164 # GLSL code has to be built twice -- one for the host OS, another for the target OS...
166 host_env = Environment(
167 # options are ignored
168 # default tool is used
169 toolpath = ['#scons'],
173 host_env['platform'] = common.default_platform
176 'src/glsl/SConscript',
177 variant_dir = env['build'] + '/host',
178 duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
179 exports={'env':host_env},
184 variant_dir = env['build'],
185 duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html