Issue #2513: enable 64bit cross compilation on windows.

This commit is contained in:
Mark Hammond 2008-04-07 01:53:39 +00:00
parent aa63d0d4af
commit 495cf99aaf
16 changed files with 323 additions and 65 deletions

View file

@ -9,11 +9,11 @@ Implements the bdist_msi command.
import sys, os
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import remove_tree
from distutils.sysconfig import get_python_version
from distutils.version import StrictVersion
from distutils.errors import DistutilsOptionError
from distutils.util import get_platform
from distutils import log
import msilib
from msilib import schema, sequence, text
@ -87,6 +87,9 @@ class bdist_msi (Command):
user_options = [('bdist-dir=', None,
"temporary directory for creating the distribution"),
('plat-name=', 'p',
"platform name to embed in generated filenames "
"(default: %s)" % get_platform()),
('keep-temp', 'k',
"keep the pseudo-installation tree around after " +
"creating the distribution archive"),
@ -116,6 +119,7 @@ class bdist_msi (Command):
def initialize_options (self):
self.bdist_dir = None
self.plat_name = None
self.keep_temp = 0
self.no_target_compile = 0
self.no_target_optimize = 0
@ -139,7 +143,10 @@ class bdist_msi (Command):
else:
self.target_version = short_version
self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
self.set_undefined_options('bdist',
('dist_dir', 'dist_dir'),
('plat_name', 'plat_name'),
)
if self.pre_install_script:
raise DistutilsOptionError, "the pre-install-script feature is not yet implemented"
@ -181,7 +188,7 @@ class bdist_msi (Command):
if not target_version:
assert self.skip_build, "Should have already checked this"
target_version = sys.version[0:3]
plat_specifier = ".%s-%s" % (get_platform(), target_version)
plat_specifier = ".%s-%s" % (self.plat_name, target_version)
build = self.get_finalized_command('build')
build.build_lib = os.path.join(build.build_base,
'lib' + plat_specifier)
@ -633,8 +640,7 @@ class bdist_msi (Command):
def get_installer_filename(self, fullname):
# Factored out to allow overriding in subclasses
plat = get_platform()
installer_name = os.path.join(self.dist_dir,
"%s.%s-py%s.msi" %
(fullname, plat, self.target_version))
base_name = "%s.%s-py%s.msi" % (fullname, self.plat_name,
self.target_version)
installer_name = os.path.join(self.dist_dir, base_name)
return installer_name