--- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -1258,8 +1258,15 @@ sub output_variables () foreach my $var (@vars) { my $v = rvar $var; + # Output unconditional definitions before conditional ones. + if ($v->def (TRUE)) { + $res .= $v->output (TRUE) + if $v->rdef (TRUE)->owner == VAR_AUTOMAKE; + } foreach my $cond ($v->conditions->conds) { + # TRUE is handled already. + next if $cond->string eq "TRUE"; $res .= $v->output ($cond) if $v->rdef ($cond)->owner == VAR_AUTOMAKE; } @@ -1269,8 +1276,15 @@ sub output_variables () foreach my $var (@vars) { my $v = rvar $var; + # Output unconditional definitions before conditional ones. + if ($v->def (TRUE)) { + $res .= $v->output (TRUE) + if $v->rdef (TRUE)->owner != VAR_AUTOMAKE; + } foreach my $cond ($v->conditions->conds) { + # TRUE is handled already. + next if $cond->string eq "TRUE"; $res .= $v->output ($cond) if $v->rdef ($cond)->owner != VAR_AUTOMAKE; }