Merge branch 'syncase-in-boot-9'
[bpt/guile.git] / README
1 !!! This is not a Guile release; it is a source tree retrieved via
2 Git or as a nightly snapshot at some random time after the
3 Guile 1.8 release. If this were a Guile release, you would not see
4 this message. !!! [fixme: zonk on release]
5
6 This is a 1.9 development version of Guile, Project GNU's extension
7 language library. Guile is an interpreter for Scheme, packaged as a
8 library that you can link into your applications to give them their
9 own scripting language. Guile will eventually support other languages
10 as well, giving users of Guile-based applications a choice of
11 languages.
12
13 Guile versions with an odd middle number, i.e. 1.9.* are unstable
14 development versions. Even middle numbers indicate stable versions.
15 This has been the case since the 1.3.* series.
16
17 The next stable release will likely be version 1.10.0.
18
19 Please send bug reports to bug-guile@gnu.org.
20
21 See the LICENSE file for the specific terms that apply to Guile.
22
23
24 Additional INSTALL instructions ===========================================
25
26 Generic instructions for configuring and compiling Guile can be found
27 in the INSTALL file. Guile specific information and configure options
28 can be found below, including instructions for installing SLIB.
29
30 Guile requires a few external packages and can optionally use a number
31 of external packages such as `readline' when they are available.
32 Guile expects to be able to find these packages in the default
33 compiler setup, it does not try to make any special arrangements
34 itself. For example, for the `readline' package, Guile expects to be
35 able to find the include file <readline/readline.h>, without passing
36 any special `-I' options to the compiler.
37
38 If you installed an external package, and you used the --prefix
39 installation option to install it somewhere else than /usr/local, you
40 must arrange for your compiler to find it by default. If that
41 compiler is gcc, one convenient way of making such arrangements is to
42 use the --with-local-prefix option during installation, naming the
43 same directory as you used in the --prefix option of the package. In
44 particular, it is not good enough to use the same --prefix option when
45 you install gcc and the package; you need to use the
46 --with-local-prefix option as well. See the gcc documentation for
47 more details.
48
49
50 Required External Packages ================================================
51
52 Guile requires the following external packages:
53
54 - GNU MP, at least version 4.1
55
56 GNU MP is used for bignum arithmetic. It is available from
57 http://swox.com/gmp
58
59 - libltdl from libtool, at least from libtool version 1.5.6
60
61 libltdl is used for loading extensions at run-time. It is
62 available from http://www.gnu.org/software/libtool/
63
64 - GNU libunistring
65
66 libunistring is used for Unicode string operations, such as the
67 `utf*->string' procedures. It is available from
68 http://www.gnu.org/software/libunistring/ .
69
70
71 Special Instructions For Some Systems =====================================
72
73 We would like Guile to build on all systems using the simple
74 instructions above, but it seems that a few systems still need special
75 treatment. If you can send us fixes for these problems, we'd be
76 grateful.
77
78 <none yet listed>
79
80 Guile specific flags Accepted by Configure =================================
81
82 If you run the configure script with no arguments, it should examine
83 your system and set things up appropriately. However, there are a few
84 switches specific to Guile you may find useful in some circumstances.
85
86 --without-threads --- Build without thread support
87
88 Build a Guile executable and library that supports multi-threading.
89
90 The default is to enable threading support when your operating
91 system offsers 'POSIX threads'. When you do not want threading, use
92 `--without-threads'.
93
94 --enable-deprecated=LEVEL
95
96 Guile may contain features that are `deprecated'. When a feature is
97 deprecated, it means that it is still there, but that there is a
98 better way of achieving the same thing, and we'd rather have you use
99 this better way. This allows us to eventually remove the old
100 implementation and helps to keep Guile reasonably clean of historic
101 baggage.
102
103 Deprecated features are considered harmful; using them is likely a
104 bug. See below for the related notion of `discouraged' features,
105 which are OK but have fallen out of favor.
106
107 See the file NEWS for a list of features that are currently
108 deprecated. Each entry will also tell you what you should replace
109 your code with.
110
111 To give you some help with this process, and to encourage (OK,
112 nudge) people to switch to the newer methods, Guile can emit
113 warnings or errors when you use a deprecated feature. There is
114 quite a range of possibilities, from being completely silent to
115 giving errors at link time. What exactly happens is determined both
116 by the value of the `--enable-deprecated' configuration option when
117 Guile was built, and by the GUILE_WARN_DEPRECATED environment
118 variable.
119
120 It works like this:
121
122 When Guile has been configured with `--enable-deprecated=no' (or,
123 equivalently, with `--disable-deprecated') then all deprecated
124 features are omitted from Guile. You will get "undefined
125 reference", "variable unbound" or similar errors when you try to
126 use them.
127
128 When `--enable-deprecated=LEVEL' has been specified (for LEVEL not
129 "no"), LEVEL will be used as the default value of the environment
130 variable GUILE_WARN_DEPRECATED. A value of "yes" is changed to
131 "summary" and "shutup" is changed to "no", however.
132
133 When GUILE_WARN_DEPRECATED has the value "no", nothing special
134 will happen when a deprecated feature is used.
135
136 When GUILE_WARN_DEPRECATED has the value "summary", and a
137 deprecated feature has been used, Guile will print this message at
138 exit:
139
140 Some deprecated features have been used. Set the environment
141 variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
142 program to get more information. Set it to "no" to suppress
143 this message.
144
145 When GUILE_WARN_DEPRECATED has the value "detailed", a detailed
146 warning is emitted immediatly for the first use of a deprecated
147 feature.
148
149 The default is `--enable-deprecated=yes'.
150
151 In addition to setting GUILE_WARN_DEPRECATED in the environment, you
152 can also use (debug-enable 'warn-deprecated) and (debug-disable
153 'warn-deprecated) to enable and disable the detailed messaged at run
154 time.
155
156 --disable-discouraged
157
158 In addition to deprecated features, Guile can also contain things
159 that are merely `discouraged'. It is OK to continue to use these
160 features in old code, but new code should avoid them since there are
161 better alternatives.
162
163 There is nothing wrong with a discouraged feature per se, but they
164 might have strange names, or be non-standard, for example. Avoiding
165 them will make your code better.
166
167 --disable-shared --- Do not build shared libraries.
168 --disable-static --- Do not build static libraries.
169
170 Normally, both static and shared libraries will be built if your
171 system supports them.
172
173 --enable-debug-freelist --- Enable freelist debugging.
174
175 This enables a debugging version of scm_cell and scm_double_cell,
176 and also registers an extra primitive, the setter
177 `gc-set-debug-check-freelist!'.
178
179 Configure with the --enable-debug-freelist option to enable the
180 gc-set-debug-check-freelist! primitive, and then use:
181
182 (gc-set-debug-check-freelist! #t) # turn on checking of the freelist
183 (gc-set-debug-check-freelist! #f) # turn off checking
184
185 Checking of the freelist forces a traversal of the freelist and a
186 garbage collection before each allocation of a cell. This can slow
187 down the interpreter dramatically, so the setter should be used to
188 turn on this extra processing only when necessary.
189
190 --enable-debug-malloc --- Enable malloc debugging.
191
192 Include code for debugging of calls to scm_malloc, scm_realloc, etc.
193
194 It records the number of allocated objects of each kind. This is
195 useful when searching for memory leaks.
196
197 A Guile compiled with this option provides the primitive
198 `malloc-stats' which returns an alist with pairs of kind and the
199 number of objects of that kind.
200
201 --enable-guile-debug --- Include internal debugging functions
202 --disable-posix --- omit posix interfaces
203 --disable-networking --- omit networking interfaces
204 --disable-regex --- omit regular expression interfaces
205
206
207 Cross building Guile =====================================================
208
209 As of guile-1.5.x, the build process uses compiled C files for
210 snarfing, and (indirectly, through libtool) for linking, and uses the
211 guile executable for generating documentation.
212
213 When cross building guile, you first need to configure, build and
214 install guile for your build host.
215
216 Then, you may configure guile for cross building, eg:
217
218 ./configure --host=i686-pc-cygwin --disable-shared
219
220 A C compiler for the build system is required. The default is
221 "PATH=/usr/bin:$PATH cc". If that doesn't suit it can be specified
222 with the CC_FOR_BUILD variable in the usual way, for instance
223
224 ./configure --host=m68k-unknown-linux-gnu CC_FOR_BUILD=/my/local/gcc
225
226 Guile for the build system can be specified similarly with the
227 GUILE_FOR_BUILD variable, it defaults to just "guile".
228
229
230 Using Guile Without Installing It =========================================
231
232 The "meta/" subdirectory of the Guile sources contains a script called
233 "guile" that can be used to run the Guile that has just been built. Note
234 that this is not the same "guile" as the one that is installed; this
235 "guile" is a wrapper script that sets up the environment appropriately,
236 then invokes the Guile binary.
237
238 You may also build external packages against an uninstalled Guile build
239 tree. The "uninstalled-env" script in the "meta/" subdirectory will set
240 up an environment with a path including "meta/", a modified dynamic
241 linker path, a modified PKG_CONFIG_PATH, etc.
242
243 For example, you can enter this environment via invoking
244
245 meta/uninstalled-env bash
246
247 Within that shell, other packages should be able to build against
248 uninstalled Guile.
249
250
251 Installing SLIB ===========================================================
252
253 In order to use SLIB from Guile you basically only need to put the
254 `slib' directory _in_ one of the directories on Guile's load path.
255
256 The standard installation is:
257
258 1. Obtain slib from http://www-swiss.ai.mit.edu/~jaffer/SLIB.html
259
260 2. Put it in Guile's data directory, that is the directory printed when
261 you type
262
263 guile-config info pkgdatadir
264
265 at the shell prompt. This is normally `/usr/local/share/guile', so the
266 directory will normally have full path `/usr/local/share/guile/slib'.
267
268 3. Start guile as a user with write access to the data directory and type
269
270 (use-modules (ice-9 slib))
271
272 at the Guile prompt. This will generate the slibcat catalog next to
273 the slib directory.
274
275 SLIB's `require' is provided by the Guile module (ice-9 slib).
276
277 Example:
278
279 (use-modules (ice-9 slib))
280 (require 'primes)
281 (prime? 7)
282
283
284 Guile Documentation ==================================================
285
286 If you've never used Scheme before, then the Guile Tutorial
287 (guile-tut.info) is a good starting point. The Guile Reference Manual
288 (guile.info) is the primary documentation for Guile. The Goops object
289 system is documented separately (goops.info). A copy of the R5RS
290 Scheme specification is included too (r5rs.info).
291
292 Info format versions of this documentation are installed as part of
293 the normal build process. The texinfo sources are under the doc
294 directory, and other formats like Postscript, PDF, DVI or HTML can be
295 generated from them with Tex and Texinfo tools.
296
297 The doc directory also includes an example-smob subdirectory which has
298 the example code from the "Defining New Types (Smobs)" chapter of the
299 reference manual.
300
301 The Guile WWW page is at
302
303 http://www.gnu.org/software/guile/guile.html
304
305 It contains a link to the Guile FAQ.
306
307 About This Distribution ==============================================
308
309 Interesting files include:
310
311 - LICENSE, which contains the exact terms of the Guile license.
312 - COPYING, which contains the terms of the GNU General Public License.
313 - INSTALL, which contains general instructions for building/installing Guile.
314 - NEWS, which describes user-visible changes since the last release of Guile.
315
316 Files are usually installed according to the prefix specified to
317 configure, /usr/local by default. Building and installing gives you:
318
319 Executables, in ${prefix}/bin:
320
321 guile --- a stand-alone interpreter for Guile. With no arguments, this
322 is a simple interactive Scheme interpreter. It can also be used
323 as an interpreter for script files; see the NEWS file for details.
324 guile-config --- a Guile script which provides the information necessary
325 to link your programs against the Guile library.
326 guile-snarf --- a script to parse declarations in your C code for
327 Scheme-visible C functions, Scheme objects to be used by C code,
328 etc.
329
330 Libraries, in ${prefix}/lib. Depending on the platform and options
331 given to configure, you may get shared libraries in addition
332 to or instead of these static libraries:
333
334 libguile.a --- an object library containing the Guile interpreter,
335 You can use Guile in your own programs by linking against this.
336 libguilereadline.a --- an object library containing glue code for the
337 GNU readline library.
338
339 libguile-srfi-*.a --- various SRFI support libraries
340
341 Header files, in ${prefix}/include:
342
343 libguile.h, guile/gh.h, libguile/*.h --- for libguile.
344 guile-readline/readline.h --- for guile-readline.
345
346 Support files, in ${prefix}/share/guile/<version>:
347
348 ice-9/* --- run-time support for Guile: the module system,
349 read-eval-print loop, some R4RS code and other infrastructure.
350 oop/* --- the Guile Object-Oriented Programming System (GOOPS)
351 scripts/* --- executable modules, i.e., scheme programs that can be both
352 called as an executable from the shell, and loaded and used as a
353 module from scheme code. See scripts/README for more info.
354 srfi/* --- SRFI support modules. See srfi/README for more info.
355
356 Automake macros, in ${prefix}/share/aclocal:
357
358 guile.m4
359
360 Documentation in Info format, in ${prefix}/info:
361
362 guile --- Guile reference manual.
363
364 guile-tut --- Guile tutorial.
365
366 GOOPS --- GOOPS reference manual.
367
368 r5rs --- Revised(5) Report on the Algorithmic Language Scheme.
369
370
371 The Guile source tree is laid out as follows:
372
373 libguile:
374 The Guile Scheme interpreter --- both the object library
375 for you to link with your programs, and the executable you can run.
376 ice-9: Guile's module system, initialization code, and other infrastructure.
377 guile-config:
378 Source for the guile-config script.
379 guile-readline:
380 The glue code for using GNU readline with Guile. This
381 will be build when configure can find a recent enough readline
382 library on your system.
383 doc: Documentation (see above).
384
385 Git Repository Access ================================================
386
387 Guile's source code is stored in a Git repository at Savannah. Anyone
388 can access it using `git-clone' from one of the following URLs:
389
390 git://git.sv.gnu.org/guile.git
391 http://git.sv.gnu.org/r/guile.git
392
393 Developers with a Savannah SSH account can also access it from:
394
395 ssh://git.sv.gnu.org/srv/git/guile.git
396
397 The repository can also be browsed on-line at the following address:
398
399 http://git.sv.gnu.org/gitweb/?p=guile.git
400
401 For more information on Git, please see:
402
403 http://git.or.cz/
404
405 Please send problem reports to <bug-guile@gnu.org>.