Enhance the flavors chapter with the experience from the past few weeks.
Sponsored by: Absolight
This commit is contained in:
parent
396398ddd6
commit
86821e0c2f
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=51378
1 changed files with 32 additions and 1 deletions
|
@ -29,6 +29,14 @@
|
||||||
The first flavor in <varname>FLAVORS</varname> is the default
|
The first flavor in <varname>FLAVORS</varname> is the default
|
||||||
flavor.</para>
|
flavor.</para>
|
||||||
|
|
||||||
|
<tip>
|
||||||
|
<para>It can help simplify the logic of the
|
||||||
|
<filename>Makefile</filename> to also define
|
||||||
|
<varname>FLAVOR</varname> as:</para>
|
||||||
|
|
||||||
|
<programlisting>FLAVOR?= ${FLAVORS:[1]}</programlisting>
|
||||||
|
</tip>
|
||||||
|
|
||||||
<important>
|
<important>
|
||||||
<para>To distinguish flavors from options, which are always
|
<para>To distinguish flavors from options, which are always
|
||||||
uppercase letters, flavor names can <emphasis>only</emphasis>
|
uppercase letters, flavor names can <emphasis>only</emphasis>
|
||||||
|
@ -43,15 +51,38 @@
|
||||||
port can be removed, and the port can be converted to flavors
|
port can be removed, and the port can be converted to flavors
|
||||||
with:</para>
|
with:</para>
|
||||||
|
|
||||||
<programlisting>FLAVORS= normal lite
|
<programlisting>FLAVORS= default lite
|
||||||
lite_PKGNAMESUFFIX= -lite
|
lite_PKGNAMESUFFIX= -lite
|
||||||
[...]
|
[...]
|
||||||
.if ${FLAVOR:U} != lite
|
.if ${FLAVOR:U} != lite
|
||||||
[enable non lite features]
|
[enable non lite features]
|
||||||
.endif</programlisting>
|
.endif</programlisting>
|
||||||
|
|
||||||
|
<note>
|
||||||
|
<para>The first flavor is the default one, and is called,
|
||||||
|
here, <literal>default</literal>. It is not an obligation,
|
||||||
|
and if possible, use a more specific flavor name, like in
|
||||||
|
<xref linkend="flavors-using-ex2"/>.</para>
|
||||||
|
</note>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
<example xml:id="flavors-using-ex2">
|
<example xml:id="flavors-using-ex2">
|
||||||
|
<title>Another Basic Flavors Usage</title>
|
||||||
|
|
||||||
|
<para>If a port has a <literal>-nox11</literal> slave port, the
|
||||||
|
slave port can be removed, and the port can be converted to
|
||||||
|
flavors with:</para>
|
||||||
|
|
||||||
|
<programlisting>FLAVORS= x11 nox11
|
||||||
|
FLAVOR?= ${FLAVORS:[1]}
|
||||||
|
nox11_PKGNAMESUFFIX= -nox11
|
||||||
|
[...]
|
||||||
|
.if ${FLAVOR} = x11
|
||||||
|
[enable x11 features]
|
||||||
|
.endif</programlisting>
|
||||||
|
</example>
|
||||||
|
|
||||||
|
<example xml:id="flavors-using-ex3">
|
||||||
<title>More Complex Flavors Usage</title>
|
<title>More Complex Flavors Usage</title>
|
||||||
|
|
||||||
<para>Here is a slightly edited excerpt of what is present in
|
<para>Here is a slightly edited excerpt of what is present in
|
||||||
|
|
Loading…
Reference in a new issue