From: Bruno Haible Date: Fri, 4 Oct 2019 09:47:18 +0000 (+0200) Subject: build: Don't fetch gnulib a second time in libtextstyle. X-Git-Tag: v0.20.2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee95b6d6ce51042ce7d4200ed957a4d78d10cc36;p=thirdparty%2Fgettext.git build: Don't fetch gnulib a second time in libtextstyle. * autogen.sh: Set GNULIB_SRCDIR when invoking libtextstyle/autogen.sh. * libtextstyle/autogen.sh: Remove all git operations. Look at the GNULIB_SRCDIR environment variable. Ignore the GNULIB_TOOL environment variable. --- diff --git a/autogen.sh b/autogen.sh index 6f1403efd..f4ec14c24 100755 --- a/autogen.sh +++ b/autogen.sh @@ -419,7 +419,9 @@ cd "$dir0" echo "$0: generating files in libtextstyle..." cd libtextstyle -./autogen.sh $skip_gnulib_option || exit $? +(if ! $skip_gnulib; then export GNULIB_SRCDIR; fi + ./autogen.sh $skip_gnulib_option +) || exit $? cd "$dir0" echo "$0: generating configure in gettext-tools/examples..." diff --git a/libtextstyle/autogen.sh b/libtextstyle/autogen.sh index 7fd5bcbe9..45708ba61 100755 --- a/libtextstyle/autogen.sh +++ b/libtextstyle/autogen.sh @@ -5,10 +5,8 @@ # with new versions of autoconf or automake. # # This script requires autoconf-2.63..2.69 and automake-1.11..1.16 in the PATH. -# It also requires either -# - the GNULIB_TOOL environment variable pointing to the gnulib-tool script -# in a gnulib checkout, or -# - the git program in the PATH and an internet connection. +# If not used from a released tarball, it also requires +# - the GNULIB_SRCDIR environment variable pointing to a gnulib checkout. # Copyright (C) 2003-2019 Free Software Foundation, Inc. # @@ -56,58 +54,60 @@ if test $skip_gnulib = false; then && mv build-aux/texinfo.tex.tmp build-aux/texinfo.tex; \ } || rm -f build-aux/texinfo.tex.tmp fi - if test -z "$GNULIB_TOOL"; then - # Check out gnulib in a subdirectory 'gnulib'. - if test -d gnulib; then - (cd gnulib && git pull) - else - git clone git://git.savannah.gnu.org/gnulib.git - fi - # Now it should contain a gnulib-tool. - if test -f gnulib/gnulib-tool; then - GNULIB_TOOL=`pwd`/gnulib/gnulib-tool - else - echo "** warning: gnulib-tool not found" 1>&2 - fi + + if test -n "$GNULIB_SRCDIR"; then + test -d "$GNULIB_SRCDIR" || { + echo "*** GNULIB_SRCDIR is set but does not point to an existing directory." 1>&2 + exit 1 + } + else + GNULIB_SRCDIR=`pwd`/gnulib + test -d "$GNULIB_SRCDIR" || { + echo "*** Subdirectory 'gnulib' does not yet exist. Use './gitsub.sh pull' to create it, or set the environment variable GNULIB_SRCDIR." 1>&2 + exit 1 + } fi - # Skip the gnulib-tool step if gnulib-tool was not found. - if test -n "$GNULIB_TOOL"; then - GNULIB_MODULES=' - ostream - fd-ostream - file-ostream - html-ostream - iconv-ostream - memory-ostream - term-ostream - styled-ostream - html-styled-ostream - noop-styled-ostream - term-styled-ostream - filename - isatty - xalloc - xconcat-filename + # Now it should contain a gnulib-tool. + GNULIB_TOOL="$GNULIB_SRCDIR/gnulib-tool" + test -f "$GNULIB_TOOL" || { + echo "*** gnulib-tool not found." 1>&2 + exit 1 + } + GNULIB_MODULES=' + ostream + fd-ostream + file-ostream + html-ostream + iconv-ostream + memory-ostream + term-ostream + styled-ostream + html-styled-ostream + noop-styled-ostream + term-styled-ostream + filename + isatty + xalloc + xconcat-filename - term-ostream-tests - ' - $GNULIB_TOOL --lib=libtextstyle --source-base=lib --m4-base=gnulib-m4 --tests-base=tests \ - --macro-prefix=lts \ - --makefile-name=Makefile.gnulib --libtool \ - --local-dir=gnulib-local --local-dir=../gnulib-local \ - --import --avoid=hash-tests $GNULIB_MODULES - $GNULIB_TOOL --copy-file build-aux/config.guess; chmod a+x build-aux/config.guess - $GNULIB_TOOL --copy-file build-aux/config.sub; chmod a+x build-aux/config.sub - $GNULIB_TOOL --copy-file build-aux/declared.sh lib/declared.sh; chmod a+x lib/declared.sh - $GNULIB_TOOL --copy-file build-aux/run-test; chmod a+x build-aux/run-test - $GNULIB_TOOL --copy-file build-aux/test-driver.diff - # If we got no texinfo.tex so far, take the snapshot from gnulib. - if test ! -f build-aux/texinfo.tex; then - $GNULIB_TOOL --copy-file build-aux/texinfo.tex - fi - # For use by the example programs. - $GNULIB_TOOL --copy-file m4/libtextstyle.m4 + term-ostream-tests + ' + $GNULIB_TOOL --lib=libtextstyle --source-base=lib --m4-base=gnulib-m4 --tests-base=tests \ + --macro-prefix=lts \ + --makefile-name=Makefile.gnulib --libtool \ + --local-dir=gnulib-local --local-dir=../gnulib-local \ + --import --avoid=hash-tests $GNULIB_MODULES + $GNULIB_TOOL --copy-file build-aux/config.guess; chmod a+x build-aux/config.guess + $GNULIB_TOOL --copy-file build-aux/config.sub; chmod a+x build-aux/config.sub + $GNULIB_TOOL --copy-file build-aux/declared.sh lib/declared.sh; chmod a+x lib/declared.sh + $GNULIB_TOOL --copy-file build-aux/run-test; chmod a+x build-aux/run-test + $GNULIB_TOOL --copy-file build-aux/test-driver.diff + # If we got no texinfo.tex so far, take the snapshot from gnulib. + if test ! -f build-aux/texinfo.tex; then + $GNULIB_TOOL --copy-file build-aux/texinfo.tex fi + # For use by the example programs. + $GNULIB_TOOL --copy-file m4/libtextstyle.m4 fi # Copy some files from gettext.