summaryrefslogtreecommitdiffstats
path: root/gettext-tools/examples/hello-gawk
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2005-02-24 13:16:02 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:12:17 +0200
commit4db28b11882ef2cf819ee270abb2cf6d3a44780f (patch)
treecd2cd02401731d778039b28df3d0aec719b6ce87 /gettext-tools/examples/hello-gawk
parent840c7f9ca5c47d9ea80df9b5e338f24f24bda772 (diff)
downloadexternal_gettext-4db28b11882ef2cf819ee270abb2cf6d3a44780f.zip
external_gettext-4db28b11882ef2cf819ee270abb2cf6d3a44780f.tar.gz
external_gettext-4db28b11882ef2cf819ee270abb2cf6d3a44780f.tar.bz2
Make it work in VPATH builds.
Diffstat (limited to 'gettext-tools/examples/hello-gawk')
-rwxr-xr-xgettext-tools/examples/hello-gawk/autogen.sh27
1 files changed, 22 insertions, 5 deletions
diff --git a/gettext-tools/examples/hello-gawk/autogen.sh b/gettext-tools/examples/hello-gawk/autogen.sh
index dc73bff..591fa29 100755
--- a/gettext-tools/examples/hello-gawk/autogen.sh
+++ b/gettext-tools/examples/hello-gawk/autogen.sh
@@ -1,15 +1,32 @@
#!/bin/sh
# Example for use of GNU gettext.
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003-2005 Free Software Foundation, Inc.
# This file is in the public domain.
#
# Script for regenerating all autogenerated files.
-test -r ../Makefile.am || . ../installpaths
+if test -r ../Makefile.am; then
+ # Inside the gettext source directory.
+ GETTEXT_TOPSRCDIR=../../..
+else
+ if test -r ../Makefile; then
+ # Inside a gettext build directory.
+ GETTEXT_TOOLS_SRCDIR=`sed -n -e 's,^top_srcdir *= *\(.*\)$,\1,p' ../Makefile`
+ # Adjust a relative top_srcdir.
+ case $GETTEXT_TOOLS_SRCDIR in
+ /*) ;;
+ *) GETTEXT_TOOLS_SRCDIR=../$GETTEXT_TOOLS_SRCDIR ;;
+ esac
+ GETTEXT_TOPSRCDIR=$GETTEXT_TOOLS_SRCDIR/..
+ else
+ # Installed under ${prefix}/share/doc/gettext/examples.
+ . ../installpaths
+ fi
+fi
-cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4
-cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4
-cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin
+cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/nls.m4 m4/nls.m4
+cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/po.m4 m4/po.m4
+cp -p ${GETTEXTSRCPODIR-$GETTEXT_TOPSRCDIR/gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin
aclocal -I m4