On Mon, May 25, 2009 at 12:42 AM, Ralf Wildenhues <ralf.wildenh...@gmx.de> wrote: > Hi Jack, > > * Jack Kelly wrote on Wed, May 13, 2009 at 01:24:40PM CEST: >> I've found that if nothing else defines OBJEXT, AM_PROG_GCJ won't do >> it and then make will fail with an error like: >> >> make: *** No rule to make target `Test.', needed by `test'. Stop. > > Thank you for the bug report and example test. I agree that it is a > bug, but I think fixing it will require at least some Autoconf support. > Maybe we should start thinking of moving AM_PROG_GCJ into the Autoconf > language framework. BTW, EXEEXT needs a definition, too.
Thanks for doing that, Ralf. I've given up on playing with GCJ for the moment, but here are some other things that I've noticed: 1. AM_PROG_GCJ might want to think about using AC_CHECK_TOOLS instead of AC_CHECK_PROGS - to catch a cross-compiled gcj that's building binaries for a different host. 2. The suffix mechanism might not be quite enough for Java projects with native methods using the C++ interface. For these, it appears that gcj wants something like this (my best guess here, docs are quite sketchy): Suppose Foo.cc contains the implementation of the native methods declared in Foo.java. Then to compile, the following is needed: # Make Foo.class gcj -C Foo.java # Make Foo.h, which is #include'd by Foo.cc gcjh Foo.class g++ -c -o Foo.o Foo.cc gcj -o Foo.class.o Foo.class # Or instead of the above: gcj -c -o Foo.class.o Foo.java Then link to taste, using gcj to call the linker. -- Jack