]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Avoid broken versions of gcj.
authorBruno Haible <bruno@clisp.org>
Tue, 18 Jun 2002 11:31:42 +0000 (11:31 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:08:36 +0000 (12:08 +0200)
lib/ChangeLog
lib/javacomp.c
m4/ChangeLog
m4/javacomp.m4

index f7ca99942a08c27022ccfa42565d3d55dd2cd9f6..7454ccc964180276537507ba6b5d47e60c068e0a 100644 (file)
@@ -1,3 +1,10 @@
+2002-06-15  Bruno Haible  <bruno@clisp.org>
+
+       * 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  <bruno@clisp.org>
 
        * linebreak.c (nonspacing_table_data, uc_width): Upgrade to
index 3f03d18abb15d5cd0d9f4dee7c3396f848f47171..83a6dd6f95ebdfa45e934634c526abba657869b2 100644 (file)
@@ -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]);
index e332c7f3be8cd264690bd17cf5769a7e63862f80..a3a6c2e3183ea9abc3067fcb47ea9792c6fe07d4 100644 (file)
@@ -1,3 +1,10 @@
+2002-06-15  Bruno Haible  <bruno@clisp.org>
+
+       * 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  <bruno@clisp.org>
 
        * lib-link.m4 (AC_LIB_RPATH): New option --disable-rpath.
index 40b44edcbf2ca22a9b85612c556a38758f4a8ac2..2286540bbfd10af90511687f32a11d9cc6bc3780 100644 (file)
@@ -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 <<EOF