Document bsd.port.options.mk
This commit is contained in:
parent
703393d2fd
commit
67788ba628
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=34299
1 changed files with 24 additions and 7 deletions
|
|
@ -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 <bsd.port.pre.mk>
|
||||
.include <bsd.port.options.mk>
|
||||
|
||||
.if defined(WITHOUT_FOO)
|
||||
CONFIGURE_ARGS+= --without-foo
|
||||
|
|
@ -3897,10 +3900,24 @@ CONFIGURE_ARGS+= --with-foo
|
|||
RUN_DEPENDS+= bar:${PORTSDIR}/bar/bar
|
||||
.endif
|
||||
|
||||
.include <bsd.port.mk></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 <bsd.port.pre.mk>
|
||||
|
||||
.if defined(WITHOUT_FOO)
|
||||
CONFIGURE_ARGS+= --without-foo
|
||||
.else
|
||||
CONFIGURE_ARGS+= --with-foo
|
||||
.endif
|
||||
|
||||
.include <bsd.port.post.mk></programlisting></para>
|
||||
</example>
|
||||
</sect3>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue