|
pyMinGW
Copyright
© 2004-2005 Khalid A. Bakr
About
pyMinGW
pyMinGW is a patch to Python source that aims to get Python to compile under
MinGW.
Compiling Python in MinGW is not supported in the official
Python distribution. This is not an official patch. It is
not made for everyone. If you do not want to
compile Python yourself or use a Python so compiled then download the official
Windows distribution at Python's site.
This project is for those who need support for compiling, using,
or distributing a Python built with MinGW.
pyMinGW
News
- May
25th, 2006. Cleaned and updated pyMinGW. It now
supports the SVN Python 2.4 branch, and trunk
(currently 2.5aX). As the latter now includes ctypes,
emphasis was put on trying to get the latter to build
under MinGW. Almost all ctypes' tests now pass, except
the callbacks which are still crashing the interpreter.
(See the known issues document).
Tix now compiles under MinGW, and is included as
part of all versions of pyMinGW's binary extension packages.
There is also experimental support for producing
Python binaries and Python extensions that are compatible
with the standard distribution (please read disclaimer
in pyMinGW's license).
- Sept
28th, 2005. Updated pyMinGW to support Python 2.4.2
final. Please refer to the changes documents in the Download
section below. Also released extension binaries.
- Aug
19th, 2005. Made a binary distribution of pyMinGW-Python 2.4.1
Build 0.0.6.5 for those who cannot build the extensions. This is
just a binary packaging of the March pyMinGW-241 release. See
the Download section below.
- Apr
13th, 2005. Access to the download files should now
be okay. Working on updating the FAQ.
- Old
news.
Click here for access to pyMinGW's
old news.
pyMinGW
System Requirements
The patch was first tested on Windows 98, MSYS-1.0.10, and GCC 3.2 (MinGW
special) with the latest versions being tested with GCC 3.4.2 (MinGW
special). In general, I see no reason why it should not work on
Win95 or better, MSYS-1.0.10 or better, and GCC 3.2 (MinGW special)
or better. Be careful that the candidate releases of MinGW can be unstable.
The current release of MinGW (3.4.2 as of this writing) works fine.
My system:
- gcc-core-3.4.2-20040916-1.tar
- gcc-g++-3.4.2-20040916-1.tar
- mingw-runtime-3.3.tar
- w32api-3.2.tar
- binutils-2.15.91-20040904-1.tar, patched with
- GNU assembler 2.13
- GNU ld 2.13
- GNU make 3.80
How To Apply The Patch
In source form.
pyMinGW patches several Python source files, C code and
Python code. These, and the same is true for pyMinGW's binary
distributions, are all zipped up in a zip file which,
when extracted to the root of Python, will overwrite some of the
original Python files in their respective directories. So a word of
advice: keep backups.
Figure 1. below shows how the directory tree should look like
in Python 2.3.5 final from CVS with all the extensions
mentioned in \PCBuild\readme.txt living side by side with the
Python source.
Figure 1.
Compiling the various extensions requires that you build the sources of
the libraries that are needed to be linked by the Python extensions.
For example to build the bz2 Python extension, you need to:
- Download the bzip2 source (link is in \PCBuild\readme.txt of
the Python source archieve or from CVS/SVN)
- Build the bzip2 link library as per the instructions found in the
bzip2 source.
- Run make.exe from within the MSYS prompt and inside
the \MinGW directory (see build tree below) in one of
the following three possibilities:
- make python24.mak bz2
- make bz2.mak all
- make python24.mak all
If you downloaded the sources of all the subprojects and built all their link
libraries and placed them as shown in Figure 1. (hopefully building them there)
and hence plan on compiling and building all the Python extensions
then issuing the command: make python24.mak all or make python23.mak all
should suffice to build all the extensions in one go, although the other forms
of the make command as mentioned above will still work if you need finer control.
Figure 2.
Figure 2. above shows where the \MinGW directory (which is the heart of
the pyMinGW distribution) goes. This placing will be automatically done by
the unzipping procedure. You only need to specify that you want to
unzip the pyMinGW package to the \src subdirectory of the Python source
you are patching. The unzipping program will then create the \MinGW
directory in the \src directory and will also patch all of the needed
files to get Python to compile under MinGW.
Python source archieve
vs. source from CVS/SVN. Please
note that if you downloaded the Python source archieve (as opposed to
the source from CVS/SVN) that your extracted Python source might not have
a \src directory. If that is the case make sure that you extract
the pyMinGW package where the \PCBuild, \PC,
and \Include directories reside.
For more details, read the instructions in the readme
file included in the pyMinGW source package (location: \MinGW\Readme.txt)
on how to apply the patch, and how to build Python with
MinGW.
Using binary distributions
. If you are using the binary
distributions then simply extract the packaged file to the root
of your local Python directory, that is to where the
\PCBuild, \PC, \Lib, and \Include
directories reside.
This will create the \MinGW directory which will contain
the Python binaries and at the same time patch several Python source
files, all distutils related. To use your MinGW compiled Python,
change directory to where the new MinGW directory is and type
python at the prompt.
Upgrading
from an earlier version. If you are upgrading from an earlier version of
pyMinGW then you should not have a problem if you used the same directory
tree structure as shown above. You can always of course delete the old MinGW
directory and start fresh. Or you can simply extract the new pyMinGW version
to the root of Python source- like you did before- and everything should
be okay.
If you used earlier versions of pyMinGW which used a different directory
structure than the one mentioned above, then apply pyMinGW first and then simply
cut and paste the subprojects' directories until your local Python source tree
looks like the one shown above. If, on the other hand, you were brave enough to
play with other Python source files not modified by the patch, then
(just to be safe) you should get a fresh copy of Python source to apply
pyMinGW to. You should always keep that fresh copy handy in case you need a
clean start to the Python build procedure.
Standalone pyMinGW Patches to Python
Source
- The pyMinGW-250 source patch, version 0.0.6.8
- The pyMinGW-243 source patch, version 0.0.6.7
- The pyMinGW-235 source patch, version 0.1.7.7
Binary Distributions of MinGW Compiled Python
- For Python 2.5a2:
- pyMinGW-bin-core-2.5a2.1 (1178KB, MD5: fdcba24700879fe4df44637984bf762e)
- pyMinGW-bin-exts-2.5 (2150KB, MD5: 6656d8e45c3451e2afb7fbda39829acb)
- Select one of the following two depending on your OS:
- pyMinGW-bin-exts-bsddb-Py2.5-WinNT,2K,XP,2003
(416KB, MD5: 41b43758fa79a59ed7a97f2127453bfa)
- pyMinGW-bin-exts-bsddb-Py2.5-Win9X,ME
(415KB, MD5: 037a8026bda4cb7d6487693db6da1e82)
- pyMinGW-bin-minipy-2.5a2.1 (836KB, MD5: a2572475932c46db2ffbb13cf0a5a0ae)
- pyMinGW-tcl-2.5 (1068KB, MD5: c4b7fe84b3819d577bee8f18c1102778)
- pyMinGW-tools-0.0.1 (23KB, MD5: b4fba40987c806d61e50ad2054cb22be)
- Read the instructions.
- Read about changes.
- Last updated: May 12th, 2006.
- For Python 2.4.3:
- pyMinGW-bin-core-2.4.3.1 (1055KB, MD5: cae883a5bc2e96fd5ac3e4d54d4a9437)
- pyMinGW-bin-exts-2.4 (1626KB, MD5: e778195b540d21aebd806b9570e4ea6e)
- Select one of the following two depending on your OS:
- pyMinGW-bin-exts-bsddb-Py2.4-WinNT,2K,XP,2003
(415KB, MD5: ef09341ed8f13d3e7975264908f8078e)
- pyMinGW-bin-exts-bsddb-Py2.4-Win9X,ME
(414KB, MD5: e591f82cc2790dc3f34fd1b175b9825e)
- pyMinGW-bin-minipy-2.4.3.1 (712KB, MD5: 28037b326eddcfb415cf5c7bf3e305ff)
- pyMinGW-tcl-2.4 (1063KB, MD5: adbf83cbf98e9b5619fae8f1a1fccd52)
- pyMinGW-tools-0.0.1 (23KB, MD5: b4fba40987c806d61e50ad2054cb22be)
- Read the instructions.
- Read about changes.
- Last updated: May 12th, 2006.
- For Python 2.3.5:
Known
Issues
You can read
about the known issues here.
Contact me
If you find pyMinGW
useful or even frustrating, drop me a line and tell me
about it.
Back to top
Copyright © 2004-2006 Khalid A. Bakr.
All Rights Reserved.
|