1 # javacomp.m4 serial 6 (gettext-0.13)
2 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 # Prerequisites of javacomp.sh.
8 # Sets HAVE_JAVACOMP to nonempty if javacomp.sh will work.
10 AC_DEFUN([gt_JAVACOMP],
12 AC_MSG_CHECKING([for Java compiler])
14 #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
17 ], CLASSPATH_SEPARATOR=';', CLASSPATH_SEPARATOR=':')
19 if test -n "$JAVAC"; then
22 pushdef([AC_MSG_CHECKING],[:])dnl
23 pushdef([AC_CHECKING],[:])dnl
24 pushdef([AC_MSG_RESULT],[:])dnl
25 AC_CHECK_PROG(HAVE_GCJ_IN_PATH, gcj, yes)
26 AC_CHECK_PROG(HAVE_JAVAC_IN_PATH, javac, yes)
27 AC_CHECK_PROG(HAVE_JIKES_IN_PATH, jikes, yes)
28 popdef([AC_MSG_RESULT])dnl
29 popdef([AC_CHECKING])dnl
30 popdef([AC_MSG_CHECKING])dnl
32 # Test for a good gcj version (>= 3.0).
33 # Exclude some versions of gcj: gcj 3.0.4 compiles GetURL.java to invalid
34 # bytecode, that crashes with an IllegalAccessError when executed by
35 # gij 3.0.4 or with a VerifyError when executed by Sun Java. Likewise for
37 # I also exclude gcj 3.2, 3.3 etc. because I have no idea when this bug
38 # will be fixed. The bug is registered as java/7066, see
39 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7066
40 # FIXME: Check new versions of gcj as they come out.
41 if test -n "$HAVE_GCJ_IN_PATH" \
42 && gcj --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^3\.[0123456789]/d' | grep '^[3-9]' >/dev/null \
44 # See if libgcj.jar is well installed.
45 cat > conftest.java <<EOF
46 public class conftest {
47 public static void main (String[] args) {
51 gcj -C -d . conftest.java 2>/dev/null
53 rm -f conftest.java conftest.class
59 if test -n "$HAVE_JAVAC_IN_PATH" \
60 && (javac -version >/dev/null 2>/dev/null || test $? -le 2) \
61 && (if javac -help 2>&1 >/dev/null | grep at.dms.kjc.Main >/dev/null && javac -help 2>/dev/null | grep 'released.*2000' >/dev/null ; then exit 1; else exit 0; fi); then
65 if test -n "$HAVE_JIKES_IN_PATH" \
66 && (jikes >/dev/null 2>/dev/null || test $? = 1) \
68 # See if the existing CLASSPATH is sufficient to make jikes work.
69 cat > conftest.java <<EOF
70 public class conftest {
71 public static void main (String[] args) {
76 jikes conftest.java 2>/dev/null
78 rm -f conftest.java conftest.class
91 AC_MSG_RESULT([$ac_result])
94 AC_SUBST(CLASSPATH_SEPARATOR)