From: Bruno Haible Date: Mon, 12 Nov 2001 12:26:20 +0000 (+0000) Subject: Make "update-po" work in VPATH builds as well. X-Git-Tag: v0.11~309 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac2b61ab8f541bcd9f9f90094a808fbe4e0c77c0;p=thirdparty%2Fgettext.git Make "update-po" work in VPATH builds as well. --- diff --git a/m4/ChangeLog b/m4/ChangeLog index aae234e22..532e92a7d 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,8 @@ +2001-11-11 Bruno Haible + + * gettext.m4 (AM_GNU_GETTEXT): For builds with $builddir != $srcdir, + prepend $(srcdir) to all elements of POFILES and GMOFILES. + 2001-11-11 Bruno Haible * javaexec.m4 (gt_JAVAEXEC): Use HAVE_JAVA instead of HAVE_JAVA_JVM. diff --git a/m4/gettext.m4 b/m4/gettext.m4 index a8678a64e..4b0445839 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -257,11 +257,15 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "" # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' fi + case "$ac_given_srcdir" in + .) srcdirpre= ;; + *) srcdirpre='$(srcdir)/' ;; + esac GMOFILES= POFILES= for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" + GMOFILES="$GMOFILES $srcdirpre$lang.gmo" + POFILES="$POFILES $srcdirpre$lang.po" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. diff --git a/po/ChangeLog b/po/ChangeLog index 156d20886..16f2e4ba6 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,10 @@ +2001-11-11 Bruno Haible + + * Makefile.in.in: Always use sed with -e option. + (.po.gmo): Use 'echo' to make the command look prettier. + ($(POFILES)): Likewise. Make it work in the case $builddir != $srcdir. + (dist2): Make it work in the case $(srcdir) is an absolute directory. + 2001-11-06 Paolo Bonzini Bruno Haible diff --git a/po/Makefile.in.in b/po/Makefile.in.in index dee3276a8..4be129b7c 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -55,8 +55,10 @@ CATALOGS = @CATALOGS@ $(MSGFMT) -c -o $@ $< .po.gmo: - file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ - && rm -f $$file && $(GMSGFMT) -c --statistics -o $$file $< + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po all: all-@USE_NLS@ @@ -77,7 +79,10 @@ $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot ) $(POFILES): force - $(MSGMERGE_UPDATE) $@ $(srcdir)/$(PACKAGE).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(PACKAGE).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(PACKAGE).pot install: install-exec install-data @@ -96,7 +101,7 @@ install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ - lang=`echo $$cat | sed 's/\.gmo$$//'`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ if test -r $$cat; then \ @@ -125,7 +130,7 @@ installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ - lang=`echo $$cat | sed 's/\.gmo$$//'`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ done @@ -146,7 +151,7 @@ uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ - lang=`echo $$cat | sed 's/\.gmo$$//'`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \ done @@ -177,8 +182,11 @@ dist2: $(DISTFILES) dists="$(DISTFILES)"; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ - if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ - cp -p $$dir/$$file $(distdir); \ + if test -f $$file; then \ + cp -p $$file $(distdir); \ + else \ + cp -p $(srcdir)/$$file $(distdir); \ + fi; \ done update-po: Makefile @@ -189,7 +197,7 @@ update-po: Makefile catalogs='$(GMOFILES)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ - lang=`echo $$cat | sed 's/\.gmo$$//'`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ echo "$$lang:"; \ if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \