From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: pkg-config support Date: Sun, 04 May 2008 22:36:18 +0200 Message-ID: <87myn5dcxp.fsf@gnu.org> References: <87lk2xd5qp.fsf@gnu.org> <87mynaz9gb.fsf@ossau.uklinux.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1209933422 8412 80.91.229.12 (4 May 2008 20:37:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 May 2008 20:37:02 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun May 04 22:37:38 2008 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jskxc-0005NN-Jj for guile-devel@m.gmane.org; Sun, 04 May 2008 22:37:29 +0200 Original-Received: from localhost ([127.0.0.1]:54436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jskwv-0004To-1H for guile-devel@m.gmane.org; Sun, 04 May 2008 16:36:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jskwn-0004Tj-A4 for guile-devel@gnu.org; Sun, 04 May 2008 16:36:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jskwk-0004TG-FD for guile-devel@gnu.org; Sun, 04 May 2008 16:36:36 -0400 Original-Received: from [199.232.76.173] (port=52636 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jskwk-0004TD-0W for guile-devel@gnu.org; Sun, 04 May 2008 16:36:34 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jskwj-0001L0-93 for guile-devel@gnu.org; Sun, 04 May 2008 16:36:33 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Jskwc-00079U-LU for guile-devel@gnu.org; Sun, 04 May 2008 20:36:26 +0000 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 04 May 2008 20:36:26 +0000 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 04 May 2008 20:36:26 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 264 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 16 =?iso-8859-1?Q?Flor=E9al?= an 216 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: i686-pc-linux-gnu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:AzTBDirc8vg6Kz65WMMZyuB0dvI= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:7210 Archived-At: --=-=-= Hi, Neil Jerram writes: > But $pkgdatadir is always ${datadir}/guile. So, in my view, better to > rely on this and use AC_CONFIG_FILES, instead of introducing the sed > dependency and incantation in Makefile.am. Right. > I'd vote for guile-1.8.pc now. OK, probably safer. Based on your remarks, I committed the attached patch. Thanks! Ludo'. --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: inline; filename=0001-Add-pkg-config-support.patch Content-Transfer-Encoding: 8bit Content-Description: The patch >From 94a997d18262ddf515180070fa8673cbf194f8ae Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 4 May 2008 22:19:30 +0200 Subject: [PATCH] Add `pkg-config' support. --- .gitignore | 1 + ChangeLog | 9 +++++++++ Makefile.am | 5 ++++- NEWS | 4 ++++ configure.in | 7 +++++++ doc/ref/ChangeLog | 11 +++++++++++ doc/ref/autoconf.texi | 41 ++++++++++++++++++++++++++++++++++++----- doc/ref/guile.texi | 4 ++++ guile-1.8.pc.in | 15 +++++++++++++++ 9 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 guile-1.8.pc.in diff --git a/.gitignore b/.gitignore index fde5392..a122176 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,4 @@ guile-config/guile-config guile-readline/guile-readline-config.h guile-readline/guile-readline-config.h.in TAGS +guile-1.8.pc diff --git a/ChangeLog b/ChangeLog index eada026..fe63267 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-05-04 Ludovic Courtès + + Add `pkg-config' support. Suggested by Aaron VanDevender, Greg + Troxel, and others. + + * configure.in: Substitute `sitedir', produce `guile-1.8.pc'. + * Makefile.am (EXTRA_DIST): Add `guile-1.8.pc.in'. + (pkgconfigdir, pkgconfig_DATA): New. + 2008-04-26 Ludovic Courtès * configure.in (BUILD_PTHREAD_SUPPORT): New Automake diff --git a/Makefile.am b/Makefile.am index 7b4d0c3..a275f01 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,7 +31,7 @@ bin_SCRIPTS = guile-tools include_HEADERS = libguile.h -EXTRA_DIST = LICENSE HACKING GUILE-VERSION FAQ +EXTRA_DIST = LICENSE HACKING GUILE-VERSION FAQ guile-1.8.pc.in TESTS = check-guile @@ -39,4 +39,7 @@ ACLOCAL_AMFLAGS = -I guile-config DISTCLEANFILES = check-guile.log +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = guile-1.8.pc + # Makefile.am ends here diff --git a/NEWS b/NEWS index 041c83d..12a289e 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,10 @@ The new repository can be accessed using "git-clone git://git.sv.gnu.org/guile.git", or can be browsed on-line at http://git.sv.gnu.org/gitweb/?p=guile.git . See `README' for details. +** Add support for `pkg-config' + +See "Autoconf Support" in the manual for details. + * New modules (see the manual for details) ** `(srfi srfi-88)' diff --git a/configure.in b/configure.in index 390c33b..276172f 100644 --- a/configure.in +++ b/configure.in @@ -1430,6 +1430,12 @@ AC_SUBST(top_builddir_absolute) top_srcdir_absolute=`(cd $srcdir && pwd)` AC_SUBST(top_srcdir_absolute) +dnl We need `sitedir' in `guile-1.8.pc'. +dnl Note: `sitedir' must be kept in sync with `GUILE_SITE_DIR' in `guile.m4'. +pkgdatadir="$datadir/guile" +sitedir="$pkgdatadir/site" +AC_SUBST([sitedir]) + # Additional SCM_I_GSC definitions are above. AC_SUBST([SCM_I_GSC_GUILE_DEBUG]) AC_SUBST([SCM_I_GSC_GUILE_DEBUG_FREELIST]) @@ -1475,6 +1481,7 @@ AC_CONFIG_FILES([ test-suite/standalone/Makefile ]) +AC_CONFIG_FILES([guile-1.8.pc]) AC_CONFIG_FILES([check-guile], [chmod +x check-guile]) AC_CONFIG_FILES([benchmark-guile], [chmod +x benchmark-guile]) AC_CONFIG_FILES([guile-tools], [chmod +x guile-tools]) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 9aa7559..c2ed8f9 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,9 @@ +2008-05-04 Ludovic Courtès + + * guile.texi (Guile Modules): Include `autoconf.texi'. + * autoconf.texi (Autoconf Support): Mention `pkg-config'. + (Autoconf Macros): Document `pkg-config' support. + 2008-04-26 Ludovic Courtès * srfi-modules.texi (SRFI-88): New section. @@ -2582,3 +2588,8 @@ The change log for files in this directory continues backwards from 2001-08-27 in ../ChangeLog, as all the Guile documentation prior to this date was contained in a single directory. + + +;; Local Variables: +;; coding: utf-8 +;; End: diff --git a/doc/ref/autoconf.texi b/doc/ref/autoconf.texi index 828155c..83686da 100644 --- a/doc/ref/autoconf.texi +++ b/doc/ref/autoconf.texi @@ -8,10 +8,10 @@ @node Autoconf Support @chapter Autoconf Support -When Guile is installed, a set of autoconf macros is also installed as -PREFIX/share/aclocal/guile.m4. This chapter documents the macros provided in -that file, as well as the high-level guile-tool Autofrisk. @xref{Top,The GNU -Autoconf Manual,,autoconf}, for more info. +When Guile is installed, a pkg-config description file and a set of +Autoconf macros is installed. This chapter documents pkg-config and +Autoconf support, as well as the high-level guile-tool Autofrisk. +@xref{Top,The GNU Autoconf Manual,,autoconf}, for more info. @menu * Autoconf Background:: Why use autoconf? @@ -45,7 +45,38 @@ checks. @node Autoconf Macros @section Autoconf Macros -The macro names all begin with "GUILE_". +@cindex pkg-config +@cindex autoconf + +GNU Guile provides a @dfn{pkg-config} description file, installed as +@file{@var{prefix}/lib/pkgconfig/guile-1.8.pc}, which contains all the +information necessary to compile and link C applications that use Guile. +The @code{pkg-config} program is able to read this file and provide this +information to application programmers; it can be obtained at +@url{http://pkg-config.freedesktop.org/}. + +The following command lines give respectively the C compilation and link +flags needed to build Guile-using programs: + +@example +pkg-config guile-1.8 --cflags +pkg-config guile-1.8 --libs +@end example + +To ease use of pkg-config with Autoconf, pkg-config comes with a +convenient Autoconf macro. The following example looks for Guile and +sets the @code{GUILE_CFLAGS} and @code{GUILE_LIBS} variables +accordingly, or prints an error and exits if Guile was not found: + +@findex PKG_CHECK_MODULES + +@example +PKG_CHECK_MODULES([GUILE], [guile-1.8]) +@end example + +Guile comes with additional Autoconf macros providing more information, +installed as @file{@var{prefix}/share/aclocal/guile.m4}. Their names +all begin with @code{GUILE_}. @c see Makefile.am @include autoconf-macros.texi diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi index 9e742f4..7c17b36 100644 --- a/doc/ref/guile.texi +++ b/doc/ref/guile.texi @@ -176,6 +176,8 @@ x * Guile Modules:: +* Autoconf Support:: + Appendices * Data Representation:: All the details. @@ -361,6 +363,8 @@ available through both Scheme and C interfaces. @include scsh.texi @include scheme-debugging.texi +@include autoconf.texi + @include data-rep.texi @include fdl.texi diff --git a/guile-1.8.pc.in b/guile-1.8.pc.in new file mode 100644 index 0000000..15c83d8 --- /dev/null +++ b/guile-1.8.pc.in @@ -0,0 +1,15 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +datarootdir=@datarootdir@ +datadir=@datadir@ + +sitedir=@sitedir@ +libguileinterface=@LIBGUILE_INTERFACE@ + +Name: GNU Guile +Description: GNU's Ubiquitous Intelligent Language for Extension +Version: @GUILE_VERSION@ +Libs: -L${libdir} -lguile @GUILE_LIBS@ +Cflags: -I${includedir} @GUILE_CFLAGS@ -- 1.5.5 --=-=-=--