3 # These variables are used in port makefiles to define the options for a port.
5 # OPTIONS_DEFINE - List of options this ports accept
6 # OPTIONS_DEFINE_${ARCH} - List of options this ports accept and are
8 # OPTIONS_DEFAULT - List of options activated by default
9 # OPTIONS_DEFAULT_${ARCH} - List of options activated by default for a
12 # ${OPTION}_DESC - Description of the ${OPTION}
14 # OPTIONS_SINGLE - List of single-choice grouped options: 1 and
16 # OPTIONS_RADIO - List of radio-choice grouped options: 0 or 1
18 # OPTIONS_MULTI - List of multiple-choice grouped options: at
20 # OPTIONS_GROUP - List of group-choice grouped options: 0 or
23 # OPTIONS_SINGLE_${NAME} - List of OPTIONS grouped as single choice (for
24 # the single named as ${NAME} as defined in
26 # OPTIONS_RADIO_${NAME} - List of OPTIONS grouped as radio choice (for
27 # the radio named as ${NAME} as defined in
29 # OPTIONS_MULTI_${NAME} - List of OPTIONS grouped as multiple-choice
30 # (for the multi named as ${NAME} as defined in
32 # OPTIONS_GROUP_${NAME} - List of OPTIONS grouped as group-choice (for
33 # the group named as ${NAME} as defined in
36 # OPTIONS_EXCLUDE - List of options unsupported (useful for slave ports)
37 # OPTIONS_EXCLUDE_${ARCH} - List of options unsupported on a given ${ARCH}
38 # OPTIONS_EXCLUDE_${OPSYS} - List of options unsupported on a given ${OPSYS}
39 # OPTIONS_EXCLUDE_${OPSYS}_${OSREL:R} - List of options unsupported on a given
40 # ${OPSYS} and major version (11/12/13...)
41 # OPTIONS_SLAVE - This is designed for slave ports, it removes an
42 # option from the options list inherited from the
43 # master port and it always adds it to PORT_OPTIONS
46 # These variables can be used in make.conf to configure options. They are
47 # processed in the order listed below, i.e. later variables override the effects
48 # of previous variables. Options saved using the options dialog are processed
49 # right before OPTIONS_SET_FORCE. When building a port a dialog to configure
50 # options will only appear if there are new options, i.e. options which have not
51 # been configured before either using the option dialog in a previous build or
52 # using the variables below. You can force the dialog to appear by running
55 # OPTIONS_SET - List of options to enable for all ports.
56 # OPTIONS_UNSET - List of options to disable for all ports.
57 # ${OPTIONS_NAME}_SET - List of options to enable for a specific port.
58 # ${OPTIONS_NAME}_UNSET - List of options to disable for a specific port.
60 # OPTIONS_SET_FORCE - List of options to enable for all ports.
61 # OPTIONS_UNSET_FORCE - List of options to disable for all ports.
62 # ${OPTIONS_NAME}_SET_FORCE - List of options to enable for a specific port.
63 # ${OPTIONS_NAME}_UNSET_FORCE
64 # - List of options to disable for a specific port.
66 # These variables can be used on the command line. They override the effects of
67 # the make.conf variables above.
69 # WITH - Set options from the command line
70 # WITHOUT - Unset options from the command line
73 # These variables are strictly informational (read-only). They indicate the
74 # current state of the selected options; they are space-delimited lists.
76 # SELECTED_OPTIONS - list of options set "on"
77 # DESELECTED_OPTIONS - list of options set "off"
80 # The following knobs are there to simplify the handling of OPTIONS in simple
83 # OPTIONS_SUB When defined it will add to PLIST_SUB:
84 # Option enabled ${opt}=""
85 # Option disabled ${opt}="@comment "
87 # ${opt}_CONFIGURE_ON When option is enabled, it will add its content to
89 # ${opt}_CONFIGURE_OFF When option is disabled, it will add its content to
91 # ${opt}_CONFIGURE_ENABLE Will add to CONFIGURE_ARGS:
92 # Option enabled --enable-${content}
93 # Option disabled --disable-${content}
94 # ${opt}_CONFIGURE_WITH Will add to CONFIGURE_ARGS:
95 # Option enabled --with-${content}
96 # Option disabled --without-${content}
98 # ${opt}_CMAKE_ON When option is enabled, it will add its content to
100 # ${opt}_CMAKE_OFF When option is disabled, it will add its content to
103 # ${opt}_CMAKE_BOOL Will add to CMAKE_ARGS:
104 # Option enabled -D${content}:BOOL=true
105 # Option disabled -D${content}:BOOL=false
106 # ${opt}_CMAKE_BOOL_OFF Will add to CMAKE_ARGS:
107 # Option enabled -D${content}:BOOL=false
108 # Option disabled -D${content}:BOOL=true
110 # ${opt}_QMAKE_ON When option is enabled, it will add its content to
112 # ${opt}_QMAKE_OFF When option is disabled, it will add its content to
115 # ${opt}_MESON_ON When option is enabled, it will add its
116 # content to MESON_ARGS.
117 # ${opt}_MESON_OFF When option is disabled, it will add its
118 # content to MESON_ARGS.
120 # ${opt}_MESON_TRUE Will add to MESON_ARGS:
121 # Option enabled -D${content}=true
122 # Option disabled -D${content}=false
123 # ${opt}_MESON_FALSE Will add to MESON_ARGS:
124 # Option enabled -D${content}=false
125 # Option disabled -D${content}=true
127 # ${opt}_MESON_YES Will add to MESON_ARGS:
128 # Option enabled -D${content}=yes
129 # Option disabled -D${content}=no
130 # ${opt}_MESON_NO Will add to MESON_ARGS:
131 # Option enabled -D${content}=no
132 # Option disabled -D${content}=yes
134 # ${opt}_MESON_ENABLED Will add to MESON_ARGS:
135 # Option enabled -D${content}=enabled
136 # Option disabled -D${content}=disabled
137 # ${opt}_MESON_DISABLED Will add to MESON_ARGS:
138 # Option enabled -D${content}=disabled
139 # Option disabled -D${content}=enabled
141 # ${opt}_IMPLIES When opt is enabled, options named in IMPLIES will
143 # ${opt}_PREVENTS When opt is enabled, if any options in PREVENTS are
144 # also enabled, it will produce an error.
145 # ${opt}_PREVENTS_MSG Provides a message explaining why the options
146 # cannot be selected together.
148 # ${opt}_USE= FOO=bar When option is enabled, it will enable
150 # If you need more than one option, you can do
151 # FOO=bar,baz and you'll get USE_FOO=bar baz
152 # ${opt}_USE_OFF= FOO=bar When option is disabled, it will enable
155 # ${opt}_VARS= FOO=bar When option is enabled, it will set
157 # ${opt}_VARS= FOO+=bar When option is enabled, it will append
159 # ${opt}_VARS_OFF= FOO=bar When option is disabled, it will set
161 # ${opt}_VARS_OFF= FOO+=bar When option is disabled, it will append
164 # For each of the depends target PKG FETCH EXTRACT PATCH BUILD LIB RUN,
165 # defining ${opt}_${deptype}_DEPENDS will add its content to the actual
166 # dependency when the option is enabled. Defining
167 # ${opt}_${deptype}_DEPENDS_OFF will add its content to the actual dependency
168 # when the option is disabled.
170 # For each of the variables in _OPTIONS_FLAGS below, defining
171 # ${opt}_${variable} will add its content to the actual variable when the
172 # option is enabled. Defining ${opt}_${variable}_OFF will add its content to
173 # the actual variable when the option is disabled.
176 # Set all the options available for the ports, beginning with the
177 # global ones and ending with the ones decided by the maintainer.
179 .if !defined(OPTIONSMKINCLUDED)
180 OPTIONSMKINCLUDED= bsd.options.mk
182 OPTIONS_NAME?= ${PKGORIGIN:S/\//_/}
183 OPTIONS_FILE?= ${PORT_DBDIR}/${OPTIONS_NAME}/options
185 _OPTIONS_FLAGS= ALL_TARGET BROKEN CATEGORIES CFLAGS CONFIGURE_ENV CONFLICTS \
186 CONFLICTS_BUILD CONFLICTS_INSTALL CPPFLAGS CXXFLAGS \
187 DESKTOP_ENTRIES DISTFILES EXECUTABLES EXTRA_PATCHES EXTRACT_ONLY \
188 GH_ACCOUNT GH_PROJECT GH_SUBDIR GH_TAGNAME GH_TUPLE \
189 GL_ACCOUNT GL_COMMIT GL_PROJECT GL_SITE GL_SUBDIR GL_TUPLE \
190 IGNORE INFO INSTALL_TARGET LDFLAGS LIBS MAKE_ARGS MAKE_ENV \
191 MASTER_SITES PATCHFILES PATCH_SITES PLIST_DIRS PLIST_FILES \
192 PLIST_SUB PORTDOCS PORTEXAMPLES SUB_FILES SUB_LIST \
193 TEST_TARGET USE_CABAL USES BINARY_ALIAS
194 _OPTIONS_DEPENDS= PKG FETCH EXTRACT PATCH BUILD LIB RUN TEST
195 _ALL_OPTIONS_HELPERS= ${_OPTIONS_DEPENDS:S/$/_DEPENDS/} \
196 ${_OPTIONS_DEPENDS:S/$/_DEPENDS_OFF/} \
197 ${_OPTIONS_FLAGS:S/$/_OFF/} ${_OPTIONS_FLAGS} \
198 CABAL_FLAGS CMAKE_BOOL CMAKE_BOOL_OFF CMAKE_OFF CMAKE_ON \
199 CONFIGURE_ENABLE CONFIGURE_OFF CONFIGURE_ON \
200 CONFIGURE_WITH IMPLIES MESON_ARGS MESON_DISABLED \
201 MESON_ENABLED MESON_FALSE MESON_OFF MESON_ON MESON_TRUE \
202 PREVENTS PREVENTS_MSG QMAKE_OFF QMAKE_ON USE USE_OFF \
205 # The format here is target_family:priority:target-type
206 _OPTIONS_TARGETS= fetch:300:pre fetch:500:do fetch:700:post \
207 extract:300:pre extract:500:do extract:700:post \
208 patch:300:pre patch:500:do patch:700:post \
209 configure:300:pre configure:500:do configure:700:post \
210 build:300:pre build:500:do build:700:post \
211 install:300:pre install:500:do install:700:post \
212 test:300:pre test:500:do test:700:post \
213 package:300:pre package:500:do package:700:post \
216 # Add per arch options
217 .for opt in ${OPTIONS_DEFINE_${ARCH}}
218 .if empty(OPTIONS_DEFINE:M${opt})
219 OPTIONS_DEFINE+= ${opt}
223 # Add per arch defaults
224 OPTIONS_DEFAULT+= ${OPTIONS_DEFAULT_${ARCH}}
226 _ALL_EXCLUDE= ${OPTIONS_EXCLUDE_${ARCH}} ${OPTIONS_EXCLUDE} \
227 ${OPTIONS_SLAVE} ${OPTIONS_EXCLUDE_${OPSYS}} \
228 ${OPTIONS_EXCLUDE_${OPSYS}_${OSREL:R}}
230 .for opt in ${OPTIONS_DEFINE:O:u}
231 . if !${_ALL_EXCLUDE:M${opt}}
232 . for opt_implied in ${${opt}_IMPLIES}
233 . if ${_ALL_EXCLUDE:M${opt_implied}}
234 _ALL_EXCLUDE+= ${opt}
240 # Remove options the port maintainer doesn't want, part 1
241 .for opt in ${_ALL_EXCLUDE:O:u}
242 OPTIONS_DEFAULT:= ${OPTIONS_DEFAULT:N${opt}}
243 OPTIONS_DEFINE:= ${OPTIONS_DEFINE:N${opt}}
244 . for otype in SINGLE RADIO MULTI GROUP
245 . for m in ${OPTIONS_${otype}}
246 OPTIONS_${otype}_${m}:= ${OPTIONS_${otype}_${m}:N${opt}}
251 # Remove empty SINGLE/GROUP/RADIO/MULTI
252 # Can be empty because of exclude/slaves
253 .for otype in SINGLE RADIO MULTI GROUP
254 . for m in ${OPTIONS_${otype}}
255 . if empty(OPTIONS_${otype}_${m})
256 OPTIONS_${otype}:= ${OPTIONS_${otype}:N${m}}
262 ALL_OPTIONS:= ${OPTIONS_DEFINE:O:u}
263 OPTIONS_DEFAULT:= ${OPTIONS_DEFAULT:O:u}
266 COMPLETE_OPTIONS_LIST= ${ALL_OPTIONS}
267 .for otype in SINGLE RADIO MULTI GROUP
268 . for m in ${OPTIONS_${otype}}
269 COMPLETE_OPTIONS_LIST+= ${OPTIONS_${otype}_${m}}
273 # Some options are always enabled by default.
274 .for _opt in DOCS NLS EXAMPLES IPV6
275 .if ${COMPLETE_OPTIONS_LIST:M${_opt}}
276 PORT_OPTIONS+= ${_opt}
280 # Remove options the port maintainer doesn't want, part 2
281 .for opt in ${_ALL_EXCLUDE:O:u}
282 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
285 ## Now create the list of activated options
286 .if defined(OPTIONS_OVERRIDE)
287 # Special case $OPTIONS_OVERRIDE; if it is defined forget about anything done
290 PORT_OPTIONS:= ${OPTIONS_OVERRIDE}
292 NEW_OPTIONS= ${COMPLETE_OPTIONS_LIST}
294 ## Set default options defined by the port maintainer
295 PORT_OPTIONS+= ${OPTIONS_DEFAULT}
297 ## Set system-wide defined options (set by user in make.conf)
298 . for opt in ${OPTIONS_SET}
299 . if !empty(COMPLETE_OPTIONS_LIST:M${opt})
300 PORT_OPTIONS+= ${opt}
301 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
305 ## Remove the options excluded system-wide (set by user in make.conf)
306 . for opt in ${OPTIONS_UNSET}
307 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
308 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
311 ## Set the options specified per-port (set by user in make.conf)
312 . for opt in ${${OPTIONS_NAME}_SET}
313 . if !empty(COMPLETE_OPTIONS_LIST:M${opt})
314 PORT_OPTIONS+= ${opt}
315 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
319 ## Unset the options excluded per-port (set by user in make.conf)
320 . for opt in ${${OPTIONS_NAME}_UNSET}
321 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
322 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
325 ## options files (from dialog)
326 . if exists(${OPTIONS_FILE}) && !make(rmconfig)
327 . include "${OPTIONS_FILE}"
329 . sinclude "${OPTIONS_FILE}.local"
331 _OPTIONS_UNIQUENAME= ${PKGNAMEPREFIX}${PORTNAME}
332 .for _k in SET UNSET SET_FORCE UNSET_FORCE
333 .if defined(${_OPTIONS_UNIQUENAME}_${_k})
334 WARNING+= "You are using ${_OPTIONS_UNIQUENAME}_${_k} which is not supported any more, use:"
335 WARNING+= "${OPTIONS_NAME}_${_k}= ${${_OPTIONS_UNIQUENAME}_${_k}}"
339 ## Finish by using the options set by the port config dialog, if any
340 . for opt in ${OPTIONS_FILE_SET}
341 . if !empty(COMPLETE_OPTIONS_LIST:M${opt})
342 PORT_OPTIONS+= ${opt}
343 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
347 .for opt in ${OPTIONS_FILE_UNSET}
348 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
349 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
355 ## Set system-wide defined options (set by user in make.conf)
356 . for opt in ${OPTIONS_SET_FORCE}
357 . if !empty(COMPLETE_OPTIONS_LIST:M${opt})
358 PORT_OPTIONS+= ${opt}
359 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
363 ## Remove the options excluded system-wide (set by user in make.conf)
364 . for opt in ${OPTIONS_UNSET_FORCE}
365 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
366 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
369 ## Set the options specified per-port (set by user in make.conf)
370 . for opt in ${${OPTIONS_NAME}_SET_FORCE}
371 . if !empty(COMPLETE_OPTIONS_LIST:M${opt})
372 PORT_OPTIONS+= ${opt}
373 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
377 ## Unset the options excluded per-port (set by user in make.conf)
378 . for opt in ${${OPTIONS_NAME}_UNSET_FORCE}
379 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
380 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
384 ## Cmdline always win over the rest
386 . if !empty(COMPLETE_OPTIONS_LIST:M${opt})
387 PORT_OPTIONS+= ${opt}
388 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
392 .for opt in ${WITHOUT}
393 PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
394 NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
397 ## Enable options implied by other options
398 # _PREVENTS is handled in bsd.port.mk:pre-check-config
399 ## 1) Build dependency chain in A.B format:
401 .for opt in ${COMPLETE_OPTIONS_LIST}
402 . for o in ${${opt}_IMPLIES}
403 _DEPCHAIN+= ${opt}.$o
406 ## 2) Check each dependency pair and if LHS is in PORT_OPTIONS then add RHS.
407 ## All of RHS of "RHS.*" (i.e. indirect dependency) are also added for
409 _PORT_OPTIONS:= ${PORT_OPTIONS}
410 .for _count in _0 ${COMPLETE_OPTIONS_LIST}
412 ### Check if all of the nested dependency are resolved already.
413 . if ${count} == _0 || ${_PORT_OPTIONS} != ${PORT_OPTIONS}
414 PORT_OPTIONS:= ${_PORT_OPTIONS}
415 . for dc in ${_DEPCHAIN}
416 . for opt in ${_PORT_OPTIONS}
418 ### Add all of direct and indirect dependency only if
419 ### they are not in ${PORT_OPTIONS}.
420 . if !empty(_opt:M${dc:R})
421 . for d in ${dc:E} ${_DEPCHAIN:M${dc:E}.*:E}
422 . if empty(_PORT_OPTIONS:M$d)
432 # Finally, add options required by slave ports
433 PORT_OPTIONS+= ${OPTIONS_SLAVE}
435 # Sort options and eliminate duplicates
436 PORT_OPTIONS:= ${PORT_OPTIONS:O:u}
438 _REALLY_ALL_POSSIBLE_OPTIONS:= ${COMPLETE_OPTIONS_LIST} ${_ALL_EXCLUDE}
439 _REALLY_ALL_POSSIBLE_OPTIONS:= ${_REALLY_ALL_POSSIBLE_OPTIONS:O:u}
441 # Handle PORTDOCS and PORTEXAMPLES
442 .for _type in DOCS EXAMPLES
443 . if !empty(_REALLY_ALL_POSSIBLE_OPTIONS:M${_type})
444 . if empty(PORT_OPTIONS:M${_type})
445 PLIST_SUB+= PORT${_type}="@comment "
447 PLIST_SUB+= PORT${_type}=""
452 .if defined(NO_OPTIONS_SORT)
453 ALL_OPTIONS= ${OPTIONS_DEFINE}
456 .for target in ${_OPTIONS_TARGETS:C/:.*//:u}
460 .for opt in ${_REALLY_ALL_POSSIBLE_OPTIONS}
464 . if defined(OPTIONS_SUB)
465 . if ! ${PLIST_SUB:M${opt}=*}
466 . if ${PORT_OPTIONS:M${opt}}
467 PLIST_SUB:= ${PLIST_SUB} ${opt}="" NO_${opt}="@comment "
469 PLIST_SUB:= ${PLIST_SUB} ${opt}="@comment " NO_${opt}=""
472 . if ! ${SUB_LIST:M${opt}=*}
473 . if ${PORT_OPTIONS:M${opt}}
474 SUB_LIST:= ${SUB_LIST} ${opt}="" NO_${opt}="@comment "
476 SUB_LIST:= ${SUB_LIST} ${opt}="@comment " NO_${opt}=""
481 . if ${PORT_OPTIONS:M${opt}}
482 . if defined(${opt}_USE)
483 . for option in ${${opt}_USE:C/=.*//:O:u}
485 USE_${_u:tu}+= ${${opt}_USE:M${option}=*:C/.*=//g:C/,/ /g}
488 . if defined(${opt}_VARS)
489 . for var in ${${opt}_VARS:C/=.*//:O:u}
492 ${_u:C/.$//:tu}+= ${${opt}_VARS:M${var}=*:C/[^+]*\+=//:C/^"(.*)"$$/\1/}
494 ${_u:tu}= ${${opt}_VARS:M${var}=*:C/[^=]*=//:C/^"(.*)"$$/\1/}
498 . if defined(${opt}_CONFIGURE_ENABLE)
499 CONFIGURE_ARGS+= ${${opt}_CONFIGURE_ENABLE:S/^/--enable-/}
501 . if defined(${opt}_CONFIGURE_WITH)
502 CONFIGURE_ARGS+= ${${opt}_CONFIGURE_WITH:S/^/--with-/}
504 . if defined(${opt}_CMAKE_BOOL)
505 CMAKE_ARGS+= ${${opt}_CMAKE_BOOL:C/.*/-D&:BOOL=true/}
507 . if defined(${opt}_CMAKE_BOOL_OFF)
508 CMAKE_ARGS+= ${${opt}_CMAKE_BOOL_OFF:C/.*/-D&:BOOL=false/}
510 . if defined(${opt}_MESON_TRUE)
511 MESON_ARGS+= ${${opt}_MESON_TRUE:C/.*/-D&=true/}
513 . if defined(${opt}_MESON_FALSE)
514 MESON_ARGS+= ${${opt}_MESON_FALSE:C/.*/-D&=false/}
516 . if defined(${opt}_MESON_YES)
517 MESON_ARGS+= ${${opt}_MESON_YES:C/.*/-D&=yes/}
519 . if defined(${opt}_MESON_NO)
520 MESON_ARGS+= ${${opt}_MESON_NO:C/.*/-D&=no/}
522 . if defined(${opt}_MESON_ENABLED)
523 MESON_ARGS+= ${${opt}_MESON_ENABLED:C/.*/-D&=enabled/}
525 . if defined(${opt}_MESON_DISABLED)
526 MESON_ARGS+= ${${opt}_MESON_DISABLED:C/.*/-D&=disabled/}
528 . if defined(${opt}_CABAL_FLAGS)
529 CABAL_FLAGS+= ${${opt}_CABAL_FLAGS}
531 . for configure in CONFIGURE CMAKE MESON QMAKE
532 . if defined(${opt}_${configure}_ON)
533 ${configure}_ARGS+= ${${opt}_${configure}_ON}
536 . for flags in ${_OPTIONS_FLAGS}
537 . if defined(${opt}_${flags})
538 ${flags}+= ${${opt}_${flags}}
541 . for deptype in ${_OPTIONS_DEPENDS}
542 . if defined(${opt}_${deptype}_DEPENDS)
543 ${deptype}_DEPENDS+= ${${opt}_${deptype}_DEPENDS}
546 . for target in ${_OPTIONS_TARGETS}
547 _target= ${target:C/:.*//}
548 _prio= ${target:C/.*:(.*):.*/\1/}
549 _type= ${target:C/.*://}
550 _OPTIONS_${_target}:= ${_OPTIONS_${_target}} ${_prio}:${_type}-${_target}-${opt}-on
553 . if defined(${opt}_USE_OFF)
554 . for option in ${${opt}_USE_OFF:C/=.*//:O:u}
556 USE_${_u:tu}+= ${${opt}_USE_OFF:M${option}=*:C/.*=//g:C/,/ /g}
559 . if defined(${opt}_VARS_OFF)
560 . for var in ${${opt}_VARS_OFF:C/=.*//:O:u}
563 ${_u:C/.$//:tu}+= ${${opt}_VARS_OFF:M${var}=*:C/[^+]*\+=//:C/^"(.*)"$$/\1/}
565 ${_u:tu}= ${${opt}_VARS_OFF:M${var}=*:C/[^=]*=//:C/^"(.*)"$$/\1/}
569 . if defined(${opt}_CONFIGURE_ENABLE)
570 CONFIGURE_ARGS+= ${${opt}_CONFIGURE_ENABLE:S/^/--disable-/:C/=.*//}
572 . if defined(${opt}_CONFIGURE_WITH)
573 CONFIGURE_ARGS+= ${${opt}_CONFIGURE_WITH:S/^/--without-/:C/=.*//}
575 . if defined(${opt}_CMAKE_BOOL)
576 CMAKE_ARGS+= ${${opt}_CMAKE_BOOL:C/.*/-D&:BOOL=false/}
578 . if defined(${opt}_CMAKE_BOOL_OFF)
579 CMAKE_ARGS+= ${${opt}_CMAKE_BOOL_OFF:C/.*/-D&:BOOL=true/}
581 . if defined(${opt}_MESON_TRUE)
582 MESON_ARGS+= ${${opt}_MESON_TRUE:C/.*/-D&=false/}
584 . if defined(${opt}_MESON_FALSE)
585 MESON_ARGS+= ${${opt}_MESON_FALSE:C/.*/-D&=true/}
587 . if defined(${opt}_MESON_YES)
588 MESON_ARGS+= ${${opt}_MESON_YES:C/.*/-D&=no/}
590 . if defined(${opt}_MESON_NO)
591 MESON_ARGS+= ${${opt}_MESON_NO:C/.*/-D&=yes/}
593 . if defined(${opt}_MESON_ENABLED)
594 MESON_ARGS+= ${${opt}_MESON_ENABLED:C/.*/-D&=disabled/}
596 . if defined(${opt}_MESON_DISABLED)
597 MESON_ARGS+= ${${opt}_MESON_DISABLED:C/.*/-D&=enabled/}
599 . if defined(${opt}_CABAL_FLAGS)
600 CABAL_FLAGS+= -${${opt}_CABAL_FLAGS}
602 . for configure in CONFIGURE CMAKE MESON QMAKE
603 . if defined(${opt}_${configure}_OFF)
604 ${configure}_ARGS+= ${${opt}_${configure}_OFF}
607 . for flags in ${_OPTIONS_FLAGS}
608 . if defined(${opt}_${flags}_OFF)
609 ${flags}+= ${${opt}_${flags}_OFF}
612 . for deptype in ${_OPTIONS_DEPENDS}
613 . if defined(${opt}_${deptype}_DEPENDS_OFF)
614 ${deptype}_DEPENDS+= ${${opt}_${deptype}_DEPENDS_OFF}
617 . for target in ${_OPTIONS_TARGETS}
618 _target= ${target:C/:.*//}
619 _prio= ${target:C/.*:(.*):.*/\1/}
620 _type= ${target:C/.*://}
621 _OPTIONS_${_target}:= ${_OPTIONS_${_target}} ${_prio}:${_type}-${_target}-${opt}-off
626 # Collect which options helpers are defined at this point for
627 # bsd.sanity.mk later to make sure no other options helper is
628 # defined after bsd.port.options.mk.
629 _OPTIONS_HELPERS_SEEN=
630 .for opt in ${_REALLY_ALL_POSSIBLE_OPTIONS}
631 . for helper in ${_ALL_OPTIONS_HELPERS}
632 . if defined(${opt}_${helper})
633 _OPTIONS_HELPERS_SEEN+= ${opt}_${helper}
638 .undef (SELECTED_OPTIONS)
639 .undef (DESELECTED_OPTIONS)
640 # Wait to expand PORT_OPTIONS until the last moment in case something modifies
641 # the selected OPTIONS after bsd.port.options.mk is included. This uses
642 # bmake's :@ for loop.
643 _SELECTED_OPTIONS= ${ALL_OPTIONS:@opt@${PORT_OPTIONS:M${opt}}@}
644 _DESELECTED_OPTIONS= ${ALL_OPTIONS:@opt@${"${PORT_OPTIONS:M${opt}}":?:${opt}}@}
645 .for otype in MULTI GROUP SINGLE RADIO
646 . for m in ${OPTIONS_${otype}}
647 _SELECTED_OPTIONS+= ${OPTIONS_${otype}_${m}:@opt@${PORT_OPTIONS:M${opt}}@}
648 _DESELECTED_OPTIONS+= ${OPTIONS_${otype}_${m}:@opt@${"${PORT_OPTIONS:M${opt}}":?:${opt}}@}
651 SELECTED_OPTIONS= ${_SELECTED_OPTIONS:O:u}
652 DESELECTED_OPTIONS= ${_DESELECTED_OPTIONS:O:u}