[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gEDA-dev: [PATCH] Autoconf checks for Guile
Hi folks,
I've written a patch which substantially simplifies the checks for Guile, now
that 1.4.x is officially no longer supported.
It's written in portable shell, and should be compatible with cross-compiling.
Rather than checking functionality like the previous tests, it checks for a
specific version, similar to the way that we check for a specific version of
GTK+ & GLib.
Comments appreciated.
Regards,
Peter
--
Fisher Society http://tinyurl.com/o39w2
CU Small-Bore Club http://tinyurl.com/mwrc9
09f911029d74e35bd84156c5635688c0 peter-b.co.uk
Improve Guile configure checks & remove 1.4 compat. code.
From: Peter TB Brett <peter@peter-b.co.uk>
Removes compatibility code for Guile 1.4, and makes configure scripts
check for actual Guile version.
---
gschem/configure.ac.in | 24 ++++++++++++++----------
libgeda/configure.ac | 45 +++++++++++++--------------------------------
libgeda/src/g_basic.c | 4 ----
3 files changed, 27 insertions(+), 46 deletions(-)
diff --git a/gschem/configure.ac.in b/gschem/configure.ac.in
index a0734a2..1743530 100644
--- a/gschem/configure.ac.in
+++ b/gschem/configure.ac.in
@@ -77,21 +77,25 @@ AC_PROG_MAKE_SET
############################################################################
# Check for guile start
-# Do a very basic guile test, as the bulk of the flags will come from
-# libgeda.pc
-
GUILE_FLAGS
-# Manually search for guile-config. This is provided by GUILE_PROGS, but
-# guile-1.4 does not have GUILE_PROGS, so we have to do it manually.
-AC_PATH_PROG(GUILE_CONFIG,guile-config)
-if test "$GUILE_CONFIG" = "" ; then
- AC_MSG_ERROR([guile-config required but not found])
-fi
-AC_SUBST(GUILE_CONFIG)
+# Check Guile version
+guile_need_major=1
+guile_need_minor=8
+guile_need_version="$guile_need_major[].$guile_need_minor.0"
+AC_MSG_CHECKING([Guile version >= $guile_need_version])
GUILE_VERSION=`$GUILE_CONFIG info guileversion`
+guile_major=`echo "$GUILE_VERSION" | sed 's/\([[^.]][[^.]]*\).*/\1/'`
+guile_minor=`echo "$GUILE_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
+AC_MSG_RESULT($GUILE_VERSION)
+
+if test $guile_need_major -gt $guile_major \
+ || test $guile_need_minor -gt $guile_minor; then
+ AC_MSG_ERROR([Guile version >= $guile_need_version is required.])
+fi
+
#
# Check for guile end
############################################################################
diff --git a/libgeda/configure.ac b/libgeda/configure.ac
index 385b48d..6388554 100644
--- a/libgeda/configure.ac
+++ b/libgeda/configure.ac
@@ -75,41 +75,22 @@ AC_PROG_MAKE_SET
#
GUILE_FLAGS
-# Manually search for guile-config. This is provided by GUILE_PROGS, but
-# guile-1.4 does not have GUILE_PROGS, so we have to do it manually.
-AC_PATH_PROG(GUILE_CONFIG,guile-config)
-if test "$GUILE_CONFIG" = "" ; then
- AC_MSG_ERROR([guile-config required but not found])
-fi
-AC_SUBST(GUILE_CONFIG)
-
-# must have guile flags in CFLAGS for AC_COMPILE_IFELSE to work right
-saved_CFLAGS="${CFLAGS}"
-CFLAGS="${CFLAGS} ${GUILE_CFLAGS}"
-
-# 1-argument scm_eval_x (guile-1.4) or 2-argument form (guile-1.6)?
-AC_MSG_CHECKING(
- [if scm_eval_x() takes a second module argument])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libguile.h>]],
- [[SCM foo,bar; scm_eval_x(foo,bar);]])],
- [AC_DEFINE([HAVE_SCM_EVAL_X_MODULE], 1,
- [Define if the SCM_EVAL_X function takes a second argument "module"])
- AC_MSG_RESULT(yes) ], [AC_MSG_RESULT(no)])
-CFLAGS="${saved_CFLAGS}"
-
-# Check some Guile functions are available
-AC_CHECK_LIB(guile, scm_init_guile)
+# Check Guile version
+guile_need_major=1
+guile_need_minor=8
+guile_need_version="$guile_need_major[].$guile_need_minor.0"
-AC_CHECK_FUNCS([scm_make_smob_type scm_set_smob_mark scm_set_smob_free scm_set_smob_print],,
- [AC_MSG_ERROR([Upgrade Guile, at least version >= 1.8.0])])
-
-AC_CHECK_FUNCS([scm_from_locale_string],,
- [AC_MSG_ERROR([Upgrade Guile, at least version >= 1.8.0])])
+AC_MSG_CHECKING([Guile version >= $guile_need_version])
+GUILE_VERSION=`$GUILE_CONFIG info guileversion`
-# Restore LIBS. Apparently AC_CHECK_LIB destroys it.
-LIBS="$ac_save_LIBS"
+guile_major=`echo "$GUILE_VERSION" | sed 's/\([[^.]][[^.]]*\).*/\1/'`
+guile_minor=`echo "$GUILE_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
+AC_MSG_RESULT($GUILE_VERSION)
-GUILE_VERSION=`$GUILE_CONFIG info guileversion`
+if test $guile_need_major -gt $guile_major \
+ || test $guile_need_minor -gt $guile_minor; then
+ AC_MSG_ERROR([Guile version >= $guile_need_version is required.])
+fi
#
# Check for guile end
diff --git a/libgeda/src/g_basic.c b/libgeda/src/g_basic.c
index 64c269e..087c2e2 100644
--- a/libgeda/src/g_basic.c
+++ b/libgeda/src/g_basic.c
@@ -77,11 +77,7 @@ static SCM load (void *data)
eof_found = 1;
} else {
most_recently_read_form = form;
-#ifdef HAVE_SCM_EVAL_X_MODULE
scm_eval_x (form, scm_current_module() );
-#else
- scm_eval_x (form);
-#endif
}
}
PGP signature
_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev