The program may not be installed because it is not needed for non-dev activities, so it is better to check at the beginning than to let the compilation fail later. The check is done only if the user has specified that he wants to install translations.
Took the opportunity to make the generation of "mo" file follow the silent rules in Makefiles if user enabled them. Signed-off-by: Christophe <[email protected]> --- WINGs/po/Makefile.am | 2 +- WPrefs.app/po/Makefile.am | 2 +- m4/wm_i18n.m4 | 5 +++++ po/Makefile.am | 2 +- util/po/Makefile.am | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/WINGs/po/Makefile.am b/WINGs/po/Makefile.am index 3c0a248..076c116 100644 --- a/WINGs/po/Makefile.am +++ b/WINGs/po/Makefile.am @@ -74,7 +74,7 @@ POTFILES += \ SUFFIXES = .po .mo .po.mo: - msgfmt -c -o $@ $< + $(AM_V_GEN)$(MSGFMT) -c -o $@ $< all-local: $(CATALOGS) diff --git a/WPrefs.app/po/Makefile.am b/WPrefs.app/po/Makefile.am index 2f9401d..cd5123f 100644 --- a/WPrefs.app/po/Makefile.am +++ b/WPrefs.app/po/Makefile.am @@ -40,7 +40,7 @@ POTFILES = \ SUFFIXES = .po .mo .po.mo: - msgfmt -c -o $@ $< + $(AM_V_GEN)$(MSGFMT) -c -o $@ $< all-local: $(CATALOGS) diff --git a/m4/wm_i18n.m4 b/m4/wm_i18n.m4 index 7a6340e..88dc70e 100644 --- a/m4/wm_i18n.m4 +++ b/m4/wm_i18n.m4 @@ -47,6 +47,11 @@ AS_IF([test "x$LINGUAS" != "x"], [AC_MSG_ERROR([support for internationalization requested, but gettext was not found])]) LIBS="$wm_save_LIBS" dnl + dnl The program 'msgfmt' is needed to convert the 'po' files into 'mo' files + AC_CHECK_PROG([MSGFMT], [msgfmt], [msgfmt]) + AS_IF([test "x$MSGFMT" = "x"], + [AC_MSG_ERROR([the program 'msgfmt' is mandatory to install translation - do you miss the package 'gettext'?])]) + dnl dnl Environment is sane, let's continue AC_DEFINE([I18N], [1], [Internationalization (I18N) support (set by configure)]) supported_locales="" diff --git a/po/Makefile.am b/po/Makefile.am index 55756fb..578f30c 100644 --- a/po/Makefile.am +++ b/po/Makefile.am @@ -69,7 +69,7 @@ POTFILES = \ SUFFIXES = .po .mo .po.mo: - msgfmt -c -o $@ $< + $(AM_V_GEN)$(MSGFMT) -c -o $@ $< all-local: $(CATALOGS) diff --git a/util/po/Makefile.am b/util/po/Makefile.am index 53d895b..53fa952 100644 --- a/util/po/Makefile.am +++ b/util/po/Makefile.am @@ -15,7 +15,7 @@ POTFILES = \ SUFFIXES = .po .mo .po.mo: - msgfmt -c -o $@ $< + $(AM_V_GEN)$(MSGFMT) -c -o $@ $< all-local: $(CATALOGS) -- 2.1.4 -- To unsubscribe, send mail to [email protected].
