aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/ninja.xml
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2019-02-19 06:05:57 +0000
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2019-02-19 06:05:57 +0000
commite050677ffbe61adb53ec3abd6c80228e0a9cab75 (patch)
tree9ebdfb9d9cea48f323e8b5fc19403054a0ec3aed /chapter06/ninja.xml
parent1d19f36da9ae9dde0f249fc3851a02e465cb7ec1 (diff)
Add an optional modification to theh build procedure for ninja to allow use the
the environment variable NINJAJOBS. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11526 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06/ninja.xml')
-rw-r--r--chapter06/ninja.xml22
1 files changed, 14 insertions, 8 deletions
diff --git a/chapter06/ninja.xml b/chapter06/ninja.xml
index 96533f1fe..5be498eb7 100644
--- a/chapter06/ninja.xml
+++ b/chapter06/ninja.xml
@@ -39,7 +39,7 @@
<sect2 role="installation">
<title>Installation of Ninja</title>
-<!--
+
<para>When run, ninja normally runs a maximum number of processes
in parallel. By default this is the number of cores on the system
plus two. In some cases this can overheat a CPU or run a system out
@@ -47,22 +47,28 @@
will limit the number of parallel processes, but some packages
embed the execution of ninja and do not pass a -j parameter.</para>
- <para>Using the <emphasis>optional</emphasis> patch below allows a user to
+ <para>Using the <emphasis>optional</emphasis> procedure below allows a user to
limit the number of parallel processes via an environment variable,
- NINJAJOBS. <command>For example</command> setting:
+ NINJAJOBS. <command>For example</command>, setting:
- <!- - Using <command> here to make the output bold. We really don't want
+ <!--Using <command> here to make the output bold. We really don't want
users setting this now and experience shows that many users blindly
- copy/paste anything in a box. - ->
+ copy/paste anything in a box. -->
<screen>export NINJAJOBS=4</screen>
will limit ninja to four parallel processes.</para>
- <para>If desired, install the patch by running:</para>
+ <para>If desired, add the capability to use the environment variable
+ NINJAJOBS by running:</para>
+
+<screen><userinput remap="pre">sed -i '/int Guess/a \
+ int j = 0;\
+ char* jobs = getenv( "NINJAJOBS" );\
+ if ( jobs != NULL ) j = atoi( jobs );\
+ if ( j > 0 ) return j;\
+' src/ninja.cc</userinput></screen>
-<screen><userinput remap="pre">patch -Np1 -i ../ninja-1.8.2-add_NINJAJOBS_var-1.patch</userinput></screen>
--->
<para>Build Ninja with:</para>
<screen><userinput remap="configure">python3 configure.py --bootstrap</userinput></screen>