Build system: implement REUSE with SPDX identifiers
[lttng-ust.git] / m4 / ax_prog_java.m4
CommitLineData
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_java.html
5c5aae82
CB
5# ===========================================================================
6#
7# SYNOPSIS
8#
9# AX_PROG_JAVA
10#
11# DESCRIPTION
12#
13# Here is a summary of the main macros:
14#
15# AX_PROG_JAVAC: finds a Java compiler.
16#
17# AX_PROG_JAVA: finds a Java virtual machine.
18#
19# AX_CHECK_CLASS: finds if we have the given class (beware of CLASSPATH!).
20#
21# AX_CHECK_RQRD_CLASS: finds if we have the given class and stops
22# otherwise.
23#
24# AX_TRY_COMPILE_JAVA: attempt to compile user given source.
25#
26# AX_TRY_RUN_JAVA: attempt to compile and run user given source.
27#
28# AX_JAVA_OPTIONS: adds Java configure options.
29#
30# AX_PROG_JAVA tests an existing Java virtual machine. It uses the
31# environment variable JAVA then tests in sequence various common Java
32# virtual machines. For political reasons, it starts with the free ones.
33# You *must* call [AX_PROG_JAVAC] before.
34#
35# If you want to force a specific VM:
36#
37# - at the configure.in level, set JAVA=yourvm before calling AX_PROG_JAVA
38#
39# (but after AC_INIT)
40#
41# - at the configure level, setenv JAVA
42#
43# You can use the JAVA variable in your Makefile.in, with @JAVA@.
44#
45# *Warning*: its success or failure can depend on a proper setting of the
46# CLASSPATH env. variable.
47#
48# TODO: allow to exclude virtual machines (rationale: most Java programs
49# cannot run with some VM like kaffe).
50#
51# Note: This is part of the set of autoconf M4 macros for Java programs.
52# It is VERY IMPORTANT that you download the whole set, some macros depend
53# on other. Unfortunately, the autoconf archive does not support the
54# concept of set of macros, so I had to break it for submission.
55#
56# A Web page, with a link to the latest CVS snapshot is at
57# <http://www.internatif.org/bortzmeyer/autoconf-Java/>.
58#
59# This is a sample configure.in Process this file with autoconf to produce
60# a configure script.
61#
62# AC_INIT(UnTag.java)
63#
64# dnl Checks for programs.
65# AC_CHECK_CLASSPATH
66# AX_PROG_JAVAC
67# AX_PROG_JAVA
68#
69# dnl Checks for classes
70# AX_CHECK_RQRD_CLASS(org.xml.sax.Parser)
71# AX_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
72#
73# AC_OUTPUT(Makefile)
74#
75# LICENSE
76#
77# Copyright (c) 2008 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
78#
79# This program is free software; you can redistribute it and/or modify it
80# under the terms of the GNU General Public License as published by the
81# Free Software Foundation; either version 2 of the License, or (at your
82# option) any later version.
83#
84# This program is distributed in the hope that it will be useful, but
85# WITHOUT ANY WARRANTY; without even the implied warranty of
86# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
87# Public License for more details.
88#
89# You should have received a copy of the GNU General Public License along
e465639e 90# with this program. If not, see <https://www.gnu.org/licenses/>.
5c5aae82
CB
91#
92# As a special exception, the respective Autoconf Macro's copyright owner
93# gives unlimited permission to copy, distribute and modify the configure
94# scripts that are the output of Autoconf when processing the Macro. You
95# need not follow the terms of the GNU General Public License when using
96# or distributing such scripts, even though portions of the text of the
97# Macro appear in them. The GNU General Public License (GPL) does govern
98# all other use of the material that constitutes the Autoconf Macro.
99#
100# This special exception to the GPL applies to versions of the Autoconf
101# Macro released by the Autoconf Archive. When you make and distribute a
102# modified version of the Autoconf Macro, you may extend this special
103# exception to the GPL to apply to your modified version as well.
104
e465639e 105#serial 10
5c5aae82
CB
106
107AU_ALIAS([AC_PROG_JAVA], [AX_PROG_JAVA])
108AC_DEFUN([AX_PROG_JAVA],[
109m4_define([m4_ax_prog_java_list], [kaffe java])dnl
110AS_IF([test "x$JAVAPREFIX" = x],
111 [test x$JAVA = x && AC_CHECK_PROGS([JAVA], [m4_ax_prog_java_list])],
112 [test x$JAVA = x && AC_CHECK_PROGS([JAVA], [m4_ax_prog_java_list], [], [$JAVAPREFIX/bin])])
113test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
114m4_undefine([m4_ax_prog_java_list])dnl
115AX_PROG_JAVA_WORKS
116AC_PROVIDE([$0])dnl
117])
This page took 0.032335 seconds and 4 git commands to generate.