|
SUMMARY The files you need for a functional MinGW compiled Python depend on your needs. A complete system includes:
The binary core includes python.exe, pythonw.exe, w9xpopen.exe, and pythonXY.dll in addition to pymingw.py (in \Lib\site-packages), and some patches to distutils for fine-tunning the ccompiler build system. Where available, the minipy package is optional; it is identical to the binary core package except it replaces the Python interpreter with a custom built mini-Python whose asian codecs are left out. Of course if you don't need tcl, which includes Tcl, Tk, and Tix, you can skip it. The same goes for the minipy if you don't need it, or the binary extensions if you just need a PythonXY.dll as then the binary core will suffice. INSTALLATION Always use the right pyMinGW versions for the Pythons you are patching. Don't use pyMinGW-23 for the Python 2.5 series, for example. And do remember we are here talking about binary distributions. You can either install a pyMinGW binary distribution to work with Python's source (from source archive), or you can install it alongside your standard Python binary distribution. In either case, you should not be able to mess up any installation of standard Pythons you may have on your system. Unless. For your own convenience, two Python Inno Setup install scripts exist in the pymingw-tools package, one is named "PythonXY.iss" and another called "PythonXY-ModifyRegistry.iss", which as the name suggests includes Windows registry modification instructions. It is assumed that you will use the latter only if you know what you are doing, especially since it has some hard-coded paths there. If you don't want the install script to modify your registry for you (that is if you are going to use the script to start with), then use the "PythonXY.iss" and you should be safe. If you ask me, the safest route would be to install the pyMinGW binary packages alongside your existing Python, and then not use any install scripts at all. If you do that then you can use (if you need to) the available and included tools (switchPY, and switchDLL) to switch between the MinGW compiled Python and the standard Python distribution. And as to why one may want to do that, the answer is as follows: firstly, to manage the runtime mismatch problem neatly (see section 4 of the issues document). Secondly, this will allow us to use the Windows registry information already stored by the standard distribution to install third party extensions. Thirdly, and in general, permit us to use all functions that the standard distribution provides (until we have our own, using a clean ctypes, IPv.6, etc.), and yet give us the ability to have the MinGW compiled Python handy for distributing programs to others without the need to include MSVCR71.dll and the like. Installation directory. As discussed on the main page, always install to the root directory of Python, to the parent directory of both \Lib, and \Include. Once you do that, your MinGW compiled Python will have its home in a new directory called \MinGW living alongside the \Lib, and \Include directories. pyMinGW TOOLS The following section is relevant to Python 2.4+ only. Starting from May, 2006, pyMinGW includes tools to switch between Pythons (from standard to MinGW compiled and vice versa), and includes other tools to switch runtime DLLs referenced in binary files. This is from running switchDLL -h:
Usage: switchDLL [options]
where options: "[v|V] [-h|-help] [-pyRT DLLname] [-rtOF [Binfile]]"
"[-rt Binfile DLLname] [-si OldDLL NewDLL] [-eg]"
-------------------------------------------------------------------------
Options detailed:
-------------------------------------------------------------------------
-V Prints program name and version
-v Prints program name, version, and copyright
-h Prints this screen
-help Same as -h above
-eg Shows example use of all options
-si Old_DLL New_DLL Sets internals in Old_DLL to New_DLL creating
a new file in the process, New_DLL
-rt Binfile DLLname Sets runtime of Binfile to DLLname
-pyRT DLLname Sets runtime to DLLname in all Python binary
files. Choice of DLLname is in:
[msvcrt, msvcr71, msvcr80]
-rtOF Binfile Prints runtime library of/used in Binfile,
no changes are made.
And here is the output of running switchPY -h:
Usage: switchPY [options]
where options: "[v|V] [-h|-help] [-eg] [-convert] [-restore]"
-------------------------------------------------------------------------
Options detailed:
-------------------------------------------------------------------------
-V Prints program name and version
-v Prints program name, version, and copyright
-h Prints this screen
-help Same as -h above
-eg Shows example use of all options
-convert Converts pyMinGW Python to be the default
Python.
-restore Restores the official Python to its
default use status.
So you can now use your MinGW compiled Python as is, or you can
convert it to the standard Python mode. Using pyMinGW's
new tools you can:
If you wish to transform your MinGW compiled Python to be always running in MSVCR71 mode (either by using switchDLL, or switchPY) then you should be careful about the legal stuff related to distributing the said runtime. Realize also that you need to set the msvcr71_mode to 1 in \Lib\distutils\cygwinccompiler.py (search said file for msvcr71_mode = 0 and change it to msvcr71_mode = 1). Don't forget to change it back in case you change your mind. |