diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2014-12-24 10:57:17 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2015-01-06 11:24:58 +0100 |
commit | 6a675ef17edf7109da189f5ae70e2dc6b7665896 (patch) | |
tree | cfb135c4af9a7b6f4e7d05be6a0b71f8894ff948 /t | |
parent | e12608fa5a899a2b2e0c7db0c3d1726b1242221e (diff) | |
download | automake-6a675ef17edf7109da189f5ae70e2dc6b7665896.tar.gz |
deps: 'subdir-object' option now works when foo_SOURCES contains $(var)
Following a suggestions of Johan Kristensen, we have config.status use
'make' invocations rather than Makefile-parsing 'sed' hacks to bootstrap
the dependency-tracking '.Po' and '.Plo' makefile fragments. To handle
the inclusion of such files that are still missing when make is first
we basically generate a temporary Makefile without these includes, and
call 'make' on that Makefile.
This fixes the serious bug bug#13928, which was an hard blocker to make the
behavior mandated by the 'subdir-object' active by default (which we want
to do in Automake 2.0).
The issue has also been reported in bug#15919.
* NEWS, THANKS: Update.
* bin/automake.in (handle_languages): Add a trailing "marking" comment
("# am--include-marker") to the generated Makefile lines issuing 'include'
directives for the dependency-tracking '.Po' and '.Plo' makefile fragments.
Also rename the generated Makefile variable 'am__depfiles_maybe' to the
clearer 'am__maybe_remake_depfiles'.
Minor unrelated refactoring.
* lib/am/configure.am: Adjust to account for the 'am__depfiles_maybe' ->
'am__maybe_remake_depfiles' renaming.
* lib/am/depend.am: Add rules to generate a dummy version of all the
dependency-tracking '.Po' and '.Plo' makefile fragments.
* m4/depout.m4: Use make invocations rather than Makefile-parsing sed hacks
to bootstrap the dependency-tracking '.Po' and '.Plo' makefile fragments.
We still use some sed trickery in order to remove the inclusion of the
still non existing .Po and .Plo files from the Makefile we invoke make
upon; this is done stripping lines that contain the magic string
"# am--include-marker".
* m4/make.m4 (AM_MAKE_INCLUDE): Given that now automake generates Makefiles
containing include statements with trailing comment, adjust the checks done
here to make sure $MAKE support that; e.g., "include foo.mk # comment"
rather than just "include foo.mk".
Also refactor and adjust to leave better debugging info in config.log.
* t/postproc.sh: Rename ...
* t/depend-postproc.sh: ... to this, and adjust and enhance.
* t/list-of-tests.mk (handwritten_TESTS): Adjust.
(XFAIL_TESTS): Remove 't/subobj-indir-pr13928.sh', which is now succeeding.
* t/subobj-indir-pr13928.sh: Simplify slightly, now that we expect it to
pass.
* t/depcomp8a.sh: Adjust grepping check to account for the changes in
the generated Makefile, and tp be somewhat more robust in light of possible
future modifications.
* t/depcomp8b.sh: Likewise.
* t/subobj11b.sh: Likewise.
* t/subobj11c.sh: Likewise.
* t/extra-sources.sh: Likewise.
* t/lex-depend-grep.sh: Likewise.
* t/lex-depend-cxx.sh: Add a command to help debugging in case of test
failure.
Helped-by: Johan Kristensen <johankristensen@gmail.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't')
-rw-r--r-- | t/depcomp8a.sh | 16 | ||||
-rw-r--r-- | t/depcomp8b.sh | 16 | ||||
-rw-r--r-- | t/depend-postproc.sh (renamed from t/postproc.sh) | 29 | ||||
-rw-r--r-- | t/extra-sources.sh | 5 | ||||
-rw-r--r-- | t/lex-depend-cxx.sh | 5 | ||||
-rw-r--r-- | t/lex-depend-grep.sh | 2 | ||||
-rw-r--r-- | t/list-of-tests.mk | 3 | ||||
-rw-r--r-- | t/subobj-indir-pr13928.sh | 4 | ||||
-rw-r--r-- | t/subobj11b.sh | 10 | ||||
-rw-r--r-- | t/subobj11c.sh | 2 |
10 files changed, 61 insertions, 31 deletions
diff --git a/t/depcomp8a.sh b/t/depcomp8a.sh index 5f14ee09a..07bbfc1fd 100644 --- a/t/depcomp8a.sh +++ b/t/depcomp8a.sh @@ -51,10 +51,10 @@ $ACLOCAL # FIXME: stop disabling the warnings in the 'unsupported' category # FIXME: once the 'subdir-objects' option has been mandatory. $AUTOMAKE -a -Wno-unsupported -grep include Makefile.in # For debugging. -grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in -grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in -grep 'include.*/\./\$(DEPDIR)' Makefile.in && exit 1 +grep '\.P' Makefile.in # For debugging. +grep '\./\$(DEPDIR)/foo\.Po' Makefile.in +grep '\./\$(DEPDIR)/bar\.Po' Makefile.in +grep '/\./\$(DEPDIR)' Makefile.in && exit 1 $AUTOCONF # Don't reject slower dependency extractors, for better coverage. @@ -68,10 +68,10 @@ DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am $AUTOMAKE -grep include Makefile.in # For debugging. -grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in -grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in -$EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1 +grep '\.P' Makefile.in # For debugging. +grep '\./\$(DEPDIR)/foo\.Po' Makefile.in +grep '[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.Po' Makefile.in +$EGREP '/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1 $AUTOCONF # Don't reject slower dependency extractors, for better coverage. diff --git a/t/depcomp8b.sh b/t/depcomp8b.sh index 8dd86a308..3f7f08244 100644 --- a/t/depcomp8b.sh +++ b/t/depcomp8b.sh @@ -48,10 +48,10 @@ $ACLOCAL # FIXME: stop disabling the warnings in the 'unsupported' category # FIXME: once the 'subdir-objects' option has been mandatory. $AUTOMAKE -a -Wno-unsupported -grep include Makefile.in # For debugging. -grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in -grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in -grep 'include.*/\./\$(DEPDIR)' Makefile.in && exit 1 +grep '\.P' Makefile.in # For debugging. +grep '\./\$(DEPDIR)/foo\.Plo' Makefile.in +grep '\./\$(DEPDIR)/bar\.Plo' Makefile.in +grep '/\./\$(DEPDIR)' Makefile.in && exit 1 $AUTOCONF # Don't reject slower dependency extractors, for better coverage. @@ -64,10 +64,10 @@ DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck echo AUTOMAKE_OPTIONS += subdir-objects >> Makefile.am $AUTOMAKE -grep include Makefile.in # For debugging. -grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in -grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in -$EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1 +grep '\.P' Makefile.in # For debugging. +grep '\./\$(DEPDIR)/foo\.Plo' Makefile.in +grep '[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.Plo' Makefile.in +$EGREP '/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1 $AUTOCONF # Don't reject slower dependency extractors, for better coverage. diff --git a/t/postproc.sh b/t/depend-postproc.sh index 94909ce15..1411783e0 100644 --- a/t/postproc.sh +++ b/t/depend-postproc.sh @@ -15,20 +15,22 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # Check to make sure we recognize a Makefile.in, even if post-processed -# and renamed. +# and renamed. The particularly tricky code for automatic dependency +# tracking support used to have issues with that. required=cc . test-init.sh -cat >configure.ac <<END +cat > configure.ac <<END AC_INIT([$me], [1.0]) AM_INIT_AUTOMAKE AC_PROG_CC AC_CONFIG_FILES([myMakefile]) +dnl: AC_CONFIG_LINKS([Makefile:Makefile]) AC_OUTPUT END -cat > myMakefile.am << 'END' +cat > myMakefile.am <<'END' bin_PROGRAMS = fred fred_SOURCES = fred.c END @@ -45,4 +47,25 @@ cat myMakefile.old >> myMakefile.in test -f .deps/fred.Po || test -f _deps/fred.Po || exit 1 +$sleep + +cat > Makefile <<'END' +include myMakefile +END + +sed 's/^dnl: *//' configure.ac >t +mv -f t configure.ac + +$MAKE myMakefile Makefile + +rm -rf .deps _deps +./config.status + +test ! -e fred.c +echo 'int main (void) { return 0; }' > fred.c + +$MAKE +test -f .deps/fred.Po || test -f _deps/fred.Po || exit 1 +$MAKE distcheck + : diff --git a/t/extra-sources.sh b/t/extra-sources.sh index cd276dbcc..cbffc9080 100644 --- a/t/extra-sources.sh +++ b/t/extra-sources.sh @@ -21,7 +21,7 @@ echo AC_PROG_CC >> configure.ac -cat > Makefile.am << 'END' +cat > Makefile.am <<'END' bin_PROGRAMS = www www_SOURCES = www.c EXTRA_www_SOURCES = xtra.c @@ -31,6 +31,7 @@ END $ACLOCAL $AUTOMAKE -grep '@am__include@ .*/xtra\.P' Makefile.in +grep '@am__include@ .*/xtra\.Po' Makefile.in +grep '^am__depfiles_remade =.*/xtra.Po' Makefile.in : diff --git a/t/lex-depend-cxx.sh b/t/lex-depend-cxx.sh index fc89c8aa5..79a2f3b77 100644 --- a/t/lex-depend-cxx.sh +++ b/t/lex-depend-cxx.sh @@ -82,6 +82,11 @@ $AUTOCONF # using slow dependency extractors. ./configure --enable-dependency-tracking +# For debugging. +for f in $(find . -name '*.Po'); do + cat $f +done + $MAKE test-deps-exist $MAKE diff --git a/t/lex-depend-grep.sh b/t/lex-depend-grep.sh index dedea2d31..70e5cb8d2 100644 --- a/t/lex-depend-grep.sh +++ b/t/lex-depend-grep.sh @@ -40,7 +40,7 @@ $AUTOMAKE -a $EGREP '([mj]oe|_[01234]|include|\.P)' Makefile.in # For debugging. for x in joe moe _0 _1 _2 _3 _4; do - grep "include.*$x\.Po" Makefile.in + $EGREP '\$\(DEPDIR\)/'"$x"'\.Po( |$)' Makefile.in done : diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 01c1a53ae..862bb29d2 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -41,7 +41,6 @@ t/java-nobase.sh \ t/objext-pr10128.sh \ t/remake-timing-bug-pr8365.sh \ t/lex-subobj-nodep.sh \ -t/subobj-indir-pr13928.sh \ t/subobj-vpath-pr13928.sh \ t/remake-am-pr10111.sh \ t/remake-m4-pr10111.sh \ @@ -391,6 +390,7 @@ t/depend3.sh \ t/depend4.sh \ t/depend5.sh \ t/depend6.sh \ +t/depend-postproc.sh \ t/deprecated-acinit.sh \ t/destdir.sh \ t/dir-named-obj-is-bad.sh \ @@ -866,7 +866,6 @@ t/posixsubst-programs.sh \ t/posixsubst-scripts.sh \ t/posixsubst-sources.sh \ t/posixsubst-tests.sh \ -t/postproc.sh \ t/ppf77.sh \ t/pr2.sh \ t/pr9.sh \ diff --git a/t/subobj-indir-pr13928.sh b/t/subobj-indir-pr13928.sh index afad53b21..9a7116d35 100644 --- a/t/subobj-indir-pr13928.sh +++ b/t/subobj-indir-pr13928.sh @@ -38,7 +38,9 @@ END mkdir s echo 'int main(void) { return 0; }' > s/foo.c -$ACLOCAL && $AUTOCONF && $AUTOMAKE -a || fatal_ "autotools failed" +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a ./configure $MAKE diff --git a/t/subobj11b.sh b/t/subobj11b.sh index db29e5e58..12e2216d2 100644 --- a/t/subobj11b.sh +++ b/t/subobj11b.sh @@ -56,9 +56,9 @@ END $ACLOCAL $AUTOMAKE -a -# Be lax in the regexp, to account for automake conditionals, the -# use of @am__include@, and similar stuff. -grep 'include.*//.*foobar' Makefile.in && exit 1 +grep '\.P' Makefile.in # For debugging. + +grep '//.*foobar\.P' Makefile.in && exit 1 # These checks depend on automake internals, but presently this is # the only way to test the code path we are interested in. @@ -71,12 +71,12 @@ for x in zardoz0 zardoz1 path/to/zardoz2 another/path/to/zardoz3; do esac # Be a little lax in the regexp, to account for automake conditionals, # quoting, and similar stuff. - grep "^[^/]*am__include[^/]*//server/$d\\\$(DEPDIR)/$b\\.[^/]*$" Makefile.in + grep "[ ]//server/$d\\\$(DEPDIR)/$b\\.Po" Makefile.in done # Sanity checks. for i in 0 1 2 3 4 5 6 7 8 9; do - grep "am__include.*/foobar$i\\." Makefile.in + grep "\$(DEPDIR)/foobar$i\\.Po" Makefile.in done : diff --git a/t/subobj11c.sh b/t/subobj11c.sh index 652a31d56..79abef96c 100644 --- a/t/subobj11c.sh +++ b/t/subobj11c.sh @@ -43,6 +43,6 @@ $AUTOMAKE -a # # FIXME: Are we sure this is the most sensible output in our situation? # -grep '^[^/]*am__include[^/]*//\$(DEPDIR)/zardoz\.[^/]*$' Makefile.in +grep 'am__depfiles_remade =.* //\$(DEPDIR)/zardoz\.Po' Makefile.in : |