summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct51
1 files changed, 47 insertions, 4 deletions
diff --git a/SConstruct b/SConstruct
index 455b4719db..3a40244d88 100644
--- a/SConstruct
+++ b/SConstruct
@@ -23,6 +23,7 @@
import os
import os.path
import sys
+import SCons.Util
import common
@@ -32,10 +33,10 @@ import common
default_statetrackers = 'mesa'
if common.default_platform in ('linux', 'freebsd', 'darwin'):
- default_drivers = 'softpipe,failover,svga,i915,trace,identity,llvmpipe'
+ default_drivers = 'softpipe,failover,svga,i915,i965,trace,identity,llvmpipe'
default_winsys = 'xlib'
elif common.default_platform in ('winddk',):
- default_drivers = 'softpipe,svga,i915,trace,identity'
+ default_drivers = 'softpipe,svga,i915,i965,trace,identity'
default_winsys = 'all'
else:
default_drivers = 'all'
@@ -46,9 +47,9 @@ common.AddOptions(opts)
opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers,
['mesa', 'python', 'xorg']))
opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers,
- ['softpipe', 'failover', 'svga', 'i915', 'cell', 'trace', 'r300', 'identity', 'llvmpipe']))
+ ['softpipe', 'failover', 'svga', 'i915', 'i965', 'trace', 'r300', 'identity', 'llvmpipe']))
opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys,
- ['xlib', 'vmware', 'intel', 'gdi', 'radeon']))
+ ['xlib', 'vmware', 'intel', 'i965', 'gdi', 'radeon']))
opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
@@ -59,6 +60,17 @@ env = Environment(
ENV = os.environ,
)
+if os.environ.has_key('CC'):
+ env['CC'] = os.environ['CC']
+if os.environ.has_key('CFLAGS'):
+ env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
+if os.environ.has_key('CXX'):
+ env['CXX'] = os.environ['CXX']
+if os.environ.has_key('CXXFLAGS'):
+ env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
+if os.environ.has_key('LDFLAGS'):
+ env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
+
Help(opts.GenerateHelpText(env))
# replicate options values in local variables
@@ -97,6 +109,9 @@ env.Append(CPPPATH = [
'#/src/gallium/drivers',
])
+if env['msvc']:
+ env.Append(CPPPATH = ['#include/c99'])
+
# Posix
if platform in ('posix', 'linux', 'freebsd', 'darwin'):
@@ -162,8 +177,36 @@ Export('env')
# TODO: Build several variants at the same time?
# http://www.scons.org/wiki/SimultaneousVariantBuilds
+if env['platform'] != common.default_platform:
+ # GLSL code has to be built twice -- one for the host OS, another for the target OS...
+
+ host_env = Environment(
+ # options are ignored
+ # default tool is used
+ tools = ['default', 'custom'],
+ toolpath = ['#scons'],
+ ENV = os.environ,
+ )
+
+ host_env['platform'] = common.default_platform
+ host_env['machine'] = common.default_machine
+ host_env['debug'] = env['debug']
+
+ SConscript(
+ 'src/glsl/SConscript',
+ variant_dir = os.path.join(env['build'], 'host'),
+ duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
+ exports={'env':host_env},
+ )
+
SConscript(
'src/SConscript',
variant_dir = env['build'],
duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
)
+
+SConscript(
+ 'progs/SConscript',
+ variant_dir = os.path.join('progs', env['build']),
+ duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
+)