From 01a7a4a7bea81b4e2d03d08b45d605b98501e024 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Tue, 23 Dec 2014 18:39:32 +0100 Subject: 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 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 Helped-by: Peter Johansson Signed-off-by: Stefano Lattarini --- t/subdir-am-cond.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 't/subdir-am-cond.sh') diff --git a/t/subdir-am-cond.sh b/t/subdir-am-cond.sh index 8a36bc36d..69345d1a3 100644 --- a/t/subdir-am-cond.sh +++ b/t/subdir-am-cond.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-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 @@ -20,13 +20,13 @@ . test-init.sh -cat >>configure.ac <<'END' +cat >> configure.ac <<'END' AM_CONDITIONAL([COND_OPT], [test "$want_opt" = yes]) AC_CONFIG_FILES([src/Makefile opt/Makefile]) AC_OUTPUT END -cat >Makefile.am << 'END' +cat > Makefile.am <<'END' if COND_OPT MAYBE_OPT = opt endif @@ -42,16 +42,18 @@ SUBDIRS = src $(MAYBE_OPT) # We rely on 'distcheck' to run 'check-local' and use # 'sanity1' and 'sanity2' as evidences that test-build was run. +test_rootdir = $(top_builddir)/../../.. + if COND_OPT test-build: all test -f src/result test -f opt/result - : > $(top_builddir)/../../sanity2 + : > $(test_rootdir)/sanity2 else test-build: all test -f src/result test ! -f opt/result - : > $(top_builddir)/../../sanity1 + : > $(test_rootdir)/sanity1 endif test-dist: distdir @@ -65,7 +67,7 @@ mkdir src opt : > src/source : > opt/source -cat >src/Makefile.am << 'END' +cat > src/Makefile.am <<'END' EXTRA_DIST = source all-local: result CLEANFILES = result @@ -75,7 +77,7 @@ result: source END # We want in opt/ the same Makefile as in src/. Let's exercise 'include'. -cat >opt/Makefile.am << 'END' +cat > opt/Makefile.am <<'END' include ../src/Makefile.am END -- cgit v1.2.1