summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2011-01-13 20:52:01 +0000
committerJosé Fonseca <jfonseca@vmware.com>2011-01-13 20:53:42 +0000
commite1bc68b0140fef465cda26b74602aeb1cbcfdafc (patch)
treeed3527b8a77b7304494abde1f7ea8eb1edc53e06 /SConstruct
parent0448f73f06b92dfd04e553147cac0e240dbabbdd (diff)
downloadmesa-e1bc68b0140fef465cda26b74602aeb1cbcfdafc.tar.gz
mesa-e1bc68b0140fef465cda26b74602aeb1cbcfdafc.tar.bz2
mesa-e1bc68b0140fef465cda26b74602aeb1cbcfdafc.zip
scons: Fix cross-compilation.
Hairy stuff. Don't know how to do it better though.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct33
1 files changed, 33 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 8880d851e64..368ad83edf3 100644
--- a/SConstruct
+++ b/SConstruct
@@ -119,6 +119,39 @@ Export('env')
#######################################################################
+# Invoke host SConscripts
+#
+# For things that are meant to be run on the native host build machine, instead
+# of the target machine.
+#
+
+# Create host environent
+if env['platform'] != common.host_platform:
+ host_env = Environment(
+ options = opts,
+ # no tool used
+ tools = [],
+ toolpath = ['#scons'],
+ ENV = os.environ,
+ )
+
+ # Override options
+ host_env['platform'] = common.host_platform
+ host_env['machine'] = common.host_machine
+ host_env['toolchain'] = 'default'
+ host_env['llvm'] = False
+
+ host_env.Tool('gallium')
+
+ SConscript(
+ 'src/glsl/SConscript',
+ variant_dir = host_env['build_dir'],
+ duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
+ exports={'env':host_env},
+ )
+
+
+#######################################################################
# Invoke SConscripts
# TODO: Build several variants at the same time?