diff options
Diffstat (limited to 'libjava/classpath/m4/ac_prog_javac.m4')
-rw-r--r-- | libjava/classpath/m4/ac_prog_javac.m4 | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libjava/classpath/m4/ac_prog_javac.m4 b/libjava/classpath/m4/ac_prog_javac.m4 index 869c1942f2c..0c505dae840 100644 --- a/libjava/classpath/m4/ac_prog_javac.m4 +++ b/libjava/classpath/m4/ac_prog_javac.m4 @@ -36,12 +36,22 @@ dnl Modified to remove jikes by Andrew John Hughes on 2008-02-11 AC_DEFUN([AC_PROG_JAVAC],[ AC_REQUIRE([AC_EXEEXT])dnl +ECJ_OPTS="-warn:-deprecation,serial,unusedImport" +JAVAC_OPTS="-Xlint:unchecked,cast,divzero,empty,finally,overrides" +GCJ_OPTS="-g" if test "x$JAVAPREFIX" = x; then - test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, ["ecj$EXEEXT -warn:-deprecation,serial,unusedImport"] ["ecj-3.3$EXEEXT -warn:-deprecation,serial,unusedImport"] ["ecj-3.2$EXEEXT -warn:-deprecation,serial,unusedImport"] ["javac$EXEEXT -Xlint:unchecked"] "gcj$EXEEXT -C") + test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, ["ecj$EXEEXT $ECJ_OPTS"] ["ecj-3.3$EXEEXT $ECJ_OPTS"] ["ecj-3.2$EXEEXT $ECJ_OPTS"] ["javac$EXEEXT $JAVAC_OPTS"] "gcj$EXEEXT -C") else - test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, ["ecj$EXEEXT -warn:-deprecation,serial,unusedImport"] ["ecj-3.3$EXEEXT -warn:-deprecation,serial,unusedImport"] ["ecj-3.2$EXEEXT -warn:-deprecation,serial,unusedImport"] ["javac$EXEEXT -Xlint:unchecked"] "gcj$EXEEXT -C", $JAVAPREFIX) + test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, ["ecj$EXEEXT $ECJ_OPTS"] ["ecj-3.3$EXEEXT $ECJ_OPTS"] ["ecj-3.2$EXEEXT $ECJ_OPTS"] ["javac$EXEEXT $JAVAC_OPTS"] "gcj$EXEEXT -C", $JAVAPREFIX) 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 + ac_cv_prog_javac_is_gcj=yes; + JAVAC="$JAVAC $GCJ_OPTS"; +fi]) +AC_SUBST(JAVAC_IS_GCJ, $ac_cv_prog_javac_is_gcj) +AM_CONDITIONAL(GCJ_JAVAC, test x"${JAVAC_IS_GCJ}" = xyes) dnl GCJ LOCAL if test "$enable_java_maintainer_mode" = yes; then AC_PROG_JAVAC_WORKS |