diff options
-rw-r--r-- | README | 28 | ||||
-rw-r--r-- | gint.mk | 4 | ||||
-rw-r--r-- | guile.m4 | 43 |
3 files changed, 48 insertions, 27 deletions
@@ -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. @@ -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 @@ -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 ]) |