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