From b944a4beb2b5d083395f460f1f7b0f22e8203b62 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Tue, 20 Jan 2015 22:03:58 +0100 Subject: [PATCH] configure: add check for the program "msgfmt" when i18n is requested 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 --- 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 3c0a2487..076c1166 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 2f9401d8..cd5123fb 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 7a6340e0..88dc70e4 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 55756fb7..578f30c8 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 53d895bd..53fa9529 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.11.4.GIT