sqlite/sqlite wrapper compiled natively
Erik Poupaert
erik.poupaert@skynet.be
Sun Apr 18 14:00:00 GMT 2004
Hi guys
sqlite/sqlite wrapper compiled natively
Only two problems encountered:
//X String pattern = "";
...
//X String[] args = pattern.split(":");
The method String[] String.split(String) is apparently not defined in libgcj? Maybe
it's not supposed to ... Dunno.
//X value = (value == null) ? null : value.replaceAll("\\s+", " ");
The method String String.replaceAll(String,String) is apparently not defined either
in libgcj? Again. I leave it up to you.
The java bindings are based on the swigging of a judiciously simplified API,
sqlitewrapper.c, written by Antoun Kanawati (http://tk-software.home.comcast.net/).
He also did the swigging. It's a very clean and useful setup. I've learned a lot from
his work.
So, after transformation, we get the following source trees:
(1) sqlite-2-8-13
The preprocessed (lemon lexer/parser already generated) but otherwise vanilla
C sourcetree distributed at http://www.hwaci.com/sw/sqlite/. I've excluded the
shell.c program and placed it in another tree.
(2) swig-sqlite-2-8-13
The java classes generated by SWIG exposing sqlitewrapper.c
(3) swig-sqlite-jni-2-8-13
The native jni sources generated by SWIG, tying the java sources to the C source
tree.
(4) sqlite-shell-2-8-13
The native shell utility program.
(5) sqlite-test-2-8-13
Antoun's fortune.db test of the whole setup.
The building instructions are quite simple:
-------------------------------------------------------------
buildmodel sqlite-2-8-13;
-------------------------------------------------------------
buildmodel sqlite-shell-2-8-13;
archive dependencies
{
sqlite-2-8-13;
}
-------------------------------------------------------------
buildmodel sqlite-test-2-8-13;
entry points
{
testit sqlite.test.testit;
}
archive dependencies
{
swig-sqlite-2-8-13;
}
-------------------------------------------------------------
buildmodel swig-sqlite-2-8-13;
compilation options
{
-fjni
}
archive dependencies
{
native whole swig-sqlite-jni-2-8-13;
}
-------------------------------------------------------------
buildmodel swig-sqlite-jni-2-8-13;
compilation options
{
-fpic
-fPIC
-export-dynamic
}
link options
{
-export-dynamic
}
archive dependencies
{
native whole sqlite-2-8-13;
}
-------------------------------------------------------------
If anybody is interested in the resulting bash scripts that schedule the build, feel
free to send me an email.
I'm currently looking into a few other interesting native source trees, to swig,
re-expose in java, and build the whole lot natively with GCJ. Once you get the hang
of it, it's actually quite easy. It's even fun!!
Greetings
Erik
More information about the Java
mailing list