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 = \
52 # Some options are totally broken on some architectures. We disable
53 # them. If you need to enable them on an experimental basis, you
54 # must change this code.
55 # Note: These only apply to the list of modules we build by default
56 # and sometimes what is in the opt_*.h files by default.
57 # Kernel config files are unaffected, though some targets can be
58 # affected by KERNEL_SYMBOLS, FORMAT_EXTENSIONS, CTF and SSP.
60 # Things that don't work based on the CPU
61 .if ${MACHINE_CPUARCH} == "arm"
63 . if ${MACHINE_ARCH:Marmv6*} == ""
68 .if ${MACHINE_CPUARCH} == "mips"
69 BROKEN_OPTIONS+= CDDL ZFS
72 .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} == "powerpc"
76 # Things that don't work because the kernel doesn't have the support
78 .if ${MACHINE} != "i386"
82 .if ${MACHINE} != "i386" && ${MACHINE} != "amd64"
86 # expanded inline from bsd.mkopt.mk to avoid share/mk dependency
88 # Those that default to yes
89 .for var in ${__DEFAULT_YES_OPTIONS}
90 .if !defined(MK_${var})
91 .if defined(WITHOUT_${var}) # WITHOUT always wins
97 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
98 .error "Illegal value for MK_${var}: ${MK_${var}}"
100 .endif # !defined(MK_${var})
102 .undef __DEFAULT_YES_OPTIONS
104 # Those that default to no
105 .for var in ${__DEFAULT_NO_OPTIONS}
106 .if !defined(MK_${var})
107 .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
113 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
114 .error "Illegal value for MK_${var}: ${MK_${var}}"
116 .endif # !defined(MK_${var})
118 .undef __DEFAULT_NO_OPTIONS
121 # MK_* options which are always no, usually because they are
122 # unsupported/badly broken on this architecture.
124 .for var in ${BROKEN_OPTIONS}
127 .undef BROKEN_OPTIONS
128 #end of bsd.mkopt.mk expanded inline.
131 # MK_*_SUPPORT options which default to "yes" unless their corresponding
132 # MK_* variable is set to "no".
137 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
138 MK_${var}_SUPPORT:= no
140 .if defined(KERNBUILDDIR) # See if there's an opt_foo.h
141 OPT_${var}!= cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo
142 .if ${OPT_${var}} == "" # nothing -> no
143 MK_${var}_SUPPORT:= no
145 MK_${var}_SUPPORT:= yes
147 .else # otherwise, yes
148 MK_${var}_SUPPORT:= yes