summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2014-12-23 18:39:32 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2014-12-23 19:47:31 +0100
commit01a7a4a7bea81b4e2d03d08b45d605b98501e024 (patch)
tree78373eeccd87f9444cfabb7a3a4a867ac20ffa33 /lib
parent2629aa9e713c584c799677987ffb03156b8aae8e (diff)
downloadautomake-01a7a4a7bea81b4e2d03d08b45d605b98501e024.tar.gz
dist: fix bug#18286 "distcheck fails to detect missing files"
BTW, this issue had been already reported in the past: http://lists.gnu.org/archive/html/automake/2006-09/msg00008.html http://lists.gnu.org/archive/html/automake/2013-01/msg00049.html "make distcheck" could sometimes fail to detect missing files in the distribution tarball, especially in those cases where both the generated files and their dependencies are explicitly in $(srcdir). An important example of this are *generated* makefile fragments included at Automake time in Makefile.am. A basic example: # -*- Makefile.am -*- $(srcdir)/fragment.am: $(srcdir)/data.txt $(srcdir)/preproc.sh cd $(srcdir) && $(SHELL) preproc.sh <data.txt >fragment.am include $(srcdir)/fragment.am ... If the use forgot to add data.txt and/or preproc.sh in the distribution tarball, "make distcheck" would have erroneously succeeded! The reason is that, while $(srcdir)/data.txt does not exist, make also looks in $(srcdir)/$(srcdir)/data.txt, and in the distcheck-issued VPATH build where $(srcdir) is '..', that file exists, as it is part of the original development directory. * t/distdir.am (distcheck): Adjust to have the build directory be '$(distdir)/_build/sub' rather than just '$(distdir)/_build'. Thanks Nicola Fontana for the suggestion. * t/distcheck-pr18286.sh: Enhance and tighten a little. * t/list-of-tests.mk (XFAIL_TESTS): Remove 't/distcheck-pr18286.sh', as it's now passing. * t/subdir-am-cond.sh: Adjust to avoid a fully spurious failure due to the new distcheck semantics. * t/subdir-ac-subst.sh: Likewise. * t/dejagnu-relative-srcdir.sh: Likewise. * t/txinfo-builddir.sh: Likewise. * NEWS: Update. Helped-by: Nicola Fontana <ntd@entidi.it> Helped-by: Peter Johansson <trojkan@gmail.com> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/am/distdir.am14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index a8ad63cef..6d9d42f28 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -1,5 +1,5 @@
## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001-2013 Free Software Foundation, Inc.
+## Copyright (C) 2001-2014 Free Software Foundation, Inc.
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -430,7 +430,7 @@ distcheck: dist
## can make our new subdirs.
chmod -R a-w $(distdir)
chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
## Undo the write access.
chmod a-w $(distdir)
## With GNU make, the following command will be executed even with "make -n",
@@ -451,8 +451,12 @@ distcheck: dist
## Parallel BSD make may not start a new shell for each command in a recipe,
## so be sure to 'cd' back to the original directory after this.
&& am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure \
+## If we merely used '$(distdir)/_build' here, "make distcheck" could
+## sometimes fail to detect missing files in the distribution tarball,
+## especially in those cases where both the generated files and their
+## dependencies are explicitly in $(srcdir). See automake bug#18286.
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
?GETTEXT? --with-included-gettext \
## Additional flags for configure.
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
@@ -461,7 +465,7 @@ distcheck: dist
## and --prefix values, so don't allow them to be overridden by the user or
## the developer. That used to be allowed, and caused issues in practice
## (in corner-case usages); see automake bug#14991.
- --srcdir=.. --prefix="$$dc_install_base" \
+ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \