Take the 2-minute tour ×

The readline library allows the CLI for sqlite to accept arrow keys to recall previously typed commands. I can build without this and sqlite works, it's just a hassle not having this nice capability. I've installed readline-devel from yum and /usr/lib64/libreadline.so.5 is present as well as it's header files. When I run ./configure to build sqlite, I see these lines:

checking for library containing readline... no
checking for readline... no

The library path is set to the correct path:


By default, ./configure does try to include readline support so there are no special "--with-XXXX" options needed.

Anyone every seen this problem? I need to use this newer version to get latest foreign key support. It's hassle running on CentOS as is bundles pretty old versions of apps but we don't have a choice right now and I cannot find an updated RPM with newer version of sqlite.

=== UPDATE ===

Ok, I found a solution but I don't completely like it...

First, I tried with this option:

./configure CPPFLAGS="-I/usr/include/ -DHAVE_READLINE"

That causes the readline functionality to get compiled into shell.c which is what is needed for starters. But, the linking fails because it cannot find libreadline. The only 'kludgy' way I could figure out to get it to link was to manually edit the Makefile after running the above ./configure command. I changed this line:

LIBS = -ldl -lpthread

to this:

LIBS = -ldl -lpthread -lreadline -ltermcap

Then I ran "make clean all" and "make install" and the readline functionality works in the CLI.

I tried every way I could think of to pass in the extra libraries including exporting using LIBS, exporting using READLINE_LIBS, exporting using LDFLAGS, nothing would work. If you set LIBS to anything, like "export LIBS="-lreadline", it causes configure to fail. The --help on configure about using LIBS seems to contradict what happens when you actually set it to any value.

Anyway, this works so I can live with it - but I don't particularly like it! :(


Well, wouldn't you know it. Spend hours trying to figure it out, then stumble onto the right tip on Google. Just needed to install ncurses-devel first. So, to summarize all that is needed to built it 'unkludgily':

yum install ncurses ncurses-devel 
yum install readline readline-devel 
yum install libtermcap libtermcap-devel
make install

No special command line options or exports or Makefile edits needed! Readline support is automatically built in by default now.

share|improve this question
Had the same problem and somehow found workaround. Sorry, but I can't recall what exactly I (or company's admin) did. In the end we dropped CentOS in favor of Debian... –  Rekin Jan 9 '11 at 21:30
check configure.log for what it fails on. Also, where is your libreadline.so (not libreadline.so.5) –  nos Jan 9 '11 at 22:09
add comment


Your Answer



Browse other questions tagged or ask your own question.