I have developed a large Java class library 
(http://sourceforge.net/projects/amberarcher) that includes a JNI 
component I'd like to expand in the next version. Since I have a chance 
to Do Things the Right Way from the start as much as possible, I wanted 
to set it up to use autoconf, automake and libtool and, if at all 
possible, support builds on MacOS X and mingw32 as well as the usual 
UNIX suspects. Since the library is mostly Java, portability of the C 
components is obviously of pantamount importantance.

What I lack are good examples, and good documentation on making these 
combinations. I saw in May there was a debate on this list about the 
best way to combine MacOS X "bundle"-based JNI libraries with standard 
autoconf, but no real solution seemed to come of that. I read the Goat 
Book, but it doesn't cover JNI, and doesn't cover MacOS X at all (for 
obvious reasons).

Some example issues I've hit:

* the Goat Book's section on mingw32--which I found very helpful, 
BTW--provides no information on combining Win32 libraries (like the RPC 
runtime in mingw32) with dynamic libraries built on mingw32--for some 
reason they're always static because I have -mno-undefined-symbols, and 
it thinks the mingw32 librpcrt4.a stub is a static library rather than a 
DLL stub. LibSDL does this somehow, but the configure script is so huge 
that I haven't been able to figure out how yet. So I can build a JNI DLL 
using mingw32...but not one that makes any Win32 calls!
* On the MacOS X side, I'm not sure how to deal with the fact that the 
"bundle" system seems to want to compile and link all in one fell swoop 
for JNI libraries, and how to get that to fit into a standard configure 
script
* To make matters more complicated, the existing Java code is all built 
with ant. So I'm not sure how to set up an autoconf target that runs

$srcdir/tools/ant/bin/ant

that gets executed as part of the "all" target. If I set up

SUBDIRS=src

and in that a Makefile.am with

SUBDIRS=share native

how do I write the Makefile.am in "share" so it kicks off the ant script 
as part of its "all" target to ensure this gets run before we get to the 
native Makefile, which builds the JNI code?
* what's the recommended way to selectively include some objects in a 
DLL/shared object and not others? Some native functions--like the code 
behind the "Symlink" object never make sense on Win32, for instance, 
while others--like the code behind the "UUID" object have Win32 and UNIX 
equivalents.

This is important enough to me that I'm willing to write fairly 
extensively on the topic & contribute it back under FDL if I can figure 
out a way to do this, but I need some serious autoconf toolset help to 
get there. Anyone willing & able? Thank you very, very much in advance.

--kd


Reply via email to