Skip to content

Commit 2f3bd9e

Browse files
committed
Check for jakarta-ant before ant, in case 'ant' is the screen saver program.
Then, run a small reality test with $ANT to see whether it works.
1 parent 499c81d commit 2f3bd9e

File tree

2 files changed

+462
-364
lines changed

2 files changed

+462
-364
lines changed

config/java.m4

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,61 @@
11
#
22
# Autoconf macros for configuring the build of Java JDBC Tools
33
#
4-
# $Header: /cvsroot/pgsql/config/Attic/java.m4,v 1.2 2001/03/11 11:24:59 petere Exp $
4+
# $Header: /cvsroot/pgsql/config/Attic/java.m4,v 1.3 2001/07/04 21:22:55 petere Exp $
55
#
66

7+
8+
# _PGAC_PROG_ANT_WORKS
9+
# --------------------
10+
AC_DEFUN([_PGAC_PROG_ANT_WORKS],
11+
[
12+
AC_CACHE_CHECK([whether $ANT works], [pgac_cv_prog_ant_works],
13+
[
14+
cat > conftest.java << EOF
15+
public class conftest {
16+
int testmethod(int a, int b) {
17+
return a + b;
18+
}
19+
}
20+
EOF
21+
22+
cat > conftest.xml << EOF
23+
<project name="conftest" default="conftest">
24+
<target name="conftest">
25+
<javac srcdir="." includes="conftest.java">
26+
</javac>
27+
</target>
28+
</project>
29+
EOF
30+
31+
pgac_cmd='$ANT -buildfile conftest.xml 1>&2'
32+
AC_TRY_EVAL(pgac_cmd)
33+
pgac_save_status=$?
34+
if test $? = 0 && test -f ./conftest.class ; then
35+
pgac_cv_prog_ant_works=yes
36+
else
37+
echo "configure: failed java program was:" >&AC_FD_CC
38+
cat conftest.java >&AC_FD_CC
39+
echo "configure: failed build file was:" >&AC_FD_CC
40+
cat conftest.xml >&AC_FD_CC
41+
pgac_cv_prog_ant_works=no
42+
fi
43+
44+
rm -f conftest* core core.* *.core
45+
])
46+
47+
if test "$pgac_cv_prog_ant_works" != yes; then
48+
AC_MSG_ERROR([ant does not work])
49+
fi
50+
])
51+
52+
753
# PGAC_PATH_ANT
854
# -------------
955
# Look for the ANT tool and set the output variable 'ANT' to 'ant'
1056
# if found, empty otherwise
1157
AC_DEFUN([PGAC_PATH_ANT],
12-
[AC_PATH_PROGS(ANT, [ant ant.sh ant.bat])])
58+
[
59+
AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat])
60+
_PGAC_PROG_ANT_WORKS
61+
])

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy