From e1bc68b0140fef465cda26b74602aeb1cbcfdafc Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 13 Jan 2011 20:52:01 +0000 Subject: scons: Fix cross-compilation. Hairy stuff. Don't know how to do it better though. --- SConstruct | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 8880d851e6..368ad83edf 100644 --- a/SConstruct +++ b/SConstruct @@ -118,6 +118,39 @@ if env['platform'] in ('posix', 'linux', 'freebsd', 'darwin'): 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 -- cgit v1.2.3