Add Canadian Cross support.

Add support to build MinGW tools using Cygwin. This is a Canadian cross
build.

Do not expand the directives when parsing a configuration file. Hold
in the package object the text as read from the configuration file. Still
parse the logic but leave the macros. This allows a configuration to be
varied when the build happens. The Canadian cross uses this to build a
build compiler used to build a Cxc runtime.

Add Cxc support to the build module. In the defaults add rm and rmfile
macros, add Cxc paths and pre-build script code.

In the setbuilder check for a Cxc build and if so and the package
allow Cxc build the build host version then the host target
version.

Add cygiwn support to the defaults processing and to the Windows module.
This commit is contained in:
Chris Johns
2013-04-01 15:19:56 +11:00
parent 0d9b101247
commit 4f26bdb2f0
30 changed files with 562 additions and 1200 deletions

View File

@@ -21,13 +21,42 @@
# Windows specific support and overrides.
#
import error
import pprint
import os
import execute
def load():
# Default to the native Windows Python.
uname = 'win32'
system = 'mingw32'
if os.environ.has_key('HOSTTYPE'):
hosttype = os.environ['HOSTTYPE']
else:
hosttype = 'i686'
host_triple = hosttype + '-pc-' + system
build_triple = hosttype + '-pc-' + system
# See if this is actually Cygwin Python
if os.name == 'posix':
try:
uname = os.uname()
hosttype = uname[4]
uname = uname[0]
if uname.startswith('CYGWIN'):
if uname.endswith('WOW64'):
uname = 'cygwin'
build_triple = hosttype + '-pc-' + uname
hosttype = 'x86_64'
host_triple = hosttype + '-w64-' + system
else:
raise error.general('invalid uname for Windows')
else:
raise error.general('invalid POSIX python')
except:
pass
if os.environ.has_key('NUMBER_OF_PROCESSORS'):
ncpus = int(os.environ['NUMBER_OF_PROCESSORS'])
else:
@@ -36,14 +65,11 @@ def load():
smp_mflags = '-j' + str(ncpus)
else:
smp_mflags = ''
if os.environ.has_key('HOSTTYPE'):
hosttype = os.environ['HOSTTYPE']
else:
hosttype = 'i686'
system = 'mingw32'
defines = {
'_os': ('none', 'none', 'win32'),
'_host': ('triplet', 'required', hosttype + '-pc-' + system),
'_build': ('triplet', 'required', build_triple),
'_host': ('triplet', 'required', host_triple),
'_host_vendor': ('none', 'none', 'microsoft'),
'_host_os': ('none', 'none', 'win32'),
'_host_cpu': ('none', 'none', hosttype),