From: Bruno Haible Date: Thu, 1 Nov 2001 11:15:53 +0000 (+0000) Subject: Work around a problem with SunOS 4 /bin/sh. X-Git-Tag: v0.11~350 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcc59696f727234d25ba8dff8cd26e1cf8d46bf4;p=thirdparty%2Fgettext.git Work around a problem with SunOS 4 /bin/sh. --- diff --git a/m4/ChangeLog b/m4/ChangeLog index 413a5ed71..486c33a90 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,10 @@ +2001-11-01 Bruno Haible + + * 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 * gettext.m4 (AM_GNU_GETTEXT): Make sure "make dist" works even when diff --git a/m4/javacomp.m4 b/m4/javacomp.m4 index a7b4f0718..511dea1ec 100644 --- a/m4/javacomp.m4 +++ b/m4/javacomp.m4 @@ -15,15 +15,28 @@ AC_DEFUN([gt_JAVACOMP], 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 </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