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