diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-04-19 11:02:12 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-04-19 11:02:12 +0300 |
commit | 884c5ffde12904a7ccf394eb31c5e7cf13ce554c (patch) | |
tree | a1711a6950a79f59a2c179ece9df54c3f8975872 | |
parent | c5416aa2097f666cfc7701210872000871f65abb (diff) | |
download | anubis-884c5ffde12904a7ccf394eb31c5e7cf13ce554c.tar.gz anubis-884c5ffde12904a7ccf394eb31c5e7cf13ce554c.tar.bz2 |
Use GINT for integrating with Guile.
* gint: New module.
* Makefile.am, configure.ac: Use gint.
* bootstrap.conf: Initialize git submodules.
* src/Makefile.am: Include gint.mk
* am/guile.m4: Remove.
* src/guile.c (guile_safe_exec): Use scm_c_catch instead of
the deprecated scm_internal_lazy_catch.
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | am/guile.m4 | 85 | ||||
-rw-r--r-- | bootstrap.conf | 3 | ||||
-rw-r--r-- | configure.ac | 33 | ||||
m--------- | gint | 0 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/guile.c | 16 |
8 files changed, 28 insertions, 118 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7c369d4 --- /dev/null +++ b/.gitmodules | |||
@@ -0,0 +1,3 @@ | |||
1 | [submodule "gint"] | ||
2 | path = gint | ||
3 | url = git://git.gnu.org.ua/gint.git | ||
diff --git a/Makefile.am b/Makefile.am index 95190d6..d11a38d 100644 --- a/Makefile.am +++ b/Makefile.am | |||
@@ -18,8 +18,8 @@ | |||
18 | ## with GNU Anubis. If not, see <http://www.gnu.org/licenses/>. | 18 | ## with GNU Anubis. If not, see <http://www.gnu.org/licenses/>. |
19 | ## | 19 | ## |
20 | 20 | ||
21 | ACLOCAL_AMFLAGS = -I m4 -I am | 21 | ACLOCAL_AMFLAGS = -I m4 -I am -I gint |
22 | SUBDIRS = build lib src po doc scripts examples guile contrib \ | 22 | SUBDIRS = build lib gint src po doc scripts examples guile contrib \ |
23 | elisp testsuite | 23 | elisp testsuite |
24 | 24 | ||
25 | .PHONY: make-ChangeLog | 25 | .PHONY: make-ChangeLog |
diff --git a/am/guile.m4 b/am/guile.m4 deleted file mode 100644 index 8841a6a..0000000 --- a/am/guile.m4 +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | dnl This file is part of GNU mailutils. | ||
2 | dnl Copyright (C) 2001, 2006, 2007, 2010 Free Software Foundation, Inc. | ||
3 | dnl | ||
4 | dnl This program is free software; you can redistribute it and/or modify | ||
5 | dnl it under the terms of the GNU General Public License as published by | ||
6 | dnl the Free Software Foundation; either version 3 of the License, or | ||
7 | dnl (at your option) any later version. | ||
8 | dnl | ||
9 | dnl This program is distributed in the hope that it will be useful, | ||
10 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | dnl GNU General Public License for more details. | ||
13 | dnl | ||
14 | dnl You should have received a copy of the GNU General Public License | ||
15 | dnl along with this program; if not, write to the Free Software Foundation, | ||
16 | dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | dnl | ||
18 | |||
19 | dnl MU_CHECK_GUILE(minversion, [act-if-found], [ac-if-not-found]) | ||
20 | dnl $1 $2 $3 | ||
21 | AC_DEFUN([MU_CHECK_GUILE], | ||
22 | [ | ||
23 | AS_VAR_SET([mu_cv_guile], [no]) | ||
24 | AC_PATH_PROG(GUILE_CONFIG, guile-config, no, $PATH) | ||
25 | if test "$GUILE_CONFIG" = no; then | ||
26 | m4_if([$3],,[AC_MSG_ERROR(cannot find Guile)], [$3]) | ||
27 | else | ||
28 | AC_SUBST(GUILE_INCLUDES) | ||
29 | AC_SUBST(GUILE_LIBS) | ||
30 | AC_SUBST(GUILE_VERSION) | ||
31 | AC_SUBST(GUILE_VERSION_NUMBER) | ||
32 | |||
33 | GUILE_INCLUDES=`$GUILE_CONFIG compile` | ||
34 | GUILE_LIBS=`$GUILE_CONFIG link` | ||
35 | GUILE_VERSION=`($GUILE_CONFIG --version 2>&1; echo '')|sed 's/guile-config [[^0-9]]* \([[0-9]][[0-9.]]*\)$/\1/'` | ||
36 | VEX=`echo $GUILE_VERSION | sed 's/\./ \\\\* 1000 + /;s/\./ \\\\* 100 + /'` | ||
37 | GUILE_VERSION_NUMBER=`eval expr "$VEX"` | ||
38 | |||
39 | m4_if([$1],,,[ | ||
40 | VEX=`echo $1 | sed 's/\./ \\\\* 1000 + /;s/\./ \\\\* 100 + /'` | ||
41 | min=`eval expr "$VEX"` | ||
42 | if test $GUILE_VERSION_NUMBER -lt $min; then | ||
43 | m4_if([$3],, | ||
44 | [AC_MSG_ERROR([Guile version too old; required is at least ]$1)], | ||
45 | [$3]) | ||
46 | fi]) | ||
47 | |||
48 | save_LIBS=$LIBS | ||
49 | save_CFLAGS=$CFLAGS | ||
50 | LIBS="$LIBS $GUILE_LIBS" | ||
51 | CFLAGS="$CFLAGS $GUILE_INCLUDES" | ||
52 | AC_TRY_LINK([#include <libguile.h>], | ||
53 | m4_if([$1], , scm_shell(0, NULL);, [$1]), | ||
54 | [AS_VAR_SET([mu_cv_guile], $GUILE_VERSION)]) | ||
55 | LIBS=$save_LIBS | ||
56 | CFLAGS=$save_CFLAGS | ||
57 | fi | ||
58 | |||
59 | if test $mu_cv_guile = no; then | ||
60 | GUILE_INCLUDES= | ||
61 | GUILE_LIBS= | ||
62 | GUILE_VERSION= | ||
63 | GUILE_VERSION_NUMBER= | ||
64 | m4_if($3,,[AC_MSG_ERROR(required library libguile not found)], [$3]) | ||
65 | else | ||
66 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libguile.h>]], | ||
67 | [SCM_DEVAL_P = 1; | ||
68 | SCM_BACKTRACE_P = 1; | ||
69 | SCM_RECORD_POSITIONS_P = 1; | ||
70 | SCM_RESET_DEBUG_MODE;])], | ||
71 | [mu_cv_guile_debug=yes], | ||
72 | [mu_cv_guile_debug=no]) | ||
73 | if test $mu_cv_guile_debug = yes; then | ||
74 | AC_DEFINE_UNQUOTED([GUILE_DEBUG_MACROS], 1, | ||
75 | [Define to 1 if SCM_DEVAL_P, SCM_BACKTRACE_P, SCM_RECORD_POSITIONS_P and SCM_RESET_DEBUG_MODE are defined]) | ||
76 | fi | ||
77 | AC_CHECK_TYPES([scm_t_off],[],[],[#include <libguile.h>]) | ||
78 | AC_DEFINE_UNQUOTED([GUILE_VERSION], "$GUILE_VERSION", | ||
79 | [Guile version number]) | ||
80 | AC_DEFINE_UNQUOTED([GUILE_VERSION_NUMBER], $GUILE_VERSION_NUMBER, | ||
81 | [Guile version number: MAX*10 + MIN]) | ||
82 | m4_if([$2],,,[$2]) | ||
83 | fi | ||
84 | ]) | ||
85 | |||
diff --git a/bootstrap.conf b/bootstrap.conf index f6e5dac..9589b64 100644 --- a/bootstrap.conf +++ b/bootstrap.conf | |||
@@ -3,6 +3,9 @@ if [ -r .bootstrap ]; then | |||
3 | eval set -- "`sed 's/#.*$//;/^$/d' .bootstrap | tr '\n' ' '` $*" | 3 | eval set -- "`sed 's/#.*$//;/^$/d' .bootstrap | tr '\n' ' '` $*" |
4 | fi | 4 | fi |
5 | 5 | ||
6 | git submodule init | ||
7 | git submodule update | ||
8 | |||
6 | gnulib_name=libanubis | 9 | gnulib_name=libanubis |
7 | gnulib_modules=`grep '^[^#]' gnulib.modules` | 10 | gnulib_modules=`grep '^[^#]' gnulib.modules` |
8 | 11 | ||
diff --git a/configure.ac b/configure.ac index 9947012..cf6c2fd 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -82,10 +82,10 @@ AH_BOTTOM([ | |||
82 | AC_CHECK_LIB(socket, socket) | 82 | AC_CHECK_LIB(socket, socket) |
83 | AC_CHECK_LIB(nsl, gethostbyaddr) | 83 | AC_CHECK_LIB(nsl, gethostbyaddr) |
84 | 84 | ||
85 | AC_SUBST(INCLUDES) | 85 | AC_SUBST(ADD_INCLUDES) |
86 | case $build in | 86 | case $build in |
87 | *-apple-darwin*) | 87 | *-apple-darwin*) |
88 | INCLUDES="$INCLUDES -I/usr/include" ;; | 88 | ADD_INCLUDES="$ADD_INCLUDES -I/usr/include" ;; |
89 | esac | 89 | esac |
90 | 90 | ||
91 | dnl Internationalization macros. | 91 | dnl Internationalization macros. |
@@ -103,26 +103,14 @@ case "${withval}" in | |||
103 | *) AC_MSG_ERROR(bad value ${withval} for --without-guile) ;; | 103 | *) AC_MSG_ERROR(bad value ${withval} for --without-guile) ;; |
104 | esac],[useguile=yes]) | 104 | esac],[useguile=yes]) |
105 | 105 | ||
106 | AC_SUBST(M4_DEFS) | 106 | AC_SUBST([M4_DEFS]) |
107 | 107 | AC_SUBST([GUILE_SCRIPTS]) | |
108 | AC_SUBST(GUILE_INCLUDES) | ||
109 | AC_SUBST(GUILE_LIBS) | ||
110 | AC_SUBST(GUILE_BINDIR) | ||
111 | AC_SUBST(GUILE_SNARF_VERSION) | ||
112 | AC_SUBST(GUILE_SCRIPTS) | ||
113 | if test x"$useguile" = x"yes"; then | 108 | if test x"$useguile" = x"yes"; then |
114 | MU_CHECK_GUILE(,[ | 109 | GINT_INIT([gint],[1.8 nodoc std-site-dir], |
115 | AC_DEFINE(WITH_GUILE,1,[Enable Guile support]) | 110 | [AC_DEFINE(WITH_GUILE,1,[Enable Guile support]) |
116 | GUILE_INCLUDES=`guile-config compile` | 111 | GUILE_SCRIPTS='$(GUILE_SCM)' |
117 | GUILE_LIBS=`guile-config link` | 112 | M4_DEFS="$M4_DEFS -DWITH_GUILE"], |
118 | GUILE_BINDIR=`guile-config info bindir` | 113 | [useguile=no]) |
119 | GUILE_SCRIPTS='$(GUILE_SCM)' | ||
120 | M4_DEFS="$M4_DEFS -DWITH_GUILE" | ||
121 | case "$GUILE_VERSION" in | ||
122 | 16|17) GUILE_SNARF_VERSION="1.6";; | ||
123 | *) GUILE_SNARF_VERSION="1.6";; | ||
124 | esac | ||
125 | ],[useguile=no]) | ||
126 | fi | 114 | fi |
127 | if test x"$useguile" = x"no"; then | 115 | if test x"$useguile" = x"no"; then |
128 | AC_MSG_RESULT([Disabling GUILE support...]) | 116 | AC_MSG_RESULT([Disabling GUILE support...]) |
@@ -148,7 +136,7 @@ else | |||
148 | findgpgmedir() { : | 136 | findgpgmedir() { : |
149 | if test -f "$1/include/gpgme.h"; then | 137 | if test -f "$1/include/gpgme.h"; then |
150 | gpgmedir=1 | 138 | gpgmedir=1 |
151 | INCLUDES="$INCLUDES -I$1/include" | 139 | ADD_INCLUDES="$ADD_INCLUDES -I$1/include" |
152 | AC_MSG_CHECKING(for $1/include/gpgme.h) | 140 | AC_MSG_CHECKING(for $1/include/gpgme.h) |
153 | AC_MSG_RESULT([yes]) | 141 | AC_MSG_RESULT([yes]) |
154 | return 0 | 142 | return 0 |
@@ -414,6 +402,7 @@ AC_CONFIG_FILES([Makefile | |||
414 | build/Makefile | 402 | build/Makefile |
415 | build/guile-1.6/Makefile | 403 | build/guile-1.6/Makefile |
416 | contrib/Makefile | 404 | contrib/Makefile |
405 | gint/Makefile | ||
417 | doc/Makefile | 406 | doc/Makefile |
418 | elisp/Makefile | 407 | elisp/Makefile |
419 | examples/Makefile | 408 | examples/Makefile |
diff --git a/gint b/gint new file mode 160000 | |||
Subproject 4254b0590e609b82dac3d688ecb401c9eefb7e2 | |||
diff --git a/src/Makefile.am b/src/Makefile.am index 3c04b95..3ac2331 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -96,7 +96,7 @@ BUILT_SOURCES = env.c | |||
96 | 96 | ||
97 | localedir = $(datadir)/locale | 97 | localedir = $(datadir)/locale |
98 | DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\" | 98 | DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\" |
99 | INCLUDES = @INCLUDES@ @LIBGNUTLS_CFLAGS@ -I$(top_srcdir)/lib | 99 | INCLUDES = @ADD_INCLUDES@ @LIBGNUTLS_CFLAGS@ -I$(top_srcdir)/lib |
100 | SUFFIXES=.opt .c | 100 | SUFFIXES=.opt .c |
101 | 101 | ||
102 | .opt.c: | 102 | .opt.c: |
diff --git a/src/guile.c b/src/guile.c index 6af115e..dbba3a9 100644 --- a/src/guile.c +++ b/src/guile.c | |||
@@ -38,15 +38,13 @@ struct scheme_exec_data | |||
38 | { | 38 | { |
39 | SCM (*handler) (void *data); | 39 | SCM (*handler) (void *data); |
40 | void *data; | 40 | void *data; |
41 | SCM result; | ||
42 | }; | 41 | }; |
43 | 42 | ||
44 | static SCM | 43 | static SCM |
45 | scheme_safe_exec_body (void *data) | 44 | scheme_safe_exec_body (void *data) |
46 | { | 45 | { |
47 | struct scheme_exec_data *ed = data; | 46 | struct scheme_exec_data *ed = data; |
48 | ed->result = ed->handler (ed->data); | 47 | return ed->handler (ed->data); |
49 | return SCM_BOOL_F; | ||
50 | } | 48 | } |
51 | 49 | ||
52 | static int | 50 | static int |
@@ -54,16 +52,18 @@ guile_safe_exec (SCM (*handler) (void *data), void *data, SCM *result) | |||
54 | { | 52 | { |
55 | jmp_buf jmp_env; | 53 | jmp_buf jmp_env; |