mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #2513: enable 64bit cross compilation on windows.
This commit is contained in:
parent
aa63d0d4af
commit
495cf99aaf
16 changed files with 323 additions and 65 deletions
|
@ -329,6 +329,42 @@ version number. This can be changed to another text by using the
|
|||
The installer file will be written to the "distribution directory" --- normally
|
||||
:file:`dist/`, but customizable with the :option:`--dist-dir` option.
|
||||
|
||||
.. _cross-compile-windows:
|
||||
|
||||
Cross-compiling on Windows
|
||||
=====================
|
||||
|
||||
Starting with Python 2.6, distutils is capable of cross-compiling between
|
||||
Windows platforms. In practice, this means that with the correct tools
|
||||
installed, you can use a 32bit version of Windows to create 64bit extensions
|
||||
and vice-versa.
|
||||
|
||||
To build for an alternate platform, specify the :option:`--plat-name` option
|
||||
to the build command. Valid values are currently 'win32', 'win-amd64' and
|
||||
'win-ia64'. For example, on a 32bit version of Windows, you could execute::
|
||||
|
||||
python setup.py build --plat-name=win-amd64
|
||||
|
||||
to build a 64bit version of your extension. The Windows Installers also
|
||||
support this option, so the command::
|
||||
|
||||
python setup.py build --plat-name=win-amd64 bdist_wininst
|
||||
|
||||
would create a 64bit installation executable on your 32bit version of Windows.
|
||||
|
||||
To cross-compile, you must download the Python source code and cross-compile
|
||||
Python itself for the platform you are targetting - it is not possible from a
|
||||
binary installtion of Python (as the .lib etc file for other platforms are
|
||||
not included.) In practice, this means the user of a 32 bit operating
|
||||
system will need to use Visual Studio 2008 to open the
|
||||
:file:`PCBuild/PCbuild.sln` solution in the Python source tree and build the
|
||||
"x64" configuration of the 'pythoncore' project before cross-compiling
|
||||
extensions is possible.
|
||||
|
||||
Note that by default, Visual Studio 2008 does not install 64bit compilers or
|
||||
tools. You may need to reexecute the Visual Studio setup process and select
|
||||
these tools (using Control Panel->[Add/Remove] Programs is a convenient way to
|
||||
check or modify your existing install.)
|
||||
|
||||
.. _postinstallation-script:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue