Re: [sqlite] Cross-Compile and Installation of Sqlite

2009-06-26 Thread Ben Atkinson

On Thu, June 25, 2009 at 4:46 PM, Matthew L. Creech wrote:

> cd /path/to/sqlite-3.6.15
> ./configure --prefix=/my/target/rootfs --host=arm-unknown-linux-gnueabi
> make install
> 


Thanks for the help. Matthew.  That was exactly what I needed.

With the configure --prefix option , the subsequent "make install" put the
installation bin, include, and lib directories in a directory on my Ubuntu host
where I could zip them up, and transfer them to /usr/local on my embedded
target.

Regards,

Ben


> On Thu, Jun 25, 2009 at 4:23 PM, Ben Atkinsonwrote:
> >
> > I have an embedded Linux ARM target and wish to run sqlite on it. I 
> successfully cross-compiled sqlite-3.6.15 on my Ubuntu x86 host, and now I'm 
> ready to install sqlite3, its libraries, and headers on my target system.
> >
> > I originally tried compiling sqlite on my embedded target system. Because 
> > it 
> has only a flash file system, and there is no swap area, gcc fails because it 
> runs out of memory.
> >
> > I tried zipping up the cross-compiled sqlite-3.6.15 directory from my x86 
> > host 
> into a tar.gz file, downloading it to my target, unzipping it, then running 
> "make install". Because the config files and the Makefile have all of the 
> arm-unknown-linux-gnueabi cross-compiler references to gcc, this doesn't 
> match 
> the actual configuration on my embedded target, and the make fails.
> >
> > Before I start hacking into the sqlite config and Makefiles on my embedded 
> target, has someone already been through this and perhaps has a "howto"? Is 
> there already a recipe in the Makefile for this?
> >
> 
> SQLite isn't much different than any other autotools-based package in
> this regard.  If you're wanting to do a firmware build, and include
> the SQLite pieces in their correct location in your target root
> filesystem, you can just do something like:
> 
> cd /path/to/sqlite-3.6.15
> ./configure --prefix=/my/target/rootfs --host=arm-unknown-linux-gnueabi
> make install
> 
> If all you want is to run the sqlite3 executable, though, you can just
> take the cross-compiled binary + shared-lib and throw them onto the
> target.  Note that you'll need to set LD_LIBRARY_PATH when running
> "sqlite3" to prevent it from complaining about missing libraries,
> unless /lib is writable on your target.
> 
> -- 
> Matthew L. Creech
> 
> 


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


Re: [sqlite] Cross-Compile and Installation of Sqlite

2009-06-25 Thread D. Richard Hipp

On Jun 25, 2009, at 5:07 PM, Ben Atkinson wrote:
>
> On Jun 25, 2009, at 4:27 PM, D. Richard Hipp wrote:
>
>> What are you trying to install?  The command-line shell?  A shared
>> library?  If the latter, why do you need or want a shared library on
>> your embedded system.  Are aware that the command-line shell is a
>> single stand-alone binary with no dependencies other than libc?
>
> I will be writing a C/C++ program that will use sqlite for data  
> storage,
> so I will need the headers and shared library to link sqlite into my
> program.  I also want to use the sqlite executable to examine the
> database from the command line.
>
>> Are you using the amalgamation tarball?  Or the separate source files
>> tarball?
>
> I'm using the amalgamation tarball.
>


The easiest way to incorporate SQLite into an application is simply to  
copy the sqlite3.c and sqlite3.h files into the source tree for your  
application and compile them together with all the rest of your source  
code.  You can do this either on your host (cross-compiling) or on the  
target, as you prefer.

If you use the amalgamation tarball and configure with --disable- 
shared, then compile, you will be left with an "sqlite3" executable  
which you then simply copy into /usr/bin on your target.


D. Richard Hipp
d...@hwaci.com



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


[sqlite] Cross-Compile and Installation of Sqlite

2009-06-25 Thread Ben Atkinson

> On Jun 25, 2009, at 4:23 PM, Ben Atkinson wrote:

>>
>> I have an embedded Linux ARM target and wish to run sqlite on it.  I  
>> successfully cross-compiled sqlite-3.6.15 on my Ubuntu x86 host, and  
>> now I'm ready to install sqlite3, its libraries, and headers on my  
>> target system.
>>
>> I originally tried compiling sqlite on my embedded target system.   
>> Because it has only a flash file system, and there is no swap area,  
>> gcc fails because it runs out of memory.
>>
>> I tried zipping up the cross-compiled sqlite-3.6.15 directory from  
>> my x86 host into a tar.gz file, downloading it to my target,  
>> unzipping it, then running "make install".  Because the config files  
>> and the Makefile have all of the arm-unknown-linux-gnueabi cross- 
>> compiler references to gcc, this doesn't match the actual  
>> configuration on my embedded target, and the make fails.
>>
>> Before I start hacking into the sqlite config and Makefiles on my  
>> embedded target, has someone already been through this and perhaps  
>> has a "howto"?  Is there already a recipe in the Makefile for this?
>>

