Getting a Python library for cross-compiling with mingw32

Gerhard Häring gh_pythonlist at gmx.de
Sat Apr 13 15:25:47 EDT 2002


* Alexandre Courbot <alexandrecourbot at linuxgames.com> [2002-04-13 16:06
* +0200]:
> Hello everybody,
> 
> I'm currently porting my Linux app (which heavily uses the Python
> library) to Windows, but I don't own Windows myself. So I'm
> cross-compiling the stuff from my Linux box using mingw32.

The main problem is not cross-compiling - I've done that successfully
from Linux x86 to Linux-StrongARM some day during the 2.2 beta days. The
main problem is that mingw32 isn't supported in Python's autoconf-based
build process, yet.

> [...] I then attempted to cross-compile Python itself. It looks like
> it's not intented for that :) After disabling configure tests that
> didn't like cross compilers, I had to twiddle even more to get a
> binary.  Finally, I managed to get a binary and a library, that even
> worked under Wine!

Wow! Cool. But you know that the resulting binary isn't necessarily
binary compatible with the Standard win32 Python distribution, do you?

> [...] Please note that I largely prefer having a version >= 2.2.
> Anyone knows of a place which provides suitable binaries, or any
> Python hacker could help me properly compiling my binary?

Next time I reboot to Windows, I can send you my gcc import library for
the standard win32 Python. It's easy to create with Cygwin, btw. I'd
have to check if this is suitable for cross-compiling from a *nix,
though.

> It looks like the source distribution wouldn't need big changes to be
> cross-compileable, which would be nice.

No, but since distutils is part of the Python build process, this got
messier. In fact, in my cross-compiling effort, I had to replace the
StrongARM ./python binary temporarily with a x86 ./python binary of the
same version to have distutils build its extension modules. For
cross-compiling, I'd suggest to add a switch --with-native-python= to
the configure script.

> I'd be glad to help making the source distribution cross-compileable,
> provided I can solve this issue and you guys think the feature would
> be usefull.

It sure would be very useful. One point: doesn't the configure script
use "uname" at some point? This would need to be worked around, too. And
one of these days I should resume my efforts with adding mingw32 as a
supported platform for Python's autoconf.

Gerhard
-- 
This sig powered by Python!
Außentemperatur in München: 10.1 °C      Wind: 2.9 m/s





More information about the Python-list mailing list