OSDN Git Service

libjava/ChangeLog:
[pf3gnuchains/gcc-fork.git] / libjava / classpath / m4 / ac_prog_javac.m4
1 dnl @synopsis AC_PROG_JAVAC
2 dnl
3 dnl AC_PROG_JAVAC tests an existing Java compiler. It uses the
4 dnl environment variable JAVAC then tests in sequence various common
5 dnl Java compilers. For political reasons, it starts with the free
6 dnl ones.
7 dnl
8 dnl If you want to force a specific compiler:
9 dnl
10 dnl - at the configure.in level, set JAVAC=yourcompiler before calling
11 dnl AC_PROG_JAVAC
12 dnl
13 dnl - at the configure level, setenv JAVAC
14 dnl
15 dnl You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
16 dnl
17 dnl *Warning*: its success or failure can depend on a proper setting of
18 dnl the CLASSPATH env. variable.
19 dnl
20 dnl TODO: allow to exclude compilers (rationale: most Java programs
21 dnl cannot compile with some compilers like guavac).
22 dnl
23 dnl Note: This is part of the set of autoconf M4 macros for Java
24 dnl programs. It is VERY IMPORTANT that you download the whole set,
25 dnl some macros depend on other. Unfortunately, the autoconf archive
26 dnl does not support the concept of set of macros, so I had to break it
27 dnl for submission. The general documentation, as well as the sample
28 dnl configure.in, is included in the AC_PROG_JAVA macro.
29 dnl
30 dnl @category Java
31 dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
32 dnl @version 2000-07-19
33 dnl @license GPLWithACException
34 dnl
35 dnl Modified to remove jikes by Andrew John Hughes on 2008-02-11
36
37 AC_DEFUN([AC_PROG_JAVAC],[
38 AC_REQUIRE([AC_EXEEXT])dnl
39 ECJ_OPTS="-warn:-deprecation,serial,unusedImport"
40 JAVAC_OPTS="-Xlint:unchecked,cast,divzero,empty,finally,overrides"
41 GCJ_OPTS="-g"
42 if test "x$JAVAPREFIX" = x; then
43         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")
44 else
45         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)
46 fi
47 test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH])
48 AC_CACHE_CHECK([if $JAVAC is a version of gcj], ac_cv_prog_javac_is_gcj, [
49 if $JAVAC --version | grep gcj > /dev/null; then
50   ac_cv_prog_javac_is_gcj=yes;
51   JAVAC="$JAVAC $GCJ_OPTS";
52 fi])
53 AC_SUBST(JAVAC_IS_GCJ, $ac_cv_prog_javac_is_gcj)
54 AM_CONDITIONAL(GCJ_JAVAC, test x"${JAVAC_IS_GCJ}" = xyes)
55 dnl GCJ LOCAL
56 if test "$enable_java_maintainer_mode" = yes; then
57 AC_PROG_JAVAC_WORKS
58 fi
59 dnl END GCJ LOCAL
60 AC_PROVIDE([$0])dnl
61 ])