]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make the gcj determination work with GCC 3.1 as well.
authorBruno Haible <bruno@clisp.org>
Mon, 6 May 2002 11:03:30 +0000 (11:03 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:07:57 +0000 (12:07 +0200)
lib/ChangeLog
lib/javacomp.c
m4/ChangeLog
m4/javacomp.m4

index 502ef44cc0e4bdc08cdbdb1ac7ae3a478eb9fab1..835e19be3a4027b1bdc9609f7de24e0ee69cf1a3 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-04  Bruno Haible  <bruno@clisp.org>
+
+       * javacomp.c (compile_java_class): Ignore non-digits in the first
+       line of the output of "gcj --version". Needed for gcj 3.1.
+
 2002-04-30  Bruno Haible  <bruno@clisp.org>
 
        * stdbool.h.in (_Bool): Omit the definition if _Bool is already known
index 858296bbdfaa5698666b20fe520c363bf3422a72..3f03d18abb15d5cd0d9f4dee7c3396f848f47171 100644 (file)
@@ -1,5 +1,5 @@
 /* Compile a Java program.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -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 | grep '^[3-9]' >/dev/null
+   gcj -C   GCC 3.0     Y  --classpath=P  -O -g  gcj --version | sed -e 's,^[^0-9]*,,' -e 1q | 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
@@ -193,7 +193,8 @@ compile_java_class (java_sources, java_sources_count,
     if (!gcj_tested)
       {
        /* Test for presence of gcj:
-          "gcj --version 2> /dev/null | grep '^[3-9]' > /dev/null"  */
+          "gcj --version 2> /dev/null | \
+           sed -e 's,^[^0-9]*,,' -e 1q | grep '^[3-9]' > /dev/null"  */
        char *argv[3];
        pid_t child;
        int fd[1];
@@ -207,12 +208,21 @@ compile_java_class (java_sources, java_sources_count,
        gcj_present = false;
        if (child != -1)
          {
-           /* Read the subprocess output, a single line, and test whether
-              it starts with a digit >= 3.  */
+           /* 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;
 
-           if (safe_read (fd[0], &c, 1) > 0)
-             gcj_present = (c >= '3' && c <= '9');
+           while (safe_read (fd[0], &c, 1) > 0)
+             {
+               if (c >= '0' && c <= '9')
+                 {
+                   gcj_present = (c >= '3' && c <= '9');
+                   break;
+                 }
+               if (c == '\n')
+                 break;
+             }
            while (safe_read (fd[0], &c, 1) > 0)
              ;
 
index 0d72d0779f788f70d45bdb5020abab39133102b5..f233bf08bdd988f3fecb691c690010dec649840d 100644 (file)
@@ -1,3 +1,8 @@
+2002-05-04  Bruno Haible  <bruno@clisp.org>
+
+       * javacomp.m4 (gt_JAVACOMP): Ignore non-digits in the first line of
+       the output of "gcj --version". Needed for gcj 3.1.
+
 2002-04-30  Bruno Haible  <bruno@clisp.org>
 
        * stdbool.m4 (gt_STDBOOL_H): If <stdbool.h> does not exist, check for
index fd49b63fe0eed4f59df282ff67d12b52c39045f9..40b44edcbf2ca22a9b85612c556a38758f4a8ac2 100644 (file)
@@ -1,4 +1,4 @@
-# javacomp.m4 serial 3 (gettext-0.11.2)
+# javacomp.m4 serial 4 (gettext-0.11.3)
 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
@@ -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 | grep '^[3-9]' >/dev/null \
+       && gcj --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | grep '^[3-9]' >/dev/null \
        && (
         # See if libgcj.jar is well installed.
         cat > conftest.java <<EOF