Getting a Python library for cross-compiling with mingw32
Alexandre Courbot
alexandrecourbot at linuxgames.com
Sun Apr 14 05:33:48 EDT 2002
> > [...] 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?
Mmm, not sure what you mean. You mean my binary might not run with the
official release modules and so on? Actually my goal is just to embed
Python in my app (statically if possible) that would come with the
mandatory Python modules and its own wrappers, and set the import path
appropriately so the user doesn't have to install the whole Python stuff
just to play. So it'd just need to be compatible with itself, plus maybe
the official Python DLL if I can't link statically (don't know why, but
despite of my linker options and the fact I had the .a the binaries
always required the DLL of the libs I used so far (SDL and z))
> > [...] 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.
Would certainly help - please don't send it by mail though (I suppose
it's huge) as I only have RTC here ;) I don't think there would be any
compatibility problems. As far as I've seen, mingw32 cross compiler for
Linux just works as well as the Windows native one, so anything working
with gcc should make it.
> > 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'll give it a second try following your suggestions. But I found no
trace of --with-native-python in 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.
Haven't cared about uname, but it's worth checking. And I'll probably
try harder to get a "out-of-the-box" compilation with mingw32. Your help
would certainly be precious, as you seem to already have attempted the
thing. Not to mention I still have no clue on how to include the builtin
module required for Windows systems! :)
Thanks for the reply anyway!
Alex.
--
http://www.gnurou.org
More information about the Python-list
mailing list