This patch redirects the output of gcj --version so it doesn't
intrude on configure's output.  It also ensures a 'no' response appears
when the test fails.

2010-05-04  Andrew John Hughes  <ahug...@redhat.com>

        * m4/ac_prog_javac.m4:
        Capture all output from javac --version
        to avoid excess output.  Make sure no appears
        when javac is not gcj.
-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
Index: m4/ac_prog_javac.m4
===================================================================
RCS file: /sources/classpath/classpath/m4/ac_prog_javac.m4,v
retrieving revision 1.6
diff -u -u -r1.6 ac_prog_javac.m4
--- m4/ac_prog_javac.m4 13 Sep 2008 03:07:27 -0000      1.6
+++ m4/ac_prog_javac.m4 4 May 2010 17:29:10 -0000
@@ -46,10 +46,13 @@
 fi
 test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in 
\$PATH])
 AC_CACHE_CHECK([if $JAVAC is a version of gcj], ac_cv_prog_javac_is_gcj, [
-if $JAVAC --version | grep gcj > /dev/null; then
+if $JAVAC --version 2>&1 | grep gcj >&AS_MESSAGE_LOG_FD ; then
   ac_cv_prog_javac_is_gcj=yes;
   JAVAC="$JAVAC $GCJ_OPTS";
-fi])
+else
+  ac_cv_prog_javac_is_gcj=no;
+fi
+])
 AC_SUBST(JAVAC_IS_GCJ, $ac_cv_prog_javac_is_gcj)
 AM_CONDITIONAL(GCJ_JAVAC, test x"${JAVAC_IS_GCJ}" = xyes)
 AC_PROG_JAVAC_WORKS

Reply via email to