Hi Matt,
Thanks for your reply.
Yes, at the current stage maybe my question is rather concerning GNU auto tools. I have also read the sections you pointed out in the Guile manual.
GNU Chess has not been using the garbage collector so far.
dnl AC_ARG_ENABLE(guile,
dnl AC_HELP_STRING([--enable-guile],[Enable Guile support [[default=no]]]),
dnl [case $enableval in
dnl yes|no) ;;
dnl ") AC_MSG_ERROR([bad value $enableval for --enable-guile, need yes or no]) ;;
dnl esac],
dnl [enable_guile=false])
AC_ARG_ENABLE(guile,
[ --enable-guile Enable Guile support [default=false]],
[case "${enableval}" in
yes | y) guile=true ;;
no | n) guile=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-guile) ;;
esac],[guile=false])
AM_CONDITIONAL([HAVE_GUILE], [test x$guile = xtrue])
I have added these lines in src/Makefile.am:
if HAVE_GUILE
gnuchess_SOURCES += guile.cc
AM_CPPFLAGS += `guile-config compile` -DHAVE_GUILE
AM_LDFLAGS += `guile-config link`
endif
This way I can configure the package with guile support:
./configure --enable-guile
Whereas guile will not be used/required by default:
./configure
And I can use C recompilation directives like this:
#ifdef HAVE_GUILE
do_some_guile_work();
#endif
With do_some_guile_work() defined in guile.cc.
So far so good, apparently. Is this the way to go?
Regards,
Antonio