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