This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Automake 1.4j: Release Candidate [PATCH]


On Tue, Jul 31, 2001 at 11:06:01AM -0600, Tom Tromey wrote:
> Lars> Here's one.  The following Makefile.am doesn't generate any object
> Lars> dependencies.  $(libtest_a_OBJECTS) is always empty.
> 
> Thanks.  I turned this into a test case.  I'll fix it asap.

For what it's worth, and since I've looked at the dependency code fairly
recently, I took a look at this, and I think its the fault of the
@parent_conds argument in &variable_conditions_sub().  This actually looks
like outdated logic to me - duplicate or impossible conditionals are
removed later by &variable_conditions_reduce().

Removing the @parent_conds machinery and simply recursing through the
conditional variables and taking all the possible conditional combinations
makes sense to me, and works correctly as far as I can tell.  I attach a
patch to do this.  All tests behave as expected after this patch, except
for cond13.test which passes. :)

This may make things slightly less efficient, but the whole thing needs
replacing with something which doesn't do a combinatorial explosion as
the number of conditionals increases, anyway.  (As previously discussed on
the list.)

-- 
Richard
Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.1513
diff -u -r1.1513 ChangeLog
--- ChangeLog	2001/07/31 16:39:37	1.1513
+++ ChangeLog	2001/07/31 21:25:58
@@ -1,3 +1,10 @@
+2001-07-31  Richard Boulton <richard@tartarus.org>
+
+	* automake.in (variable_conditions_sub): Remove @parent_conds
+	  argument.  This was old logic - duplicate or impossible
+	  conditionals are removed later by &variable_conditions_reduce().
+	  Fixes tests/cond13.test.
+
 2001-07-31  Tom Tromey  <tromey@redhat.com>
 
 	* tests/Makefile.am (TESTS): Added cond13.test.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1164
diff -u -r1.1164 automake.in
--- automake.in	2001/07/31 04:22:07	1.1164
+++ automake.in	2001/07/31 21:26:15
@@ -5849,7 +5849,7 @@
 
     %vars_scanned = ();
 
-    my @new_conds = &variable_conditions_sub ($var, '', ());
+    my @new_conds = &variable_conditions_sub ($var, '');
     # Now we want to return all permutations of the subvariable
     # conditions.
     my %allconds = ();
@@ -5894,14 +5894,13 @@
 
 
 
-# &variable_conditions_sub ($VAR, $PARENT, @PARENT_CONDS)
+# &variable_conditions_sub ($VAR, $PARENT)
 # -------------------------------------------------------
 # A subroutine of variable_conditions.  This returns all the
-# conditions of $VAR which are satisfiable when all of @PARENT_CONDS
-# are true.
+# conditions of $VAR, including those of any sub-variables.
 sub variable_conditions_sub
 {
-    my ($var, $parent, @parent_conds) = @_;
+    my ($var, $parent) = @_;
     my @new_conds = ();
 
     if (defined $vars_scanned{$var})
@@ -5915,16 +5914,10 @@
     # Examine every condition under which $VAR is defined.
     foreach my $vcond (keys %{$var_value{$var}})
     {
-	# If this condition cannot be true when the parent conditions
-	# are true, then skip it.
-	next
-	  if ! conditionals_true_when (@parent_conds, $vcond);
-
 	push (@this_conds, $vcond);
 
 	# If $VAR references some other variable, then compute the
 	# conditions for that subvariable.
-	push (@parent_conds, $vcond);
 	my @subvar_conds = ();
 	foreach (split (' ', $var_value{$var}{$vcond}))
 	{
@@ -5938,7 +5931,7 @@
 		# Here we compute all the conditions under which the
 		# subvariable is defined.  Then we go through and add
 		# $VCOND to each.
-		my @svc = &variable_conditions_sub ($1, $var, @parent_conds);
+		my @svc = &variable_conditions_sub ($1, $var);
 		foreach my $item (@svc)
 		{
 		    my $val = conditional_string ($vcond, split (' ', $item));
@@ -5947,7 +5940,6 @@
 		}
 	    }
 	}
-	pop (@parent_conds);
 
 	# If there are no conditional subvariables, then we want to
 	# return this condition.  Otherwise, we want to return the
@@ -5989,9 +5981,6 @@
 		}
 	    }
 	    next if ! $ok;
-
-	    next
-	      if ! conditionals_true_when (@parent_conds, $perm);
 
 	    # This permutation was not already handled, and is valid
 	    # for the parents.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]