Compiling Python 2.x with MinGW32 on Win32? 
Author Message
 Compiling Python 2.x with MinGW32 on Win32?


I have undertaken a small adventure to do whatever it takes to compile
python 2.x sources under my MinGW32/Win32 environment. Is there anyone
else undertaking efforts like this? The last discussion I could find
about it was back in 8/00 when somebody else was wondering why it was
not supported.

My progress so far:

I'm currently using a customized version of the
distutils.cygwinccompiler to compile the sources. The previous
discussion brought up the very good point that VC is, and will continue
to be, the standard compiler for Win32. So, I've built a quick python
script to parse the VC++ project file and try to emulate its behavior
using MinGW32. Hopefully, by doing that, subsequent Python releases can
be compiled with MinGW32 without duplicating the work of the VC++

I've surmounted compilation problems of types which seem to indicate
that nobody has made changes to MinGW32 or the Python sources to support
this effort. At present, I have made changes to both the MinGW32 header
files and various Python sources which bring me very close to building a
static core library. I'm down to the .rc file in the PC directory, but
it includes a few headers that are not included with MinGW32 (ver.h and

Compiling the core to a DLL library looks like it will require, at
minimum, some modification of every Python object in the Objects/
directory. The problem is that gcc doesn't like non-constant
initializers (see the Python FAQ) even though they should be okay, and
even though we can compile with g++ to get around it, g++ does not like
the use of the 'class' keyword, which the source files use as a variable
name. Hmm..

Eventually, I would like to make a 'build wizard' using wxPython that
allows users of MinGW to configure whether they want a DLL, or static
lib, which modules they would like compiled in, if they want a windows
or console executable, and other nifty features. The hardest part is
getting the sources to compile :)

Somehow, I don't think anybody will write back and say "oh, all this is
done already." But I can hope.

Ben Allfree

Mon, 19 May 2003 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Getting a Python library for cross-compiling with mingw32

2. Compiling Python with mingw32

3. Python 2.2.2 and 2.3a2 compile problems on Mingw32

4. Does OOC on Win32 use Mingw32?

5. Mingw32 modules (was: "win32: cygwin modules")

6. Updated compile tools for egcs/mingw32

7. Cross compiling Tcl Extensions with MINGW32

8. Compiling Python Extensions on Win32 w/GCC 2.95

9. Can't get (building win32 Python extensions)

10. Compiling Python 2.0 on Win32

11. Problem compiling Python 2.0 extension under Win32

12. Compiling Python on Win32


Powered by phpBB® Forum Software