Check-in [c7d2304ea6]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix wording based on eadler remarks
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c7d2304ea63c8134a9eedc2cc6a142eba9bd7662
User & Date: bapt 2013-07-29 19:36:18
Context
2013-09-11
12:07
In port already check-in: b92f61b021 user: bapt tags: trunk
2013-07-29
19:36
Fix wording based on eadler remarks check-in: c7d2304ea6 user: bapt tags: trunk
19:27
Committed check-in: 7720d3e92f user: bapt tags: trunk
Changes

Changes to options-helpers.patch.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
..
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
..
50
51
52
53
54
55
56
57
58
59
60

61
62
63
64
65
66
67
68
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
..
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
...
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
...
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
...
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
Index: book.xml
===================================================================
diff --git a/head/en_US.ISO8859-1/books/porters-handbook/book.xml b/head/en_US.ISO8859-1/books/porters-handbook/book.xml
--- a/head/en_US.ISO8859-1/books/porters-handbook/book.xml	(revision 42469)
+++ b/head/en_US.ISO8859-1/books/porters-handbook/book.xml	(working copy)
@@ -4645,6 +4645,246 @@
 .if ${VARIABLE:MVALUE}</programlisting>
 	</note>
       </sect2>
+      <sect2>
+	<title>Options helpers</title>
+
+	<para>A couple of helpers exists to simplify handling actions
+	  based on the value of an option.</para>
+
+	<para>If <makevar>OPTIONS_SUB</makevar> is set to
+	  <literal>yes</literal> then all <makevar>PLIST_SUB<makevar>
+	  will be populated automatically for each options defined in
+	  <makevar>OPTIONS_DEFINE</makevar>, for example:</para>

+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPTIONS_SUB=	yes</programlisting>
+
+	<para> is equivalent to:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
................................................................................
+
+.if ${PORT_OPTIONS:MOPT1}
+PLIST_SUB+=	OPT1=""
+.else
+PLIST_SUB+=	OPT1="@comment "
+.endif</programlisting>
+
+	<para>If <makevar>X_CONFIGURE_ENABLE</makevar> is set then it
+	  will add <literal>--enable-${X_CONFIGURE_ENABLE}</literal>
+	  or <literal>--disable-${X_CONFIGURE_ENABLE}</literal> to
+	  <makevar>CONFIGURE_ARGS</makevar> depending on the value of the
+	  option<makevar>X</makevar>, for example:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CONFIGURE_ENABLE=	test</programlisting>
+
+	<para>is equivalent to:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
................................................................................
+
+.if ${PORT_OPTIONS:MOPT1}
+CONFIGURE_ARGS+=	--enable-test
+.else
+CONFIGURE_ARGS+=	--disable-test
+.endif</programlisting>
+
+	<para>If <makevar>X_CONFIGURE_WITH</makevar> is set then it
+	  will add <literal>--with-${X_CONFIGURE_WITH}</literal>
+	  or <literal>--without-${X_CONFIGURE_WITH}</literal> to
+	  <makevar>CONFIGURE_ARGS</makevar> depending on the value of the

