aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-05-11 16:20:03 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2010-05-11 16:20:03 +0300
commita5774356a1c12d1bcb55b6322710e347e1604fc9 (patch)
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.
-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.
297 297
298Only one of these four options may be given to a +GINT_INIT+ invocation. 298Only one of these four options may be given to a +GINT_INIT+ invocation.
299 299
300Here is a more complex example: 300If the check for Guile was disabled at configure time, either by default or
301by the user's request, the action of +GINT_INIT+ depends on whether it had
302been given the +ACTION-IF-NOT-FOUND+ argument. If not, +GINT_INIT+ does
303nothing. Otherwise, the +ACTION-IF-NOT-FOUND+ argument is executed just as
304if Guile has not been found. If you need to discern between various failure
305reasons (`check disabled` vs. `Guile not found` or vs. `Guile version too
306low`), use the <<gint_guile_status, +gint_guile_status+>> variable.
301 307
308Here is a more complex example of +GINT_INIT+ usage:
302 309
303.+GINT_INIT+ macro 310.+GINT_INIT+ macro
304------------------------------------------------------- 311-------------------------------------------------------
@@ -379,12 +386,17 @@ By default, set to `yes`. If an <<option-generators, option generating>>
379option was used, this variable is set to `no` if the *Guile* checks were 386option was used, this variable is set to `no` if the *Guile* checks were
380disabled (either by default or by the user request) and to `yes` otherwise. 387disabled (either by default or by the user request) and to `yes` otherwise.
381 388
382gint_cv_guile:: 389[[gint_guile_status]]
383Set to `yes` if a sufficiently new version of *Guile* was found, and to 390gint_guile_status::
384`no` otherwise. 391This variable contains the status of the last check. It is `ok`, if the
385 392check has passed, `badversion` if the Guile version is older than the
386[[gint_cv_guile_debug]] 393requested minimum and `cantlink` if Guile was found but the attempt to
387gint_cv_guile_debug:: 394link a test program had failed. You may use this variable in the
395+ACTION-IF-NOT-FOUND+ argument to +GINT_INIT+ to discern between
396various reasons for failure.
397
398[[gint_guile_debug]]
399gint_guile_debug::
388Set if guile supports the debugging macros (i.e. +SCM_DEVAL_P+, 400Set if guile supports the debugging macros (i.e. +SCM_DEVAL_P+,
389+SCM_BACKTRACE_P+, +SCM_RECORD_POSITIONS_P+ and SCM_RESET_DEBUG_MODE). 401+SCM_BACKTRACE_P+, +SCM_RECORD_POSITIONS_P+ and SCM_RESET_DEBUG_MODE).
390 402
@@ -394,7 +406,7 @@ Config.h Defines
394GUILE_DEBUG_MACROS:: 406GUILE_DEBUG_MACROS::
395Defined if guile supports the debugging macros (i.e. +SCM_DEVAL_P+, 407Defined if guile supports the debugging macros (i.e. +SCM_DEVAL_P+,
396+SCM_BACKTRACE_P+, +SCM_RECORD_POSITIONS_P+ and SCM_RESET_DEBUG_MODE). 408+SCM_BACKTRACE_P+, +SCM_RECORD_POSITIONS_P+ and SCM_RESET_DEBUG_MODE).
397See also the <<gint_cv_guile_debug, +gint_cv_guile_debug+>> variable. 409See also the <<gint_guile_debug, +gint_guile_debug+>> variable.
398 410
399GUILE_VERSION:: 411GUILE_VERSION::
400Same as the <<GUILE_VERSION, +GUILE_VERSION+>> substitution variable. 412Same 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
25 25
26SUFFIXES += .x 26SUFFIXES += .x
27 27
28snarfcppopts = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
29
28if GINT_COND_DOC 30if GINT_COND_DOC
29EXTRA_DIST += guile-procedures.texi guile-procedures.txt 31EXTRA_DIST += guile-procedures.texi guile-procedures.txt
30 32
@@ -39,8 +41,6 @@ DISTCLEANFILES += \
39 41
40SUFFIXES += .doc 42SUFFIXES += .doc
41 43
42snarfcppopts = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
43
44if GINT_COND_SNARF_DOC_FILTER 44if GINT_COND_SNARF_DOC_FILTER
45GUILE_DOC_SNARF=$(top_builddir)/$(GINT_MODULE_DIR)/snarf-doc-filter --snarfer 45GUILE_DOC_SNARF=$(top_builddir)/$(GINT_MODULE_DIR)/snarf-doc-filter --snarfer
46else 46else
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],
31 AC_SUBST(GUILE_LIBS) 31 AC_SUBST(GUILE_LIBS)
32 AC_SUBST(GUILE_VERSION) 32 AC_SUBST(GUILE_VERSION)
33 AC_SUBST(GUILE_VERSION_NUMBER) 33 AC_SUBST(GUILE_VERSION_NUMBER)
34 AS_VAR_SET([gint_cv_guile], [no]) 34
35 gint_guile_status=no
35 36
36 _GINT_OPTION_SWITCH( 37 _GINT_OPTION_SWITCH(
37 [with-guile], 38 [with-guile],
@@ -74,25 +75,31 @@ AC_DEFUN([GINT_CHECK_GUILE],
74 VEX=`echo $GUILE_VERSION | sed 's/\./ \\\\* 1000 + /;s/\./ \\\\* 100 + /'` 75 VEX=`echo $GUILE_VERSION | sed 's/\./ \\\\* 1000 + /;s/\./ \\\\* 100 + /'`
75 GUILE_VERSION_NUMBER=`eval expr "$VEX"` 76 GUILE_VERSION_NUMBER=`eval expr "$VEX"`
76 77
78 gint_guile_status=ok
79
77 m4_if([$1],,,[ 80 m4_if([$1],,,[
78 if test $GUILE_VERSION_NUMBER -lt _gint_mangle_version($1); then 81 if test $GUILE_VERSION_NUMBER -lt _gint_mangle_version($1); then
79 m4_if($3,, 82 m4_if([$3],,
80 [AC_MSG_ERROR([Guile version too old; required is at least ]$1)], 83 [AC_MSG_ERROR([Guile version too old; required at least ]$1)],
81 [$3]) 84 [gint_guile_status=badversion])
82 fi]) 85 fi])
83 86
84 save_LIBS=$LIBS 87 if test $gint_guile_status = ok; then
85 save_CFLAGS=$CFLAGS 88 save_LIBS=$LIBS
86 LIBS="$LIBS $GUILE_LIBS" 89 save_CFLAGS=$CFLAGS
87 CFLAGS="$CFLAGS $GUILE_INCLUDES" 90 LIBS="$LIBS $GUILE_LIBS"
88 AC_TRY_LINK([#include <libguile.h>], 91 CFLAGS="$CFLAGS $GUILE_INCLUDES"
89 m4_if([$1], , scm_shell(0, NULL);, [$1]), 92 AC_LINK_IFELSE(
90 [AS_VAR_SET([gint_cv_guile], $GUILE_VERSION)]) 93 [AC_LANG_PROGRAM([#include <libguile.h>],
91 LIBS=$save_LIBS 94 [scm_shell(0, NULL);])],
92 CFLAGS=$save_CFLAGS 95 [],
96 [gint_guile_status=cantlink])
97 LIBS=$save_LIBS
98 CFLAGS=$save_CFLAGS
99 fi
93 fi 100 fi
94 101
95 if test $gint_cv_guile = no; then 102 if test $gint_guile_status != ok; then
96 GUILE_INCLUDES= 103 GUILE_INCLUDES=
97 GUILE_LIBS= 104 GUILE_LIBS=
98 GUILE_VERSION= 105 GUILE_VERSION=
@@ -108,9 +115,9 @@ AC_DEFUN([GINT_CHECK_GUILE],
108 SCM_BACKTRACE_P = 1; 115 SCM_BACKTRACE_P = 1;
109 SCM_RECORD_POSITIONS_P = 1; 116 SCM_RECORD_POSITIONS_P = 1;
110 SCM_RESET_DEBUG_MODE;])], 117 SCM_RESET_DEBUG_MODE;])],
111 [gint_cv_guile_debug=yes], 118 [gint_guile_debug=yes],
112 [gint_cv_guile_debug=no]) 119 [gint_guile_debug=no])
113 if test $gint_cv_guile_debug = yes; then 120 if test $gint_guile_debug = yes; then
114 AC_DEFINE_UNQUOTED(GUILE_DEBUG_MACROS, 1, 121 AC_DEFINE_UNQUOTED(GUILE_DEBUG_MACROS, 1,
115 [Define to 1 if SCM_DEVAL_P, SCM_BACKTRACE_P, SCM_RECORD_POSITIONS_P and SCM_RESET_DEBUG_MODE are defined]) 122 [Define to 1 if SCM_DEVAL_P, SCM_BACKTRACE_P, SCM_RECORD_POSITIONS_P and SCM_RESET_DEBUG_MODE are defined])
116 fi 123 fi
@@ -145,6 +152,8 @@ AC_DEFUN([GINT_CHECK_GUILE],
145 [Guile version number: MAX*10 + MIN]) 152 [Guile version number: MAX*10 + MIN])
146 m4_if([$2],,,[$2]) 153 m4_if([$2],,,[$2])
147 fi 154 fi
155 m4_if([$3],,,[else
156 $3])
148 fi 157 fi
149]) 158])
150 159

Return to:

Send suggestions and report system problems to the System administrator.