summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2010-05-11 13:20:03 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2010-05-11 13:20:03 (GMT)
commita5774356a1c12d1bcb55b6322710e347e1604fc9 (patch) (side-by-side diff)
treeaaff6e22c36e2b8b2a97789d4382d63ad6900766
parent4e48677eee5abf6a7190fc200d3085cc43643322 (diff)
downloadgint-a5774356a1c12d1bcb55b6322710e347e1604fc9.tar.gz
gint-a5774356a1c12d1bcb55b6322710e347e1604fc9.tar.bz2
Bugfixes.
* gint.mk (snarfcppopts): Define even if GINT_COND_DOC is false. This variable is needed for x snarfing as well. * guile.m4 (GINT_CHECK_GUILE) <gint_cv_guile>: Remove. <gint_guile_status>: New var. Invoke $3 if checks were disabled. * README: Update.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--README28
-rw-r--r--gint.mk4
-rw-r--r--guile.m443
3 files changed, 48 insertions, 27 deletions
diff --git a/README b/README
index 9ca2c76..58f9b9f 100644
--- a/README
+++ b/README
@@ -297,8 +297,15 @@ option.
Only one of these four options may be given to a +GINT_INIT+ invocation.
-Here is a more complex example:
+If the check for Guile was disabled at configure time, either by default or
+by the user's request, the action of +GINT_INIT+ depends on whether it had
+been given the +ACTION-IF-NOT-FOUND+ argument. If not, +GINT_INIT+ does
+nothing. Otherwise, the +ACTION-IF-NOT-FOUND+ argument is executed just as
+if Guile has not been found. If you need to discern between various failure
+reasons (`check disabled` vs. `Guile not found` or vs. `Guile version too
+low`), use the <<gint_guile_status, +gint_guile_status+>> variable.
+Here is a more complex example of +GINT_INIT+ usage:
.+GINT_INIT+ macro
-------------------------------------------------------
@@ -379,12 +386,17 @@ By default, set to `yes`. If an <<option-generators, option generating>>
option was used, this variable is set to `no` if the *Guile* checks were
disabled (either by default or by the user request) and to `yes` otherwise.
-gint_cv_guile::
-Set to `yes` if a sufficiently new version of *Guile* was found, and to
-`no` otherwise.
-
-[[gint_cv_guile_debug]]
-gint_cv_guile_debug::
+[[gint_guile_status]]
+gint_guile_status::
+This variable contains the status of the last check. It is `ok`, if the
+check has passed, `badversion` if the Guile version is older than the
+requested minimum and `cantlink` if Guile was found but the attempt to
+link a test program had failed. You may use this variable in the
++ACTION-IF-NOT-FOUND+ argument to +GINT_INIT+ to discern between
+various reasons for failure.
+
+[[gint_guile_debug]]
+gint_guile_debug::
Set if guile supports the debugging macros (i.e. +SCM_DEVAL_P+,
+SCM_BACKTRACE_P+, +SCM_RECORD_POSITIONS_P+ and SCM_RESET_DEBUG_MODE).
@@ -394,7 +406,7 @@ Config.h Defines
GUILE_DEBUG_MACROS::
Defined if guile supports the debugging macros (i.e. +SCM_DEVAL_P+,
+SCM_BACKTRACE_P+, +SCM_RECORD_POSITIONS_P+ and SCM_RESET_DEBUG_MODE).
-See also the <<gint_cv_guile_debug, +gint_cv_guile_debug+>> variable.
+See also the <<gint_guile_debug, +gint_guile_debug+>> variable.
GUILE_VERSION::
Same as the <<GUILE_VERSION, +GUILE_VERSION+>> substitution variable.
diff --git a/gint.mk b/gint.mk
index 74b20ca..7befe5e 100644
--- a/gint.mk
+++ b/gint.mk
@@ -25,6 +25,8 @@ ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_L
SUFFIXES += .x
+snarfcppopts = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+
if GINT_COND_DOC
EXTRA_DIST += guile-procedures.texi guile-procedures.txt
@@ -39,8 +41,6 @@ DISTCLEANFILES += \
SUFFIXES += .doc
-snarfcppopts = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-
if GINT_COND_SNARF_DOC_FILTER
GUILE_DOC_SNARF=$(top_builddir)/$(GINT_MODULE_DIR)/snarf-doc-filter --snarfer
else
diff --git a/guile.m4 b/guile.m4
index a0171a3..f695a21 100644
--- a/guile.m4
+++ b/guile.m4
@@ -31,7 +31,8 @@ AC_DEFUN([GINT_CHECK_GUILE],
AC_SUBST(GUILE_LIBS)
AC_SUBST(GUILE_VERSION)
AC_SUBST(GUILE_VERSION_NUMBER)
- AS_VAR_SET([gint_cv_guile], [no])
+
+ gint_guile_status=no
_GINT_OPTION_SWITCH(
[with-guile],
@@ -74,25 +75,31 @@ AC_DEFUN([GINT_CHECK_GUILE],
VEX=`echo $GUILE_VERSION | sed 's/\./ \\\\* 1000 + /;s/\./ \\\\* 100 + /'`
GUILE_VERSION_NUMBER=`eval expr "$VEX"`
+ gint_guile_status=ok
+
m4_if([$1],,,[
if test $GUILE_VERSION_NUMBER -lt _gint_mangle_version($1); then
- m4_if($3,,
- [AC_MSG_ERROR([Guile version too old; required is at least ]$1)],
- [$3])
+ m4_if([$3],,
+ [AC_MSG_ERROR([Guile version too old; required at least ]$1)],
+ [gint_guile_status=badversion])
fi])
- save_LIBS=$LIBS
- save_CFLAGS=$CFLAGS
- LIBS="$LIBS $GUILE_LIBS"
- CFLAGS="$CFLAGS $GUILE_INCLUDES"
- AC_TRY_LINK([#include <libguile.h>],
- m4_if([$1], , scm_shell(0, NULL);, [$1]),
- [AS_VAR_SET([gint_cv_guile], $GUILE_VERSION)])
- LIBS=$save_LIBS
- CFLAGS=$save_CFLAGS
+ if test $gint_guile_status = ok; then
+ save_LIBS=$LIBS
+ save_CFLAGS=$CFLAGS
+ LIBS="$LIBS $GUILE_LIBS"
+ CFLAGS="$CFLAGS $GUILE_INCLUDES"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <libguile.h>],
+ [scm_shell(0, NULL);])],
+ [],
+ [gint_guile_status=cantlink])
+ LIBS=$save_LIBS
+ CFLAGS=$save_CFLAGS
+ fi
fi
- if test $gint_cv_guile = no; then
+ if test $gint_guile_status != ok; then
GUILE_INCLUDES=
GUILE_LIBS=
GUILE_VERSION=
@@ -108,9 +115,9 @@ AC_DEFUN([GINT_CHECK_GUILE],
SCM_BACKTRACE_P = 1;
SCM_RECORD_POSITIONS_P = 1;
SCM_RESET_DEBUG_MODE;])],
- [gint_cv_guile_debug=yes],
- [gint_cv_guile_debug=no])
- if test $gint_cv_guile_debug = yes; then
+ [gint_guile_debug=yes],
+ [gint_guile_debug=no])
+ if test $gint_guile_debug = yes; then
AC_DEFINE_UNQUOTED(GUILE_DEBUG_MACROS, 1,
[Define to 1 if SCM_DEVAL_P, SCM_BACKTRACE_P, SCM_RECORD_POSITIONS_P and SCM_RESET_DEBUG_MODE are defined])
fi
@@ -145,6 +152,8 @@ AC_DEFUN([GINT_CHECK_GUILE],
[Guile version number: MAX*10 + MIN])
m4_if([$2],,,[$2])
fi
+ m4_if([$3],,,[else
+ $3])
fi
])

Return to:

Send suggestions and report system problems to the System administrator.