Bug 4087 - New gcj doesn't provide jv-scan
Summary: New gcj doesn't provide jv-scan
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks: 1600
  Show dependency treegraph
 
Reported: 2007-02-21 16:56 UTC by Mark Wielaard
Modified: 2007-02-21 19:45 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2007-02-21 16:56:34 UTC
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.
Comment 1 Andrew Cagney 2007-02-21 16:58:57 UTC
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.
Comment 2 Andrew Cagney 2007-02-21 17:01:46 UTC
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.
Comment 3 Andrew Cagney 2007-02-21 17:10:16 UTC
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.
Comment 4 Andrew Cagney 2007-02-21 17:49:01 UTC
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.
Comment 5 Andrew Cagney 2007-02-21 18:40:59 UTC
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.
Comment 6 Andrew Cagney 2007-02-21 19:01:13 UTC
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.
Comment 7 Mark Wielaard 2007-02-21 19:45:23 UTC
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.