*** empty log message ***
[bpt/guile.git] / INSTALL
CommitLineData
afdd97ae
MV
1Guile Installation Guide
2Copyright (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
6dad9cd3
JB
18Brief Installation Instructions ===========================================
19
30d14d55 20To build Guile on unix, there are two basic steps:
0196b30a 21
6dad9cd3
JB
22 1. Type "./configure", to configure the package for your system.
23 2. Type "make", to build the package.
0196b30a
JB
24
25Generic instructions for configuring and compiling GNU distributions
fde0a324
MD
26are included below. (For instructions how to install SLIB, the scheme
27procedure library, see below.)
6dad9cd3 28
0196b30a 29
2bc6f750
MV
30Guile can use a number of external packages such as `readline' when
31they are available. Guile expects to be able to find these packages
32in the default compiler setup, it does not try to make any special
33arrangements itself. For example, for the `readline' package, Guile
34expects to be able to find the include file <readline/readline.h>,
35without passing any special `-I' options to the compiler.
36
37If you installed an external package, and you used the --prefix
38installation option to install it somewhere else than /usr/local, you
39must arrange for your compiler to find it by default. If that
40compiler is gcc, one convenient way of making such arrangements is to
41use the --with-local-prefix option during installation, naming the
42same directory as you used in the --prefix option of the package. In
43particular, it is not good enough to use the same --prefix option when
44you install gcc and the package; you need to use the
45--with-local-prefix option as well. See the gcc documentation for
46more details.
47
48
9f75bc05
JB
49Special Instructions For Some Systems =====================================
50
51We would like Guile to build on all systems using the simple
52instructions above, but it seems that a few systems still need special
53treatment. If you can send us fixes for these problems, we'd be
54grateful.
55
56SunOS 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:
7e2c0c8d 59 ./configure --disable-shared
9f75bc05
JB
60 For more information on `--disable-shared', see below, "Flags
61 Accepted by Configure".
62
63HP/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
bd0a8b65
JB
69NetBSD: 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.)"
6dad9cd3 72
fde0a324 73
6dad9cd3
JB
74Flags Accepted by Configure ===============================================
75
76If you run the configure script with no arguments, it should examine
77your system and set things up appropriately. However, there are a few
78switches specific to Guile you may find useful in some circumstances.
79
6dad9cd3 80
6503ad7f 81--enable-maintainer-mode
873b9044 82
6503ad7f
MV
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 README file says which
87 versions of those tools you will need.
6dad9cd3 88
6dad9cd3 89
6503ad7f 90--with-threads --- Build with thread support
6dad9cd3 91
6503ad7f
MV
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.
69fc343a 98
6503ad7f
MV
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.
69fc343a 103
69fc343a 104
6503ad7f 105--with-modules --- Specify statically linked `modules'
69fc343a 106
6503ad7f
MV
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?
69fc343a 112
69fc343a 113
6503ad7f 114--enable-deprecated=LEVEL --- Control the inclusion of deprecated features.
69fc343a 115
6503ad7f
MV
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
96a4a5b2
MV
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.
1db8171a
GH
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
96a4a5b2 136 --enable-deprecated=shutup
1db8171a
GH
137
138 To omit deprecated features completely and irrevokably:
139
140 --enable-deprecated=no
69fc343a 141
69fc343a 142
6503ad7f 143--disable-shared --- Do not build shared libraries.
a29bd019 144--disable-static --- Do not build static libraries.
69fc343a 145
a29bd019
GH
146 Normally, both static and shared libraries will be built if your
147 system supports them.
69fc343a 148
6503ad7f
MV
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
6dad9cd3 192
fde0a324 193
6dad9cd3
JB
194Using Guile Without Installing It =========================================
195
30d14d55 196If you want to run Guile without installing it, set the environment
cf591c72 197variable `GUILE_LOAD_PATH' to a colon-separated list of directories,
bacf83f0
JB
198including the directory containing this INSTALL file. If you used a
199separate build directory, you'll need to include the build directory
200in the path as well.
30d14d55 201
bacf83f0 202For example, suppose the Guile distribution unpacked into a directory
18f468f8
JB
203called `/home/jimb/guile-snap' (so the full name of this INSTALL file
204would be `/home/jimb/guile-snap/INSTALL'). Then you might say, if
205you're using Bash or any other Bourne shell variant,
bacf83f0 206
cf591c72 207 export GUILE_LOAD_PATH=/home/jimb/guile-snap
0196b30a 208
18f468f8 209or if you're using CSH or one of its variants:
0196b30a 210
cf591c72 211 setenv GUILE_LOAD_PATH /home/jimb/guile-snap
0196b30a 212
0196b30a 213
fde0a324
MD
214Installing SLIB ===========================================================
215
216In 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
219The 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
238SLIB's `require' is provided by the Guile module (ice-9 slib).
239
240Example:
241
242 (use-modules (ice-9 slib))
243 (require 'primes)
244 (prime? 7)
245
246
6dad9cd3 247Generic Instructions for Building Auto-Configured Packages ================
0196b30a 248
2bc6f750
MV
249 The `configure' shell script attempts to guess correct values for
250various system-dependent variables used during compilation. It uses
251those values to create a `Makefile' in each directory of the package.
252It may also create one or more `.h' files containing system-dependent
253definitions. Finally, it creates a shell script `config.status' that
254you 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
256reconfiguring, 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
260to figure out how `configure' could check whether to do them, and mail
261diffs or instructions to the address given in the `README' so they can
262be considered for the next release. If at some point `config.cache'
263contains 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
266called `autoconf'. You only need `configure.in' if you want to change
267it or regenerate `configure' using a newer version of `autoconf'.
268
269The 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
297Compilers and Options
298=====================
299
300 Some systems require unusual options for compilation or linking that
301the `configure' script does not know about. You can give `configure'
302initial values for variables by setting them in the environment. Using
303a Bourne-compatible shell, you can do that on the command line like
0196b30a 304this:
2bc6f750
MV
305 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
306
307Or on systems that have the `env' program, you can do it like this:
308 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
309
310Compiling For Multiple Architectures
311====================================
312
313 You can compile the package for more than one kind of computer at the
314same time, by placing the object files for each architecture in their
315own directory. To do this, you must use a version of `make' that
316supports the `VPATH' variable, such as GNU `make'. `cd' to the
317directory where you want the object files and executables to go and run
318the `configure' script. `configure' automatically checks for the
319source 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'
322variable, you have to compile the package for one architecture at a time
323in the source code directory. After you have installed the package for
324one architecture, use `make distclean' before reconfiguring for another
325architecture.
326
327Installation 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
332installation prefix other than `/usr/local' by giving `configure' the
333option `--prefix=PATH'.
334
335 You can specify separate installation prefixes for
336architecture-specific files and architecture-independent files. If you
337give `configure' the option `--exec-prefix=PATH', the package will use
338PATH as the prefix for installing programs and libraries.
339Documentation and other data files will still use the regular prefix.
340
341 In addition, if you use an unusual directory layout you can give
342options like `--bindir=PATH' to specify different values for particular
343kinds of files. Run `configure --help' for a list of the directories
344you can set and what kinds of files go in them.
345
346 If the package supports it, you can cause programs to be installed
347with an extra prefix or suffix on their names by giving `configure' the
348option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
349
350Optional Features
351=================
352
353 Some packages pay attention to `--enable-FEATURE' options to
354`configure', where FEATURE indicates an optional part of the package.
355They may also pay attention to `--with-PACKAGE' options, where PACKAGE
356is something like `gnu-as' or `x' (for the X Window System). The
357`README' should mention any `--enable-' and `--with-' options that the
358package recognizes.
359
360 For packages that use the X Window System, `configure' can usually
361find the X include and library files automatically, but if it doesn't,
362you can use the `configure' options `--x-includes=DIR' and
363`--x-libraries=DIR' to specify their locations.
364
365Specifying the System Type
366==========================
367
368 There may be some features `configure' can not figure out
369automatically, but needs to determine by the type of host the package
370will run on. Usually `configure' can figure that out, but if it prints
371a 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
373type, such as `sun4', or a canonical name with three fields:
374 CPU-COMPANY-SYSTEM
375
376See 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
378need to know the host type.
379
380 If you are building compiler tools for cross-compiling, you can also
381use the `--target=TYPE' option to select the type of system they will
382produce code for and the `--build=TYPE' option to select the type of
383system on which you are compiling the package.
384
385Sharing Defaults
386================
387
388 If you want to set default values for `configure' scripts to share,
389you can create a site shell script called `config.site' that gives
390default 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.
394A warning: not all `configure' scripts look for a site script.
395
396Operation Controls
397==================
398
399 `configure' recognizes the following options to control how it
400operates.
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.