[51918] trunk/base/src/port1.0/portbuild.tcl
jmr at macports.org
jmr at macports.org
Sat Jun 6 04:00:02 PDT 2009
Revision: 51918
http://trac.macports.org/changeset/51918
Author: jmr at macports.org
Date: 2009-06-06 04:00:02 -0700 (Sat, 06 Jun 2009)
Log Message:
-----------
add a fallback for when the number of CPUs can't be determined via sysctl, and use the recommended hw.availcpu instead of hw.ncpu
Modified Paths:
--------------
trunk/base/src/port1.0/portbuild.tcl
Modified: trunk/base/src/port1.0/portbuild.tcl
===================================================================
--- trunk/base/src/port1.0/portbuild.tcl 2009-06-06 09:54:24 UTC (rev 51917)
+++ trunk/base/src/port1.0/portbuild.tcl 2009-06-06 11:00:02 UTC (rev 51918)
@@ -131,7 +131,11 @@
set jobs [option build.jobs]
# if set to '0', use the number of cores for the number of jobs
if {$jobs == 0} {
- set jobs [exec "/usr/sbin/sysctl" "-n" "hw.ncpu"]
+ if {[catch {set jobs [exec "/usr/sbin/sysctl" "-n" "hw.availcpu"]}]} {
+ set jobs 2
+ ui_warn "failed to determine the number of available CPUs (probably not supported on this platform)"
+ ui_warn "defaulting to $jobs jobs, consider setting buildmakejobs to a nonzero value in macports.conf"
+ }
}
if {![string is integer -strict $jobs] || $jobs <= 1} {
return ""
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090606/9d9ebfc8/attachment.html>
More information about the macports-changes
mailing list