fixed Makefile
[platform/upstream/expect.git] / INSTALL
1 This file is INSTALL.  It contains installation instructions for Expect.
2
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
5 installed.
6
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.
12
13 --------------------
14 Permissions
15 --------------------
16
17 On a Cray, you must be root to compile Expect.  See the FAQ for why
18 this is.
19
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.
22
23 --------------------
24 Simple Installation
25 --------------------
26
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:
30
31         /usr/local/src/tcl8.0           (actual version may be different)
32         /usr/local/src/expect-5.24      (actual version may be different)
33
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:
37
38         ln -s /some/where/else/src/tcl8.0 ..
39
40 The same applies for Tk, if you have it.  (Tk is optional.)
41
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!)
47
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.
53
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.
58
59 To build everything, run "make".  If "configure" found Tk and X on
60 your system, this will build "expectk" (Expect with Tk).
61
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"
66 below.
67
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
70 useful examples.
71
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
74 info.
75
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.
79
80 --------------------
81 Trying Expect Without Installing Tcl
82 --------------------
83
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
88 8.0.3:
89
90         $ setenv TCL_LIBRARY ../tcl8.0.3/library
91
92 Now you can run expect.
93
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:
97
98         $ setenv TK_LIBRARY ../tk8.0.3/library
99
100 Now you can run expectk.
101
102 --------------------
103 Sophisticated Installations
104 --------------------
105
106 The following instructions provide some suggestions for handling
107 complex installations.
108
109 --------------------
110 Changing Defaults
111 --------------------
112
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
117 standard ones:
118
119         --verbose               Cause configure to describe
120                                 what it is checking and what it decides.
121
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.)
126
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.
132
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.
142
143         --enable-threads        This switch is ignored so that you can
144                                 configure Expect with the same configure
145                                 command as Tcl.
146
147         --with-tcl=...          Specifies the directory containing Tcl's
148                                 configure file (tclConfig.sh).
149
150         --with-tclinclude=...   Specifies the directory containing Tcl's
151                                 private include files (such as tclInt.h)
152
153         --with-tk=...           Specifies the directory containing Tk's
154                                 configure file (tkConfig.sh).
155
156         --with-tkinclude=...    Specifies the directory containing Tk's
157                                 private include files (such as tkInt.h)
158
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.
162
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.
166
167 CC              C compiler
168 CFLAGS          Flags to C compiler
169 CPPFLAGS        Flags to C preprocessor
170 LDFLAGS         Flags to linker
171 LIBS            Libraries
172 CONFIG_SHELL    Shell for configure and Make
173
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
176 follows:
177
178      CFLAGS=-O2 LIBS=-lposix ./configure
179
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.
186
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
189 release you want.
190
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:
193  
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)
198
199 --------------------
200 Multiple-Architecture Installation
201 --------------------
202
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
207 disk.
208
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.
213
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
219 source code.
220
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:
227
228         --prefix=indep
229         --exec-prefix=dep
230
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
234 way:
235
236         configure --prefix=/usr/local/bin --exec-prefix=/usr/local/bin/arch
237
238 --------------------
239 Test Suite
240 --------------------
241
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.
248
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
253 parameters.
254
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.
259
260 --------------------
261 Uninstalling
262 --------------------
263
264 "make uninstall" removes all the files that "make install" creates
265 (excluding those in the current directory).
266
267 --------------------
268 Cleaning Up
269 --------------------
270
271 Several "clean" targets are available to reduce space consumption of
272 the Expect source.  The two most useful are as follows:
273
274 "make clean" deletes all files from the current directory that were
275 created by "make"
276
277 "make distclean" is like "make clean", but it also deletes files
278 created by "configure"
279
280 Other targets can be found in the Makefile.  They follow the GNU
281 Makefile conventions.
282