Cross Compiling SQLite 3 Library in Fedora Core 3 to be used for compiling appications that would support SQLite for your ARM system.
Download sqlite version 3.3.4 from sqlite.org. Untar the file and go to the directory.
# tar xvzf sqlite-3.3.4.so.gz
# cd sqlite-3.3.4
Edit the Makefile to set your cross compiler tool app and do the following changes:
BCC = arm-linux-gcc -g -O2
USLEEP = -DHAVE_USLEEP=1
THREADSAFE = -DTHREADSAFE=1
THREADLIB = -lpthread
OPTS = -DNDEBUG=1
OPTS += -DHAVE_FDATASYNC=1
OPTS += -DNO_TCL
TCC = arm-linux-gcc -O6
AR = arm-linux-ar cr
RANLIB = arm-linux-ranlib
READLINE_FLAGS =
LIBREADLINE = -static
Now that you have setup the Makefile the next thing we should do is try to run the make command.
# make
You would be encountering an ERROR since in the makefile there are some commands that needs to be executed to generate some more files. Upon encountering the error, search for the line ./lemon $(OPTS) parse.y and put a comment '#' before that line. Now, you have to do that command on the platform in which you would be porting SQLite. After exectuting the command on the target platform, copy the files generated into the sqlite installation directory.
Run make again. This time you would encounter another ERROR. Comment out the line ./mkkeywordhash >keywordhash.h and again, execute the app on your target platform and copy keywordhash.h file. Run make again.
It would finish the compilation and you now have a crossed compiled sqlite 3 library for arm linux.
Copy the library file generated to your library directory.
# cp libsqlite3.a /usr/local/arm-linux/lib/
Vist http://www.sqlite.org for more information on Sqlite.
Subscribe to:
Post Comments (Atom)
1 comment:
What a great site print digital picture
Post a Comment