+2001-11-01 Bruno Haible <haible@clisp.cons.org>
+
+ * javacomp.m4 (gt_JAVACOMP): Test for the existence of gcj, javac,
+ jikes in $PATH. Needed because the call of a program not found in PATH
+ yields return code 1 with SunOS 4 /bin/sh and is thus indistinguishable
+ from a successful call returning 1.
+
2001-10-30 Bruno Haible <haible@clisp.cons.org>
* gettext.m4 (AM_GNU_GETTEXT): Make sure "make dist" works even when
if test -n "$JAVAC"; then
ac_result="$JAVAC"
else
- if gcj --version 2>/dev/null | grep '^[3-9]' >/dev/null; then
+ pushdef([AC_MSG_CHECKING],[:])dnl
+ pushdef([AC_CHECKING],[:])dnl
+ pushdef([AC_MSG_RESULT],[:])dnl
+ AC_CHECK_PROG(HAVE_GCJ_IN_PATH, gcj, yes)
+ AC_CHECK_PROG(HAVE_JAVAC_IN_PATH, javac, yes)
+ AC_CHECK_PROG(HAVE_JIKES_IN_PATH, jikes, yes)
+ popdef([AC_MSG_RESULT])dnl
+ popdef([AC_CHECKING])dnl
+ popdef([AC_MSG_CHECKING])dnl
+ if test -n "$HAVE_GCJ_IN_PATH" \
+ && gcj --version 2>/dev/null | grep '^[3-9]' >/dev/null; then
HAVE_GCJ=1
ac_result="gcj -C"
else
- if (javac -version >/dev/null 2>/dev/null || test $? -le 2); then
+ if test -n "$HAVE_JAVAC_IN_PATH" \
+ && (javac -version >/dev/null 2>/dev/null || test $? -le 2); then
HAVE_JAVAC=1
ac_result="javac"
else
- if (jikes >/dev/null 2>/dev/null || test $? = 1) && (
+ if test -n "$HAVE_JIKES_IN_PATH" \
+ && (jikes >/dev/null 2>/dev/null || test $? = 1) \
+ && (
# See if the existing CLASSPATH is sufficient to make jikes work.
cat > conftest.java <<EOF
public class conftest {
if test -n "$JAVA"; then
ac_result="$JAVA"
else
- if gij --version >/dev/null 2>/dev/null; then
+ pushdef([AC_MSG_CHECKING],[:])dnl
+ pushdef([AC_CHECKING],[:])dnl
+ pushdef([AC_MSG_RESULT],[:])dnl
+ AC_CHECK_PROG(HAVE_GIJ_IN_PATH, gij, yes)
+ AC_CHECK_PROG(HAVE_JAVA_IN_PATH, java, yes)
+ AC_CHECK_PROG(HAVE_JRE_IN_PATH, jre, yes)
+ AC_CHECK_PROG(HAVE_JVIEW_IN_PATH, jview, yes)
+ popdef([AC_MSG_RESULT])dnl
+ popdef([AC_CHECKING])dnl
+ popdef([AC_MSG_CHECKING])dnl
+ if test -n "$HAVE_GIJ_IN_PATH" \
+ && gij --version >/dev/null 2>/dev/null; then
HAVE_GIJ=1
ac_result="gij"
else
- if java -version >/dev/null 2>/dev/null; then
+ if test -n "$HAVE_JAVA_IN_PATH" \
+ && java -version >/dev/null 2>/dev/null; then
HAVE_JAVA_JVM=1
ac_result="java"
else
- if (jre >/dev/null 2>/dev/null || test $? = 1); then
+ if test -n "$HAVE_JRE_IN_PATH" \
+ && (jre >/dev/null 2>/dev/null || test $? = 1); then
HAVE_JRE=1
ac_result="jre"
else
- if (jview -? >/dev/null 2>/dev/null || test $? = 1); then
+ if test -n "$HAVE_JVIEW_IN_PATH" \
+ && (jview -? >/dev/null 2>/dev/null || test $? = 1); then
HAVE_JVIEW=1
ac_result="jview"
else