aboutsummaryrefslogtreecommitdiff
path: root/tools/automake/patches/300-output-TRUE-cond-first.patch
blob: 1ac655adffdba59d7f38a332bf058c66e2724b42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- 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;
 	}