Author: MarcWeber
Date: 2010-06-15 19:00:51 +0000 (Tue, 15 Jun 2010)
New Revision: 22283

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22283&view=rev

Modified:
   nixpkgs/branches/stdenv-updates/pkgs/stdenv/generic/setup.sh

Log:
setup.sh: add -j and -l options

Changes:

Modified: nixpkgs/branches/stdenv-updates/pkgs/stdenv/generic/setup.sh
===================================================================
--- nixpkgs/branches/stdenv-updates/pkgs/stdenv/generic/setup.sh        
2010-06-15 19:00:48 UTC (rev 22282)
+++ nixpkgs/branches/stdenv-updates/pkgs/stdenv/generic/setup.sh        
2010-06-15 19:00:51 UTC (rev 22283)
@@ -79,9 +79,19 @@
 }
 
 runMake(){
-  cmd make ${makefile:+-f $makefile} "$@"
+  local optout=NO_PARALLEL_BUILD_${curPhase}
+  [ -n "${!optout}" ] || \
+    local j="$makeFlagsParallelBuild"
+  cmd make ${makefile:+-f $makefile} "$@" $j
 }
 
+######################################################################
+# parallel builds: opt-out
+# - in a phase:     set NO_PARALLEL_BUILD_${PHASE_NAME}
+# - for this build: pass NUM_CORES=1 to the builder
+if [ "$NUM_CORES" != 1 ]; then
+  makeFlagsParallelBuild="-j $NIX_MAX_PARALLELIZATION -l $NIX_TARGET_LOAD"
+fi
 
 ######################################################################
 # Initialisation.

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to