1 | dnl @synopsis AC_PROG_JAVA
|
---|
2 | dnl
|
---|
3 | dnl Here is a summary of the main macros:
|
---|
4 | dnl
|
---|
5 | dnl AC_PROG_JAVAC: finds a Java compiler.
|
---|
6 | dnl
|
---|
7 | dnl AC_PROG_JAVA: finds a Java virtual machine.
|
---|
8 | dnl
|
---|
9 | dnl AC_CHECK_CLASS: finds if we have the given class (beware of
|
---|
10 | dnl CLASSPATH!).
|
---|
11 | dnl
|
---|
12 | dnl AC_CHECK_RQRD_CLASS: finds if we have the given class and stops
|
---|
13 | dnl otherwise.
|
---|
14 | dnl
|
---|
15 | dnl AC_TRY_COMPILE_JAVA: attempt to compile user given source.
|
---|
16 | dnl
|
---|
17 | dnl AC_TRY_RUN_JAVA: attempt to compile and run user given source.
|
---|
18 | dnl
|
---|
19 | dnl AC_JAVA_OPTIONS: adds Java configure options.
|
---|
20 | dnl
|
---|
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.
|
---|
25 | dnl
|
---|
26 | dnl If you want to force a specific VM:
|
---|
27 | dnl
|
---|
28 | dnl - at the configure.in level, set JAVA=yourvm before calling
|
---|
29 | dnl AC_PROG_JAVA
|
---|
30 | dnl
|
---|
31 | dnl (but after AC_INIT)
|
---|
32 | dnl
|
---|
33 | dnl - at the configure level, setenv JAVA
|
---|
34 | dnl
|
---|
35 | dnl You can use the JAVA variable in your Makefile.in, with @JAVA@.
|
---|
36 | dnl
|
---|
37 | dnl *Warning*: its success or failure can depend on a proper setting of
|
---|
38 | dnl the CLASSPATH env. variable.
|
---|
39 | dnl
|
---|
40 | dnl TODO: allow to exclude virtual machines (rationale: most Java
|
---|
41 | dnl programs cannot run with some VM like kaffe).
|
---|
42 | dnl
|
---|
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
|
---|
47 | dnl for submission.
|
---|
48 | dnl
|
---|
49 | dnl A Web page, with a link to the latest CVS snapshot is at
|
---|
50 | dnl <http://www.internatif.org/bortzmeyer/autoconf-Java/>.
|
---|
51 | dnl
|
---|
52 | dnl This is a sample configure.in Process this file with autoconf to
|
---|
53 | dnl produce a configure script.
|
---|
54 | dnl
|
---|
55 | dnl AC_INIT(UnTag.java)
|
---|
56 | dnl
|
---|
57 | dnl dnl Checks for programs.
|
---|
58 | dnl AC_CHECK_CLASSPATH
|
---|
59 | dnl AC_PROG_JAVAC
|
---|
60 | dnl AC_PROG_JAVA
|
---|
61 | dnl
|
---|
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)
|
---|
65 | dnl
|
---|
66 | dnl AC_OUTPUT(Makefile)
|
---|
67 | dnl
|
---|
68 | dnl @category Java
|
---|
69 | dnl @author Stephane Bortzmeyer <[email protected]>
|
---|
70 | dnl @version 2000-07-19
|
---|
71 | dnl @license GPLWithACException
|
---|
72 |
|
---|
73 | AC_DEFUN([AC_PROG_JAVA],[
|
---|
74 | AC_REQUIRE([AC_EXEEXT])
|
---|
75 | if test x$JAVAPREFIX = x; then
|
---|
76 | test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT)
|
---|
77 | else
|
---|
78 | test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT, $JAVAPREFIX)
|
---|
79 | fi
|
---|
80 | test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
|
---|
81 | AC_PROG_JAVA_WORKS
|
---|
82 | AC_PROVIDE([$0])
|
---|
83 | ])
|
---|