The latest gcj does away with its own .java source parser and doesn't provide jv-scan or something equivalent anymore. jv-scan is used to select .java source classes that have a public static void main() method in common/Makefile.gen.sh has_main(). And to generate the classes list in the CNi header .java.h target in common/Makefile.rules.
The search for "main" was originally a grep. It was changed to jv-scan to make it more robust (kept finding main in comments and the like). It can always be reverted back to grep.
the .java.o rule is an optional check that there is no duplicate class (which gcj has in the past botched). It can be wrapped in a HAVE_JV_SCAN conditional.
The .java.h rule is generating the .h file for all sub-classes of the .java file. The sequence: - get list of classes from .java using jv-scan - compile to .class .java using gcj - generate .h file for each class using gcjh can probably fudge this using a find looking for the classes; or somehow directly get all .h files generated.
This fixes the .java.o problem: Index: frysk-core/common/ChangeLog 2007-02-21 Andrew Cagney <cagney@redhat.com> * frysk-common.ac (JV_SCAN): Default to "no". (HAVE_JV_SCAN): Set using AM_CONDITIONAL. * Makefile.rules (.java.o): Wrap use of JV_SCAN in HAVE_JV_SCAN.
This removes the use in the Makefile.rules' JUnitTests.java rule: Index: common/ChangeLog 2007-02-21 Andrew Cagney <cagney@redhat.com> * Makefile.rules ($(GEN_SOURCENAME)/JUnitTests.java): Simplify, remove check for a main program in the test file.
This eliminates jv-scan from Makefile.gen.sh. Index: common/ChangeLog 2007-02-21 Andrew Cagney <cagney@redhat.com> * Makefile.gen.sh (has_java_main): New function. (has_main): Use.
And this should eliminate the last usage: 2007-02-21 Mark Wielaard <mark@klomp.org> * frysk-common.ac (AC_CHECK_PROGS): Try gjavah also. * Makefile.rules (.java.h): Don't use jv-scan, compile and use generated classes found by find and sed.