]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Don't fetch gnulib a second time in libtextstyle.
authorBruno Haible <bruno@clisp.org>
Fri, 4 Oct 2019 09:47:18 +0000 (11:47 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 13 Apr 2020 11:22:04 +0000 (13:22 +0200)
* 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.

autogen.sh
libtextstyle/autogen.sh

index 6f1403efd9a3733ebf9de07b15daf75809c26798..f4ec14c248e729a33ea66c1c540836564972f39e 100755 (executable)
@@ -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..."
index 7fd5bcbe9c30b70668c164da7664fa7ec9908ae6..45708ba61161e3e63057db6030774341170813c9 100755 (executable)
@@ -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.