summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-10-01 22:38:42 +0000
committerrillig <rillig@pkgsrc.org>2007-10-01 22:38:42 +0000
commit297dbe296aa16b7f4cf4d7d9c8d4c96c0b989a35 (patch)
tree4812a038beb3c06d7b5af594a7b56ca2b9654999 /doc
parent6ded5eb97b10afc606329ddfe6c0a3d9699df419 (diff)
downloadpkgsrc-297dbe296aa16b7f4cf4d7d9c8d4c96c0b989a35.tar.gz
Documented how to query for the options with which a dependent package
has been built.
Diffstat (limited to 'doc')
-rw-r--r--doc/guide/files/buildlink.xml4
-rw-r--r--doc/guide/files/options.xml29
-rw-r--r--doc/guide/files/pkgsrc.ent3
3 files changed, 33 insertions, 3 deletions
diff --git a/doc/guide/files/buildlink.xml b/doc/guide/files/buildlink.xml
index a6c9bda9921..2b9c8849f83 100644
--- a/doc/guide/files/buildlink.xml
+++ b/doc/guide/files/buildlink.xml
@@ -1,4 +1,4 @@
-<!-- $NetBSD: buildlink.xml,v 1.24 2007/06/01 11:07:24 rillig Exp $ -->
+<!-- $NetBSD: buildlink.xml,v 1.25 2007/10/01 22:38:42 rillig Exp $ -->
<chapter id="buildlink">
<title>Buildlink methodology</title>
@@ -158,6 +158,8 @@ BUILDLINK_API_DEPENDS.foo+= foo>=1.1.0
<sect1 id="creating-buildlink3.mk">
<title>Writing <filename>buildlink3.mk</filename> files</title>
+<anchor id="buildlink3.mk"/>
+
<para>A package's <filename>buildlink3.mk</filename> file is
included by Makefiles to indicate the need to compile and link
against header files and libraries provided by the package. A
diff --git a/doc/guide/files/options.xml b/doc/guide/files/options.xml
index 618ac230b42..dee6c8d403e 100644
--- a/doc/guide/files/options.xml
+++ b/doc/guide/files/options.xml
@@ -1,4 +1,4 @@
-<!-- $NetBSD: options.xml,v 1.24 2007/09/22 02:52:48 kano Exp $ -->
+<!-- $NetBSD: options.xml,v 1.25 2007/10/01 22:38:42 rillig Exp $ -->
<!-- based on: pkgsrc/mk/bsd.options.mk 1.56 -->
@@ -243,4 +243,31 @@ support.</quote> The file is sorted by option names.</para>
</sect1>
+<sect1 id="option-build">
+<title>Determining the options of dependencies</title>
+
+<para>When writing &buildlink3.mk; files, it is often necessary to list
+different dependencies based on the options with which the package was
+built. For querying these options, the file
+<filename>pkgsrc/mk/pkg-build-options.mk</filename> should be used. A
+typical example looks like this:</para>
+
+<programlisting>
+pkgbase := libpurple
+.include "../../mk/pkg-build-options.mk"
+
+.if !empty(PKG_BUILD_OPTIONS.libpurple:Mdbus)
+...
+.endif
+</programlisting>
+
+<para>Including <filename>pkg-build-options.mk</filename> here will set
+the variable <varname>PKG_BUILD_OPTIONS.libpurple</varname> to the build
+options of the libpurple package, which can then be queried like
+<varname>PKG_OPTIONS</varname> in the <filename>options.mk</filename>
+file. See the file <filename>pkg-build-options.mk</filename> for more
+details.</para>
+
+</sect1>
+
</chapter>
diff --git a/doc/guide/files/pkgsrc.ent b/doc/guide/files/pkgsrc.ent
index 9ea9ec97dd9..1bcf16fe278 100644
--- a/doc/guide/files/pkgsrc.ent
+++ b/doc/guide/files/pkgsrc.ent
@@ -1,7 +1,8 @@
-<!-- $NetBSD: pkgsrc.ent,v 1.1 2007/08/15 06:33:46 rillig Exp $ -->
+<!-- $NetBSD: pkgsrc.ent,v 1.2 2007/10/01 22:38:42 rillig Exp $ -->
<!--
Entities that can (and should) be used in the pkgsrc guide.
-->
<!ENTITY mk.conf "<link linkend='mk.conf'><filename>mk.conf</filename></link>">
+<!ENTITY buildlink3.mk "<link linkend='buildlink3.mk'><filename>buildlink3.mk</filename></link>">