1
dnl @synopsis AC_TRY_COMPILE_JAVA
3
dnl AC_TRY_COMPILE_JAVA attempt to compile user given source.
5
dnl *Warning*: its success or failure can depend on a proper setting of the
6
dnl CLASSPATH env. variable.
8
dnl Note: This is part of the set of autoconf M4 macros for Java programs.
9
dnl It is VERY IMPORTANT that you download the whole set, some
10
dnl macros depend on other. Unfortunately, the autoconf archive does not
11
dnl support the concept of set of macros, so I had to break it for
13
dnl The general documentation, as well as the sample configure.in, is
14
dnl included in the AC_PROG_JAVA macro.
16
dnl @author Devin Weaver <ktohg@tritarget.com>
19
AC_DEFUN([AC_TRY_COMPILE_JAVA],[
20
AC_REQUIRE([AC_PROG_JAVAC])dnl
21
cat << \EOF > Test.java
22
/* [#]line __oline__ "configure" */
23
ifelse([$1], , , [import $1;])
28
if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class
30
dnl Don't remove the temporary files here, so they can be examined.
31
ifelse([$3], , :, [$3])
33
echo "configure: failed program was:" >&AC_FD_CC
34
cat Test.java >&AC_FD_CC
35
ifelse([$4], , , [ rm -fr Test*