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