Next: Using Autoconf Macros, Previous: Autoconf Background, Up: Autoconf Support
The macro names all begin with "GUILE_".
Look for programs
guile,guile-configandguile-tools, and set variables GUILE, GUILE_CONFIG and GUILE_TOOLS, to their paths, respectively. If either of the first two is not found, signal error.Mark the variables for substitution, as by
AC_SUBST.
Run the
guile-configscript, installed with Guile, to find out where Guile's header files and libraries are installed. Set two variables, GUILE_CFLAGS and GUILE_LDFLAGS.GUILE_CFLAGS: flags to pass to a C or C++ compiler to build code that uses Guile header files. This is almost always just a
-Iflag.GUILE_LDFLAGS: flags to pass to the linker to link a program against Guile. This includes
-lguilefor the Guile library itself, any libraries that Guile itself requires (like -lqthreads), and so on. It may also include a-Lflag to tell the compiler where to find the libraries.Mark the variables for substitution, as by
AC_SUBST.
Look for Guile's "site" directory, usually something like PREFIX/share/guile/site, and set var GUILE_SITE to the path. Note that PREFIX is that of Guile, which may or may not coincide with the one specified by
configure --prefix. Note also that the var name is different from the macro name.Mark the variable for substitution, as by
AC_SUBST.
Look for Guile's "library site" directory, usually something like PREFIX/lib/guile/site, and set var GUILE_LIBSITE to the path. Note that PREFIX is that of Guile, which may or may not coincide with the one specified by
configure --prefix. Note also that the var name is different from the macro name.Mark the variable for substitution, as by
AC_SUBST.
Set var to the numeric return value of evaluating check. var is a shell variable name to be set to the return value.
check is one or more Guile Scheme expression, evaluated with "$GUILE -c", the last of which should return either 0 or non-#f to indicate the check passed. Non-0 number or #f indicates failure. This is conventionally achieved by wrapping the last expression in
exit. For example,(foo) (bar) (exit (baz)).Avoid using the character "#" since that confuses autoconf.
Set var based on whether or not feature is
provided?. var is a shell variable name to be set to "yes" or "no". feature is a symbol, like:posix.
Set var based on whether or not module supports featuretest. var is a shell variable name to be set to "yes" or "no". module is a list of symbols, like:
(ice-9 common-list). featuretest is an expression acceptable to GUILE_CHECK, q.v. description is a present-tense verb phrase (passed to AC_MSG_CHECKING).
Set var based on whether or not module can be found. var is a shell variable name to be set to "yes" or "no". module is a list of symbols, like:
(ice-9 common-list).
Check that the module named by symlist is available. If not, fail. symlist is a list of symbols, WITHOUT surrounding parens, like:
ice-9 common-list.
Set var based on whether or not module exports modvar. var is a shell variable to be set to "yes" or "no". module is a list of symbols, like:
(ice-9 common-list). modvar is the Guile Scheme variable to check.
Check if module exports modvar. If not, fail. module is a list of symbols, like:
(ice-9 common-list). modvar is the Guile Scheme variable to check.
Check if module
(ice-9 optargs-kw)is available. If so, set shell var var to "no" (see why below). Otherwise, check if module(ice-9 optargs)acts like(ice-9 optargs-kw). If so, set var to "yes", otherwise set it to "no".Mark the variable for substitution, as by
AC_SUBST.Some versions of Guile provide a module
(ice-9 optargs)that acts like(ice-9 optargs-kw)(and subsequently omit the latter, instead of providing both). Code that uses(ice-9 optargs-kw)solely can be textually kludged to load(ice-9 optargs)in these situations if var has value "yes". Here is a Makefile.am fragment that demonstrates the technique:install-data-hook: if test "$(need_optargs_kludge)" = yes ; then \ sed s/optargs-kw/optargs/ foo.scm > TMP ; \ mv TMP foo.scm ; \ fiIn this example, var is
need_optargs_kludge. If it turns out(ice-9 optargs-kw)is available,need_optargs_kludgewould have value "no", and the kludge would neither be required nor applied.
Define two AC_CONFIG_COMMAND commands to manage the local module catalog.
module-catalog-prep- This command runs towards the tail end of a
configureinvocation. It does these actions:
- Create a dependencies subdirectory named by the shell var
DEPDIR, or ".deps" if not that var is not defined. This step is skipped if the directory already exists.- Create a dummy makefile fragment file in the dependencies directory named .Pmodule-catalog. This step is skipped if the file already exists. Optional arg FRAGNAME specifies another filename for the makefile fragment.
- Append an
includedirective to ./Makefile. This step is skipped if the directive has already been appended.module-catalog-clean-local- This command is intended to be run as an action in the Makefile.am target
clean-local. It re-initializes the dependencies file (ie, FRAGNAME or .Pmodule-catalog in the deps dir). You still need to add the module catalog's name to the Makefile.am varCLEANFILES. For example:# fragment of top-level Makefile.am CLEANFILES = .module-catalog clean-local: ./config.status module-catalog-clean-local
Set shell variable var to be the absolute filename of the guile-tools program if it exists, or to ":" otherwise. Optional third arg notfound is the value to use instead of ":".
Mark the variable for substitution, as by
AC_SUBST.