Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 010670e365eac4bfdf0087ea1c497c2e > files > 88

gauche-0.9.3.2-1.fc15.i686.rpm

This directory contains sources of "spigot" extension module,
as an example of Gauche extension.

This extension isn't built by default.  You can build it
_after installing Gauche_.  See below.

The sources include:

  DIST           - a helper script to create a distribution tarball.
  configure.in   - source of "configure" script
  Makefile.in    - template makefile
  spigot.h       - common declaration within the spigot module
  spigot.c       - main logic 
  spigotlib.stub - a "stub" file to generate Scheme-C glue
  spigot.scm     - Scheme part of the module
  test.scm       - unit test

This is a typical construction of a simple extension.  Note that
you can generate the skeletons of these files automatically,
by "gauche-package" script:

  % gauche-package generate spigot

It is a good way to start writing a fresh extension; but now
we already have the sources, so let's move on.

As a developer, you have to start from generating "configure"
script by autoconf.   You need autoconf version 2.54 or later.
This command creates "configure" from configure.in.

  % ./DIST gen

It actually just calls autoconf.  (Note: in Gauche 0.8.5 or
before, you needed to give an option to autoconf so that it
understands Gauche-specific macros.  Now the standard configure.in
does not contain any Gauche-specific macros, so you don't need
the option anymore.)

Once configure is generated, you can create Makefile by
running configure script.

  % ./configure

The configure script automatically finds installed Gauche,
and picks the right options to compile and link.
Now, 'make' builds the extension, 'make check' runs
the test, and 'make install' installs the extension
in the Gauche's standard location.

  % make
  % make check
  % make install

To create a distributable package, use DIST script:

  % ./DIST tgz

It creates a tarball "spigot-1.0.tgz" in the parent directory.