Re: test for javac

2007-12-24 Thread Andrew John Hughes
On 20/12/2007, Robert Schuster [EMAIL PROTECTED] wrote:

 Hi,
 when configuring classpath with --with-ecj=something there is still a
 test being run to check whether 'javac' exists and whether it is Java5
 compatible.

 I think the correct behavior would be:
   a) test whether the supplied command (may ecj or whatever) is available
   b) test whether this executable can compile Java5 code

 There should be no test for other compilers if I explicitly provide one.


Good point.  It is also confusing that ecj is still used even if a 'javac'
is found and is 1.5 compatible.  We should only do the former test if the
ecj one fails (to reflect how Makefile.am works) and test 1.5 compatibility
for both.

I've filed this as PR34578:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34578

Additionally the current test for Java5 compatibility is IMHO wrong. To
 compile Java5 code one needs a suitable compiler and class library. If a
 Java5-capable compiler is running on a pre-Java5 class library (e.g. ecj
 on gcj 4.2.1) the current test fails.

 A better test would IMHO be to compile the following source:

 package java.lang;

 public class Object
 {
   static T void foo()
   {
   }
 }

 with

 javac-to-be-tested -source 1.5 -bootclasspath . -d .
 java/lang/Object.java

 and check the results.



I agree; the current one depends on java.util.List being generic where it
shouldn't, although I think a  clearer test would be a simple enumeration
which would achieve the same goal.

Filed as PR34579: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34579

File some bugs?



Yes; done :)

Regards
 Robert



Thanks for reporting this,
-- 
Andrew :-)

Help end the Java Trap!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net


test for javac

2007-12-20 Thread Robert Schuster
Hi,
when configuring classpath with --with-ecj=something there is still a
test being run to check whether 'javac' exists and whether it is Java5
compatible.

I think the correct behavior would be:
  a) test whether the supplied command (may ecj or whathever) is available
  b) test whether this executable can compile Java5 code

There should be no test for other compilers if I explicitly provide one.

Additionally the current test for Java5 compatibility is IMHO wrong. To
compile Java5 code one needs a suitable compiler and class library. If a
Java5-capable compiler is running on a pre-Java5 class library (e.g. ecj
on gcj 4.2.1) the current test fails.

A better test would IMHO be to compile the following source:

package java.lang;

public class Object
{
  static T void foo()
  {
  }
}

with

javac-to-be-tested -source 1.5 -bootclasspath . -d . java/lang/Object.java

and check the results.

File some bugs?

Regards
Robert



signature.asc
Description: OpenPGP digital signature