diff options
author | doko@ubuntu.com <doko@ubuntu.com> | 2012-06-30 18:42:45 (GMT) |
---|---|---|
committer | doko@ubuntu.com <doko@ubuntu.com> | 2012-06-30 18:42:45 (GMT) |
commit | 1abe1c5fe13ca64c54e16db25de7c4dd5578a7c1 (patch) | |
tree | 8ea445f4288eaa7db6407625b0c74a22625d3b37 /Lib | |
parent | b457b9be4deac2460cb8ac741af6a723d6cb4f88 (diff) | |
download | cpython-1abe1c5fe13ca64c54e16db25de7c4dd5578a7c1.zip cpython-1abe1c5fe13ca64c54e16db25de7c4dd5578a7c1.tar.gz cpython-1abe1c5fe13ca64c54e16db25de7c4dd5578a7c1.tar.bz2 |
- Issue #14330: For cross builds, don't use host python, use host search paths
for host compiler.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/util.py | 4 | ||||
-rw-r--r-- | Lib/sysconfig.py | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index bce8402..9833bf9 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -53,6 +53,10 @@ def get_platform (): return 'win-ia64' return sys.platform + # Set for cross builds explicitly + if "_PYTHON_HOST_PLATFORM" in os.environ: + return os.environ["_PYTHON_HOST_PLATFORM"] + if os.name != "posix" or not hasattr(os, 'uname'): # XXX what about the architecture? NT is Intel or Alpha, # Mac OS is M68k or PPC, etc. diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 2f2fac2..eccd304 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -138,6 +138,10 @@ if os.name == "nt" and "\\pc\\v" in _PROJECT_BASE[-10:].lower(): if os.name == "nt" and "\\pcbuild\\amd64" in _PROJECT_BASE[-14:].lower(): _PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir)) +# set for cross builds +if "_PROJECT_BASE" in os.environ: + _PROJECT_BASE = _safe_realpath(os.environ["_PROJECT_BASE"]) + def _is_python_source_dir(d): for fn in ("Setup.dist", "Setup.local"): if os.path.isfile(os.path.join(d, "Modules", fn)): @@ -673,6 +677,10 @@ def get_platform(): # Mac OS is M68k or PPC, etc. return sys.platform + # Set for cross builds explicitly + if "_PYTHON_HOST_PLATFORM" in os.environ: + return os.environ["_PYTHON_HOST_PLATFORM"] + # Try to distinguish various flavours of Unix osname, host, release, version, machine = os.uname() |