aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--Makefile.am4
-rw-r--r--am/guile.m485
-rw-r--r--bootstrap.conf3
-rw-r--r--configure.ac33
m---------gint0
-rw-r--r--src/Makefile.am2
-rw-r--r--src/guile.c16
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
21ACLOCAL_AMFLAGS = -I m4 -I am 21ACLOCAL_AMFLAGS = -I m4 -I am -I gint
22SUBDIRS = build lib src po doc scripts examples guile contrib \ 22SUBDIRS = 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 @@
1dnl This file is part of GNU mailutils.
2dnl Copyright (C) 2001, 2006, 2007, 2010 Free Software Foundation, Inc.
3dnl
4dnl This program is free software; you can redistribute it and/or modify
5dnl it under the terms of the GNU General Public License as published by
6dnl the Free Software Foundation; either version 3 of the License, or
7dnl (at your option) any later version.
8dnl
9dnl This program is distributed in the hope that it will be useful,
10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12dnl GNU General Public License for more details.
13dnl
14dnl You should have received a copy of the GNU General Public License
15dnl along with this program; if not, write to the Free Software Foundation,
16dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17dnl
18
19dnl MU_CHECK_GUILE(minversion, [act-if-found], [ac-if-not-found])
20dnl $1 $2 $3
21AC_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' ' '` $*"
4fi 4fi
5 5
6git submodule init
7git submodule update
8
6gnulib_name=libanubis 9gnulib_name=libanubis
7gnulib_modules=`grep '^[^#]' gnulib.modules` 10gnulib_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([
82AC_CHECK_LIB(socket, socket) 82AC_CHECK_LIB(socket, socket)
83AC_CHECK_LIB(nsl, gethostbyaddr) 83AC_CHECK_LIB(nsl, gethostbyaddr)
84 84
85AC_SUBST(INCLUDES) 85AC_SUBST(ADD_INCLUDES)
86case $build in 86case $build in
87 *-apple-darwin*) 87 *-apple-darwin*)
88 INCLUDES="$INCLUDES -I/usr/include" ;; 88 ADD_INCLUDES="$ADD_INCLUDES -I/usr/include" ;;
89esac 89esac
90 90
91dnl Internationalization macros. 91dnl 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) ;;
104esac],[useguile=yes]) 104esac],[useguile=yes])
105 105
106AC_SUBST(M4_DEFS) 106AC_SUBST([M4_DEFS])
107 107AC_SUBST([GUILE_SCRIPTS])
108AC_SUBST(GUILE_INCLUDES)
109AC_SUBST(GUILE_LIBS)
110AC_SUBST(GUILE_BINDIR)
111AC_SUBST(GUILE_SNARF_VERSION)
112AC_SUBST(GUILE_SCRIPTS)
113if test x"$useguile" = x"yes"; then 108if 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])
126fi 114fi
127if test x"$useguile" = x"no"; then 115if 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
97localedir = $(datadir)/locale 97localedir = $(datadir)/locale
98DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\" 98DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\"
99INCLUDES = @INCLUDES@ @LIBGNUTLS_CFLAGS@ -I$(top_srcdir)/lib 99INCLUDES = @ADD_INCLUDES@ @LIBGNUTLS_CFLAGS@ -I$(top_srcdir)/lib
100SUFFIXES=.opt .c 100SUFFIXES=.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
44static SCM 43static SCM
45scheme_safe_exec_body (void *data) 44scheme_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
52static int 50static 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;
56 struct scheme_exec_data ed; 54 struct scheme_exec_data ed;
57 55 SCM res;
56
58 if (setjmp(jmp_env))