Javier Jardón <[email protected]> writes: > For gdk-pixbuf, for example, was decided to use a kind of ugly patch > in autogen.sh to make the .pot files old enough so .po doesnt get > updated see [2] > > I wonder if a better solution exist?
Currently no, but in the long term we could surely improve the build stuff to support different workflows. A quick idea is adding an option to AM_PO_SUBDIRS to skip auto-update rules: AM_PO_SUBDIRS([no-update]) The attached is a proof-of-concept patch, FWIW. Regards, -- Daiki Ueno
>From a0c59674b3d6a3bc76f07f5e424de10f66e56dc8 Mon Sep 17 00:00:00 2001 From: Daiki Ueno <[email protected]> Date: Tue, 23 Jul 2013 16:52:35 +0900 Subject: [PATCH] autopoint: add option to skip PO file generation * m4/po.m4 (AM_PO_SUBDIRS): Add 'no-update' option to skip auto-update rules. * po/Makefile.in.in (stamp-po-update-yes): New rule renamed from stamp-po. (stamp-po-update-no): New empty rule. (stamp-po): Call them. (dist-update-yes): New rule renamed from dist. (dist-update-no): New empty rule. (dist): Call them. --- gettext-runtime/m4/po.m4 | 32 ++++++++++++++++++++++++++++++++ gettext-runtime/po/Makefile.in.in | 18 +++++++++++++++++- gettext-tools/po/Makefile.in.in | 18 +++++++++++++++++- 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/gettext-runtime/m4/po.m4 b/gettext-runtime/m4/po.m4 index 1c70b6c..bad357c 100644 --- a/gettext-runtime/m4/po.m4 +++ b/gettext-runtime/m4/po.m4 @@ -20,8 +20,15 @@ dnl Bruno Haible <[email protected]>, 2000-2003. AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. +dnl Usage: AM_PO_SUBDIRS([OPTIONS]). AC_DEFUN([AM_PO_SUBDIRS], [ + dnl Argument checking. + gt_SET_OPTIONS([$1]) + UPDATE=yes + gt_IF_OPTION([no-update], UPDATE=no) + AC_SUBST([UPDATE]) + AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl @@ -451,3 +458,28 @@ AC_DEFUN([AM_XGETTEXT_OPTION], AC_REQUIRE([AM_XGETTEXT_OPTION_INIT]) XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1" ]) + +# Option parsing, copied and renamed from Automake's options.m4. + +# gt_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([gt_MANGLE_OPTION], +[[gt_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# gt_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([gt_SET_OPTION], +[m4_define(gt_MANGLE_OPTION([$1]), [1])]) + +# gt_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([gt_SET_OPTIONS], +[m4_foreach_w([gt_Option], [$1], [gt_SET_OPTION(gt_Option)])]) + +# gt_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([gt_IF_OPTION], +[m4_ifset(gt_MANGLE_OPTION([$1]), [$2], [$3])]) diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in index fabdc76..29d79ae 100644 --- a/gettext-runtime/po/Makefile.in.in +++ b/gettext-runtime/po/Makefile.in.in @@ -123,7 +123,10 @@ CHECK_MACRO_VERSION = \ # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. -stamp-po: $(srcdir)/$(DOMAIN).pot +stamp-po: + @$(MAKE) stamp-po-update-@UPDATE@ + +stamp-po-update-yes: $(srcdir)/$(DOMAIN).pot @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @@ -133,6 +136,12 @@ stamp-po: $(srcdir)/$(DOMAIN).pot mv stamp-poT stamp-po; \ } +stamp-po-update-no: + @$(CHECK_MACRO_VERSION) + @echo "touch stamp-po" && \ + echo timestamp > stamp-poT && \ + mv stamp-poT stamp-po; + # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. @@ -362,8 +371,15 @@ maintainer-clean: distclean distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: + $(MAKE) dist-update-@UPDATE@ + +dist-update-yes: $(MAKE) update-po @$(MAKE) dist2 + +dist-update-no: + @$(MAKE) dist2 + # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ diff --git a/gettext-tools/po/Makefile.in.in b/gettext-tools/po/Makefile.in.in index fabdc76..29d79ae 100644 --- a/gettext-tools/po/Makefile.in.in +++ b/gettext-tools/po/Makefile.in.in @@ -123,7 +123,10 @@ CHECK_MACRO_VERSION = \ # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. -stamp-po: $(srcdir)/$(DOMAIN).pot +stamp-po: + @$(MAKE) stamp-po-update-@UPDATE@ + +stamp-po-update-yes: $(srcdir)/$(DOMAIN).pot @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @@ -133,6 +136,12 @@ stamp-po: $(srcdir)/$(DOMAIN).pot mv stamp-poT stamp-po; \ } +stamp-po-update-no: + @$(CHECK_MACRO_VERSION) + @echo "touch stamp-po" && \ + echo timestamp > stamp-poT && \ + mv stamp-poT stamp-po; + # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. @@ -362,8 +371,15 @@ maintainer-clean: distclean distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: + $(MAKE) dist-update-@UPDATE@ + +dist-update-yes: $(MAKE) update-po @$(MAKE) dist2 + +dist-update-no: + @$(MAKE) dist2 + # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ -- 1.8.3.1
