diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2013-04-29 14:49:18 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2013-04-29 14:49:18 +0000 |
commit | c564c4d40a2a5a75499f818899c2bb48d0cd64f9 (patch) | |
tree | 18773c9142784789d8f47f42eb07868ad87c3feb /Mk | |
parent | - Update to 9.8j (diff) |
Rework OPTIONS_EXCLUDE and OPTIONS_EXCLUDE_${ARCH} so that is also get excluded
from the SINGLE/MULTI/GROUP/RADIO
Add new (OPTIONS|${UNIQUENAME}_(UN)SET_FORCE to force options from make.conf
what ever has been saved via make config [1]
Add new OPTIONS_SLAVE designed to help slaved ports, each options added to
OPTIONS_SLAVE will be removed from master's OPTIONS_DEFINE, and PORT_OPTIONS
will be set as if always on.
Submitted by: Marco Steinbach <coco@executive-computing.de> [1]
Notes
Notes:
svn path=/head/; revision=316825
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/bsd.options.mk | 72 |
1 files changed, 63 insertions, 9 deletions
diff --git a/Mk/bsd.options.mk b/Mk/bsd.options.mk index 6a00251cbee6..73b1bd9f1d2b 100644 --- a/Mk/bsd.options.mk +++ b/Mk/bsd.options.mk @@ -9,6 +9,7 @@ # OPTIONS_DEFAULT_${ARCH} - List of options activated by default for a # given arch # +# OPTIONS_EXCLUDE - List of options unsupported (useful for slave ports) # OPTIONS_EXCLUDE_${ARCH} - List of options unsupported on a given ${ARCH} # ${OPTION}_DESC - Description the the ${OPTION} # @@ -36,6 +37,10 @@ # # WITH Set options from the command line # WITHOUT Unset options from the command line +# +# OPTIONS_SLAVE This is designed for slave ports, it removes an option +# from the options list inherited from the master port +# and it always adds it to PORT_OPTIONS meaning activated ## # Set all the options available for the ports, beginning with the @@ -67,10 +72,7 @@ PORT_OPTIONS+= EXAMPLES PORT_OPTIONS+= IPV6 # Exclude per arch options -.for opt in ${OPTIONS_EXCLUDE_${ARCH}} -OPTIONS_DEFINE:= ${OPTIONS_DEFINE:N${opt}} -OPTIONS_DEFAULT:= ${OPTIONS_DEFAULT:N${opt}} -.endfor +_ALL_EXCLUDE= ${OPTIONS_EXCLUDE_${ARCH}} ${OPTIONS_EXCLUDE} ${OPTIONS_SLAVE} # Add per arch options .for opt in ${OPTIONS_DEFINE_${ARCH}} @@ -93,11 +95,6 @@ ALL_OPTIONS+= ${opt} ALL_OPTIONS:= ${ALL_OPTIONS:O:u} -# Remove global options the port maintainer doesn't want -.for opt in ${OPTIONS_EXCLUDE} -ALL_OPTIONS:= ${ALL_OPTIONS:N${opt}} -.endfor - #XXX to kill when old option framework won't be used anymore .if defined(OPTIONS) NO_OPTIONS_SORT= yes @@ -136,6 +133,31 @@ PORT_OPTIONS:= ${PORT_OPTIONS:N${O}} #XXX end of compatibility ALL_OPTIONS:= ${ALL_OPTIONS:O:u} +OPTIONS_DEFINE:= ${OPTIONS_DEFINE:O:u} +OPTIONS_DEFAULT:= ${OPTIONS_DEFAULT:O:u} + +# Remove global options the port maintainer doesn't want +.for opt in ${_ALL_EXCLUDE} +OPTIONS_DEFINE:= ${OPTIONS_DEFINE:N${opt}} +OPTIONS_DEFAULT:= ${OPTIONS_DEFAULT:N${opt}} +ALL_OPTIONS:= ${ALL_OPTIONS:N${opt}} +.endfor + +# Remove illegal per-arch options +.for opt in ${_ALL_EXCLUDE} +. for single in ${OPTIONS_SINGLE} +OPTIONS_SINGLE_${single}:= ${OPTIONS_SINGLE_${single}:N${opt}} +. endfor +. for radio in ${OPTIONS_RADIO} +OPTIONS_RADIO_${radio}:= ${OPTIONS_RADIO_${radio}:N${opt}} +. endfor +. for multi in ${OPTIONS_MULTI} +OPTIONS_MULTI_${multi}:= ${OPTIONS_MULTI_${multi}:N${opt}} +. endfor +. for group in ${OPTIONS_GROUP} +OPTIONS_GROUP_${group}:= ${OPTIONS_GROUP_${group}:N${opt}} +. endfor +.endfor # complete list COMPLETE_OPTIONS_LIST= ${ALL_OPTIONS} @@ -225,6 +247,34 @@ PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}} .endif +## FORCE +## Set system-wide defined options (set by user in make.conf) +. for opt in ${OPTIONS_SET_FORCE} +. if !empty(COMPLETE_OPTIONS_LIST:M${opt}) +PORT_OPTIONS+= ${opt} +. endif +. endfor +PORT_OPTIONS:= ${PORT_OPTIONS:O:u} + +## Remove the options excluded system-wide (set by user in make.conf) +. for opt in ${OPTIONS_UNSET_FORCE} +PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}} +. endfor + +## Set the options specified per-port (set by user in make.conf) +. for opt in ${${UNIQUENAME}_SET_FORCE} +. if !empty(COMPLETE_OPTIONS_LIST:M${opt}) +PORT_OPTIONS+= ${opt} +. endif +. endfor +PORT_OPTIONS:= ${PORT_OPTIONS:O:u} + +## Unset the options excluded per-port (set by user in make.conf) +. for opt in ${${UNIQUENAME}_UNSET_FORCE} +PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}} +. endfor + + ## Cmdline always win over the rest .for opt in ${WITH} . if !empty(COMPLETE_OPTIONS_LIST:M${opt}) @@ -236,6 +286,10 @@ PORT_OPTIONS:= ${PORT_OPTIONS:O:u} .for opt in ${WITHOUT} PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}} .endfor + +.for opt in ${OPTIONS_SLAVE} +PORT_OPTIONS+= ${opt} +.endfor .undef opt ## Now some compatibility |