X-Git-Url: https://git.draconx.ca/gitweb/slotifier.git/blobdiff_plain/51e1fbaa5ba49a66c8b03ffc199de042007fc919..5c9f3276505a9cbe000842401cbf7dd132b48ccb:/bootstrap diff --git a/bootstrap b/bootstrap index 460094f..f92c1c7 100755 --- a/bootstrap +++ b/bootstrap @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright © 2011-2012 Nick Bowler +# Copyright © 2011-2012, 2021 Nick Bowler # # Simple script to get started from a fresh git checkout. # @@ -10,16 +10,11 @@ scriptname=$0 -err() { - printf '%s: %s\n' "$scriptname" "$@" 1>&2 -} - -die() { - err "$@" - exit 1 -} +err () { printf '%s: %s\n' "$scriptname" "$*" 1>&2; } +die () { err "$@"; exit 1; } : ${AUTORECONF=autoreconf} +: ${AUTOMAKE=automake} : ${GNULIB=gnulib} : ${GIT=git} : ${PERL=perl} @@ -29,13 +24,36 @@ $GIT submodule update --init || err "Failed to update submodules from git." if test -x $GNULIB/gnulib-tool; then $GNULIB/gnulib-tool --update -S || die "Failed to update Gnulib." else - die "Gnulib sources are not properly installed in gnulib/." + err "Gnulib sources are not properly installed in $GNULIB/" + cat >&2 <<'EOF' + +To bootstrap this package using an external Gnulib, you can set the GNULIB +environment variable to indicate the location of the Gnulib sources. +EOF + + test ! -f configure || cat >&2 <<'EOF' + +However, it seems this package is already bootstrapped. It should not +normally be necessary to run this script from a release tarball. +EOF + exit 1 fi -$PERL common/scripts/fix-gnulib.pl -o lib/gnulib.mk -i lib/gnulib.mk.in \ - || die "Failed to fixup Gnulib makefile fragment." +$PERL common/scripts/fix-gnulib.pl -o lib/gnulib.mk -i lib/gnulib.mk.in || + die "Failed to fixup Gnulib makefile fragment." + +# Rewrite if ! ... construts produced by gnulib conditional dependencies +# as these fail in heirloom-sh. +sed 's/if ! *\(.*gnulib_enabled[^;]*\); then/if \1; then :; else/' \ + m4/gnulib-comp.m4 >m4/gnulib-comp.m4.new || exit +mv -f m4/gnulib-comp.m4.new m4/gnulib-comp.m4 || exit # Punt some automake-generated files so that Gentoo's wrapper script doesn't # try to detect the automake version in use. rm -f Makefile.in aclocal.m4 -$AUTORECONF -fis +$AUTORECONF -fis || exit + +amdir=`$AUTOMAKE --print-libdir` +if test -f "$amdir/INSTALL"; then + ln -sf "$amdir/INSTALL" INSTALL +fi