temporarily disable elisp exception tests
[bpt/guile.git] / README
CommitLineData
cfad56a4
LC
1This is version 2.0 of Guile, Project GNU's extension language library.
2Guile is an implementation of the Scheme programming language, packaged
3as a library that can be linked into applications to give them their own
4extension language. Guile supports other languages as well, giving
5users of Guile-based applications a choice of languages.
7fcc90c4 6
1e457544 7Please send bug reports to bug-guile@gnu.org.
86f40248 8
c52f77ef
AW
9See the LICENSE file for the specific terms that apply to Guile. Note
10that for any copyright year range specified as YYYY-ZZZZ in this
11package, the range specifies every single year in that closed interval.
d165aa15
RB
12
13
14Additional INSTALL instructions ===========================================
15
16Generic instructions for configuring and compiling Guile can be found
17in the INSTALL file. Guile specific information and configure options
18can be found below, including instructions for installing SLIB.
19
a89cafc0
NJ
20Guile depends on the following external libraries.
21- libgmp
22- libiconv
23- libintl
24- libltdl
25- libunistring
cab6e6c0 26- libgc
127f5c62 27- libffi
18f2d5aa
LC
28It will also use the libreadline library if it is available.
29
30There is a corresponding `--with-XXX-prefix' option for each of these
31libraries (except for libgc and libffi which use `pkg-config', see
32below) that you can use when invoking ./configure, if you have these
33libraries installed in a location other than the standard places (/usr
34and /usr/local).
a89cafc0
NJ
35
36These options are provided by the Gnulib `havelib' module, and details
37of how they work are documented in `Searching for Libraries' in the
38Gnulib manual (http://www.gnu.org/software/gnulib/manual). The extent
39to which they work on a given OS depends on whether that OS supports
40encoding full library path names in executables (aka `rpath'). Also
41note that using these options, and hence hardcoding full library path
42names (where that is supported), makes it impossible to later move the
43built executables and libraries to an installation location other than
44the one that was specified at build time.
45
e744e076
TTN
46Another possible approach is to set CPPFLAGS and LDFLAGS on the
47configure command-line, so that they include -I options for all the
a89cafc0
NJ
48non-standard places where you have installed header files and -L
49options for all the non-standard places where you have installed
50libraries. This will allow configure and make to find those headers
e744e076
TTN
51and libraries during the build. E.g.:
52
53 ../configure [...] CPPFLAGS='-I/my/include' LDFLAGS='-L/my/lib'
54
55The locations found will not be hardcoded into the build executables and
56libraries, so with this approach you will probably also need to set
57LD_LIBRARY_PATH correspondingly, to allow Guile to find the necessary
58libraries again at runtime.
d165aa15
RB
59
60
a98dbc87
MV
61Required External Packages ================================================
62
63Guile requires the following external packages:
64
465ff502 65 - GNU MP, at least version 4.2
a98dbc87
MV
66
67 GNU MP is used for bignum arithmetic. It is available from
cab6e6c0 68 http://gmplib.org/ .
a98dbc87 69
cab6e6c0 70 - libltdl from GNU Libtool, at least version 1.5.6
a98dbc87
MV
71
72 libltdl is used for loading extensions at run-time. It is
cab6e6c0 73 available from http://www.gnu.org/software/libtool/ .
a98dbc87 74
800c0943 75 - GNU libunistring, at least version 0.9.3
1ee2c72e
LC
76
77 libunistring is used for Unicode string operations, such as the
78 `utf*->string' procedures. It is available from
79 http://www.gnu.org/software/libunistring/ .
80
cab6e6c0
LC
81 - libgc, at least version 7.0
82
83 libgc (aka. the Boehm-Demers-Weiser garbage collector) is the
84 conservative garbage collector used by Guile. It is available
d2fcbb19 85 from http://www.hboehm.info/gc/ .
cab6e6c0 86
127f5c62
LC
87 - libffi
88
89 libffi provides a "foreign function interface", used by the
90 `(system foreign)' module. It is available from
91 http://sourceware.org/libffi/ .
92
ef736635
NJ
93 - pkg-config
94
95 Guile's ./configure script uses pkg-config to discover the correct
ad17b155
LC
96 compile and link options for libgc and libffi. For this to work,
97 the `PKG_CONFIG_PATH' environment variable must be set to point to
98 the places where libgc's and libffi's `.pc' files can be found:
99
100 PKG_CONFIG_PATH=/path/to/libgc/lib/pkgconfig:/path/to/libffi/lib/pkgconfig
101
102 Alternatively, when pkg-config is not installed, you can work around
103 this by setting some variables as part of the configure
104 command-line:
ef736635
NJ
105
106 - PKG_CONFIG=true
107
108 - BDW_GC_CFLAGS=<compile flags for picking up libgc headers>
109
110 - BDW_GC_LIBS=<linker flags for picking up the libgc library>
111
35b67308
AW
112 Note that because you're bypassing all pkg-config checks, you will
113 also have to specify libffi flags as well:
114
115 - LIBFFI_CFLAGS=<compile flags for picking up libffi headers>
116
117 - LIBFFI_LIBS=<linker flags for picking up the libffi library>
118
a98dbc87 119
d165aa15
RB
120Special Instructions For Some Systems =====================================
121
122We would like Guile to build on all systems using the simple
123instructions above, but it seems that a few systems still need special
124treatment. If you can send us fixes for these problems, we'd be
125grateful.
126
70bb8113 127 <none yet listed>
d165aa15
RB
128
129Guile specific flags Accepted by Configure =================================
130
131If you run the configure script with no arguments, it should examine
132your system and set things up appropriately. However, there are a few
133switches specific to Guile you may find useful in some circumstances.
134
4f416616 135--without-threads --- Build without thread support
d165aa15 136
70bb8113 137 Build a Guile executable and library that supports multi-threading.
d165aa15 138
70bb8113
MV
139 The default is to enable threading support when your operating
140 system offsers 'POSIX threads'. When you do not want threading, use
141 `--without-threads'.
d165aa15
RB
142
143--enable-deprecated=LEVEL
144
145 Guile may contain features that are `deprecated'. When a feature is
3623a170
MV
146 deprecated, it means that it is still there, but that there is a
147 better way of achieving the same thing, and we'd rather have you use
148 this better way. This allows us to eventually remove the old
149 implementation and helps to keep Guile reasonably clean of historic
150 baggage.
151
d165aa15
RB
152 See the file NEWS for a list of features that are currently
153 deprecated. Each entry will also tell you what you should replace
154 your code with.
155
156 To give you some help with this process, and to encourage (OK,
157 nudge) people to switch to the newer methods, Guile can emit
158 warnings or errors when you use a deprecated feature. There is
159 quite a range of possibilities, from being completely silent to
160 giving errors at link time. What exactly happens is determined both
161 by the value of the `--enable-deprecated' configuration option when
162 Guile was built, and by the GUILE_WARN_DEPRECATED environment
163 variable.
164
165 It works like this:
166
167 When Guile has been configured with `--enable-deprecated=no' (or,
168 equivalently, with `--disable-deprecated') then all deprecated
169 features are omitted from Guile. You will get "undefined
170 reference", "variable unbound" or similar errors when you try to
171 use them.
172
173 When `--enable-deprecated=LEVEL' has been specified (for LEVEL not
174 "no"), LEVEL will be used as the default value of the environment
175 variable GUILE_WARN_DEPRECATED. A value of "yes" is changed to
176 "summary" and "shutup" is changed to "no", however.
177
178 When GUILE_WARN_DEPRECATED has the value "no", nothing special
179 will happen when a deprecated feature is used.
180
181 When GUILE_WARN_DEPRECATED has the value "summary", and a
182 deprecated feature has been used, Guile will print this message at
183 exit:
184
185 Some deprecated features have been used. Set the environment
186 variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
187 program to get more information. Set it to "no" to suppress
188 this message.
189
190 When GUILE_WARN_DEPRECATED has the value "detailed", a detailed
191 warning is emitted immediatly for the first use of a deprecated
192 feature.
193
194 The default is `--enable-deprecated=yes'.
195
8f305401
MV
196 In addition to setting GUILE_WARN_DEPRECATED in the environment, you
197 can also use (debug-enable 'warn-deprecated) and (debug-disable
198 'warn-deprecated) to enable and disable the detailed messaged at run
199 time.
200
1435c7dc
AW
201 Additionally, if your toolchain is new enough, you will receive
202 warnings at link time if you have a Guile extension that uses
203 deprecated functions provided by Guile.
3623a170 204
d165aa15
RB
205--disable-shared --- Do not build shared libraries.
206--disable-static --- Do not build static libraries.
207
208 Normally, both static and shared libraries will be built if your
209 system supports them.
210
d165aa15
RB
211--enable-debug-freelist --- Enable freelist debugging.
212
70bb8113
MV
213 This enables a debugging version of scm_cell and scm_double_cell,
214 and also registers an extra primitive, the setter
d165aa15
RB
215 `gc-set-debug-check-freelist!'.
216
217 Configure with the --enable-debug-freelist option to enable the
218 gc-set-debug-check-freelist! primitive, and then use:
219
220 (gc-set-debug-check-freelist! #t) # turn on checking of the freelist
221 (gc-set-debug-check-freelist! #f) # turn off checking
222
223 Checking of the freelist forces a traversal of the freelist and a
224 garbage collection before each allocation of a cell. This can slow
225 down the interpreter dramatically, so the setter should be used to
226 turn on this extra processing only when necessary.
227
d165aa15
RB
228--enable-debug-malloc --- Enable malloc debugging.
229
70bb8113 230 Include code for debugging of calls to scm_malloc, scm_realloc, etc.
d165aa15 231
70bb8113
MV
232 It records the number of allocated objects of each kind. This is
233 useful when searching for memory leaks.
d165aa15
RB
234
235 A Guile compiled with this option provides the primitive
236 `malloc-stats' which returns an alist with pairs of kind and the
237 number of objects of that kind.
238
d165aa15 239--enable-guile-debug --- Include internal debugging functions
d165aa15
RB
240--disable-posix --- omit posix interfaces
241--disable-networking --- omit networking interfaces
242--disable-regex --- omit regular expression interfaces
243
244
245Cross building Guile =====================================================
246
2db1dbfe
LC
247As of Guile 2.0.x, the build process produces a library, libguile-2.0,
248along with Guile "object files" containing bytecode to be interpreted by
249Guile's virtual machine. The bytecode format depends on the endianness
250and word size of the host CPU.
d165aa15 251
2db1dbfe
LC
252Thus, when cross building Guile, you first need to configure, build and
253install it for your build host.
d165aa15 254
2db1dbfe 255Then, you may configure Guile for cross building:
d165aa15
RB
256
257 ./configure --host=i686-pc-cygwin --disable-shared
258
2db1dbfe
LC
259A C compiler for the build system is required. If that doesn't suit it
260can be specified with the CC_FOR_BUILD variable in the usual way, for
261instance:
d165aa15 262
cd9d439e
KR
263 ./configure --host=m68k-unknown-linux-gnu CC_FOR_BUILD=/my/local/gcc
264
1028fcb2 265Guile for the build system can be specified similarly with the
2db1dbfe
LC
266GUILE_FOR_BUILD variable, which defaults to whatever `guile' executable
267is found in $PATH. It must have the exact same version has the Guile
268that you intend to cross-build.
d165aa15
RB
269
270
271Using Guile Without Installing It =========================================
272
0b6d8fdc
AW
273The "meta/" subdirectory of the Guile sources contains a script called
274"guile" that can be used to run the Guile that has just been built. Note
275that this is not the same "guile" as the one that is installed; this
276"guile" is a wrapper script that sets up the environment appropriately,
277then invokes the Guile binary.
278
4ea9429e
AW
279You may also build external packages against an uninstalled Guile build
280tree. The "uninstalled-env" script in the "meta/" subdirectory will set
281up an environment with a path including "meta/", a modified dynamic
282linker path, a modified PKG_CONFIG_PATH, etc.
0b6d8fdc
AW
283
284For example, you can enter this environment via invoking
285
286 meta/uninstalled-env bash
287
288Within that shell, other packages should be able to build against
289uninstalled Guile.
d165aa15
RB
290
291
292Installing SLIB ===========================================================
293
294In order to use SLIB from Guile you basically only need to put the
295`slib' directory _in_ one of the directories on Guile's load path.
296
297The standard installation is:
298
299 1. Obtain slib from http://www-swiss.ai.mit.edu/~jaffer/SLIB.html
300
301 2. Put it in Guile's data directory, that is the directory printed when
302 you type
303
304 guile-config info pkgdatadir
305
306 at the shell prompt. This is normally `/usr/local/share/guile', so the
307 directory will normally have full path `/usr/local/share/guile/slib'.
308
309 3. Start guile as a user with write access to the data directory and type
310
311 (use-modules (ice-9 slib))
312
313 at the Guile prompt. This will generate the slibcat catalog next to
314 the slib directory.
315
316SLIB's `require' is provided by the Guile module (ice-9 slib).
317
318Example:
319
320 (use-modules (ice-9 slib))
321 (require 'primes)
322 (prime? 7)
323
70bb8113 324
394a535e
MD
325Guile Documentation ==================================================
326
c52f77ef
AW
327The Guile Reference Manual (guile.info) is the primary documentation for
328Guile. A copy of the R5RS Scheme specification is included too
329(r5rs.info).
ea8ac9ac
KR
330
331Info format versions of this documentation are installed as part of
332the normal build process. The texinfo sources are under the doc
333directory, and other formats like Postscript, PDF, DVI or HTML can be
334generated from them with Tex and Texinfo tools.
335
336The doc directory also includes an example-smob subdirectory which has
337the example code from the "Defining New Types (Smobs)" chapter of the
338reference manual.
394a535e 339
b5074b23
MD
340The Guile WWW page is at
341
342 http://www.gnu.org/software/guile/guile.html
343
344It contains a link to the Guile FAQ.
345
cf78e9e8
JB
346About This Distribution ==============================================
347
f89a27fa 348Interesting files include:
ae8de16e 349
d165aa15 350- LICENSE, which contains the exact terms of the Guile license.
53befeb7 351- COPYING.LESSER, which contains the terms of the GNU Lesser General Public License.
d165aa15
RB
352- COPYING, which contains the terms of the GNU General Public License.
353- INSTALL, which contains general instructions for building/installing Guile.
f89a27fa 354- NEWS, which describes user-visible changes since the last release of Guile.
f89a27fa 355
ae8de16e
GH
356Files are usually installed according to the prefix specified to
357configure, /usr/local by default. Building and installing gives you:
358
359Executables, in ${prefix}/bin:
360
04873705
TTN
361 guile --- a stand-alone interpreter for Guile. With no arguments, this
362 is a simple interactive Scheme interpreter. It can also be used
363 as an interpreter for script files; see the NEWS file for details.
364 guile-config --- a Guile script which provides the information necessary
365 to link your programs against the Guile library.
366 guile-snarf --- a script to parse declarations in your C code for
367 Scheme-visible C functions, Scheme objects to be used by C code,
368 etc.
ae8de16e
GH
369
370Libraries, in ${prefix}/lib. Depending on the platform and options
371 given to configure, you may get shared libraries in addition
372 to or instead of these static libraries:
0a7fcdbc 373
04873705
TTN
374 libguile.a --- an object library containing the Guile interpreter,
375 You can use Guile in your own programs by linking against this.
04873705 376 libguilereadline.a --- an object library containing glue code for the
70bb8113
MV
377 GNU readline library.
378
04873705 379 libguile-srfi-*.a --- various SRFI support libraries
ae8de16e
GH
380
381Header files, in ${prefix}/include:
382
04873705
TTN
383 libguile.h, guile/gh.h, libguile/*.h --- for libguile.
384 guile-readline/readline.h --- for guile-readline.
ae8de16e
GH
385
386Support files, in ${prefix}/share/guile/<version>:
387
04873705
TTN
388 ice-9/* --- run-time support for Guile: the module system,
389 read-eval-print loop, some R4RS code and other infrastructure.
390 oop/* --- the Guile Object-Oriented Programming System (GOOPS)
391 scripts/* --- executable modules, i.e., scheme programs that can be both
392 called as an executable from the shell, and loaded and used as a
393 module from scheme code. See scripts/README for more info.
394 srfi/* --- SRFI support modules. See srfi/README for more info.
ae8de16e
GH
395
396Automake macros, in ${prefix}/share/aclocal:
397
04873705 398 guile.m4
ae8de16e
GH
399
400Documentation in Info format, in ${prefix}/info:
401
c08a1190
GH
402 guile --- Guile reference manual.
403
404 guile-tut --- Guile tutorial.
405
406 GOOPS --- GOOPS reference manual.
407
408 r5rs --- Revised(5) Report on the Algorithmic Language Scheme.
409
0196b30a 410
5c54da76
JB
411The Guile source tree is laid out as follows:
412
1325feea 413libguile:
cf78e9e8
JB
414 The Guile Scheme interpreter --- both the object library
415 for you to link with your programs, and the executable you can run.
1325feea 416ice-9: Guile's module system, initialization code, and other infrastructure.
17f8d40c
JB
417guile-config:
418 Source for the guile-config script.
621e8324
MV
419guile-readline:
420 The glue code for using GNU readline with Guile. This
421 will be build when configure can find a recent enough readline
422 library on your system.
ae8de16e 423doc: Documentation (see above).
4c8980a2 424
4b824aae 425Git Repository Access ================================================
c11f9405 426
4b824aae
LC
427Guile's source code is stored in a Git repository at Savannah. Anyone
428can access it using `git-clone' from one of the following URLs:
c11f9405 429
4b824aae
LC
430 git://git.sv.gnu.org/guile.git
431 http://git.sv.gnu.org/r/guile.git
349d9c1f 432
4b824aae
LC
433Developers with a Savannah SSH account can also access it from:
434
435 ssh://git.sv.gnu.org/srv/git/guile.git
436
437The repository can also be browsed on-line at the following address:
438
439 http://git.sv.gnu.org/gitweb/?p=guile.git
440
441For more information on Git, please see:
442
443 http://git.or.cz/
444
445Please send problem reports to <bug-guile@gnu.org>.