Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F135526518
D3516.id8489.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
17 KB
Referenced Files
None
Subscribers
None
D3516.id8489.diff
View Options
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,14 @@
<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 +4143,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 <bsd.port.options.mk>
-
-.if ! ${PORT_OPTIONS:MOPT1}
-USE_MYSQL= yes
-USE_XORG= x11 xextproto xext xrandr
+.else
+USE_OPENSSL= yes
.endif</programlisting>
</sect3>
@@ -4253,16 +4231,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 +4256,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 <bsd.port.options.mk>
-
-.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 +4286,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 <bsd.port.options.mk>
-
-.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 +4316,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 <bsd.port.options.mk>
-
-.if ! ${PORT_OPTIONS:MOPT1}
-QMAKE_ARGS+= -DTEST:BOOL=false
+.else
+QMAKE_ARGS+= -DPRODUCTION:BOOL=true
.endif</programlisting>
</sect3>
@@ -4496,8 +4427,71 @@
</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 <bsd.port.options.mk>
+
+.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>
+ <title>Dependencies,
+ <varname><replaceable>OPT</replaceable>_<replaceable>DEPTYPE</replaceable></varname>
+ and
+ <varname><replaceable>OPT</replaceable>_<replaceable>DEPTYPE</replaceable>_OFF</varname></title>
<para>For any of these dependency types:</para>
@@ -4531,20 +4525,18 @@
</listitem>
</itemizedlist>
- <para>The following variables can be used.</para>
-
- <sect4>
- <title><varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable></varname></title>
-
<para>When option <replaceable>OPT</replaceable> is
selected, the value of
- <varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable></varname>,
+ <varname><replaceable>OPT</replaceable>_<replaceable>DEPTYPE</replaceable></varname>,
if defined, is appended to
- <literal><replaceable>ABOVEVARIABLE</replaceable></literal>.
- For example:</para>
+ <literal><replaceable>DEPTYPE</replaceable></literal>.
+ <varname><replaceable>OPT</replaceable>_<replaceable>DEPTYPE</replaceable>_OFF</varname>
+ works the same, but when <literal>OPT</literal> is not
+ selected. For example:</para>
<programlisting>OPTIONS_DEFINE= OPT1
-OPT1_LIB_DEPENDS= liba.so:${PORTSDIR}/devel/a</programlisting>
+OPT1_LIB_DEPENDS= liba.so:${PORTSDIR}/devel/a
+OPT1_LIB_DEPENDS_OFF= libb.so:${PORTSDIR}/devel/b</programlisting>
<para>is equivalent to:</para>
@@ -4554,37 +4546,16 @@
.if ${PORT_OPTIONS:MOPT1}
LIB_DEPENDS+= liba.so:${PORTSDIR}/devel/a
+.else
+LIB_DEPENDS+= libb.so:${PORTSDIR}/devel/b
.endif</programlisting>
-
- </sect4>
-
- <sect4>
- <title><varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable>_OFF</varname></title>
-
- <para>When option <replaceable>OPT</replaceable>
- <emphasis>is not</emphasis> selected, the value of
- <varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable>_OFF</varname>,
- if defined, is appended to
- <literal><replaceable>ABOVEVARIABLE</replaceable></literal>.
- For example:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-OPT1_LIB_DEPENDS_OFF= liba.so:${PORTSDIR}/devel/a</programlisting>
-
- <para>is equivalent to:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-
-.include <bsd.port.options.mk>
-
-. if ! ${PORT_OPTIONS:MOPT1}
-LIB_DEPENDS+= liba.so:${PORTSDIR}/devel/a
-.endif</programlisting>
- </sect4>
</sect3>
<sect3 xml:id="options-variables">
- <title>Generic Variables Replacement</title>
+ <title>Generic Variables Replacement,
+ <varname><replaceable>OPT</replaceable>_<replaceable>VARIABLE</replaceable></varname>
+ and
+ <varname><replaceable>OPT</replaceable>_<replaceable>VARIABLE</replaceable>_OFF</varname></title>
<para>For any of these variables:</para>
@@ -4722,7 +4693,30 @@
</listitem>
</itemizedlist>
- <para>The following variables can be used.</para>
+ <para>When option <replaceable>OPT</replaceable> is
+ selected, the value of
+ <varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable></varname>,
+ if defined, is appended to
+ <literal><replaceable>ABOVEVARIABLE</replaceable></literal>.
+ <varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable>_OFF</varname>
+ works the same way, but when <literal>OPT</literal> is not
+ selected. For example:</para>
+
+ <programlisting>OPTIONS_DEFINE= OPT1
+OPT1_USES= gmake
+OPT1_CFLAGS_OFF= -DTEST</programlisting>
+
+ <para>is equivalent to:</para>
+
+ <programlisting>OPTIONS_DEFINE= OPT1
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MOPT1}
+USES+= gmake
+.else
+CFLAGS+= -DTEST
+.endif</programlisting>
<note>
<para>Some variables are not in this list, in particular
@@ -4762,59 +4756,13 @@
would have a value of <literal>all</literal>.</para>
</warning>
- <sect4>
- <title><varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable></varname></title>
-
- <para>When option <replaceable>OPT</replaceable> is
- selected, the value of
- <varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable></varname>,
- if defined, is appended to
- <literal><replaceable>ABOVEVARIABLE</replaceable></literal>.
- For example:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-OPT1_USES= gmake
-OPT1_CFLAGS= -DTEST</programlisting>
-
- <para>is equivalent to:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MOPT1}
-USES+= gmake
-CFLAGS+= -DTEST
-.endif</programlisting>
- </sect4>
-
- <sect4>
- <title><varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable>_OFF</varname></title>
-
- <para>When option OPT is not selected, the value of
- <varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable>_OFF</varname>,
- if defined, is appended to
- <literal><replaceable>ABOVEVARIABLE</replaceable></literal>.
- For example:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-OPT1_USES_OFF= gmake</programlisting>
-
- <para>is equivalent to:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-
-.include <bsd.port.options.mk>
-
-.if ! ${PORT_OPTIONS:MOPT1}
-USES+= gmake
-.endif</programlisting>
-
- </sect4>
</sect3>
<sect3 xml:id="options-targets">
- <title>Additional Build Targets</title>
+ <title>Additional Build Targets,
+ <buildtarget><replaceable>TARGET</replaceable>-<replaceable>OPT</replaceable>-on</buildtarget>
+ and
+ <buildtarget><replaceable>TARGET</replaceable>-<replaceable>OPT</replaceable>-on</buildtarget></title>
<para>These <filename>Makefile</filename> targets can accept
optional extra build targets:</para>
@@ -4909,49 +4857,21 @@
</listitem>
</itemizedlist>
- <para>The additional build targets are listed below.</para>
-
- <sect4 xml:id="options-targets-on">
- <title><buildtarget><replaceable>ABOVETARGET</replaceable>-<replaceable>OPT</replaceable>-on</buildtarget></title>
-
<para>When option <replaceable>OPT</replaceable> is
selected, the target
- <buildtarget><replaceable>ABOVETARGET</replaceable>-<replaceable>OPT</replaceable>-on</buildtarget>,
+ <buildtarget><replaceable>TARGET</replaceable>-<replaceable>OPT</replaceable>-on</buildtarget>,
if defined, is executed after
- <buildtarget><replaceable>ABOVETARGET</replaceable></buildtarget>.
- For example:</para>
+ <buildtarget><replaceable>TARGET</replaceable></buildtarget>.
+ <buildtarget><replaceable>TARGET</replaceable>-<replaceable>OPT</replaceable>-off</buildtarget>
+ works the same way, but when <literal>OPT</literal> is not
+ selected. For example:</para>
<programlisting>OPTIONS_DEFINE= OPT1
post-patch-OPT1-on:
- @${REINPLACE_CMD} -e '/opt1/d' ${WRKSRC}/Makefile</programlisting>
-
- <para>is equivalent to:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-
-.include <bsd.port.options.mk>
-
-post-patch:
-.if ${PORT_OPTIONS:MOPT1}
@${REINPLACE_CMD} -e '/opt1/d' ${WRKSRC}/Makefile
-.endif</programlisting>
- </sect4>
-
- <sect4 xml:id="options-targets-off">
- <title><buildtarget><replaceable>ABOVETARGET</replaceable>-<replaceable>OPT</replaceable>-off</buildtarget></title>
-
- <para>When option <replaceable>OPT</replaceable> is
- not selected, the target
- <buildtarget><replaceable>ABOVETARGET</replaceable>-<replaceable>OPT</replaceable>-off</buildtarget>,
- if defined, is executed after
- <buildtarget><replaceable>ABOVETARGET</replaceable></buildtarget>.
- For example:</para>
-
- <programlisting>OPTIONS_DEFINE= OPT1
-
post-patch-OPT1-off:
- @${REINPLACE_CMD} -e '/opt1/d' ${WRKSRC}/Makefile</programlisting>
+ @${REINPLACE_CMD} -e '/opt1/s|/usr/bin/|${LOCALBASE}/bin/|' ${WRKSRC}/Makefile</programlisting>
<para>is equivalent to:</para>
@@ -4960,10 +4880,11 @@
.include <bsd.port.options.mk>
post-patch:
-.if !${PORT_OPTIONS:MOPT1}
+.if ${PORT_OPTIONS:MOPT1}
@${REINPLACE_CMD} -e '/opt1/d' ${WRKSRC}/Makefile
+.else
+ @${REINPLACE_CMD} -e '/opt1/s|/usr/bin/|${LOCALBASE}/bin/|' ${WRKSRC}/Makefile
.endif</programlisting>
- </sect4>
</sect3>
</sect2>
</sect1>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 11, 1:31 PM (13 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25163564
Default Alt Text
D3516.id8489.diff (17 KB)
Attached To
Mode
D3516: Add documentation about opt_VARS from D3410.
Attached
Detach File
Event Timeline
Log In to Comment