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