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

« back to all changes in this revision

Viewing changes to htmldoc/ac_check_class.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_check_class</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_check_class.m4">Download M4 Source</a>]</td>
 
19
      </tr>
 
20
    </tbody>
 
21
  </table>
 
22
  <hr>
 
23
 
 
24
  <h1>ac_check_class</h1>
 
25
 
 
26
  <h2>Synopsis</h2>
 
27
 
 
28
  <div class="indent">
 
29
    <p style="text-align:left; white-space:nowrap;">
 
30
    <code>AC_CHECK_CLASS</code></p>
 
31
  </div>
 
32
 
 
33
  <h2>Description</h2>
 
34
 
 
35
  <div class="indent">
 
36
    <p>AC_CHECK_CLASS tests the existence of a given Java class, either in a
 
37
    jar or in a '.class' file.</p>
 
38
 
 
39
    <p>*Warning*: its success or failure can depend on a proper setting of the
 
40
    CLASSPATH env. variable.</p>
 
41
 
 
42
    <p>Note: This is part of the set of autoconf M4 macros for Java programs.
 
43
    It is VERY IMPORTANT that you download the whole set, some macros depend on
 
44
    other. Unfortunately, the autoconf archive does not support the concept of
 
45
    set of macros, so I had to break it for submission. The general
 
46
    documentation, as well as the sample configure.in, is included in the
 
47
    AC_PROG_JAVA macro.</p>
 
48
  </div>
 
49
 
 
50
  <h2>Version</h2>
 
51
 
 
52
  <div class="indent">
 
53
    <p>1.2 (last modified: 2000-07-19)</p>
 
54
  </div>
 
55
 
 
56
  <h2>Author</h2>
 
57
 
 
58
  <div class="indent">
 
59
    <p>Stephane Bortzmeyer &lt;bortzmeyer@pasteur.fr&gt;</p>
 
60
  </div>
 
61
 
 
62
  <h2>M4 Source Code</h2>
 
63
 
 
64
  <div class="indent">
 
65
    <pre class="m4source">
 
66
AC_DEFUN([AC_CHECK_CLASS],[
 
67
AC_REQUIRE([AC_PROG_JAVA])
 
68
ac_var_name=`echo $1 | sed 's/\./_/g'`
 
69
dnl Normaly I'd use a AC_CACHE_CHECK here but since the variable name is
 
70
dnl dynamic I need an extra level of extraction
 
71
AC_MSG_CHECKING([for $1 class])
 
72
AC_CACHE_VAL(ac_cv_class_$ac_var_name, [
 
73
if test x$ac_cv_prog_uudecode_base64 = xyes; then
 
74
dnl /**
 
75
dnl  * Test.java: used to test dynamicaly if a class exists.
 
76
dnl  */
 
77
dnl public class Test
 
78
dnl {
 
79
dnl
 
80
dnl public static void
 
81
dnl main( String[] argv )
 
82
dnl {
 
83
dnl     Class lib;
 
84
dnl     if (argv.length &lt; 1)
 
85
dnl      {
 
86
dnl             System.err.println ("Missing argument");
 
87
dnl             System.exit (77);
 
88
dnl      }
 
89
dnl     try
 
90
dnl      {
 
91
dnl             lib = Class.forName (argv[0]);
 
92
dnl      }
 
93
dnl     catch (ClassNotFoundException e)
 
94
dnl      {
 
95
dnl             System.exit (1);
 
96
dnl      }
 
97
dnl     lib = null;
 
98
dnl     System.exit (0);
 
99
dnl }
 
100
dnl
 
101
dnl }
 
102
cat &lt;&lt; \EOF &gt; Test.uue
 
103
begin-base64 644 Test.class
 
104
yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
 
105
bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
 
106
bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ
 
107
AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt
 
108
ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV
 
109
ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp
 
110
VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM
 
111
amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi
 
112
AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B
 
113
AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA
 
114
AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN
 
115
uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK
 
116
AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA
 
117
JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA
 
118
JwAAAAIAKA==
 
119
====
 
120
EOF
 
121
                if uudecode$EXEEXT Test.uue; then
 
122
                        :
 
123
                else
 
124
                        echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" &gt;&amp;AC_FD_CC
 
125
                        echo "configure: failed file was:" &gt;&amp;AC_FD_CC
 
126
                        cat Test.uue &gt;&amp;AC_FD_CC
 
127
                        ac_cv_prog_uudecode_base64=no
 
128
                fi
 
129
        rm -f Test.uue
 
130
        if AC_TRY_COMMAND($JAVA $JAVAFLAGS Test $1) &gt;/dev/null 2&gt;&amp;1; then
 
131
                eval "ac_cv_class_$ac_var_name=yes"
 
132
        else
 
133
                eval "ac_cv_class_$ac_var_name=no"
 
134
        fi
 
135
        rm -f Test.class
 
136
else
 
137
        AC_TRY_COMPILE_JAVA([$1], , [eval "ac_cv_class_$ac_var_name=yes"],
 
138
                [eval "ac_cv_class_$ac_var_name=no"])
 
139
fi
 
140
eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
 
141
eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`"
 
142
HAVE_LAST_CLASS=$ac_var_val
 
143
if test x$ac_var_val = xyes; then
 
144
        ifelse([$2], , :, [$2])
 
145
else
 
146
        ifelse([$3], , :, [$3])
 
147
fi
 
148
])
 
149
dnl for some reason the above statment didn't fall though here?
 
150
dnl do scripts have variable scoping?
 
151
eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
 
152
AC_MSG_RESULT($ac_var_val)
 
153
])
 
154
</pre>
 
155
  </div>
 
156
 
 
157
  <h2>Copyright</h2>
 
158
 
 
159
  <div class="indent">
 
160
    <a href="COPYING.html">GNU General Public License</a> with this special
 
161
    <a href="COPYING-Exception.html">exception</a>.
 
162
  </div>
 
163
</body>
 
164
</html>