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 if common
.default_platform
in ('linux', 'freebsd', 'darwin'):
33 default_statetrackers
= 'mesa'
34 default_drivers
= 'softpipe,failover,i915simple,i965simple'
35 default_winsys
= 'xlib'
36 elif common
.default_platform
in ('winddk',):
37 default_statetrackers
= 'none'
38 default_drivers
= 'softpipe,i915simple'
39 default_winsys
= 'none'
41 default_drivers
= 'all'
42 default_winsys
= 'all'
44 opts
= Options('config.py')
45 common
.AddOptions(opts
)
46 opts
.Add(ListOption('statetrackers', 'state_trackers to build', default_statetrackers
,
48 opts
.Add(ListOption('drivers', 'pipe drivers to build', default_drivers
,
49 ['softpipe', 'failover', 'i915simple', 'i965simple', 'cell']))
50 opts
.Add(ListOption('winsys', 'winsys drivers to build', default_winsys
,
56 Help(opts
.GenerateHelpText(env
))
58 # replicate options values in local variables
62 machine
= env
['machine']
63 platform
= env
['platform']
66 x86
= machine
== 'x86'
67 gcc
= platform
in ('linux', 'freebsd', 'darwin')
68 msvc
= platform
in ('windows', 'winddk')
81 #######################################################################
84 # TODO: put the compiler specific settings in separate files
85 # TODO: auto-detect as much as possible
87 if platform
== 'winddk':
88 env
.Tool('winddk', ['.'])
90 env
.Append(CPPPATH
= [
101 env
.Append(CPPPATH
= [
103 '#/src/gallium/include',
104 '#/src/gallium/auxiliary',
105 '#/src/gallium/drivers',
112 env
.Append(CFLAGS
= '-m32')
113 env
.Append(CXXFLAGS
= '-m32')
117 if platform
in ('posix', 'linux', 'freebsd', 'darwin'):
118 env
.Append(CPPDEFINES
= [
120 ('_POSIX_C_SOURCE', '199309L'),
126 'HAVE_POSIX_MEMALIGN',
128 env
.Append(CPPPATH
= ['/usr/X11R6/include'])
129 env
.Append(LIBPATH
= ['/usr/X11R6/lib'])
140 env
.ParseConfig('pkg-config --cflags --libs libdrm')
141 env
.Append(CPPDEFINES
= [
142 ('USE_EXTERNAL_DXTN_LIB', '1'),
144 'GLX_DIRECT_RENDERING',
145 'GLX_INDIRECT_RENDERING',
150 # See also http://www.scons.org/wiki/UsingPkgConfig
151 env
.ParseConfig('llvm-config --cflags --ldflags --libs')
152 env
.Append(CPPDEFINES
= ['MESA_LLVM'])
154 env
['LINK'] = env
['CXX']
157 if platform
in ('linux', 'freebsd', 'darwin'):
172 #######################################################################
175 # TODO: Build several variants at the same time?
176 # http://www.scons.org/wiki/SimultaneousVariantBuilds
180 build_dir
= common
.make_build_dir(env
),
181 duplicate
= 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html