From 354d8fbc63f861401b402f96975a5ab3e27d1dff Mon Sep 17 00:00:00 2001 From: Alex Parker Date: Tue, 19 Jul 2011 19:16:54 +0000 Subject: 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 --- tools/multigcc.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools/multigcc.pl') 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 @@ #!/usr/bin/perl -use Switch; +use feature "switch"; use List::Util 'shuffle'; # standard from Perl 5.8 and later my $tempfile = "multigcc.out"; @@ -26,16 +26,16 @@ my $command = join " ", @params; # count number of cores my $cores; -switch($^O) { - case "darwin" { +given ($^O) { + when ("darwin") { chomp($cores = `sysctl -n hw.ncpu`); $cores = 1 if ($?); } - case "solaris" { + when ("solaris") { $cores = scalar grep /on-line/i, `psrinfo`; $cores = 1 if ($?); } - else { + default { if (open CPUINFO, "; close CPUINFO; -- cgit v1.2.3