summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/install.py
diff options
context:
space:
mode:
authorMark Hammond <mhammond@skippinet.com.au>2008-04-07 01:53:39 (GMT)
committerMark Hammond <mhammond@skippinet.com.au>2008-04-07 01:53:39 (GMT)
commit495cf99aaf40fb1c0859e528d5b2c52018fba09f (patch)
tree7eccc4215be221e4f5aae27a487e69d8057c2465 /Lib/distutils/command/install.py
parentaa63d0d4af3db832b390ac74517af5eb799540e5 (diff)
downloadcpython-495cf99aaf40fb1c0859e528d5b2c52018fba09f.zip
cpython-495cf99aaf40fb1c0859e528d5b2c52018fba09f.tar.gz
cpython-495cf99aaf40fb1c0859e528d5b2c52018fba09f.tar.bz2
Issue #2513: enable 64bit cross compilation on windows.
Diffstat (limited to 'Lib/distutils/command/install.py')
-rw-r--r--Lib/distutils/command/install.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index 0d39b91..33a1212 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -16,6 +16,7 @@ from distutils.sysconfig import get_config_vars
from distutils.errors import DistutilsPlatformError
from distutils.file_util import write_file
from distutils.util import convert_path, subst_vars, change_root
+from distutils.util import get_platform
from distutils.errors import DistutilsOptionError
if sys.version < "2.2":
@@ -503,6 +504,14 @@ class install (Command):
# Obviously have to build before we can install
if not self.skip_build:
self.run_command('build')
+ # If we built for any other platform, we can't install.
+ build_plat = self.distribution.get_command_obj('build').plat_name
+ # check warn_dir - it is a clue that the 'install' is happening
+ # internally, and not to sys.path, so we don't check the platform
+ # matches what we are running.
+ if self.warn_dir and build_plat != get_platform():
+ raise DistutilsPlatformError("Can't install when "
+ "cross-compiling")
# Run all sub-commands (at least those that need to be run)
for cmd_name in self.get_sub_commands():