LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   How to Cross Compile SQLite3 inside the SBC TS-5500 (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/how-to-cross-compile-sqlite3-inside-the-sbc-ts-5500-a-4175458668/)

Newbie89 04-18-2013 01:50 PM

How to Cross Compile SQLite3 inside the SBC TS-5500
 
Any idea to make it?:)
Is it new to use sqlite3 inside the SBC?
Because my project is to use sqlite3 inside my SBC...

Can show me the step to make it?And I also need to know how to install the sqliteman into the sbc...because I need to link between sqlite and c language...:)

michaelk 04-19-2013 08:20 AM

Welcome to LinuxQuestions.

How is your SBC configured including any peripherals. Do you have the development kit?

sqliteman is a QT based GUI tool so your not going to be able to install it on the your TS-5500. The SQLite website has information on the C API. It might be possible to run sqlite on the SBC.

http://www.sqlite.org/index.html

knudfl 04-19-2013 10:44 AM

And : No cross compiling. The processor is plain "x86".

You may even be able to use an sqlite binary package for the OS on your TS-5500.
>> No compilation at all.

Newbie89 04-19-2013 10:58 AM

Thanks for reply:)

I found the step of cross compile

Steps are as follows:

1. Download "sqlite-amalgamation-3071300.z​ip" from http://www.sqlite.org/​download.html

2. Extract and execute the following command on cross-compile environment:

gcc -DSQLITE_THREADSAFE=0 shell.c sqlite3.c -ldl

Where, the -ldl library is needed to support dynamic loading, the sqlite3_load_extension() interface and the load_extension() SQL function.

3. Transfer file "a.out" to the embedded computer (TS5500) and execute there "./a.out".

the method correct?

Newbie89 04-20-2013 04:11 AM

Quote:

Originally Posted by michaelk (Post 4934728)
Welcome to LinuxQuestions.

How is your SBC configured including any peripherals. Do you have the development kit?

sqliteman is a QT based GUI tool so your not going to be able to install it on the your TS-5500. The SQLite website has information on the C API. It might be possible to run sqlite on the SBC.

http://www.sqlite.org/index.html

SBC configured not include any peripherals...nope...

oic...thanks for your information...

---------- Post added 04-20-13 at 04:12 AM ----------

Quote:

Originally Posted by knudfl (Post 4934806)
And : No cross compiling. The processor is plain "x86".

You may even be able to use an sqlite binary package for the OS on your TS-5500.
>> No compilation at all.

I'm not quite understand...can you explain a bit?:)

michaelk 04-20-2013 04:27 AM

In a nutshell cross compiling means your compiling an application on a system i.e. processor, OS etc that is different then the actual system that will be running it. Since the SBC is an x86 just like a desktop computer cross compiling is not required.

It isn't obvious what arch i.e. 386,486,586 etc the x86 precompiled binaries are using so they may or may not work.

theNbomr 04-21-2013 01:00 PM

There is such a thing as cross-native compilation. The CPU is not the only aspect of a compiler/toolchain. There are many factors that dictate whether a toolchain's resutlant object code will run on a particular target: OS/kernel, libc, floating point implementation in some cases, threading model, and others. If the build host is not the same as the target host, then there is some real possibility that the code will fail on the target.
If the OP's target host includes a native toolchain, then it is probably simple to build the package there. Sqlite seems to be distributed in a tarball that includes the usual 'configure; make; make install' support. This should be simple enough to perform in the native target environment if there is a toolchain present there. I just built it that way on the Debian desktop host I'm using to write this, and it took all of 1 minute.
As someone has already pointed out, the very simplest method may be to download a package already built for the target architecture.
--- rod.


All times are GMT -5. The time now is 12:08 AM.