readline.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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-readline" role="wrap">
  8. <?dbhtml filename="readline.html"?>
  9. <sect1info condition="script">
  10. <productname>readline</productname>
  11. <productnumber>&readline-version;</productnumber>
  12. <address>&readline-url;</address>
  13. </sect1info>
  14. <title>Readline-&readline-version;</title>
  15. <indexterm zone="ch-system-readline">
  16. <primary sortas="a-Readline">Readline</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>Readline 软件包包含一些提供命令行编辑和历史记录功能的库。</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&readline-ch6-sbu;</seg>
  26. <seg>&readline-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. </sect2>
  30. <sect2 role="installation">
  31. <title>安装 Readline</title>
  32. <!--para>Reinstalling Readline will cause the old libraries to be moved to
  33. &lt;libraryname&gt;.old. While this is normally not a problem, in some cases
  34. it can trigger a linking bug in <command>ldconfig</command>. This can be
  35. avoided by issuing the following two seds:</para-->
  36. <para>重新安装 Readline 会导致旧版本的库被重命名为
  37. &lt;库名称&gt;.old 。这一般不是问题,但某些情况下会触发
  38. <command>ldconfig</command> 的一个链接 bug 。
  39. 运行以下两条 sed 命令防止这种情况:</para>
  40. <screen><userinput remap="pre">sed -i '/MV.*old/d' Makefile.in
  41. sed -i '/{OLDSUFF}/c:' support/shlib-install</userinput></screen>
  42. <para>准备安装 Readline:</para>
  43. <screen><userinput remap="configure">./configure --prefix=/usr \
  44. --disable-static \
  45. --docdir=/usr/share/doc/readline-&readline-version;</userinput></screen>
  46. <para>编译该软件包:</para>
  47. <screen><userinput remap="make">make SHLIB_LIBS="-L/tools/lib -lncursesw"</userinput></screen>
  48. <variablelist>
  49. <title>make 命令选项的含义</title>
  50. <varlistentry>
  51. <term><parameter>SHLIB_LIBS="-L/tools/lib -lncursesw"</parameter></term>
  52. <listitem>
  53. <para>该选项强制 Readline 链接到
  54. <filename class="libraryfile">libncursesw</filename> 库。</para>
  55. </listitem>
  56. </varlistentry>
  57. </variablelist>
  58. <para>该软件包不包含测试套件。</para>
  59. <para>安装该软件包:</para>
  60. <screen><userinput remap="install">make SHLIB_LIBS="-L/tools/lib -lncurses" install</userinput></screen>
  61. <!--para>Now move the dynamic libraries to a more appropriate location
  62. and fix up some permissions and symbolic links:</para-->
  63. <para>下面将动态库移动到更合适的位置,并修正访问权限和符号链接:</para>
  64. <screen><userinput remap="install">mv -v /usr/lib/lib{readline,history}.so.* /lib
  65. chmod -v u+w /lib/lib{readline,history}.so.*
  66. ln -sfv ../../lib/$(readlink /usr/lib/libreadline.so) /usr/lib/libreadline.so
  67. ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so ) /usr/lib/libhistory.so</userinput></screen>
  68. <para>如果您希望的话,可以安装文档:</para>
  69. <screen><userinput remap="install">install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-&readline-version;</userinput></screen>
  70. </sect2>
  71. <sect2 id="contents-readline" role="content">
  72. <title>Readline 的内容</title>
  73. <segmentedlist>
  74. <segtitle>安装的库</segtitle>
  75. <segtitle>安装的目录</segtitle>
  76. <seglistitem>
  77. <seg>libhistory.so 和 libreadline.so</seg>
  78. <seg>/usr/include/readline, /usr/share/readline, 以及
  79. /usr/share/doc/readline-&readline-version;</seg>
  80. </seglistitem>
  81. </segmentedlist>
  82. <variablelist>
  83. <bridgehead renderas="sect3">简要描述</bridgehead>
  84. <?dbfo list-presentation="list"?>
  85. <?dbhtml list-presentation="table"?>
  86. <varlistentry id="libhistory">
  87. <term><filename class="libraryfile">libhistory</filename></term>
  88. <listitem>
  89. <para>提供一个查询之前输入行的一致用户接口</para>
  90. <indexterm zone="ch-system-readline libhistory">
  91. <primary sortas="c-libhistory">libhistory</primary>
  92. </indexterm>
  93. </listitem>
  94. </varlistentry>
  95. <varlistentry id="libreadline">
  96. <term><filename class="libraryfile">libreadline</filename></term>
  97. <listitem>
  98. <para>提供一组在程序的交互会话中操纵输入的文本的命令</para>
  99. <indexterm zone="ch-system-readline libreadline">
  100. <primary sortas="c-libreadline">libreadline</primary>
  101. </indexterm>
  102. </listitem>
  103. </varlistentry>
  104. </variablelist>
  105. </sect2>
  106. </sect1>