2 # Autoconf macros for configuring the build of Java JDBC Tools
4 # $Header: /cvsroot/pgsql/config/Attic/java.m4,v 1.4 2002/03/29 17:32:54 petere Exp $
10 AC_DEFUN([_PGAC_PROG_ANT_WORKS],
12 AC_CACHE_CHECK([whether $ANT works], [pgac_cv_prog_ant_works],
14 cat > conftest.java << EOF
15 public class conftest {
16 int testmethod(int a, int b) {
22 cat > conftest.xml << EOF
23 <project name="conftest" default="conftest">
24 <target name="conftest">
25 <javac srcdir="." includes="conftest.java">
31 pgac_cmd='$ANT -buildfile conftest.xml 1>&2'
34 if test $? = 0 && test -f ./conftest.class ; then
35 pgac_cv_prog_ant_works=yes
37 echo "configure: failed java program was:" >&AS_MESSAGE_LOG_FD
38 cat conftest.java >&AS_MESSAGE_LOG_FD
39 echo "configure: failed build file was:" >&AS_MESSAGE_LOG_FD
40 cat conftest.xml >&AS_MESSAGE_LOG_FD
41 pgac_cv_prog_ant_works=no
44 rm -f conftest* core core.* *.core
47 if test "$pgac_cv_prog_ant_works" != yes; then
48 AC_MSG_ERROR([ant does not work])
55 # Look for the ANT tool and set the output variable 'ANT' to 'ant'
56 # if found, empty otherwise
57 AC_DEFUN([PGAC_PATH_ANT],
59 AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat])