1
0

bc.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?xml version="1.0" encoding="UTF-8"?>
  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>Bc 软件包包含一个任意精度数值处理语言。</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&bc-ch6-sbu;</seg>
  26. <seg>&bc-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. </sect2>
  30. <sect2 role="installation">
  31. <title>安装 Bc</title>
  32. <para>首先修改一个内部脚本,使它使用 <command>sed</command>,
  33. 而不是 <command>ed</command>:</para>
  34. <screen><userinput remap="pre">cat &gt; bc/fix-libmath_h &lt;&lt; "EOF"
  35. #! /bin/bash
  36. sed -e '1 s/^/{"/' \
  37. -e 's/$/",/' \
  38. -e '2,$ s/^/"/' \
  39. -e '$ d' \
  40. -i libmath.h
  41. sed -e '$ s/$/0}/' \
  42. -i libmath.h
  43. EOF</userinput></screen>
  44. <!--para>Create temporary symbolic links so the package can find
  45. the readline library and confirm that its required libncurses
  46. library is available. Even though the libraries are in /tools/lib
  47. at this point, the system will use /usr/lib at the end of
  48. this chapter.</para-->
  49. <para> 创建一个临时的符号链接,使该软件包可以找到 readline 库,
  50. 并确认它需要的 libncurses 库可用。虽然目前它还在 /tools/lib
  51. 中,但在本章结束时系统会使用 /usr/lib 中的最后版本。 </para>
  52. <screen><userinput remap="pre">ln -sv /tools/lib/libncursesw.so.6 /usr/lib/libncursesw.so.6
  53. ln -sfv libncursesw.so.6 /usr/lib/libncurses.so</userinput></screen>
  54. <para>由于LFS 早期阶段缺失了一些文件,需要修正
  55. <command>configure</command> 中的一个问题:</para>
  56. <screen><userinput remap="pre">sed -i -e '/flex/s/as_fn_error/: ;; # &amp;/' configure</userinput></screen>
  57. <para>准备安装 Bc:</para>
  58. <screen><userinput remap="configure">./configure --prefix=/usr \
  59. --with-readline \
  60. --mandir=/usr/share/man \
  61. --infodir=/usr/share/info</userinput></screen>
  62. <variablelist>
  63. <title>配置选项的含义:</title>
  64. <varlistentry>
  65. <term><parameter>--with-readline</parameter></term>
  66. <listitem>
  67. <!--para>This option tells Bc to use the <filename
  68. class="libraryfile">readline</filename> library that is already
  69. installed on the system rather than using its own readline
  70. version.</para-->
  71. <para>该选项告诉 Bc 使用系统中已经安装好的
  72. <filename class="libraryfile">readline</filename>
  73. 库,而不是它自己附带的 readline 。</para>
  74. </listitem>
  75. </varlistentry>
  76. </variablelist>
  77. <para>编译该软件包:</para>
  78. <screen><userinput remap="make">make</userinput></screen>
  79. <!--para>To test bc, run the commands below. There is quite a bit of output,
  80. so you may want to redirect it to a file. There are a very small percentage
  81. of tests (10 of 12,144) that will indicate a round off error at the last
  82. digit.</para-->
  83. <para>为了测试 bc,执行以下命令。它会输出很多内容,
  84. 因此您可能希望把输出重定向到文件。
  85. 少量测试 (12144 个测试中有 10 个)会在最后一位出现舍入误差。
  86. </para>
  87. <screen><userinput remap="test">echo "quit" | ./bc/bc -l Test/checklib.b</userinput></screen>
  88. <para>安装该软件包:</para>
  89. <screen><userinput remap="install">make install</userinput></screen>
  90. </sect2>
  91. <sect2 id="contents-bc" role="content">
  92. <title>Bc 的内容</title>
  93. <segmentedlist>
  94. <segtitle>安装的程序</segtitle>
  95. <seglistitem>
  96. <seg>bc 和 dc</seg>
  97. </seglistitem>
  98. </segmentedlist>
  99. <variablelist>
  100. <bridgehead renderas="sect3">简要描述</bridgehead>
  101. <?dbfo list-presentation="list"?>
  102. <?dbhtml list-presentation="table"?>
  103. <varlistentry id="bc">
  104. <term><command>bc</command></term>
  105. <listitem>
  106. <para>一个命令行计算器</para>
  107. <indexterm zone="ch-system-bc bc">
  108. <primary sortas="b-bc">bc</primary>
  109. </indexterm>
  110. </listitem>
  111. </varlistentry>
  112. <varlistentry id="dc">
  113. <term><command>dc</command></term>
  114. <listitem>
  115. <para>一个逆波兰式命令行计算器</para>
  116. <indexterm zone="ch-system-bc dc">
  117. <primary sortas="b-dc">dc</primary>
  118. </indexterm>
  119. </listitem>
  120. </varlistentry>
  121. </variablelist>
  122. </sect2>
  123. </sect1>