bc.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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, change an internal script to use <command>sed</command> instead
  34. of <command>ed</command>:</para>
  35. <screen><userinput remap="pre">cat &gt; bc/fix-libmath_h &lt;&lt; "EOF"
  36. #! /bin/bash
  37. sed -e '1 s/^/{"/' \
  38. -e 's/$/",/' \
  39. -e '2,$ s/^/"/' \
  40. -e '$ d' \
  41. -i libmath.h
  42. sed -e '$ s/$/0}/' \
  43. -i libmath.h
  44. EOF</userinput></screen>
  45. <para>Create a temporary symbolic link so the package can find
  46. the readline library and confirm that its required libncurses
  47. library is available. Even though the libraries are in /tools/lib
  48. at this point, the system will use /usr/lib at the end of
  49. this chapter.</para>
  50. <screen><userinput remap="pre">ln -sv /tools/lib/libncursesw.so /usr/lib/libncurses.so</userinput></screen>
  51. <para>Prepare Bc for compilation:</para>
  52. <screen><userinput remap="configure">./configure --prefix=/usr \
  53. --with-readline \
  54. --mandir=/usr/share/man \
  55. --infodir=/usr/share/info</userinput></screen>
  56. <variablelist>
  57. <title>The meaning of the configure options:</title>
  58. <varlistentry>
  59. <term><parameter>--with-readline</parameter></term>
  60. <listitem>
  61. <para>This option tells Bc to use the <filename
  62. class="libraryfile">readline</filename> library that is already
  63. installed on the system rather than using its own readline
  64. version.</para>
  65. </listitem>
  66. </varlistentry>
  67. </variablelist>
  68. <para>Compile the package:</para>
  69. <screen><userinput remap="make">make</userinput></screen>
  70. <para>To test bc, run the commands below. There is quite a bit of output,
  71. so you may want to redirect it to a file. There are a very small percentage
  72. of tests (10 of 12,144) that will indicate a round off error at the last
  73. digit.</para>
  74. <screen><userinput remap="test">echo "quit" | ./bc/bc -l Test/checklib.b</userinput></screen>
  75. <para>Install the package:</para>
  76. <screen><userinput remap="install">make install</userinput></screen>
  77. </sect2>
  78. <sect2 id="contents-bc" role="content">
  79. <title>Contents of Bc</title>
  80. <segmentedlist>
  81. <segtitle>Installed programs</segtitle>
  82. <seglistitem>
  83. <seg>bc and dc</seg>
  84. </seglistitem>
  85. </segmentedlist>
  86. <variablelist>
  87. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  88. <?dbfo list-presentation="list"?>
  89. <?dbhtml list-presentation="table"?>
  90. <varlistentry id="bc">
  91. <term><command>bc</command></term>
  92. <listitem>
  93. <para>is a command line calculator</para>
  94. <indexterm zone="ch-system-bc bc">
  95. <primary sortas="b-bc">bc</primary>
  96. </indexterm>
  97. </listitem>
  98. </varlistentry>
  99. <varlistentry id="dc">
  100. <term><command>dc</command></term>
  101. <listitem>
  102. <para>is a reverse-polish command line calculator</para>
  103. <indexterm zone="ch-system-bc dc">
  104. <primary sortas="b-dc">dc</primary>
  105. </indexterm>
  106. </listitem>
  107. </varlistentry>
  108. </variablelist>
  109. </sect2>
  110. </sect1>