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