No, that's wrong. You can try changing libtool.m4 to run tests
on .class files instead; compile them with an old GCJ, and
include the bytecode in libtool.m4, using tr or awk to turn ASCII
strings into bytecode.
That is the best I can find. I don't know anything about .classs file
nor java bytecode.
So the attached patch (untested because the problem does not
reproduce on my machine) should give you an idea of what I meant.
Please test it and/or fix it.
Libtool maintainers, would you accept a patch like this one? The
problem is that under some configurations, GCC 4.3 cannot compile
Java source code until its build has finished.
Paolo
2007-05-27 Paolo Bonzini <address@hidden>
* libtool.m4 (_LT_LANG_GCJ_CONFIG): Run tests on .class files.
Index: libtool.m4
===================================================================
--- libtool.m4 (revision 125123)
+++ libtool.m4 (working copy)
@@ -6737,18 +6737,54 @@ m4_defun([_LT_LANG_GCJ_CONFIG],
[AC_REQUIRE([LT_PROG_GCJ])dnl
AC_LANG_SAVE
-# Source file extension for Java test sources.
-ac_ext=java
+# Source file extension for Java test sources. Actually, we use a
list
+# of input files so that we can prepare binary .class files and keep
+# lt_simple_compile_test_code/lt_simple_link_test_code in ASCII.
+ac_ext=list
# Object file extension for compiled Java test sources.
objext=o
_LT_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
+# "class conftest_compile {}"
+# Turn it into hex using "od -x foo.class | sed s/^.......// | tr -
d ' '"
+lt_simple_compile_test_code='conftest_compile.class'
+awk 'BEGIN { h = "0123456789abcdef" }
+ {
+ for (i = 1; i <= length; i+=2)
+ printf "%c", 16*index(h, substr($0, i, 1))+index(h, substr
($0, i+1, 1))-17
+ }' > conftest_compile.class << EOF
+cafebabe00000031000d0a0003000a07000b07000c0100063c696e69743e0100
+03282956010004436f646501000f4c696e654e756d6265725461626c6501000a
+536f7572636546696c65010015636f6e66746573745f636f6d70696c652e6a61
+76610c00040005010010636f6e66746573745f636f6d70696c650100106a6176
+612f6c616e672f4f626a65637400200002000300000000000100000004000500
+0100060000001d00010001000000052ab70001b1000000010007000000060001
+0000000100010008000000020009
+EOF