Commit 0b519f34 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Libtarot is optional

The goal is to have the symbol =tarot_guile_init= work with guile only
if it is available.  Otherwise, this function does nothing.

This does not mean that libtarot uses guile.  It only means that if
guile is available, you can load this lib with guile and call the
function to register the Guile functions.
parent 0f87aeb1
......@@ -137,7 +137,14 @@ AC_ARG_WITH([static_program_name],
AS_IF([test "x$with_static_program_name" != "xno"], [
CPPFLAGS="$CPPFLAGS -Dprogram_name=tarot_libtarot_program_name"
])
PKG_CHECK_MODULES([GUILE], [guile-2.2],, [PKG_CHECK_MODULES([GUILE], [guile-2.0])])
HAVE_GUILE="1"
PKG_CHECK_MODULES([GUILE], [guile-2.2],, [
PKG_CHECK_MODULES([GUILE], [guile-2.0],, [
HAVE_GUILE="0"
])
])
AC_DEFINE_UNQUOTED(HAVE_GUILE, $HAVE_GUILE, [Whether the tarot_guile_init () function works with guile])
AM_CONDITIONAL([HAVE_GUILE], [test "x$HAVE_GUILE" != "x0"])
# Checks for header files.
AC_HEADER_STDBOOL
......
......@@ -32,6 +32,8 @@ static char *libtarot_localedir = NULL;
static char *libtarot_datadir = NULL;
static char *libtarot_pkgdatadir = NULL;
int tarot_libtarot_with_guile = HAVE_GUILE;
static void
tarot_set_localedir (const char *localedir)
{
......
......@@ -48,6 +48,8 @@ extern "C"
*/
const char *tarot_libtarot_version (void);
extern int tarot_libtarot_with_guile;
#ifdef __cplusplus
}
#endif /* __cplusplus */
......
......@@ -15,5 +15,9 @@
AM_CPPFLAGS += -I $(srcdir)/%reldir% -I %reldir%
if HAVE_GUILE
src_libtarot_libtarot_la_SOURCES += \
src/libtarot/semantic-api/tarot_guile.c
else
src_libtarot_libtarot_la_SOURCES += %reldir%/tarot_noguile.c
endif
void
tarot_guile_init ()
{
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment