diff --git a/Mk/bsd.options.mk b/Mk/bsd.options.mk index f399660412af..f4581ae13710 100644 --- a/Mk/bsd.options.mk +++ b/Mk/bsd.options.mk @@ -68,6 +68,13 @@ # WITHOUT - Unset options from the command line # # +# These variables are strictly informational (read-only). They indicate the +# current state of the selected options; they are space-delimited lists. +# +# SELECTED_OPTIONS - list of options set "on" +# DESELECTED_OPTIONS - list of options set "off" +# +# # The following knobs are there to simplify the handling of OPTIONS in simple # cases : # @@ -573,4 +580,25 @@ _OPTIONS_${_target}:= ${_OPTIONS_${_target}} ${_prio}:${_type}-${_target}-${opt} . endif .endfor +.undef (SELECTED_OPTIONS) +.undef (DESELECTED_OPTIONS) +.for opt in ${ALL_OPTIONS} +. if ${PORT_OPTIONS:M${opt}} +SELECTED_OPTIONS:= ${opt} ${SELECTED_OPTIONS} +. else +DESELECTED_OPTIONS:= ${opt} ${DESELECTED_OPTIONS} +. endif +.endfor +.for otype in MULTI GROUP SINGLE RADIO +. for m in ${OPTIONS_${otype}} +. for opt in ${OPTIONS_${otype}_${m}} +. if ${PORT_OPTIONS:M${opt}} +SELECTED_OPTIONS:= ${opt} ${SELECTED_OPTIONS} +. else +DESELECTED_OPTIONS:= ${opt} ${DESELECTED_OPTIONS} +. endif +. endfor +. endfor +.endfor + .endif