File: ac_prog_java_cc.html

package info (click to toggle)
autoconf-archive 20041123-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,336 kB
  • ctags: 2
  • sloc: makefile: 29
file content (129 lines) | stat: -rw-r--r-- 3,195 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>
  <title>Autoconf Macro: ac_prog_java_cc</title>
  <link rel="stylesheet" type="text/css" href="ac-archive.css">
</head>

<body>
  <table summary="web navigation" style="width:100%;">
    <tbody>
      <tr>
        <td style="width:50%;" align="center">[<a href="index.html">Macro Index
        Page</a>]</td>

        <td style="width:50%;" align="center">[<a href=
        "../m4source/ac_prog_java_cc.m4">Download M4 Source</a>]</td>
      </tr>
    </tbody>
  </table>
  <hr>

  <h1>ac_prog_java_cc</h1>

  <h2>Synopsis</h2>

  <div class="indent">
    <p style="text-align:left; white-space:nowrap;">
    <code>AC_PROG_JAVA_CC</code></p>
  </div>

  <h2>Description</h2>

  <div class="indent">
    <p>Finds the appropriate java compiler on your path. By preference the java
    compiler is gcj, then jikes then javac.</p>

    <p>The macro can take one argument specifying a space separated list of
    java compiler names.</p>

    <p>For example:</p>
    <pre>
  AC_PROG_JAVA_CC(javac, gcj)
</pre>

    <p>The macro also sets the compiler options variable: JAVA_CC_OPTS to
    something sensible:</p>
    <pre>
 - for GCJ it sets it to: @GCJ_OPTS@
   (if GCJ_OPTS is not yet defined then it is set to "-C")
</pre>
    <pre>
 - no other compiler has applicable options yet
</pre>

    <p>Here's an example configure.in:</p>
    <pre>
  AC_INIT(Makefile.in)
  AC_PROG_JAVA_CC()
  AC_OUTPUT(Makefile)
  dnl End.
</pre>

    <p>And here's the start of the Makefile.in:</p>
    <pre>
  PROJECT_ROOT      := @srcdir@
  # Tool definitions.
  JAVAC             := @JAVA_CC@
  JAVAC_OPTS        := @JAVA_CC_OPTS@
  JAR_TOOL          := @jar_tool@
</pre>
  </div>

  <h2>Version</h2>

  <div class="indent">
    <p>1.1 (last modified: 2002-03-04)</p>
  </div>

  <h2>Author</h2>

  <div class="indent">
    <p>Nic Ferrier &lt;nferrier@tapsellferrier.co.uk&gt;</p>
  </div>

  <h2>M4 Source Code</h2>

  <div class="indent">
    <pre class="m4source">
# AC_PROG_JAVA_CC([COMPILER ...])
# --------------------------
# COMPILER ... is a space separated list of java compilers to search for.
# This just gives the user an opportunity to specify an alternative
# search list for the java compiler.
AC_DEFUN([AC_PROG_JAVA_CC],
[AC_ARG_VAR([JAVA_CC],                [java compiler command])dnl
AC_ARG_VAR([JAVA_CC_FLAGS],           [java compiler flags])dnl
m4_ifval([$1],
      [AC_CHECK_TOOLS(JAVA_CC, [$1])],
[AC_CHECK_TOOL(JAVA_CC, gcj)
if test -z "$JAVA_CC"; then
  AC_CHECK_TOOL(JAVA_CC, javac)
fi
if test -z "$JAVA_CC"; then
  AC_CHECK_TOOL(JAVA_CC, jikes)
fi
])

if test "$JAVA_CC" = "gcj"; then
   if test "$GCJ_OPTS" = ""; then
      AC_SUBST(GCJ_OPTS,-C)
   fi
   AC_SUBST(JAVA_CC_OPTS, @GCJ_OPTS@,
        [Define the compilation options for GCJ])
fi
test -z "$JAVA_CC" &amp;&amp; AC_MSG_ERROR([no acceptable java compiler found in \$PATH])
])# AC_PROG_JAVA_CC
</pre>
  </div>

  <h2>Copyright</h2>

  <div class="indent">
    <a href="COPYING.html">GNU General Public License</a> with this special
    <a href="COPYING-Exception.html">exception</a>.
  </div>
</body>
</html>