]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
More robust detection of GNU msgfmt and GNU xgettext.
authorBruno Haible <bruno@clisp.org>
Wed, 30 May 2001 21:56:35 +0000 (21:56 +0000)
committerBruno Haible <bruno@clisp.org>
Wed, 30 May 2001 21:56:35 +0000 (21:56 +0000)
m4/ChangeLog
m4/gettext.m4
m4/progtest.m4

index 57c30a9c965087073a6a6d3de78fa27546953625..ca0377ea484ea779e9190f35a4ef2d8d13daf2bb 100644 (file)
@@ -1,3 +1,10 @@
+2001-05-30  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettext.m4 (AM_WITH_NLS): Look only for GNU msgfmt and GNU xgettext.
+       Set the variables to ":" if not found.
+       * progtest.m4 (AM_PATH_PROG_WITH_TEST): If not found, print "no", not
+       the default value.
+
 2001-05-23  Bruno Haible  <haible@clisp.cons.org>
 
        * gettext-0.10.38 released.
index 05358c480c9d1645edf3add9e8417a31bdfdcddf..110e79b752c25a807c414478aa594a0f680b5024 100644 (file)
@@ -6,7 +6,7 @@
 # but which still want to provide support for the GNU gettext functionality.
 # Please note that the actual code is *not* freely available.
 
-# serial 9
+# serial 10
 
 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
@@ -117,14 +117,14 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", ""
             AC_CHECK_FUNCS(dcgettext)
             LIBS="$gt_save_LIBS"
 
+            dnl Search for GNU msgfmt in the PATH.
             AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
-              [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
-            if test "$MSGFMT" != "no"; then
-              AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
-            fi
+              [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
+            AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
+            dnl Search for GNU xgettext in the PATH.
             AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
-              [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+              [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
 
             CATOBJEXT=.gmo
           fi
@@ -141,10 +141,10 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", ""
         dnl Mark actions used to generate GNU NLS library.
         INTLOBJS="\$(GETTOBJS)"
         AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
-         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
+         [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
         AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
-         [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+         [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
         AC_SUBST(MSGFMT)
        BUILD_INCLUDED_LIBINTL=yes
        USE_INCLUDED_LIBINTL=yes
@@ -153,11 +153,26 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", ""
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
       fi
 
+      dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
+      dnl Test whether we really found GNU msgfmt.
+      if test "$GMSGFMT" != ":"; then
+       dnl If it is no GNU msgfmt we define it as : so that the
+       dnl Makefiles still can work.
+       if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
+         : ;
+       else
+         AC_MSG_RESULT(
+           [found msgfmt program is not GNU msgfmt; ignore it])
+         GMSGFMT=":"
+       fi
+      fi
+
+      dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
       dnl Test whether we really found GNU xgettext.
       if test "$XGETTEXT" != ":"; then
        dnl If it is no GNU xgettext we define it as : so that the
        dnl Makefiles still can work.
-       if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+       if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
          : ;
        else
          AC_MSG_RESULT(
index aa3c2180941807aca5c94581fb5307e85ab994fb..e467ec1ce5d6f209fc7fc83bbbed37b210bec9e0 100644 (file)
@@ -6,7 +6,7 @@
 # but which still want to provide support for the GNU gettext functionality.
 # Please note that the actual code is *not* freely available.
 
-# serial 1
+# serial 2
 
 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
@@ -38,7 +38,7 @@ ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
   ;;
 esac])dnl
 $1="$ac_cv_path_$1"
-if test -n "[$]$1"; then
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
   AC_MSG_RESULT([$]$1)
 else
   AC_MSG_RESULT(no)