test defs: fix 'javac' requirement for older JDK versions
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 10 Apr 2011 11:38:47 +0000 (13:38 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 10 Apr 2011 12:10:03 +0000 (14:10 +0200)
The Java compiler from JDK 1.5 (and presumably earlier versions)
cannot handle the `-version' option by itself; and while it does
print the version number, it then errors out with an usage error:
  $ javac -version
  javac 1.5.0_22
  javac: no source files
  Usage: javac <options> <source files>
  ...
Luckily, adding the `-help' option to the `javac' invocation
seems to fix this problem.

* tests/defs.in (javac): Pass also the `-help' option to the
`javac' program.  Add a comment explaining why it is needed.

Report from Ralf Wildenhues.

ChangeLog
tests/defs.in

index a605aa8..ea29222 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 2011-04-10  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       test defs: fix 'javac' requirement for older JDK versions
+       The Java compiler from JDK 1.5 (and presumably earlier versions)
+       cannot handle the `-version' option by itself; and while it does
+       print the version number, it then errors out with an usage error:
+         $ javac -version
+         javac 1.5.0_22
+         javac: no source files
+         Usage: javac <options> <source files>
+         ...
+       Luckily, adding the `-help' option to the `javac' invocation
+       seems to fix this problem.
+       * tests/defs.in (javac): Pass also the `-help' option to the
+       `javac' program.  Add a comment explaining why it is needed.
+       Report from Ralf Wildenhues.
+
+2011-04-10  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
        test defs: new requirement for the default java compiler
        * tests/defs.in (for tool in $required): New requirement 'javac'.
        * tests/java.test: Use it instead of ad-hoc configure check.
index cd2284c..8aaf108 100644 (file)
@@ -166,8 +166,12 @@ do
       ( $CC -V -help ) || exit 77
       ;;
     javac)
-      echo "$me: running javac -version"
-      javac -version || exit 77
+      # The Java compiler from JDK 1.5 (and presumably earlier versions)
+      # cannot handle the `-version' option by itself: it bails out
+      # telling that source files are missing.  Adding also the `-help'
+      # option seems to solve the problem.
+      echo "$me: running javac -version -help"
+      javac -version -help || exit 77
       ;;
     makedepend)
       echo "$me: running makedepend -f-"