From: Bruno Haible Date: Wed, 23 Feb 2005 20:47:49 +0000 (+0000) Subject: Make "make dist" work in VPATH builds. X-Git-Tag: v0.14.2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2a7a1244fe50f6a27b5afe39b4df004c636fd7d;p=thirdparty%2Fgettext.git Make "make dist" work in VPATH builds. --- diff --git a/gettext-tools/examples/ChangeLog b/gettext-tools/examples/ChangeLog index 55772fec7..36ef75b71 100644 --- a/gettext-tools/examples/ChangeLog +++ b/gettext-tools/examples/ChangeLog @@ -1,3 +1,9 @@ +2005-02-23 Bruno Haible + + * xsmallpot.sh: Add srcdir argument. Make it work when + builddir != srcdir. + * Makefile.am (hello-*.pot): Update xsmallpot.sh invocations. + 2005-02-21 Bruno Haible * po/vi.po: New file, from Clytie Siddall . diff --git a/gettext-tools/examples/po/Makefile.am b/gettext-tools/examples/po/Makefile.am index a8a7f0d1b..8ff78e467 100644 --- a/gettext-tools/examples/po/Makefile.am +++ b/gettext-tools/examples/po/Makefile.am @@ -196,85 +196,85 @@ $(DOMAIN).pot-update: $(POTFILES_DEPS) $(SMALLPOTS) remove-potcdate.sed hello-c.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-c + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c hello-c-gnome.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-c-gnome + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c-gnome hello-c++.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-c++ + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++ hello-c++-qt.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-c++-qt + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-qt hello-c++-kde.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-c++-kde + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-kde hello-c++-gnome.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-c++-gnome + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-c++-gnome hello-objc.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-objc + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc hello-objc-gnustep.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-objc-gnustep + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc-gnustep hello-objc-gnome.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-objc-gnome + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-objc-gnome hello-sh.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-sh + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-sh hello-python.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-python + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-python hello-clisp.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-clisp + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-clisp hello-librep.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-librep + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-librep hello-guile.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-guile + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-guile hello-smalltalk.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-smalltalk + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-smalltalk hello-java.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-java + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java hello-java-awt.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-java-awt + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java-awt hello-java-swing.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-java-swing + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-java-swing hello-csharp.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-csharp + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-csharp hello-csharp-forms.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-csharp-forms + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-csharp-forms hello-gawk.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-gawk + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-gawk hello-pascal.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-pascal + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-pascal hello-ycp.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-ycp + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-ycp hello-tcl.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-tcl + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-tcl hello-tcl-tk.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-tcl-tk + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-tcl-tk hello-perl.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-perl + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-perl hello-php.pot : $(POTFILES_DEPS) - $(SHELL) xsmallpot.sh hello-php + $(SHELL) '$(srcdir)/xsmallpot.sh' '$(srcdir)' hello-php # This rule has no dependencies: we don't need to update $(DOMAIN).pot at diff --git a/gettext-tools/examples/po/xsmallpot.sh b/gettext-tools/examples/po/xsmallpot.sh index 9d0c98f89..e107bb66f 100755 --- a/gettext-tools/examples/po/xsmallpot.sh +++ b/gettext-tools/examples/po/xsmallpot.sh @@ -1,15 +1,21 @@ #!/bin/sh -# Usage: xsmallpot.sh hello-foo [hello-foobar.pot] +# Usage: xsmallpot.sh srcdir hello-foo [hello-foobar.pot] set -e -test $# = 1 || test $# = 2 || { echo "Usage: xsmallpot.sh hello-foo [hello-foobar.pot]" 1>&2; exit 1; } -directory=$1 -potfile=${2-$directory.pot} +# Nuisances. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +test $# = 2 || test $# = 3 || { echo "Usage: xsmallpot.sh srcdir hello-foo [hello-foobar.pot]" 1>&2; exit 1; } +srcdir=$1 +directory=$2 +potfile=${3-$directory.pot} + +abs_srcdir=`cd "$srcdir" && pwd` cd .. rm -rf tmp-$directory -cp -p -r $directory tmp-$directory +cp -p -r "$abs_srcdir"/../$directory tmp-$directory cd tmp-$directory case $directory in hello-c++-kde)