diff --git a/autogen.sh b/autogen.sh index ff946787af..b93cdbae65 100755 --- a/autogen.sh +++ b/autogen.sh @@ -62,20 +62,27 @@ else fi fi +# Compute the hash we'll use to determine whether rerunning bootstrap +# is required. The first is just the SHA1 that selects a gnulib snapshot. +# The second ensures that whenever we change the set of gnulib modules used +# by this package, we rerun bootstrap to pull in the matching set of files. +bootstrap_hash() +{ + git submodule status | sed 's/^[ +-]//;s/ .*//' + git hash-object bootstrap.conf +} + # Ensure that whenever we pull in a gnulib update or otherwise change to a # different version (i.e., when switching branches), we also rerun ./bootstrap. curr_status=.git-module-status -t=$(git submodule status|sed 's/^[ +-]//;s/ .*//'; \ - git hash-object bootstrap.conf) +t=$(bootstrap_hash) if test "$t" = "$(cat $curr_status 2>/dev/null)"; then : # good, it's up to date, all we need is autoreconf autoreconf -if else - echo running bootstrap... - ./bootstrap && echo "$t" > $curr_status || { - echo "Failed to bootstrap gnulib, please investigate." - exit 1; - } + echo running bootstrap... + ./bootstrap && bootstrap_hash > $curr_status \ + || { echo "Failed to bootstrap gnulib, please investigate."; exit 1; } fi cd "$THEDIR"