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).
65 "make install" will install Expect. If you built Expectk, that will
66 be installed as well. So will the documentation and some of the most
69 If you want shared libs on Linux, you must now su to root and run
70 ldconfig on the shared library. See the ldconfig man page for more
73 A handful of people running "pure" 4.2BSD systems have noted that
74 expect fails to link due to lack of getopt and vprintf. You can get
75 these from uunet or any good archive site.
78 Sophisticated Installations
81 The following instructions provide some suggestions for handling
82 complex installations.
88 The configure script allows you to customize the Expect configuration
89 for your site; for details on how you can do this, type "./configure
90 -help" or refer to the autoconf documentation (not included here).
91 Expect's configure supports the following flags in addition to the
94 --verbose Cause configure to describe
95 what it is checking and what it decides.
97 --enable-shared Compile Expect as a shared library if it
98 can figure out how to do that on this
99 platform. (You must have already
100 compiled Tcl with this flag.)
102 --disable-load This switch is ignored so that you can
103 configure Expect with the same configure
104 command as Tcl. If you want to disable
105 dynamic loading, configure Tcl with this
106 flag and then reconfigure Expect.
108 --enable-gcc This switch is ignored so that you can
109 configure Expect with the same configure
110 command as Tcl. If you want to enable gcc,
111 configure Tcl with it and then reconfigure
112 Expect. Expect will inherit the definition
113 that way. It is not safe to modify the
114 Makefile to use gcc by hand. If you do
115 this, then information related to dynamic
116 linking will be incorrect.
118 --with-tclconfig=... Specifies the directory containing Tcl's
119 configure file (tclConfig.sh).
121 --with-tclinclude=... Specifies the directory containing Tcl's
122 private include files (such as tclInt.h)
124 --with-tkconfig=... Specifies the directory containing Tk's
125 configure file (tkConfig.sh).
127 --with-tkinclude=... Specifies the directory containing Tk's
128 private include files (such as tkInt.h)
130 Some of the defaults in "configure" can be overridden by environment
131 variables. This is a convenience intended for environments that are
132 likely to affect any program that you configure and install.
134 The following environment variables are supported. If you use these,
135 consider adding them to your .login file so that other installation
136 scripts can make use of them.
139 CFLAGS Flags to C compiler
140 CPPFLAGS Flags to C preprocessor
141 LDFLAGS Flags to linker
143 CONFIG_SHELL Shell for configure and Make
145 Settings can also be given on the command line. For example, you
146 could tell configure about flags from a Bourne-compatible shell as
149 CFLAGS=-O2 LIBS=-lposix ./configure
151 Although configure will do some searching for Tcl (and all of this
152 discussion holds true for Tk as well), configure likes to find the Tcl
153 source directory in the parent directory of Expect and will use that
154 Tcl if it exists. To make sure Tcl can be found this way (if it is
155 located somewhere else), create a symbolic link in Expect's parent
156 directory to where the Tcl directory is.
158 By default, configure uses the latest Tcl it can find. You can
159 override this by creating a symbolic link of "tcl" which points to the
162 If you can't or don't want to create symbolic links, you can instead
163 indicate where Tcl and Tk are by using the following environment variables:
165 with_tclconfig Directory containing Tcl configure file (tclConfig.h)
166 with_tclinclude Directory containing Tcl include files
167 with_tkinclude Directory containing Tk include files
168 with_tkconfig Directory containing Tk binary library (tkConfig.h)
171 Multiple-Architecture Installation
174 You might want to compile a software package in a different directory
175 from the one that contains the source code. Doing this allows you to
176 compile the package for several architectures simultaneously from the
177 same copy of the source code and keep multiple sets of object files on
180 To compile the package in a different directory from the one
181 containing the source code, you must use a version of make that
182 supports the VPATH variable. GNU make and most other recent make
183 programs can do this.
185 cd to the directory where you want the object files and executables to
186 go and run configure. configure automatically checks for the source
187 code in the directory that configure is in and in .. If configure
188 reports that it cannot find the source code, run configure with the
189 option --srcdir=dir, where dir is the directory that contains the
192 You can save some disk space by installing architecture-independent
193 files (e.g., scripts, include files) in a different place than
194 architecture-dependent files (e.g., binaries, libraries). To do this,
195 edit the Makefile after configure builds it, or have configure create
196 the Makefile with the right definitions in the first place. To have
197 configure do it, use the following options to configure:
202 where dep is the root of the tree in which to store
203 architecture-dependent files and indep is the root in which to
204 store -dependent files. For example, you might invoke configure this
207 configure --prefix=/usr/local/bin --exec-prefix=/usr/local/bin/arch
213 Patterned after the Tcl test suite, I have begun building a test suite
214 in the subdirectory "test". It is still incomplete however you may
215 use by typing "make test" in this directory. You should then see a
216 printout of the test files processed. If any errors occur, you'll see
217 a much more substantial printout for each error. See the README file
218 in the "tests" directory for more information on the test suite.
220 Note that the test suite assumes the existence of certain programs to
221 use as interactive programs. If you are missing these or they behave
222 differently, errors may be reported. Similarly, the test suite
223 assumes certain other things about your system, such as the sane stty
226 You may also try some of the programs distribute in the example
227 directory (see the README file in the example directory). They are a
228 strong indication of whether Expect works or not. If you have any
229 problems with them, let me know.
235 "make uninstall" removes all the files that "make install" creates
236 (excluding those in the current directory).
242 Several "clean" targets are available to reduce space consumption of
243 the Expect source. The two most useful are as follows:
245 "make clean" deletes all files from the current directory that were
248 "make distclean" is like "make clean", but it also deletes files
249 created by "configure"
251 Other targets can be found in the Makefile. They follow the GNU
252 Makefile conventions.