]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
FreeBSD portability.
authorBruno Haible <bruno@clisp.org>
Tue, 15 Jan 2002 12:52:49 +0000 (12:52 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 22:59:28 +0000 (00:59 +0200)
m4/ChangeLog
m4/gettext.m4

index 7b4c9d3e8945cceaa07b66505b3c7880e3668efd..a3c654f562a434daa443cb3b3f5dfb48a6bcc4b1 100644 (file)
@@ -1,3 +1,9 @@
+2002-01-12  Bruno Haible  <bruno@clisp.org>
+
+       * gettext.m4 (AM_PO_SUBDIRS): Exclude FreeBSD's msgfmt and xgettext
+       programs. They give usage messages on stderr but then terminate with
+       exit code 0.
+
 2002-01-05  Bruno Haible  <bruno@clisp.org>
 
        * gettext.m4 (AM_PO_SUBDIRS): Look for Rules-* files in the source dir,
index 8ffba956cb2202b75a8fbf996e02a7addeca0769..0ac5a9a4c51b8457f3f0ffb8b426d70759c1c8d9 100644 (file)
@@ -255,13 +255,23 @@ AC_DEFUN([AM_PO_SUBDIRS],
   dnl because they are needed for "make dist" to work.
 
   dnl Search for GNU msgfmt in the PATH.
+  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
+  dnl The second test excludes FreeBSD msgfmt.
   AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
-    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
+    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
+     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+    :)
   AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
   dnl Search for GNU xgettext 0.11 or newer in the PATH.
+  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
+  dnl The second test excludes FreeBSD xgettext.
   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
-    [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1], :)
+    [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
+     (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+    :)
+  dnl Remove leftover from FreeBSD xgettext call.
+  rm -f messages.po
 
   dnl Search for GNU msgmerge 0.11 or newer in the PATH.
   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
@@ -272,7 +282,8 @@ AC_DEFUN([AM_PO_SUBDIRS],
   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
+    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
+       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
       : ;
     else
       AC_MSG_RESULT(
@@ -286,13 +297,16 @@ AC_DEFUN([AM_PO_SUBDIRS],
   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 --copyright-holder= /dev/null >/dev/null 2>&1; then
+    if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
+       (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
       : ;
     else
       AC_MSG_RESULT(
         [found xgettext program is not GNU xgettext; ignore it])
       XGETTEXT=":"
     fi
+    dnl Remove leftover from FreeBSD xgettext call.
+    rm -f messages.po
   fi
 
   AC_OUTPUT_COMMANDS([