2001-04-09 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
[bpt/guile.git] / doc / scheme-modules.texi
CommitLineData
38a93523
NJ
1@page
2@node Modules
3@chapter Modules
4@cindex modules
5
6[FIXME: somewhat babbling; should be reviewed by someone who understands
7modules, once the new module system is in place]
8
9When programs become large, naming conflicts can occur when a function
10or global variable defined in one file has the same name as a function
11or global variable in another file. Even just a @emph{similarity}
12between function names can cause hard-to-find bugs, since a programmer
13might type the wrong function name.
14
15The approach used to tackle this problem is called @emph{information
16encapsulation}, which consists of packaging functional units into a
17given name space that is clearly separated from other name spaces.
18@cindex encapsulation
19@cindex information encapsulation
20@cindex name space
21
22The language features that allow this are usually called @emph{the
23module system} because programs are broken up into modules that are
24compiled separately (or loaded separately in an interpreter).
25
26Older languages, like C, have limited support for name space
27manipulation and protection. In C a variable or function is public by
28default, and can be made local to a module with the @code{static}
29keyword. But you cannot reference public variables and functions from
30another module with different names.
31
32More advanced module systems have become a common feature in recently
33designed languages: ML, Python, Perl, and Modula 3 all allow the
34@emph{renaming} of objects from a foreign module, so they will not
35clutter the global name space.
36@cindex name space - private
37
38@menu
39* Scheme and modules::
40* The Guile module system::
41* Dynamic Libraries:: Loading libraries of compiled code at run time.
42* Dynamic Linking from Marius::
43@end menu
44
45
46@node Scheme and modules
47@section Scheme and modules
48
49Scheme, as defined in R4RS, does @emph{not} have a module system at all.
50
51Aubrey Jaffer, mostly to support his portable Scheme library SLIB,
52implemented a provide/require mechanism for many Scheme implementations.
53Library files in SLIB @emph{provide} a feature, and when user programs
54@emph{require} that feature, the library file is loaded in.
55
56For example, the file @file{random.scm} in the SLIB package contains the
57line
58@smalllisp
59(provide 'random)
60@end smalllisp
61so to use its procedures, a user would type
62@smalllisp
63(require 'random)
64@end smalllisp
65and they would magically become available, @emph{but still have the same
66names!} So this method is nice, but not as good as a full-featured
67module system.
68
69
70@node The Guile module system
71@section The Guile module system
72
73In 1996 Tom Lord implemented a full-featured module system for Guile
74which allows loading Scheme source files into a private name space.
75
76This module system is regarded as being rather idiosyncratic, and will
77probably change to something more like the ML module system, so for now
78I will simply describe how it works for a couple of simple cases.
79
80First of all, the Guile module system sets up a hierarchical name space,
81and that name space can be represented like Unix pathnames preceded by a
82@key{#} character. The root name space for all Guile-supplied modules
83is called @code{ice-9}.
84
85So for example, the SLIB interface, contained in
86@file{$srcdir/ice-9/slib.scm}, starts out with
87@smalllisp
88(define-module (ice-9 slib))
89@end smalllisp
90and a user program can use
91@smalllisp
92(use-modules (ice-9 slib))
93@end smalllisp
94to have access to all procedures and variables defined within the slib
95module with @code{(define-public ...)}.
96
97So here are the functions involved:
98@c begin (scm-doc-string "boot-9.scm" "define-module")
99@deffn syntax define-module module-specification
100@var{module-specification} is of the form @code{(hierarchy file)}. One
101example of this is
102@smalllisp
103(use-modules (ice-9 slib))
104@end smalllisp
105define-module makes this module available to Guile programs under the
106given @var{module-specification}.
107@end deffn
108@c end
109
110@c begin (scm-doc-string "boot-9.scm" "define-public")
111@deffn syntax define-public @dots{}
112Makes a procedure or variable available to programs that use the current
113module.
114@end deffn
115@c end
116
117@c begin (scm-doc-string "boot-9.scm" "use-modules")
118@deffn syntax use-modules module-specification
119@var{module-specification} is of the form @code{(hierarchy file)}. One
120example of this is
121@smalllisp
122(use-modules (ice-9 slib))
123@end smalllisp
124use-modules allows the current Guile program to use all publicly defined
125procedures and variables in the module denoted by
126@var{module-specification}.
127@end deffn
128@c end
129
130[FIXME: must say more, and explain, and also demonstrate a private name
131space use, and demonstrate how one would do Python's "from Tkinter
132import *" versus "import Tkinter". Must also add something about paths
133and standards for contributed modules.]
134
135@c docstring begin (texi-doc-string "guile" "standard-eval-closure")
136@deffn primitive standard-eval-closure module
137Return an eval closure for the module @var{module}.
138@end deffn
139
140Some modules are included in the Guile distribution; here are references
141to the entries in this manual which describe them in more detail:
142@table @strong
143@item boot-9
144boot-9 is Guile's initialization module, and it is always loaded when
145Guile starts up.
146@item (ice-9 debug)
147Mikael Djurfeldt's source-level debugging support for Guile
148(@pxref{Debugger User Interface}).
149@item (ice-9 threads)
150Guile's support for multi threaded execution (@pxref{Scheduling}).
151@item (ice-9 slib)
152This module contains hooks for using Aubrey Jaffer's portable Scheme
153library SLIB from Guile (@pxref{SLIB}).
154@item (ice-9 jacal)
155This module contains hooks for using Aubrey Jaffer's symbolic math
156packge Jacal from Guile (@pxref{JACAL}).
157@end table
158
159
160@node Dynamic Libraries
161@section Dynamic Libraries
162
163Often you will want to extend Guile by linking it with some existing
164system library. For example, linking Guile with a @code{curses} or
165@code{termcap} library would be useful if you want to implement a
166full-screen user interface for a Guile application. However, if you
167were to link Guile with these libraries at compile time, it would bloat
168the interpreter considerably, affecting everyone on the system even if
169the new libraries are useful only to you. Also, every time a new
170library is installed, you would have to reconfigure, recompile and
171relink Guile merely in order to provide a new interface.
172
173Many Unix systems permit you to get around this problem by using
174@dfn{dynamic loading}. When a new library is linked, it can be made a
175@dfn{dynamic library} by passing certain switches to the linker. A
176dynamic library does not need to be linked with an executable image at
177link time; instead, the executable may choose to load it dynamically at
178run time. This is a powerful concept that permits an executable to link
179itself with almost any library without reconfiguration, if it has been
180written properly.
181
182Guile's dynamic linking functions make it relatively easy to write a
183module that incorporates code from third-party object code libraries.
184
38a93523 185@c docstring begin (texi-doc-string "guile" "dynamic-link")
ae9f3a15
MG
186@deffn primitive dynamic-link filename
187Open the dynamic library called @var{filename}. A library
188handle representing the opened library is returned; this handle
189should be used as the @var{dobj} argument to the following
190functions.
38a93523
NJ
191@end deffn
192
193@c docstring begin (texi-doc-string "guile" "dynamic-object?")
194@deffn primitive dynamic-object? obj
195Return @code{#t} if @var{obj} is a dynamic library handle, or @code{#f}
196otherwise.
197@end deffn
198
38a93523
NJ
199@c docstring begin (texi-doc-string "guile" "dynamic-unlink")
200@deffn primitive dynamic-unlink dobj
38a93523 201Unlink the indicated object file from the application. The
ae9f3a15 202argument @var{dobj} must have been obtained by a call to
38a93523 203@code{dynamic-link}. After @code{dynamic-unlink} has been
ae9f3a15 204called on @var{dobj}, its content is no longer accessible.
38a93523
NJ
205@end deffn
206
38a93523
NJ
207@c docstring begin (texi-doc-string "guile" "dynamic-func")
208@deffn primitive dynamic-func name dobj
209Search the dynamic object @var{dobj} for the C function
210indicated by the string @var{name} and return some Scheme
211handle that can later be used with @code{dynamic-call} to
212actually call the function.
213
214Regardless whether your C compiler prepends an underscore @samp{_} to
215the global names in a program, you should @strong{not} include this
216underscore in @var{function}. Guile knows whether the underscore is
217needed or not and will add it when necessary.
218@end deffn
219
38a93523
NJ
220@c docstring begin (texi-doc-string "guile" "dynamic-call")
221@deffn primitive dynamic-call func dobj
ae9f3a15
MG
222Call the C function indicated by @var{func} and @var{dobj}.
223The function is passed no arguments and its return value is
224ignored. When @var{function} is something returned by
225@code{dynamic-func}, call that function and ignore @var{dobj}.
226When @var{func} is a string , look it up in @var{dynobj}; this
227is equivalent to
38a93523 228@smallexample
ae9f3a15 229(dynamic-call (dynamic-func @var{func} @var{dobj} #f))
38a93523
NJ
230@end smallexample
231
232Interrupts are deferred while the C function is executing (with
233@code{SCM_DEFER_INTS}/@code{SCM_ALLOW_INTS}).
234@end deffn
235
38a93523
NJ
236@c docstring begin (texi-doc-string "guile" "dynamic-args-call")
237@deffn primitive dynamic-args-call func dobj args
ae9f3a15
MG
238Call the C function indicated by @var{func} and @var{dobj},
239just like @code{dynamic-call}, but pass it some arguments and
240return its return value. The C function is expected to take
241two arguments and return an @code{int}, just like @code{main}:
38a93523
NJ
242@smallexample
243int c_func (int argc, char **argv);
244@end smallexample
245
ae9f3a15
MG
246The parameter @var{args} must be a list of strings and is
247converted into an array of @code{char *}. The array is passed
248in @var{argv} and its size in @var{argc}. The return value is
249converted to a Scheme number and returned from the call to
250@code{dynamic-args-call}.
38a93523
NJ
251@end deffn
252
253@c docstring begin (texi-doc-string "guile" "c-registered-modules")
254@deffn primitive c-registered-modules
255Return a list of the object code modules that have been imported into
256the current Guile process. Each element of the list is a pair whose
257car is the name of the module, and whose cdr is the function handle
258for that module's initializer function. The name is the string that
259has been passed to scm_register_module_xxx.
260@end deffn
261
262@c docstring begin (texi-doc-string "guile" "c-clear-registered-modules")
263@deffn primitive c-clear-registered-modules
264Destroy the list of modules registered with the current Guile process.
265The return value is unspecified. @strong{Warning:} this function does
266not actually unlink or deallocate these modules, but only destroys the
267records of which modules have been loaded. It should therefore be used
268only by module bookkeeping operations.
269@end deffn
270
271[FIXME: provide a brief example here of writing the C hooks for an
272object code module, and using dynamic-link and dynamic-call to load the
273module.]
274
275
276@node Dynamic Linking from Marius
277@section Dynamic Linking from Marius
278
279@c NJFIXME primitive documentation here duplicates (and is generally
280@c better than) documentation for the same primitives earlier on.
281
282Most modern Unices have something called @dfn{shared libraries}. This
283ordinarily means that they have the capability to share the executable
284image of a library between several running programs to save memory and
285disk space. But generally, shared libraries give a lot of additional
286flexibility compared to the traditional static libraries. In fact,
287calling them `dynamic' libraries is as correct as calling them `shared'.
288
289Shared libraries really give you a lot of flexibility in addition to the
290memory and disk space savings. When you link a program against a shared
291library, that library is not closely incorporated into the final
292executable. Instead, the executable of your program only contains
293enough information to find the needed shared libraries when the program
294is actually run. Only then, when the program is starting, is the final
295step of the linking process performed. This means that you need not
296recompile all programs when you install a new, only slightly modified
297version of a shared library. The programs will pick up the changes
298automatically the next time they are run.
299
300Now, when all the necessary machinery is there to perform part of the
301linking at run-time, why not take the next step and allow the programmer
302to explicitly take advantage of it from within his program? Of course,
303many operating systems that support shared libraries do just that, and
304chances are that Guile will allow you to access this feature from within
305your Scheme programs. As you might have guessed already, this feature
306is called @dfn{dynamic linking}@footnote{Some people also refer to the
307final linking stage at program startup as `dynamic linking', so if you
308want to make yourself perfectly clear, it is probably best to use the
309more technical term @dfn{dlopening}, as suggested by Gordon Matzigkeit
310in his libtool documentation.}
311
312As with many aspects of Guile, there is a low-level way to access the
313dynamic linking apparatus, and a more high-level interface that
314integrates dynamically linked libraries into the module system.
315
316@menu
317* Low level dynamic linking::
318* Compiled Code Modules::
319* Dynamic Linking and Compiled Code Modules::
320@end menu
321
322@node Low level dynamic linking
323@subsection Low level dynamic linking
324
325When using the low level procedures to do your dynamic linking, you have
326complete control over which library is loaded when and what get's done
327with it.
328
329@deffn primitive dynamic-link library
330Find the shared library denoted by @var{library} (a string) and link it
331into the running Guile application. When everything works out, return a
332Scheme object suitable for representing the linked object file.
333Otherwise an error is thrown. How object files are searched is system
334dependent.
335
336Normally, @var{library} is just the name of some shared library file
337that will be searched for in the places where shared libraries usually
338reside, such as in @file{/usr/lib} and @file{/usr/local/lib}.
339@end deffn
340
341@deffn primitive dynamic-object? val
342Determine whether @var{val} represents a dynamically linked object file.
343@end deffn
344
345@deffn primitive dynamic-unlink dynobj
346Unlink the indicated object file from the application. The argument
347@var{dynobj} should be one of the values returned by
348@code{dynamic-link}. When @code{dynamic-unlink} has been called on
349@var{dynobj}, it is no longer usable as an argument to the functions
350below and you will get type mismatch errors when you try to.
351@end deffn
352
353@deffn primitive dynamic-func function dynobj
354Search the C function indicated by @var{function} (a string or symbol)
355in @var{dynobj} and return some Scheme object that can later be used
356with @code{dynamic-call} to actually call this function. Right now,
357these Scheme objects are formed by casting the address of the function
358to @code{long} and converting this number to its Scheme representation.
359
360Regardless whether your C compiler prepends an underscore @samp{_} to
361the global names in a program, you should @strong{not} include this
362underscore in @var{function}. Guile knows whether the underscore is
363needed or not and will add it when necessary.
364@end deffn
365
366@deffn primitive dynamic-call function dynobj
367Call the C function indicated by @var{function} and @var{dynobj}. The
368function is passed no arguments and its return value is ignored. When
369@var{function} is something returned by @code{dynamic-func}, call that
370function and ignore @var{dynobj}. When @var{function} is a string (or
371symbol, etc.), look it up in @var{dynobj}; this is equivalent to
372
373@smallexample
374(dynamic-call (dynamic-func @var{function} @var{dynobj} #f))
375@end smallexample
376
377Interrupts are deferred while the C function is executing (with
378@code{SCM_DEFER_INTS}/@code{SCM_ALLOW_INTS}).
379@end deffn
380
381@deffn primitive dynamic-args-call function dynobj args
382Call the C function indicated by @var{function} and @var{dynobj}, just
383like @code{dynamic-call}, but pass it some arguments and return its
384return value. The C function is expected to take two arguments and
385return an @code{int}, just like @code{main}:
386
387@smallexample
388int c_func (int argc, char **argv);
389@end smallexample
390
391The parameter @var{args} must be a list of strings and is converted into
392an array of @code{char *}. The array is passed in @var{argv} and its
393size in @var{argc}. The return value is converted to a Scheme number
394and returned from the call to @code{dynamic-args-call}.
395@end deffn
396
397When dynamic linking is disabled or not supported on your system,
398the above functions throw errors, but they are still available.
399
400Here is a small example that works on GNU/Linux:
401
402@smallexample
403(define libc-obj (dynamic-link "libc.so"))
404libc-obj
405@result{} #<dynamic-object "libc.so">
406(dynamic-args-call 'rand libc-obj '())
407@result{} 269167349
408(dynamic-unlink libc-obj)
409libc-obj
410@result{} #<dynamic-object "libc.so" (unlinked)>
411@end smallexample
412
413As you can see, after calling @code{dynamic-unlink} on a dynamically
414linked library, it is marked as @samp{(unlinked)} and you are no longer
415able to use it with @code{dynamic-call}, etc. Whether the library is
416really removed from you program is system-dependent and will generally
417not happen when some other parts of your program still use it. In the
418example above, @code{libc} is almost certainly not removed from your
419program because it is badly needed by almost everything.
420
421The functions to call a function from a dynamically linked library,
422@code{dynamic-call} and @code{dynamic-args-call}, are not very powerful.
423They are mostly intended to be used for calling specially written
424initialization functions that will then add new primitives to Guile.
425For example, we do not expect that you will dynamically link
426@file{libX11} with @code{dynamic-link} and then construct a beautiful
427graphical user interface just by using @code{dynamic-call} and
428@code{dynamic-args-call}. Instead, the usual way would be to write a
429special Guile<->X11 glue library that has intimate knowledge about both
430Guile and X11 and does whatever is necessary to make them inter-operate
431smoothly. This glue library could then be dynamically linked into a
432vanilla Guile interpreter and activated by calling its initialization
433function. That function would add all the new types and primitives to
434the Guile interpreter that it has to offer.
435
436From this setup the next logical step is to integrate these glue
437libraries into the module system of Guile so that you can load new
438primitives into a running system just as you can load new Scheme code.
439
440There is, however, another possibility to get a more thorough access to
441the functions contained in a dynamically linked library. Anthony Green
442has written @file{libffi}, a library that implements a @dfn{foreign
443function interface} for a number of different platforms. With it, you
444can extend the Spartan functionality of @code{dynamic-call} and
445@code{dynamic-args-call} considerably. There is glue code available in
446the Guile contrib archive to make @file{libffi} accessible from Guile.
447
448@node Compiled Code Modules
449@subsection Putting Compiled Code into Modules
450
451The new primitives that you add to Guile with @code{gh_new_procedure} or
452with any of the other mechanisms are normally placed into the same
453module as all the other builtin procedures (like @code{display}).
454However, it is also possible to put new primitives into their own
455module.
456
457The mechanism for doing so is not very well thought out and is likely to
458change when the module system of Guile itself is revised, but it is
459simple and useful enough to document it as it stands.
460
461What @code{gh_new_procedure} and the functions used by the snarfer
462really do is to add the new primitives to whatever module is the
463@emph{current module} when they are called. This is analogous to the
464way Scheme code is put into modules: the @code{define-module} expression
465at the top of a Scheme source file creates a new module and makes it the
466current module while the rest of the file is evaluated. The
467@code{define} expressions in that file then add their new definitions to
468this current module.
469
470Therefore, all we need to do is to make sure that the right module is
471current when calling @code{gh_new_procedure} for our new primitives.
472Unfortunately, there is not yet an easy way to access the module system
473from C, so we are better off with a more indirect approach. Instead of
474adding our primitives at initialization time we merely register with
475Guile that we are ready to provide the contents of a certain module,
476should it ever be needed.
477
478@deftypefun void scm_register_module_xxx (char *@var{name}, void (*@var{initfunc})(void))
479Register with Guile that @var{initfunc} will provide the contents of the
480module @var{name}.
481
482The function @var{initfunc} should perform the usual initialization
483actions for your new primitives, like calling @code{gh_new_procedure} or
484including the file produced by the snarfer. When @var{initfunc} is
485called, the current module is a newly created module with a name as
486indicated by @var{name}. Each definition that is added to it will be
487automatically exported.
488
489The string @var{name} indicates the hierachical name of the new module.
490It should consist of the individual components of the module name
491separated by single spaces. That is, the Scheme module name @code{(foo
492bar)}, which is a list, should be written as @code{"foo bar"} for the
493@var{name} parameter.
494
495You can call @code{scm_register_module_xxx} at any time, even before
496Guile has been initialized. This might be useful when you want to put
497the call to it in some initialization code that is magically called
498before main, like constructors for global C++ objects.
499
500An example for @code{scm_register_module_xxx} appears in the next section.
501@end deftypefun
502
503Now, instead of calling the initialization function at program startup,
504you should simply call @code{scm_register_module_xxx} and pass it the
505initialization function. When the named module is later requested by
506Scheme code with @code{use-modules} for example, Guile will notice that
507it knows how to create this module and will call the initialization
508function at the right time in the right context.
509
510@node Dynamic Linking and Compiled Code Modules
511@subsection Dynamic Linking and Compiled Code Modules
512
513The most interesting application of dynamically linked libraries is
514probably to use them for providing @emph{compiled code modules} to
515Scheme programs. As much fun as programming in Scheme is, every now and
516then comes the need to write some low-level C stuff to make Scheme even
517more fun.
518
519Not only can you put these new primitives into their own module (see the
520previous section), you can even put them into a shared library that is
521only then linked to your running Guile image when it is actually
522needed.
523
524An example will hopefully make everything clear. Suppose we want to
525make the Bessel functions of the C library available to Scheme in the
526module @samp{(math bessel)}. First we need to write the appropriate
527glue code to convert the arguments and return values of the functions
528from Scheme to C and back. Additionally, we need a function that will
529add them to the set of Guile primitives. Because this is just an
530example, we will only implement this for the @code{j0} function, tho.
531
532@smallexample
533#include <math.h>
534#include <guile/gh.h>
535
536SCM
537j0_wrapper (SCM x)
538@{
539 return gh_double2scm (j0 (gh_scm2double (x)));
540@}
541
542void
543init_math_bessel ()
544@{
545 gh_new_procedure1_0 ("j0", j0_wrapper);
546@}
547@end smallexample
548
549We can already try to bring this into action by manually calling the low
550level functions for performing dynamic linking. The C source file needs
551to be compiled into a shared library. Here is how to do it on
552GNU/Linux, please refer to the @code{libtool} documentation for how to
553create dynamically linkable libraries portably.
554
555@smallexample
556gcc -shared -o libbessel.so -fPIC bessel.c
557@end smallexample
558
559Now fire up Guile:
560
561@smalllisp
562(define bessel-lib (dynamic-link "./libbessel.so"))
563(dynamic-call "init_math_bessel" bessel-lib)
564(j0 2)
565@result{} 0.223890779141236
566@end smalllisp
567
568The filename @file{./libbessel.so} should be pointing to the shared
569library produced with the @code{gcc} command above, of course. The
570second line of the Guile interaction will call the
571@code{init_math_bessel} function which in turn will register the C
572function @code{j0_wrapper} with the Guile interpreter under the name
573@code{j0}. This function becomes immediately available and we can call
574it from Scheme.
575
576Fun, isn't it? But we are only half way there. This is what
577@code{apropos} has to say about @code{j0}:
578
579@smallexample
580(apropos 'j0)
581@print{} the-root-module: j0 #<primitive-procedure j0>
582@end smallexample
583
584As you can see, @code{j0} is contained in the root module, where all
585the other Guile primitives like @code{display}, etc live. In general,
586a primitive is put into whatever module is the @dfn{current module} at
587the time @code{gh_new_procedure} is called. To put @code{j0} into its
588own module named @samp{(math bessel)}, we need to make a call to
589@code{scm_register_module_xxx}. Additionally, to have Guile perform
590the dynamic linking automatically, we need to put @file{libbessel.so}
591into a place where Guile can find it. The call to
592@code{scm_register_module_xxx} should be contained in a specially
593named @dfn{module init function}. Guile knows about this special name
594and will call that function automatically after having linked in the
595shared library. For our example, we add the following code to
596@file{bessel.c}:
597
598@smallexample
599void scm_init_math_bessel_module ()
600@{
601 scm_register_module_xxx ("math bessel", init_math_bessel);
602@}
603@end smallexample
604
605The general pattern for the name of a module init function is:
606@samp{scm_init_}, followed by the name of the module where the
607individual hierarchical components are concatenated with underscores,
608followed by @samp{_module}. It should call
609@code{scm_register_module_xxx} with the correct module name and the
610appropriate initialization function. When that initialization function
611will be called, a newly created module with the right name will be the
612@emph{current module} so that all definitions that the initialization
613functions makes will end up in the correct module.
614
615After @file{libbessel.so} has been rebuild, we need to place the shared
616library into the right place. When Guile tries to autoload the
617@samp{(math bessel)} module, it looks not only for a file called
618@file{math/bessel.scm} in its @code{%load-path}, but also for
619@file{math/libbessel.so}. So all we need to do is to create a directory
620called @file{math} somewhere in Guile's @code{%load-path} and place
621@file{libbessel.so} there. Normally, the current directory @file{.} is
622in the @code{%load-path}, so we just use that for this example.
623
624@smallexample
625% mkdir maths
626% cd maths
627% ln -s ../libbessel.so .
628% cd ..
629% guile
630guile> (use-modules (math bessel))
631guile> (j0 2)
6320.223890779141236
633guile> (apropos 'j0)
634@print{} bessel: j0 #<primitive-procedure j0>
635@end smallexample
636
637That's it!
638
639Note that we used a symlink to make @file{libbessel.so} appear in the
640right spot. This is probably not a bad idea in general. The
641directories that the @file{%load-path} normally contains are supposed to
642contain only architecture independent files. They are not really the
643right place for a shared library. You might want to install the
644libraries somewhere below @samp{exec_prefix} and then symlink to them
645from the architecture independent directory. This will at least work on
646heterogenous systems where the architecture dependent stuff resides in
647the same place on all machines (which seems like a good idea to me
648anyway).
649
650
651@c Local Variables:
652@c TeX-master: "guile.texi"
653@c End: