* Made the port implementations less tightly coupled within guile.
[bpt/guile.git] / INSTALL
CommitLineData
6dad9cd3
JB
1Brief Installation Instructions ===========================================
2
30d14d55 3To build Guile on unix, there are two basic steps:
0196b30a 4
6dad9cd3
JB
5 1. Type "./configure", to configure the package for your system.
6 2. Type "make", to build the package.
0196b30a
JB
7
8Generic instructions for configuring and compiling GNU distributions
fde0a324
MD
9are included below. (For instructions how to install SLIB, the scheme
10procedure library, see below.)
6dad9cd3 11
0196b30a 12
9f75bc05
JB
13Special Instructions For Some Systems =====================================
14
15We would like Guile to build on all systems using the simple
16instructions above, but it seems that a few systems still need special
17treatment. If you can send us fixes for these problems, we'd be
18grateful.
19
20SunOS 4.1: Guile's shared library support seems to be confused, but
21 hey; shared libraries are confusing. You may need to configure
22 Guile with a command like:
7e2c0c8d 23 ./configure --disable-shared
9f75bc05
JB
24 For more information on `--disable-shared', see below, "Flags
25 Accepted by Configure".
26
27HP/UX: GCC 2.7.2 (and maybe other versions) have trouble creating
28 shared libraries if they depend on any non-shared libraries. GCC
29 seems to have other problems as well. To work around this, we
30 suggest you configure Guile to use the system's C compiler:
31 CC=cc ./configure
32
bd0a8b65
JB
33NetBSD: Perry Metzger says, "Guile will build under NetBSD only using
34 gmake -- the native make will not work. (gmake is in our package
35 system, so this will not be a problem when we packagize 1.3.)"
6dad9cd3 36
fde0a324 37
6dad9cd3
JB
38Flags Accepted by Configure ===============================================
39
40If you run the configure script with no arguments, it should examine
41your system and set things up appropriately. However, there are a few
42switches specific to Guile you may find useful in some circumstances.
43
44--enable-maintainer-mode --- If you have automake, autoconf, and
45libtool installed on your system, this switch causes configure to
46generate Makefiles which know how to automatically regenerate
47configure scripts, makefiles, and headers, when they are out of date.
48The README file says which versions of those tools you will need.
49
50--with-threads --- Build a Guile executable and library that supports
51cooperative threading. If you use this switch, Guile will also build
52and install the QuickThreads non-preemptive threading library,
6d2bd56d
MV
53libqthreads, which you will need to link into your programs after
54libguile. When you use `guile-config', you will pick up all
55neccessary linker flags automatically.
873b9044 56
18f468f8
JB
57Cooperative threads are not yet thoroughly tested; once they are, they
58will be enabled by default. The interaction with blocking I/O is
59pretty ad hoc at the moment. In our experience, bugs in the thread
60support do not affect you if you don't actually use threads.
6dad9cd3 61
6d2bd56d
MV
62--with-modules --- Guile can dynamically load `plugin modules' during
63runtime, using facilities provided by libtool. Not all platforms
64support this, however. On these platforms, you can statically link
65the plugin modules into libguile when Guile itself is build. XXX -
66how does one specify the modules?
6dad9cd3
JB
67
68--disable-shared --- Do not build shared libraries. Normally, Guile
69will build shared libraries if your system supports them. Guile
70always builds static libraries.
71
69fc343a
MD
72--enable-debug-freelist --- Enable freelist debugging.
73
74This enables a debugging version of SCM_NEWCELL(), and also registers
75an extra primitive, the setter `gc-set-debug-check-freelist!'.
76
77Configure with the --enable-debug-freelist option to enable
78the gc-set-debug-check-freelist! primitive, and then use:
79
80(gc-set-debug-check-freelist! #t) # turn on checking of the freelist
81(gc-set-debug-check-freelist! #f) # turn off checking
82
83Checking of the freelist forces a traversal of the freelist and
84a garbage collection before each allocation of a cell. This can
85slow down the interpreter dramatically, so the setter should be used to
86turn on this extra processing only when necessary.
87
88--enable-debug-malloc --- Enable malloc debugging.
89
90Include code for debugging of calls to scm_must_malloc/realloc/free.
91
92Checks that
93
941. objects freed by scm_must_free has been mallocated by scm_must_malloc
952. objects reallocated by scm_must_realloc has been allocated by
96 scm_must_malloc
973. reallocated objects are reallocated with the same what string
98
99But, most importantly, it records the number of allocated objects of
100each kind. This is useful when searching for memory leaks.
101
102A Guile compiled with this option provides the primitive
103`malloc-stats' which returns an alist with pairs of kind and the
104number of objects of that kind.
105
ee2bf8b8 106--enable-guile-debug --- Include internal debugging functions
69fc343a
MD
107--disable-arrays --- omit array and uniform array support
108--disable-posix --- omit posix interfaces
109--disable-networking --- omit networking interfaces
110--disable-regex --- omit regular expression interfaces
6dad9cd3 111
fde0a324 112
6dad9cd3
JB
113Using Guile Without Installing It =========================================
114
30d14d55 115If you want to run Guile without installing it, set the environment
cf591c72 116variable `GUILE_LOAD_PATH' to a colon-separated list of directories,
bacf83f0
JB
117including the directory containing this INSTALL file. If you used a
118separate build directory, you'll need to include the build directory
119in the path as well.
30d14d55 120
bacf83f0 121For example, suppose the Guile distribution unpacked into a directory
18f468f8
JB
122called `/home/jimb/guile-snap' (so the full name of this INSTALL file
123would be `/home/jimb/guile-snap/INSTALL'). Then you might say, if
124you're using Bash or any other Bourne shell variant,
bacf83f0 125
cf591c72 126 export GUILE_LOAD_PATH=/home/jimb/guile-snap
0196b30a 127
18f468f8 128or if you're using CSH or one of its variants:
0196b30a 129
cf591c72 130 setenv GUILE_LOAD_PATH /home/jimb/guile-snap
0196b30a 131
0196b30a 132
fde0a324
MD
133Installing SLIB ===========================================================
134
135In order to use SLIB from Guile you basically only need to put the
136`slib' directory _in_ one of the directories on Guile's load path.
137
138The standard installation is:
139
140 1. Obtain slib from http://www-swiss.ai.mit.edu/~jaffer/SLIB.html
141
142 2. Put it in Guile's data directory, that is the directory printed when
143 you type
144
145 guile-config info pkgdatadir
146
147 at the shell prompt. This is normally `/usr/local/share/guile', so the
148 directory will normally have full path `/usr/local/share/guile/slib'.
149
150 3. Start guile as a user with write access to the data directory and type
151
152 (use-modules (ice-9 slib))
153
154 at the Guile prompt. This will generate the slibcat catalog next to
155 the slib directory.
156
157SLIB's `require' is provided by the Guile module (ice-9 slib).
158
159Example:
160
161 (use-modules (ice-9 slib))
162 (require 'primes)
163 (prime? 7)
164
165
6dad9cd3 166Generic Instructions for Building Auto-Configured Packages ================
0196b30a
JB
167
168To compile this package:
169
1701. Configure the package for your system. In the directory that this
171file is in, type `./configure'. If you're using `csh' on an old
172version of System V, you might need to type `sh configure' instead to
173prevent `csh' from trying to execute `configure' itself.
174
175The `configure' shell script attempts to guess correct values for
176various system-dependent variables used during compilation, and
177creates the Makefile(s) (one in each subdirectory of the source
178directory). In some packages it creates a C header file containing
179system-dependent definitions. It also creates a file `config.status'
180that you can run in the future to recreate the current configuration.
181Running `configure' takes a minute or two.
182
183To compile the package in a different directory from the one
184containing the source code, you must use GNU make. `cd' to the
185directory where you want the object files and executables to go and
186run `configure' with the option `--srcdir=DIR', where DIR is the
187directory that contains the source code. Using this option is
188actually unnecessary if the source code is in the parent directory of
189the one in which you are compiling; `configure' automatically checks
190for the source code in `..' if it does not find it in the current
191directory.
192
193By default, `make install' will install the package's files in
194/usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify
195an installation prefix other than /usr/local by giving `configure' the
196option `--prefix=PATH'. Alternately, you can do so by changing the
197`prefix' variable in the Makefile that `configure' creates (the
198Makefile in the top-level directory, if the package contains
199subdirectories).
200
201You can specify separate installation prefixes for machine-specific
202files and machine-independent files. If you give `configure' the
203option `--exec_prefix=PATH', the package will use PATH as the prefix
204for installing programs and libraries. Normally, all files are
205installed using the same prefix.
206
207`configure' ignores any other arguments that you give it.
208
209If your system requires unusual options for compilation or linking
210that `configure' doesn't know about, you can give `configure' initial
211values for some variables by setting them in the environment. In
212Bourne-compatible shells, you can do that on the command line like
213this:
214 CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure
215
216The `make' variables that you might want to override with environment
217variables when running `configure' are:
218
219(For these variables, any value given in the environment overrides the
220value that `configure' would choose:)
221CC C compiler program.
222 Default is `cc', or `gcc' if `gcc' is in your PATH.
223INSTALL Program to use to install files.
224 Default is `install' if you have it, `cp' otherwise.
225INCLUDEDIR Directory for `configure' to search for include files.
226 Default is /usr/include.
227
228(For these variables, any value given in the environment is added to
229the value that `configure' chooses:)
230DEFS Configuration options, in the form '-Dfoo -Dbar ...'
231LIBS Libraries to link with, in the form '-lfoo -lbar ...'
232
233If you need to do unusual things to compile the package, we encourage
234you to teach `configure' how to do them and mail the diffs to the
235address given in the README so we can include them in the next
236release.
237
2382. Type `make' to compile the package.
239
2403. Type `make install' to install programs, data files, and
241documentation.
242
2434. You can remove the program binaries and object files from the
244source directory by typing `make clean'. To also remove the
245Makefile(s), the header file containing system-dependent definitions
246(if the package uses one), and `config.status' (all the files that
247`configure' created), type `make distclean'.
248
249The file `configure.in' is used as a template to create `configure' by
250a program called `autoconf'. You will only need it if you want to
251regenerate `configure' using a newer version of `autoconf'.