gnutls-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnutls-dev] Guile needs 1.8?


From: Ludovic Courtès
Subject: Re: [gnutls-dev] Guile needs 1.8?
Date: Tue, 26 Jun 2007 22:35:34 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Hi,

Simon Josefsson <address@hidden> writes:

> 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.

Hmm, annoying.  I think `guile-1.8-libs' should conflict with
`guile-1.6-dev', although that'd look strange.  The reason is that in
this case, the Guile M4 macros see `guile-config' from 1.6 but see
`guile' from 1.8...

>> 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?

> +      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)

This only fails because `SCM_API' is undefined in 1.6.  Well, that's a
sufficient reason, but not a strong one.

Instead, I prefer the solution below that tries to link against Guile
and check for a function that appeared in 1.8 and will never appear in
1.6.

Does it look ok?

Thanks,
Ludovic.

diff --git a/configure.in b/configure.in
index 4ff951e..9f9da6b 100644
--- a/configure.in
+++ b/configure.in
@@ -311,13 +311,17 @@ if test "x$opt_guile_bindings" = "xyes"; then
       GUILE_PROGS
       GUILE_FLAGS
 
+      save_CFLAGS="$CFLAGS"
+      save_LDFLAGS="$LDFLAGS"
+      CFLAGS="$CFLAGS $GUILE_CFLAGS"
+      LDFLAGS="$LDFLAGS $GUILE_LDFLAGS"
       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)
+      AC_LINK_IFELSE(AC_LANG_CALL([], [scm_from_locale_string]),
+        [], [opt_guile_bindings=no])
+      CFLAGS="$save_CFLAGS"
+      LDFLAGS="$save_LDFLAGS"
 
-      if test "$recent_guile" = yes; then
+      if test "x$opt_guile_bindings" = "xyes"; then
         AC_MSG_RESULT([yes])
        case "x$with_guile_site_dir" in 
             xno)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]