From: Martin Mares Date: Thu, 30 Oct 2008 21:28:02 +0000 (+0100) Subject: Configure: Enabled strict mode and localized @cpu. X-Git-Tag: holmes-import~227^2~5^2~4 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=3ed0624018423bdf91e18429ade3ed3c9f46c69e;p=libucw.git Configure: Enabled strict mode and localized @cpu. --- diff --git a/ucw/perl/UCW/Configure/C.pm b/ucw/perl/UCW/Configure/C.pm index eb30caee..ec39630d 100644 --- a/ucw/perl/UCW/Configure/C.pm +++ b/ucw/perl/UCW/Configure/C.pm @@ -8,6 +8,9 @@ package UCW::Configure::C; use UCW::Configure; +use strict; +use warnings; + Test("OS", "Checking on which OS we run", sub { my $os = `uname`; chomp $os; @@ -70,9 +73,9 @@ sub parse_cpuinfo_linux() { } sub parse_cpuinfo_darwin() { - @cpu = (`sysctl -n machdep.cpu.vendor`, - `sysctl -n machdep.cpu.family`, - `sysctl -n machdep.cpu.model`); + my @cpu = (`sysctl -n machdep.cpu.vendor`, + `sysctl -n machdep.cpu.family`, + `sysctl -n machdep.cpu.model`); chomp @cpu; return @cpu; } @@ -250,8 +253,8 @@ sub ConfigHeader($$) { open X, ">obj/$hdr" or Fail $!; print X "/* Generated automatically by $0, please don't touch manually. */\n"; - sub match_rules($) { - my ($name) = @_; + sub match_rules($$) { + my ($rules, $name) = @_; for (my $i=0; $i < scalar @$rules; $i++) { my ($r, $v) = ($rules->[$i], $rules->[$i+1]); return $v if $name =~ $r; @@ -260,7 +263,7 @@ sub ConfigHeader($$) { } foreach my $x (sort keys %UCW::Configure::vars) { - next unless match_rules($x); + next unless match_rules($rules, $x); my $v = $UCW::Configure::vars{$x}; # Try to add quotes if necessary $v = '"' . $v . '"' unless ($v =~ /^"/ || $v =~ /^\d*$/); diff --git a/ucw/perl/UCW/Configure/LibUCW.pm b/ucw/perl/UCW/Configure/LibUCW.pm index ef09fa31..3d17ac7a 100644 --- a/ucw/perl/UCW/Configure/LibUCW.pm +++ b/ucw/perl/UCW/Configure/LibUCW.pm @@ -6,6 +6,9 @@ package UCW::Configure::LibUCW; use UCW::Configure; +use strict; +use warnings; + # Determine page size Test("CPU_PAGE_SIZE", "Determining page size", sub { my $p; diff --git a/ucw/perl/UCW/Configure/Paths.pm b/ucw/perl/UCW/Configure/Paths.pm index ef5c8851..ecfa2caa 100644 --- a/ucw/perl/UCW/Configure/Paths.pm +++ b/ucw/perl/UCW/Configure/Paths.pm @@ -6,6 +6,9 @@ package UCW::Configure::Paths; use UCW::Configure; +use strict; +use warnings; + Log "Determining installation prefix ... "; if (IsSet("CONFIG_LOCAL")) { Log("local build\n");