Update to Module-Init-Tools-3.12
[linux_from_scratch.git] / chapter05 / expect.xml
blob5e54450fc101c99331399fe00b8907238f70c132
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 ]>
8 <sect1 id="ch-tools-expect" role="wrap">
9   <?dbhtml filename="expect.html"?>
11   <sect1info condition="script">
12     <productname>expect</productname>
13     <productnumber>&expect-version;</productnumber>
14     <address>&expect-url;</address>
15   </sect1info>
17   <title>Expect-&expect-version;</title>
19   <indexterm zone="ch-tools-expect">
20     <primary sortas="a-Expect">Expect</primary>
21   </indexterm>
23   <sect2 role="package">
24     <title/>
26     <para>The Expect package contains a program for carrying out scripted
27     dialogues with other interactive programs.</para>
29     <segmentedlist>
30       <segtitle>&buildtime;</segtitle>
31       <segtitle>&diskspace;</segtitle>
33       <seglistitem>
34         <seg>&expect-ch5-sbu;</seg>
35         <seg>&expect-ch5-du;</seg>
36       </seglistitem>
37     </segmentedlist>
39   </sect2>
41   <sect2 role="installation">
42     <title>Installation of Expect</title>
44     <para>First, fix a bug that can result in false failures during the GCC test
45     suite run:</para>
47 <screen><userinput remap="pre">patch -Np1 -i ../&expect-spawn-patch;</userinput></screen>
49     <para>Next, fix a bug that is a result of recent Tcl changes:</para>
51 <screen><userinput remap="pre">patch -Np1 -i ../&expect-tcl-patch;</userinput></screen>
53     <para>Next, force Expect's configure script to use <filename>/bin/stty</filename>
54     instead of a <filename>/usr/local/bin/stty</filename> it may find on the host system.
55     This will ensure that our testsuite tools remain sane for the final builds of our
56     toolchain:</para>
58 <screen><userinput remap="pre">cp -v configure{,.orig}
59 sed 's:/usr/local/bin:/bin:' configure.orig &gt; configure</userinput></screen>
61     <para>Now prepare Expect for compilation:</para>
63 <screen><userinput remap="configure">./configure --prefix=/tools --with-tcl=/tools/lib \
64   --with-tclinclude=/tools/include --with-x=no</userinput></screen>
66     <variablelist>
67       <title>The meaning of the configure options:</title>
69       <varlistentry>
70         <term><parameter>--with-tcl=/tools/lib</parameter></term>
71         <listitem>
72           <para>This ensures that the configure script finds the Tcl
73           installation in the temporary tools location instead of possibly
74           locating an existing one on the host system.</para>
75         </listitem>
76       </varlistentry>
78       <varlistentry>
79         <term><parameter>--with-tclinclude=/tools/include</parameter></term>
80         <listitem>
81           <para>This explicitly tells Expect where to find Tcl's internal
82           headers. Using this option avoids conditions where
83           <command>configure</command> fails because it cannot automatically
84           discover the location of Tcl's headers.</para>
85         </listitem>
86       </varlistentry>
88       <varlistentry>
89         <term><parameter>--with-x=no</parameter></term>
90         <listitem>
91           <para>This tells the configure script not to search for Tk (the
92           Tcl GUI component) or the X Window System libraries, both of which
93           may reside on the host system but will not exist in the temporary
94           environment.</para>
95         </listitem>
96       </varlistentry>
98     </variablelist>
100     <para>Build the package:</para>
102 <screen><userinput remap="make">make</userinput></screen>
104     <para>Compilation is now complete. As discussed earlier, running the test
105     suite is not mandatory for the temporary tools here in this chapter. To run
106     the Expect test suite anyway, issue the following command:</para>
108 <screen><userinput remap="test">make test</userinput></screen>
110     <para>Note that the Expect test suite is known to experience failures under
111     certain host conditions that are not within our control. Therefore,
112     test suite failures here are not surprising and are not considered
113     critical.</para>
115     <para>Install the package:</para>
117 <screen><userinput remap="install">make SCRIPTS="" install</userinput></screen>
119     <variablelist>
120       <title>The meaning of the make parameter:</title>
122       <varlistentry>
123         <term><parameter>SCRIPTS=""</parameter></term>
124         <listitem>
125           <para>This prevents installation of the supplementary Expect
126           scripts, which are not needed.</para>
127         </listitem>
128       </varlistentry>
130     </variablelist>
132   </sect2>
134   <sect2 id="contents-expect" role="content">
135     <title>Contents of Expect</title>
137     <segmentedlist>
138       <segtitle>Installed program</segtitle>
139       <segtitle>Installed library</segtitle>
141       <seglistitem>
142         <seg>expect</seg>
143         <seg>libexpect-&expect-lib-version;.a</seg>
144       </seglistitem>
145     </segmentedlist>
147     <variablelist>
148       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
149       <?dbfo list-presentation="list"?>
150       <?dbhtml list-presentation="table"?>
152       <varlistentry id="expect">
153         <term><command>expect</command></term>
154         <listitem>
155           <para>Communicates with other interactive programs according
156           to a script</para>
157           <indexterm zone="ch-tools-expect expect">
158             <primary sortas="b-expect">expect</primary>
159           </indexterm>
160         </listitem>
161       </varlistentry>
163       <varlistentry id="libexpect">
164         <term><filename class="libraryfile">libexpect-&expect-lib-version;.a</filename></term>
165         <listitem>
166           <para>Contains functions that allow Expect to be used as a Tcl
167           extension or to be used directly from C or C++ (without Tcl)</para>
168           <indexterm zone="ch-tools-expect libexpect">
169             <primary sortas="c-libexpect-&expect-lib-version;">libexpect-&expect-lib-version;</primary>
170           </indexterm>
171         </listitem>
172       </varlistentry>
174     </variablelist>
176   </sect2>
178 </sect1>