bc.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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-bc" role="wrap">
  8. <?dbhtml filename="bc.html"?>
  9. <sect1info condition="script">
  10. <productname>bc</productname>
  11. <productnumber>&bc-version;</productnumber>
  12. <address>&bc-url;</address>
  13. </sect1info>
  14. <title>Bc-&bc-version;</title>
  15. <indexterm zone="ch-system-bc">
  16. <primary sortas="a-Bc">Bc</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>The Bc package contains an arbitrary precision numeric processing
  21. language.</para>
  22. <segmentedlist>
  23. <segtitle>&buildtime;</segtitle>
  24. <segtitle>&diskspace;</segtitle>
  25. <seglistitem>
  26. <seg>&bc-ch6-sbu;</seg>
  27. <seg>&bc-ch6-du;</seg>
  28. </seglistitem>
  29. </segmentedlist>
  30. </sect2>
  31. <sect2 role="installation">
  32. <title>Installation of Bc</title>
  33. <para>First, fix some minor memory leaks in the code:</para>
  34. <screen><userinput remap="pre">patch -Np1 -i ../&bc-memory-leak-patch;</userinput></screen>
  35. <para>Create a temporary symbolic link so the package can find
  36. the readline library and confirm that its required libncurses
  37. library is available. Even though the libraries are in /tools/lib
  38. at this point, the system will use /usr/lib at the end of
  39. this chapter.</para>
  40. <screen><userinput remap="pre">ln -sv /tools/lib/libncursesw.so /usr/lib/libncurses.so</userinput></screen>
  41. <para>Prepare Bc for compilation:</para>
  42. <screen><userinput remap="configure">./configure --prefix=/usr \
  43. --with-readline \
  44. --mandir=/usr/share/man \
  45. --infodir=/usr/share/info</userinput></screen>
  46. <variablelist>
  47. <title>The meaning of the configure options:</title>
  48. <varlistentry>
  49. <term><parameter>--with-readline</parameter></term>
  50. <listitem>
  51. <para>This option tells Bc to use the <filename
  52. class="libraryfile">readline</filename> library that is already
  53. installed on the system rather than using its own readline
  54. version.</para>
  55. </listitem>
  56. </varlistentry>
  57. </variablelist>
  58. <para>Compile the package:</para>
  59. <screen><userinput remap="make">make</userinput></screen>
  60. <para>To test bc, run the commands below. There is quite a bit of output,
  61. so you may want to redirect it to a file. There are a very small percentage
  62. of tests (10 of 12,144) that will indicate a round off error at the last
  63. digit.</para>
  64. <screen><userinput remap="test">echo "quit" | ./bc/bc -l Test/checklib.b</userinput></screen>
  65. <para>Install the package:</para>
  66. <screen><userinput remap="install">make install</userinput></screen>
  67. </sect2>
  68. <sect2 id="contents-bc" role="content">
  69. <title>Contents of Bc</title>
  70. <segmentedlist>
  71. <segtitle>Installed programs</segtitle>
  72. <seglistitem>
  73. <seg>bc and dc</seg>
  74. </seglistitem>
  75. </segmentedlist>
  76. <variablelist>
  77. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  78. <?dbfo list-presentation="list"?>
  79. <?dbhtml list-presentation="table"?>
  80. <varlistentry id="bc">
  81. <term><command>bc</command></term>
  82. <listitem>
  83. <para>is a command line calculator</para>
  84. <indexterm zone="ch-system-bc bc">
  85. <primary sortas="b-bc">bc</primary>
  86. </indexterm>
  87. </listitem>
  88. </varlistentry>
  89. <varlistentry id="dc">
  90. <term><command>dc</command></term>
  91. <listitem>
  92. <para>is a reverse-polish command line calculator</para>
  93. <indexterm zone="ch-system-bc dc">
  94. <primary sortas="b-dc">dc</primary>
  95. </indexterm>
  96. </listitem>
  97. </varlistentry>
  98. </variablelist>
  99. </sect2>
  100. </sect1>