Hi,
> I am trying to compile sqlite in a /custom/directory and keep the ability
> to use arrows to get previously entered commands in the sqlite3
> executable. I read the wiki about that topic
> http://www.sqlite.org/cvstrac/wiki?p=ReadLine
> but I am still failing. It is advised to find the variable READLINE_FLAGS
> and LIBREADLINE in the Makefile, but I can only find:
> READLINE_LIBS
> I am not sure what I should enter there as a value and whether that would
> be enough to solve my problem
Note that the above page refers to the case where readline is installed in an
unusual location, not SQLite itself. This page is outdated anyway, as it
refers to SQLite 2.7.x and a bug that seems to have been fixed in more recent
releases. Setting CPPFLAGS and LDFLAGS does work. See below.
If readline is already installed in a default location where it can be found
by the compiler and linker, you don't have to mess with the Makefile. On my
Linux workstation for example:
$ cd /tmp
$ wget -q http://www.sqlite.org/sqlite-amalgamation-3.5.6.tar.gz
$ tar xzf sqlite-amalgamation-3.5.6.tar.gz
$ cd sqlite-3.5.6
$ configure --prefix=/tmp/install
[...]
checking for library containing readline... -lreadline
checking for readline... yes
[...]
config.status: creating Makefile
config.status: executing depfiles commands
$ make
[...]
$ make install
[...]
$
Now if readline is not installed on your Unix system and you have installed it
in an unusual location, it's a different issue. I have simulated it by
removing the readline development package on my Linux workstation:
# rpm -e readline-devel
#
and then installing readline in /tmp/install:
$ cd /tmp
$ wget -q ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz
$ tar xzf readline-5.2.tar.gz
$ cd readline-5.2
$ ./configure --prefix=/tmp/install
[...]
$ make
[...]
$ make install
[...]
$ export LD_LIBRARY_PATH=/tmp/install/lib:
$
I was then able to build SQlite using the readline library in /tmp/install:
$ cd /tmp
$ wget -q http://www.sqlite.org/sqlite-amalgamation-3.5.6.tar.gz
$ tar xzf sqlite-amalgamation-3.5.6.tar.gz
$ cd sqlite-3.5.6
$
$ ./configure --prefix=/tmp/install
[...]
checking for library containing readline... no
checking for readline... no
[...]
$
$ export CPPFLAGS=-I/tmp/install/include
$ export LDFLAGS=-L/tmp/install/lib
$ ./configure --prefix=/tmp/install
[...]
checking for library containing readline... -lreadline
checking for readline... yes
[...]
$ make
[...]
$ make install
[...]
$
$ ldd /tmp/install/bin/sqlite3
[...]
libsqlite3.so.0 => /tmp/install/lib/libsqlite3.so.0 [...]
libreadline.so.5 => /tmp/install/lib/libreadline.so.5 [...]
[...]
$
Regards,
--
Dimitri
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users