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