aboutsummaryrefslogtreecommitdiff
path: root/po/Makefile.in.in
diff options
context:
space:
mode:
Diffstat (limited to 'po/Makefile.in.in')
-rw-r--r--po/Makefile.in.in108
1 files changed, 90 insertions, 18 deletions
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index 5022b8b18..65184f65c 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -1,5 +1,5 @@
1# Makefile for PO directory in any package using GNU gettext. 1# Makefile for PO directory in any package using GNU gettext.
2# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu> 2# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
3# 3#
4# This file can be copied and used freely without restrictions. It can 4# This file can be copied and used freely without restrictions. It can
5# be used in projects which are not available under the GNU General Public 5# be used in projects which are not available under the GNU General Public
@@ -8,12 +8,14 @@
8# Please note that the actual code of GNU gettext is covered by the GNU 8# Please note that the actual code of GNU gettext is covered by the GNU
9# General Public License and is *not* in the public domain. 9# General Public License and is *not* in the public domain.
10# 10#
11# Origin: gettext-0.16 11# Origin: gettext-0.19
12GETTEXT_MACRO_VERSION = 0.19
12 13
13PACKAGE = @PACKAGE@ 14PACKAGE = @PACKAGE@
14VERSION = @VERSION@ 15VERSION = @VERSION@
15PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 16PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
16 17
18SED = @SED@
17SHELL = /bin/sh 19SHELL = /bin/sh
18@SET_MAKE@ 20@SET_MAKE@
19 21
@@ -75,6 +77,16 @@ POTFILES = \
75 77
76CATALOGS = @CATALOGS@ 78CATALOGS = @CATALOGS@
77 79
80POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
81POFILESDEPS_yes = $(POFILESDEPS_)
82POFILESDEPS_no =
83POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
84
85DISTFILESDEPS_ = update-po
86DISTFILESDEPS_yes = $(DISTFILESDEPS_)
87DISTFILESDEPS_no =
88DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
89
78# Makevars gets inserted here. (Don't remove this line!) 90# Makevars gets inserted here. (Don't remove this line!)
79 91
80.SUFFIXES: 92.SUFFIXES:
@@ -87,8 +99,8 @@ CATALOGS = @CATALOGS@
87.po.gmo: 99.po.gmo:
88 @lang=`echo $* | sed -e 's,.*/,,'`; \ 100 @lang=`echo $* | sed -e 's,.*/,,'`; \
89 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 101 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
90 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ 102 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
91 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo 103 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
92 104
93.sin.sed: 105.sin.sed:
94 sed -e '/^#/d' $< > t-$@ 106 sed -e '/^#/d' $< > t-$@
@@ -100,6 +112,13 @@ all: all-@USE_NLS@
100all-yes: stamp-po 112all-yes: stamp-po
101all-no: 113all-no:
102 114
115# Ensure that the gettext macros and this Makefile.in.in are in sync.
116CHECK_MACRO_VERSION = \
117 test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
118 || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
119 exit 1; \
120 }
121
103# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no 122# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
104# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because 123# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
105# we don't want to bother translators with empty POT files). We assume that 124# we don't want to bother translators with empty POT files). We assume that
@@ -115,6 +134,7 @@ all-no:
115# $(POFILES) has been designed to not touch files that don't need to be 134# $(POFILES) has been designed to not touch files that don't need to be
116# changed. 135# changed.
117stamp-po: $(srcdir)/$(DOMAIN).pot 136stamp-po: $(srcdir)/$(DOMAIN).pot
137 @$(CHECK_MACRO_VERSION)
118 test ! -f $(srcdir)/$(DOMAIN).pot || \ 138 test ! -f $(srcdir)/$(DOMAIN).pot || \
119 test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) 139 test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
120 @test ! -f $(srcdir)/$(DOMAIN).pot || { \ 140 @test ! -f $(srcdir)/$(DOMAIN).pot || { \
@@ -129,17 +149,53 @@ stamp-po: $(srcdir)/$(DOMAIN).pot
129 149
130# This target rebuilds $(DOMAIN).pot; it is an expensive operation. 150# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
131# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. 151# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
152# The determination of whether the package xyz is a GNU one is based on the
153# heuristic whether some file in the top level directory mentions "GNU xyz".
154# If GNU 'find' is available, we avoid grepping through monster files.
132$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed 155$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
156 package_gnu="$(PACKAGE_GNU)"; \
157 test -n "$$package_gnu" || { \
158 if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
159 LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \
160 -size -10000000c -exec grep 'GNU @PACKAGE@' \
161 /dev/null '{}' ';' 2>/dev/null; \
162 else \
163 LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
164 fi; \
165 } | grep -v 'libtool:' >/dev/null; then \
166 package_gnu=yes; \
167 else \
168 package_gnu=no; \
169 fi; \
170 }; \
171 if test "$$package_gnu" = "yes"; then \
172 package_prefix='GNU '; \
173 else \
174 package_prefix=''; \
175 fi; \
133 if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ 176 if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
134 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ 177 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
135 else \ 178 else \
136 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ 179 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
137 fi; \ 180 fi; \
138 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ 181 case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
139 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ 182 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
140 --files-from=$(srcdir)/POTFILES.in \ 183 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
141 --copyright-holder='$(COPYRIGHT_HOLDER)' \ 184 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
142 --msgid-bugs-address="$$msgid_bugs_address" 185 --files-from=$(srcdir)/POTFILES.in \
186 --copyright-holder='$(COPYRIGHT_HOLDER)' \
187 --msgid-bugs-address="$$msgid_bugs_address" \
188 ;; \
189 *) \
190 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
191 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
192 --files-from=$(srcdir)/POTFILES.in \
193 --copyright-holder='$(COPYRIGHT_HOLDER)' \
194 --package-name="$${package_prefix}@PACKAGE@" \
195 --package-version='@VERSION@' \
196 --msgid-bugs-address="$$msgid_bugs_address" \
197 ;; \
198 esac
143 test ! -f $(DOMAIN).po || { \ 199 test ! -f $(DOMAIN).po || { \
144 if test -f $(srcdir)/$(DOMAIN).pot; then \ 200 if test -f $(srcdir)/$(DOMAIN).pot; then \
145 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ 201 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
@@ -163,12 +219,20 @@ $(srcdir)/$(DOMAIN).pot:
163 219
164# This target rebuilds a PO file if $(DOMAIN).pot has changed. 220# This target rebuilds a PO file if $(DOMAIN).pot has changed.
165# Note that a PO file is not touched if it doesn't need to be changed. 221# Note that a PO file is not touched if it doesn't need to be changed.
166$(POFILES): $(srcdir)/$(DOMAIN).pot 222$(POFILES): $(POFILESDEPS)
167 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ 223 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
168 if test -f "$(srcdir)/$${lang}.po"; then \ 224 if test -f "$(srcdir)/$${lang}.po"; then \
225 test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \
169 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 226 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
170 echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ 227 echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
171 cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ 228 cd $(srcdir) \
229 && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
230 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
231 $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
232 *) \
233 $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
234 esac; \
235 }; \
172 else \ 236 else \
173 $(MAKE) $${lang}.po-create; \ 237 $(MAKE) $${lang}.po-create; \
174 fi 238 fi
@@ -191,7 +255,6 @@ install-data: install-data-@USE_NLS@
191 fi 255 fi
192install-data-no: all 256install-data-no: all
193install-data-yes: all 257install-data-yes: all
194 $(mkdir_p) $(DESTDIR)$(datadir)
195 @catalogs='$(CATALOGS)'; \ 258 @catalogs='$(CATALOGS)'; \
196 for cat in $$catalogs; do \ 259 for cat in $$catalogs; do \
197 cat=`basename $$cat`; \ 260 cat=`basename $$cat`; \
@@ -243,7 +306,6 @@ installdirs-data: installdirs-data-@USE_NLS@
243 fi 306 fi
244installdirs-data-no: 307installdirs-data-no:
245installdirs-data-yes: 308installdirs-data-yes:
246 $(mkdir_p) $(DESTDIR)$(datadir)
247 @catalogs='$(CATALOGS)'; \ 309 @catalogs='$(CATALOGS)'; \
248 for cat in $$catalogs; do \ 310 for cat in $$catalogs; do \
249 cat=`basename $$cat`; \ 311 cat=`basename $$cat`; \
@@ -321,7 +383,7 @@ maintainer-clean: distclean
321 383
322distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) 384distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
323dist distdir: 385dist distdir:
324 $(MAKE) update-po 386 test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
325 @$(MAKE) dist2 387 @$(MAKE) dist2
326# This is a separate target because 'update-po' must be executed before. 388# This is a separate target because 'update-po' must be executed before.
327dist2: stamp-po $(DISTFILES) 389dist2: stamp-po $(DISTFILES)
@@ -369,9 +431,15 @@ update-po: Makefile
369 tmpdir=`pwd`; \ 431 tmpdir=`pwd`; \
370 echo "$$lang:"; \ 432 echo "$$lang:"; \
371 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 433 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
372 echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ 434 echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
373 cd $(srcdir); \ 435 cd $(srcdir); \
374 if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ 436 if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
437 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
438 $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
439 *) \
440 $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
441 esac; \
442 }; then \
375 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 443 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
376 rm -f $$tmpdir/$$lang.new.po; \ 444 rm -f $$tmpdir/$$lang.new.po; \
377 else \ 445 else \
@@ -392,9 +460,13 @@ $(DUMMYPOFILES):
392update-gmo: Makefile $(GMOFILES) 460update-gmo: Makefile $(GMOFILES)
393 @: 461 @:
394 462
463# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
464# because execution permission bits may not work on the current file system.
465# Use @SHELL@, which is the shell determined by autoconf for the use by its
466# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
395Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ 467Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
396 cd $(top_builddir) \ 468 cd $(top_builddir) \
397 && $(SHELL) ./config.status $(subdir)/$@.in po-directories 469 && @SHELL@ ./config.status $(subdir)/$@.in po-directories
398 470
399force: 471force:
400 472