]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/conf/kern.opts.mk
Add UPDATING entries and bump version.
[FreeBSD/FreeBSD.git] / sys / conf / kern.opts.mk
1 # $FreeBSD$
2
3 # Options set in the build system that affect the kernel somehow.
4
5 #
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
8 # make(1) environment.
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.
12 #
13
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).
19 .include <bsd.own.mk>
20
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
23 # src tree.
24
25 __DEFAULT_YES_OPTIONS = \
26     AUTOFS \
27     BHYVE \
28     BLUETOOTH \
29     CCD \
30     CDDL \
31     CRYPT \
32     CUSE \
33     EFI \
34     FORMAT_EXTENSIONS \
35     INET \
36     INET6 \
37     IPFILTER \
38     IPSEC_SUPPORT \
39     ISCSI \
40     KERNEL_SYMBOLS \
41     MODULE_DRM \
42     MODULE_DRM2 \
43     NETGRAPH \
44     OFED \
45     PF \
46     REPRODUCIBLE_BUILD \
47     SCTP_SUPPORT \
48     SOURCELESS_HOST \
49     SOURCELESS_UCODE \
50     TESTS \
51     USB_GADGET_EXAMPLES \
52     ZFS
53
54 __DEFAULT_NO_OPTIONS = \
55     EXTRA_TCP_STACKS \
56     KERNEL_RETPOLINE \
57     NAND \
58     RATELIMIT
59
60 # Some options are totally broken on some architectures. We disable
61 # them. If you need to enable them on an experimental basis, you
62 # must change this code.
63 # Note: These only apply to the list of modules we build by default
64 # and sometimes what is in the opt_*.h files by default.
65 # Kernel config files are unaffected, though some targets can be
66 # affected by KERNEL_SYMBOLS, FORMAT_EXTENSIONS, CTF and SSP.
67
68 # Things that don't work based on the CPU
69 .if ${MACHINE_CPUARCH} == "arm"
70 . if ${MACHINE_ARCH:Marmv[67]*} == ""
71 BROKEN_OPTIONS+= CDDL ZFS
72 . endif
73 .endif
74
75 .if ${MACHINE_CPUARCH} == "mips"
76 BROKEN_OPTIONS+= CDDL ZFS SSP
77 .endif
78
79 .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} == "powerpc"
80 BROKEN_OPTIONS+= ZFS
81 .endif
82
83 .if ${MACHINE_CPUARCH} == "riscv"
84 BROKEN_OPTIONS+= FORMAT_EXTENSIONS
85 .endif
86
87 # Things that don't work because the kernel doesn't have the support
88 # for them.
89 .if ${MACHINE} != "i386" && ${MACHINE} != "amd64"
90 BROKEN_OPTIONS+= OFED
91 .endif
92
93 # Things that don't work based on toolchain support.
94 .if ${MACHINE} != "i386" && ${MACHINE} != "amd64"
95 BROKEN_OPTIONS+= KERNEL_RETPOLINE
96 .endif
97
98 # EFI doesn't exist on mips, powerpc, sparc or riscv.
99 .if ${MACHINE:Mmips} || ${MACHINE:Mpowerpc} || ${MACHINE:Msparc64} || ${MACHINE:Mriscv}
100 BROKEN_OPTIONS+=EFI
101 .endif
102
103 # expanded inline from bsd.mkopt.mk to avoid share/mk dependency
104
105 # Those that default to yes
106 .for var in ${__DEFAULT_YES_OPTIONS}
107 .if !defined(MK_${var})
108 .if defined(WITHOUT_${var})                     # WITHOUT always wins
109 MK_${var}:=     no
110 .else
111 MK_${var}:=     yes
112 .endif
113 .else
114 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
115 .error "Illegal value for MK_${var}: ${MK_${var}}"
116 .endif
117 .endif # !defined(MK_${var})
118 .endfor
119 .undef __DEFAULT_YES_OPTIONS
120
121 # Those that default to no
122 .for var in ${__DEFAULT_NO_OPTIONS}
123 .if !defined(MK_${var})
124 .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
125 MK_${var}:=     yes
126 .else
127 MK_${var}:=     no
128 .endif
129 .else
130 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
131 .error "Illegal value for MK_${var}: ${MK_${var}}"
132 .endif
133 .endif # !defined(MK_${var})
134 .endfor
135 .undef __DEFAULT_NO_OPTIONS
136
137 #
138 # MK_* options which are always no, usually because they are
139 # unsupported/badly broken on this architecture.
140 #
141 .for var in ${BROKEN_OPTIONS}
142 MK_${var}:=     no
143 .endfor
144 .undef BROKEN_OPTIONS
145 #end of bsd.mkopt.mk expanded inline.
146
147 #
148 # MK_*_SUPPORT options which default to "yes" unless their corresponding
149 # MK_* variable is set to "no".
150 #
151 .for var in \
152     INET \
153     INET6
154 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
155 MK_${var}_SUPPORT:= no
156 .else
157 .if defined(KERNBUILDDIR)       # See if there's an opt_foo.h
158 .if !defined(OPT_${var})
159 OPT_${var}!= cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo
160 .export OPT_${var}
161 .endif
162 .if ${OPT_${var}} == ""         # nothing -> no
163 MK_${var}_SUPPORT:= no
164 .else
165 MK_${var}_SUPPORT:= yes
166 .endif
167 .else                           # otherwise, yes
168 MK_${var}_SUPPORT:= yes
169 .endif
170 .endif
171 .endfor
172
173 # Some modules only compile successfully if option FDT is set, due to #ifdef FDT
174 # wrapped around declarations.  Module makefiles can optionally compile such
175 # things using .if !empty(OPT_FDT)
176 .if !defined(OPT_FDT) && defined(KERNBUILDDIR)
177 OPT_FDT!= sed -n '/FDT/p' ${KERNBUILDDIR}/opt_platform.h
178 .export OPT_FDT
179 .endif