automake: do not emit rule with two dependents
authorJim Meyering <meyering@fb.com>
Fri, 9 Sep 2016 01:58:43 +0000 (18:58 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 9 Sep 2016 02:16:35 +0000 (19:16 -0700)
On a system using our replacement alloca, make would emit
this warning:
  target '.deps/alloca.Po' given more than once in the same rule
That arose because automake would emit a rule depending on both
./.deps/alloca.Po and .deps/alloca.Po. Normally, duplicate
dependents are avoided by virtue of their names being keys in
the %dep_files hash, but in this case, that particular file
was specified in two different ways.
* bin/automake.in (handle_ALLOCA): When the $dir prefix is empty,
make it './', to ensure that when we add ./.deps/alloca.Po
it is deduped.
See: http://bugs/gnu/org/22702

bin/automake.in

index 2c8f31e14527a716f218b9ffc822a0d8a243f243..5cacf633e767f0c1be74091f8d22b5f71a90b058 100644 (file)
@@ -2297,6 +2297,7 @@ sub handle_ALLOCA
   $lt ||= '';
   my $dir = handle_LIBOBJS_or_ALLOCA "${lt}ALLOCA";
 
+  $dir eq '' and $dir = './';
   $var->requires_variables ("\@${lt}ALLOCA\@ used", $lt . 'ALLOCA');
   $dep_files{$dir . '$(DEPDIR)/alloca.P' . $myobjext} = 1;
   require_libsource_with_macro ($cond, $var, FOREIGN, 'alloca.c');