55# with new versions of autoconf or automake.
66#
77# This script requires autoconf-2.63..2.69 and automake-1.11..1.16 in the PATH.
8- # It also requires either
9- # - the GNULIB_TOOL environment variable pointing to the gnulib-tool script
10- # in a gnulib checkout, or
11- # - the git program in the PATH and an internet connection.
8+ # If not used from a released tarball, it also requires either
9+ # - the GNULIB_SRCDIR environment variable pointing to a gnulib checkout, or
10+ # - a preceding invocation of './gitsub.sh pull'.
1211# It also requires
1312# - the gperf program.
1413
2827# along with this program. If not, see <https://www.gnu.org/licenses/>.
2928
3029# Usage: ./autogen.sh [--skip-gnulib]
31- #
32- # Usage from a git checkout: ./autogen.sh
33- # This uses an up-to-date gnulib checkout.
34- #
35- # Usage from a released tarball: ./autogen.sh --skip-gnulib
36- # This does not use a gnulib checkout.
3730
3831skip_gnulib=false
3932while : ; do
@@ -44,28 +37,29 @@ while :; do
4437done
4538
4639if test $skip_gnulib = false ; then
47- if test -z " $GNULIB_TOOL " ; then
48- # Check out gnulib in a subdirectory 'gnulib'.
49- if test -d gnulib; then
50- (cd gnulib && git pull)
51- else
52- git clone git://git.savannah.gnu.org/gnulib.git
53- fi
54- # Now it should contain a gnulib-tool.
55- if test -f gnulib/gnulib-tool; then
56- GNULIB_TOOL=` pwd` /gnulib/gnulib-tool
57- else
58- echo " ** warning: gnulib-tool not found" 1>&2
59- fi
60- fi
61- # Skip the gnulib-tool step if gnulib-tool was not found.
62- if test -n " $GNULIB_TOOL " ; then
63- $GNULIB_TOOL --copy-file build-aux/ar-lib || exit $?
64- chmod a+x build-aux/ar-lib || exit $?
65- make -f Makefile.devel \
66- gnulib-clean srclib/Makefile.gnulib gnulib-imported-files \
67- GNULIB_TOOL=" $GNULIB_TOOL "
40+ if test -n " $GNULIB_SRCDIR " ; then
41+ test -d " $GNULIB_SRCDIR " || {
42+ echo " *** GNULIB_SRCDIR is set but does not point to an existing directory." 1>&2
43+ exit 1
44+ }
45+ else
46+ GNULIB_SRCDIR=` pwd` /gnulib
47+ test -d " $GNULIB_SRCDIR " || {
48+ echo " *** Subdirectory 'gnulib' does not yet exist. Use './gitsub.sh pull' to create it, or set the environment variable GNULIB_SRCDIR." 1>&2
49+ exit 1
50+ }
6851 fi
52+ # Now it should contain a gnulib-tool.
53+ GNULIB_TOOL=" $GNULIB_SRCDIR /gnulib-tool"
54+ test -f " $GNULIB_TOOL " || {
55+ echo " *** gnulib-tool not found." 1>&2
56+ exit 1
57+ }
58+ $GNULIB_TOOL --copy-file build-aux/ar-lib || exit $?
59+ chmod a+x build-aux/ar-lib || exit $?
60+ make -f Makefile.devel \
61+ gnulib-clean srclib/Makefile.gnulib gnulib-imported-files \
62+ GNULIB_TOOL=" $GNULIB_TOOL "
6963fi
7064
7165make -f Makefile.devel totally-clean all || exit $?
0 commit comments