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