diff options
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; |