Re: problem compiling python's readline on linux

Guido.van.Rossum@cwi.nl
Wed, 21 Sep 1994 21:01:17 +0200

> I would like to compile python on a linux box with readline (to use tkinter)
> or as an alternative with stdwin. Python itself builds without change. I
> also build python + readline + stdwin successfully on a sun4 under SunOs
> 4.3.1. Unfortunateley things are not so straightforward under linux, and I
> do not know much about unix, gcc, make ...

You really don't need readline to run tkinter, unless you insist on
running in interactively.

Regarding readline: I suggest you use readline 2.0. From the Python
1.1 README:

- You can use the GNU readline library to improve the interactive user
interface: this gives you line editing and command history when
calling python interactively. You need to configure build the GNU
readline library before running the configure script. Its sources are
no longer distributed with Python; you can ftp them from any GNU
mirror site, or from its home site:
ftp://slc2.ins.cwru.edu/pub/dist/readline-2.0.tar.gz (or a higher
version number -- using version 1.x is not recommended). Pass the
Python configure script the option --with-readline=DIRECTORY where
DIRECTORY is the absolute pathname of the directory where you've built
the readline library. Some hints on building and using the readline
library:

- On SGI IRIX 5, you may have to add the following
to rldefs.h:

#ifndef sigmask
#define sigmask(sig) (1L << ((sig)-1))
#endif

- On most systems, you will have to add #include "rldefs.h" to the
top of several source files, and if you use the VPATH feature, you
will have to add dependencies of the form foo.o: foo.c to the
Makefile for several values of foo.

- The readline library requires use of the termcap library. A
known problem with this is that it contains entry points which
cause conflicts with the STDWIN and SGI GL libraries. The stdwin
conflict can be solved (and will be, in the next release of
stdwin) by adding a line saying '#define werase w_erase' to the
stdwin.h file (in the stdwin distribution, subdirectory H). The
GL conflict has been solved in the Python configure script by a
hack that forces use of the static version of the termcap library.

- Check the newsgroup gnu.bash.bugs for specific problems with the
readline library (I don't get this group here but I've been told
that it is the place for readline bugs.)

--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>