From 097a793b2225039980c2b6309661cb23326903f1 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 20 Feb 2011 21:43:19 +0100 Subject: [PATCH] pkg-config instead of guile-config in manuals * doc/ref/api-options.texi (Build Config): * doc/ref/libguile-linking.texi (Linking Programs With Guile): (A Sample Guile Main Program): * doc/ref/libguile-smobs.texi (The Complete Example): Use pkg-config in the examples instead of guile-config. --- doc/ref/api-options.texi | 13 +++++++------ doc/ref/libguile-linking.texi | 32 ++++++++++++++++++++------------ doc/ref/libguile-smobs.texi | 8 ++++---- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/doc/ref/api-options.texi b/doc/ref/api-options.texi index 4813864e7..6f7568bee 100644 --- a/doc/ref/api-options.texi +++ b/doc/ref/api-options.texi @@ -171,13 +171,14 @@ guileversion, libguileinterface, buildstamp @end table Values are all strings. The value for @code{LIBS} is typically found -also as a part of "guile-config link" output. The value for +also as a part of @code{pkg-config --libs +guile-@value{EFFECTIVE-VERSION}} output. The value for @code{guileversion} has form X.Y.Z, and should be the same as returned -by @code{(version)}. The value for @code{libguileinterface} is -libtool compatible and has form CURRENT:REVISION:AGE -(@pxref{Versioning,, Library interface versions, libtool, GNU -Libtool}). The value for @code{buildstamp} is the output of the -command @samp{date -u +'%Y-%m-%d %T'} (UTC). +by @code{(version)}. The value for @code{libguileinterface} is libtool +compatible and has form CURRENT:REVISION:AGE (@pxref{Versioning,, +Library interface versions, libtool, GNU Libtool}). The value for +@code{buildstamp} is the output of the command @samp{date -u +'%Y-%m-%d +%T'} (UTC). In the source, @code{%guile-build-info} is initialized from libguile/libpath.h, which is completely generated, so deleting this file diff --git a/doc/ref/libguile-linking.texi b/doc/ref/libguile-linking.texi index b6a88556e..cc95ef423 100644 --- a/doc/ref/libguile-linking.texi +++ b/doc/ref/libguile-linking.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2010 +@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2010, 2011 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -16,16 +16,24 @@ head of any C source file that uses identifiers described in this manual. Once you've compiled your source files, you need to link them against the Guile object code library, @code{libguile}. -On most systems, you should not need to tell the compiler and linker -explicitly where they can find @file{libguile.h} and @file{libguile}. -When Guile has been installed in a peculiar way, or when you are on a -peculiar system, things might not be so easy and you might need to pass -additional @code{-I} or @code{-L} options to the compiler. Guile -provides the utility program @code{guile-config} to help you find the -right values for these options. You would typically run -@code{guile-config} during the configuration phase of your program and +@code{} is not in the default search path for headers, +because Guile supports parallel installation of multiple versions of +Guile, with each version's headers under their own directories. This is +to allow development against, say, both Guile 2.0 and 2.2. + +To compile code that includes @code{}, or links to +@code{libguile}, you need to select the effective version you are +interested in, and then ask @code{pkg-config} for the compilation flags +or linking instructions. For effective version +@value{EFFECTIVE-VERSION}, for example, you would invoke +@code{pkg-config --cflags --libs guile-@value{EFFECTIVE-VERSION}} to get +the compilation and linking flags necessary to link to version +@value{EFFECTIVE-VERSION} of Guile. You would typically run +@code{pkg-config} during the configuration phase of your program and use the obtained information in the Makefile. +See the @code{pkg-config} man page, for more information. + @menu * Guile Initialization Functions:: What to call first. * A Sample Guile Main Program:: Sources and makefiles. @@ -98,17 +106,17 @@ ready, it invokes @code{inner_main}, which calls @code{scm_shell} to process the command-line arguments in the usual way. Here is a Makefile which you can use to compile the above program. It -uses @code{guile-config} to learn about the necessary compiler and +uses @code{pkg-config} to learn about the necessary compiler and linker flags. @example # Use GCC, if you have it installed. CC=gcc # Tell the C compiler where to find -CFLAGS=`guile-config compile` +CFLAGS=`pkg-config --cflags guile-@value{EFFECTIVE-VERSION}` # Tell the linker what libraries to use and where to find them. -LIBS=`guile-config link` +LIBS=`pkg-config --libs guile-@value{EFFECTIVE-VERSION}` simple-guile: simple-guile.o $@{CC@} simple-guile.o $@{LIBS@} -o simple-guile diff --git a/doc/ref/libguile-smobs.texi b/doc/ref/libguile-smobs.texi index c6581a1ac..eb938f099 100644 --- a/doc/ref/libguile-smobs.texi +++ b/doc/ref/libguile-smobs.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2010 +@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2010, 2011 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -686,9 +686,9 @@ Here is a sample build and interaction with the code from the @example zwingli:example-smob$ make CC=gcc -gcc `guile-config compile` -c image-type.c -o image-type.o -gcc `guile-config compile` -c myguile.c -o myguile.o -gcc image-type.o myguile.o `guile-config link` -o myguile +gcc `pkg-config --cflags guile-@value{EFFECTIVE-VERSION}` -c image-type.c -o image-type.o +gcc `pkg-config --cflags guile-@value{EFFECTIVE-VERSION}` -c myguile.c -o myguile.o +gcc image-type.o myguile.o `pkg-config --libs guile-@value{EFFECTIVE-VERSION}` -o myguile zwingli:example-smob$ ./myguile guile> make-image # -- 2.20.1