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