xref: /freebsd/sys/conf/kern.opts.mk (revision ff0ba87247820afbdfdc1b307c803f7923d0e4d3)
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    BLUETOOTH \
27    CDDL \
28    CRYPT \
29    FORMAT_EXTENSIONS \
30    INET \
31    INET6 \
32    IPFILTER \
33    KERNEL_SYMBOLS \
34    NETGRAPH \
35    PF \
36    SOURCELESS_HOST \
37    SOURCELESS_UCODE \
38    USB_GADGET_EXAMPLES \
39    ZFS
40
41__DEFAULT_NO_OPTIONS = \
42    EISA \
43    NAND \
44    OFED
45
46# expanded inline from bsd.mkopt.mk to avoid share/mk dependency
47
48# Those that default to yes
49.for var in ${__DEFAULT_YES_OPTIONS}
50.if !defined(MK_${var})
51.if defined(WITHOUT_${var})			# WITHOUT always wins
52MK_${var}:=	no
53.else
54MK_${var}:=	yes
55.endif
56.endif
57.endfor
58.undef __DEFAULT_YES_OPTIONS
59
60# Those that default to no
61.for var in ${__DEFAULT_NO_OPTIONS}
62.if !defined(MK_${var})
63.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
64MK_${var}:=	yes
65.else
66MK_${var}:=	no
67.endif
68.endif
69.endfor
70.undef __DEFAULT_NO_OPTIONS
71
72#
73# MK_*_SUPPORT options which default to "yes" unless their corresponding
74# MK_* variable is set to "no".
75#
76.for var in \
77    INET \
78    INET6
79.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
80MK_${var}_SUPPORT:= no
81.else
82.if defined(KERNBUILDDIR)	# See if there's an opt_foo.h
83OPT_${var}!= cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo
84.if ${OPT_${var}} == ""		# nothing -> no
85MK_${var}_SUPPORT:= no
86.else
87MK_${var}_SUPPORT:= yes
88.endif
89.else				# otherwise, yes
90MK_${var}_SUPPORT:= yes
91.endif
92.endif
93.endfor
94
95
96
97