3 # Generic mechanism to deal with WITH and WITHOUT options and turn
4 # them into MK_ options.
6 # For each option FOO in __DEFAULT_YES_OPTIONS, MK_FOO is set to
7 # "yes", unless WITHOUT_FOO is defined, in which case it is set to
10 # For each option FOO in __REQUIRED_OPTIONS, MK_FOO is set to "yes".
12 # For each option FOO in __DEFAULT_NO_OPTIONS, MK_FOO is set to "no",
13 # unless WITH_FOO is defined, in which case it is set to "yes".
15 # For each entry FOO/BAR in __DEFAULT_DEPENDENT_OPTIONS,
16 # MK_FOO is set to "no" if WITHOUT_FOO is defined,
17 # "yes" if WITH_FOO is defined, otherwise the value of MK_BAR.
19 # If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and
20 # MK_FOO is set to "no" regardless of which list it was in.
22 # All of __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and
23 # __DEFAULT_DEPENDENT_OPTIONS are undef'd after all this processing,
24 # allowing this file to be included multiple times with different lists.
26 # Other parts of the build system will set BROKEN_OPTIONS to a list
27 # of options that are broken on this platform. This will not be unset
28 # before returning. Clients are expected to always += this variable.
30 # Users should generally define WITH_FOO or WITHOUT_FOO, but the build
31 # system should use MK_FOO={yes,no} when it needs to override the
32 # user's desires or default behavior.
36 # MK_* options which default to "yes".
38 .for var in ${__DEFAULT_YES_OPTIONS}
39 .if !defined(MK_${var})
40 .if defined(WITH_${var}) && ${WITH_${var}} == "no"
41 .warning Use WITHOUT_${var}=1 instead of WITH_${var}=no
43 .if defined(WITHOUT_${var}) # WITHOUT always wins
49 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
50 .error Illegal value for MK_${var}: ${MK_${var}}
52 .endif # !defined(MK_${var})
54 .undef __DEFAULT_YES_OPTIONS
57 # MK_* options which are always yes, typically as a transitional
58 # step towards removing the options entirely.
60 .for var in ${__REQUIRED_OPTIONS}
61 .if defined(WITHOUT_${var})
62 .warning WITHOUT_${var} option ignored: it is no longer supported
68 # MK_* options which default to "no".
70 .for var in ${__DEFAULT_NO_OPTIONS}
71 .if !defined(MK_${var})
72 .if defined(WITH_${var}) && ${WITH_${var}} == "no"
73 .warning Use WITHOUT_${var}=1 instead of WITH_${var}=no
75 .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
81 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
82 .error Illegal value for MK_${var}: ${MK_${var}}
84 .endif # !defined(MK_${var})
86 .undef __DEFAULT_NO_OPTIONS
89 # MK_* options which are always no, usually because they are
90 # unsupported/badly broken on this architecture.
92 .for var in ${BROKEN_OPTIONS}
96 .for vv in ${__DEFAULT_DEPENDENT_OPTIONS}
97 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
99 .elif defined(WITH_${vv:H})
101 .elif defined(WITHOUT_${vv:H})
104 MK_${vv:H}?= ${MK_${vv:T}}
106 MK_${vv:H}:= ${MK_${vv:H}}
108 .undef __DEFAULT_DEPENDENT_OPTIONS