From fba502dbccfa57c6a8f5b7bffa4fddfb22725677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 2 Mar 2011 22:12:56 +0100 Subject: [PATCH] Improve the documentation for `dynamic-link'. * doc/ref/api-foreign.texi (Foreign Libraries): Make it clear that the LIBRARY argument of `dynamic-link' should not contain an extension. (Foreign Functions): Add cross-reference from `load-extension' to `dynamic-link'. Typeset file names and module names correctly. --- doc/ref/api-foreign.texi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/ref/api-foreign.texi b/doc/ref/api-foreign.texi index e9d7df6eb..b91439e5a 100644 --- a/doc/ref/api-foreign.texi +++ b/doc/ref/api-foreign.texi @@ -79,6 +79,12 @@ Normally, @var{library} is just the name of some shared library file that will be searched for in the places where shared libraries usually reside, such as in @file{/usr/lib} and @file{/usr/local/lib}. +@var{library} should not contain an extension such as @code{.so}. The +correct file name extension for the host operating system is provided +automatically, according to libltdl's rules (@pxref{Libltdl interface, +lt_dlopenext, @code{lt_dlopenext}, libtool, Shared Library Support for +GNU}). + When @var{library} is omitted, a @dfn{global symbol handle} is returned. This handle provides access to the symbols available to the program at run-time, including those exported by the program itself and the shared libraries already @@ -196,12 +202,13 @@ In that case, you would statically link your program with the desired library, and register its init function right after Guile has been initialized. -LIB should be a string denoting a shared library without any file type -suffix such as ".so". The suffix is provided automatically. It +As for @code{dynamic-link}, @var{lib} should not contain any suffix such +as @code{.so} (@pxref{Foreign Libraries, dynamic-link}). It should also not contain any directory components. Libraries that implement Guile Extensions should be put into the normal locations for shared libraries. We recommend to use the naming convention -libguile-bla-blum for a extension related to a module `(bla blum)'. +@file{libguile-bla-blum} for a extension related to a module @code{(bla +blum)}. The normal way for a extension to be used is to write a small Scheme file that defines a module, and to load the extension into this