]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: automatically rerun ./bootstrap when needed
authorJim Meyering <meyering@redhat.com>
Fri, 10 Jul 2009 08:01:04 +0000 (10:01 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 10 Jul 2009 11:39:28 +0000 (13:39 +0200)
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.

.gitignore
Makefile.am
README-hacking
autogen.sh
cfg.mk

index 54c3ba46b5d18288456ec6bd0181cb1ebf2f7eb7..17c3975847133d31da6048ec18c5e830d26f377f 100644 (file)
@@ -2,6 +2,7 @@
 *.o
 *~
 .git
+.git-module-status
 ABOUT-NLS
 COPYING
 INSTALL
index f9efff580bd13041a39e808eaab085689098a72a..beddca725c94ad5c3005f318a95ce43771b61e73 100644 (file)
@@ -48,6 +48,8 @@ cov: clean-cov
 clean-cov:
        rm -rf $(top_builddir)/coverage
 
+MAINTAINERCLEANFILES = .git-module-status
+
 # disable this check
 distuninstallcheck:
 
index 99c68fef4b82c68f0d351bb6ae03d546f5b06630..4105a3ee6a986645bd4fbb16070a4e30bd47546e 100644 (file)
@@ -28,13 +28,8 @@ You can get a copy of the source repository like this:
         $ git clone git://libvirt.org/libvirt
         $ cd libvirt
 
-The next step is to get and check other files needed to build,
-which are extracted from other source packages:
-
-        $ ./bootstrap
-
-Then run this to create e.g., Makefiles and ./configure,
-and to invoke ./configure:
+The next step is to get all required pieces from gnulib,
+to run autoreconf, and to invoke ./configure:
 
         $ ./autogen.sh
 
index e6bde33aece8f34f9cebf4d76a6eda2e2b02f919..415f3ec6dd81293996569317052cd7060fc81ad2 100755 (executable)
@@ -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
 
diff --git a/cfg.mk b/cfg.mk
index 736f7c056cae5187d2124e32252c3f729c648c5e..3b3d57f492abb6c7e459ebfeefc9e83951b064d0 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -230,3 +230,13 @@ sc_libvirt_unmarked_diagnostics:
 
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null
+
+ifeq (0,$(MAKELEVEL))
+  _curr_status = .git-module-status
+  _update_required :=                                                  \
+    $(shell t=$$(git submodule status);                                        \
+      test "$$t" = "$$(cat $(_curr_status) 2>/dev/null)"; echo $$?)
+  ifeq (1,$(_update_required))
+    $(error gnulib update required; run ./autogen.sh first)
+  endif
+endif