bc.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. <!--
  34. <para>First, change an internal script to use <command>sed</command> instead
  35. of <command>ed</command>:</para>
  36. <screen><userinput remap="pre">cat &gt; bc/fix-libmath_h &lt;&lt; "EOF"
  37. #! /bin/bash
  38. sed -e '1 s/^/{"/' \
  39. -e 's/$/",/' \
  40. -e '2,$ s/^/"/' \
  41. -e '$ d' \
  42. -i libmath.h
  43. sed -e '$ s/$/0}/' \
  44. -i libmath.h
  45. EOF</userinput></screen>
  46. <para>Create temporary symbolic links so the package can find
  47. the readline library and confirm that its required libncurses
  48. library is available. Even though the libraries are in /tools/lib
  49. at this point, the system will use /usr/lib at the end of
  50. this chapter.</para>
  51. <screen><userinput remap="pre">ln -sv /tools/lib/libncursesw.so.6 /usr/lib/libncursesw.so.6
  52. ln -sfv libncursesw.so.6 /usr/lib/libncurses.so</userinput></screen>
  53. <para>Fix an issue in <command>configure</command> due to missing
  54. files in the early stages of LFS:</para>
  55. <screen><userinput remap="pre">sed -i -e '/flex/s/as_fn_error/: ;; # &amp;/' configure</userinput></screen>
  56. -->
  57. <para>Prepare Bc for compilation:</para>
  58. <!--
  59. <screen><userinput remap="configure">./configure - -prefix=/usr \
  60. - -with-readline \
  61. - -mandir=/usr/share/man \
  62. - -infodir=/usr/share/info</userinput></screen>
  63. -->
  64. <screen><userinput remap="configure">PREFIX=/usr CC=gcc CFLAGS="-std=c99" ./configure.sh -G -O3</userinput></screen>
  65. <variablelist>
  66. <title>The meaning of the configure options:</title>
  67. <!--
  68. <varlistentry>
  69. <term><parameter>- -with-readline</parameter></term>
  70. <listitem>
  71. <para>This option tells Bc to use the <filename
  72. class="libraryfile">readline</filename> library that is already
  73. installed on the system rather than using its own readline
  74. version.</para>
  75. </listitem>
  76. </varlistentry>
  77. -->
  78. <varlistentry>
  79. <term><parameter>CC=gcc CFLAGS="-std=c99"</parameter></term>
  80. <listitem>
  81. <para>These parameters specify the compiler and C standard to use.</para>
  82. </listitem>
  83. </varlistentry>
  84. <varlistentry>
  85. <term><parameter>-O3</parameter></term>
  86. <listitem>
  87. <para>Specify the optimization to use.</para>
  88. </listitem>
  89. </varlistentry>
  90. <varlistentry>
  91. <term><parameter>-G</parameter></term>
  92. <listitem>
  93. <para>Omit parts of the test suite that won't work
  94. without a GNU bc present.</para>
  95. </listitem>
  96. </varlistentry>
  97. </variablelist>
  98. <para>Compile the package:</para>
  99. <screen><userinput remap="make">make</userinput></screen>
  100. <!--
  101. <para>To test bc, run the commands below. There is quite a bit of output,
  102. so you may want to redirect it to a file. There are a very small percentage
  103. of tests (10 of 12,144) that will indicate a round off error at the last
  104. digit.</para>
  105. <screen><userinput remap="test">echo "quit" | ./bc/bc -l Test/checklib.b</userinput></screen>
  106. -->
  107. <para>To test bc, run:</para>
  108. <screen><userinput remap="test">make test</userinput></screen>
  109. <para>Install the package:</para>
  110. <screen><userinput remap="install">make install</userinput></screen>
  111. </sect2>
  112. <sect2 id="contents-bc" role="content">
  113. <title>Contents of Bc</title>
  114. <segmentedlist>
  115. <segtitle>Installed programs</segtitle>
  116. <seglistitem>
  117. <seg>bc and dc</seg>
  118. </seglistitem>
  119. </segmentedlist>
  120. <variablelist>
  121. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  122. <?dbfo list-presentation="list"?>
  123. <?dbhtml list-presentation="table"?>
  124. <varlistentry id="bc">
  125. <term><command>bc</command></term>
  126. <listitem>
  127. <para>A command line calculator</para>
  128. <indexterm zone="ch-system-bc bc">
  129. <primary sortas="b-bc">bc</primary>
  130. </indexterm>
  131. </listitem>
  132. </varlistentry>
  133. <varlistentry id="dc">
  134. <term><command>dc</command></term>
  135. <listitem>
  136. <para>A reverse-polish command line calculator</para>
  137. <indexterm zone="ch-system-bc dc">
  138. <primary sortas="b-dc">dc</primary>
  139. </indexterm>
  140. </listitem>
  141. </varlistentry>
  142. </variablelist>
  143. </sect2>
  144. </sect1>