[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>
|
---|
[fb386e0] | 33 | <seg>&ninja-fin-sbu;</seg>
|
---|
| 34 | <seg>&ninja-fin-du;</seg>
|
---|
[b0aabe0] | 35 | </seglistitem>
|
---|
| 36 | </segmentedlist>
|
---|
| 37 |
|
---|
[1cd5961] | 38 | <tip revision="sysv">
|
---|
| 39 | <para>This section is not strictly required for LFS if not using
|
---|
| 40 | systemd. On the other hand, ninja associated to meson makes
|
---|
| 41 | a powerful build system combination,
|
---|
| 42 | which is expected to be used more and more often. It is required for
|
---|
| 43 | several packages in <ulink url="&blfs-book;">the BLFS
|
---|
| 44 | book</ulink>.</para>
|
---|
| 45 | </tip>
|
---|
| 46 |
|
---|
[b0aabe0] | 47 | </sect2>
|
---|
| 48 |
|
---|
| 49 | <sect2 role="installation">
|
---|
| 50 | <title>Installation of Ninja</title>
|
---|
[e050677] | 51 |
|
---|
[4476fba] | 52 | <para>When run, ninja normally runs a maximum number of processes
|
---|
| 53 | in parallel. By default this is the number of cores on the system
|
---|
| 54 | plus two. In some cases this can overheat a CPU or run a system out
|
---|
| 55 | of memory. If run from the command line, passing a -jN parameter
|
---|
| 56 | will limit the number of parallel processes, but some packages
|
---|
| 57 | embed the execution of ninja and do not pass a -j parameter.</para>
|
---|
| 58 |
|
---|
[e050677] | 59 | <para>Using the <emphasis>optional</emphasis> procedure below allows a user to
|
---|
[4476fba] | 60 | limit the number of parallel processes via an environment variable,
|
---|
[5d6f3dd] | 61 | NINJAJOBS. <emphasis role="bold">For example</emphasis>, setting:
|
---|
[4476fba] | 62 |
|
---|
| 63 | <screen>export NINJAJOBS=4</screen>
|
---|
| 64 |
|
---|
| 65 | will limit ninja to four parallel processes.</para>
|
---|
| 66 |
|
---|
[e050677] | 67 | <para>If desired, add the capability to use the environment variable
|
---|
| 68 | NINJAJOBS by running:</para>
|
---|
| 69 |
|
---|
| 70 | <screen><userinput remap="pre">sed -i '/int Guess/a \
|
---|
| 71 | int j = 0;\
|
---|
| 72 | char* jobs = getenv( "NINJAJOBS" );\
|
---|
| 73 | if ( jobs != NULL ) j = atoi( jobs );\
|
---|
| 74 | if ( j > 0 ) return j;\
|
---|
| 75 | ' src/ninja.cc</userinput></screen>
|
---|
[4476fba] | 76 |
|
---|
| 77 | <para>Build Ninja with:</para>
|
---|
[b0aabe0] | 78 |
|
---|
| 79 | <screen><userinput remap="configure">python3 configure.py --bootstrap</userinput></screen>
|
---|
| 80 |
|
---|
| 81 | <variablelist>
|
---|
[4476fba] | 82 | <title>The meaning of the build option:</title>
|
---|
[b0aabe0] | 83 |
|
---|
| 84 | <varlistentry>
|
---|
| 85 | <term><parameter>--bootstrap</parameter></term>
|
---|
| 86 | <listitem>
|
---|
| 87 | <para>This parameter forces ninja to rebuild itself for the current
|
---|
| 88 | system.</para>
|
---|
| 89 | </listitem>
|
---|
| 90 | </varlistentry>
|
---|
| 91 |
|
---|
| 92 | </variablelist>
|
---|
| 93 |
|
---|
| 94 | <para>To test the results, issue:</para>
|
---|
| 95 |
|
---|
[3333b64] | 96 | <screen><userinput remap="test">./ninja ninja_test
|
---|
[b0aabe0] | 97 | ./ninja_test --gtest_filter=-SubprocessTest.SetWithLots</userinput></screen>
|
---|
| 98 |
|
---|
| 99 | <para>Install the package:</para>
|
---|
| 100 |
|
---|
| 101 | <screen><userinput remap="install">install -vm755 ninja /usr/bin/
|
---|
[4476fba] | 102 | install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
|
---|
| 103 | install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja</userinput></screen>
|
---|
[b0aabe0] | 104 |
|
---|
| 105 | </sect2>
|
---|
| 106 |
|
---|
| 107 | <sect2 id="contents-ninja" role="content">
|
---|
| 108 | <title>Contents of Ninja</title>
|
---|
| 109 |
|
---|
| 110 | <segmentedlist>
|
---|
| 111 | <segtitle>Installed programs</segtitle>
|
---|
| 112 |
|
---|
| 113 | <seglistitem>
|
---|
| 114 | <seg>ninja</seg>
|
---|
| 115 | </seglistitem>
|
---|
| 116 | </segmentedlist>
|
---|
| 117 | <variablelist>
|
---|
| 118 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 119 | <?dbfo list-presentation="list"?>
|
---|
| 120 | <?dbhtml list-presentation="table"?>
|
---|
| 121 |
|
---|
| 122 | <varlistentry id="ninja">
|
---|
| 123 | <term><command>ninja</command></term>
|
---|
| 124 | <listitem>
|
---|
[8d35535] | 125 | <para>is the Ninja build system</para>
|
---|
[b0aabe0] | 126 | <indexterm zone="ch-system-ninja ninja">
|
---|
| 127 | <primary sortas="b-ninja">ninja</primary>
|
---|
| 128 | </indexterm>
|
---|
| 129 | </listitem>
|
---|
| 130 | </varlistentry>
|
---|
| 131 |
|
---|
| 132 | </variablelist>
|
---|
| 133 |
|
---|
| 134 | </sect2>
|
---|
| 135 |
|
---|
| 136 | </sect1>
|
---|
| 137 |
|
---|