[gnutls-dev] Guile needs 1.8?

Simon Josefsson simon at josefsson.org
Tue Jun 26 15:41:17 CEST 2007


ludo at chbouib.org (Ludovic Courtès) writes:

>>> I'll add a more reliable test anyway.
>
> See attached patch: It basically uses Guile's `version' procedure to
> check whether we are using 1.8 or later.

I noticed now that this didn't work...  on my system, the command
'guile' is 1.8, but the guile-dev package is 1.6.  The test only checks
that the tool is recent enough, but doesn't test the header files (which
were the ones that failed).

jas at mocca:~/src/gnutls$ dpkg -l|grep guile
ii  guile-1.6                                1.6.8-6                         The GNU extension language and Scheme interp
ii  guile-1.6-dev                            1.6.8-6                         Development files for Guile 1.6
ii  guile-1.6-libs                           1.6.8-6                         Main Guile libraries
ii  guile-1.6-slib                           1.6.8-6                         Guile SLIB support
ii  guile-1.8                                1.8.1+1-4                       The GNU extension language and Scheme interp
ii  guile-1.8-libs                           1.8.1+1-4                       Main Guile libraries
ii  guile-g-wrap                             1.9.6-3.1                       scripting interface generator for C - Guile
ii  guile-library                            0.1.2-1                         Library of useful Guile modules
ii  libguile-ltdl-1                          1.6.8-6                         Guile's patched version of libtool's libltdl
jas at mocca:~/src/gnutls$

>> Perhaps a test for the feature that seems to break things here?
>> SCM_API, scm_t_bits, or whatever it might have been.
>
> No.  Those types and macros are actually defined in 1.6 as well.  It
> just turned out that for some reason their definitions were not visible.
>
> Anyway, such a feature test wouldn't help since 1.6 and 1.8 are
> significantly different API-wise.

So, I still think it is better to test for some particular feature in
the guile header files that is required by the guile bindings, which is
available in v1.8 but not in v1.6.  I installed the patch below, what do
you think?

/Simon

commit 6b1da319e3997386458242d50a6a14c71af81873
Author: Simon Josefsson <simon at josefsson.org>
Date:   Tue Jun 26 15:24:15 2007 +0200

    Check that the guile header files is recent enough and that it works.

diff --git a/NEWS b/NEWS
index 5761d8c..3c6c3a6 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,11 @@ See the end for copying conditions.
 
 * Version 1.7.15 (unreleased)
 
+** Test that the Guile header files are recent enough to work.
+Before we just tested that the command line tool 'guile' was recent
+enough, which may not be sufficient if you still have an old
+libguile.h header installed.
+
 ** Guile bindings are now installed under $prefix by default.
 Use --without-guile-site-dir to install it under $pkgdatadir/site/
 where $pkgdatadir is as returned by "guile-config info pkgdatadir".
diff --git a/configure.in b/configure.in
index f38838d..4ff951e 100644
--- a/configure.in
+++ b/configure.in
@@ -311,11 +311,13 @@ if test "x$opt_guile_bindings" = "xyes"; then
       GUILE_PROGS
       GUILE_FLAGS
 
-      AC_MSG_CHECKING([whether GNU Guile 1.8 or later is available])
-      GUILE_CHECK([is_guile_1_8],
-         [(exit (string>=? (version) (number->string 1.8)))])
+      AC_MSG_CHECKING([whether GNU Guile is recent enough])
+      AC_COMPILE_IFELSE(AC_LANG_PROGRAM([
+	#include <libguile.h>
+SCM_API scm_t_bits scm_tc16_gnutls_cipher_enum;]),
+	recent_guile=yes,recent_guile=no)
 
-      if test $is_guile_1_8 -eq 0; then
+      if test "$recent_guile" = yes; then
         AC_MSG_RESULT([yes])
 	case "x$with_guile_site_dir" in 
 	     xno)
@@ -337,7 +339,7 @@ if test "x$opt_guile_bindings" = "xyes"; then
 	esac
       else
         AC_MSG_RESULT([no])
-        AC_MSG_WARN([GNU Guile 1.8 or later is required.  Guile bindings not built.])
+        AC_MSG_WARN([A sufficiently recent GNU Guile not found.  Guile bindings not built.])
         opt_guile_bindings=no
       fi
    fi




More information about the Gnutls-devel mailing list