1 | # =========================================================================== |
---|
2 | # http://autoconf-archive.cryp.to/ac_prog_javac.html |
---|
3 | # =========================================================================== |
---|
4 | # |
---|
5 | # SYNOPSIS |
---|
6 | # |
---|
7 | # AC_PROG_JAVAC |
---|
8 | # |
---|
9 | # DESCRIPTION |
---|
10 | # |
---|
11 | # AC_PROG_JAVAC tests an existing Java compiler. It uses the environment |
---|
12 | # variable JAVAC then tests in sequence various common Java compilers. For |
---|
13 | # political reasons, it starts with the free ones. |
---|
14 | # |
---|
15 | # If you want to force a specific compiler: |
---|
16 | # |
---|
17 | # - at the configure.in level, set JAVAC=yourcompiler before calling |
---|
18 | # AC_PROG_JAVAC |
---|
19 | # |
---|
20 | # - at the configure level, setenv JAVAC |
---|
21 | # |
---|
22 | # You can use the JAVAC variable in your Makefile.in, with @JAVAC@. |
---|
23 | # |
---|
24 | # *Warning*: its success or failure can depend on a proper setting of the |
---|
25 | # CLASSPATH env. variable. |
---|
26 | # |
---|
27 | # TODO: allow to exclude compilers (rationale: most Java programs cannot |
---|
28 | # compile with some compilers like guavac). |
---|
29 | # |
---|
30 | # Note: This is part of the set of autoconf M4 macros for Java programs. |
---|
31 | # It is VERY IMPORTANT that you download the whole set, some macros depend |
---|
32 | # on other. Unfortunately, the autoconf archive does not support the |
---|
33 | # concept of set of macros, so I had to break it for submission. The |
---|
34 | # general documentation, as well as the sample configure.in, is included |
---|
35 | # in the AC_PROG_JAVA macro. |
---|
36 | # |
---|
37 | # LAST MODIFICATION |
---|
38 | # |
---|
39 | # 2008-04-12 |
---|
40 | # |
---|
41 | # COPYLEFT |
---|
42 | # |
---|
43 | # Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr> |
---|
44 | # |
---|
45 | # This program is free software; you can redistribute it and/or modify it |
---|
46 | # under the terms of the GNU General Public License as published by the |
---|
47 | # Free Software Foundation; either version 2 of the License, or (at your |
---|
48 | # option) any later version. |
---|
49 | # |
---|
50 | # This program is distributed in the hope that it will be useful, but |
---|
51 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
52 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
53 | # Public License for more details. |
---|
54 | # |
---|
55 | # You should have received a copy of the GNU General Public License along |
---|
56 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
57 | # |
---|
58 | # As a special exception, the respective Autoconf Macro's copyright owner |
---|
59 | # gives unlimited permission to copy, distribute and modify the configure |
---|
60 | # scripts that are the output of Autoconf when processing the Macro. You |
---|
61 | # need not follow the terms of the GNU General Public License when using |
---|
62 | # or distributing such scripts, even though portions of the text of the |
---|
63 | # Macro appear in them. The GNU General Public License (GPL) does govern |
---|
64 | # all other use of the material that constitutes the Autoconf Macro. |
---|
65 | # |
---|
66 | # This special exception to the GPL applies to versions of the Autoconf |
---|
67 | # Macro released by the Autoconf Macro Archive. When you make and |
---|
68 | # distribute a modified version of the Autoconf Macro, you may extend this |
---|
69 | # special exception to the GPL to apply to your modified version as well. |
---|
70 | |
---|
71 | AC_DEFUN([AC_PROG_JAVAC],[ |
---|
72 | AC_REQUIRE([AC_EXEEXT])dnl |
---|
73 | if test "x$JAVAPREFIX" = x; then |
---|
74 | test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT) |
---|
75 | else |
---|
76 | test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT, $JAVAPREFIX) |
---|
77 | fi |
---|
78 | test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH]) |
---|
79 | AC_PROG_JAVAC_WORKS |
---|
80 | AC_PROVIDE([$0])dnl |
---|
81 | ]) |
---|