ninja.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. <sect1 id="ch-system-ninja" role="wrap">
  8. <?dbhtml filename="ninja.html"?>
  9. <sect1info condition="script">
  10. <productname>ninja</productname>
  11. <productnumber>&ninja-version;</productnumber>
  12. <address>&ninja-url;</address>
  13. </sect1info>
  14. <title>Ninja-&ninja-version;</title>
  15. <indexterm zone="ch-system-ninja">
  16. <primary sortas="a-Ninja">Ninja</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>Ninja is a small build system with a focus on speed.</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&ninja-fin-sbu;</seg>
  26. <seg>&ninja-fin-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. <tip revision="sysv">
  30. <para>This section is not strictly required for LFS if not using
  31. systemd. On the other hand, ninja associated to meson makes
  32. a powerful build system combination,
  33. which is expected to be used more and more often. It is required for
  34. several packages in <ulink url="&blfs-book;">the BLFS
  35. book</ulink>.</para>
  36. </tip>
  37. </sect2>
  38. <sect2 role="installation">
  39. <title>Installation of Ninja</title>
  40. <para>When run, ninja normally runs a maximum number of processes
  41. in parallel. By default this is the number of cores on the system
  42. plus two. In some cases this can overheat a CPU or run a system out
  43. of memory. If run from the command line, passing a -jN parameter
  44. will limit the number of parallel processes, but some packages
  45. embed the execution of ninja and do not pass a -j parameter.</para>
  46. <para>Using the <emphasis>optional</emphasis> procedure below allows a user to
  47. limit the number of parallel processes via an environment variable,
  48. NINJAJOBS. <emphasis role="bold">For example</emphasis>, setting:
  49. <screen>export NINJAJOBS=4</screen>
  50. will limit ninja to four parallel processes.</para>
  51. <para>If desired, add the capability to use the environment variable
  52. NINJAJOBS by running:</para>
  53. <screen><userinput remap="pre">sed -i '/int Guess/a \
  54. int j = 0;\
  55. char* jobs = getenv( "NINJAJOBS" );\
  56. if ( jobs != NULL ) j = atoi( jobs );\
  57. if ( j > 0 ) return j;\
  58. ' src/ninja.cc</userinput></screen>
  59. <para>Build Ninja with:</para>
  60. <screen><userinput remap="configure">python3 configure.py --bootstrap</userinput></screen>
  61. <variablelist>
  62. <title>The meaning of the build option:</title>
  63. <varlistentry>
  64. <term><parameter>--bootstrap</parameter></term>
  65. <listitem>
  66. <para>This parameter forces ninja to rebuild itself for the current
  67. system.</para>
  68. </listitem>
  69. </varlistentry>
  70. </variablelist>
  71. <para>To test the results, issue:</para>
  72. <screen><userinput remap="test">./ninja ninja_test
  73. ./ninja_test --gtest_filter=-SubprocessTest.SetWithLots</userinput></screen>
  74. <para>Install the package:</para>
  75. <screen><userinput remap="install">install -vm755 ninja /usr/bin/
  76. install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
  77. install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja</userinput></screen>
  78. </sect2>
  79. <sect2 id="contents-ninja" role="content">
  80. <title>Contents of Ninja</title>
  81. <segmentedlist>
  82. <segtitle>Installed programs</segtitle>
  83. <seglistitem>
  84. <seg>ninja</seg>
  85. </seglistitem>
  86. </segmentedlist>
  87. <variablelist>
  88. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  89. <?dbfo list-presentation="list"?>
  90. <?dbhtml list-presentation="table"?>
  91. <varlistentry id="ninja">
  92. <term><command>ninja</command></term>
  93. <listitem>
  94. <para>is the Ninja build system</para>
  95. <indexterm zone="ch-system-ninja ninja">
  96. <primary sortas="b-ninja">ninja</primary>
  97. </indexterm>
  98. </listitem>
  99. </varlistentry>
  100. </variablelist>
  101. </sect2>
  102. </sect1>