summaryrefslogtreecommitdiff
path: root/tools/multigcc.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/multigcc.pl')
-rwxr-xr-xtools/multigcc.pl10
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
2use Switch; 2use feature "switch";
3use List::Util 'shuffle'; # standard from Perl 5.8 and later 3use List::Util 'shuffle'; # standard from Perl 5.8 and later
4 4
5my $tempfile = "multigcc.out"; 5my $tempfile = "multigcc.out";
@@ -26,16 +26,16 @@ my $command = join " ", @params;
26 26
27# count number of cores 27# count number of cores
28my $cores; 28my $cores;
29switch($^O) { 29given ($^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;