57 |
## Code |
## Code |
58 |
## ---- |
## ---- |
59 |
|
|
60 |
|
## NOTE: Comments preceding an AC_DEFUN (starting from "Usage:") are massaged |
61 |
|
## into doc/ref/autoconf-macros.texi (see Makefile.am in that directory). |
62 |
|
|
63 |
# GUILE_PROGS -- set paths to Guile interpreter, config and tool programs |
# GUILE_PROGS -- set paths to Guile interpreter, config and tool programs |
64 |
# |
# |
65 |
# Usage: GUILE_PROGS |
# Usage: GUILE_PROGS |
66 |
# |
# |
67 |
# This macro looks for programs `guile', `guile-config' and `guile-tools', |
# This macro looks for programs @code{guile}, @code{guile-config} and |
68 |
# and sets variables GUILE, GUILE_CONFIG and GUILE_TOOLS, to their paths, |
# @code{guile-tools}, and sets variables @var{GUILE}, @var{GUILE_CONFIG} and |
69 |
# respectively. If either of the first two are not found, signal error. |
# @var{GUILE_TOOLS}, to their paths, respectively. If either of the first two |
70 |
|
# are not found, signal error. |
71 |
# |
# |
72 |
# The variables are marked for substitution, as by AC_SUBST. |
# The variables are marked for substitution, as by @code{AC_SUBST}. |
73 |
# |
# |
74 |
AC_DEFUN([GUILE_PROGS], |
AC_DEFUN([GUILE_PROGS], |
75 |
[AC_PATH_PROG(GUILE,guile) |
[AC_PATH_PROG(GUILE,guile) |
90 |
# |
# |
91 |
# Usage: GUILE_FLAGS |
# Usage: GUILE_FLAGS |
92 |
# |
# |
93 |
# This macro runs the `guile-config' script, installed with Guile, |
# This macro runs the @code{guile-config} script, installed with Guile, to |
94 |
# to find out where Guile's header files and libraries are |
# find out where Guile's header files and libraries are installed. It sets |
95 |
# installed. It sets two variables, GUILE_CFLAGS and GUILE_LDFLAGS. |
# two variables, @var{GUILE_CFLAGS} and @var{GUILE_LDFLAGS}. |
96 |
# |
# |
97 |
# GUILE_CFLAGS: flags to pass to a C or C++ compiler to build code that |
# @var{GUILE_CFLAGS}: flags to pass to a C or C++ compiler to build code that |
98 |
# uses Guile header files. This is almost always just a -I flag. |
# uses Guile header files. This is almost always just a @code{-I} flag. |
99 |
# |
# |
100 |
# GUILE_LDFLAGS: flags to pass to the linker to link a program against |
# @var{GUILE_LDFLAGS}: flags to pass to the linker to link a program against |
101 |
# Guile. This includes `-lguile' for the Guile library itself, any |
# Guile. This includes @code{-lguile} for the Guile library itself, any |
102 |
# libraries that Guile itself requires (like -lqthreads), and so on. It |
# libraries that Guile itself requires (like -lqthreads), and so on. It may |
103 |
# may also include a -L flag to tell the compiler where to find the |
# also include a @code{-L} flag to tell the compiler where to find the |
104 |
# libraries. |
# libraries. |
105 |
# |
# |
106 |
# The variables are marked for substitution, as by AC_SUBST. |
# The variables are marked for substitution, as by @code{AC_SUBST}. |
107 |
# |
# |
108 |
AC_DEFUN([GUILE_FLAGS],[ |
AC_DEFUN([GUILE_FLAGS], |
109 |
## The GUILE_FLAGS macro. |
[AC_REQUIRE([GUILE_PROGS])dnl |
110 |
## First, let's just see if we can find Guile at all. |
AC_MSG_CHECKING([libguile compile flags]) |
111 |
AC_MSG_CHECKING(for Guile) |
GUILE_CFLAGS="`$GUILE_CONFIG compile`" |
112 |
guile-config link > /dev/null || { |
AC_MSG_RESULT([$GUILE_CFLAGS]) |
113 |
echo "configure: cannot find guile-config; is Guile installed?" 1>&2 |
AC_MSG_CHECKING([libguile link flags]) |
114 |
exit 1 |
GUILE_LDFLAGS="`$GUILE_CONFIG link`" |
115 |
} |
AC_MSG_RESULT([$GUILE_LDFLAGS]) |
|
GUILE_CFLAGS="`guile-config compile`" |
|
|
GUILE_LDFLAGS="`guile-config link`" |
|
116 |
AC_SUBST(GUILE_CFLAGS) |
AC_SUBST(GUILE_CFLAGS) |
117 |
AC_SUBST(GUILE_LDFLAGS) |
AC_SUBST(GUILE_LDFLAGS) |
118 |
AC_MSG_RESULT(yes) |
]) |
|
]) |
|
119 |
|
|
120 |
# GUILE_SITE_DIR -- find path to Guile "site" directory |
# GUILE_SITE_DIR -- find path to Guile "site" directory |
121 |
# |
# |
122 |
# Usage: GUILE_SITE_DIR |
# Usage: GUILE_SITE_DIR |
123 |
# |
# |
124 |
# This looks for Guile's "site" directory, usually something like |
# This looks for Guile's "site" directory, usually something like |
125 |
# PREFIX/share/guile/site, and sets var GUILE_SITE to the path. |
# PREFIX/share/guile/site, and sets var @var{GUILE_SITE} to the path. |
126 |
# Note that the var name is different from the macro name. |
# Note that the var name is different from the macro name. |
127 |
# |
# |
128 |
# The variable is marked for substitution, as by AC_SUBST. |
# The variable is marked for substitution, as by @code{AC_SUBST}. |
129 |
# |
# |
130 |
AC_DEFUN([GUILE_SITE_DIR], |
AC_DEFUN([GUILE_SITE_DIR], |
131 |
[AC_REQUIRE([GUILE_PROGS])dnl |
[AC_REQUIRE([GUILE_PROGS])dnl |
139 |
# |
# |
140 |
# Usage: GUILE_CHECK_RETVAL(var,check) |
# Usage: GUILE_CHECK_RETVAL(var,check) |
141 |
# |
# |
142 |
# $1 is a shell variable name to be set to the return value |
# @var{var} is a shell variable name to be set to the return value. |
143 |
# $2 is a Guile Scheme expression, evaluated with "$GUILE -c", and |
# @var{check} is a Guile Scheme expression, evaluated with "$GUILE -c", and |
144 |
# returning either 0 or non-#f to indicate the check passed. |
# returning either 0 or non-#f to indicate the check passed. |
145 |
# Non-0 number or #f indicates failure. |
# Non-0 number or #f indicates failure. |
146 |
# Avoid using the character "#" since that confuses autoconf. |
# Avoid using the character "#" since that confuses autoconf. |
155 |
# |
# |
156 |
# Usage: GUILE_MODULE_CHECK(var,module,featuretest,description) |
# Usage: GUILE_MODULE_CHECK(var,module,featuretest,description) |
157 |
# |
# |
158 |
# $1 is a shell variable name to be set to "yes" or "no" |
# @var{var} is a shell variable name to be set to "yes" or "no". |
159 |
# $2 is a list of symbols, like: (ice-9 common-list) |
# @var{module} is a list of symbols, like: (ice-9 common-list). |
160 |
# $3 is an expression acceptable to GUILE_CHECK, q.v. |
# @var{featuretest} is an expression acceptable to GUILE_CHECK, q.v. |
161 |
# $4 is a present-tense verb phrase (passed to AC_MSG_CHECKING) |
# @var{description} is a present-tense verb phrase (passed to AC_MSG_CHECKING). |
162 |
# |
# |
163 |
AC_DEFUN([GUILE_MODULE_CHECK], |
AC_DEFUN([GUILE_MODULE_CHECK], |
164 |
[AC_MSG_CHECKING([if $2 $4]) |
[AC_MSG_CHECKING([if $2 $4]) |
171 |
# |
# |
172 |
# Usage: GUILE_MODULE_AVAILABLE(var,module) |
# Usage: GUILE_MODULE_AVAILABLE(var,module) |
173 |
# |
# |
174 |
# $1 is a shell variable name to be set to "yes" or "no" |
# @var{var} is a shell variable name to be set to "yes" or "no". |
175 |
# $2 is a list of symbols, like: (ice-9 common-list) |
# @var{module} is a list of symbols, like: (ice-9 common-list). |
176 |
# |
# |
177 |
AC_DEFUN([GUILE_MODULE_AVAILABLE], |
AC_DEFUN([GUILE_MODULE_AVAILABLE], |
178 |
[GUILE_MODULE_CHECK($1,$2,0,is available) |
[GUILE_MODULE_CHECK($1,$2,0,is available) |
182 |
# |
# |
183 |
# Usage: GUILE_MODULE_REQUIRED(symlist) |
# Usage: GUILE_MODULE_REQUIRED(symlist) |
184 |
# |
# |
185 |
# $1 is a list of symbols, WITHOUT surrounding parens, like: ice-9 common-list |
# @var{symlist} is a list of symbols, WITHOUT surrounding parens, |
186 |
|
# like: ice-9 common-list. |
187 |
# |
# |
188 |
AC_DEFUN([GUILE_MODULE_REQUIRED], |
AC_DEFUN([GUILE_MODULE_REQUIRED], |
189 |
[GUILE_MODULE_AVAILABLE(ac_guile_module_required, ($1)) |
[GUILE_MODULE_AVAILABLE(ac_guile_module_required, ($1)) |
196 |
# |
# |
197 |
# Usage: GUILE_MODULE_EXPORTS(var,module,modvar) |
# Usage: GUILE_MODULE_EXPORTS(var,module,modvar) |
198 |
# |
# |
199 |
# $1 is a shell variable to be set to "yes" or "no" |
# @var{var} is a shell variable to be set to "yes" or "no". |
200 |
# $2 is a list of symbols, like: (ice-9 common-list) |
# @var{module} is a list of symbols, like: (ice-9 common-list). |
201 |
# $3 is the Guile Scheme variable to check |
# @var{modvar} is the Guile Scheme variable to check. |
202 |
# |
# |
203 |
AC_DEFUN([GUILE_MODULE_EXPORTS], |
AC_DEFUN([GUILE_MODULE_EXPORTS], |
204 |
[GUILE_MODULE_CHECK($1,$2,$3,exports `$3') |
[GUILE_MODULE_CHECK($1,$2,$3,exports `$3') |
208 |
# |
# |
209 |
# Usage: GUILE_MODULE_REQUIRED_EXPORT(module,modvar) |
# Usage: GUILE_MODULE_REQUIRED_EXPORT(module,modvar) |
210 |
# |
# |
211 |
# $1 is a list of symbols, like: (ice-9 common-list) |
# @var{module} is a list of symbols, like: (ice-9 common-list). |
212 |
# $2 is the Guile Scheme variable to check |
# @var{modvar} is the Guile Scheme variable to check. |
213 |
# |
# |
214 |
AC_DEFUN([GUILE_MODULE_REQUIRED_EXPORT], |
AC_DEFUN([GUILE_MODULE_REQUIRED_EXPORT], |
215 |
[GUILE_MODULE_EXPORTS(guile_module_required_export,$1,$2) |
[GUILE_MODULE_EXPORTS(guile_module_required_export,$1,$2) |