1 This file is INSTALL. It contains installation instructions for Expect.
3 If you do not have Tcl, get it (Expect's README explains how) and
4 install it. The rest of these instructions assume that you have Tcl
7 If you are installing Expect on a single architecture, or are just
8 trying it out to see whether it is worth installing, follow the
9 "Simple Installation" below. If you are installing Expect on multiple
10 architectures or the "Simple Installation" instructions are not
11 sufficient, see "Sophisticated Installations" below.
17 On a Cray, you must be root to compile Expect. See the FAQ for why
20 If you want shared libs on Linux, you must be root in order to run
21 ldconfig. See the ldconfig man page for more info.
27 By default, the Tcl source directory is assumed to be in the same
28 directory as the Expect source directory. For example, in this
29 listing, Expect and Tcl are both stored in /usr/local/src:
31 /usr/local/src/tcl8.0 (actual version may be different)
32 /usr/local/src/expect-5.24 (actual version may be different)
34 If Tcl is stored elsewhere, the easiest way to deal with this is to
35 create a symbolic link to its real directory. For example, from the
36 Expect directory, type:
38 ln -s /some/where/else/src/tcl8.0 ..
40 The same applies for Tk, if you have it. (Tk is optional.)
42 Run "./configure". This will generate a Makefile (from a prototype
43 called "Makefile.in") appropriate to your system. (This step must be
44 done in the foreground because configure performs various tests on
45 your controlling tty. If you want to do this step in the background
46 in the future, automate it using Expect!)
48 Most people will not need to make any changes to the generated
49 Makefile and can go on to the next step. If you want though, you can
50 edit the Makefile and change any definitions as appropriate for your
51 site. All the definitions you are likely to want to change are
52 clearly identified and described at the beginning of the file.
54 To build only the stand-alone Expect program, run "make expect". This
55 is appropriate even if you still haven't decided whether to install
56 Expect, are still curious about it, and want to do the minimum
57 possible in order to experiment with it.
59 To build everything, run "make". If "configure" found Tk and X on
60 your system, this will build "expectk" (Expect with Tk).
62 Once expect is built, you can cd to the example directory and try out
63 some of the examples (see the README file in the example directory).
64 Note that if Tcl has not yet been installed, this won't work. In this
65 case, see the instructions "Trying Expect Without Installing Tcl"
68 "make install" will install Expect. If you built Expectk, that will
69 be installed as well. So will the documentation and some of the most
72 If you want shared libs on Linux, you must now su to root and run
73 ldconfig on the shared library. See the ldconfig man page for more
76 A handful of people running "pure" 4.2BSD systems have noted that
77 expect fails to link due to lack of getopt and vprintf. You can get
78 these from uunet or any good archive site.
81 Trying Expect Without Installing Tcl
84 Once expect is built, you can try it out. If Tcl has not been
85 installed (but it has been compiled), you will need to define the
86 environment variable TCL_LIBRARY. It should name the directory
87 contain the Tcl libraries. For example, if you are using csh with Tcl
90 $ setenv TCL_LIBRARY ../tcl8.0.3/library
92 Now you can run expect.
94 The same advice applies to Tk. If it is available but has not been
95 installed, you can try out expectk but only after defining TK_LIBRARY.
96 For example, if you are using csh with Tk 8.0.3:
98 $ setenv TK_LIBRARY ../tk8.0.3/library
100 Now you can run expectk.
103 Sophisticated Installations
106 The following instructions provide some suggestions for handling
107 complex installations.
113 The configure script allows you to customize the Expect configuration
114 for your site; for details on how you can do this, type "./configure
115 -help" or refer to the autoconf documentation (not included here).
116 Expect's configure supports the following flags in addition to the
119 --verbose Cause configure to describe
120 what it is checking and what it decides.
122 --enable-shared Compile Expect as a shared library if it
123 can figure out how to do that on this
124 platform. (You must have already
125 compiled Tcl with this flag.)
127 --disable-load This switch is ignored so that you can
128 configure Expect with the same configure
129 command as Tcl. If you want to disable
130 dynamic loading, configure Tcl with this
131 flag and then reconfigure Expect.
133 --enable-gcc This switch is ignored so that you can
134 configure Expect with the same configure
135 command as Tcl. If you want to enable gcc,
136 configure Tcl with it and then reconfigure
137 Expect. Expect will inherit the definition
138 that way. It is not safe to modify the
139 Makefile to use gcc by hand. If you do
140 this, then information related to dynamic
141 linking will be incorrect.
143 --enable-threads This switch is ignored so that you can
144 configure Expect with the same configure
147 --with-tcl=... Specifies the directory containing Tcl's
148 configure file (tclConfig.sh).
150 --with-tclinclude=... Specifies the directory containing Tcl's
151 private include files (such as tclInt.h)
153 --with-tk=... Specifies the directory containing Tk's
154 configure file (tkConfig.sh).
156 --with-tkinclude=... Specifies the directory containing Tk's
157 private include files (such as tkInt.h)
159 Some of the defaults in "configure" can be overridden by environment
160 variables. This is a convenience intended for environments that are
161 likely to affect any program that you configure and install.
163 The following environment variables are supported. If you use these,
164 consider adding them to your .login file so that other installation
165 scripts can make use of them.
168 CFLAGS Flags to C compiler
169 CPPFLAGS Flags to C preprocessor
170 LDFLAGS Flags to linker
172 CONFIG_SHELL Shell for configure and Make
174 Settings can also be given on the command line. For example, you
175 could tell configure about flags from a Bourne-compatible shell as
178 CFLAGS=-O2 LIBS=-lposix ./configure
180 Although configure will do some searching for Tcl (and all of this
181 discussion holds true for Tk as well), configure likes to find the Tcl
182 source directory in the parent directory of Expect and will use that
183 Tcl if it exists. To make sure Tcl can be found this way (if it is
184 located somewhere else), create a symbolic link in Expect's parent
185 directory to where the Tcl directory is.
187 By default, configure uses the latest Tcl it can find. You can
188 override this by creating a symbolic link of "tcl" which points to the
191 If you can't or don't want to create symbolic links, you can instead
192 indicate where Tcl and Tk are by using the following environment variables:
194 with_tcl Directory containing Tcl configure file (tclConfig.h)
195 with_tclinclude Directory containing Tcl include files
196 with_tkinclude Directory containing Tk include files
197 with_tk Directory containing Tk binary library (tkConfig.h)
200 Multiple-Architecture Installation
203 You might want to compile a software package in a different directory
204 from the one that contains the source code. Doing this allows you to
205 compile the package for several architectures simultaneously from the
206 same copy of the source code and keep multiple sets of object files on
209 To compile the package in a different directory from the one
210 containing the source code, you must use a version of make that
211 supports the VPATH variable. GNU make and most other recent make
212 programs can do this.
214 cd to the directory where you want the object files and executables to
215 go and run configure. configure automatically checks for the source
216 code in the directory that configure is in and in .. If configure
217 reports that it cannot find the source code, run configure with the
218 option --srcdir=dir, where dir is the directory that contains the
221 You can save some disk space by installing architecture-independent
222 files (e.g., scripts, include files) in a different place than
223 architecture-dependent files (e.g., binaries, libraries). To do this,
224 edit the Makefile after configure builds it, or have configure create
225 the Makefile with the right definitions in the first place. To have
226 configure do it, use the following options to configure:
231 where dep is the root of the tree in which to store
232 architecture-dependent files and indep is the root in which to
233 store -dependent files. For example, you might invoke configure this
236 configure --prefix=/usr/local/bin --exec-prefix=/usr/local/bin/arch
242 Patterned after the Tcl test suite, I have begun building a test suite
243 in the subdirectory "test". It is still incomplete however you may
244 use by typing "make test" in this directory. You should then see a
245 printout of the test files processed. If any errors occur, you'll see
246 a much more substantial printout for each error. See the README file
247 in the "tests" directory for more information on the test suite.
249 Note that the test suite assumes the existence of certain programs to
250 use as interactive programs. If you are missing these or they behave
251 differently, errors may be reported. Similarly, the test suite
252 assumes certain other things about your system, such as the sane stty
255 You may also try some of the programs distribute in the example
256 directory (see the README file in the example directory). They are a
257 strong indication of whether Expect works or not. If you have any
258 problems with them, let me know.
264 "make uninstall" removes all the files that "make install" creates
265 (excluding those in the current directory).
271 Several "clean" targets are available to reduce space consumption of
272 the Expect source. The two most useful are as follows:
274 "make clean" deletes all files from the current directory that were
277 "make distclean" is like "make clean", but it also deletes files
278 created by "configure"
280 Other targets can be found in the Makefile. They follow the GNU
281 Makefile conventions.