summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-07-10 10:01:04 +0200
committerJim Meyering <meyering@redhat.com>2009-07-10 13:39:28 +0200
commitf272378d52e28b937219121e8b90883df8a10012 (patch)
tree353e0145c767d13563b7c2fca756e21a7da562e3 /autogen.sh
parentbuild: make autogen.sh use autoreconf -if (diff)
downloadlibvirt-f272378d52e28b937219121e8b90883df8a10012.tar.gz
libvirt-f272378d52e28b937219121e8b90883df8a10012.tar.bz2
libvirt-f272378d52e28b937219121e8b90883df8a10012.zip
build: automatically rerun ./bootstrap when needed
When "git pull" (or any other operation) brings in a new version of the gnulib git submodule, you must rerun the autogen.sh script. With this change, "make" now fails and tells you to run ./autogen.sh, when needed. * autogen.sh: Maintain a new file, .git-module-status, containing the current submodule status. If it doesn't exist or its content is different from what "git submodule status" prints, then run ./bootstrap * .gitignore: Add .git-module-status * cfg.mk: Diagnose out of date submodule and fail. * README-hacking: Update not to mention bootstrap. * Makefile.am (MAINTAINERCLEANFILES): Add .git-module-status, so that "make maintainerclean" will remove it.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
index e6bde33ae..415f3ec6d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -54,6 +54,17 @@ if test -z "$*"; then
echo "to pass any to it, please specify them on the $0 command line."
fi
+# 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)
+if test "$t" = "$(cat $curr_status 2>/dev/null)"; then
+ : # good, it's up to date
+else
+ echo running bootstrap...
+ ./bootstrap && echo "$t" > $curr_status
+fi
+
# Automake requires that ChangeLog exist.
touch ChangeLog