This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
sqlite/sqlite wrapper compiled natively
- From: Erik Poupaert <erik dot poupaert at skynet dot be>
- To: java at gcc dot gnu dot org, Antoun Kanawati <tk-software at comcast dot net>
- Date: Sun, 18 Apr 2004 15:55:15 +0000
- Subject: sqlite/sqlite wrapper compiled natively
- Organization: Erik Poupaert
- References: <20040412175207.74821235.erik.poupaert@hurricanedev.com><407AC12F.5060904@comcast.net><20040412182139.19dcc1f0.erik.poupaert@hurricanedev.com><20040412195618.0dbd9838.erik.poupaert@hurricanedev.com><407C647F.2070802@comcast.net><20040414134046.43b53edd.erik.poupaert@hurricanedev.com><407D67BD.1090909@comcast.net><20040414185251.4cd33f5f.erik.poupaert@hurricanedev.com><407D736C.8070603@comcast.net><20040418052101.334fa225.erik.poupaert@hurricanedev.com><4081FFC1.7080902@comcast.net><20040418060855.6d253e5a.erik.poupaert@hurricanedev.com><40820A69.3040408@comcast.net><20040418071609.40c8c798.erik.poupaert@hurricanedev.com><40821375.6040900@comcast.net><20040418132533.79fa8787.erik.poupaert@hurricanedev.com><4082683C.2010808@comcast.net>
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