summaryrefslogtreecommitdiff
path: root/m4/ac_prog_javac_works.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/ac_prog_javac_works.m4')
-rw-r--r--m4/ac_prog_javac_works.m47
1 files changed, 6 insertions, 1 deletions
diff --git a/m4/ac_prog_javac_works.m4 b/m4/ac_prog_javac_works.m4
index 02b1f28c3..a03f476e3 100644
--- a/m4/ac_prog_javac_works.m4
+++ b/m4/ac_prog_javac_works.m4
@@ -31,7 +31,12 @@ public class Object
}
}
EOF
-if AC_TRY_COMMAND($JAVAC $JAVACFLAGS -source 1.5 -target 1.5 $JAVA_TEST) >/dev/null 2>&1; then
+if test x$JAVAC_IS_GCJ = xyes; then
+ CMD="$JAVAC $JAVACFLAGS -fsource=1.5 -ftarget=1.5 $JAVA_TEST"
+else
+ CMD="$JAVAC $JAVACFLAGS -source 1.5 -target 1.5 $JAVA_TEST"
+fi
+if AC_TRY_COMMAND($CMD) >/dev/null 2>&1; then
ac_cv_prog_javac_works=yes
else
AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)])