ninja.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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-ch6-sbu;</seg>
  26. <seg>&ninja-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. </sect2>
  30. <sect2 role="installation">
  31. <title>Installation of Ninja</title>
  32. <para>When run, ninja normally runs a maximum number of processes
  33. in parallel. By default this is the number of cores on the system
  34. plus two. In some cases this can overheat a CPU or run a system out
  35. of memory. If run from the command line, passing a -jN parameter
  36. will limit the number of parallel processes, but some packages
  37. embed the execution of ninja and do not pass a -j parameter.</para>
  38. <para>Using the <emphasis>optional</emphasis> procedure below allows a user to
  39. limit the number of parallel processes via an environment variable,
  40. NINJAJOBS. <command>For example</command>, setting:
  41. <!--Using <command> here to make the output bold. We really don't want
  42. users setting this now and experience shows that many users blindly
  43. copy/paste anything in a box. -->
  44. <screen>export NINJAJOBS=4</screen>
  45. will limit ninja to four parallel processes.</para>
  46. <para>If desired, add the capability to use the environment variable
  47. NINJAJOBS by running:</para>
  48. <screen><userinput remap="pre">sed -i '/int Guess/a \
  49. int j = 0;\
  50. char* jobs = getenv( "NINJAJOBS" );\
  51. if ( jobs != NULL ) j = atoi( jobs );\
  52. if ( j > 0 ) return j;\
  53. ' src/ninja.cc</userinput></screen>
  54. <para>Build Ninja with:</para>
  55. <screen><userinput remap="configure">python3 configure.py --bootstrap</userinput></screen>
  56. <variablelist>
  57. <title>The meaning of the build option:</title>
  58. <varlistentry>
  59. <term><parameter>--bootstrap</parameter></term>
  60. <listitem>
  61. <para>This parameter forces ninja to rebuild itself for the current
  62. system.</para>
  63. </listitem>
  64. </varlistentry>
  65. </variablelist>
  66. <para>To test the results, issue:</para>
  67. <screen><userinput remap="test">./ninja ninja_test
  68. ./ninja_test --gtest_filter=-SubprocessTest.SetWithLots</userinput></screen>
  69. <para>Install the package:</para>
  70. <screen><userinput remap="install">install -vm755 ninja /usr/bin/
  71. install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
  72. install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja</userinput></screen>
  73. </sect2>
  74. <sect2 id="contents-ninja" role="content">
  75. <title>Contents of Ninja</title>
  76. <segmentedlist>
  77. <segtitle>Installed programs</segtitle>
  78. <seglistitem>
  79. <seg>ninja</seg>
  80. </seglistitem>
  81. </segmentedlist>
  82. <variablelist>
  83. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  84. <?dbfo list-presentation="list"?>
  85. <?dbhtml list-presentation="table"?>
  86. <varlistentry id="ninja">
  87. <term><command>ninja</command></term>
  88. <listitem>
  89. <para>is the Ninja build system.</para>
  90. <indexterm zone="ch-system-ninja ninja">
  91. <primary sortas="b-ninja">ninja</primary>
  92. </indexterm>
  93. </listitem>
  94. </varlistentry>
  95. </variablelist>
  96. </sect2>
  97. </sect1>