[PATCH 02/10] Move the intltool Makefile rules into configure.ac

Chris Lumens clumens at redhat.com
Fri Aug 15 15:27:16 UTC 2014


From: David Shea <dshea at redhat.com>

This copies the rule for running intltool-merge on .desktop files from
IT_PROG_INTLTOOL in intltool.m4. We're not using the macro itself
because it expects us to run intltoolize on the source tree, and the
intltool version of Makefile.in.in breaks some of the things gettext
does. But at least this way the intltool-merge rule is in one place
instead of two, and it works right when run outside of $srcdir.

Also added autoconf checks for the intltool programs.

Related: rhbz#1121678
---
 .gitignore                      |  1 +
 configure.ac                    | 25 +++++++++++++++++++++++++
 data/liveinst/Makefile.am       |  7 +------
 data/liveinst/gnome/Makefile.am |  7 +------
 4 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/.gitignore b/.gitignore
index af3f06a..d50106c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,6 +55,7 @@ po/en at quot.po
 po/remove-potcdate.sed
 po/stamp-po
 po/tmp
+po/.intltool-merge-cache
 py-compile
 stamp-h1
 tags
diff --git a/configure.ac b/configure.ac
index 6b40fb6..27a6341 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,31 @@ AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AC_PROG_LIBTOOL
 
+# Check for the intltool programs
+# These checks and subsitutions are adapted IT_PROG_INTLTOOL provided in
+# intltool.m4, but without the parts where it breaks gettext.
+AC_PATH_PROG([INTLTOOL_EXTRACT], [intltool-extract])
+AC_PATH_PROG([INTLTOOL_MERGE], [intltool-merge])
+AS_IF([test -z "$INTLTOOL_EXTRACT" -o -z "$INTLTOOL_MERGE"],
+      [AC_MSG_ERROR([*** intltool not found])])
+
+# Add the bits for Makefile rules
+INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))'
+INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))'
+INTLTOOL__v_MERGE_0='@echo "  ITMRG " $@;'
+INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))'
+intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))'
+intltool__v_merge_options_0='-q'
+AC_SUBST(INTLTOOL_V_MERGE)
+AC_SUBST(INTLTOOL__v_MERGE_)
+AC_SUBST(INTLTOOL__v_MERGE_0)
+AC_SUBST(INTLTOOL_V_MERGE_OPTIONS)
+AC_SUBST(intltool__v_merge_options_)
+AC_SUBST(intltool__v_merge_options_0)
+
+INTLTOOL_DESKTOP_RULE='%.desktop:  %.desktop.in  $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
+AC_SUBST(INTLTOOL_DESKTOP_RULE)
+
 AM_GNU_GETTEXT([external])
 
 # Checks for libraries.
diff --git a/data/liveinst/Makefile.am b/data/liveinst/Makefile.am
index 0da8c6c..7274b3f 100644
--- a/data/liveinst/Makefile.am
+++ b/data/liveinst/Makefile.am
@@ -35,12 +35,7 @@ CLEANFILES = liveinst.desktop *.h
 
 MAINTAINERCLEANFILES = Makefile.in
 
-intltool_merge_verbose = $(intltool_merge_verbose_$(V))
-intltool_merge_verbose_ = $(intltool_merge_verbose_$(AM_DEFAULT_VERBOSITY))
-intltool_merge_verbose_0 = @echo "  MERGE  "$@;
-
-liveinst.desktop: liveinst.desktop.in
-	$(intltool_merge_verbose)LC_ALL=C intltool-merge -q -d -u $(top_srcdir)/po liveinst.desktop.in liveinst.desktop
+ at INTLTOOL_DESKTOP_RULE@
 
 install-exec-local:
 	mkdir -p $(DESTDIR)$(bindir)
diff --git a/data/liveinst/gnome/Makefile.am b/data/liveinst/gnome/Makefile.am
index 174a04f..706cd10 100644
--- a/data/liveinst/gnome/Makefile.am
+++ b/data/liveinst/gnome/Makefile.am
@@ -27,9 +27,4 @@ CLEANFILES = fedora-welcome.desktop
 
 MAINTAINERCLEANFILES = Makefile.in
 
-intltool_merge_verbose = $(intltool_merge_verbose_$(V))
-intltool_merge_verbose_ = $(intltool_merge_verbose_$(AM_DEFAULT_VERBOSITY))
-intltool_merge_verbose_0 = @echo "  MERGE  "$@;
-
-fedora-welcome.desktop: fedora-welcome.desktop.in
-	$(intltool_merge_verbose)LC_ALL=C intltool-merge -q -d -u $(top_srcdir)/po fedora-welcome.desktop.in fedora-welcome.desktop
+ at INTLTOOL_DESKTOP_RULE@
-- 
1.9.3



More information about the anaconda-patches mailing list