Point to HACKING for tool versions.
[bpt/guile.git] / INSTALL
1 Guile Installation Guide
2 Copyright (c) 1996, 1997, 1998, 1999, 2000 Free software Foundation, Inc.
3
4 Permission is granted to anyone to make or distribute verbatim copies
5 of this document as received, in any medium, provided that the
6 copyright notice and permission notice are preserved,
7 and that the distributor grants the recipient permission
8 for further redistribution as permitted by this notice.
9
10 Permission is granted to distribute modified versions
11 of this document, or of portions of it,
12 under the above conditions, provided also that they
13 carry prominent notices stating who last changed them,
14 and that any new or changed statements about the activities
15 of the Free Software Foundation are approved by the Foundation.
16
17
18 Brief Installation Instructions ===========================================
19
20 To build Guile on unix, there are two basic steps:
21
22 1. Type "./configure", to configure the package for your system.
23 2. Type "make", to build the package.
24
25 Generic instructions for configuring and compiling GNU distributions
26 are included below. (For instructions how to install SLIB, the scheme
27 procedure library, see below.)
28
29
30 Guile can use a number of external packages such as `readline' when
31 they are available. Guile expects to be able to find these packages
32 in the default compiler setup, it does not try to make any special
33 arrangements itself. For example, for the `readline' package, Guile
34 expects to be able to find the include file <readline/readline.h>,
35 without passing any special `-I' options to the compiler.
36
37 If you installed an external package, and you used the --prefix
38 installation option to install it somewhere else than /usr/local, you
39 must arrange for your compiler to find it by default. If that
40 compiler is gcc, one convenient way of making such arrangements is to
41 use the --with-local-prefix option during installation, naming the
42 same directory as you used in the --prefix option of the package. In
43 particular, it is not good enough to use the same --prefix option when
44 you install gcc and the package; you need to use the
45 --with-local-prefix option as well. See the gcc documentation for
46 more details.
47
48
49 Special Instructions For Some Systems =====================================
50
51 We would like Guile to build on all systems using the simple
52 instructions above, but it seems that a few systems still need special
53 treatment. If you can send us fixes for these problems, we'd be
54 grateful.
55
56 SunOS 4.1: Guile's shared library support seems to be confused, but
57 hey; shared libraries are confusing. You may need to configure
58 Guile with a command like:
59 ./configure --disable-shared
60 For more information on `--disable-shared', see below, "Flags
61 Accepted by Configure".
62
63 HP/UX: GCC 2.7.2 (and maybe other versions) have trouble creating
64 shared libraries if they depend on any non-shared libraries. GCC
65 seems to have other problems as well. To work around this, we
66 suggest you configure Guile to use the system's C compiler:
67 CC=cc ./configure
68
69 NetBSD: Perry Metzger says, "Guile will build under NetBSD only using
70 gmake -- the native make will not work. (gmake is in our package
71 system, so this will not be a problem when we packagize 1.3.)"
72
73
74 Flags Accepted by Configure ===============================================
75
76 If you run the configure script with no arguments, it should examine
77 your system and set things up appropriately. However, there are a few
78 switches specific to Guile you may find useful in some circumstances.
79
80
81 --enable-maintainer-mode
82
83 If you have automake, autoconf, and libtool installed on your
84 system, this switch causes configure to generate Makefiles which
85 know how to automatically regenerate configure scripts, makefiles,
86 and headers, when they are out of date. The HACKING file says which
87 versions of those tools you will need.
88
89
90 --with-threads --- Build with thread support
91
92 Build a Guile executable and library that supports cooperative
93 threading. If you use this switch, Guile will also build and
94 install the QuickThreads non-preemptive threading library,
95 libqthreads, which you will need to link into your programs after
96 libguile. When you use `guile-config', you will pick up all
97 neccessary linker flags automatically.
98
99 Cooperative threads are not yet thoroughly tested; once they are,
100 they will be enabled by default. The interaction with blocking I/O
101 is pretty ad hoc at the moment. In our experience, bugs in the
102 thread support do not affect you if you don't actually use threads.
103
104
105 --with-modules --- Specify statically linked `modules'
106
107 Guile can dynamically load `plugin modules' during runtime, using
108 facilities provided by libtool. Not all platforms support this,
109 however. On these platforms, you can statically link the plugin
110 modules into libguile when Guile itself is build. XXX - how does
111 one specify the modules?
112
113
114 --enable-deprecated=LEVEL --- Control the inclusion of deprecated features.
115
116 You can select between different behaviours via the LEVEL argument:
117 a value of "no" will omit all deprecated features and you will get
118 "undefined reference", "variable unbound" or similar errors when you
119 try to use them. All other values will include all deprecated
120 features. The LEVEL argument is used to determine the default value
121 for the environment variable GUILE_WARN_DEPRECATED. See the README
122 for more information.
123
124 The default is to get a vague warning at program exit if deprecated
125 features were used:
126
127 --enable-deprecated=yes
128 --enable-deprecated=summary
129
130 To get a detailed warning at first use of a deprecated feature:
131
132 --enable-deprecated=detailed
133
134 To get no warnings:
135
136 --enable-deprecated=shutup
137
138 To omit deprecated features completely and irrevokably:
139
140 --enable-deprecated=no
141
142
143 --disable-shared --- Do not build shared libraries.
144 --disable-static --- Do not build static libraries.
145
146 Normally, both static and shared libraries will be built if your
147 system supports them.
148
149
150 --enable-debug-freelist --- Enable freelist debugging.
151
152 This enables a debugging version of SCM_NEWCELL(), and also
153 registers an extra primitive, the setter
154 `gc-set-debug-check-freelist!'.
155
156 Configure with the --enable-debug-freelist option to enable the
157 gc-set-debug-check-freelist! primitive, and then use:
158
159 (gc-set-debug-check-freelist! #t) # turn on checking of the freelist
160 (gc-set-debug-check-freelist! #f) # turn off checking
161
162 Checking of the freelist forces a traversal of the freelist and a
163 garbage collection before each allocation of a cell. This can slow
164 down the interpreter dramatically, so the setter should be used to
165 turn on this extra processing only when necessary.
166
167
168 --enable-debug-malloc --- Enable malloc debugging.
169
170 Include code for debugging of calls to scm_must_malloc/realloc/free.
171
172 Checks that
173
174 1. objects freed by scm_must_free has been mallocated by scm_must_malloc
175 2. objects reallocated by scm_must_realloc has been allocated by
176 scm_must_malloc
177 3. reallocated objects are reallocated with the same what string
178
179 But, most importantly, it records the number of allocated objects of
180 each kind. This is useful when searching for memory leaks.
181
182 A Guile compiled with this option provides the primitive
183 `malloc-stats' which returns an alist with pairs of kind and the
184 number of objects of that kind.
185
186
187 --enable-guile-debug --- Include internal debugging functions
188 --disable-arrays --- omit array and uniform array support
189 --disable-posix --- omit posix interfaces
190 --disable-networking --- omit networking interfaces
191 --disable-regex --- omit regular expression interfaces
192
193
194 Using Guile Without Installing It =========================================
195
196 If you want to run Guile without installing it, set the environment
197 variable `GUILE_LOAD_PATH' to a colon-separated list of directories,
198 including the directory containing this INSTALL file. If you used a
199 separate build directory, you'll need to include the build directory
200 in the path as well.
201
202 For example, suppose the Guile distribution unpacked into a directory
203 called `/home/jimb/guile-snap' (so the full name of this INSTALL file
204 would be `/home/jimb/guile-snap/INSTALL'). Then you might say, if
205 you're using Bash or any other Bourne shell variant,
206
207 export GUILE_LOAD_PATH=/home/jimb/guile-snap
208
209 or if you're using CSH or one of its variants:
210
211 setenv GUILE_LOAD_PATH /home/jimb/guile-snap
212
213
214 Installing SLIB ===========================================================
215
216 In order to use SLIB from Guile you basically only need to put the
217 `slib' directory _in_ one of the directories on Guile's load path.
218
219 The standard installation is:
220
221 1. Obtain slib from http://www-swiss.ai.mit.edu/~jaffer/SLIB.html
222
223 2. Put it in Guile's data directory, that is the directory printed when
224 you type
225
226 guile-config info pkgdatadir
227
228 at the shell prompt. This is normally `/usr/local/share/guile', so the
229 directory will normally have full path `/usr/local/share/guile/slib'.
230
231 3. Start guile as a user with write access to the data directory and type
232
233 (use-modules (ice-9 slib))
234
235 at the Guile prompt. This will generate the slibcat catalog next to
236 the slib directory.
237
238 SLIB's `require' is provided by the Guile module (ice-9 slib).
239
240 Example:
241
242 (use-modules (ice-9 slib))
243 (require 'primes)
244 (prime? 7)
245
246
247 Generic Instructions for Building Auto-Configured Packages ================
248
249 The `configure' shell script attempts to guess correct values for
250 various system-dependent variables used during compilation. It uses
251 those values to create a `Makefile' in each directory of the package.
252 It may also create one or more `.h' files containing system-dependent
253 definitions. Finally, it creates a shell script `config.status' that
254 you can run in the future to recreate the current configuration, a file
255 `config.cache' that saves the results of its tests to speed up
256 reconfiguring, and a file `config.log' containing compiler output
257 (useful mainly for debugging `configure').
258
259 If you need to do unusual things to compile the package, please try
260 to figure out how `configure' could check whether to do them, and mail
261 diffs or instructions to the address given in the `README' so they can
262 be considered for the next release. If at some point `config.cache'
263 contains results you don't want to keep, you may remove or edit it.
264
265 The file `configure.in' is used to create `configure' by a program
266 called `autoconf'. You only need `configure.in' if you want to change
267 it or regenerate `configure' using a newer version of `autoconf'.
268
269 The simplest way to compile this package is:
270
271 1. `cd' to the directory containing the package's source code and type
272 `./configure' to configure the package for your system. If you're
273 using `csh' on an old version of System V, you might need to type
274 `sh ./configure' instead to prevent `csh' from trying to execute
275 `configure' itself.
276
277 Running `configure' takes awhile. While running, it prints some
278 messages telling which features it is checking for.
279
280 2. Type `make' to compile the package.
281
282 3. Optionally, type `make check' to run any self-tests that come with
283 the package.
284
285 4. Type `make install' to install the programs and any data files and
286 documentation.
287
288 5. You can remove the program binaries and object files from the
289 source code directory by typing `make clean'. To also remove the
290 files that `configure' created (so you can compile the package for
291 a different kind of computer), type `make distclean'. There is
292 also a `make maintainer-clean' target, but that is intended mainly
293 for the package's developers. If you use it, you may have to get
294 all sorts of other programs in order to regenerate files that came
295 with the distribution.
296
297 Compilers and Options
298 =====================
299
300 Some systems require unusual options for compilation or linking that
301 the `configure' script does not know about. You can give `configure'
302 initial values for variables by setting them in the environment. Using
303 a Bourne-compatible shell, you can do that on the command line like
304 this:
305 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
306
307 Or on systems that have the `env' program, you can do it like this:
308 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
309
310 Compiling For Multiple Architectures
311 ====================================
312
313 You can compile the package for more than one kind of computer at the
314 same time, by placing the object files for each architecture in their
315 own directory. To do this, you must use a version of `make' that
316 supports the `VPATH' variable, such as GNU `make'. `cd' to the
317 directory where you want the object files and executables to go and run
318 the `configure' script. `configure' automatically checks for the
319 source code in the directory that `configure' is in and in `..'.
320
321 If you have to use a `make' that does not supports the `VPATH'
322 variable, you have to compile the package for one architecture at a time
323 in the source code directory. After you have installed the package for
324 one architecture, use `make distclean' before reconfiguring for another
325 architecture.
326
327 Installation Names
328 ==================
329
330 By default, `make install' will install the package's files in
331 `/usr/local/bin', `/usr/local/man', etc. You can specify an
332 installation prefix other than `/usr/local' by giving `configure' the
333 option `--prefix=PATH'.
334
335 You can specify separate installation prefixes for
336 architecture-specific files and architecture-independent files. If you
337 give `configure' the option `--exec-prefix=PATH', the package will use
338 PATH as the prefix for installing programs and libraries.
339 Documentation and other data files will still use the regular prefix.
340
341 In addition, if you use an unusual directory layout you can give
342 options like `--bindir=PATH' to specify different values for particular
343 kinds of files. Run `configure --help' for a list of the directories
344 you can set and what kinds of files go in them.
345
346 If the package supports it, you can cause programs to be installed
347 with an extra prefix or suffix on their names by giving `configure' the
348 option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
349
350 Optional Features
351 =================
352
353 Some packages pay attention to `--enable-FEATURE' options to
354 `configure', where FEATURE indicates an optional part of the package.
355 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
356 is something like `gnu-as' or `x' (for the X Window System). The
357 `README' should mention any `--enable-' and `--with-' options that the
358 package recognizes.
359
360 For packages that use the X Window System, `configure' can usually
361 find the X include and library files automatically, but if it doesn't,
362 you can use the `configure' options `--x-includes=DIR' and
363 `--x-libraries=DIR' to specify their locations.
364
365 Specifying the System Type
366 ==========================
367
368 There may be some features `configure' can not figure out
369 automatically, but needs to determine by the type of host the package
370 will run on. Usually `configure' can figure that out, but if it prints
371 a message saying it can not guess the host type, give it the
372 `--host=TYPE' option. TYPE can either be a short name for the system
373 type, such as `sun4', or a canonical name with three fields:
374 CPU-COMPANY-SYSTEM
375
376 See the file `config.sub' for the possible values of each field. If
377 `config.sub' isn't included in this package, then this package doesn't
378 need to know the host type.
379
380 If you are building compiler tools for cross-compiling, you can also
381 use the `--target=TYPE' option to select the type of system they will
382 produce code for and the `--build=TYPE' option to select the type of
383 system on which you are compiling the package.
384
385 Sharing Defaults
386 ================
387
388 If you want to set default values for `configure' scripts to share,
389 you can create a site shell script called `config.site' that gives
390 default values for variables like `CC', `cache_file', and `prefix'.
391 `configure' looks for `PREFIX/share/config.site' if it exists, then
392 `PREFIX/etc/config.site' if it exists. Or, you can set the
393 `CONFIG_SITE' environment variable to the location of the site script.
394 A warning: not all `configure' scripts look for a site script.
395
396 Operation Controls
397 ==================
398
399 `configure' recognizes the following options to control how it
400 operates.
401
402 `--cache-file=FILE'
403 Use and save the results of the tests in FILE instead of
404 `./config.cache'. Set FILE to `/dev/null' to disable caching, for
405 debugging `configure'.
406
407 `--help'
408 Print a summary of the options to `configure', and exit.
409
410 `--quiet'
411 `--silent'
412 `-q'
413 Do not print messages saying which checks are being made. To
414 suppress all normal output, redirect it to `/dev/null' (any error
415 messages will still be shown).
416
417 `--srcdir=DIR'
418 Look for the package's source code in directory DIR. Usually
419 `configure' can determine that directory automatically.
420
421 `--version'
422 Print the version of Autoconf used to generate the `configure'
423 script, and exit.
424
425 `configure' also accepts some other, not widely useful, options.