Readline, Python, Mac OS X and the GPL

The Python distribution that comes with Mac OS X does not include the Readline support, largely because of the contagious nature of the Gnu Public License (GPL) and the fact that Apple link the Python that is shipped against their own libraries. In a fit of "You can only play with us if you play by our rules", the authors of Readline chose to release it under the full GPL rather than the Lesser GPL for the explicit reason of interfering with the choice of licenses available to people who choose to use the Readline library. While it is of course the prerogative of the authors to choose the license under which they release their code I personally think that the choice to release something which is clearly a separable library under the full GPL, specifically so that people who wish to use it are limited in their choice of license, is obnoxiously coercive. Anyway, enough of the rant. The the software is under the GPL and as such you have a right to access the source to anything against which is gets linked if the combination is distributed, so here are details of where to get the bits in this package and how to put them together.

You can download the full source of the Readline library from its homepage and compile it on Pather by first editing the file support/shobj-conf so that, in the section marked

# Darwin/MacOS X
darwin*|macosx*)
Locate the last significant line of the section, which reads:
    SHLIB_LIBS='-lSystem'
is changed to read:
    SHLIB_LIBS='-lSystem -lcurses -lgcc'
Then re-run the ./configure, make and install. Once this is done you can download the Python 2.3.3 source from the Python.org web site, configure with ./configure --enable-framwork and compile as normal. Once you have done this you can copy the readline.so file that results into the appropriate place in the Python framework that is pre-installed on your system.

Alternatively, if you just want to use the stuff you can download my prebuilt package.

©Nicko van Someren, 2004