bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: javacomp.m4 usage [Fwd: Re: Java-related Bison tests all fail]


From: Bruno Haible
Subject: Re: javacomp.m4 usage [Fwd: Re: Java-related Bison tests all fail]
Date: Sat, 10 Feb 2007 22:02:15 +0100
User-agent: KMail/1.5.4

Paolo Bonzini wrote:
> We got this report that gt_JAVACOMP([1.3]) does not work for Bison.  Can 
> anybody help?

Thanks for writing to bug-gnulib, because some maintainers of gnulib macros
don't regularly read bug-bison :-)

But your question is confusing, because bison's configure.ac contains

   gt_JAVACOMP([1.3], [1.3])

which doesn't recognize gcj < 4.3 as a suitable Java compiler, whereas if
you would use

   gt_JAVACOMP([1.3])

it would do!

More explanations:

From http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00012.html :
>   % gcj --version
>   gcj (GCC) 4.1.0
> ...
>   configure:18480: checking for Java compiler
>   configure:18694: found /usr/local/bin/gcj
>   configure:18781: gcj -C -d . conftestlib.java
>   configure:18967: result: no

In gt_JAVACOMP([1.3], [1.3]), you have specified that you want a Java compiler
that
  - accepts Java 1.3 source, and
  - produces Java 1.3 class files.

gcj 4.[012] does accept Java 1.3 source (even 1.4 syntax), but does not
produce Java 1.3 class files. It produces class files which use Java 1.4
bytecodes and which make Sun Java 1.3.1 crash. Therefore javacomp.m4 rejects
gcj in this situation.

When you use gt_JAVACOMP([1.3]), on the other hand, you are specifying that
you want a Java compiler that
  - accepts Java 1.3 source, and
  - produces Java class files suitable for the found interpreter (here gij),
and here the test succeeds:

  checking for Java virtual machine... gij
  checking for Java compiler... gcj -C -fno-assert

(The -fno-assert is so that the source code may use 'assert' as a method name,
which is allowed in Java 1.3 but not in Java 1.4.)

Since bison doesn't install .class or .jar files, and uses the Java compiler
only for its tests, you shouldn't need to care about the class file version
that the compiler produces, so the solution for you is to use


2007-02-10  Bruno Haible  <address@hidden>

        Enable the Java related testsuite tests when the only Java compiler
        found is a gcj < 4.3.
        * configure.ac (gt_JAVACOMP): Don't specify a target_version.

--- configure.ac        29 Jan 2007 10:54:42 -0000      1.79
+++ configure.ac        10 Feb 2007 20:53:22 -0000
@@ -136,7 +136,7 @@
 O0CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[[0-9]] *//'`
 AC_SUBST([O0CXXFLAGS])
 
-gt_JAVACOMP([1.3], [1.3])
+gt_JAVACOMP([1.3])
 gt_JAVAEXEC
 
 AC_CONFIG_FILES([Makefile





reply via email to

[Prev in Thread] Current Thread [Next in Thread]