1dnl A function to check whether the Java compiler supports enums.
2dnl Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3dnl Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4dnl
5dnl This file is part of the Parma Polyhedra Library (PPL).
6dnl
7dnl The PPL is free software; you can redistribute it and/or modify it
8dnl under the terms of the GNU General Public License as published by the
9dnl Free Software Foundation; either version 3 of the License, or (at your
10dnl option) any later version.
11dnl
12dnl The PPL is distributed in the hope that it will be useful, but WITHOUT
13dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15dnl for more details.
16dnl
17dnl You should have received a copy of the GNU General Public License
18dnl along with this program; if not, write to the Free Software Foundation,
19dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20dnl
21dnl For the most up-to-date information see the Parma Polyhedra Library
22dnl site: http://bugseng.com/products/ppl/ .
23
24AC_DEFUN([AC_JAVAC_SUPPORTS_ENUMS],[
25AC_CACHE_CHECK([whether $JAVAC supports enums], ac_cv_javac_supports_enums, [
26JAVA_TEST=Test.java
27CLASS_TEST=Test.class
28cat << \EOF > $JAVA_TEST
29/* [#]line __oline__ "configure" */
30public class Test {
31public enum Relation_Symbol {
32    /*! Less than. */
33    LESS_THAN,
34    /*! Less than or equal to. */
35    LESS_OR_EQUAL,
36    /*! Equal to. */
37    EQUAL,
38    /*! Greater than or equal to. */
39    GREATER_OR_EQUAL,
40    /*! Greater than. */
41    GREATER_THAN,
42 }
43}
44EOF
45if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then
46  ac_cv_javac_supports_enums=yes
47else
48  echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
49  cat $JAVA_TEST >&AS_MESSAGE_LOG_FD
50  ac_cv_javac_supports_enums=no
51fi
52
53rm -f $JAVA_TEST $CLASS_TEST Test\$Relation_Symbol.class
54])
55AC_PROVIDE([$0])dnl
56])
57
58##### http://autoconf-archive.cryp.to/ac_prog_javac.html
59#
60# SYNOPSIS
61#
62#   AC_PROG_JAVAC
63#
64# DESCRIPTION
65#
66#   AC_PROG_JAVAC tests an existing Java compiler. It uses the
67#   environment variable JAVAC then tests in sequence various common
68#   Java compilers. For political reasons, it starts with the free
69#   ones.
70#
71#   If you want to force a specific compiler:
72#
73#   - at the configure.in level, set JAVAC=yourcompiler before calling
74#   AC_PROG_JAVAC
75#
76#   - at the configure level, setenv JAVAC
77#
78#   You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
79#
80#   *Warning*: its success or failure can depend on a proper setting of
81#   the CLASSPATH env. variable.
82#
83#   TODO: allow to exclude compilers (rationale: most Java programs
84#   cannot compile with some compilers like guavac).
85#
86#   Note: This is part of the set of autoconf M4 macros for Java
87#   programs. It is VERY IMPORTANT that you download the whole set,
88#   some macros depend on other. Unfortunately, the autoconf archive
89#   does not support the concept of set of macros, so I had to break it
90#   for submission. The general documentation, as well as the sample
91#   configure.in, is included in the AC_PROG_JAVA macro.
92#
93# LAST MODIFICATION
94#
95#   2006-11-07
96#
97# COPYLEFT
98#
99#   Copyright (c) 2000      Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
100#   Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
101#   Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
102#
103#   This program is free software; you can redistribute it and/or
104#   modify it under the terms of the GNU General Public License as
105#   published by the Free Software Foundation; either version 2 of the
106#   License, or (at your option) any later version.
107#
108#   This program is distributed in the hope that it will be useful, but
109#   WITHOUT ANY WARRANTY; without even the implied warranty of
110#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
111#   General Public License for more details.
112#
113#   You should have received a copy of the GNU General Public License
114#   along with this program; if not, write to the Free Software
115#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
116#   02111-1307, USA.
117#
118#   As a special exception, the respective Autoconf Macro's copyright
119#   owner gives unlimited permission to copy, distribute and modify the
120#   configure scripts that are the output of Autoconf when processing
121#   the Macro. You need not follow the terms of the GNU General Public
122#   License when using or distributing such scripts, even though
123#   portions of the text of the Macro appear in them. The GNU General
124#   Public License (GPL) does govern all other use of the material that
125#   constitutes the Autoconf Macro.
126#
127#   This special exception to the GPL applies to versions of the
128#   Autoconf Macro released by the Autoconf Macro Archive. When you
129#   make and distribute a modified version of the Autoconf Macro, you
130#   may extend this special exception to the GPL to apply to your
131#   modified version as well.
132AC_DEFUN([AC_PROG_JAVAC],[
133AC_REQUIRE([AC_EXEEXT])dnl
134if test "x$JAVAPREFIX" = x
135then
136        test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, javac$EXEEXT, no)
137else
138        test "x$JAVAC" = x && AC_PATH_PROGS(JAVAC, javac$EXEEXT, no, $JAVAPREFIX)
139fi
140if test ! x$JAVAC = "xno"
141then
142 	AC_JAVAC_SUPPORTS_ENUMS
143fi
144AC_PROVIDE([$0])dnl
145])
146