2014-04-18 17:04:26 +00:00
|
|
|
#
|
|
|
|
#
|
2014-05-05 22:02:48 +00:00
|
|
|
# Generic mechanism to deal with WITH and WITHOUT options and turn
|
|
|
|
# them into MK_ options.
|
2014-04-18 17:04:26 +00:00
|
|
|
#
|
2014-10-22 06:53:55 +00:00
|
|
|
# For each option FOO in __DEFAULT_YES_OPTIONS, MK_FOO is set to
|
2014-05-05 22:02:48 +00:00
|
|
|
# "yes", unless WITHOUT_FOO is defined, in which case it is set to
|
|
|
|
# "no".
|
2014-04-18 17:04:26 +00:00
|
|
|
#
|
2023-06-17 20:08:37 +00:00
|
|
|
# For each option FOO in __REQUIRED_OPTIONS, MK_FOO is set to "yes".
|
|
|
|
#
|
2014-10-22 06:53:55 +00:00
|
|
|
# For each option FOO in __DEFAULT_NO_OPTIONS, MK_FOO is set to "no",
|
2014-05-05 22:02:48 +00:00
|
|
|
# unless WITH_FOO is defined, in which case it is set to "yes".
|
2014-04-18 17:04:26 +00:00
|
|
|
#
|
2019-09-16 00:32:23 +00:00
|
|
|
# For each entry FOO/BAR in __DEFAULT_DEPENDENT_OPTIONS,
|
|
|
|
# MK_FOO is set to "no" if WITHOUT_FOO is defined,
|
|
|
|
# "yes" if WITH_FOO is defined, otherwise the value of MK_BAR.
|
|
|
|
#
|
2014-05-05 22:02:48 +00:00
|
|
|
# If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and
|
|
|
|
# MK_FOO is set to "no" regardless of which list it was in.
|
|
|
|
#
|
2019-09-16 00:32:23 +00:00
|
|
|
# All of __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and
|
|
|
|
# __DEFAULT_DEPENDENT_OPTIONS are undef'd after all this processing,
|
|
|
|
# allowing this file to be included multiple times with different lists.
|
2014-05-05 22:02:48 +00:00
|
|
|
#
|
2015-03-12 03:57:00 +00:00
|
|
|
# Other parts of the build system will set BROKEN_OPTIONS to a list
|
|
|
|
# of options that are broken on this platform. This will not be unset
|
|
|
|
# before returning. Clients are expected to always += this variable.
|
|
|
|
#
|
2014-05-05 22:02:48 +00:00
|
|
|
# Users should generally define WITH_FOO or WITHOUT_FOO, but the build
|
|
|
|
# system should use MK_FOO={yes,no} when it needs to override the
|
|
|
|
# user's desires or default behavior.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# MK_* options which default to "yes".
|
2014-04-18 17:04:26 +00:00
|
|
|
#
|
|
|
|
.for var in ${__DEFAULT_YES_OPTIONS}
|
|
|
|
.if !defined(MK_${var})
|
2021-06-10 00:10:12 +00:00
|
|
|
.if defined(WITH_${var}) && ${WITH_${var}} == "no"
|
2022-02-04 23:59:00 +00:00
|
|
|
.warning Use WITHOUT_${var}=1 instead of WITH_${var}=no
|
2021-06-10 00:10:12 +00:00
|
|
|
.endif
|
2014-05-05 22:02:48 +00:00
|
|
|
.if defined(WITHOUT_${var}) # WITHOUT always wins
|
2014-04-18 17:04:26 +00:00
|
|
|
MK_${var}:= no
|
|
|
|
.else
|
|
|
|
MK_${var}:= yes
|
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.else
|
|
|
|
.if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
|
2022-02-04 23:59:00 +00:00
|
|
|
.error Illegal value for MK_${var}: ${MK_${var}}
|
2014-04-18 17:04:26 +00:00
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.endif # !defined(MK_${var})
|
2014-04-18 17:04:26 +00:00
|
|
|
.endfor
|
|
|
|
.undef __DEFAULT_YES_OPTIONS
|
|
|
|
|
2023-06-17 20:08:37 +00:00
|
|
|
#
|
|
|
|
# MK_* options which are always yes, typically as a transitional
|
|
|
|
# step towards removing the options entirely.
|
|
|
|
#
|
|
|
|
.for var in ${__REQUIRED_OPTIONS}
|
2023-06-20 04:42:17 +00:00
|
|
|
.if defined(WITHOUT_${var})
|
|
|
|
.warning WITHOUT_${var} option ignored: it is no longer supported
|
|
|
|
.endif
|
2023-06-17 20:08:37 +00:00
|
|
|
MK_${var}:= yes
|
|
|
|
.endfor
|
|
|
|
|
2014-04-18 17:04:26 +00:00
|
|
|
#
|
|
|
|
# MK_* options which default to "no".
|
|
|
|
#
|
|
|
|
.for var in ${__DEFAULT_NO_OPTIONS}
|
|
|
|
.if !defined(MK_${var})
|
2021-06-10 00:10:12 +00:00
|
|
|
.if defined(WITH_${var}) && ${WITH_${var}} == "no"
|
2022-02-04 23:59:00 +00:00
|
|
|
.warning Use WITHOUT_${var}=1 instead of WITH_${var}=no
|
2021-06-10 00:10:12 +00:00
|
|
|
.endif
|
2014-05-09 04:49:43 +00:00
|
|
|
.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
|
2014-04-18 17:04:26 +00:00
|
|
|
MK_${var}:= yes
|
|
|
|
.else
|
|
|
|
MK_${var}:= no
|
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.else
|
|
|
|
.if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
|
2022-02-04 23:59:00 +00:00
|
|
|
.error Illegal value for MK_${var}: ${MK_${var}}
|
2014-04-18 17:04:26 +00:00
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.endif # !defined(MK_${var})
|
2014-04-18 17:04:26 +00:00
|
|
|
.endfor
|
|
|
|
.undef __DEFAULT_NO_OPTIONS
|
2015-03-12 03:57:00 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# MK_* options which are always no, usually because they are
|
|
|
|
# unsupported/badly broken on this architecture.
|
|
|
|
#
|
|
|
|
.for var in ${BROKEN_OPTIONS}
|
|
|
|
MK_${var}:= no
|
|
|
|
.endfor
|
2015-06-06 01:18:28 +00:00
|
|
|
|
|
|
|
.for vv in ${__DEFAULT_DEPENDENT_OPTIONS}
|
|
|
|
.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
|
|
|
|
MK_${vv:H}?= no
|
|
|
|
.elif defined(WITH_${vv:H})
|
|
|
|
MK_${vv:H}?= yes
|
|
|
|
.elif defined(WITHOUT_${vv:H})
|
|
|
|
MK_${vv:H}?= no
|
|
|
|
.else
|
|
|
|
MK_${vv:H}?= ${MK_${vv:T}}
|
|
|
|
.endif
|
2015-06-22 19:01:09 +00:00
|
|
|
MK_${vv:H}:= ${MK_${vv:H}}
|
2015-06-06 01:18:28 +00:00
|
|
|
.endfor
|
|
|
|
.undef __DEFAULT_DEPENDENT_OPTIONS
|