From: Bruno Haible Date: Tue, 15 Jan 2002 12:52:49 +0000 (+0000) Subject: FreeBSD portability. X-Git-Tag: v0.11~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74ccb05f7fbca72155259e0ae3e8c014058e79b7;p=thirdparty%2Fgettext.git FreeBSD portability. --- diff --git a/m4/ChangeLog b/m4/ChangeLog index 7b4c9d3e8..a3c654f56 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,9 @@ +2002-01-12 Bruno Haible + + * 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 * gettext.m4 (AM_PO_SUBDIRS): Look for Rules-* files in the source dir, diff --git a/m4/gettext.m4 b/m4/gettext.m4 index 8ffba956c..0ac5a9a4c 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -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([