Compiling libreadline

Bob McCracken (
Thu, 4 Apr 1996 23:45:21 -0500

On Thu, 4 Apr 1996, Linus Torvalds wrote:

>On Wed, 3 Apr 1996, Michael Meissner wrote:
>> I rev'ed up to Linux 1.3.79 and then 1.3.81, and found that readline
>> won't build. I then rev'ed up to the latest beta libc (5.3.8) and
>> termcap (2.0.6), and the error was still there. The reason is it
>> includes termcap.h, which has the following lines:
>> #include <features.h>
>> #include <sys/types.h>
>> extern char PC;
>> extern char *UP;
>> extern char *BC;
>> #ifdef __linux__
>> extern speed_t ospeed;
>> #else
>> extern short ospeed;
>> #endif
>Mmm.. I _think_ that it should include <termios.h>, according to POSIX.
>That's where speed_t should be (but I don't have the POSIX stuff here:
>it's at the university). So the correct fix would be to just include that
>in termcap.h, and then it should work with all kernels.
>The #ifdef __linux__ looks a bit suspicious too. speed_t isn't any linux
>specific thing, it's quite standard.
> Linus

Actually, "speed_t" is defined in asm/termbits.h. To get readline compiled,
#include it before termcap.h in readline's "rldefs.h", like so:

#if defined (__linux__) || defined (HAVE_TERMCAP_H)
+ # include <asm/termbits.h>
# include <termcap.h>
#endif /* __linux__ || HAVE_TERMCAP_H */

- Bob McCracken