Revert commit e7e23e73, work around Automake bug
authorMichael Hanselmann <hansmi@google.com>
Thu, 4 Nov 2010 14:56:13 +0000 (15:56 +0100)
committerMichael Hanselmann <hansmi@google.com>
Thu, 4 Nov 2010 15:30:41 +0000 (16:30 +0100)
After commit e7e23e73 the build would fail in distcheck on systems with
Automake 1.10. An investigation identified Automake bug #533[1] as the
cause. Applying the changes in Automake commit 3a12ed5e[2] to the
generated Makefile.in file made distcheck work again.

The underlying problem is that in our case both doc/html and
doc/html/.dir were included in the distributed files. When distcheck
copied the former from the source to the staging directory, it was
marked as read-only (distcheck makes the whole source read-only). It
then tried to copy doc/html/.dir from the build directory, which failed.
Automake 1.11 and newer avoid this problem by adjusting the permissions.

Since depending on Automake 1.11 or above is not an option at this time,
a work-around was found by not using a “.dir” file in doc/html, but
using “index.html” as a flag for creating the directory.

[1] http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=view&database=automake&pr=533
[2] http://git.savannah.gnu.org/gitweb/?p=automake.git;a=commit;h=3a12ed5e97dc193a38dd14e031658cbd329b50ca

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

Makefile.am

index 56a8500..b4e111b 100644 (file)
@@ -57,10 +57,13 @@ DIRS = \
        test/data \
        tools
 
-BUILDTIME_DIRS = \
+BUILDTIME_DIR_AUTOCREATE = \
        scripts \
        doc/api \
-       doc/coverage \
+       doc/coverage
+
+BUILDTIME_DIRS = \
+       $(BUILDTIME_DIR_AUTOCREATE) \
        doc/html
 
 DIRCHECK_EXCLUDE = \
@@ -68,7 +71,7 @@ DIRCHECK_EXCLUDE = \
        ganeti-[0-9]*.[0-9]*.[0-9]* \
        doc/html/_*
 
-all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIRS))
+all_dirfiles = $(addsuffix /.dir,$(DIRS) $(BUILDTIME_DIR_AUTOCREATE))
 
 MAINTAINERCLEANFILES = \
        $(docpng) \
@@ -226,9 +229,10 @@ docrst = \
 $(RUN_IN_TEMPDIR): | $(all_dirfiles)
 
 doc/html/index.html: $(docrst) $(docpng) doc/conf.py configure.ac \
-       $(RUN_IN_TEMPDIR) | doc/html/.dir
+       $(RUN_IN_TEMPDIR)
        @test -n "$(SPHINX)" || \
            { echo 'sphinx-build' not found during configure; exit 1; }
+       @mkdir_p@ $(dir $@)
        PYTHONPATH=. $(RUN_IN_TEMPDIR) $(SPHINX) -q -W -b html \
            -d . \
            -D version="$(VERSION_MAJOR).$(VERSION_MINOR)" \
@@ -732,7 +736,6 @@ dist-hook:
        $(MAKE) regen-vcs-version && \
        rm -f $(top_distdir)/vcs-version && \
        cp -p $(srcdir)/vcs-version $(top_distdir)
-       rm $(top_distdir)/doc/html/.dir
 
 # a distcheck hook rule for catching revision control directories
 distcheck-hook: