1 | # =========================================================================== |
---|
2 | # http://autoconf-archive.cryp.to/ac_prog_javac_works.html |
---|
3 | # =========================================================================== |
---|
4 | # |
---|
5 | # SYNOPSIS |
---|
6 | # |
---|
7 | # AC_PROG_JAVAC_WORKS |
---|
8 | # |
---|
9 | # DESCRIPTION |
---|
10 | # |
---|
11 | # Internal use ONLY. |
---|
12 | # |
---|
13 | # Note: This is part of the set of autoconf M4 macros for Java programs. |
---|
14 | # It is VERY IMPORTANT that you download the whole set, some macros depend |
---|
15 | # on other. Unfortunately, the autoconf archive does not support the |
---|
16 | # concept of set of macros, so I had to break it for submission. The |
---|
17 | # general documentation, as well as the sample configure.in, is included |
---|
18 | # in the AC_PROG_JAVA macro. |
---|
19 | # |
---|
20 | # LAST MODIFICATION |
---|
21 | # |
---|
22 | # 2008-04-12 |
---|
23 | # |
---|
24 | # COPYLEFT |
---|
25 | # |
---|
26 | # Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr> |
---|
27 | # |
---|
28 | # This program is free software; you can redistribute it and/or modify it |
---|
29 | # under the terms of the GNU General Public License as published by the |
---|
30 | # Free Software Foundation; either version 2 of the License, or (at your |
---|
31 | # option) any later version. |
---|
32 | # |
---|
33 | # This program is distributed in the hope that it will be useful, but |
---|
34 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
35 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
36 | # Public License for more details. |
---|
37 | # |
---|
38 | # You should have received a copy of the GNU General Public License along |
---|
39 | # with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
40 | # |
---|
41 | # As a special exception, the respective Autoconf Macro's copyright owner |
---|
42 | # gives unlimited permission to copy, distribute and modify the configure |
---|
43 | # scripts that are the output of Autoconf when processing the Macro. You |
---|
44 | # need not follow the terms of the GNU General Public License when using |
---|
45 | # or distributing such scripts, even though portions of the text of the |
---|
46 | # Macro appear in them. The GNU General Public License (GPL) does govern |
---|
47 | # all other use of the material that constitutes the Autoconf Macro. |
---|
48 | # |
---|
49 | # This special exception to the GPL applies to versions of the Autoconf |
---|
50 | # Macro released by the Autoconf Macro Archive. When you make and |
---|
51 | # distribute a modified version of the Autoconf Macro, you may extend this |
---|
52 | # special exception to the GPL to apply to your modified version as well. |
---|
53 | |
---|
54 | AC_DEFUN([AC_PROG_JAVAC_WORKS],[ |
---|
55 | AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [ |
---|
56 | JAVA_TEST=Test.java |
---|
57 | CLASS_TEST=Test.class |
---|
58 | cat << \EOF > $JAVA_TEST |
---|
59 | /* [#]line __oline__ "configure" */ |
---|
60 | public class Test { |
---|
61 | } |
---|
62 | EOF |
---|
63 | if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then |
---|
64 | ac_cv_prog_javac_works=yes |
---|
65 | else |
---|
66 | AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)]) |
---|
67 | echo "configure: failed program was:" >&AC_FD_CC |
---|
68 | cat $JAVA_TEST >&AC_FD_CC |
---|
69 | fi |
---|
70 | rm -f $JAVA_TEST $CLASS_TEST |
---|
71 | ]) |
---|
72 | AC_PROVIDE([$0])dnl |
---|
73 | ]) |
---|