diff options
Diffstat (limited to 'make/utilities.pm')
-rw-r--r-- | make/utilities.pm | 49 |
1 files changed, 15 insertions, 34 deletions
diff --git a/make/utilities.pm b/make/utilities.pm index 8b8241e04..fc7ce13d2 100644 --- a/make/utilities.pm +++ b/make/utilities.pm @@ -322,57 +322,38 @@ sub translate_functions($$) die "Developers should no longer use backticks in configuration macros. Please use exec() and eval() macros instead. Offending line: $line (In module: $module)"; } - if ($line =~ /\$EndIf/) + if ($line =~ /ifuname\(\!"(\w+)"\)/) { - if ($if_skip_lines == 1) - { - $if_skip_lines = 0; - return; - } - else - { - die "\$EndIf found when not in \$If/\$IfUname in $module"; - } - } - - if ($line =~ /\$Else/) - { - if ($if_skip_lines == 0) - { - $if_skip_lines = 1; - } - else + my $uname = $1; + if ($uname eq $^O) { - $if_skip_lines = 0; + $line = ""; + return ""; } - return; - } - if ($if_skip_lines == 1) - { - return; + $line =~ s/ifuname\(\!"(.+?)"\)//; } - if ($line =~ /\$IfUname\s+(\w+)/) + if ($line =~ /ifuname\("(\w+)"\)/) { my $uname = $1; if ($uname ne $^O) { - $if_skip_lines = 1; - return; + $line = ""; + return ""; } + + $line =~ s/ifuname\("(.+?)"\)//; } - if ($line =~ /\$If:\s+(\w+)/) + if ($line =~ /if\("(\w+)"\)/) { if (defined $main::config{$1}) { - if (($main::config{$1} !~ /y/i) and ($main::config{$1} ne "1")) - { - $if_skip_lines = 1; - return; - } + return "" if (($main::config{$1} !~ /y/i) and ($main::config{$1} ne "1")) } + + $line =~ s/if\("(.+?)"\)//; } while ($line =~ /exec\("(.+?)"\)/) |