build-webkit should use environment variable at number of CPU
authorrgabor@webkit.org <rgabor@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 18:10:40 +0000 (18:10 +0000)
committerrgabor@webkit.org <rgabor@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2012 18:10:40 +0000 (18:10 +0000)
detection on all platform
https://bugs.webkit.org/show_bug.cgi?id=79227

Reviewed by Martin Robinson.

* Scripts/webkitdirs.pm:
(determineNumberOfCPUs):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108513 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitdirs.pm

index 05afaf5..f4eaf87 100644 (file)
@@ -1,3 +1,14 @@
+2012-02-22  Gabor Rapcsanyi  <rgabor@webkit.org>
+
+        build-webkit should use environment variable at number of CPU
+        detection on all platform
+        https://bugs.webkit.org/show_bug.cgi?id=79227
+
+        Reviewed by Martin Robinson.
+
+        * Scripts/webkitdirs.pm:
+        (determineNumberOfCPUs):
+
 2012-02-22  Mihnea Ovidenie  <mihnea@adobe.com>
 
         [Qt] REGRESSION(r108108): It made 3 fast/repaint tests fail
index abbd41e..bcae94c 100755 (executable)
@@ -326,7 +326,9 @@ sub determineArchitecture
 sub determineNumberOfCPUs
 {
     return if defined $numberOfCPUs;
-    if (isLinux()) {
+    if (defined($ENV{NUMBER_OF_PROCESSORS})) {
+        $numberOfCPUs = $ENV{NUMBER_OF_PROCESSORS};
+    } elsif (isLinux()) {
         # First try the nproc utility, if it exists. If we get no
         # results fall back to just interpretting /proc directly.
         chomp($numberOfCPUs = `nproc 2> /dev/null`);
@@ -334,12 +336,8 @@ sub determineNumberOfCPUs
             $numberOfCPUs = (grep /processor/, `cat /proc/cpuinfo`);
         }
     } elsif (isWindows() || isCygwin()) {
-        if (defined($ENV{NUMBER_OF_PROCESSORS})) {
-            $numberOfCPUs = $ENV{NUMBER_OF_PROCESSORS};
-        } else {
-            # Assumes cygwin
-            $numberOfCPUs = `ls /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor | wc -w`;
-        }
+        # Assumes cygwin
+        $numberOfCPUs = `ls /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor | wc -w`;
     } elsif (isDarwin()) {
         chomp($numberOfCPUs = `sysctl -n hw.ncpu`);
     }