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