This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: compiling an app that depends on a
- To: java at gcc dot gnu dot org
- Subject: Re: compiling an app that depends on a
- From: David Brownell <david-b at pacbell dot net>
- Date: Wed, 03 Oct 2001 18:57:45 -0700
- References: <1001612156.5616.ezmlm@gcc.gnu.org>
> I am a gcj newbie. I just installed gcc 3.0.1 and tested it with a simple
> HelloWorld program. Now, I have a slightly more useful application that I
> would like to compile. This application depends on a java usb library that
> consists of a jar file ( jusb.jar ). Also, some the classes in the jar file
> include native methods. These methods are implemented in a shared library
> called libjusb.so.
Except that when you compile it to "libjusb.a" it uses GCJ to
build everything ... including using CNI instead of JNI.
> My question is simply,
> how do I do this. What steps do I take in order to compile the jar file code
> and my application code and get it all working with the shared library and
> everything. I don't have much experience with compiling and linking c code, so
> I suspect that is where my confusion lies. Explicit instructions would be
> greatly appreciated. Thanks very much. Oh yea, I should mention that I do
> have access to all the source code for the jusb library.
Use the Makefile that comes with that source code. One of the samples
shows how to (statically) link to generate a GCJ binary that dumps the
contents of the USB bus as XML text ... your application will work just
a bit differently, since your "main" will be some different program.
So just copy and modify.
- Dave