about summary refs log tree commit diff
path: root/src/libmain/shared.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-08-10T20·19+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-08-10T20·19+0000
commitd19b6521fc5f28f821562f2f93cf9c772a5d4582 (patch)
treefb1a6ae1e0d0273d36477ca21f9b20089927867a /src/libmain/shared.cc
parent3e239a37ff6f19f2072f70881f8bce748d447c68 (diff)
* New configuration setting `build-max-jobs' which sets the default
  for the `-j' flag (i.e., the maximum number of jobs to execute in
  parallel).  Useful on multi-processor machines.

Diffstat (limited to 'src/libmain/shared.cc')
-rw-r--r--src/libmain/shared.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index d176db7a7855..2441cbf0139d 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -94,7 +94,14 @@ static void initAndRun(int argc, char * * argv)
     nixConfDir = canonPath(getEnv("NIX_CONF_DIR", NIX_CONF_DIR));
     nixLibexecDir = canonPath(getEnv("NIX_LIBEXEC_DIR", NIX_LIBEXEC_DIR));
 
+    /* Get some settings from the configuration file. */
     thisSystem = querySetting("system", SYSTEM);
+    {
+        int n;
+        if (!string2Int(querySetting("build-max-jobs", "1"), n) || n < 0)
+            throw Error("invalid value for configuration setting `build-max-jobs'");
+        maxBuildJobs = n;
+    }
 
     /* Catch SIGINT. */
     struct sigaction act, oact;