]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make "update-po" work in VPATH builds as well.
authorBruno Haible <bruno@clisp.org>
Mon, 12 Nov 2001 12:26:20 +0000 (12:26 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 20:56:59 +0000 (22:56 +0200)
m4/ChangeLog
m4/gettext.m4
po/ChangeLog
po/Makefile.in.in

index aae234e2216dfacfe1ecf86bafeeaaf81d6108bf..532e92a7dd69f13a15e14a22adbc1416c3711473 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-11  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettext.m4 (AM_GNU_GETTEXT): For builds with $builddir != $srcdir,
+       prepend $(srcdir) to all elements of POFILES and GMOFILES.
+
 2001-11-11  Bruno Haible  <haible@clisp.cons.org>
 
        * javaexec.m4 (gt_JAVAEXEC): Use HAVE_JAVA instead of HAVE_JAVA_JVM.
index a8678a64e5628f70820868f29eeb7fa5bee4b81b..4b0445839dd15db5d47719d0104c96a665a24367 100644 (file)
@@ -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.
index 156d208861c84fb7a739ee9032387e47dd5a3a31..16f2e4ba6183305811cdc65bfc661151a20def3b 100644 (file)
@@ -1,3 +1,10 @@
+2001-11-11  Bruno Haible  <haible@clisp.cons.org>
+
+       * 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 <bonzini@gnu.org>
             Bruno Haible  <haible@clisp.cons.org>
 
index dee3276a844525321fba9141f9e1de3ad8a64723..4be129b7c8e65960b8e97196e8f5017724c88a13 100644 (file)
@@ -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 \