[52386] trunk/dports/devel/boost/Portfile

nox at macports.org nox at macports.org
Mon Jun 15 08:33:49 PDT 2009


Revision: 52386
          http://trac.macports.org/changeset/52386
Author:   nox at macports.org
Date:     2009-06-15 08:33:48 -0700 (Mon, 15 Jun 2009)
Log Message:
-----------
boost: Do not use portbuild::build_getmakejobs directly.

Modified Paths:
--------------
    trunk/dports/devel/boost/Portfile

Modified: trunk/dports/devel/boost/Portfile
===================================================================
--- trunk/dports/devel/boost/Portfile	2009-06-15 14:54:31 UTC (rev 52385)
+++ trunk/dports/devel/boost/Portfile	2009-06-15 15:33:48 UTC (rev 52386)
@@ -36,7 +36,7 @@
 	touch ${worksrcpath}/user-config.jam
 }
 
-build.cmd		bjam [portbuild::build_getmakejobs]
+build.cmd		bjam
 build.target
 build.args		--toolset=darwin \
 			--debug-configuration \
@@ -49,6 +49,21 @@
 			-sZLIB_INCLUDE=${prefix}/include \
 			-sZLIB_LIBPATH=${prefix}/lib
 
+pre-build {
+    set jobs [option build.jobs]
+    # if set to '0', use the number of cores for the number of jobs
+    if {${jobs} == 0} {
+        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} {
+    	build.pre_args-append	-j${jobs}
+    }
+}
+
 destroot.cmd		bjam
 destroot.destdir	--prefix=${destroot}${prefix}
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090615/df0616a2/attachment.html>


More information about the macports-changes mailing list