]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Work around a problem with SunOS 4 /bin/sh.
authorBruno Haible <bruno@clisp.org>
Thu, 1 Nov 2001 11:15:53 +0000 (11:15 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 20:48:08 +0000 (22:48 +0200)
m4/ChangeLog
m4/javacomp.m4
m4/javaexec.m4

index 413a5ed715d22a90fb2a75fef46f0888bbe103d3..486c33a905d5c680f471fbd6e2067923068b63d8 100644 (file)
@@ -1,3 +1,10 @@
+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
index a7b4f07184c2bd3049e2a2f8d6cbd997670b6807..511dea1ec22bd2c18fb050dce0fda99fbcc604db 100644 (file)
@@ -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 <<EOF
 public class conftest {
index 99604ae8d64c296e4d12c63fec534e621b4c78da..7a00aea95a57fcd838df85f01e7a0b5ddfbb31a6 100644 (file)
@@ -15,19 +15,33 @@ AC_DEFUN([gt_JAVAEXEC],
   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