Index: bsd.options.mk =================================================================== --- bsd.options.mk +++ bsd.options.mk @@ -7,7 +7,7 @@ # specific to ${ARCH} # OPTIONS_DEFAULT - List of options activated by default # OPTIONS_DEFAULT_${ARCH} - List of options activated by default for a -# given arch +# given ${ARCH} # # ${OPTION}_DESC - Description of the ${OPTION} # @@ -158,7 +158,52 @@ PORT_OPTIONS+= IPV6 -# Add per arch options +### Parse new extended syntax OPTIONS knob (architecture-independent) +.for opt in ${OPTIONS:N*/*:N*!*} +OPTIONS_DEFINE+= ${opt:C~:.*~~} +OPTIONS_DEFAULT+= ${opt:M*\:on:S~:on~~} +.endfor + +# Process known option groups (only architecture exclusion supported) +.for otype in SINGLE RADIO MULTI GROUP +. for group in ${OPTIONS_${otype}} +# Here we need the temporary variables because of the := operator used few +# lines below +_exclude:= ${OPTIONS_${otype}_${group}:M*!*} +_default:= ${OPTIONS_${otype}_${group}:M*\:on*:C~:.*~~} +OPTIONS_DEFAULT+= ${_default} +OPTIONS_${otype}_${group}:= ${OPTIONS_${otype}_${group}:C~[:!].*~~} +. for opt in ${_exclude} +. for arch in ${opt:C~.*!~~:S~,~ ~g} +OPTIONS_EXCLUDE_${arch}+= ${opt:C~[:!].*~~} +. endfor +. endfor +. endfor +.endfor + +# Process architecture-specific options +.for opt in ${OPTIONS:M*/*} +. for arch in ${opt:C~.*/~~:S~,~ ~g} +. for defarch in OPTIONS_DEFINE_${arch:C~:.*~~} +${defarch}+= ${opt:C~/.*~~} +. endfor +. for defarch in OPTIONS_DEFAULT_${arch:M*\:on:S~:on~~} +${defarch}+= ${opt:C~/.*~~} +. endfor +. endfor +.endfor + +# Process options unsupported on some architectures +.for opt in ${OPTIONS:M*!*} +OPTIONS_DEFINE+= ${opt:C~[:!].*~~} +OPTIONS_DEFAULT+= ${opt:M*\:on!*:C~:.*~~} +. for arch in ${opt:C~.*!~~:S~,~ ~g} +OPTIONS_EXCLUDE_${arch}+= ${opt:C~[:!].*~~} +. endfor +.endfor +### + +# Add per-architecture options .for opt in ${OPTIONS_DEFINE_${ARCH}} .if empty(OPTIONS_DEFINE:M${opt}) OPTIONS_DEFINE+= ${opt} @@ -165,7 +210,7 @@ .endif .endfor -# Add per arch defaults +# Add per-architecture defaults OPTIONS_DEFAULT+= ${OPTIONS_DEFAULT_${ARCH}} # Remove options the port maintainer doesn't want @@ -194,7 +239,7 @@ ALL_OPTIONS:= ${OPTIONS_DEFINE:O:u} OPTIONS_DEFAULT:= ${OPTIONS_DEFAULT:O:u} -# complete list +# Complete list COMPLETE_OPTIONS_LIST= ${ALL_OPTIONS} .for otype in SINGLE RADIO MULTI GROUP . for m in ${OPTIONS_${otype}}