[b0aabe0] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-system-ninja" role="wrap">
|
---|
| 9 | <?dbhtml filename="ninja.html"?>
|
---|
| 10 |
|
---|
| 11 | <sect1info condition="script">
|
---|
| 12 | <productname>ninja</productname>
|
---|
| 13 | <productnumber>&ninja-version;</productnumber>
|
---|
| 14 | <address>&ninja-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
| 17 | <title>Ninja-&ninja-version;</title>
|
---|
| 18 |
|
---|
| 19 | <indexterm zone="ch-system-ninja">
|
---|
| 20 | <primary sortas="a-Ninja">Ninja</primary>
|
---|
| 21 | </indexterm>
|
---|
| 22 |
|
---|
| 23 | <sect2 role="package">
|
---|
| 24 | <title/>
|
---|
| 25 |
|
---|
| 26 | <para>Ninja is a small build system with a focus on speed.</para>
|
---|
| 27 |
|
---|
| 28 | <segmentedlist>
|
---|
| 29 | <segtitle>&buildtime;</segtitle>
|
---|
| 30 | <segtitle>&diskspace;</segtitle>
|
---|
| 31 |
|
---|
| 32 | <seglistitem>
|
---|
| 33 | <seg>&ninja-ch6-sbu;</seg>
|
---|
| 34 | <seg>&ninja-ch6-du;</seg>
|
---|
| 35 | </seglistitem>
|
---|
| 36 | </segmentedlist>
|
---|
| 37 |
|
---|
| 38 | </sect2>
|
---|
| 39 |
|
---|
| 40 | <sect2 role="installation">
|
---|
| 41 | <title>Installation of Ninja</title>
|
---|
[e050677] | 42 |
|
---|
[4476fba] | 43 | <para>When run, ninja normally runs a maximum number of processes
|
---|
| 44 | in parallel. By default this is the number of cores on the system
|
---|
| 45 | plus two. In some cases this can overheat a CPU or run a system out
|
---|
| 46 | of memory. If run from the command line, passing a -jN parameter
|
---|
| 47 | will limit the number of parallel processes, but some packages
|
---|
| 48 | embed the execution of ninja and do not pass a -j parameter.</para>
|
---|
| 49 |
|
---|
[e050677] | 50 | <para>Using the <emphasis>optional</emphasis> procedure below allows a user to
|
---|
[4476fba] | 51 | limit the number of parallel processes via an environment variable,
|
---|
[e050677] | 52 | NINJAJOBS. <command>For example</command>, setting:
|
---|
[4476fba] | 53 |
|
---|
[e050677] | 54 | <!--Using <command> here to make the output bold. We really don't want
|
---|
[4476fba] | 55 | users setting this now and experience shows that many users blindly
|
---|
[e050677] | 56 | copy/paste anything in a box. -->
|
---|
[4476fba] | 57 |
|
---|
| 58 | <screen>export NINJAJOBS=4</screen>
|
---|
| 59 |
|
---|
| 60 | will limit ninja to four parallel processes.</para>
|
---|
| 61 |
|
---|
[e050677] | 62 | <para>If desired, add the capability to use the environment variable
|
---|
| 63 | NINJAJOBS by running:</para>
|
---|
| 64 |
|
---|
| 65 | <screen><userinput remap="pre">sed -i '/int Guess/a \
|
---|
| 66 | int j = 0;\
|
---|
| 67 | char* jobs = getenv( "NINJAJOBS" );\
|
---|
| 68 | if ( jobs != NULL ) j = atoi( jobs );\
|
---|
| 69 | if ( j > 0 ) return j;\
|
---|
| 70 | ' src/ninja.cc</userinput></screen>
|
---|
[4476fba] | 71 |
|
---|
| 72 | <para>Build Ninja with:</para>
|
---|
[b0aabe0] | 73 |
|
---|
| 74 | <screen><userinput remap="configure">python3 configure.py --bootstrap</userinput></screen>
|
---|
| 75 |
|
---|
| 76 | <variablelist>
|
---|
[4476fba] | 77 | <title>The meaning of the build option:</title>
|
---|
[b0aabe0] | 78 |
|
---|
| 79 | <varlistentry>
|
---|
| 80 | <term><parameter>--bootstrap</parameter></term>
|
---|
| 81 | <listitem>
|
---|
| 82 | <para>This parameter forces ninja to rebuild itself for the current
|
---|
| 83 | system.</para>
|
---|
| 84 | </listitem>
|
---|
| 85 | </varlistentry>
|
---|
| 86 |
|
---|
| 87 | </variablelist>
|
---|
| 88 |
|
---|
| 89 | <para>To test the results, issue:</para>
|
---|
| 90 |
|
---|
| 91 | <screen><userinput remap="test">python3 configure.py
|
---|
| 92 | ./ninja ninja_test
|
---|
| 93 | ./ninja_test --gtest_filter=-SubprocessTest.SetWithLots</userinput></screen>
|
---|
| 94 |
|
---|
| 95 | <para>Install the package:</para>
|
---|
| 96 |
|
---|
| 97 | <screen><userinput remap="install">install -vm755 ninja /usr/bin/
|
---|
[4476fba] | 98 | install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
|
---|
| 99 | install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja</userinput></screen>
|
---|
[b0aabe0] | 100 |
|
---|
| 101 | </sect2>
|
---|
| 102 |
|
---|
| 103 | <sect2 id="contents-ninja" role="content">
|
---|
| 104 | <title>Contents of Ninja</title>
|
---|
| 105 |
|
---|
| 106 | <segmentedlist>
|
---|
| 107 | <segtitle>Installed programs</segtitle>
|
---|
| 108 |
|
---|
| 109 | <seglistitem>
|
---|
| 110 | <seg>ninja</seg>
|
---|
| 111 | </seglistitem>
|
---|
| 112 | </segmentedlist>
|
---|
| 113 | <variablelist>
|
---|
| 114 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 115 | <?dbfo list-presentation="list"?>
|
---|
| 116 | <?dbhtml list-presentation="table"?>
|
---|
| 117 |
|
---|
| 118 | <varlistentry id="ninja">
|
---|
| 119 | <term><command>ninja</command></term>
|
---|
| 120 | <listitem>
|
---|
| 121 | <para>is the Ninja build system.</para>
|
---|
| 122 | <indexterm zone="ch-system-ninja ninja">
|
---|
| 123 | <primary sortas="b-ninja">ninja</primary>
|
---|
| 124 | </indexterm>
|
---|
| 125 | </listitem>
|
---|
| 126 | </varlistentry>
|
---|
| 127 |
|
---|
| 128 | </variablelist>
|
---|
| 129 |
|
---|
| 130 | </sect2>
|
---|
| 131 |
|
---|
| 132 | </sect1>
|
---|
| 133 |
|
---|