Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-23 Thread Prashant Shah
Hi,

On Thu, May 23, 2013 at 3:23 PM, Stephan Beal  wrote:
> gcc -fPIC -o libsqlite4.so -shared $(ar t libsqlite4.a)

Works :)

Thanks.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-23 Thread Stephan Beal
On Thu, May 23, 2013 at 11:45 AM, Prashant Shah wrote:

> Works !
>

:). That fix is in the trunk now.


> How do I build the libsqlite4.so shared object file ? There is no
> .libs folder in sqlite4
>

There currently aren't build rules for the .so, but here's a quick-hack way
to do it:

gcc -fPIC -o libsqlite4.so -shared $(ar t libsqlite4.a)

you might not need the -fPIC part - on my system it makes no difference.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-23 Thread Prashant Shah
Hi,

On Thu, May 23, 2013 at 3:02 PM, Stephan Beal  wrote:
> Please try:
>
> - Edit Makefile.linux-gcc and make this change:
> -TLIBS =
> +TLIBS ?=
>
> - Run: make TLIBS=-lm

Works !

How do I build the libsqlite4.so shared object file ? There is no
.libs folder in sqlite4

Thanks.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-23 Thread Stephan Beal
On Thu, May 23, 2013 at 11:23 AM, Stephan Beal wrote:

> The problem is that fts5func.c uses log() from math.h, which requires
> linking against -lm. A quick workaround is to copy/paste the output from
> where the build fails and add -lm to it:
>

Please try:

- Edit Makefile.linux-gcc and make this change:
-TLIBS =
+TLIBS ?=

- Run: make TLIBS=-lm

That _assumes_ you have symlinked Makefile.linux-gcc to "GNUmakefile". If
not, add "-f Makefile.linux-gcc" to the make arguments.

That works for me.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-23 Thread Stephan Beal
On Thu, May 23, 2013 at 7:33 AM, Prashant Shah wrote:

> libsqlite4.a(fts5func.o): In function `fts5Rank':
> /home/user/db/build/sqlite4/src/fts5func.c:159: undefined reference to
> `log'
> collect2: ld returned 1 exit status
> make: *** [sqlite4] Error 1
>

The problem is that fts5func.c uses log() from math.h, which requires
linking against -lm. A quick workaround is to copy/paste the output from
where the build fails and add -lm to it:

stephan@tiny:~/cvs/fossil/sqlite4$ gcc -g -fPIC -UNDEBUG -DDEBUG -Wall
-std=c89  -I. -I./src -I.  -I./ext/rtree -I./ext/icu -I./ext/fts3
-I./ext/async  -o sqlite4 ./src/shell.c libsqlite4.a -lm
./src/shell.c: In function 'do_meta_command':
./src/shell.c:1888:7: warning: implicit declaration of function 'pclose'
[-Wimplicit-function-declaration]
./src/shell.c:1894:7: warning: implicit declaration of function 'popen'
[-Wimplicit-function-declaration]
./src/shell.c:1894:14: warning: assignment makes pointer from integer
without a cast [enabled by default]
stephan@tiny:~/cvs/fossil/sqlite4$ ldd sqlite4
linux-gate.so.1 =>  (0xb77bd000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb7775000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb75cb000)
/lib/ld-linux.so.2 (0xb77be000)

i'll try to figure out where that fix belongs. fts5func.c says, though:

#include  /* temporary: For log() */

so i suspect that -lm is not intended to be needed long-term.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-22 Thread Prashant Shah
On Wed, May 22, 2013 at 7:53 PM, Stephan Beal  wrote:
> make -f GNUmakefile.linux

libsqlite4.a(fts5func.o): In function `fts5Rank':
/home/user/db/build/sqlite4/src/fts5func.c:159: undefined reference to `log'
collect2: ld returned 1 exit status
make: *** [sqlite4] Error 1
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-22 Thread Stephan Beal
On Wed, May 22, 2013 at 4:13 PM, Prashant Shah wrote:

> How can I compile sqlite4 ? Is there a amalgamation file available ?
>

Try:

make -f GNUmakefile.linux
or:
ln -s GNUmakefile.linux GNUmakefile
make

That "should" do it for you.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] compiling sqlite4 on ubuntu 12.04 64 bit

2013-05-22 Thread Prashant Shah
Hi,

Also, how do I build a .so file ?

Regards.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users