1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
"http://www.w3.org/TR/html4/strict.dtd">
6
<title>Autoconf Macro: ac_prog_java_cc</title>
7
<link rel="stylesheet" type="text/css" href="ac-archive.css">
11
<table summary="web navigation" style="width:100%;">
14
<td style="width:50%;" align="center">[<a href="index.html">Macro Index
17
<td style="width:50%;" align="center">[<a href=
18
"../m4source/ac_prog_java_cc.m4">Download M4 Source</a>]</td>
24
<h1>ac_prog_java_cc</h1>
29
<p style="text-align:left; white-space:nowrap;">
30
<code>AC_PROG_JAVA_CC</code></p>
36
<p>Finds the appropriate java compiler on your path. By preference the java
37
compiler is gcj, then jikes then javac.</p>
39
<p>The macro can take one argument specifying a space separated list of
40
java compiler names.</p>
44
AC_PROG_JAVA_CC(javac, gcj)
47
<p>The macro also sets the compiler options variable: JAVA_CC_OPTS to
48
something sensible:</p>
50
- for GCJ it sets it to: @GCJ_OPTS@
51
(if GCJ_OPTS is not yet defined then it is set to "-C")
54
- no other compiler has applicable options yet
57
<p>Here's an example configure.in:</p>
65
<p>And here's the start of the Makefile.in:</p>
67
PROJECT_ROOT := @srcdir@
70
JAVAC_OPTS := @JAVA_CC_OPTS@
71
JAR_TOOL := @jar_tool@
78
<p>1.1 (last modified: 2002-03-04)</p>
84
<p>Nic Ferrier <nferrier@tapsellferrier.co.uk></p>
87
<h2>M4 Source Code</h2>
90
<pre class="m4source">
91
# AC_PROG_JAVA_CC([COMPILER ...])
92
# --------------------------
93
# COMPILER ... is a space separated list of java compilers to search for.
94
# This just gives the user an opportunity to specify an alternative
95
# search list for the java compiler.
96
AC_DEFUN([AC_PROG_JAVA_CC],
97
[AC_ARG_VAR([JAVA_CC], [java compiler command])dnl
98
AC_ARG_VAR([JAVA_CC_FLAGS], [java compiler flags])dnl
100
[AC_CHECK_TOOLS(JAVA_CC, [$1])],
101
[AC_CHECK_TOOL(JAVA_CC, gcj)
102
if test -z "$JAVA_CC"; then
103
AC_CHECK_TOOL(JAVA_CC, javac)
105
if test -z "$JAVA_CC"; then
106
AC_CHECK_TOOL(JAVA_CC, jikes)
110
if test "$JAVA_CC" = "gcj"; then
111
if test "$GCJ_OPTS" = ""; then
112
AC_SUBST(GCJ_OPTS,-C)
114
AC_SUBST(JAVA_CC_OPTS, @GCJ_OPTS@,
115
[Define the compilation options for GCJ])
117
test -z "$JAVA_CC" && AC_MSG_ERROR([no acceptable java compiler found in \$PATH])
125
<a href="COPYING.html">GNU General Public License</a> with this special
126
<a href="COPYING-Exception.html">exception</a>.