diff options
author | doko@python.org <doko@python.org> | 2013-01-31 23:52:03 +0100 |
---|---|---|
committer | doko@python.org <doko@python.org> | 2013-01-31 23:52:03 +0100 |
commit | d65e2bab3b438f883ef28245f51795b14a4c498f (patch) | |
tree | f9a237fb2be7cf175a68940f4210407842f0468a /Lib/sysconfig.py | |
parent | c5200b489de125088fdc445b5f5c97d7fb98cead (diff) | |
download | cpython-git-d65e2bab3b438f883ef28245f51795b14a4c498f.tar.gz |
- Issue #17086: Backport the patches from the 3.3 branch to cross-build
the package.
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r-- | Lib/sysconfig.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 9442d39f5f..d74ca391c6 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -116,6 +116,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 "_PYTHON_PROJECT_BASE" in os.environ: + # the build directory for posix builds + _PROJECT_BASE = os.path.normpath(os.path.abspath(".")) def is_python_build(): for fn in ("Setup.dist", "Setup.local"): if os.path.isfile(os.path.join(_PROJECT_BASE, "Modules", fn)): @@ -507,6 +511,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. |