Personal tools
You are here: Home Solaris Articles Building Python with readline on Solaris 10
Document Actions

Building Python with readline on Solaris 10

by Chris Miles last modified 2007-04-19 23:00

This is the best method I've come up with to build Python (2.4.4) - with readline support - on a freshly installed Solaris 10 box.

Install the readline package from the Sun Freeware collection, SFWrline. You will find this on the Solaris Companion Disc or download it from http://www.sun.com/software/solaris/freeware/s10pkgs_download.xml

Configure Python as you normally would, but enable shared library support (--enable-shared). I like to install into /opt/ to keep things tidy, so I use:

$ ./configure --prefix=/opt/python-2.4.4 --enable-shared

After configure you need to enable the readline module and specify the parameters necessary to compile it in. Add the following line to Modules/Setup.local:

readline readline.c -I/opt/sfw/include -L/opt/sfw/lib -R/opt/sfw/lib -lreadline -ltermcap

Then build as normal using make:

$ make

Now, it will compile for a while, but I normally get this error:

Undefined                       first referenced
symbol                             in file
initreadline                        ./libpython2.4.so
ld: fatal: Symbol referencing errors. No output written to python
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `python'

However, simply running another make kicks it into gear and completes the build:

$ make

If that completes fine, then you can make install as usual (probably as root):

# make install

And you are done.

 

Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: