This directory contains sources of "spigot" extension module.
You can use these files as a template of your extension.

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

The sources include:

  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.

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.

  % autoconf -I `gauche-config --ac`

Don't forget to include the generated 'configure' script when
you distribute your extension, so that the users won't need
autoconf.

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.p

  % make
  % make check
  % make install

To create your own package, you can start copying configure.in and
Makefile.in from this directory and editing it.   There are some
autoconf macros defined for the convenience, so usually there
won't be much of Gauche-specific stuff in configure.in.

In Makefile.in, you may find some Gauche-specific items.

- Define INSTALL to @GAUCHE_INSTALL@, which will be replaced to
  the path to gauche-install script.  gauche-isntall script is
  upper-compatible to BSD install but cleverer in handling
  missing target directories.  Especially it eliminates the need
  of mkinstalldirs.

- If you include AC_GAUCHE_MAKE_GPD macro in configure.in, then
  a file $(PACKAGE).gpd is created at configuration time.  It records
  package's version and configuration option.  You can install it
  under $(SCM_INSTALL_DIR)/.packages.

  
