Note that there are some explanatory texts on larger screens.

plurals
  1. POTrouble building sqlite 3.7.4 on CentOS 5.5 to include readline support
    text
    copied!<p>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:</p> <pre><code>checking for library containing readline... no checking for readline... no </code></pre> <p>The library path is set to the correct path:</p> <pre><code>LD_LIBRARY_PATH="/usr/lib64:/usr/local/lib:/lib:/usr/lib" </code></pre> <p>By default, ./configure does try to include readline support so there are no special "--with-XXXX" options needed.</p> <p>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.</p> <p>=== UPDATE ===</p> <p>Ok, I found a solution but I don't completely like it...</p> <p>First, I tried with this option:</p> <p>./configure CPPFLAGS="-I/usr/include/ -DHAVE_READLINE"</p> <p>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:</p> <pre><code>LIBS = -ldl -lpthread </code></pre> <p>to this:</p> <pre><code>LIBS = -ldl -lpthread -lreadline -ltermcap </code></pre> <p>Then I ran "make clean all" and "make install" and the readline functionality works in the CLI.</p> <p>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.</p> <p>Anyway, this works so I can live with it - but I don't particularly like it! :(</p> <p>==== THE RIGHT SOLUTION ====</p> <p>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':</p> <pre><code>yum install ncurses ncurses-devel yum install readline readline-devel yum install libtermcap libtermcap-devel ./configure make make install </code></pre> <p>No special command line options or exports or Makefile edits needed! Readline support is automatically built in by default now.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload