ninja.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. <command>For example</command>, setting:
  49. <!--Using <command> here to make the output bold. We really don't want
  50. users setting this now and experience shows that many users blindly
  51. copy/paste anything in a box. -->
  52. <screen>export NINJAJOBS=4</screen>
  53. will limit ninja to four parallel processes.</para>
  54. <para>If desired, add the capability to use the environment variable
  55. NINJAJOBS by running:</para>
  56. <screen><userinput remap="pre">sed -i '/int Guess/a \
  57. int j = 0;\
  58. char* jobs = getenv( "NINJAJOBS" );\
  59. if ( jobs != NULL ) j = atoi( jobs );\
  60. if ( j > 0 ) return j;\
  61. ' src/ninja.cc</userinput></screen>
  62. <para>Build Ninja with:</para>
  63. <screen><userinput remap="configure">python3 configure.py --bootstrap</userinput></screen>
  64. <variablelist>
  65. <title>The meaning of the build option:</title>
  66. <varlistentry>
  67. <term><parameter>--bootstrap</parameter></term>
  68. <listitem>
  69. <para>This parameter forces ninja to rebuild itself for the current
  70. system.</para>
  71. </listitem>
  72. </varlistentry>
  73. </variablelist>
  74. <para>To test the results, issue:</para>
  75. <screen><userinput remap="test">./ninja ninja_test
  76. ./ninja_test --gtest_filter=-SubprocessTest.SetWithLots</userinput></screen>
  77. <para>Install the package:</para>
  78. <screen><userinput remap="install">install -vm755 ninja /usr/bin/
  79. install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
  80. install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja</userinput></screen>
  81. </sect2>
  82. <sect2 id="contents-ninja" role="content">
  83. <title>Contents of Ninja</title>
  84. <segmentedlist>
  85. <segtitle>Installed programs</segtitle>
  86. <seglistitem>
  87. <seg>ninja</seg>
  88. </seglistitem>
  89. </segmentedlist>
  90. <variablelist>
  91. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  92. <?dbfo list-presentation="list"?>
  93. <?dbhtml list-presentation="table"?>
  94. <varlistentry id="ninja">
  95. <term><command>ninja</command></term>
  96. <listitem>
  97. <para>is the Ninja build system.</para>
  98. <indexterm zone="ch-system-ninja ninja">
  99. <primary sortas="b-ninja">ninja</primary>
  100. </indexterm>
  101. </listitem>
  102. </varlistentry>
  103. </variablelist>
  104. </sect2>
  105. </sect1>