From 5faeab492b9af22ad053ec06203c739e3c9d056e Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Mon, 21 Jan 2002 07:41:47 +0000 Subject: [PATCH] Suppresses copying the gettext macro files if they are already avalable to aclocal. Reported by Petr Kozelka --- autogen.sh | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/autogen.sh b/autogen.sh index 77c7a9f3c..981660ccc 100755 --- a/autogen.sh +++ b/autogen.sh @@ -31,23 +31,28 @@ $GETTEXTIZE --copy --force >tmpout || exit 1 rm -f po/ChangeLog mv po/ChangeLog~ po/ChangeLog -# Ugly way to parse the instructions gettexize gives us. -m4files="`cat tmpout | sed -n -e '/^Please/,/^from/s/^ *//p'`" -fromdir=`cat tmpout | sed -n -e '/^Please/,/^from/s/^from the \([^ ]*\) .*$/\1/p'` -rm tmpout -rm -rf gettext.m4 -mkdir gettext.m4 -for i in $m4files; do - cp -f $fromdir/$i gettext.m4 -done - if test ! -d config; then mkdir config || exit 1 fi -$ACLOCAL -I gettext.m4 $ACLOCAL_FLAGS || \ - $ACLOCAL $ACLOCAL_FLAGS || \ - exit 1 +if test -f `aclocal --print-ac-dir`/gettext.m4; then + # gettext macro files are available to aclocal. + $ACLOCAL $ACLOCAL_FLAGS || exit 1 +else + # gettext macro files are not available. + # Find them and copy to a local directory. + # Ugly way to parse the instructions gettexize gives us. + m4files="`cat tmpout | sed -n -e '/^Please/,/^from/s/^ *//p'`" + fromdir=`cat tmpout | sed -n -e '/^Please/,/^from/s/^from the \([^ ]*\) .*$/\1/p'` + rm tmpout + rm -rf gettext.m4 + mkdir gettext.m4 + for i in $m4files; do + cp -f $fromdir/$i gettext.m4 + done + $ACLOCAL -I gettext.m4 $ACLOCAL_FLAGS || exit 1 +fi + $AUTOHEADER || exit 1 $AUTOCONF || exit 1