build: avoid problems with autogen.sh runs from tarball

Introduced by commit fac97c65c distributing cfg.mk, which
previously could blindly assume it was in a git checkout.

* cfg.mk (_update_required): Also check for .git.
* autogen.sh: Don't run bootstrap from a tarball.
Reported by Daniel Veillard.
This commit is contained in:
Eric Blake 2011-02-11 10:35:54 -07:00
parent 117b2a6756
commit 3a97fa28e4
2 changed files with 16 additions and 12 deletions

View File

@ -52,6 +52,8 @@ bootstrap_hash()
# Also, running 'make rpm' tends to litter the po/ directory, and some people # Also, running 'make rpm' tends to litter the po/ directory, and some people
# like to run 'git clean -x -f po' to fix it; but only ./bootstrap regenerates # like to run 'git clean -x -f po' to fix it; but only ./bootstrap regenerates
# the required file po/Makevars. # the required file po/Makevars.
# Only run bootstrap from a git checkout, never from a tarball.
if test -d .git; then
curr_status=.git-module-status curr_status=.git-module-status
t=$(bootstrap_hash; git diff .gnulib) t=$(bootstrap_hash; git diff .gnulib)
if test "$t" = "$(cat $curr_status 2>/dev/null)" \ if test "$t" = "$(cat $curr_status 2>/dev/null)" \
@ -63,6 +65,7 @@ else
./bootstrap$no_git --bootstrap-sync && bootstrap_hash > $curr_status \ ./bootstrap$no_git --bootstrap-sync && bootstrap_hash > $curr_status \
|| { echo "Failed to bootstrap, please investigate."; exit 1; } || { echo "Failed to bootstrap, please investigate."; exit 1; }
fi fi
fi
cd "$THEDIR" cd "$THEDIR"

1
cfg.mk
View File

@ -507,6 +507,7 @@ ifeq (0,$(MAKELEVEL))
_submodule_hash = sed 's/^[ +-]//;s/ .*//' _submodule_hash = sed 's/^[ +-]//;s/ .*//'
_update_required := $(shell \ _update_required := $(shell \
cd '$(srcdir)'; \ cd '$(srcdir)'; \
test -d .git || { echo 0; exit; }; \
test -f po/Makevars || { echo 1; exit; }; \ test -f po/Makevars || { echo 1; exit; }; \
actual=$$(git submodule status | $(_submodule_hash); \ actual=$$(git submodule status | $(_submodule_hash); \
git hash-object bootstrap.conf; \ git hash-object bootstrap.conf; \