Contents
Contents
System Requirements
System Requirements for building on Windows
Cygwin
Cygwin: http://www.cygwin.com/
Cygwin is used to provide a unix-like environment in which to run 'configure' and 'make'.
Besides the default set of packages, make sure to install:
- make (devel)
- patchutils (utils) - to apply patches;
- rsync (net) - to reorganize the layout of the compiled python package;
- unzip (archive) - to unpack some modules;
- wget (web) - for downloading libraries used by Python
- perl (interpreters) - used to build ssl shared libs
MinGW
MinGW: http://www.mingw.org/
The MinGW compiler toolchain is used to generate win32 executables. In particular, these packages:
- gcc-core-3.4.5-20060117-1.tar.gz
- gcc-g++-3.4.5-20060117-1.tar.gz
- binutils-2.16.91-20060117-1.tar.gz
- mingw-runtime-3.13.tar.gz
- w32api-3.10.tar.gz
And for building PyLucene:
- gcc-java-3.4.5-20060117-1.tar.gz
iconv: http://prdownloads.sf.net/mingw/libiconv-1.8.0-2003.02.01-1.exe
System Requirements for building on Linux
The usual stuff; the package should behave just like the source package from python.org.
Build using the Makefiles Package
The Makefiles package provides a convenient mechanism for downloading and building some of the external libraries required by some modules included with Python. In particular, the makefiles package will download and build:
- bzip2
- gdbm
- openssl
- sqlite
- zlib
Modules that are not supported include:
- bsddb
- Tkinter
Additional modules that can be easily downloaded and compiled using the makefiles module include:
- apsw
- cherrypy
- genshi
- kid
- pil
- pycurl
- pylucene
- sqlalchemy
- wxpython
Getting the Makefiles
Go to: http://sourceforge.net/project/showfiles.php?group_id=182839 and download the latest makefiles package.
Then, unpack the makefiles:
# Create a top-level directory for our project; mkdir python-mingw cd python-mingw tar xvzf makefiles-XXX.tar.gz mv makefiles-XXX makefiles # cd into the makefiles directory where we will do the rest or our work; cd makefiles
Install the Compilers
If you do not already have the mingw compiler suite installed, you can get it via:
make mingw-download make mingw-unpack
Do the Build
Then:
make python25
Run the Tests
To verify which modules are working and installed:
make python25-test
Reorganize the Layout
The makefiles used to build Python-MinGW create a layout that is much as it would be for any other unix platform. To reorganize the layout so it more closely resembles the windows release from python.org, do the following:
make python25-win32-release
Build Additional Modules
You can download and build additional modules for installation into the python build tree. To see a list of available modules and install them, do:
make modulelist <displays a list of available modules and their versions> # Now, download and build a module make <module-name> # To build most modules; make most # To build all modules: make all # most + pil, pylucene, & wxpython;
Additional Make Targets
make help - print a help message
make download - download all packages
make modulelist - display list of modules and their versions
Build Python-mingw without using the Makefiles Package
Building from the Python-MinGW package will create a python installation with none of the modules that require external libraries. To include the zlib, bzip2, and sqlite modules, you should follow the instructions above entitled Build using the Makefiles Package.
Download Python
Download the python source code from http://www.python.org/download/ .
Download the Patches
Download the patches that match your python version from HERE .
Unpack Python and Apply the Patches
Unpack the tree using and apply the patches:
tar xvzf python-XXX.tgz (adjust this line if you downloaded the .bz2 file) cd python-XXX gunzip < ../patches-XXX.gz | patch -b -p0
Building the Source
Make sure the MinGW compilers are at the start of your path. Then:
# cd into the top-level python directory; cd python-XXX # Pick your own value for prefix; ./configure --prefix=/cygdrive/c/python-mingw --host=i686-pc-mingw32 make make install
Python-MinGW