This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for cpplib.pot generation


The instructions in translation.html for regenerating cpplib.pot, and
the corresponding rules in libcpp/Makefile.in, look rather untested:

* There is no cpplib.pot target, only a po/cpplib.pot one.

* The cpplib.pot in CVS uses file names from before cpplib was moved
to its own directory.  Also, they don't include a srcdir path but the
rule does nothing to exclude one from the file.

* The Makefile.in rule does not generate an output file because the
--keyword options to xgettext use "," instead of the ":" which at
least xgettext 0.14.1 expects.

* With that fixed, the messages from the _, N_, SYNTAX_ERROR and
SYNTAX_ERROR2 macros - which existed before the move - still aren't
extracted; those keywords need adding as well.

I tried regenerating cpplib.pot and found those issues.  Although I'm
happy to deal with the .pot file regeneration and submission to the TP
(item 11 of the branching checklist) when 4.0 branches, having been
dealing with TP matters lately (unless the i18n maintainer wishes to
take over these matters again), it seems better for them to be fixed
now rather than waiting for discovery when the branching checklist is
being followed.

This patch fixes those issues.  The fix to stop srcdir paths getting
in follows that in my unreviewed exgettext patch
<http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00451.html>.

Bootstrapped with no regressions on i686-pc-linux-gnu, and
successfully regenerates cpplib.pot.  OK to commit?  (I'd regenerate
cpplib.pot after committing.)

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>

	* Makefile.in ($(PACKAGE).pot): New rule.  Depend on
	po/$(PACKAGE).pot.
	(po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
	arguments.  Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
	Remove local srcdir path from generated file.

diff -rupN GCC.orig/libcpp/Makefile.in GCC/libcpp/Makefile.in
--- GCC.orig/libcpp/Makefile.in	2004-10-11 08:50:28.000000000 +0000
+++ GCC/libcpp/Makefile.in	2004-11-09 17:03:11.000000000 +0000
@@ -207,14 +207,19 @@ update-po: $(CATALOGS:.gmo=.pox)
 	                else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
 
 # Rule for regenerating the message template.
+$(PACKAGE).pot: po/$(PACKAGE).pot
 po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
 	-test -d $(srcdir)/po || mkdir $(srcdir)/po
 	$(XGETTEXT) --default-domain=$(PACKAGE) \
-	  --keyword=cpp_error,3 --keyword=cpp_errno,3 \
-	  --keyword=cpp_error_with_line,5 \
+	  --keyword=_ --keyword=N_ \
+	  --keyword=cpp_error:3 --keyword=cpp_errno:3 \
+	  --keyword=cpp_error_with_line:5 \
+	  --keyword=SYNTAX_ERROR --keyword=SYNTAX_ERROR2 \
 	  --copyright-holder="Free Software Foundation, Inc." \
 	  --msgid-bugs-address="http://gcc.gnu.org/bugs.html"; \
-	  --language=c -o po/$(PACKAGE).pot $^
+	  --language=c -o po/$(PACKAGE).pot.tmp $^
+	sed 's:$(srcdir)/::g' <po/$(PACKAGE).pot.tmp >po/$(PACKAGE).pot
+	rm po/$(PACKAGE).pot.tmp
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]