1
dnl @synopsis AC_PROG_JAVA
3
dnl Here is a summary of the main macros:
5
dnl AC_PROG_JAVAC: finds a Java compiler.
7
dnl AC_PROG_JAVA: finds a Java virtual machine.
9
dnl AC_CHECK_CLASS: finds if we have the given class (beware of CLASSPATH!).
11
dnl AC_CHECK_RQRD_CLASS: finds if we have the given class and stops otherwise.
13
dnl AC_TRY_COMPILE_JAVA: attempt to compile user given source.
15
dnl AC_TRY_RUN_JAVA: attempt to compile and run user given source.
17
dnl AC_JAVA_OPTIONS: adds Java configure options.
19
dnl AC_PROG_JAVA tests an existing Java virtual machine. It uses the
20
dnl environment variable JAVA then tests in sequence various common Java
21
dnl virtual machines. For political reasons, it starts with the free ones.
22
dnl You *must* call [AC_PROG_JAVAC] before.
24
dnl If you want to force a specific VM:
26
dnl - at the configure.in level, set JAVA=yourvm before calling AC_PROG_JAVA
27
dnl (but after AC_INIT)
29
dnl - at the configure level, setenv JAVA
31
dnl You can use the JAVA variable in your Makefile.in, with @JAVA@.
33
dnl *Warning*: its success or failure can depend on a proper setting of the
34
dnl CLASSPATH env. variable.
36
dnl TODO: allow to exclude virtual machines (rationale: most Java programs
37
dnl cannot run with some VM like kaffe).
39
dnl Note: This is part of the set of autoconf M4 macros for Java programs.
40
dnl It is VERY IMPORTANT that you download the whole set, some
41
dnl macros depend on other. Unfortunately, the autoconf archive does not
42
dnl support the concept of set of macros, so I had to break it for
45
dnl A Web page, with a link to the latest CVS snapshot is at
46
dnl <http://www.internatif.org/bortzmeyer/autoconf-Java/>.
48
dnl This is a sample configure.in
49
dnl Process this file with autoconf to produce a configure script.
51
dnl AC_INIT(UnTag.java)
53
dnl dnl Checks for programs.
54
dnl AC_CHECK_CLASSPATH
58
dnl dnl Checks for classes
59
dnl AC_CHECK_RQRD_CLASS(org.xml.sax.Parser)
60
dnl AC_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
62
dnl AC_OUTPUT(Makefile)
64
dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
67
AC_DEFUN([AC_PROG_JAVA],[
68
AC_REQUIRE([AC_EXEEXT])dnl
69
if test x$JAVAPREFIX = x; then
70
test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT)
72
test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT, $JAVAPREFIX)
74
test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])