提交 f272378d 编写于 作者: J Jim Meyering

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.
上级 e335b2ca
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
*.o *.o
*~ *~
.git .git
.git-module-status
ABOUT-NLS ABOUT-NLS
COPYING COPYING
INSTALL INSTALL
......
...@@ -48,6 +48,8 @@ cov: clean-cov ...@@ -48,6 +48,8 @@ cov: clean-cov
clean-cov: clean-cov:
rm -rf $(top_builddir)/coverage rm -rf $(top_builddir)/coverage
MAINTAINERCLEANFILES = .git-module-status
# disable this check # disable this check
distuninstallcheck: distuninstallcheck:
......
...@@ -28,13 +28,8 @@ You can get a copy of the source repository like this: ...@@ -28,13 +28,8 @@ You can get a copy of the source repository like this:
$ git clone git://libvirt.org/libvirt $ git clone git://libvirt.org/libvirt
$ cd libvirt $ cd libvirt
The next step is to get and check other files needed to build, The next step is to get all required pieces from gnulib,
which are extracted from other source packages: to run autoreconf, and to invoke ./configure:
$ ./bootstrap
Then run this to create e.g., Makefiles and ./configure,
and to invoke ./configure:
$ ./autogen.sh $ ./autogen.sh
......
...@@ -54,6 +54,17 @@ if test -z "$*"; then ...@@ -54,6 +54,17 @@ if test -z "$*"; then
echo "to pass any to it, please specify them on the $0 command line." echo "to pass any to it, please specify them on the $0 command line."
fi 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. # Automake requires that ChangeLog exist.
touch ChangeLog touch ChangeLog
......
...@@ -230,3 +230,13 @@ sc_libvirt_unmarked_diagnostics: ...@@ -230,3 +230,13 @@ sc_libvirt_unmarked_diagnostics:
# We don't use this feature of maint.mk. # We don't use this feature of maint.mk.
prev_version_file = /dev/null 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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册