1 # ===========================================================================
2 # http://www.gnu.org/software/autoconf-archive/ax_prog_java.html
3 # ===========================================================================
11 # Here is a summary of the main macros:
13 # AX_PROG_JAVAC: finds a Java compiler.
15 # AX_PROG_JAVA: finds a Java virtual machine.
17 # AX_CHECK_CLASS: finds if we have the given class (beware of CLASSPATH!).
19 # AX_CHECK_RQRD_CLASS: finds if we have the given class and stops
22 # AX_TRY_COMPILE_JAVA: attempt to compile user given source.
24 # AX_TRY_RUN_JAVA: attempt to compile and run user given source.
26 # AX_JAVA_OPTIONS: adds Java configure options.
28 # AX_PROG_JAVA tests an existing Java virtual machine. It uses the
29 # environment variable JAVA then tests in sequence various common Java
30 # virtual machines. For political reasons, it starts with the free ones.
31 # You *must* call [AX_PROG_JAVAC] before.
33 # If you want to force a specific VM:
35 # - at the configure.in level, set JAVA=yourvm before calling AX_PROG_JAVA
39 # - at the configure level, setenv JAVA
41 # You can use the JAVA variable in your Makefile.in, with @JAVA@.
43 # *Warning*: its success or failure can depend on a proper setting of the
44 # CLASSPATH env. variable.
46 # TODO: allow to exclude virtual machines (rationale: most Java programs
47 # cannot run with some VM like kaffe).
49 # Note: This is part of the set of autoconf M4 macros for Java programs.
50 # It is VERY IMPORTANT that you download the whole set, some macros depend
51 # on other. Unfortunately, the autoconf archive does not support the
52 # concept of set of macros, so I had to break it for submission.
54 # A Web page, with a link to the latest CVS snapshot is at
55 # <http://www.internatif.org/bortzmeyer/autoconf-Java/>.
57 # This is a sample configure.in Process this file with autoconf to produce
62 # dnl Checks for programs.
67 # dnl Checks for classes
68 # AX_CHECK_RQRD_CLASS(org.xml.sax.Parser)
69 # AX_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
75 # Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
77 # This program is free software; you can redistribute it and/or modify it
78 # under the terms of the GNU General Public License as published by the
79 # Free Software Foundation; either version 2 of the License, or (at your
80 # option) any later version.
82 # This program is distributed in the hope that it will be useful, but
83 # WITHOUT ANY WARRANTY; without even the implied warranty of
84 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
85 # Public License for more details.
87 # You should have received a copy of the GNU General Public License along
88 # with this program. If not, see <http://www.gnu.org/licenses/>.
90 # As a special exception, the respective Autoconf Macro's copyright owner
91 # gives unlimited permission to copy, distribute and modify the configure
92 # scripts that are the output of Autoconf when processing the Macro. You
93 # need not follow the terms of the GNU General Public License when using
94 # or distributing such scripts, even though portions of the text of the
95 # Macro appear in them. The GNU General Public License (GPL) does govern
96 # all other use of the material that constitutes the Autoconf Macro.
98 # This special exception to the GPL applies to versions of the Autoconf
99 # Macro released by the Autoconf Archive. When you make and distribute a
100 # modified version of the Autoconf Macro, you may extend this special
101 # exception to the GPL to apply to your modified version as well.
105 AU_ALIAS([AC_PROG_JAVA], [AX_PROG_JAVA])
106 AC_DEFUN([AX_PROG_JAVA],[
107 m4_define([m4_ax_prog_java_list], [kaffe java])dnl
108 AS_IF([test "x$JAVAPREFIX" = x],
109 [test x$JAVA = x && AC_CHECK_PROGS([JAVA], [m4_ax_prog_java_list])],
110 [test x$JAVA = x && AC_CHECK_PROGS([JAVA], [m4_ax_prog_java_list], [], [$JAVAPREFIX/bin])])
111 test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
112 m4_undefine([m4_ax_prog_java_list])dnl