Page MenuHomeFreeBSD

D3516.id8486.diff
No OneTemporary

D3516.id8486.diff

Index: en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
===================================================================
--- en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
+++ en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
@@ -4111,7 +4111,9 @@
</sect3>
<sect3 xml:id="options-use">
- <title><varname><replaceable>OPT</replaceable>_USE</varname></title>
+ <title><varname><replaceable>OPT</replaceable>_USE</varname>
+ and
+ <varname><replaceable>OPT</replaceable>_USE_OFF</varname></title>
<para>When option <replaceable>OPT</replaceable> is selected,
for each
@@ -4123,10 +4125,15 @@
<varname>USE_<replaceable>KEY</replaceable></varname>. If
<replaceable>value</replaceable> has spaces in it, replace
them with commas and they will be changed back to spaces
- during processing. For example:</para>
+ during processing.
+ <varname><replaceable>OPT</replaceable>_USE_OFF</varname>
+ works the same way, but when <literal>OPT</literal> is not
+ selected. For example:</para>
<programlisting>OPTIONS_DEFINE= OPT1
-OPT1_USE= mysql=yes xorg=x11,xextproto,xext,xrandr</programlisting>
+OPT1_USE= mysql=yes xorg=x11,xextproto,xext,xrandr
+OPT1_USE_OFF= openssl=yes
+ </programlisting>
<para>is equivalent to:</para>
@@ -4137,36 +4144,8 @@
.if ${PORT_OPTIONS:MOPT1}
USE_MYSQL= yes
USE_XORG= x11 xextproto xext xrandr
-.endif</programlisting>
- </sect3>
-
- <sect3 xml:id="options-use-off">
- <title><varname><replaceable>OPT</replaceable>_USE_OFF</varname></title>
-
- <para>When option <replaceable>OPT</replaceable> <emphasis>is
- not</emphasis> selected, for each
- <literal><replaceable>key</replaceable>=<replaceable>value</replaceable></literal>
- pair in
- <varname><replaceable>OPT</replaceable>_USE_OFF</varname>,
- <replaceable>value</replaceable> is appended to the
- corresponding
- <varname>USE_<replaceable>KEY</replaceable></varname>. If
- <replaceable>value</replaceable> has spaces in it, replace
- them with commas and they will be changed back to spaces
- during processing. For example:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-OPT1_USE_OFF= mysql=yes xorg=x11,xextproto,xext,xrandr</programlisting>
-
- <para>is equivalent to:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-
-.include &lt;bsd.port.options.mk&gt;
-
-.if ! ${PORT_OPTIONS:MOPT1}
-USE_MYSQL= yes
-USE_XORG= x11 xextproto xext xrandr
+.else
+USE_OPENSSL= yes
.endif</programlisting>
</sect3>
@@ -4253,16 +4232,22 @@
</sect3>
<sect3 xml:id="options-configure_on">
- <title><varname><replaceable>OPT</replaceable>_CONFIGURE_ON</varname></title>
+ <title><varname><replaceable>OPT</replaceable>_CONFIGURE_ON</varname>
+ and
+ <varname><replaceable>OPT</replaceable>_CONFIGURE_OFF</varname></title>
<para>When option <replaceable>OPT</replaceable> is selected,
the value of
<varname><replaceable>OPT</replaceable>_CONFIGURE_ON</varname>,
if defined, is appended to
- <varname>CONFIGURE_ARGS</varname>. For example:</para>
+ <varname>CONFIGURE_ARGS</varname>.
+ <varname><replaceable>OPT</replaceable>_CONFIGURE_OFF</varname>
+ works the same way, but when <literal>OPT</literal> is
+ not selected. For example:</para>
<programlisting>OPTIONS_DEFINE= OPT1
-OPT1_CONFIGURE_ON= --add-test</programlisting>
+OPT1_CONFIGURE_ON= --add-test
+OPT1_CONFIGURE_OFF= --no-test</programlisting>
<para>is equivalent to:</para>
@@ -4272,43 +4257,27 @@
.if ${PORT_OPTIONS:MOPT1}
CONFIGURE_ARGS+= --add-test
-.endif</programlisting>
- </sect3>
-
- <sect3 xml:id="options-configure_off">
- <title><varname><replaceable>OPT</replaceable>_CONFIGURE_OFF</varname></title>
-
- <para>When option <replaceable>OPT</replaceable> <emphasis>is
- not</emphasis> selected, the value of
- <varname><replaceable>OPT</replaceable>_CONFIGURE_ON</varname>,
- if defined, is appended to
- <varname>CONFIGURE_ARGS</varname>. For example:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-OPT1_CONFIGURE_OFF= --no-test</programlisting>
-
- <para>is equivalent to:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-
-.include &lt;bsd.port.options.mk&gt;
-
-.if ! ${PORT_OPTIONS:MOPT1}
+.else
CONFIGURE_ARGS+= --no-test
.endif</programlisting>
</sect3>
<sect3 xml:id="options-cmake_on">
- <title><varname><replaceable>OPT</replaceable>_CMAKE_ON</varname></title>
+ <title><varname><replaceable>OPT</replaceable>_CMAKE_ON</varname>
+ and
+ <varname><replaceable>OPT</replaceable>_CMAKE_OFF</varname></title>
<para>When option <replaceable>OPT</replaceable> is selected,
the value of
<varname><replaceable>OPT</replaceable>_CMAKE_ON</varname>,
if defined, is appended to <varname>CMAKE_ARGS</varname>.
- For example:</para>
+ <varname><replaceable>OPT</replaceable>_CMAKE_OFF</varname>
+ works the same way, but when <literal>OPT</literal> is not
+ selected. For example:</para>
<programlisting>OPTIONS_DEFINE= OPT1
-OPT1_CMAKE_ON= -DTEST:BOOL=true</programlisting>
+OPT1_CMAKE_ON= -DTEST:BOOL=true
+OPT1_CMAKE_OFF= -DOPTIMIZE:BOOL=true</programlisting>
<para>is equivalent to:</para>
@@ -4318,43 +4287,27 @@
.if ${PORT_OPTIONS:MOPT1}
CMAKE_ARGS+= -DTEST:BOOL=true
-.endif</programlisting>
- </sect3>
-
- <sect3 xml:id="options-cmake_off">
- <title><varname><replaceable>OPT</replaceable>_CMAKE_OFF</varname></title>
-
- <para>When option <replaceable>OPT</replaceable> <emphasis>is
- not</emphasis> selected, the value of
- <varname><replaceable>OPT</replaceable>_CMAKE_OFF</varname>,
- if defined, is appended to <varname>CMAKE_ARGS</varname>.
- For example:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-OPT1_CMAKE_OFF= -DTEST:BOOL=false</programlisting>
-
- <para>is equivalent to:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-
-.include &lt;bsd.port.options.mk&gt;
-
-.if ! ${PORT_OPTIONS:MOPT1}
-CMAKE_ARGS+= -DTEST:BOOL=false
+.else
+CMAKE_ARGS+= -DOPTIMIZE:BOOL=true
.endif</programlisting>
</sect3>
<sect3 xml:id="options-qmake_on">
- <title><varname><replaceable>OPT</replaceable>_QMAKE_ON</varname></title>
+ <title><varname><replaceable>OPT</replaceable>_QMAKE_ON</varname>
+ and
+ <varname><replaceable>OPT</replaceable>_QMAKE_OFF</varname></title>
<para>When option <replaceable>OPT</replaceable> is selected,
the value of
<varname><replaceable>OPT</replaceable>_QMAKE_ON</varname>,
- if defined, is appended to
- <varname>QMAKE_ARGS</varname>. For example:</para>
+ if defined, is appended to <varname>QMAKE_ARGS</varname>.
+ <varname><replaceable>OPT</replaceable>_QMAKE_OFF</varname>
+ works the same way, but when <literal>OPT</literal> is not
+ enabled. For example:</para>
<programlisting>OPTIONS_DEFINE= OPT1
-OPT1_QMAKE_ON= -DTEST:BOOL=true</programlisting>
+OPT1_QMAKE_ON= -DTEST:BOOL=true
+OPT1_QMAKE_OFF= -DPRODUCTION:BOOL=true</programlisting>
<para>is equivalent to:</para>
@@ -4364,29 +4317,8 @@
.if ${PORT_OPTIONS:MOPT1}
QMAKE_ARGS+= -DTEST:BOOL=true
-.endif</programlisting>
- </sect3>
-
- <sect3 xml:id="options-qmake_off">
- <title><varname><replaceable>OPT</replaceable>_QMAKE_OFF</varname></title>
-
- <para>When option <replaceable>OPT</replaceable> <emphasis>is
- not</emphasis> selected, the value of
- <varname><replaceable>OPT</replaceable>_QMAKE_OFF</varname>,
- if defined, is appended to
- <varname>QMAKE_ARGS</varname>. For example:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-OPT1_QMAKE_OFF= -DTEST:BOOL=false</programlisting>
-
- <para>is equivalent to:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-
-.include &lt;bsd.port.options.mk&gt;
-
-.if ! ${PORT_OPTIONS:MOPT1}
-QMAKE_ARGS+= -DTEST:BOOL=false
+.else
+QMAKE_ARGS+= -DPRODUCTION:BOOL=true
.endif</programlisting>
</sect3>
@@ -4496,6 +4428,66 @@
</example>
</sect3>
+ <sect3 xml:id="options-vars">
+ <title><varname><replaceable>OPT</replaceable>_VARS</varname>
+ and
+ <varname><replaceable>OPT</replaceable>_VARS_OFF</varname></title>
+
+ <para>Provides a generic way to set and append to
+ variables.</para>
+
+ <warning><para>Before using
+ <varname><replaceable>OPT</replaceable>_VARS</varname> and
+ <varname><replaceable>OPT</replaceable>_VARS_OFF</varname>,
+ see if there is already a more specific helper available in
+ <xref linkend="options-variables"/>.</para></warning>
+
+ <para>When option <replaceable>OPT</replaceable> is selected,
+ and <varname><replaceable>OPT</replaceable>_VARS</varname>
+ defined,
+ <literal><replaceable>key</replaceable>=<replaceable>value</replaceable></literal>
+ and
+ <literal><replaceable>key</replaceable>+=<replaceable>value</replaceable></literal>
+ pairs are evaluated from
+ <varname><replaceable>OPT</replaceable>_VARS</varname>. An
+ <literal>=</literal> cause the existing value of
+ <literal>KEY</literal> to be overwritten, an
+ <literal>+=</literal> appends to the value.
+ <varname><replaceable>OPT</replaceable>_VARS_OFF</varname>
+ works the same way, but when <literal>OPT</literal> is not
+ selected.</para>
+
+ <programlisting>OPTIONS_DEFINE= OPT1 OPT2 OPT3
+OPT1_VARS= also_build+=bin1
+OPT2_VARS= also_build+=bin2
+OPT3_VARS= bin3_build=yes
+OPT3_VARS_OFF= bin3_build=no
+
+MAKE_ARGS= ALSO_BUILD="${ALSO_BUILD}" BIN3_BUILD="${BIN3_BUILD}"</programlisting>
+
+ <para>is equivalent to:</para>
+
+ <programlisting>OPTIONS_DEFINE= OPT1 OPT2
+
+MAKE_ARGS= ALSO_BUILD="${ALSO_BUILD}" BIN3_BUILD="${BIN3_BUILD}"
+
+.include &lt;bsd.port.options.mk&gt;
+
+.if ${PORT_OPTIONS:MOPT1}
+ALSO_BUILD+= bin1
+.endif
+
+.if ${PORT_OPTIONS:MOPT2}
+ALSO_BUILD+= bin2
+.endif
+
+.if ${PORT_OPTIONS:MOPT2}
+BIN3_BUILD= yes
+.else
+BIN3_BUILD= no
+.endif</programlisting>
+ </sect3>
+
<sect3 xml:id="options-dependencies">
<title>Dependencies</title>

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 19, 5:48 PM (4 h, 16 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29972127
Default Alt Text
D3516.id8486.diff (9 KB)

Event Timeline