Document bsd.port.options.mk

This commit is contained in:
Pav Lucistnik 2009-05-21 15:07:31 +00:00
parent 703393d2fd
commit 67788ba628
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=34299

View file

@ -3872,20 +3872,23 @@ ${MANPREFIX}/man/de/man3/baz.3.gz</programlisting>
are allowed.</para>
<para><makevar>OPTIONS</makevar> definition must appear before
the inclusion of <filename>bsd.port.pre.mk</filename>.
the inclusion of <filename>bsd.port.options.mk</filename>.
The <makevar>WITH_*</makevar> and <makevar>WITHOUT_*</makevar>
variables can only be tested after the inclusion of
<filename>bsd.port.pre.mk</filename>.</para>
</sect3>
<filename>bsd.port.options.mk</filename>. Inclusion of
<filename>bsd.port.pre.mk</filename> can be used instead, too,
and is still widely used in ports written before the introduction
of <filename>bsd.port.options.mk</filename>. But be aware that
some variables will not work as expected after the inclusion of
<filename>bsd.port.pre.mk</filename>, typically
<makevar>USE_*</makevar> flags.</para>
<sect3>
<title>Example</title>
<example id="ports-options-simple-use">
<title>Simple use of <makevar>OPTIONS</makevar></title>
<para><programlisting>OPTIONS= FOO "Enable option foo" On \
BAR "Support feature bar" Off
.include &lt;bsd.port.pre.mk&gt;
.include &lt;bsd.port.options.mk&gt;
.if defined(WITHOUT_FOO)
CONFIGURE_ARGS+= --without-foo
@ -3897,10 +3900,24 @@ CONFIGURE_ARGS+= --with-foo
RUN_DEPENDS+= bar:${PORTSDIR}/bar/bar
.endif
.include &lt;bsd.port.mk&gt;</programlisting></para>
</example>
<example id="ports-options-old-style-use">
<title>Old style use of <makevar>OPTIONS</makevar></title>
<para><programlisting>OPTIONS= FOO "Enable option foo" On
.include &lt;bsd.port.pre.mk&gt;
.if defined(WITHOUT_FOO)
CONFIGURE_ARGS+= --without-foo
.else
CONFIGURE_ARGS+= --with-foo
.endif
.include &lt;bsd.port.post.mk&gt;</programlisting></para>
</example>
</sect3>
</sect2>
<sect2>