On Jun 25, 2009, at 4:27 PM, D. Richard Hipp wrote:

> What are you trying to install?  The command-line shell?  A shared  
> library?  If the latter, why do you need or want a shared library on  
> your embedded system.  Are aware that the command-line shell is a  
> single stand-alone binary with no dependencies other than libc?

I will be writing a C/C++ program that will use sqlite for data storage,
so I will need the headers and shared library to link sqlite into my
program.  I also want to use the sqlite executable to examine the
database from the command line.

> Are you using the amalgamation tarball?  Or the separate source files  
> tarball?

I'm using the amalgamation tarball.

Regards,

Ben


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


Re: [sqlite] Cross-Compile and Installation of Sqlite

2009-06-25 Thread D. Richard Hipp

On Jun 25, 2009, at 4:23 PM, Ben Atkinson wrote:

>
> I have an embedded Linux ARM target and wish to run sqlite on it.  I  
> successfully cross-compiled sqlite-3.6.15 on my Ubuntu x86 host, and  
> now I'm ready to install sqlite3, its libraries, and headers on my  
> target system.
>
> I originally tried compiling sqlite on my embedded target system.   
> Because it has only a flash file system, and there is no swap area,  
> gcc fails because it runs out of memory.
>
> I tried zipping up the cross-compiled sqlite-3.6.15 directory from  
> my x86 host into a tar.gz file, downloading it to my target,  
> unzipping it, then running "make install".  Because the config files  
> and the Makefile have all of the arm-unknown-linux-gnueabi cross- 
> compiler references to gcc, this doesn't match the actual  
> configuration on my embedded target, and the make fails.
>
> Before I start hacking into the sqlite config and Makefiles on my  
> embedded target, has someone already been through this and perhaps  
> has a "howto"?  Is there already a recipe in the Makefile for this?
>


What are you trying to install?  The command-line shell?  A shared  
library?  If the latter, why do you need or want a shared library on  
your embedded system.  Are aware that the command-line shell is a  
single stand-alone binary with no dependencies other than libc?

Are you using the amalgamation tarball?  Or the separate source files  
tarball?

D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] Cross-Compile and Installation of Sqlite

2009-06-25 Thread Matthew L. Creech
On Thu, Jun 25, 2009 at 4:23 PM, Ben Atkinson wrote:
>
> I have an embedded Linux ARM target and wish to run sqlite on it.  I 
> successfully cross-compiled sqlite-3.6.15 on my Ubuntu x86 host, and now I'm 
> ready to install sqlite3, its libraries, and headers on my target system.
>
> I originally tried compiling sqlite on my embedded target system.  Because it 
> has only a flash file system, and there is no swap area, gcc fails because it 
> runs out of memory.
>
> I tried zipping up the cross-compiled sqlite-3.6.15 directory from my x86 
> host into a tar.gz file, downloading it to my target, unzipping it, then 
> running "make install".  Because the config files and the Makefile have all 
> of the arm-unknown-linux-gnueabi cross-compiler references to gcc, this 
> doesn't match the actual configuration on my embedded target, and the make 
> fails.
>
> Before I start hacking into the sqlite config and Makefiles on my embedded 
> target, has someone already been through this and perhaps has a "howto"?  Is 
> there already a recipe in the Makefile for this?
>

SQLite isn't much different than any other autotools-based package in
this regard.  If you're wanting to do a firmware build, and include
the SQLite pieces in their correct location in your target root
filesystem, you can just do something like:

cd /path/to/sqlite-3.6.15
./configure --prefix=/my/target/rootfs --host=arm-unknown-linux-gnueabi
make install

If all you want is to run the sqlite3 executable, though, you can just
take the cross-compiled binary + shared-lib and throw them onto the
target.  Note that you'll need to set LD_LIBRARY_PATH when running
"sqlite3" to prevent it from complaining about missing libraries,
unless /lib is writable on your target.

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


[sqlite] Cross-Compile and Installation of Sqlite

2009-06-25 Thread Ben Atkinson

I have an embedded Linux ARM target and wish to run sqlite on it.  I 
successfully cross-compiled sqlite-3.6.15 on my Ubuntu x86 host, and now I'm 
ready to install sqlite3, its libraries, and headers on my target system.

I originally tried compiling sqlite on my embedded target system.  Because it 
has only a flash file system, and there is no swap area, gcc fails because it 
runs out of memory.

I tried zipping up the cross-compiled sqlite-3.6.15 directory from my x86 host 
into a tar.gz file, downloading it to my target, unzipping it, then running 
"make install".  Because the config files and the Makefile have all of the 
arm-unknown-linux-gnueabi cross-compiler references to gcc, this doesn't match 
the actual configuration on my embedded target, and the make fails.

Before I start hacking into the sqlite config and Makefiles on my embedded 
target, has someone already been through this and perhaps has a "howto"?  Is 
there already a recipe in the Makefile for this?

Regards,

Ben



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