On 4/18/2009 3:08 PM, LCID Fire wrote:
I'm currently stuck with compiling a JNI library, which java does not recognize. I'm not too sure about what options I have to provide to automake and which are already builtin. Does anybody know an example of how a jni lib is built using automake?
There are basically two steps to building JNI libraries:

1. Use the javah utility to generate JNI prototypes in C-language header files from your Java source code. 2. Compile the C-language JNI sources (including the headers generated in step 1) into a library.

Step 1 above is pure Java-speak, and Automake has little built-in functionality for it. Step 2, however is pure gcc, and Automake has no trouble with it. For an example of how to integrate javah operations into Makefile.am so you can do it all from Automake, see Chapter 6 of this online book at freesoftwaremagazine.com:

  http://www.freesoftwaremagazine.com/books/agaal/autotools_example

Search for the text, "Building the JNI C++ sources".

Regards,
John


Reply via email to