AC_DEFUN([gt_GCJ],
[
AC_ARG_VAR([GCJ], [Java native code compiler command])
AC_ARG_VAR([GCJFLAGS], [Java native code compiler flags])
AC_MSG_CHECKING([for Java to native code compiler])
if test -z "$GCJ"; then
pushdef([AC_MSG_CHECKING],[:]) pushdef([AC_CHECKING],[:]) pushdef([AC_MSG_RESULT],[:]) AC_CHECK_PROGS(GCJ, [gcj], [none])
popdef([AC_MSG_RESULT]) popdef([AC_CHECKING]) popdef([AC_MSG_CHECKING]) fi
if test "$GCJ" != none; then
test "${GCJFLAGS+set}" != set || GCJFLAGS="-O2 -g"
fi
ac_gcj_link="$GCJ $GCJFLAGS conftest.java --main=conftest -o conftest$ac_exeext"
changequote(,) if test "$GCJ" != none \
&& $GCJ --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | grep '^[3-9]' >/dev/null \
&& (
cat > conftest.java <<EOF
public class conftest {
public static void main (String[] args) {
try {
java.util.ResourceBundle.getBundle("foobar");
} catch (Exception e) {
}
System.exit(0);
}
}
EOF
changequote([,]) AC_TRY_EVAL([ac_gcj_link])
error=$?
if test $error = 0 && test "$cross_compiling" != yes; then
error=`./conftest >/dev/null 2>&1; echo $?`
test $error = 0 || error=1
rm -f core conftest.core
fi
rm -f conftest.java conftest$ac_exeext
exit $error
); then
:
else
GCJ=none
fi
AC_MSG_RESULT($GCJ)
if test "$GCJ" != none; then
HAVE_GCJ=1
else
HAVE_GCJ=
fi
AC_SUBST(GCJ)
AC_SUBST(GCJFLAGS)
AC_SUBST(HAVE_GCJ)
])