summaryrefslogtreecommitdiff
path: root/m4/ac_prog_javac.m4
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-02-12 22:30:18 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-02-12 22:30:18 +0000
commitc16bf0bb4b41362a6f0a35fb1d61744f1487bfcb (patch)
tree188e06a0aa1bff0a13e6de0323300a699a78496c /m4/ac_prog_javac.m4
parentd6eb5ba5f739900a8947990e17fd9de439e70711 (diff)
downloadclasspath-c16bf0bb4b41362a6f0a35fb1d61744f1487bfcb.tar.gz
2008-02-11 Andrew John Hughes <gnu_andrew@member.fsf.org>
PR classpath/34578: * NEWS: Mention javah and javac build changes. * configure.ac: Call AC_PROG_JAVAC and CLASSPATH_JAVAC_MEM_CHECK instead of CLASSPATH_FIND_JAVAC. * examples/Makefile.am: Simplify compiler choice to just use JAVAC. * lib/Makefile.am: Likewise, but with JAVAC_MEM_OPT too. * m4/ac_prog_javac.m4: New file. * m4/ac_prog_javac_works.m4: Likewise. * m4/acinclude.m4: (CLASSPATH_FIND_JAVAC): Removed. (CLASSPATH_WITH_GCJ): Removed. (CLASSPATH_CHECK_GCJ): Removed. (CLASSPATH_WITH_JIKES): Removed. (CLASSPATH_CHECK_JIKES): Removed. (CLASSPATH_WITH_KJC): Removed. (CLASSPATH_CHECK_KJC): Removed. (CLASSPATH_WITH_ECJ): Removed. (CLASSPATH_CHECK_ECJ): Removed. (CLASSPATH_WITH_JAVAC): Removed. (CLASSPATH_CHECK_JAVAC): Removed. (CLASSPATH_JAVAC_MEM_CHECK): Added. * tools/Makefile.am: Simplify compiler choice to just javac.
Diffstat (limited to 'm4/ac_prog_javac.m4')
-rw-r--r--m4/ac_prog_javac.m447
1 files changed, 47 insertions, 0 deletions
diff --git a/m4/ac_prog_javac.m4 b/m4/ac_prog_javac.m4
new file mode 100644
index 000000000..8215808c6
--- /dev/null
+++ b/m4/ac_prog_javac.m4
@@ -0,0 +1,47 @@
+dnl @synopsis AC_PROG_JAVAC
+dnl
+dnl AC_PROG_JAVAC tests an existing Java compiler. It uses the
+dnl environment variable JAVAC then tests in sequence various common
+dnl Java compilers. For political reasons, it starts with the free
+dnl ones.
+dnl
+dnl If you want to force a specific compiler:
+dnl
+dnl - at the configure.in level, set JAVAC=yourcompiler before calling
+dnl AC_PROG_JAVAC
+dnl
+dnl - at the configure level, setenv JAVAC
+dnl
+dnl You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
+dnl
+dnl *Warning*: its success or failure can depend on a proper setting of
+dnl the CLASSPATH env. variable.
+dnl
+dnl TODO: allow to exclude compilers (rationale: most Java programs
+dnl cannot compile with some compilers like guavac).
+dnl
+dnl Note: This is part of the set of autoconf M4 macros for Java
+dnl programs. It is VERY IMPORTANT that you download the whole set,
+dnl some macros depend on other. Unfortunately, the autoconf archive
+dnl does not support the concept of set of macros, so I had to break it
+dnl for submission. The general documentation, as well as the sample
+dnl configure.in, is included in the AC_PROG_JAVA macro.
+dnl
+dnl @category Java
+dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+dnl @version 2000-07-19
+dnl @license GPLWithACException
+dnl
+dnl Modified to remove jikes by Andrew John Hughes on 2008-02-11
+
+AC_DEFUN([AC_PROG_JAVAC],[
+AC_REQUIRE([AC_EXEEXT])dnl
+if test "x$JAVAPREFIX" = x; then
+ test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, ecj$EXEEXT javac$EXEEXT "gcj$EXEEXT -C")
+else
+ test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, ecj$EXEEXT javac$EXEEXT "gcj$EXEEXT -C", $JAVAPREFIX)
+fi
+test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH])
+AC_PROG_JAVAC_WORKS
+AC_PROVIDE([$0])dnl
+])