#
# Create host environent
-if env['platform'] != common.host_platform:
+if env['crosscompile'] and env['platform'] != 'embedded':
host_env = Environment(
options = opts,
# no tool used
#######################################################################
# Defaults
-_platform_map = {
- 'linux2': 'linux',
- 'win32': 'windows',
-}
-
-host_platform = sys.platform
-host_platform = _platform_map.get(host_platform, host_platform)
+host_platform = _platform.system().lower()
# Search sys.argv[] for a "platform=foo" argument since we don't have
# an 'env' variable at this point.
else:
target_platform = host_platform
-cross_compiling = target_platform != host_platform
-
_machine_map = {
'x86': 'x86',
'i386': 'x86',
default_machine = host_machine
default_toolchain = 'default'
-if target_platform == 'windows' and cross_compiling:
+if target_platform == 'windows' and host_platform != 'windows':
default_machine = 'x86'
default_toolchain = 'crossmingw'
import os.path
import re
import subprocess
+import platform as _platform
import SCons.Action
import SCons.Builder
gcc = env['gcc']
msvc = env['msvc']
+ # Determine whether we are cross compiling; in particular, whether we need
+ # to compile code generators with a different compiler as the target code.
+ host_platform = _platform.system().lower()
+ host_machine = os.environ.get('PROCESSOR_ARCHITECTURE', _platform.machine())
+ host_machine = {
+ 'x86': 'x86',
+ 'i386': 'x86',
+ 'i486': 'x86',
+ 'i586': 'x86',
+ 'i686': 'x86',
+ 'ppc' : 'ppc',
+ 'x86_64': 'x86_64',
+ }.get(host_machine, 'generic')
+ env['crosscompile'] = platform != host_platform
+ if machine == 'x86_64' and host_machine != 'x86_64':
+ env['crosscompile'] = True
+
# Backwards compatability with the debug= profile= options
if env['build'] == 'debug':
if not env['debug']:
]
-if env['platform'] == common.host_platform:
+if not env['crosscompile'] or env['platform'] == 'embedded':
if env['msvc']:
env.Prepend(CPPPATH = ['#/src/getopt'])
env.PrependUnique(LIBS = [getopt])
Export('builtin_glsl_function')
- if common.cross_compiling:
- Return()
-
sources += builtin_glsl_function
glsl = env.ConvenienceLibrary(