source: chapter08/ninja.xml@ 19a03e1

10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 19a03e1 was 1cd5961, checked in by Pierre Labastie <pieere@…>, 4 years ago

Add a tip for meson and ninja in the SysV book, telling that those packages
are optional for lfs, but required for blfs

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11945 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 4.3 KB
Line 
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-fin-sbu;</seg>
34 <seg>&ninja-fin-du;</seg>
35 </seglistitem>
36 </segmentedlist>
37
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
47 </sect2>
48
49 <sect2 role="installation">
50 <title>Installation of Ninja</title>
51
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
59 <para>Using the <emphasis>optional</emphasis> procedure below allows a user to
60 limit the number of parallel processes via an environment variable,
61 NINJAJOBS. <command>For example</command>, setting:
62
63 <!--Using <command> here to make the output bold. We really don't want
64 users setting this now and experience shows that many users blindly
65 copy/paste anything in a box. -->
66
67 <screen>export NINJAJOBS=4</screen>
68
69 will limit ninja to four parallel processes.</para>
70
71 <para>If desired, add the capability to use the environment variable
72 NINJAJOBS by running:</para>
73
74<screen><userinput remap="pre">sed -i '/int Guess/a \
75 int j = 0;\
76 char* jobs = getenv( "NINJAJOBS" );\
77 if ( jobs != NULL ) j = atoi( jobs );\
78 if ( j > 0 ) return j;\
79' src/ninja.cc</userinput></screen>
80
81 <para>Build Ninja with:</para>
82
83<screen><userinput remap="configure">python3 configure.py --bootstrap</userinput></screen>
84
85 <variablelist>
86 <title>The meaning of the build option:</title>
87
88 <varlistentry>
89 <term><parameter>--bootstrap</parameter></term>
90 <listitem>
91 <para>This parameter forces ninja to rebuild itself for the current
92 system.</para>
93 </listitem>
94 </varlistentry>
95
96 </variablelist>
97
98 <para>To test the results, issue:</para>
99
100<screen><userinput remap="test">./ninja ninja_test
101./ninja_test --gtest_filter=-SubprocessTest.SetWithLots</userinput></screen>
102
103 <para>Install the package:</para>
104
105<screen><userinput remap="install">install -vm755 ninja /usr/bin/
106install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
107install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja</userinput></screen>
108
109 </sect2>
110
111 <sect2 id="contents-ninja" role="content">
112 <title>Contents of Ninja</title>
113
114 <segmentedlist>
115 <segtitle>Installed programs</segtitle>
116
117 <seglistitem>
118 <seg>ninja</seg>
119 </seglistitem>
120 </segmentedlist>
121 <variablelist>
122 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
123 <?dbfo list-presentation="list"?>
124 <?dbhtml list-presentation="table"?>
125
126 <varlistentry id="ninja">
127 <term><command>ninja</command></term>
128 <listitem>
129 <para>is the Ninja build system.</para>
130 <indexterm zone="ch-system-ninja ninja">
131 <primary sortas="b-ninja">ninja</primary>
132 </indexterm>
133 </listitem>
134 </varlistentry>
135
136 </variablelist>
137
138 </sect2>
139
140</sect1>
141
Note: See TracBrowser for help on using the repository browser.