300-output-TRUE-cond-first.patch 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. --- a/lib/Automake/Variable.pm
  2. +++ b/lib/Automake/Variable.pm
  3. @@ -1258,8 +1258,15 @@ sub output_variables ()
  4. foreach my $var (@vars)
  5. {
  6. my $v = rvar $var;
  7. + # Output unconditional definitions before conditional ones.
  8. + if ($v->def (TRUE)) {
  9. + $res .= $v->output (TRUE)
  10. + if $v->rdef (TRUE)->owner == VAR_AUTOMAKE;
  11. + }
  12. foreach my $cond ($v->conditions->conds)
  13. {
  14. + # TRUE is handled already.
  15. + next if $cond->string eq "TRUE";
  16. $res .= $v->output ($cond)
  17. if $v->rdef ($cond)->owner == VAR_AUTOMAKE;
  18. }
  19. @@ -1269,8 +1276,15 @@ sub output_variables ()
  20. foreach my $var (@vars)
  21. {
  22. my $v = rvar $var;
  23. + # Output unconditional definitions before conditional ones.
  24. + if ($v->def (TRUE)) {
  25. + $res .= $v->output (TRUE)
  26. + if $v->rdef (TRUE)->owner != VAR_AUTOMAKE;
  27. + }
  28. foreach my $cond ($v->conditions->conds)
  29. {
  30. + # TRUE is handled already.
  31. + next if $cond->string eq "TRUE";
  32. $res .= $v->output ($cond)
  33. if $v->rdef ($cond)->owner != VAR_AUTOMAKE;
  34. }