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 ISCSI \ 38 KERNEL_SYMBOLS \ 39 NETGRAPH \ 40 PF \ 41 SOURCELESS_HOST \ 42 SOURCELESS_UCODE \ 43 USB_GADGET_EXAMPLES \ 44 ZFS 45 46__DEFAULT_NO_OPTIONS = \ 47 EISA \ 48 NAND \ 49 OFED 50 51# expanded inline from bsd.mkopt.mk to avoid share/mk dependency 52 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 57MK_${var}:= no 58.else 59MK_${var}:= yes 60.endif 61.else 62.if ${MK_${var}} != "yes" && ${MK_${var}} != "no" 63.error "Illegal value for MK_${var}: ${MK_${var}}" 64.endif 65.endif # !defined(MK_${var}) 66.endfor 67.undef __DEFAULT_YES_OPTIONS 68 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 73MK_${var}:= yes 74.else 75MK_${var}:= no 76.endif 77.else 78.if ${MK_${var}} != "yes" && ${MK_${var}} != "no" 79.error "Illegal value for MK_${var}: ${MK_${var}}" 80.endif 81.endif # !defined(MK_${var}) 82.endfor 83.undef __DEFAULT_NO_OPTIONS 84 85# 86# MK_*_SUPPORT options which default to "yes" unless their corresponding 87# MK_* variable is set to "no". 88# 89.for var in \ 90 INET \ 91 INET6 92.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" 93MK_${var}_SUPPORT:= no 94.else 95.if defined(KERNBUILDDIR) # See if there's an opt_foo.h 96OPT_${var}!= cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo 97.if ${OPT_${var}} == "" # nothing -> no 98MK_${var}_SUPPORT:= no 99.else 100MK_${var}_SUPPORT:= yes 101.endif 102.else # otherwise, yes 103MK_${var}_SUPPORT:= yes 104.endif 105.endif 106.endfor 107 108 109 110