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