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
12 dnl AC_CHECK_RQRD_CLASS: finds if we have the given class and stops
15 dnl AC_TRY_COMPILE_JAVA: attempt to compile user given source.
17 dnl AC_TRY_RUN_JAVA: attempt to compile and run user given source.
19 dnl AC_JAVA_OPTIONS: adds Java configure options.
21 dnl AC_PROG_JAVA tests an existing Java virtual machine. It uses the
22 dnl environment variable JAVA then tests in sequence various common
23 dnl Java virtual machines. For political reasons, it starts with the
24 dnl free ones. You *must* call [AC_PROG_JAVAC] before.
26 dnl If you want to force a specific VM:
28 dnl - at the configure.in level, set JAVA=yourvm before calling
31 dnl (but after AC_INIT)
33 dnl - at the configure level, setenv JAVA
35 dnl You can use the JAVA variable in your Makefile.in, with @JAVA@.
37 dnl *Warning*: its success or failure can depend on a proper setting of
38 dnl the CLASSPATH env. variable.
40 dnl TODO: allow to exclude virtual machines (rationale: most Java
41 dnl programs cannot run with some VM like kaffe).
43 dnl Note: This is part of the set of autoconf M4 macros for Java
44 dnl programs. It is VERY IMPORTANT that you download the whole set,
45 dnl some macros depend on other. Unfortunately, the autoconf archive
46 dnl does not support the concept of set of macros, so I had to break it
49 dnl A Web page, with a link to the latest CVS snapshot is at
50 dnl <http://www.internatif.org/bortzmeyer/autoconf-Java/>.
52 dnl This is a sample configure.in Process this file with autoconf to
53 dnl produce a configure script.
55 dnl AC_INIT(UnTag.java)
57 dnl dnl Checks for programs.
58 dnl AC_CHECK_CLASSPATH
62 dnl dnl Checks for classes
63 dnl AC_CHECK_RQRD_CLASS(org.xml.sax.Parser)
64 dnl AC_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
66 dnl AC_OUTPUT(Makefile)
69 dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
70 dnl @version 2000-07-19
71 dnl @license GPLWithACException
73 AC_DEFUN([AC_PROG_JAVA],[
74 AC_REQUIRE([AC_EXEEXT])dnl
75 if test x$JAVAPREFIX = x; then
76 test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT)
78 test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT, $JAVAPREFIX)
80 test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])