[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[b06ca36] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[673b0d8] | 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
[09fb7a09] | 7 |
|
---|
[81fd230] | 8 | <sect1 id="ch-tools-expect" role="wrap">
|
---|
[09fb7a09] | 9 | <?dbhtml filename="expect.html"?>
|
---|
| 10 |
|
---|
[e747759] | 11 | <sect1info condition="script">
|
---|
| 12 | <productname>expect</productname>
|
---|
| 13 | <productnumber>&expect-version;</productnumber>
|
---|
| 14 | <address>&expect-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
[09fb7a09] | 17 | <title>Expect-&expect-version;</title>
|
---|
| 18 |
|
---|
| 19 | <indexterm zone="ch-tools-expect">
|
---|
| 20 | <primary sortas="a-Expect">Expect</primary>
|
---|
| 21 | </indexterm>
|
---|
| 22 |
|
---|
| 23 | <sect2 role="package">
|
---|
| 24 | <title/>
|
---|
[673b0d8] | 25 |
|
---|
[630308d] | 26 | <para>The <application>Expect</application> package contains tools for
|
---|
| 27 | automating, via scripted dialogues, interactive applications such as
|
---|
| 28 | <command>telnet</command>, <command>ftp</command>,
|
---|
| 29 | <command>passwd</command>, <command>fsck</command>,
|
---|
| 30 | <command>rlogin</command>, and <command>tip</command>.
|
---|
| 31 | <application>Expect</application> is also useful for testing these same
|
---|
| 32 | applications as well as easing all sorts of tasks that are prohibitively
|
---|
| 33 | difficult with anything else. The <application>DejaGnu</application>
|
---|
| 34 | framework is written in <application>Expect</application>.</para>
|
---|
[bc82645e] | 35 |
|
---|
[09fb7a09] | 36 | <segmentedlist>
|
---|
| 37 | <segtitle>&buildtime;</segtitle>
|
---|
| 38 | <segtitle>&diskspace;</segtitle>
|
---|
[5888299] | 39 |
|
---|
[09fb7a09] | 40 | <seglistitem>
|
---|
[e4a5635] | 41 | <seg>&expect-ch5-sbu;</seg>
|
---|
| 42 | <seg>&expect-ch5-du;</seg>
|
---|
[09fb7a09] | 43 | </seglistitem>
|
---|
| 44 | </segmentedlist>
|
---|
[73aedd1d] | 45 |
|
---|
[09fb7a09] | 46 | </sect2>
|
---|
| 47 |
|
---|
| 48 | <sect2 role="installation">
|
---|
| 49 | <title>Installation of Expect</title>
|
---|
| 50 |
|
---|
[bd488ac] | 51 | <para>First, force Expect's configure script to use <filename>/bin/stty</filename>
|
---|
[9d4c6dc] | 52 | instead of a <filename>/usr/local/bin/stty</filename> it may find on the host system.
|
---|
[0ebe029b] | 53 | This will ensure that our test suite tools remain sane for the final builds of our
|
---|
[f19e766] | 54 | toolchain:</para>
|
---|
[9d4c6dc] | 55 |
|
---|
[a877994] | 56 | <screen><userinput remap="pre">cp -v configure{,.orig}
|
---|
| 57 | sed 's:/usr/local/bin:/bin:' configure.orig > configure</userinput></screen>
|
---|
[9d4c6dc] | 58 |
|
---|
[09fb7a09] | 59 | <para>Now prepare Expect for compilation:</para>
|
---|
[73aedd1d] | 60 |
|
---|
[3dc9543] | 61 | <screen><userinput remap="configure">./configure --prefix=/tools \
|
---|
| 62 | --with-tcl=/tools/lib \
|
---|
| 63 | --with-tclinclude=/tools/include</userinput></screen>
|
---|
[09fb7a09] | 64 |
|
---|
| 65 | <variablelist>
|
---|
| 66 | <title>The meaning of the configure options:</title>
|
---|
| 67 |
|
---|
| 68 | <varlistentry>
|
---|
| 69 | <term><parameter>--with-tcl=/tools/lib</parameter></term>
|
---|
| 70 | <listitem>
|
---|
| 71 | <para>This ensures that the configure script finds the Tcl
|
---|
| 72 | installation in the temporary tools location instead of possibly
|
---|
| 73 | locating an existing one on the host system.</para>
|
---|
| 74 | </listitem>
|
---|
| 75 | </varlistentry>
|
---|
| 76 |
|
---|
| 77 | <varlistentry>
|
---|
| 78 | <term><parameter>--with-tclinclude=/tools/include</parameter></term>
|
---|
| 79 | <listitem>
|
---|
| 80 | <para>This explicitly tells Expect where to find Tcl's internal
|
---|
| 81 | headers. Using this option avoids conditions where
|
---|
| 82 | <command>configure</command> fails because it cannot automatically
|
---|
| 83 | discover the location of Tcl's headers.</para>
|
---|
| 84 | </listitem>
|
---|
| 85 | </varlistentry>
|
---|
| 86 |
|
---|
| 87 | </variablelist>
|
---|
| 88 |
|
---|
| 89 | <para>Build the package:</para>
|
---|
[73aedd1d] | 90 |
|
---|
[0445a3d] | 91 | <screen><userinput remap="make">make</userinput></screen>
|
---|
[73aedd1d] | 92 |
|
---|
[1fa0f19] | 93 | <para>Compilation is now complete. As discussed earlier, running the test
|
---|
| 94 | suite is not mandatory for the temporary tools here in this chapter. To run
|
---|
| 95 | the Expect test suite anyway, issue the following command:</para>
|
---|
[0445a3d] | 96 |
|
---|
| 97 | <screen><userinput remap="test">make test</userinput></screen>
|
---|
| 98 |
|
---|
| 99 | <para>Note that the Expect test suite is known to experience failures under
|
---|
[09fb7a09] | 100 | certain host conditions that are not within our control. Therefore,
|
---|
| 101 | test suite failures here are not surprising and are not considered
|
---|
| 102 | critical.</para>
|
---|
[73aedd1d] | 103 |
|
---|
[09fb7a09] | 104 | <para>Install the package:</para>
|
---|
[73aedd1d] | 105 |
|
---|
[0445a3d] | 106 | <screen><userinput remap="install">make SCRIPTS="" install</userinput></screen>
|
---|
[73aedd1d] | 107 |
|
---|
[09fb7a09] | 108 | <variablelist>
|
---|
| 109 | <title>The meaning of the make parameter:</title>
|
---|
| 110 |
|
---|
| 111 | <varlistentry>
|
---|
| 112 | <term><parameter>SCRIPTS=""</parameter></term>
|
---|
| 113 | <listitem>
|
---|
| 114 | <para>This prevents installation of the supplementary Expect
|
---|
| 115 | scripts, which are not needed.</para>
|
---|
| 116 | </listitem>
|
---|
| 117 | </varlistentry>
|
---|
| 118 |
|
---|
| 119 | </variablelist>
|
---|
| 120 |
|
---|
| 121 | </sect2>
|
---|
| 122 |
|
---|
| 123 | <sect2 id="contents-expect" role="content">
|
---|
| 124 | <title>Contents of Expect</title>
|
---|
| 125 |
|
---|
| 126 | <segmentedlist>
|
---|
| 127 | <segtitle>Installed program</segtitle>
|
---|
| 128 | <segtitle>Installed library</segtitle>
|
---|
| 129 |
|
---|
| 130 | <seglistitem>
|
---|
| 131 | <seg>expect</seg>
|
---|
[813c938] | 132 | <seg>libexpect-&expect-lib-version;.so</seg>
|
---|
[09fb7a09] | 133 | </seglistitem>
|
---|
| 134 | </segmentedlist>
|
---|
| 135 |
|
---|
| 136 | <variablelist>
|
---|
| 137 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 138 | <?dbfo list-presentation="list"?>
|
---|
| 139 | <?dbhtml list-presentation="table"?>
|
---|
| 140 |
|
---|
| 141 | <varlistentry id="expect">
|
---|
| 142 | <term><command>expect</command></term>
|
---|
| 143 | <listitem>
|
---|
| 144 | <para>Communicates with other interactive programs according
|
---|
| 145 | to a script</para>
|
---|
| 146 | <indexterm zone="ch-tools-expect expect">
|
---|
| 147 | <primary sortas="b-expect">expect</primary>
|
---|
| 148 | </indexterm>
|
---|
| 149 | </listitem>
|
---|
| 150 | </varlistentry>
|
---|
| 151 |
|
---|
| 152 | <varlistentry id="libexpect">
|
---|
[813c938] | 153 | <term><filename class="libraryfile">libexpect-&expect-lib-version;.so</filename></term>
|
---|
[09fb7a09] | 154 | <listitem>
|
---|
| 155 | <para>Contains functions that allow Expect to be used as a Tcl
|
---|
| 156 | extension or to be used directly from C or C++ (without Tcl)</para>
|
---|
| 157 | <indexterm zone="ch-tools-expect libexpect">
|
---|
| 158 | <primary sortas="c-libexpect-&expect-lib-version;">libexpect-&expect-lib-version;</primary>
|
---|
| 159 | </indexterm>
|
---|
| 160 | </listitem>
|
---|
| 161 | </varlistentry>
|
---|
| 162 |
|
---|
| 163 | </variablelist>
|
---|
| 164 |
|
---|
| 165 | </sect2>
|
---|
[673b0d8] | 166 |
|
---|
| 167 | </sect1>
|
---|