8c8a82b38ec9725e7a0937bb487162066b5fdf40
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
= 'all'
34 default_drivers
= 'softpipe,failover,i915simple,i965simple'
35 default_winsys
= 'xlib'
36 elif common
.default_platform
in ('winddk',):
37 default_statetrackers
= 'all'
38 default_drivers
= 'softpipe,i915simple'
39 default_winsys
= 'all'
41 default_statetrackers
= 'all'
42 default_drivers
= 'all'
43 default_winsys
= 'all'
45 opts
= Options('config.py')
46 common
.AddOptions(opts
)
47 opts
.Add(ListOption('statetrackers', 'state_trackers to build', default_statetrackers
,
49 opts
.Add(ListOption('drivers', 'pipe drivers to build', default_drivers
,
50 ['softpipe', 'failover', 'i915simple', 'i965simple', 'cell']))
51 opts
.Add(ListOption('winsys', 'winsys drivers to build', default_winsys
,
52 ['xlib', 'intel', 'gdi']))
58 Help(opts
.GenerateHelpText(env
))
60 # replicate options values in local variables
64 machine
= env
['machine']
65 platform
= env
['platform']
68 x86
= machine
== 'x86'
69 gcc
= platform
in ('linux', 'freebsd', 'darwin')
70 msvc
= platform
in ('windows', 'winddk')
83 #######################################################################
86 # TODO: put the compiler specific settings in separate files
87 # TODO: auto-detect as much as possible
89 if platform
== 'winddk':
90 env
.Tool('winddk', ['scons'])
92 env
.Append(CPPPATH
= [
99 if platform
== 'wince':
100 env
.Tool('evc', ['scons'])
106 env
.Append(CPPPATH
= [
108 '#/src/gallium/include',
109 '#/src/gallium/auxiliary',
110 '#/src/gallium/drivers',
117 env
.Append(CFLAGS
= '-m32')
118 env
.Append(CXXFLAGS
= '-m32')
122 if platform
in ('posix', 'linux', 'freebsd', 'darwin'):
123 env
.Append(CPPDEFINES
= [
125 ('_POSIX_C_SOURCE', '199309L'),
131 'HAVE_POSIX_MEMALIGN',
133 env
.Append(CPPPATH
= ['/usr/X11R6/include'])
134 env
.Append(LIBPATH
= ['/usr/X11R6/lib'])
145 env
.ParseConfig('pkg-config --cflags --libs libdrm')
146 env
.Append(CPPDEFINES
= [
147 ('USE_EXTERNAL_DXTN_LIB', '1'),
149 'GLX_DIRECT_RENDERING',
150 'GLX_INDIRECT_RENDERING',
155 # See also http://www.scons.org/wiki/UsingPkgConfig
156 env
.ParseConfig('llvm-config --cflags --ldflags --libs')
157 env
.Append(CPPDEFINES
= ['MESA_LLVM'])
159 env
['LINK'] = env
['CXX']
162 if platform
in ('linux', 'freebsd', 'darwin'):
177 #######################################################################
180 # TODO: Build several variants at the same time?
181 # http://www.scons.org/wiki/SimultaneousVariantBuilds
185 build_dir
= common
.make_build_dir(env
),
186 duplicate
= 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html