How to cross compile python interpreter for window

2019-08-21 07:14发布

问题:

I have installed all necessary packages i think. I do not know what causes my problem that i cannot successfully compile latest stable python.

 ./configure --host=i686-w64-mingw32 --build=x86_64-pc-linux-gnu  
checking build system type... x86_64-pc-linux-gnu
checking host system type... i686-w64-mingw32
checking for python3.7... python3.7
checking for python interpreter for cross build... python3.7
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... configure: error: cross build not supported for i686-w64-mingw32

Edit:

There is also promising project for cmake.. → The question remains open. https://github.com/python-cmake-buildsystem/python-cmake-buildsystem

回答1:

To my, and Python's README's, knowledge, this is not supported. Windows builds are officially made with the non-cross-platform MSVC compiler, so there's no point maintaining an additional toolchain support.

There was an unsuccessful attempt to add support for MinGW in https://bugs.python.org/issue3754.

Anaconda must be adding support privately in its python recipe by extensively patching Python's codebase.