This is the mail archive of the mailing list for the binutils 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]

ld message translation for emultempl and emulparams

Most of the emultempl/*.em error/warning messages do not currently
appear in ld.pot, and fixing that is not simply a matter of adding
missing files to POTFILES.  The difficulty is the shell-script
quoting, for example aarch64elf.em:PARSE_AND_LIST_OPTIONS "Don'\''t".
I suppose you could avoid contractions like "don't" but I'm unsure as
to whether gettext could handle everything in the emulparams scripts.

The right thing to do is feed the generated C files to gettext, as
this patch does.  The patch just copies what is already done in bfd/
for generated files.

	(po/ Delete rule.
	(po/, po/ New rules.
	* Add AC_CONFIG_COMMANDS to create po/Makefile.
	* po/Make-in (DISTFILES): Remove, add
	(POTFILES): Delete.
	(SRC-POTFILES, BLD-POTFILES): Define place marker.
	(ld.pot): Build from SRC-POTFILES plus BLD-POTFILES.
	(distclean, maintainer-clean): Tidy up new files.
	(POTFILES, Delete rules.
	New rules.
	(Makefile): Depend on SRC-POTFILES and BLD-POTFILES.
	* po/ Rename from po/
	* po/ New file.
	* Regenerate.
	* configure: Regenerate.

diff --git a/ld/ b/ld/
index 6243c12..d94fce7 100644
--- a/ld/
+++ b/ld/
@@ -590,15 +590,16 @@ endif
 	$(COMPILE) -c `test -f deffilep.c || echo $(srcdir)/`deffilep.c $(NO_WERROR)
-# At the moment this is just a list of those emulation template files
-# that contain internationalised strings.
-EMULATION_FILES = emultempl/pe.em emultempl/armcoff.em
+po/ @MAINT@ Makefile
+	for f in $(SRC_POTFILES); do echo $$f; done | LC_ALL=C sort > $@-tmp \
+	  && mv $@-tmp $(srcdir)/po/
-po/ @MAINT@ Makefile
-	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
-	  && mv tmp $(srcdir)/po/
+po/ @MAINT@ Makefile $(BLD_POTFILES)
+	for f in $(BLD_POTFILES); do echo $$f; done | LC_ALL=C sort > $@-tmp \
+	  && mv $@-tmp $(srcdir)/po/
 ldmain.@OBJEXT@: ldmain.c config.status
 if am__fastdepCC
diff --git a/ld/ b/ld/
index bada1b5..6da8c8e 100644
--- a/ld/
+++ b/ld/
@@ -491,6 +491,26 @@ if test x${EXTRA_SHLIB_EXTENSION} != x ; then
    [Additional extension a shared object might have.])
+case "$srcdir" in
+  .) srcdirpre= ;;
+  *) srcdirpre='$(srcdir)/' ;;
+for lang in dummy $OBSOLETE_ALL_LINGUAS; do
+  if test $lang != dummy; then
+    POFILES="$POFILES $srcdirpre$lang.po"
+    GMOFILES="$GMOFILES $srcdirpre$"
+  fi
+sed -e '/^SRC-POTFILES =/r po/SRC-POTFILES' \
+    -e '/^BLD-POTFILES =/r po/BLD-POTFILES' \
+    -e "s,@POFILES@,$POFILES," \
+    -e "s,@GMOFILES@,$GMOFILES," \
+    po/ > po/Makefile]],[[]])
 dnl Required by html, pdf, install-pdf and install-html
diff --git a/ld/po/ b/ld/po/
new file mode 100644
index 0000000..dc16636
--- /dev/null
+++ b/ld/po/
@@ -0,0 +1,362 @@
diff --git a/ld/po/Make-in b/ld/po/Make-in
index 7e38f5d..3f7064f 100644
--- a/ld/po/Make-in
+++ b/ld/po/Make-in
@@ -50,10 +50,12 @@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
 SOURCES = cat-id-tbl.c
-DISTFILES = ChangeLog $(PACKAGE).pot \
+DISTFILES = ChangeLog $(PACKAGE).pot \
 stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
@@ -86,11 +88,16 @@ all: all-@USE_NLS@
 all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot
-$(srcdir)/$(PACKAGE).pot: $(POTFILES)
+$(srcdir)/$(PACKAGE).pot: $(SRC-POTFILES) $(BLD-POTFILES)
 	$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
-	  --add-comments -C --keyword=_ --keyword=N_ \
+	  --add-comments --keyword=_ --keyword=N_ \
+ \
+	  --files-from=$(srcdir)/
+	$(XGETTEXT) --default-domain=$(PACKAGE) --directory=.. \
+	  --add-comments --keyword=_ --keyword=N_ \
+	  --join-existing \ \
-	  --files-from=$(srcdir)/
+	  --files-from=$(srcdir)/
 	rm -f $(srcdir)/$(PACKAGE).pot
 	mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
@@ -198,12 +205,13 @@ mostlyclean:
 clean: mostlyclean
 distclean: clean
-	rm -f Makefile POTFILES *.mo *.msg *.cat *.cat.m
+	rm -f Makefile *.mo *.msg *.cat *.cat.m
 maintainer-clean: distclean
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
-	rm -f $(GMOFILES)
+	rm -f $(GMOFILES)
 distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
 dist distdir: update-po $(DISTFILES)
@@ -232,7 +240,7 @@ update-po: Makefile
 	  fi; \
 	( if test 'x$(srcdir)' != 'x.'; then \
 	    posrcprefix='$(top_srcdir)/'; \
 	  else \
@@ -245,10 +253,21 @@ POTFILES:
 	    && chmod a-w $@-t \
 	    && mv $@-t $@ ) @MAINT@ ../Makefile
-	cd .. && $(MAKE) po/
+	  rm -f $@-t $@ \
+	  && sed -e '/^#/d' -e '/^[	 ]*$$/d' \
+		 -e "s@.*@	../& \\\\@" < $(srcdir)/$ \
+	     | sed -e '$$s/\\$$//' > $@-t \
+	  && chmod a-w $@-t \
+	  && mv $@-t $@
+ @MAINT@ ../Makefile
+	cd .. && $(MAKE) po/
+ @MAINT@ ../Makefile
+	cd .. && $(MAKE) po/
-Makefile: Make-in ../config.status POTFILES
+Makefile: Make-in ../config.status SRC-POTFILES BLD-POTFILES
 	cd .. \
 	  && CONFIG_FILES=$(subdir)/$(subdir)/Make-in \
 	     CONFIG_HEADERS= $(SHELL) ./config.status
diff --git a/ld/po/ b/ld/po/
deleted file mode 100644
index fcc2894..0000000
--- a/ld/po/
+++ /dev/null
@@ -1,37 +0,0 @@
diff --git a/ld/po/ b/ld/po/
new file mode 100644
index 0000000..1628826
--- /dev/null
+++ b/ld/po/
@@ -0,0 +1,35 @@

Alan Modra
Australia Development Lab, IBM

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