~ubuntu-branches/ubuntu/hardy/autoconf-archive/hardy

« back to all changes in this revision

Viewing changes to htmldoc/ac_prog_java_cc.html

  • Committer: Bazaar Package Importer
  • Author(s): Martin A. Godisch
  • Date: 2004-06-26 09:43:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040626094357-3be3jwcz1vcdhpe8
Tags: upstream-20040616
ImportĀ upstreamĀ versionĀ 20040616

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
 
2
"http://www.w3.org/TR/html4/strict.dtd">
 
3
 
 
4
<html lang="en">
 
5
<head>
 
6
  <title>Autoconf Macro: ac_prog_java_cc</title>
 
7
  <link rel="stylesheet" type="text/css" href="ac-archive.css">
 
8
</head>
 
9
 
 
10
<body>
 
11
  <table summary="web navigation" style="width:100%;">
 
12
    <tbody>
 
13
      <tr>
 
14
        <td style="width:50%;" align="center">[<a href="index.html">Macro Index
 
15
        Page</a>]</td>
 
16
 
 
17
        <td style="width:50%;" align="center">[<a href=
 
18
        "../m4source/ac_prog_java_cc.m4">Download M4 Source</a>]</td>
 
19
      </tr>
 
20
    </tbody>
 
21
  </table>
 
22
  <hr>
 
23
 
 
24
  <h1>ac_prog_java_cc</h1>
 
25
 
 
26
  <h2>Synopsis</h2>
 
27
 
 
28
  <div class="indent">
 
29
    <p style="text-align:left; white-space:nowrap;">
 
30
    <code>AC_PROG_JAVA_CC</code></p>
 
31
  </div>
 
32
 
 
33
  <h2>Description</h2>
 
34
 
 
35
  <div class="indent">
 
36
    <p>Finds the appropriate java compiler on your path. By preference the java
 
37
    compiler is gcj, then jikes then javac.</p>
 
38
 
 
39
    <p>The macro can take one argument specifying a space separated list of
 
40
    java compiler names.</p>
 
41
 
 
42
    <p>For example:</p>
 
43
    <pre>
 
44
  AC_PROG_JAVA_CC(javac, gcj)
 
45
</pre>
 
46
 
 
47
    <p>The macro also sets the compiler options variable: JAVA_CC_OPTS to
 
48
    something sensible:</p>
 
49
    <pre>
 
50
 - for GCJ it sets it to: @GCJ_OPTS@
 
51
   (if GCJ_OPTS is not yet defined then it is set to "-C")
 
52
</pre>
 
53
    <pre>
 
54
 - no other compiler has applicable options yet
 
55
</pre>
 
56
 
 
57
    <p>Here's an example configure.in:</p>
 
58
    <pre>
 
59
  AC_INIT(Makefile.in)
 
60
  AC_PROG_JAVA_CC()
 
61
  AC_OUTPUT(Makefile)
 
62
  dnl End.
 
63
</pre>
 
64
 
 
65
    <p>And here's the start of the Makefile.in:</p>
 
66
    <pre>
 
67
  PROJECT_ROOT      := @srcdir@
 
68
  # Tool definitions.
 
69
  JAVAC             := @JAVA_CC@
 
70
  JAVAC_OPTS        := @JAVA_CC_OPTS@
 
71
  JAR_TOOL          := @jar_tool@
 
72
</pre>
 
73
  </div>
 
74
 
 
75
  <h2>Version</h2>
 
76
 
 
77
  <div class="indent">
 
78
    <p>1.1 (last modified: 2002-03-04)</p>
 
79
  </div>
 
80
 
 
81
  <h2>Author</h2>
 
82
 
 
83
  <div class="indent">
 
84
    <p>Nic Ferrier &lt;nferrier@tapsellferrier.co.uk&gt;</p>
 
85
  </div>
 
86
 
 
87
  <h2>M4 Source Code</h2>
 
88
 
 
89
  <div class="indent">
 
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
 
99
m4_ifval([$1],
 
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)
 
104
fi
 
105
if test -z "$JAVA_CC"; then
 
106
  AC_CHECK_TOOL(JAVA_CC, jikes)
 
107
fi
 
108
])
 
109
 
 
110
if test "$JAVA_CC" = "gcj"; then
 
111
   if test "$GCJ_OPTS" = ""; then
 
112
      AC_SUBST(GCJ_OPTS,-C)
 
113
   fi
 
114
   AC_SUBST(JAVA_CC_OPTS, @GCJ_OPTS@,
 
115
        [Define the compilation options for GCJ])
 
116
fi
 
117
test -z "$JAVA_CC" &amp;&amp; AC_MSG_ERROR([no acceptable java compiler found in \$PATH])
 
118
])# AC_PROG_JAVA_CC
 
119
</pre>
 
120
  </div>
 
121
 
 
122
  <h2>Copyright</h2>
 
123
 
 
124
  <div class="indent">
 
125
    <a href="COPYING.html">GNU General Public License</a> with this special
 
126
    <a href="COPYING-Exception.html">exception</a>.
 
127
  </div>
 
128
</body>
 
129
</html>