guile-user
[Top][All Lists]
Advanced

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

autoconf macro GUILE_CHECK_ICE9_OPTARGS


From: Thien-Thi Nguyen
Subject: autoconf macro GUILE_CHECK_ICE9_OPTARGS
Date: Tue, 13 Jan 2004 16:04:13 +0100

the autoconf macro below will appear in guile 1.4.1.98.  it is released
here under the same license as guile 1.4.x (GPL + exception).

thi

__________________________________________
# GUILE_CHECK_ICE9_OPTARGS -- use (ice-9 optargs) for (ice-9 optargs-kw)?
#
# Usage: GUILE_CHECK_ICE9_OPTARGS(var)
#
# Check if module @code{(ice-9 optargs-kw)} is available.  If so, set
# shell var @var{var} to "no" (see why below).  Otherwise, check if
# module @code{(ice-9 optargs)} acts like @code{(ice-9 optargs-kw)}.
# If so, set @var{var} to "yes", otherwise set it to "no".
#
# Mark the variable for substitution, as by @code{AC_SUBST}.
#
# Some versions of Guile provide a module @code{(ice-9 optargs)} that
# acts like @code{(ice-9 optargs-kw)} (and subsequently omit the latter,
# instead of providing both).  Code that uses @code{(ice-9 optargs-kw)}
# solely can be textually kludged to load @code{(ice-9 optargs)} in
# these situations if @var{var} is "yes".  Here is a Makefile fragment
# that demonstrates the technique:
#
# @example
# install-data-hook:
#         if test "$(need_optargs_kludge)" = yes ; then \
#            sed s/optargs-kw/optargs/ foo.scm > TMP ; \
#            mv TMP foo.scm ; \
#         fi
# @end example
#
# In this example, @var{var} is @code{need_optargs_kludge}.  If it turns
# out @code{(ice-9 optargs-kw)} is available, @code{need_optargs_kludge}
# would have value "no", and the kludge would neither be required nor
# applied.
#
AC_DEFUN([GUILE_CHECK_ICE9_OPTARGS],[
  GUILE_MODULE_AVAILABLE($1, (ice-9 optargs-kw))
  if test "$$1" = yes ; then
    $1=no
  else
    GUILE_MODULE_CHECK($1, (ice-9 optargs),
      [(= 2 ((lambda* (a #:optional b) b) 4 2))],
      [acts like (ice-9 optargs-kw)])
  fi
  AC_SUBST($1)
])




reply via email to

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