]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/conf/kern.opts.mk
MFC r304572 (by bz):
[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     FORMAT_EXTENSIONS \
34     INET \
35     INET6 \
36     IPFILTER \
37     IPSEC_SUPPORT \
38     ISCSI \
39     KERNEL_SYMBOLS \
40     NETGRAPH \
41     PF \
42     SOURCELESS_HOST \
43     SOURCELESS_UCODE \
44     USB_GADGET_EXAMPLES \
45     ZFS
46
47 __DEFAULT_NO_OPTIONS = \
48     EISA \
49     EXTRA_TCP_STACKS \
50     NAND \
51     OFED \
52     REPRODUCIBLE_BUILD
53
54 # Some options are totally broken on some architectures. We disable
55 # them. If you need to enable them on an experimental basis, you
56 # must change this code.
57 # Note: These only apply to the list of modules we build by default
58 # and sometimes what is in the opt_*.h files by default.
59 # Kernel config files are unaffected, though some targets can be
60 # affected by KERNEL_SYMBOLS, FORMAT_EXTENSIONS, CTF and SSP.
61
62 # Things that don't work based on the CPU
63 .if ${MACHINE_CPUARCH} == "arm"
64 . if ${MACHINE_ARCH:Marmv6*} == ""
65 BROKEN_OPTIONS+= CDDL ZFS
66 . endif
67 .endif
68
69 .if ${MACHINE_CPUARCH} == "mips"
70 BROKEN_OPTIONS+= CDDL ZFS
71 .endif
72
73 .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} == "powerpc"
74 BROKEN_OPTIONS+= ZFS
75 .endif
76
77 # Things that don't work because the kernel doesn't have the support
78 # for them.
79 .if ${MACHINE} != "i386"
80 BROKEN_OPTIONS+= EISA
81 .endif
82
83 .if ${MACHINE} != "i386" && ${MACHINE} != "amd64"
84 BROKEN_OPTIONS+= OFED
85 .endif
86
87 # expanded inline from bsd.mkopt.mk to avoid share/mk dependency
88
89 # Those that default to yes
90 .for var in ${__DEFAULT_YES_OPTIONS}
91 .if !defined(MK_${var})
92 .if defined(WITHOUT_${var})                     # WITHOUT always wins
93 MK_${var}:=     no
94 .else
95 MK_${var}:=     yes
96 .endif
97 .else
98 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
99 .error "Illegal value for MK_${var}: ${MK_${var}}"
100 .endif
101 .endif # !defined(MK_${var})
102 .endfor
103 .undef __DEFAULT_YES_OPTIONS
104
105 # Those that default to no
106 .for var in ${__DEFAULT_NO_OPTIONS}
107 .if !defined(MK_${var})
108 .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
109 MK_${var}:=     yes
110 .else
111 MK_${var}:=     no
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_NO_OPTIONS
120
121 #
122 # MK_* options which are always no, usually because they are
123 # unsupported/badly broken on this architecture.
124 #
125 .for var in ${BROKEN_OPTIONS}
126 MK_${var}:=     no
127 .endfor
128 .undef BROKEN_OPTIONS
129 #end of bsd.mkopt.mk expanded inline.
130
131 #
132 # MK_*_SUPPORT options which default to "yes" unless their corresponding
133 # MK_* variable is set to "no".
134 #
135 .for var in \
136     INET \
137     INET6
138 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
139 MK_${var}_SUPPORT:= no
140 .else
141 .if defined(KERNBUILDDIR)       # See if there's an opt_foo.h
142 .if !defined(OPT_${var})
143 OPT_${var}!= cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo
144 .export OPT_${var}
145 .endif
146 .if ${OPT_${var}} == ""         # nothing -> no
147 MK_${var}_SUPPORT:= no
148 .else
149 MK_${var}_SUPPORT:= yes
150 .endif
151 .else                           # otherwise, yes
152 MK_${var}_SUPPORT:= yes
153 .endif
154 .endif
155 .endfor
156
157 # Some modules only compile successfully if option FDT is set, due to #ifdef FDT
158 # wrapped around declarations.  Module makefiles can optionally compile such
159 # things using .if !empty(OPT_FDT)
160 .if !defined(OPT_FDT) && defined(KERNBUILDDIR)
161 OPT_FDT!= sed -n '/FDT/p' ${KERNBUILDDIR}/opt_platform.h
162 .export OPT_FDT
163 .endif