From: Bruno Haible Date: Tue, 18 Jun 2002 11:31:42 +0000 (+0000) Subject: Avoid broken versions of gcj. X-Git-Tag: v0.11.3~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fff78c7dce274c05f8e0863f94eb818bb24fe3e4;p=thirdparty%2Fgettext.git Avoid broken versions of gcj. --- diff --git a/lib/ChangeLog b/lib/ChangeLog index f7ca99942..7454ccc96 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,10 @@ +2002-06-15 Bruno Haible + + * javacomp.c (compile_java_class): Ignore gcj versions that start with + "3.0" or "3.1". (gcj 3.0.4 compiles GetURL.java to invalid bytecode, + that crashes with an IllegalAccessError when executed by gij 3.0.4 or + with a VerifyError when executed by Sun Java. Likewise for gcj 3.1.) + 2002-05-29 Bruno Haible * linebreak.c (nonspacing_table_data, uc_width): Upgrade to diff --git a/lib/javacomp.c b/lib/javacomp.c index 3f03d18ab..83a6dd6f9 100644 --- a/lib/javacomp.c +++ b/lib/javacomp.c @@ -55,7 +55,7 @@ Program from A C O g T $JAVAC unknown N n/a -O -g true - gcj -C GCC 3.0 Y --classpath=P -O -g gcj --version | sed -e 's,^[^0-9]*,,' -e 1q | grep '^[3-9]' >/dev/null + gcj -C GCC 3.2 Y --classpath=P -O -g gcj --version | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^3\.[01]/d' | grep '^[3-9]' >/dev/null javac JDK 1.1.8 Y -classpath P -O -g javac 2>/dev/null; test $? = 1 javac JDK 1.3.0 Y -classpath P -O -g javac 2>/dev/null; test $? -le 2 jikes Jikes 1.14 N -classpath P -O -g jikes 2>/dev/null; test $? = 1 @@ -194,7 +194,8 @@ compile_java_class (java_sources, java_sources_count, { /* Test for presence of gcj: "gcj --version 2> /dev/null | \ - sed -e 's,^[^0-9]*,,' -e 1q | grep '^[3-9]' > /dev/null" */ + sed -e 's,^[^0-9]*,,' -e 1q | \ + sed -e '/^3\.[01]/d' | grep '^[3-9]' > /dev/null" */ char *argv[3]; pid_t child; int fd[1]; @@ -209,21 +210,32 @@ compile_java_class (java_sources, java_sources_count, if (child != -1) { /* Read the subprocess output, drop all lines except the first, - and test whether the first digit found in the first line is - >= 3. */ - char c; + drop all characters before the first digit, and test whether + the remaining string starts with a digit >= 3, but not with + "3.0" or "3.1". */ + char c[3]; + size_t count = 0; - while (safe_read (fd[0], &c, 1) > 0) + while (safe_read (fd[0], &c[count], 1) > 0) { - if (c >= '0' && c <= '9') + if (c[count] == '\n') + break; + if (count == 0) + { + if (!(c[0] >= '0' && c[0] <= '9')) + continue; + gcj_present = (c[0] >= '3'); + } + count++; + if (count == 3) { - gcj_present = (c >= '3' && c <= '9'); + if (c[0] == '3' && c[1] == '.' + && (c[2] == '0' || c[2] == '1')) + gcj_present = false; break; } - if (c == '\n') - break; } - while (safe_read (fd[0], &c, 1) > 0) + while (safe_read (fd[0], &c[0], 1) > 0) ; close (fd[0]); diff --git a/m4/ChangeLog b/m4/ChangeLog index e332c7f3b..a3a6c2e31 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,10 @@ +2002-06-15 Bruno Haible + + * javacomp.m4 (gt_JAVACOMP): Ignore gcj versions that start with + "3.0" or "3.1". (gcj 3.0.4 compiles GetURL.java to invalid bytecode, + that crashes with an IllegalAccessError when executed by gij 3.0.4 or + with a VerifyError when executed by Sun Java. Likewise for gcj 3.1.) + 2002-06-14 Bruno Haible * lib-link.m4 (AC_LIB_RPATH): New option --disable-rpath. diff --git a/m4/javacomp.m4 b/m4/javacomp.m4 index 40b44edcb..2286540bb 100644 --- a/m4/javacomp.m4 +++ b/m4/javacomp.m4 @@ -32,7 +32,7 @@ AC_DEFUN([gt_JAVACOMP], popdef([AC_MSG_CHECKING])dnl changequote(,)dnl if test -n "$HAVE_GCJ_IN_PATH" \ - && gcj --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | grep '^[3-9]' >/dev/null \ + && gcj --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^3\.[01]/d' | grep '^[3-9]' >/dev/null \ && ( # See if libgcj.jar is well installed. cat > conftest.java <