3 # Options set in the build system that affect the kernel somehow.
6 # Define MK_* variables (which are either "yes" or "no") for users
7 # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
9 # These should be tested with `== "no"' or `!= "no"' in makefiles.
10 # The NO_* variables should only be set by makefiles for variables
11 # that haven't been converted over.
14 # Note: bsd.own.mk must be included before the rest of kern.opts.mk to make
15 # building on 10.x and earlier work. This should be removed when that's no
16 # longer supported since it confounds the defaults (since it uses the host's
17 # notion of defaults rather than what's default in current when building
18 # within sys/modules).
21 # These options are used by the kernel build process (kern.mk and kmod.mk)
22 # They have to be listed here so we can build modules outside of the
25 __DEFAULT_YES_OPTIONS = \
46 __DEFAULT_NO_OPTIONS = \
51 # expanded inline from bsd.mkopt.mk to avoid share/mk dependency
53 # Those that default to yes
54 .for var in ${__DEFAULT_YES_OPTIONS}
55 .if !defined(MK_${var})
56 .if defined(WITHOUT_${var}) # WITHOUT always wins
62 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
63 .error "Illegal value for MK_${var}: ${MK_${var}}"
65 .endif # !defined(MK_${var})
67 .undef __DEFAULT_YES_OPTIONS
69 # Those that default to no
70 .for var in ${__DEFAULT_NO_OPTIONS}
71 .if !defined(MK_${var})
72 .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
78 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
79 .error "Illegal value for MK_${var}: ${MK_${var}}"
81 .endif # !defined(MK_${var})
83 .undef __DEFAULT_NO_OPTIONS
86 # MK_*_SUPPORT options which default to "yes" unless their corresponding
87 # MK_* variable is set to "no".
92 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
93 MK_${var}_SUPPORT:= no
95 .if defined(KERNBUILDDIR) # See if there's an opt_foo.h
96 OPT_${var}!= cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo
97 .if ${OPT_${var}} == "" # nothing -> no
98 MK_${var}_SUPPORT:= no
100 MK_${var}_SUPPORT:= yes
102 .else # otherwise, yes
103 MK_${var}_SUPPORT:= yes