Fix the "num-cpus not found" warning the Windows WebCore build emits
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Jun 2007 18:35:50 +0000 (18:35 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Jun 2007 18:35:50 +0000 (18:35 +0000)
WebCore:

        Silence a build warning about not finding `num-cpus`

        Reviewed by Mark Rowe.

        * WebCore.vcproj/build-generated-files.sh: Look for num-cpus in its new
        location.

WebKitTools:

        Land num-cpus for the Windows build.

        Reviewed by Mark Rowe.

        * Scripts/num-cpus: Added.

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

WebCore/ChangeLog
WebCore/WebCore.vcproj/build-generated-files.sh
WebKitTools/ChangeLog
WebKitTools/Scripts/num-cpus [new file with mode: 0644]

index 3a9963f..3fee396 100644 (file)
@@ -1,3 +1,12 @@
+2007-06-23  Adam Roben  <aroben@apple.com>
+
+        Silence a build warning about not finding `num-cpus`
+
+        Reviewed by Mark Rowe.
+
+        * WebCore.vcproj/build-generated-files.sh: Look for num-cpus in its new
+        location.
+
 2007-06-22  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Darin.
index a3a1b24..463ff7a 100644 (file)
@@ -1,12 +1,8 @@
 #!/usr/bin/bash
 
-NUMCPUS=`../../../Tools/Scripts/num-cpus`
+NUMCPUS=`../../WebKitTools/Scripts/num-cpus`
 
-if [ -e "../../../../OpenSource/WebCore" ]; then
-    XSRCROOT="`pwd`/../../../../OpenSource/WebCore"
-else
-    XSRCROOT="`pwd`/.."
-fi
+XSRCROOT="`pwd`/.."
 XSRCROOT=`realpath "$XSRCROOT"`
 # Do a little dance to get the path into 8.3 form to make it safe for gnu make
 # http://bugzilla.opendarwin.org/show_bug.cgi?id=8173
index ea7f099..a56c806 100644 (file)
@@ -1,3 +1,11 @@
+2007-06-23  Adam Roben  <aroben@apple.com>
+
+        Land num-cpus for the Windows build.
+
+        Reviewed by Mark Rowe.
+
+        * Scripts/num-cpus: Added.
+
 2007-06-22  Simon Hausmann  <hausmann@kde.org>
 
         Reviewed by Adam Roben.
diff --git a/WebKitTools/Scripts/num-cpus b/WebKitTools/Scripts/num-cpus
new file mode 100644 (file)
index 0000000..c5f28a1
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Win32API::Registry 0.21 qw( :ALL );
+
+
+my $key;
+my $i = 0;
+while (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\$i", 0, KEY_READ, $key)) {
+    $i++;
+    RegCloseKey($key);
+}
+
+print "$i\n";