+	  option<makevar>X</makevar>, for example:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CONFIGURE_WITH=	test</programlisting>
+
+	<para>is equivalent to:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
................................................................................
+.if ${PORT_OPTIONS:MOPT1}
+CONFIGURE_ARGS+=	--with-test
+.else
+CONFIGURE_ARGS+=	--without-test
+.endif</programlisting>
+
+	<para>If <makevar>X_CONFIGURE_ON</makevar> is set then its value
+	  will be appended to <makevar>CONFIGURE_ARGS</makevar> if
+	  the options <makevar>X</makevar> is activated, for example:
+	</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CONFIGURE_ON=	--add-test</programlisting>
+
+	<para>is equivalent to</para>
+
................................................................................
+.include &ls;bsd.port.options.mk&gt;
+
+.if ${PORT_OPTIONS:MOPT1}
+CONFIGURE_ARGS+=	--add-test
+.endif</programlisting>
+
+	<para>If <makevar>X_CONFIGURE_OFF</makevar> is set then its value
+	  will be appended to <makevar>CONFIGURE_ARGS</makevar> if
+	  the options <makevar>X</makevar> is deactivated, for example:
+	</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CONFIGURE_OFF=	--no-test</programlisting>
+
+	<para>is equivalent to</para>
+
................................................................................
+	<programlisting>OPTIONS_DEFINE=	OPT1
+.include &ls;bsd.port.options.mk&gt;
+.if ! ${PORT_OPTIONS:MOPT1}
+CONFIGURE_ARGS+=	--no-test
+.endif</programlisting>
+
+	<para>If <makevar>X_CMAKE_ON</makevar> is set then its value
+	  will be appended to <makevar>CMAKE_ARGS</makevar> if
+	  the options <makevar>X</makevar> is activated, for example:
+	</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CMAKE_ON=	-DTEST:BOOL=true</programlisting>
+
+	<para>is equivalent to</para>
+
................................................................................
+.include &ls;bsd.port.options.mk&gt;
+
+.if ${PORT_OPTIONS:MOPT1}
+CMAKE_ARGS+=	-DTEST:BOOL=true
+.endif</programlisting>
+
+	<para>If <makevar>X_CMAKE_OFF</makevar> is set then its value
+	  will be appended to <makevar>CMAKE_ARGS</makevar> if
+	  the options <makevar>X</makevar> is deactivated, for example:
+	</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CMAKE_OFF=	-DTEST:BOOL=false</programlisting>
+
+	<para>is equivalent to</para>
+
................................................................................
+	    <listitem>
+	      <para><makevar>DISTFILES</makevar>.</para>
+	    </listitem>
+	</itemizedlist>
+
+	<para>If <makevar>X_ABOVEVARIABLE</makevar> is defined then
+	  its value will be appended to
+	  <makevar>ABOVEVARIABLE</makevar> if <makevar>X</makevar>
+	  is activated, for example:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_USES=	gmake
+OPT1_CFLAGS=	-DTEST</programlisting>
+
+	<para>is equivalent to:</para>
+
................................................................................
+	    <listitem>
+	      <para><makevar>RUN_DEPENDS</makevar>.</para>
+	    </listitem>
+	</itemizedlist>
+
+	<para>If <makevar>X_ABOVEVARIABLE</makevar> is defined then
+	  its value will be appended to
+	  <makevar>ABOVEVARIABLE</makevar> if <makevar>X</makevar>
+	  is activated, for example:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_LIB_DEPENDS=	liba.so:${PORTSDIR}/devel/a</programlisting>
+
+	<para>is equivalent to:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1



|

|






|
|


|
<
|
>







 







|
|
|
|
|







 







|
|
|
|
>
|







 







|
|







 







|
|







 







|
|







 







|
|







 







|
|







 







|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
25
26
..
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
..
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
..
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
...
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
...
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
...
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
Index: book.xml
===================================================================
diff --git a/head/en_US.ISO8859-1/books/porters-handbook/book.xml b/head/en_US.ISO8859-1/books/porters-handbook/book.xml
--- a/head/en_US.ISO8859-1/books/porters-handbook/book.xml	(revision 42470)
+++ b/head/en_US.ISO8859-1/books/porters-handbook/book.xml	(working copy)
@@ -4629,6 +4629,247 @@
 .if ${VARIABLE:MVALUE}</programlisting>
 	</note>
       </sect2>
+      <sect2>
+	<title>Options helpers</title>
+
+	<para>There are some macros to help simplify conditional
+	  values which differ based on the options set.</para>
+
+	<para>If <makevar>OPTIONS_SUB</makevar> is set to
+	  <literal>yes</literal> then each of the options added 

