From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antonio Ceballos Newsgroups: gmane.lisp.guile.user Subject: RE: How to add Guile support to a package Date: Mon, 5 Jan 2015 10:19:53 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bdcad9e787525050be4312d X-Trace: ger.gmane.org 1420449616 11515 80.91.229.3 (5 Jan 2015 09:20:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Jan 2015 09:20:16 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jan 05 10:20:11 2015 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y83pa-0008JF-Ug for guile-user@m.gmane.org; Mon, 05 Jan 2015 10:20:11 +0100 Original-Received: from localhost ([::1]:59482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y83pV-0007X3-4I for guile-user@m.gmane.org; Mon, 05 Jan 2015 04:20:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y83pM-0007Wx-GU for guile-user@gnu.org; Mon, 05 Jan 2015 04:19:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y83pK-0003vl-W7 for guile-user@gnu.org; Mon, 05 Jan 2015 04:19:56 -0500 Original-Received: from mail-we0-x235.google.com ([2a00:1450:400c:c03::235]:52022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y83pK-0003vd-M6 for guile-user@gnu.org; Mon, 05 Jan 2015 04:19:54 -0500 Original-Received: by mail-we0-f181.google.com with SMTP id q58so7413428wes.26 for ; Mon, 05 Jan 2015 01:19:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=DdyGEzOMv+TIvb/tDrmTbuff26aJZUzrRh+8a5UiM8w=; b=a8mFUmiROVq7RXOGbGUPVESYokxk6cKIJ3XIlWB6dygDSTMSehv4/VL59JFYC241/d c86ilKMZWMiaHAaboja59j7AM3+oOxbP/KF+/RParXZ7zWY5x2aZW/ISSRKCAUIwIiqk x9hN37YbaPjQtLgtvVNdUXTJ+WIRF1/gS/V+3wKMkasZo7U/8qDP8gQVbuhbpB2QHYSV VlCZU9araGTJXI3hAu9GM0mu21YlNe3upPKKf4aQwsJ20kN2zrZu07U4sLQXFJKTls+r x1ZfUY2ToTcHG1QbjhI+BVgnr7VEc51TD6eHaur0lLJKUhNtBiLhBdVJuRlRAoM0A88B IoAQ== X-Received: by 10.194.94.227 with SMTP id df3mr181780945wjb.34.1420449593978; Mon, 05 Jan 2015 01:19:53 -0800 (PST) Original-Received: by 10.216.150.1 with HTTP; Mon, 5 Jan 2015 01:19:53 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c03::235 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11699 Archived-At: --047d7bdcad9e787525050be4312d Content-Type: text/plain; charset=UTF-8 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 --047d7bdcad9e787525050be4312d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Matt,

Thanks for your reply.

Yes, at the current stage maybe my question is rather con= cerning GNU auto tools. I have also read the sections you pointed out in th= e Guile manual.

GNU Chess has not been using the g= arbage 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=3Dno]]]),
dnl [case $enableval in
= dnl yes|no) = ;;
dnl ") AC_MSG_ERROR([bad value $enableval for --enable-guile, = need yes or no]) =C2=A0;;
dnl esac],
dnl [enable_guile=3Dfalse])<= /font>
AC_ARG_ENABLE(guile,
=C2=A0 [ =C2=A0--enable-guile =C2=A0 =C2=A0E= nable Guile support [default=3Dfalse]],
=C2=A0 [case "${enableval= }" in
=C2=A0 =C2=A0 =C2=A0yes | y) guile=3Dtrue ;;
=C2=A0 = =C2=A0 =C2=A0no | n) =C2=A0guile=3Dfalse ;;
=C2=A0 =C2=A0 =C2=A0*) AC_= MSG_ERROR(bad value ${enableval} for --enable-guile) ;;
=C2=A0 =C2=A0e= sac],[guile=3Dfalse])

AM_CONDITIONAL([HAVE_GUILE], [test x$g= uile =3D xtrue])

I have added these l= ines in src/Makefile.am:

if HAVE_GUILE
gnuchess_SOURCES += =3D guile.cc
AM_CPPFLAGS +=3D `guile-config compile` -DHAVE_GUILE
AM_LDFLAGS +=3D `guile-config link`
endif
=C2=A0
This way I can configure the package with guile support:
<= br>
Whereas guile= will not be used/required by default:

<= font class=3D"Apple-style-span" face=3D"monospace, monospace">./configure

And I can use C recompilation directives li= ke this:

#ifdef HAVE_GUILE
do_some_guile_work();
#en= dif

With do_some_guile_work() defined in gu= ile.cc.

So far so good, apparently. Is this the wa= y to go?

Regards,
Antonio
--047d7bdcad9e787525050be4312d--