Previous: Reentrancy, Up: Using GNU lightning
autoconf
with gnu lightningIt is very easy to include gnu lightning's source code (without the documentation and examples) into your program's distribution so that people don't need to have it installed in order to use it.
Here is a step by step explanation of what to do:
lightningize
If you're using Automake, you might be pleased to know that Makefile.am files will be already there.
aclocal
, instead,
you should delete the Makefile.am files (they are of no use
to you) and copy the contents of the lightning.m4 file, found in
aclocal's macro repository (usually /usr/share/aclocal,
to your configure.in or acinclude.m4 or aclocal.m4 file.
LIGHTNING_CONFIGURE_IF_NOT_FOUND
macro in your configure.in file.
LIGHTNING_CONFIGURE_IF_NOT_FOUND
will first look for a
pre-installed copy of gnu lightning and, if it can be found, it will
use it; otherwise, it will do exactly the same things that
gnu lightning's own configure script does. If gnu lightning is
already installed, or if the configuration process succeeds, it
will define the HAVE_LIGHTNING
symbol.
In addtion, an Automake conditional named HAVE_INSTALLED_LIGHTNING
will be set if gnu lightning is already installed, which can be used to
set up include paths appropriately.
Finally, LIGHTNING_CONFIGURE_IF_NOT_FOUND
accepts two
optional parameters: respectively, an action to be taken if gnu lightning
is available, and an action to be taken if it is not.