diff options
author | Alex Parker <rockbox@aeparker.com> | 2011-07-19 19:16:54 +0000 |
---|---|---|
committer | Alex Parker <rockbox@aeparker.com> | 2011-07-19 19:16:54 +0000 |
commit | 354d8fbc63f861401b402f96975a5ab3e27d1dff (patch) | |
tree | 05360e385908b29fd3f788c6db04a4ab1433059c /tools/multigcc.pl | |
parent | 31b7ecb09b31d7fb1e95758d5c7b3b40b38437ed (diff) | |
download | rockbox-354d8fbc63f861401b402f96975a5ab3e27d1dff.tar.gz rockbox-354d8fbc63f861401b402f96975a5ab3e27d1dff.zip |
Commit FS#12188 - Fix perl scripts that used Switch by Sean Bartell.
Perl 5.14 removed Switch which means that Rockbox will no longer build
with the current release of Perl. The patch replaces Switch
with given/when which was introduced in Perl 5.10.0.
Debian stable has 5.10.1, cygwin 1.7 has 5.10.1 and Mac OSX 10.6 comes
with 5.10.0. I'm not sure what version older versions of OSX come with,
but newer versions are apparently available from Macports.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30169 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/multigcc.pl')
-rwxr-xr-x | tools/multigcc.pl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/multigcc.pl b/tools/multigcc.pl index 9be9978bd4..e263638d9d 100755 --- a/tools/multigcc.pl +++ b/tools/multigcc.pl | |||
@@ -1,5 +1,5 @@ | |||
1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl |
2 | use Switch; | 2 | use feature "switch"; |
3 | use List::Util 'shuffle'; # standard from Perl 5.8 and later | 3 | use List::Util 'shuffle'; # standard from Perl 5.8 and later |
4 | 4 | ||
5 | my $tempfile = "multigcc.out"; | 5 | my $tempfile = "multigcc.out"; |
@@ -26,16 +26,16 @@ my $command = join " ", @params; | |||
26 | 26 | ||
27 | # count number of cores | 27 | # count number of cores |
28 | my $cores; | 28 | my $cores; |
29 | switch($^O) { | 29 | given ($^O) { |
30 | case "darwin" { | 30 | when ("darwin") { |
31 | chomp($cores = `sysctl -n hw.ncpu`); | 31 | chomp($cores = `sysctl -n hw.ncpu`); |
32 | $cores = 1 if ($?); | 32 | $cores = 1 if ($?); |
33 | } | 33 | } |
34 | case "solaris" { | 34 | when ("solaris") { |
35 | $cores = scalar grep /on-line/i, `psrinfo`; | 35 | $cores = scalar grep /on-line/i, `psrinfo`; |
36 | $cores = 1 if ($?); | 36 | $cores = 1 if ($?); |
37 | } | 37 | } |
38 | else { | 38 | default { |
39 | if (open CPUINFO, "</proc/cpuinfo") { | 39 | if (open CPUINFO, "</proc/cpuinfo") { |
40 | $cores = scalar grep /^processor/i, <CPUINFO>; | 40 | $cores = scalar grep /^processor/i, <CPUINFO>; |
41 | close CPUINFO; | 41 | close CPUINFO; |