summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2014-12-24 10:57:17 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2015-01-06 11:24:58 +0100
commit6a675ef17edf7109da189f5ae70e2dc6b7665896 (patch)
treecfb135c4af9a7b6f4e7d05be6a0b71f8894ff948 /bin
parente12608fa5a899a2b2e0c7db0c3d1726b1242221e (diff)
downloadautomake-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 'bin')
-rw-r--r--bin/automake.in84
1 files changed, 43 insertions, 41 deletions
diff --git a/bin/automake.in b/bin/automake.in
index a3a0aa318..681b3d2a5 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1230,48 +1230,50 @@ sub check_user_variables
sub handle_languages ()
{
if (! option 'no-dependencies')
- {
- # Include auto-dep code. Don't include it if DEP_FILES would
- # be empty.
- if (keys %extension_seen && keys %dep_files)
- {
- # Set location of depcomp.
- define_variable ('depcomp',
- "\$(SHELL) $am_config_aux_dir/depcomp",
- INTERNAL);
- define_variable ('am__depfiles_maybe', 'depfiles', INTERNAL);
-
- require_conf_file ("$am_file.am", FOREIGN, 'depcomp');
-
- my @deplist = sort keys %dep_files;
- # Generate each 'include' individually. Irix 6 make will
- # not properly include several files resulting from a
- # variable expansion; generating many separate includes
- # seems safest.
- $output_rules .= "\n";
- foreach my $iter (@deplist)
- {
- $output_rules .= (subst ('AMDEP_TRUE')
- . subst ('am__include')
- . ' '
- . subst ('am__quote')
- . $iter
- . subst ('am__quote')
- . "\n");
- }
-
- # Compute the set of directories to remove in distclean-depend.
- my @depdirs = uniq (map { dirname ($_) } @deplist);
- $output_rules .= file_contents ('depend',
- new Automake::Location,
- DEPDIRS => "@depdirs");
- }
- }
+ {
+ # Include auto-dep code. Don't include it if DEP_FILES would
+ # be empty.
+ if (keys %extension_seen && keys %dep_files)
+ {
+ my @dep_files = sort keys %dep_files;
+ # Set location of depcomp.
+ define_variable ('depcomp',
+ "\$(SHELL) $am_config_aux_dir/depcomp",
+ INTERNAL);
+ define_variable ('am__maybe_remake_depfiles', 'depfiles', INTERNAL);
+ define_variable ('am__depfiles_remade', "@dep_files", INTERNAL);
+ # Generate each 'include' directive individually. Several make
+ # implementations (IRIX 6, Solaris 10, FreeBSD 8) will fail to
+ # properly include several files resulting from a variable
+ # expansion. Just Generating many separate includes seems thus
+ # safest.
+ $output_rules .= "\n";
+ foreach my $depfile (@dep_files)
+ {
+ $output_rules .= subst ('AMDEP_TRUE') .
+ subst ('am__include') .
+ " " .
+ subst('am__quote') .
+ $depfile .
+ subst('am__quote') .
+ " " .
+ "# am--include-marker\n";
+ }
+
+ require_conf_file ("$am_file.am", FOREIGN, 'depcomp');
+
+ # Compute the set of directories to remove in distclean-depend.
+ my @dep_dirs = uniq (map { dirname ($_) } @dep_files);
+ $output_rules .= file_contents ('depend',
+ new Automake::Location,
+ DEPDIRS => "@dep_dirs");
+ }
+ }
else
- {
- define_variable ('depcomp', '', INTERNAL);
- define_variable ('am__depfiles_maybe', '', INTERNAL);
- }
+ {
+ define_variable ('depcomp', '', INTERNAL);
+ define_variable ('am__maybe_remake_depfiles', '', INTERNAL);
+ }
my %done;