1dnl @synopsis AC_TRY_RUN_JAVA 2dnl 3dnl AC_TRY_RUN_JAVA attempt to compile and run user given source. 4dnl 5dnl *Warning*: its success or failure can depend on a proper setting of the 6dnl CLASSPATH env. variable. 7dnl 8dnl Note: This is part of the set of autoconf M4 macros for Java programs. 9dnl It is VERY IMPORTANT that you download the whole set, some 10dnl macros depend on other. Unfortunately, the autoconf archive does not 11dnl support the concept of set of macros, so I had to break it for 12dnl submission. 13dnl The general documentation, as well as the sample configure.in, is 14dnl included in the AC_PROG_JAVA macro. 15dnl 16dnl @author Devin Weaver <ktohg@tritarget.com> 17dnl @version $Id: ac_try_run_javac.m4,v 12.0 2004/11/17 03:43:38 bostic Exp $ 18dnl 19AC_DEFUN([AC_TRY_RUN_JAVA],[ 20AC_REQUIRE([AC_PROG_JAVAC])dnl 21AC_REQUIRE([AC_PROG_JAVA])dnl 22cat << \EOF > Test.java 23/* [#]line __oline__ "configure" */ 24ifelse([$1], , , [include $1;]) 25public class Test { 26[$2] 27} 28EOF 29if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class && ($JAVA $JAVAFLAGS Test; exit) 2>/dev/null 30then 31dnl Don't remove the temporary files here, so they can be examined. 32 ifelse([$3], , :, [$3]) 33else 34 echo "configure: failed program was:" >&AC_FD_CC 35 cat Test.java >&AC_FD_CC 36ifelse([$4], , , [ rm -fr Test* 37 $4 38])dnl 39fi 40rm -fr Test*]) 41