guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Guile extension module skeleton package available


From: Martin Grabmueller
Subject: Guile extension module skeleton package available
Date: Thu, 03 May 2001 22:34:48 +0200

Hello folks,

I have just released the first version of my skeleton package

  guile-extension

All files and machinery for creating Guile extension modules is
included, as well as a script for adapting it to the name for your new
module.

If you are interested, download from:

http://www.pintus.de/mgrabmue/guile/guile.html#modules

For more information, I quote the README file:

Please give me feedback if you thing such a package is useful and/or
instructive, and how it could be improved.

Happy Guiling,
  'martin

-->8==================================================================

The guile-extension package is a meta-package.  It contains all files
and machinery to create a Guile extension module, with inital support
for C code shared object modules, Scheme modules, a complete
distribution layout and a manual skeleton.

How to get started:
-------------------

In this example, we suppose that you wish to create a package called
`guile-foo', providing the module (foo foo).

Unpack the tarball and rename the resulting directory to suit your
needs.

  address@hidden (~/cvs/x): tar xzf guile-extension-0.0.1.tar.gz 
  address@hidden (~/cvs/x): mv guile-extension-0.0.1 guile-foo
  address@hidden (~/cvs/x/guile-foo): 

Now change into that directory and start the `convert.sh' script,
which will rename several files and substitute your package name in
various places.

  address@hidden (~/cvs/x): cd guile-foo/
  address@hidden (~/cvs/x/guile-foo): ./convert.sh foo
  Renaming to foo...
  address@hidden (~/cvs/x/guile-foo): 

Now the package has been renamed and is ready for trying to build it.
Do not forget to run `autogen.sh' before configuring.

  address@hidden (~/cvs/x/guile-foo): ./autogen.sh 
  address@hidden (~/cvs/x/guile-foo): ./configure
  creating cache ./config.cache
  checking for a BSD compatible install... /usr/bin/install -c
  ...
  address@hidden (~/cvs/x/guile-foo): make
  guile-snarf -DPACKAGE=\"guile-foo\" -DVERSION=\"0.0.1\"  -I. -I.    -Wall 
-pedantic -ansi foo.c > foo.x \
  || { rm foo.x; false; }
  ...

You now have the compiled module in the .libs subdirectory and we can
try if everything worked fine.  Trying out is a bit complicated,
because we have not yet installed the package, but with a bit
symlinking and environment fiddling, we can do it.

Go to the directory above and make a symlink from your module name to
the package directory.  This step is required to make Guile search in
the right place for our Scheme module.

  address@hidden (~/cvs/x/guile-foo): cd ..
  address@hidden (~/cvs/x): ln -s guile-foo/ foo
  address@hidden (~/cvs/x): 

Now we have to set up the environment to tell Guile where to find the
compiled portion of the module.

  address@hidden (~/cvs/x): export 
LTDL_LIBRARY_PATH=/home/mgrabmue/cvs/x/guile-foo/.libs/
  address@hidden (~/cvs/x): 

Let's go for it.

  address@hidden (~/cvs/x): guile
  guile> (use-modules (foo foo))
  guile> (foo-version)
  "0.0.1"
  guile> (quit)

Congratulations!  Your new package works.  The `foo-version' procedure
is implemented in the C file foo.c for demonstration purposes.

-->8==================================================================



reply via email to

[Prev in Thread] Current Thread [Next in Thread]