guile-user
[Top][All Lists]
Advanced

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

RE: How to add Guile support to a package


From: Antonio Ceballos
Subject: RE: How to add Guile support to a package
Date: Mon, 5 Jan 2015 10:19:53 +0100

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.

I have added these lines in configure.ac:

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

reply via email to

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