/[gnu-crypto]/gnu-crypto/acinclude.m4
ViewVC logotype

Contents of /gnu-crypto/acinclude.m4

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Sat Sep 27 16:47:40 2003 UTC (20 years, 6 months ago) by rsdio
Branch: MAIN
Branch point for: stable-2-0
Changes since 1.10: +641 -2 lines
2003-09-27  Casey Marshall <rsdio@metastatic.org>

	* acinclude.m4: added new java macros.

1 # ----------------------------------------------------------------------------
2 # $Id: acinclude.m4,v 1.10 2003/05/10 18:14:06 raif Exp $
3 #
4 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
5 #
6 # This file is part of GNU Crypto.
7 #
8 # GNU Crypto is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12 #
13 # GNU Crypto is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; see the file COPYING. If not, write to the
20 #
21 # Free Software Foundation Inc.,
22 # 59 Temple Place - Suite 330,
23 # Boston, MA 02111-1307
24 # USA
25 #
26 # Linking this library statically or dynamically with other modules is
27 # making a combined work based on this library. Thus, the terms and
28 # conditions of the GNU General Public License cover the whole
29 # combination.
30 #
31 # As a special exception, the copyright holders of this library give
32 # you permission to link this library with independent modules to
33 # produce an executable, regardless of the license terms of these
34 # independent modules, and to copy and distribute the resulting
35 # executable under terms of your choice, provided that you also meet,
36 # for each linked independent module, the terms and conditions of the
37 # license of that module. An independent module is a module which is
38 # not derived from or based on this library. If you modify this
39 # library, you may extend this exception to your version of the
40 # library, but you are not obligated to do so. If you do not wish to
41 # do so, delete this exception statement from your version.
42 # ----------------------------------------------------------------------------
43 #
44 # GNU Crypto m4 macros for auto-configuration
45 #
46 # This file is an input to aclocal which generates aclocal.m4, which in turn,
47 # is an input to autoconf which generates the ./configure script.
48 #
49 # $Revision: 1.10 $
50 #
51
52 # process --with-java configure option.
53 # test if a Java bytecode interpreter is available, and if yes set in
54 # JAVA_BIN_PATH the path to the executable, and in
55 # JAVA_RT_JAR the path to the runtime jar (needed by jikes and similar).
56 # -----------------------------------------------------------------------------
57 AC_DEFUN([_GNU_CRYPTO_WHICH_JAVA],[
58 AC_ARG_WITH([java],
59 AC_HELP_STRING([--with-java@<:@=ARG@:>@],
60 [use Java for bytecode interpretation, and optionally the path where to find it]),
61 [if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
62 _GNU_CRYPTO_CHECK_JAVA(${withval})
63 elif test "x${withval}" != xno; then
64 _GNU_CRYPTO_CHECK_JAVA
65 fi],
66 [_GNU_CRYPTO_CHECK_JAVA])
67 AM_CONDITIONAL(FOUND_JAVA, test "x${JAVA}" != x)
68 AC_SUBST(JAVA)
69 JAVA_BIN_PATH=`AS_DIRNAME([$JAVA])`
70 if test -r ${JAVA_BIN_PATH}/../jre/lib/rt.jar ; then
71 JAVA_RT_JAR=${JAVA_BIN_PATH}/../jre/lib/rt.jar
72 AC_SUBST(JAVA_RT_JAR)
73 fi
74 AC_SUBST(JAVA_BIN_PATH)
75 ])# _GNU_CRYPTO_WHICH_JAVA
76
77
78 # a wrapper around AC_PATH_PROG to check for the accessibility of a Java
79 # bytecode interpreter.
80 # may be invoked without or with one argument. when invoked with no arguments
81 # the executable 'java' (supposedly accessible from PATH directories) is used
82 # as the argument to AC_PATH_PROG.
83 # if the Java bytecode interpreter is found, this macro checks the version of
84 # that interpreter, in order to set the conditional WITH_BREAKITERATOR which
85 # needed to specify correct parameters to the 'javadoc' tool. this assumes
86 # (a) the bytecode interpreter is the sun's one, or (b) the substitute tools
87 # closely mimic sun's tools behaviour.
88 # -----------------------------------------------------------------------------
89 AC_DEFUN([_GNU_CRYPTO_CHECK_JAVA],[
90 if test "x$1" != x; then
91 if test -f "$1"; then
92 JAVA="$1"
93 else
94 AC_PATH_PROG(JAVA, "$1")
95 fi
96 else
97 AC_PATH_PROG(JAVA, "java")
98 fi
99
100 if test "x$JAVA" != x; then
101 AC_MSG_CHECKING(for java version)
102 JAVA_VERSION=`$JAVA -version 2>&1 | head -1 | cut -d '"' -f 2`
103 JAVA_VERSION_MAJOR=`echo $JAVA_VERSION | cut -d '.' -f 1`
104 JAVA_VERSION_MINOR=`echo $JAVA_VERSION | cut -d '.' -f 2`
105 AC_MSG_RESULT($JAVA_VERSION)
106
107 AC_MSG_CHECKING(wether javadoc uses -breakiterator)
108 if (expr "$JAVA_VERSION_MAJOR" \> 0 >/dev/null ) && (expr "$JAVA_VERSION_MINOR" \> 3 >/dev/null); then
109 AC_MSG_RESULT([yes])
110 else
111 AC_MSG_RESULT([no])
112 fi
113 fi
114 AM_CONDITIONAL(WITH_BREAKITERATOR, (expr "$JAVA_VERSION_MAJOR" \> 0 >/dev/null) && (expr "$JAVA_VERSION_MINOR" \> 3 >/dev/null))[]dnl
115 ])# _GNU_CRYPTO_CHECK_JAVA
116
117 # =============================================================================
118
119 # process --with-classpath configure option.
120 # test if the GNU Classpath package is installed. if no argument was specified
121 # with the option, this macro looks for a 'share/classpath/glibj.zip' file and
122 # a 'lib/classpath/libjavalang.so' in the following places, in this order:
123 # /usr/local/classpath, /usr/local, /usr, /opt/classpath, and /opt. otherwise
124 # those two files are looked up under the designated location.
125 # if glibj.zip is found, GLIBJ_ZIP shall contain its path.
126 # -----------------------------------------------------------------------------
127 AC_DEFUN([_GNU_CRYPTO_WITH_CLASSPATH],[
128 AC_ARG_WITH([classpath],
129 AC_HELP_STRING([--with-classpath],
130 [path to GNU Classpath install directory. if unspecified, /usr/local/classpath, /usr/local, /usr, /opt/classpath, and /opt are considered, in that order]),
131
132 [if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
133 AC_MSG_CHECKING([${withval}])
134 _GNU_CRYPTO_CHECK_CLASSPATH(${withval})
135 if test x$GNU_CLASSPATH_INSTALL_DIR = x ; then
136 AC_MSG_RESULT(no)
137 AC_MSG_ERROR([cannot find designated GNU Classpath install directory])
138 else
139 AC_MSG_RESULT(yes)
140 with_classpath=true
141 fi
142 elif test "x${withval}" != xno; then
143 AC_MSG_NOTICE([no value supplied --with-classpath. will look in default locations])
144 _GNU_CRYPTO_FIND_GNU_CLASSPATH([/usr/local/classpath /usr/local /usr /opt/classpath /opt])
145 if test x$GNU_CLASSPATH_INSTALL_DIR = x ; then
146 AC_MSG_ERROR([cannot find GNU Classpath install directory: install it and/or specify its location using --with-classpath])
147 fi
148 with_classpath=true
149 else
150 with_classpath=false
151 fi],
152 [with_classpath=false])
153 GNU_CLASSPATH_INSTALL_DIR=`(cd ${GNU_CLASSPATH_INSTALL_DIR}; pwd)`
154 AC_SUBST(GNU_CLASSPATH_INSTALL_DIR)
155 if test -r ${GNU_CLASSPATH_INSTALL_DIR}/share/classpath/glibj.zip ; then
156 GLIBJ_ZIP=${GNU_CLASSPATH_INSTALL_DIR}/share/classpath/glibj.zip
157 AC_SUBST(GLIBJ_ZIP)
158 fi
159 AM_CONDITIONAL(USER_WANT_CLASSPATH, test "x${with_classpath}" = xtrue)
160 ])# _GNU_CRYPTO_WITH_CLASSPATH
161
162
163 # given a list of arguments, this macro tries repeatedly and for each element
164 # of the input list, to (a) assert that the argument is indeed a directory, and
165 # (b) it contains under it both 'lib/classpath/libjavalang.so' and
166 # 'share/classpath/glibj.zip' files.
167 # -----------------------------------------------------------------------------
168 AC_DEFUN(_GNU_CRYPTO_FIND_GNU_CLASSPATH,[
169 AC_MSG_CHECKING([for GNU Classpath installation directory])
170 for _F in $1 ; do
171 _GNU_CRYPTO_CHECK_CLASSPATH(${_F})
172 if test x$GNU_CLASSPATH_INSTALL_DIR != x ; then
173 break
174 fi
175 done
176 if test x${GNU_CLASSPATH_INSTALL_DIR} = x ; then
177 AC_MSG_RESULT([not found])
178 else
179 AC_MSG_RESULT([${GNU_CLASSPATH_INSTALL_DIR}])
180 fi])# _GNU_CRYPTO_FIND_GNU_CLASSPATH
181
182
183 # given a directory as an input, this macro checks if the two files
184 # 'lib/classpath/libjavalang.so' and 'share/classpath/glibj.zip' exist under
185 # it. if they do, then GNU_CLASSPATH_INSTALL_DIR is set to that argument.
186 # -----------------------------------------------------------------------------
187 AC_DEFUN([_GNU_CRYPTO_CHECK_CLASSPATH],
188 [if test -r $1/lib/classpath/libjavalang.so && test -r $1/share/classpath/glibj.zip ; then
189 GNU_CLASSPATH_INSTALL_DIR=$1
190 fi])# _GNU_CRYPTO_CHECK_CLASSPATH
191
192 # =============================================================================
193
194 # check user preferences for the bytecode compiler to use.
195 # user preferences may be defined with --with-xxx style configure options.
196 # those of interest to this macro are:
197 #
198 # --with-gcj=...
199 # --with-jikes=...
200 # --with-javac=...
201 #
202 # each of the above options may be (a) empty, (b) equal to 'yes' or 'no', or
203 # (c) points to the location of the executable of that compiler.
204 # when the option is specified with no value, default locations are searched
205 # for the executable to ensure they can be used. if more than one are
206 # specified, GCJ is picked before Jikes, which is picked before Javac.
207 # the first thing this macro does is invoke the _GNU_CRYPTO_WHICH JAVA and the
208 # _GNU_CRYPTO_WITH_CLASSPATH macros. this is to ensure that a proper runtime
209 # jar can be used if the chosen compiler needs it.
210 # it then checks the arguments for each option in turn, setting a USER_WANT_xxx
211 # if a positive definition of the corresponding --with-xxx was specified.
212 # finally the USE_xxx conditionals are set if configure is able to locate the
213 # appropriate binary.
214 # -----------------------------------------------------------------------------
215 AC_DEFUN([GNU_CRYPTO_WHICH_JAVAC],[
216 _GNU_CRYPTO_WHICH_JAVA
217 _GNU_CRYPTO_WITH_CLASSPATH
218
219 user_specified_compiler=_GNU_CRYPTO_WITH_GCJ _GNU_CRYPTO_WITH_JIKES _GNU_CRYPTO_WITH_JAVAC
220
221 AM_CONDITIONAL(USER_WANT_GCJ, test "x${user_specified_compiler}" = xgcj)
222 AM_CONDITIONAL(USER_WANT_JIKES, test "x${user_specified_compiler}" = xjikes)
223 AM_CONDITIONAL(USER_WANT_JAVAC, test "x${user_specified_compiler}" = xjavac)
224
225 # sanity check
226 _GNU_CRYPTO_ENSURE_GCJ
227 AM_CONDITIONAL(USE_GCJ, test "x${selected_compiler}" = xgcj)
228 AM_CONDITIONAL(USE_JIKES, test "x${selected_compiler}" = xjikes)
229 AM_CONDITIONAL(USE_JAVAC, test "x${selected_compiler}" = xjavac)
230
231 AM_CONDITIONAL(FOUND_GCJ, test "x${GCJ}" != x)
232 AM_CONDITIONAL(FOUND_JIKES, test "x${JIKES}" != x)
233 AM_CONDITIONAL(FOUND_JAVAC, test "x${JAVAC}" != x)
234 ])# _GNU_CRYPTO_WHICH_JAVAC
235
236
237 AC_DEFUN([_GNU_CRYPTO_ENSURE_GCJ],[
238 if test "x${user_specified_compiler}" = xgcj || test "x${user_specified_compiler}" = x ; then
239 if test "x${GCJ}" != x; then
240 AC_MSG_NOTICE([will use GCJ for bytecode compilation])
241 selected_compiler=gcj
242 else
243 AC_MSG_NOTICE([GCJ specified but not found. Will try with Jikes])
244 user_specified_compiler=jikes
245 _GNU_CRYPTO_ENSURE_JIKES
246 fi
247 else
248 _GNU_CRYPTO_ENSURE_JIKES
249 fi])# _GNU_CRYPTO_ENSURE_GCJ
250
251
252 AC_DEFUN([_GNU_CRYPTO_ENSURE_JIKES],[
253 if test "x${user_specified_compiler}" = xjikes; then
254 if test "x${JIKES}" != x; then
255 # cannot use jikes without either glibj.zip or rt.jar
256 if test "x${GLIBJ_ZIP}" != x || test "x${JAVA_RT_JAR}" != x; then
257 AC_MSG_NOTICE([will use Jikes for bytecode compilation])
258 selected_compiler=jikes
259 else
260 AC_MSG_NOTICE([Jikes specified but runtime classes not found. Will try with Javac])
261 _GNU_CRYPTO_ENSURE_JAVAC
262 fi
263 else
264 AC_MSG_NOTICE([Jikes specified but not found. Will try with Javac])
265 _GNU_CRYPTO_ENSURE_JAVAC
266 fi
267 else
268 _GNU_CRYPTO_ENSURE_JAVAC
269 fi])# GNU_CRYPTO_ENSURE_JIKES
270
271
272 AC_DEFUN([_GNU_CRYPTO_ENSURE_JAVAC],[
273 if test "x${JAVAC}" != x; then
274 AC_MSG_NOTICE([will use Javac for bytecode compilation])
275 selected_compiler=javac
276 else # user wants nothing; back-track
277 if test "x${GCJ}" != x; then
278 AC_MSG_NOTICE([will use GCJ for bytecode compilation])
279 selected_compiler=gcj
280 else
281 if test "x${JIKES}" != x; then
282 # cannot use jikes without either glibj.zip or rt.jar
283 if test "x${GLIBJ_ZIP}" != x || test "x${JAVA_RT_JAR}" != x; then
284 AC_MSG_NOTICE([will use Jikes for bytecode compilation])
285 selected_compiler=jikes
286 else
287 AC_MSG_NOTICE([cannot find a runtime library for use with Jikes])
288 _GNU_CRYPTO_NO_COMPILER
289 fi
290 else
291 _GNU_CRYPTO_NO_COMPILER
292 fi
293 fi
294 fi])# _GNU_CRYPTO_ENSURE_JAVAC
295
296
297 AC_DEFUN([_GNU_CRYPTO_NO_COMPILER],[
298 AC_MSG_NOTICE([cannot find a suitable java bytecode compiler])
299 AC_MSG_ERROR([try --with-gcj[[=ARG]], --with-jikes[[=ARG]], or --with-javac[[=ARG]]], 1)
300 ])# _GNU_CRYPTO_NO_COMPILER
301
302
303 AC_DEFUN([_GNU_CRYPTO_WITH_GCJ],[
304 AC_ARG_WITH([gcj],
305 AC_HELP_STRING([--with-gcj@<:@=ARG@:>@],
306 [use GCJ for bytecode compilation, and optionally the path where to find it @<:@ARG=yes@:>@]),
307 [if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
308 user_specified_compiler=gcj
309 _GNU_CRYPTO_CHECK_GCJ(${withval})
310 elif test "x${withval}" != xno; then
311 user_specified_compiler=gcj
312 _GNU_CRYPTO_CHECK_GCJ
313 else
314 user_specified_compiler=
315 fi],
316 [_GNU_CRYPTO_CHECK_GCJ])
317 AM_CONDITIONAL(FOUND_GCJ, test "x${GCJ}" != x)
318 AC_SUBST(GCJ)
319 ])# _GNU_CRYPTO_WITH_GCJ
320
321
322 AC_DEFUN([_GNU_CRYPTO_CHECK_GCJ],[
323 if test "x$1" != x; then
324 if test -f "$1"; then
325 GCJ="$1"
326 else
327 AC_PATH_PROG(GCJ, "$1")
328 fi
329 else
330 AC_PATH_PROG(GCJ, "gcj")
331 fi
332 if test "x$GCJ" != x; then
333 AC_MSG_CHECKING(gcj version)
334 GCJ_VERSION=`$GCJ --version`
335 GCJ_VERSION_MAJOR=`echo "$GCJ_VERSION" | cut -d '.' -f 1`
336 GCJ_VERSION_MINOR=`echo "$GCJ_VERSION" | cut -d '.' -f 2`
337 if expr "$GCJ_VERSION_MAJOR" \< 3 > /dev/null; then
338 GCJ=""
339 fi
340 if expr "$GCJ_VERSION_MAJOR" = 3 > /dev/null; then
341 if expr "$GCJ_VERSION_MINOR" \< 1; then
342 GCJ=""
343 fi
344 fi
345 if test "x$GCJ" != x; then
346 AC_MSG_RESULT($GCJ_VERSION)
347 AM_PROG_GCJ
348 else
349 AC_MSG_WARN($GCJ_VERSION: gcj 3.1 or higher required)
350 fi
351 fi])# _GNU_CRYPTO_CHECK_GCJ
352
353
354 AC_DEFUN([_GNU_CRYPTO_WITH_JIKES],[
355 AC_ARG_WITH([jikes],
356 AC_HELP_STRING([--with-jikes@<:@=ARG@:>@],
357 [use Jikes for bytecode compilation, and optionally the path where to find it @<:@ARG=no@:>@]),
358 [if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
359 user_specified_compiler=jikes
360 _GNU_CRYPTO_CHECK_JIKES(${withval})
361 elif test "x${withval}" != xno; then
362 user_specified_compiler=jikes
363 _GNU_CRYPTO_CHECK_JIKES
364 else
365 user_specified_compiler=
366 fi],
367 [_GNU_CRYPTO_CHECK_JIKES])
368 AM_CONDITIONAL(FOUND_JIKES, test "x${JIKES}" != x)
369 AC_SUBST(JIKES)
370 ])# _GNU_CRYPTO_WITH_JIKES
371
372
373 AC_DEFUN([_GNU_CRYPTO_CHECK_JIKES],[
374 if test "x$1" != x; then
375 if test -f "$1"; then
376 JIKES="$1"
377 else
378 AC_PATH_PROG(JIKES, "$1")
379 fi
380 else
381 AC_PATH_PROG(JIKES, "jikes")
382 fi])# _GNU_CRYPTO_CHECK_JIKES
383
384
385 AC_DEFUN([_GNU_CRYPTO_WITH_JAVAC],[
386 AC_ARG_WITH([javac],
387 AC_HELP_STRING([--with-javac@<:@=ARG@:>@],
388 [use Javac for bytecode compilation, and optionally the path where to find it @<:@ARG=no@:>@]),
389 [if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
390 user_specified_compiler=javac
391 _GNU_CRYPTO_CHECK_JAVAC(${withval})
392 elif test "x${withval}" != xno; then
393 user_specified_compiler=javac
394 _GNU_CRYPTO_CHECK_JAVAC
395 else
396 user_specified_compiler=
397 fi],
398 [_GNU_CRYPTO_CHECK_JAVAC])
399 AM_CONDITIONAL(FOUND_JAVAC, test "x${JAVAC}" != x)
400 AC_SUBST(JAVAC)
401 ])# _GNU_CRYPTO_WITH_JAVAC
402
403
404 AC_DEFUN([_GNU_CRYPTO_CHECK_JAVAC],[
405 if test "x$1" != x; then
406 if test -f "$1"; then
407 JAVAC="$1"
408 else
409 AC_PATH_PROG(JAVAC, "$1")
410 fi
411 else
412 AC_PATH_PROG(JAVAC, "javac")
413 fi])# _GNU_CRYPTO_CHECK_JAVAC
414
415 # =============================================================================
416
417 AC_DEFUN([_GNU_CRYPTO_WITH_JCE_JAR],[
418 AC_ARG_WITH([jce_jar],
419 AC_HELP_STRING([--with-jce-jar=DIR],
420 [path to JCE framework classes (javax.crypto) jar. if unspecified, /usr/local/jce/share, /usr/local/share, /usr/share, /opt/jce/share, and /opt/share are considered, in that order; unless --with-jce is specified]),
421 [if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then
422 AC_MSG_CHECKING([for ${withval}])
423 if test -r ${withval} ; then
424 AC_MSG_RESULT(yes)
425 JCE_JAR=${withval}
426 found_jce_jar=true
427 else
428 AC_MSG_ERROR([cannot find indicated JCE jar])
429 fi
430 elif test "x${withval}" != xno; then
431 AC_MSG_NOTICE([no value supplied --with-jce-jar. will look in default locations])
432 _GNU_CRYPTO_FIND_JCE_JAR([/usr/local/jce /usr/local /usr /opt/jce /opt])
433 if test x$JCE_JAR = x ; then
434 AC_MSG_ERROR([cannot find JCE jar; specify its location using --with-jce-jar])
435 fi
436 INCLUDE_FOR_MAUVE_JCE=""
437 found_jce_jar=true
438 else
439 JCE_JAR=""
440 INCLUDE_FOR_MAUVE_JCE="!"
441 found_jce_jar=false
442 fi],
443 [JCE_JAR=""
444 INCLUDE_FOR_MAUVE_JCE="!"
445 found_jce_jar=false])
446 AM_CONDITIONAL(FOUND_JCE_JAR, test "x${found_jce_jar}" = xtrue)
447 AC_SUBST(JCE_JAR)
448 AC_SUBST(INCLUDE_FOR_MAUVE_JCE)
449 ])# _GNU_CRYPTO_WITH_JCE_JAR
450
451
452 AC_DEFUN(_GNU_CRYPTO_FIND_JCE_JAR,[
453 AC_MSG_CHECKING([for JCE jar])
454 for _F in $1 ; do
455 _GNU_CRYPTO_CHECK_JCE_JAR(${_F})
456 if test x$JCE_JAR != x ; then
457 break
458 fi
459 done
460 if test x${JCE_JAR} = x ; then
461 AC_MSG_RESULT([not found])
462 else
463 AC_MSG_RESULT([${JCE_JAR}])
464 fi])# _GNU_CRYPTO_FIND_JCE_JAR
465
466
467 AC_DEFUN([_GNU_CRYPTO_CHECK_JCE_JAR],
468 [if test -r $1/share/javax-crypto.jar ; then
469 JCE_JAR=$1/share/javax-crypto.jar
470 fi])# _GNU_CRYPTO_CHECK_JCE_JAR
471
472
473 # macros copied from Mauve project's configure.in and acinclude.m4
474 # -----------------------------------------------------------------------------
475
476 # Designate the temporary directory to use by Mauve
477 AC_DEFUN(GNU_CRYPTO_WITH_TMPDIR,[
478 AC_ARG_WITH([tmpdir],
479 AC_HELP_STRING([--with-tmpdir=DIR],
480 [put temporary files in DIR @<:@/tmp@:>@]),
481 TMPDIR="$with_tmpdir",
482 TMPDIR=/tmp)
483 AC_SUBST(TMPDIR)
484 ])# GNU_CRYPTO_WITH_TMPDIR
485
486
487 # -----------------------------------------------------------
488 # Original by Mark Elbrecht <snowball3@bigfoot.com>
489 # Modified by Brian Jones <cbj@gnu.org> for Mauve
490 # acx_check_pathname_style.m4
491 # http://research.cys.de/autoconf-archive/
492
493 AC_DEFUN(ACX_CHECK_PATHNAME_STYLE_DOS,[
494 AC_MSG_CHECKING([for Windows and DOS and OS/2 style pathnames])
495 AC_CACHE_VAL([acx_cv_pathname_style_dos],[
496 AC_REQUIRE([AC_CANONICAL_HOST])
497 acx_cv_pathname_style_dos="no"
498 case ${host_os} in
499 *djgpp | *mingw32* | *emx*) acx_cv_pathname_style_dos="yes" ;;
500 esac])
501 AC_MSG_RESULT([$acx_cv_pathname_style_dos])
502 if test "$acx_cv_pathname_style_dos" = "yes"; then
503 AC_DEFINE([HAVE_PATHNAME_STYLE_DOS],[],[defined if running on a system with dos style paths])
504 CHECK_PATH_SEPARATOR=';'
505 CHECK_FILE_SEPARATOR='\\'
506 else
507 CHECK_PATH_SEPARATOR=':'
508 CHECK_FILE_SEPARATOR='/'
509 fi
510 AC_SUBST(CHECK_PATH_SEPARATOR)
511 AC_SUBST(CHECK_FILE_SEPARATOR)
512 ])
513
514 # =============================================================================
515
516 AC_DEFUN([GNU_CRYPTO_WITH_JCE],[
517 AC_ARG_WITH([jce],
518 AC_HELP_STRING([--with-jce@<:@=ARG@:>@ ],
519 [build the Java Cryptography Extension (JCE) as a shared library @<:@ARG=yes@:>@. If this option is specified then --with-jce-jar is ignored]),
520 [case "${withval}" in
521 yes) with_jce=yes ;;
522 no) with_jce=no ;;
523 *) AC_MSG_ERROR([bad value ${withval} for --with-jce]) ;;
524 esac],
525 [with_jce=yes])
526 AM_CONDITIONAL(WITH_JCE, test "x${with_jce}" = xyes)
527 if test "x${with_jce}" = xyes; then
528 JCE_JAR="`pwd`/jce/javax-crypto.jar"
529 INCLUDE_FOR_MAUVE_JCE=""
530 found_jce_jar=true
531
532 AM_CONDITIONAL(FOUND_JCE_JAR, test "x${found_jce_jar}" = xtrue)
533 AC_SUBST(JCE_JAR)
534 AC_SUBST(INCLUDE_FOR_MAUVE_JCE)
535 else
536 _GNU_CRYPTO_WITH_JCE_JAR
537 fi])# GNU_CRYPTO_WITH_JCE
538
539 # =============================================================================
540
541 # process --with-sasl configure option.
542 # test if building the javax.security.sasl and javax.security.auth.callback
543 # extensions is desired, or not. possible values are 'yes' or 'no' with the
544 # default being 'yes' i.e. build such a shared library.
545 # -----------------------------------------------------------------------------
546 AC_DEFUN([GNU_CRYPTO_WITH_SASL],[
547 AC_ARG_WITH([sasl],
548 AC_HELP_STRING([--with-sasl@<:@=ARG@:>@ ],
549 [build the Java SASL and Callback Extensions in a shared library @<:@ARG=yes@:>@]),
550 [case "${withval}" in
551 yes) with_sasl=yes ;;
552 no) with_sasl=no ;;
553 *) AC_MSG_ERROR([bad value ${withval} for --with-sasl]) ;;
554 esac],
555 [with_sasl=yes])
556 AM_CONDITIONAL(WITH_SASL, test "x${with_sasl}" = xyes)
557 if test "x${with_sasl}" = xyes; then
558 SASL_JAR="`pwd`/security/javax-security.jar"
559 found_sasl_jar=true
560 else
561 SASL_JAR=""
562 found_sasl_jar=false
563 fi
564 AM_CONDITIONAL(FOUND_SASL_JAR, test "x${found_sasl_jar}" = xtrue)
565 AC_SUBST(SASL_JAR)])# GNU_CRYPTO_WITH_SASL
566
567 # ==============================================================================
568
569 # set configured compiler options.
570 # ------------------------------------------------------------------------------
571 AC_DEFUN([GNU_CRYPTO_SET_COMPILE_OPTS],[
572 AM_GCJFLAGS="--encoding=UTF-8 -fassume-compiled"
573 if test -z "${FOUND_JCE_JAR_TRUE}" ; then
574 if test -z "${FOUND_SASL_JAR_TRUE}" ; then
575 AM_GCJFLAGS="${AM_GCJFLAGS} --classpath=\${JCE_JAR}\${PATH_SEPARATOR}\${SASL_JAR}\${PATH_SEPARATOR}.\${PATH_SEPARATOR}\${srcdir}"
576 else
577 AM_GCJFLAGS="${AM_GCJFLAGS} --classpath=\${JCE_JAR}\${PATH_SEPARATOR}.\${PATH_SEPARATOR}\${srcdir}"
578 fi # FOUND_SASL_JAR
579 else
580 if test -z "${FOUND_SASL_JAR_TRUE}" ; then
581 AM_GCJFLAGS="${AM_GCJFLAGS} --classpath=\${SASL_JAR}\${PATH_SEPARATOR}.\${PATH_SEPARATOR}\${srcdir}"
582 else
583 AM_GCJFLAGS="${AM_GCJFLAGS} --classpath=.\${PATH_SEPARATOR}\${srcdir}"
584 fi #FOUND_SASL_JAR
585 fi # FOUND_JCE_JAR
586 AC_SUBST(AM_GCJFLAGS)
587
588 JIKESFLAGS="-bootclasspath"
589 if test -z "${USER_WANT_GCJ_TRUE}" ; then
590 JIKESFLAGS="${JIKESFLAGS} \$(GLIBJ_ZIP)\$(PATH_SEPARATOR)\$(JCE_JAR)"
591 else
592 if test -z "${FOUND_JAVAC_TRUE}" ; then
593 JIKESFLAGS="${JIKESFLAGS} \$(JAVA_RT_JAR)\$(PATH_SEPARATOR)\$(JCE_JAR)"
594 else
595 JIKESFLAGS="${JIKESFLAGS} \$(GLIBJ_ZIP)\$(PATH_SEPARATOR)\$(JCE_JAR)"
596 fi
597 fi
598 JIKESFLAGS="${JIKESFLAGS} -target 1.1 +F -extdirs '' -sourcepath \$(srcdir)"
599 if test -z "${FOUND_SASL_JAR_TRUE}" ; then
600 JIKESFLAGS="${JIKESFLAGS} -classpath \$(SASL_JAR)\$(PATH_SEPARATOR). "
601 else
602 JIKESFLAGS="${JIKESFLAGS} -classpath . "
603 fi # FOUND_SASL_JAR
604 AC_SUBST(JIKESFLAGS)
605
606 JAVACFLAGS="-sourcepath \$(srcdir)"
607 if test -z "${FOUND_JCE_JAR_TRUE}" ; then
608 JAVACFLAGS="${JAVACFLAGS} -bootclasspath \$(JCE_JAR)\$(PATH_SEPARATOR)\$(JAVA_RT_JAR)"
609 fi
610 if test -z "${FOUND_SASL_JAR_TRUE}" ; then
611 JAVACFLAGS="${JAVACFLAGS} -classpath \$(SASL_JAR)\$(PATH_SEPARATOR). "
612 else
613 JAVACFLAGS="${JAVACFLAGS} -classpath . "
614 fi # FOUND_SASL_JAR
615 AC_SUBST(JAVACFLAGS)
616
617 if test -z "${USE_GCJ_TRUE}" ; then
618 JAVAC_CMD="\$(GCJ) \$(AM_GCJFLAGS) \$(GCJFLAGS) -C "
619 else
620 if test -z "${USE_JIKES_TRUE}" ; then
621 JAVAC_CMD="\$(JIKES) \$(JIKESFLAGS) "
622 else
623 JAVAC_CMD="\$(JAVAC) \$(JAVACFLAGS) "
624 fi
625 fi
626 AC_SUBST(JAVAC_CMD)])# GNU_CRYPTO_SET_COMPILE_OPTS
627 dnl java.m4: Java autoconf macros.
628 dnl @synopsis AC_PROG_JAVA
629 dnl
630 dnl Here is a summary of the main macros:
631 dnl
632 dnl AC_PROG_JAVAC: finds a Java compiler.
633 dnl
634 dnl AC_PROG_JAVA: finds a Java virtual machine.
635 dnl
636 dnl AC_CHECK_CLASS: finds if we have the given class (beware of CLASSPATH!).
637 dnl
638 dnl AC_CHECK_RQRD_CLASS: finds if we have the given class and stops otherwise.
639 dnl
640 dnl AC_TRY_COMPILE_JAVA: attempt to compile user given source.
641 dnl
642 dnl AC_TRY_RUN_JAVA: attempt to compile and run user given source.
643 dnl
644 dnl AC_JAVA_OPTIONS: adds Java configure options.
645 dnl
646 dnl AC_PROG_JAVA tests an existing Java virtual machine. It uses the
647 dnl environment variable JAVA then tests in sequence various common Java
648 dnl virtual machines. For political reasons, it starts with the free ones.
649 dnl You *must* call [AC_PROG_JAVAC] before.
650 dnl
651 dnl If you want to force a specific VM:
652 dnl
653 dnl - at the configure.in level, set JAVA=yourvm before calling AC_PROG_JAVA
654 dnl (but after AC_INIT)
655 dnl
656 dnl - at the configure level, setenv JAVA
657 dnl
658 dnl You can use the JAVA variable in your Makefile.in, with @JAVA@.
659 dnl
660 dnl *Warning*: its success or failure can depend on a proper setting of the
661 dnl CLASSPATH env. variable.
662 dnl
663 dnl TODO: allow to exclude virtual machines (rationale: most Java programs
664 dnl cannot run with some VM like kaffe).
665 dnl
666 dnl Note: This is part of the set of autoconf M4 macros for Java programs.
667 dnl It is VERY IMPORTANT that you download the whole set, some
668 dnl macros depend on other. Unfortunately, the autoconf archive does not
669 dnl support the concept of set of macros, so I had to break it for
670 dnl submission.
671 dnl
672 dnl A Web page, with a link to the latest CVS snapshot is at
673 dnl <http://www.internatif.org/bortzmeyer/autoconf-Java/>.
674 dnl
675 dnl This is a sample configure.in
676 dnl Process this file with autoconf to produce a configure script.
677 dnl
678 dnl AC_INIT(UnTag.java)
679 dnl
680 dnl dnl Checks for programs.
681 dnl AC_CHECK_CLASSPATH
682 dnl AC_PROG_JAVAC
683 dnl AC_PROG_JAVA
684 dnl
685 dnl dnl Checks for classes
686 dnl AC_CHECK_RQRD_CLASS(org.xml.sax.Parser)
687 dnl AC_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
688 dnl
689 dnl AC_OUTPUT(Makefile)
690 dnl
691 dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
692 dnl @version $Id: ac_prog_java.m4,v 1.5 2000/01/02 16:07:12 bortz Exp $
693 dnl
694 AC_DEFUN(AC_PROG_JAVA,[
695 AC_REQUIRE([AC_EXEEXT])dnl
696 AC_ARG_VAR(JAVA, [Java bytecode interpreter.])
697 AC_ARG_VAR(JAVAFLAGS, [Java interpreter run-time flags.])
698 if test x$JAVAPREFIX = x; then
699 test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT)
700 else
701 test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT, $JAVAPREFIX)
702 fi
703 test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
704 AC_PROG_JAVA_WORKS
705 AC_PROVIDE([$0])dnl
706 ])
707 dnl @synopsis AC_CHECK_CLASS
708 dnl
709 dnl AC_CHECK_CLASS tests the existence of a given Java class, either in
710 dnl a jar or in a '.class' file.
711 dnl
712 dnl *Warning*: its success or failure can depend on a proper setting of the
713 dnl CLASSPATH env. variable.
714 dnl
715 dnl Note: This is part of the set of autoconf M4 macros for Java programs.
716 dnl It is VERY IMPORTANT that you download the whole set, some
717 dnl macros depend on other. Unfortunately, the autoconf archive does not
718 dnl support the concept of set of macros, so I had to break it for
719 dnl submission.
720 dnl The general documentation, as well as the sample configure.in, is
721 dnl included in the AC_PROG_JAVA macro.
722 dnl
723 dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
724 dnl @version $Id: ac_check_class.m4,v 1.3 2000/01/28 11:54:26 bortz Exp $
725 dnl
726 AC_DEFUN(AC_CHECK_CLASS,[
727 AC_REQUIRE([AC_PROG_JAVA])
728 ac_var_name=`echo $1 | sed 's/\./_/g'`
729 dnl Normaly I'd use a AC_CACHE_CHECK here but since the variable name is
730 dnl dynamic I need an extra level of extraction
731 AC_MSG_CHECKING([for $1 class])
732 AC_CACHE_VAL(ac_cv_class_$ac_var_name, [
733 if test x$ac_cv_prog_uudecode_base64 = xyes; then
734 dnl /**
735 dnl * Test.java: used to test dynamicaly if a class exists.
736 dnl */
737 dnl public class Test
738 dnl {
739 dnl
740 dnl public static void
741 dnl main( String[] argv )
742 dnl {
743 dnl Class lib;
744 dnl if (argv.length < 1)
745 dnl {
746 dnl System.err.println ("Missing argument");
747 dnl System.exit (77);
748 dnl }
749 dnl try
750 dnl {
751 dnl lib = Class.forName (argv[0]);
752 dnl }
753 dnl catch (ClassNotFoundException e)
754 dnl {
755 dnl System.exit (1);
756 dnl }
757 dnl lib = null;
758 dnl System.exit (0);
759 dnl }
760 dnl
761 dnl }
762 cat << \EOF > Test.uue
763 begin-base64 644 Test.class
764 yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
765 bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
766 bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ
767 AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt
768 ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV
769 ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp
770 VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM
771 amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi
772 AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B
773 AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA
774 AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN
775 uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK
776 AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA
777 JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA
778 JwAAAAIAKA==
779 ====
780 EOF
781 if uudecode$EXEEXT Test.uue; then
782 :
783 else
784 echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC
785 echo "configure: failed file was:" >&AC_FD_CC
786 cat Test.uue >&AC_FD_CC
787 ac_cv_prog_uudecode_base64=no
788 fi
789 rm -f Test.uue
790 if AC_TRY_COMMAND($JAVA $JAVAFLAGS Test $1) >/dev/null 2>&1; then
791 eval "ac_cv_class_$ac_var_name=yes"
792 else
793 eval "ac_cv_class_$ac_var_name=no"
794 fi
795 rm -f Test.class
796 else
797 AC_TRY_COMPILE_JAVA([$1], , [eval "ac_cv_class_$ac_var_name=yes"],
798 [eval "ac_cv_class_$ac_var_name=no"])
799 fi
800 eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
801 eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`"
802 HAVE_LAST_CLASS=$ac_var_val
803 if test x$ac_var_val = xyes; then
804 ifelse([$2], , :, [$2])
805 else
806 ifelse([$3], , :, [$3])
807 fi
808 ])
809 dnl for some reason the above statment didn't fall though here?
810 dnl do scripts have variable scoping?
811 eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`"
812 AC_MSG_RESULT($ac_var_val)
813 ])
814
815 dnl @synopsis AC_CHECK_CLASSPATH
816 dnl
817 dnl AC_CHECK_CLASSPATH just displays the CLASSPATH, for the edification
818 dnl of the user.
819 dnl
820 dnl Note: This is part of the set of autoconf M4 macros for Java programs.
821 dnl It is VERY IMPORTANT that you download the whole set, some
822 dnl macros depend on other. Unfortunately, the autoconf archive does not
823 dnl support the concept of set of macros, so I had to break it for
824 dnl submission.
825 dnl The general documentation, as well as the sample configure.in, is
826 dnl included in the AC_PROG_JAVA macro.
827 dnl
828 dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
829 dnl @version $Id: ac_check_classpath.m4,v 1.3 1999/12/29 10:45:03 bortz Exp $
830 dnl
831 AC_DEFUN(AC_CHECK_CLASSPATH,[
832 AC_ARG_VAR(CLASSPATH, [Path to extra class libraries.])
833 if test "x$CLASSPATH" = x; then
834 echo "You have no CLASSPATH, I hope it is good"
835 else
836 echo "You have CLASSPATH $CLASSPATH, hope it is correct"
837 fi
838 ])
839
840
841
842 dnl @synopsis AC_CHECK_RQRD_CLASS
843 dnl
844 dnl AC_CHECK_RQRD_CLASS tests the existence of a given Java class, either in
845 dnl a jar or in a '.class' file and fails if it doesn't exist.
846 dnl Its success or failure can depend on a proper setting of the
847 dnl CLASSPATH env. variable.
848 dnl
849 dnl Note: This is part of the set of autoconf M4 macros for Java programs.
850 dnl It is VERY IMPORTANT that you download the whole set, some
851 dnl macros depend on other. Unfortunately, the autoconf archive does not
852 dnl support the concept of set of macros, so I had to break it for
853 dnl submission.
854 dnl The general documentation, as well as the sample configure.in, is
855 dnl included in the AC_PROG_JAVA macro.
856 dnl
857 dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
858 dnl @version $Id: ac_check_rqrd_class.m4,v 1.1 1999/12/29 09:22:26 bortz Exp $
859 dnl
860
861 AC_DEFUN(AC_CHECK_RQRD_CLASS,[
862 CLASS=`echo $1|sed 's/\./_/g'`
863 AC_CHECK_CLASS($1)
864 if test "$HAVE_LAST_CLASS" = "no"; then
865 AC_MSG_ERROR([Required class $1 missing, exiting.])
866 fi
867 ])
868 dnl @synopsis AC_JAVA_OPTIONS
869 dnl
870 dnl AC_JAVA_OPTIONS adds configure command line options used for Java m4
871 dnl macros. This Macro is optional.
872 dnl
873 dnl Note: This is part of the set of autoconf M4 macros for Java programs.
874 dnl It is VERY IMPORTANT that you download the whole set, some
875 dnl macros depend on other. Unfortunately, the autoconf archive does not
876 dnl support the concept of set of macros, so I had to break it for
877 dnl submission.
878 dnl The general documentation, as well as the sample configure.in, is
879 dnl included in the AC_PROG_JAVA macro.
880 dnl
881 dnl @author Devin Weaver <ktohg@tritarget.com>
882 dnl @version $Id: ac_java_options.m4,v 1.2 2000/01/02 16:07:12 bortz Exp $
883 dnl
884 AC_DEFUN(AC_JAVA_OPTIONS,[
885 AC_ARG_WITH(java-prefix,
886 AC_HELP_STRING([--with-java-prefix=PFX],[prefix where Java runtime is installed (optional)]))
887 AC_ARG_WITH(javac-flags,
888 AC_HELP_STRING([--with-javac-flags=FLAGS],[flags to pass to the Java compiler (optional)]))
889 AC_ARG_WITH(java-flags,
890 AC_HELP_STRING([--with-java-flags=FLAGS],[flags to pass to the Java VM (optional)]))
891 JAVAPREFIX=$with_java_prefix
892 JAVACFLAGS=$with_javac_flags
893 JAVAFLAGS=$with_java_flags
894 AC_SUBST(JAVAPREFIX)dnl
895 AC_SUBST(JAVACFLAGS)dnl
896 AC_SUBST(JAVAFLAGS)dnl
897 AC_SUBST(JAVA)dnl
898 AC_SUBST(JAVAC)dnl
899 ])
900 dnl @synopsis AC_PROG_JAVA_WORKS
901 dnl
902 dnl Internal use ONLY.
903 dnl
904 dnl Note: This is part of the set of autoconf M4 macros for Java programs.
905 dnl It is VERY IMPORTANT that you download the whole set, some
906 dnl macros depend on other. Unfortunately, the autoconf archive does not
907 dnl support the concept of set of macros, so I had to break it for
908 dnl submission.
909 dnl The general documentation, as well as the sample configure.in, is
910 dnl included in the AC_PROG_JAVA macro.
911 dnl
912 dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
913 dnl @version $Id: ac_prog_java_works.m4,v 1.2 1999/12/29 09:58:48 bortz Exp $
914 dnl
915 AC_DEFUN(AC_PROG_JAVA_WORKS, [
916 AC_CHECK_PROG(uudecode, uudecode$EXEEXT, yes)
917 if test x$uudecode = xyes; then
918 AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [
919 dnl /**
920 dnl * Test.java: used to test if java compiler works.
921 dnl */
922 dnl public class Test
923 dnl {
924 dnl
925 dnl public static void
926 dnl main( String[] argv )
927 dnl {
928 dnl System.exit (0);
929 dnl }
930 dnl
931 dnl }
932 cat << \EOF > Test.uue
933 begin-base64 644 Test.class
934 yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
935 bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
936 bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s
937 YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG
938 aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB
939 AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB
940 AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ=
941 ====
942 EOF
943 if uudecode$EXEEXT Test.uue; then
944 ac_cv_prog_uudecode_base64=yes
945 else
946 echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC
947 echo "configure: failed file was:" >&AC_FD_CC
948 cat Test.uue >&AC_FD_CC
949 ac_cv_prog_uudecode_base64=no
950 fi
951 rm -f Test.uue])
952 fi
953 if test x$ac_cv_prog_uudecode_base64 != xyes; then
954 rm -f Test.class
955 AC_MSG_WARN([I have to compile Test.class from scratch])
956 if test x$ac_cv_prog_javac_works = xno; then
957 AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly])
958 fi
959 if test x$ac_cv_prog_javac_works = x; then
960 AC_PROG_JAVAC
961 fi
962 fi
963 AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [
964 JAVA_TEST=Test.java
965 CLASS_TEST=Test.class
966 TEST=Test
967 changequote(, )dnl
968 cat << \EOF > $JAVA_TEST
969 /* [#]line __oline__ "configure" */
970 public class Test {
971 public static void main (String args[]) {
972 System.exit (0);
973 } }
974 EOF
975 changequote([, ])dnl
976 if test x$ac_cv_prog_uudecode_base64 != xyes; then
977 if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
978 :
979 else
980 echo "configure: failed program was:" >&AC_FD_CC
981 cat $JAVA_TEST >&AC_FD_CC
982 AC_MSG_ERROR(The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?))
983 fi
984 fi
985 if AC_TRY_COMMAND($JAVA $JAVAFLAGS $TEST) >/dev/null 2>&1; then
986 ac_cv_prog_java_works=yes
987 else
988 echo "configure: failed program was:" >&AC_FD_CC
989 cat $JAVA_TEST >&AC_FD_CC
990 AC_MSG_ERROR(The Java VM $JAVA failed (see config.log, check the CLASSPATH?))
991 fi
992 rm -fr $JAVA_TEST $CLASS_TEST Test.uue
993 ])
994 AC_PROVIDE([$0])dnl
995 ]
996 )
997
998 dnl @synopsis AC_PROG_JAVAC
999 dnl
1000 dnl AC_PROG_JAVAC tests an existing Java compiler. It uses the environment
1001 dnl variable JAVAC then tests in sequence various common Java compilers. For
1002 dnl political reasons, it starts with the free ones.
1003 dnl
1004 dnl If you want to force a specific compiler:
1005 dnl
1006 dnl - at the configure.in level, set JAVAC=yourcompiler before calling
1007 dnl AC_PROG_JAVAC
1008 dnl
1009 dnl - at the configure level, setenv JAVAC
1010 dnl
1011 dnl You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
1012 dnl
1013 dnl *Warning*: its success or failure can depend on a proper setting of the
1014 dnl CLASSPATH env. variable.
1015 dnl
1016 dnl TODO: allow to exclude compilers (rationale: most Java programs cannot compile
1017 dnl with some compilers like guavac).
1018 dnl
1019 dnl Note: This is part of the set of autoconf M4 macros for Java programs.
1020 dnl It is VERY IMPORTANT that you download the whole set, some
1021 dnl macros depend on other. Unfortunately, the autoconf archive does not
1022 dnl support the concept of set of macros, so I had to break it for
1023 dnl submission.
1024 dnl The general documentation, as well as the sample configure.in, is
1025 dnl included in the AC_PROG_JAVA macro.
1026 dnl
1027 dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
1028 dnl @version $Id: ac_prog_javac.m4,v 1.3 1999/12/29 10:46:15 bortz Exp $
1029 dnl
1030 AC_DEFUN(AC_PROG_JAVAC,[
1031 AC_REQUIRE([AC_EXEEXT])dnl
1032 AC_ARG_VAR(JAVAC, [Java bytecode compiler.])
1033 AC_ARG_VAR(JAVACFLAGS, [Extra flags for the java compiler.])
1034 if test "x$JAVAPREFIX" = x; then
1035 test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT)
1036 else
1037 test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT, $JAVAPREFIX)
1038 fi
1039 test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH])
1040 AC_PROG_JAVAC_WORKS
1041 AC_PROVIDE([$0])dnl
1042 ])
1043
1044 dnl @synopsis AC_PROG_JAVAC_WORKS
1045 dnl
1046 dnl Internal use ONLY.
1047 dnl
1048 dnl Note: This is part of the set of autoconf M4 macros for Java programs.
1049 dnl It is VERY IMPORTANT that you download the whole set, some
1050 dnl macros depend on other. Unfortunately, the autoconf archive does not
1051 dnl support the concept of set of macros, so I had to break it for
1052 dnl submission.
1053 dnl The general documentation, as well as the sample configure.in, is
1054 dnl included in the AC_PROG_JAVA macro.
1055 dnl
1056 dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
1057 dnl @version $Id: ac_prog_javac_works.m4,v 1.2 1999/12/29 09:58:48 bortz Exp $
1058 dnl
1059 AC_DEFUN(AC_PROG_JAVAC_WORKS,[
1060 AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [
1061 JAVA_TEST=Test.java
1062 CLASS_TEST=Test.class
1063 cat << \EOF > $JAVA_TEST
1064 /* [#]line __oline__ "configure" */
1065 public class Test {
1066 }
1067 EOF
1068 if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then
1069 ac_cv_prog_javac_works=yes
1070 else
1071 AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)])
1072 echo "configure: failed program was:" >&AC_FD_CC
1073 cat $JAVA_TEST >&AC_FD_CC
1074 fi
1075 rm -f $JAVA_TEST $CLASS_TEST
1076 ])
1077 AC_PROVIDE([$0])dnl
1078 ])
1079 dnl @synopsis AC_TRY_COMPILE_JAVA
1080 dnl
1081 dnl AC_TRY_COMPILE_JAVA attempt to compile user given source.
1082 dnl
1083 dnl *Warning*: its success or failure can depend on a proper setting of the
1084 dnl CLASSPATH env. variable.
1085 dnl
1086 dnl Note: This is part of the set of autoconf M4 macros for Java programs.
1087 dnl It is VERY IMPORTANT that you download the whole set, some
1088 dnl macros depend on other. Unfortunately, the autoconf archive does not
1089 dnl support the concept of set of macros, so I had to break it for
1090 dnl submission.
1091 dnl The general documentation, as well as the sample configure.in, is
1092 dnl included in the AC_PROG_JAVA macro.
1093 dnl
1094 dnl @author Devin Weaver <ktohg@tritarget.com>
1095 dnl @version $Id: ac_try_compile_java.m4,v 1.1 1999/12/29 09:59:34 bortz Exp $
1096 dnl
1097 AC_DEFUN(AC_TRY_COMPILE_JAVA,[
1098 AC_REQUIRE([AC_PROG_JAVAC])dnl
1099 cat << \EOF > Test.java
1100 /* [#]line __oline__ "configure" */
1101 ifelse([$1], , , [import $1;])
1102 public class Test {
1103 [$2]
1104 }
1105 EOF
1106 if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class
1107 then
1108 dnl Don't remove the temporary files here, so they can be examined.
1109 ifelse([$3], , :, [$3])
1110 else
1111 echo "configure: failed program was:" >&AC_FD_CC
1112 cat Test.java >&AC_FD_CC
1113 ifelse([$4], , , [ rm -fr Test*
1114 $4
1115 ])dnl
1116 fi
1117 rm -fr Test*])
1118 dnl @synopsis AC_TRY_RUN_JAVA
1119 dnl
1120 dnl AC_TRY_RUN_JAVA attempt to compile and run user given source.
1121 dnl
1122 dnl *Warning*: its success or failure can depend on a proper setting of the
1123 dnl CLASSPATH env. variable.
1124 dnl
1125 dnl Note: This is part of the set of autoconf M4 macros for Java programs.
1126 dnl It is VERY IMPORTANT that you download the whole set, some
1127 dnl macros depend on other. Unfortunately, the autoconf archive does not
1128 dnl support the concept of set of macros, so I had to break it for
1129 dnl submission.
1130 dnl The general documentation, as well as the sample configure.in, is
1131 dnl included in the AC_PROG_JAVA macro.
1132 dnl
1133 dnl @author Devin Weaver <ktohg@tritarget.com>
1134 dnl @version $Id: ac_try_run_java.m4,v 1.1 1999/12/29 09:59:34 bortz Exp $
1135 dnl
1136 AC_DEFUN(AC_TRY_RUN_JAVA,[
1137 AC_REQUIRE([AC_PROG_JAVAC])dnl
1138 AC_REQUIRE([AC_PROG_JAVA])dnl
1139 cat << \EOF > Test.java
1140 /* [#]line __oline__ "configure" */
1141 ifelse([$1], , , [include $1;])
1142 public class Test {
1143 [$2]
1144 }
1145 EOF
1146 if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class && ($JAVA $JAVAFLAGS Test; exit) 2>/dev/null
1147 then
1148 dnl Don't remove the temporary files here, so they can be examined.
1149 ifelse([$3], , :, [$3])
1150 else
1151 echo "configure: failed program was:" >&AC_FD_CC
1152 cat Test.java >&AC_FD_CC
1153 ifelse([$4], , , [ rm -fr Test*
1154 $4
1155 ])dnl
1156 fi
1157 rm -fr Test*])
1158
1159 dnl AC_CHECK_PATH_SEPARATOR
1160 dnl
1161 dnl Determines the strings used to separate paths (e.g. ':') and
1162 dnl directories (e.g. '/').
1163 dnl
1164 AC_DEFUN([AC_CHECK_PATH_SEPARATOR],[
1165 AC_REQUIRE([AC_PROG_JAVA])
1166 AC_MSG_CHECKING([for the system path separator])
1167 AC_CACHE_VAL(ac_cv_path_separator, [
1168 if test x$ac_cv_prog_uudecode_base64 = xyes; then
1169 dnl class pathtest {
1170 dnl public static void main(String[] argv) {
1171 dnl System.out.println(System.getProperty("path.separator"));
1172 dnl }
1173 dnl }
1174 cat << \EOF > pathtest.uue
1175 begin-base64 640 pathtest.class
1176 yv66vgADAC0AIQcAAgEACHBhdGh0ZXN0BwAEAQAQamF2YS9sYW5nL09iamVj
1177 dAEABG1haW4BABYoW0xqYXZhL2xhbmcvU3RyaW5nOylWAQAEQ29kZQEAD0xp
1178 bmVOdW1iZXJUYWJsZQwACgALAQADb3V0AQAVTGphdmEvaW8vUHJpbnRTdHJl
1179 YW07CQANAAkHAA4BABBqYXZhL2xhbmcvU3lzdGVtCAAQAQAOcGF0aC5zZXBh
1180 cmF0b3IMABIAEwEAC2dldFByb3BlcnR5AQAmKExqYXZhL2xhbmcvU3RyaW5n
1181 OylMamF2YS9sYW5nL1N0cmluZzsKAA0AEQwAFgAXAQAHcHJpbnRsbgEAFShM
1182 amF2YS9sYW5nL1N0cmluZzspVgoAGQAVBwAaAQATamF2YS9pby9QcmludFN0
1183 cmVhbQEABjxpbml0PgEAAygpVgwAGwAcCgADAB0BAApTb3VyY2VGaWxlAQAN
1184 cGF0aHRlc3QuamF2YQAgAAEAAwAAAAAAAgAJAAUABgABAAcAAAAoAAIAAQAA
1185 AAyyAAwSD7gAFLYAGLEAAAABAAgAAAAKAAIAAAADAAsABAAAABsAHAABAAcA
1186 AAAhAAEAAQAAAAUqtwAesQAAAAEACAAAAAoAAgAAAAEABAABAAEAHwAAAAIA
1187 IA==
1188 ====
1189 EOF
1190 if uudecode$EXEEXT pathtest.uue; then
1191 :
1192 else
1193 echo "configure: __oline__: uudecode had trouble decoding base 64 file 'pathtest.uue'" >&AC_FD_CC
1194 echo "configure: failed file was:" >&AC_FD_CC
1195 cat pathtest.uue >&AC_FD_CC
1196 ac_cv_prog_uudecode_base64=no
1197 fi
1198 rm -f pathtest.uue
1199 ac_cv_path_separator=$($JAVA $JAVAFLAGS pathtest)
1200 rm -f pathtest.class
1201 ])
1202 AC_MSG_RESULT([$ac_cv_path_separator])
1203 PATH_SEPARATOR=$ac_cv_path_separator
1204 fi
1205 ])
1206
1207 dnl AC_CHECK_FILE_SEPARATOR
1208 dnl
1209 dnl Determines the strings used to separate files (e.g. '/').
1210 dnl
1211 AC_DEFUN([AC_CHECK_FILE_SEPARATOR],[
1212 AC_REQUIRE([AC_PROG_JAVA])
1213 AC_MSG_CHECKING([for the system file separator])
1214 AC_CACHE_VAL(ac_cv_file_separator, [
1215 if test x$ac_cv_prog_uudecode_base64 = xyes; then
1216 dnl class filetest {
1217 dnl public static void main(String[] argv) {
1218 dnl System.out.println(System.getProperty("file.separator"));
1219 dnl }
1220 dnl }
1221 cat << \EOF > filetest.uue
1222 begin-base64 644 filetest.class
1223 yv66vgADAC0AIQcAAgEACGZpbGV0ZXN0BwAEAQAQamF2YS9sYW5nL09iamVj
1224 dAEABG1haW4BABYoW0xqYXZhL2xhbmcvU3RyaW5nOylWAQAEQ29kZQEAD0xp
1225 bmVOdW1iZXJUYWJsZQwACgALAQADb3V0AQAVTGphdmEvaW8vUHJpbnRTdHJl
1226 YW07CQANAAkHAA4BABBqYXZhL2xhbmcvU3lzdGVtCAAQAQAOZmlsZS5zZXBh
1227 cmF0b3IMABIAEwEAC2dldFByb3BlcnR5AQAmKExqYXZhL2xhbmcvU3RyaW5n
1228 OylMamF2YS9sYW5nL1N0cmluZzsKAA0AEQwAFgAXAQAHcHJpbnRsbgEAFShM
1229 amF2YS9sYW5nL1N0cmluZzspVgoAGQAVBwAaAQATamF2YS9pby9QcmludFN0
1230 cmVhbQEABjxpbml0PgEAAygpVgwAGwAcCgADAB0BAApTb3VyY2VGaWxlAQAN
1231 ZmlsZXRlc3QuamF2YQAgAAEAAwAAAAAAAgAJAAUABgABAAcAAAAoAAIAAQAA
1232 AAyyAAwSD7gAFLYAGLEAAAABAAgAAAAKAAIAAAADAAsABAAAABsAHAABAAcA
1233 AAAhAAEAAQAAAAUqtwAesQAAAAEACAAAAAoAAgAAAAEABAABAAEAHwAAAAIA
1234 IA==
1235 ====
1236 EOF
1237 if uudecode$EXEEXT filetest.uue; then
1238 :
1239 else
1240 echo "configure: __oline__: uudecode had trouble decoding base 64 file 'filetest.uue'" >&AC_FD_CC
1241 echo "configure: failed file was:" >&AC_FD_CC
1242 cat filetest.uue >&AC_FD_CC
1243 ac_cv_prog_uudecode_base64=no
1244 fi
1245 rm -f filetest.uue
1246 ac_cv_file_separator=$($JAVA $JAVAFLAGS filetest)
1247 rm -f filetest.class
1248 ])
1249 AC_MSG_RESULT([$ac_cv_file_separator])
1250 if test $ac_cv_file_separator = '\\'; then
1251 ac_cv_file_separator=\\\\
1252 fi
1253 FILE_SEPARATOR=$ac_cv_file_separator
1254 fi
1255 ])
1256
1257 dnl @synopsis AC_PROG_JAR
1258 dnl
1259 AC_DEFUN(AC_PROG_JAR,[
1260 AC_REQUIRE([AC_EXEEXT])dnl
1261 AC_ARG_VAR(JAR, [Java archiver.])
1262 test "x$JAR" = x && AC_CHECK_PROGS(JAR, "jar$EXEEXT")
1263 test "x$JAR" = x && AC_MSG_ERROR([no acceptable Java archiver found in \$PATH])
1264 AC_PROVIDE([$0])dnl
1265 ])

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26