expect.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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-tools-expect" role="wrap">
  8. <?dbhtml filename="expect.html"?>
  9. <sect1info condition="script">
  10. <productname>expect</productname>
  11. <productnumber>&expect-version;</productnumber>
  12. <address>&expect-url;</address>
  13. </sect1info>
  14. <title>Expect-&expect-version;</title>
  15. <indexterm zone="ch-tools-expect">
  16. <primary sortas="a-Expect">Expect</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <!--para>The Expect package contains a program for carrying out scripted
  21. dialogues with other interactive programs.</para-->
  22. <para>Expect 软件包包含一个根据脚本,与其他交互程序进行对话的程序。
  23. </para>
  24. <segmentedlist>
  25. <segtitle>&buildtime;</segtitle>
  26. <segtitle>&diskspace;</segtitle>
  27. <seglistitem>
  28. <seg>&expect-ch5-sbu;</seg>
  29. <seg>&expect-ch5-du;</seg>
  30. </seglistitem>
  31. </segmentedlist>
  32. </sect2>
  33. <sect2 role="installation">
  34. <title>安装 Expect</title>
  35. <!--para>First, force Expect's configure script to use <filename>/bin/stty</filename>
  36. instead of a <filename>/usr/local/bin/stty</filename> it may find on the host system.
  37. This will ensure that our test suite tools remain sane for the final builds of our
  38. toolchain:</para-->
  39. <para>首先强制 Expect 的配置脚本使用 <filename>/bin/stty</filename>,
  40. 而不是宿主系统上可能存在的
  41. <filename>/usr/local/bin/stty</filename>,
  42. 以保证测试套件工具在最终构建工具链时仍然完整:</para>
  43. <screen><userinput remap="pre">cp -v configure{,.orig}
  44. sed 's:/usr/local/bin:/bin:' configure.orig &gt; configure</userinput></screen>
  45. <para>现在准备编译 Expect:</para>
  46. <screen><userinput remap="configure">./configure --prefix=/tools \
  47. --with-tcl=/tools/lib \
  48. --with-tclinclude=/tools/include</userinput></screen>
  49. <variablelist>
  50. <title>配置选项的含义:</title>
  51. <varlistentry>
  52. <term><parameter>--with-tcl=/tools/lib</parameter></term>
  53. <listitem>
  54. <!--para>This ensures that the configure script finds the Tcl
  55. installation in the temporary tools location instead of possibly
  56. locating an existing one on the host system.</para-->
  57. <para>这保证配置脚本找到临时工具中的 Tcl 安装,
  58. 而不是宿主系统中可能存在的 Tcl 安装。</para>
  59. </listitem>
  60. </varlistentry>
  61. <varlistentry>
  62. <term><parameter>--with-tclinclude=/tools/include</parameter></term>
  63. <listitem>
  64. <!--para>This explicitly tells Expect where to find Tcl's internal
  65. headers. Using this option avoids conditions where
  66. <command>configure</command> fails because it cannot automatically
  67. discover the location of Tcl's headers.</para-->
  68. <para>该选项明确告诉 Expect 去哪里寻找 Tcl 的内部头文件。
  69. 使用该选项可以避免某些情况下 <command>configure</command>
  70. 由于找不到 Tcl 头文件的位置而失败。</para>
  71. </listitem>
  72. </varlistentry>
  73. </variablelist>
  74. <para>构建该软件包:</para>
  75. <screen><userinput remap="make">make</userinput></screen>
  76. <!--para>Compilation is now complete. As discussed earlier, running the test
  77. suite is not mandatory for the temporary tools here in this chapter. To run
  78. the Expect test suite anyway, issue the following command:</para-->
  79. <para>现在编译已经完成,正如之前所述,
  80. 并不需要运行本章中临时工具的测试套件。如果一定要运行 Expect
  81. 的测试套件,输入以下命令:</para>
  82. <screen><userinput remap="test">make test</userinput></screen>
  83. <!--para>Note that the Expect test suite is known to experience failures under
  84. certain host conditions that are not within our control. Therefore,
  85. test suite failures here are not surprising and are not considered
  86. critical.</para-->
  87. <para>注意,已经知道在特定宿主环境下 Expect 测试套件会失败。
  88. 我们无法控制宿主环境,因此这里的测试失败并不令人吃惊,
  89. 也不会造成严重问题。</para>
  90. <para>安装该软件包:</para>
  91. <screen><userinput remap="install">make SCRIPTS="" install</userinput></screen>
  92. <variablelist>
  93. <title>make 命令参数的含义:</title>
  94. <varlistentry>
  95. <term><parameter>SCRIPTS=""</parameter></term>
  96. <listitem>
  97. <!--para>This prevents installation of the supplementary Expect
  98. scripts, which are not needed.</para-->
  99. <para>该选项使得一些不需要的 Expect 辅助脚本不被安装。</para>
  100. </listitem>
  101. </varlistentry>
  102. </variablelist>
  103. </sect2>
  104. <sect2 id="contents-expect" role="content">
  105. <title>Expect 的内容</title>
  106. <segmentedlist>
  107. <segtitle>安装的程序</segtitle>
  108. <segtitle>安装的库</segtitle>
  109. <seglistitem>
  110. <seg>expect</seg>
  111. <seg>libexpect-&expect-lib-version;.so</seg>
  112. </seglistitem>
  113. </segmentedlist>
  114. <variablelist>
  115. <bridgehead renderas="sect3">简要描述</bridgehead>
  116. <?dbfo list-presentation="list"?>
  117. <?dbhtml list-presentation="table"?>
  118. <varlistentry id="expect">
  119. <term><command>expect</command></term>
  120. <listitem>
  121. <para>根据一个脚本与其他交互程序交流</para>
  122. <indexterm zone="ch-tools-expect expect">
  123. <primary sortas="b-expect">expect</primary>
  124. </indexterm>
  125. </listitem>
  126. </varlistentry>
  127. <varlistentry id="libexpect">
  128. <term><filename class="libraryfile">libexpect-&expect-lib-version;.so</filename></term>
  129. <listitem>
  130. <para>包含一些函数,使得 Expect 可以作为 Tcl 扩展使用,
  131. 也可以直接在 C 或 C++ 中使用(不使用 Tcl)</para>
  132. <indexterm zone="ch-tools-expect libexpect">
  133. <primary sortas="c-libexpect-&expect-lib-version;">libexpect-&expect-lib-version;</primary>
  134. </indexterm>
  135. </listitem>
  136. </varlistentry>
  137. </variablelist>
  138. </sect2>
  139. </sect1>