+	  to <makevar>OPTIONS_DEFINE</makevar> will be added to 
+	  <makevar>PLIST_SUB<makevar>.  For example,</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPTIONS_SUB=	yes</programlisting>
+
+	<para> is equivalent to:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
................................................................................
+
+.if ${PORT_OPTIONS:MOPT1}
+PLIST_SUB+=	OPT1=""
+.else
+PLIST_SUB+=	OPT1="@comment "
+.endif</programlisting>
+
+	<para>If <makevar>X_CONFIGURE_ENABLE</makevar> is set then
+	  <literal>--enable-${X_CONFIGURE_ENABLE}</literal>
+	  or <literal>--disable-${X_CONFIGURE_ENABLE}</literal> will
+	  be added to <makevar>CONFIGURE_ARGS</makevar> depending on
+	  the value of the option<makevar>X</makevar>, for example:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CONFIGURE_ENABLE=	test</programlisting>
+
+	<para>is equivalent to:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
................................................................................
+
+.if ${PORT_OPTIONS:MOPT1}
+CONFIGURE_ARGS+=	--enable-test
+.else
+CONFIGURE_ARGS+=	--disable-test
+.endif</programlisting>
+
+	<para>If <makevar>X_CONFIGURE_WITH</makevar> is set then
+	  <literal>--with-${X_CONFIGURE_WITH}</literal>
+	  or <literal>--without-${X_CONFIGURE_WITH}</literal> will
+	  be added to <makevar>CONFIGURE_ARGS</makevar> depending 
+	  on the status of the option <makevar>X</makevar>,
+	  for example:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CONFIGURE_WITH=	test</programlisting>
+
+	<para>is equivalent to:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
................................................................................
+.if ${PORT_OPTIONS:MOPT1}
+CONFIGURE_ARGS+=	--with-test
+.else
+CONFIGURE_ARGS+=	--without-test
+.endif</programlisting>
+
+	<para>If <makevar>X_CONFIGURE_ON</makevar> is set then its value
+	  will be appended to <makevar>CONFIGURE_ARGS</makevar> depending
+	  on the status of the option <makevar>X</makevar>, for example:
+	</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CONFIGURE_ON=	--add-test</programlisting>
+
+	<para>is equivalent to</para>
+
................................................................................
+.include &ls;bsd.port.options.mk&gt;
+
+.if ${PORT_OPTIONS:MOPT1}
+CONFIGURE_ARGS+=	--add-test
+.endif</programlisting>
+
+	<para>If <makevar>X_CONFIGURE_OFF</makevar> is set then its value
+	  will be appended to <makevar>CONFIGURE_ARGS</makevar> depending
+	  on the status of the option <makevar>X</makevar>, for example:
+	</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CONFIGURE_OFF=	--no-test</programlisting>
+
+	<para>is equivalent to</para>
+
................................................................................
+	<programlisting>OPTIONS_DEFINE=	OPT1
+.include &ls;bsd.port.options.mk&gt;
+.if ! ${PORT_OPTIONS:MOPT1}
+CONFIGURE_ARGS+=	--no-test
+.endif</programlisting>
+
+	<para>If <makevar>X_CMAKE_ON</makevar> is set then its value
+	  will be appended to <makevar>CMAKE_ARGS</makevar> depending
+	  on the status of the option <makevar>X</makevar>, for example:
+	</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CMAKE_ON=	-DTEST:BOOL=true</programlisting>
+
+	<para>is equivalent to</para>
+
................................................................................
+.include &ls;bsd.port.options.mk&gt;
+
+.if ${PORT_OPTIONS:MOPT1}
+CMAKE_ARGS+=	-DTEST:BOOL=true
+.endif</programlisting>
+
+	<para>If <makevar>X_CMAKE_OFF</makevar> is set then its value
+	  will be appended to <makevar>CMAKE_ARGS</makevar> depending
+	  on the staus of the option <makevar>X</makevar>, for example:
+	</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_CMAKE_OFF=	-DTEST:BOOL=false</programlisting>
+
+	<para>is equivalent to</para>
+
................................................................................
+	    <listitem>
+	      <para><makevar>DISTFILES</makevar>.</para>
+	    </listitem>
+	</itemizedlist>
+
+	<para>If <makevar>X_ABOVEVARIABLE</makevar> is defined then
+	  its value will be appended to
+	  <makevar>ABOVEVARIABLE</makevar> depending on the status of
+	  the option <makevar>X</makevar>, for example:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_USES=	gmake
+OPT1_CFLAGS=	-DTEST</programlisting>
+
+	<para>is equivalent to:</para>
+
................................................................................
+	    <listitem>
+	      <para><makevar>RUN_DEPENDS</makevar>.</para>
+	    </listitem>
+	</itemizedlist>
+
+	<para>If <makevar>X_ABOVEVARIABLE</makevar> is defined then
+	  its value will be appended to
+	  <makevar>ABOVEVARIABLE</makevar> depending on the status
+	  of the option  <makevar>X</makevar>, for example:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_LIB_DEPENDS=	liba.so:${PORTSDIR}/devel/a</programlisting>
+
+	<para>is equivalent to:</para>
+
+	<programlisting>OPTIONS_DEFINE=	OPT1