]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/conf/kern.opts.mk
Update to ELF Tool Chain r3475
[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     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 # Some options are totally broken on some architectures. We disable
52 # them. If you need to enable them on an experimental basis, you
53 # must change this code.
54 # Note: These only apply to the list of modules we build by default
55 # and sometimes what is in the opt_*.h files by default.
56 # Kernel config files are unaffected, though some targets can be
57 # affected by KERNEL_SYMBOLS, FORMAT_EXTENSIONS, CTF and SSP.
58
59 # Things that don't work based on the CPU
60 .if ${MACHINE_CPUARCH} == "arm"
61 . if ${MACHINE_ARCH:Marmv6*} == ""
62 BROKEN_OPTIONS+= CDDL ZFS
63 . endif
64 .endif
65
66 .if ${MACHINE_CPUARCH} == "mips"
67 BROKEN_OPTIONS+= CDDL ZFS
68 .endif
69
70 .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} == "powerpc"
71 BROKEN_OPTIONS+= ZFS
72 .endif
73
74 # Things that don't work because the kernel doesn't have the support
75 # for them.
76 .if ${MACHINE} != "i386"
77 BROKEN_OPTIONS+= EISA
78 .endif
79
80 .if ${MACHINE} != "i386" && ${MACHINE} != "amd64"
81 BROKEN_OPTIONS+= OFED
82 .endif
83
84 # expanded inline from bsd.mkopt.mk to avoid share/mk dependency
85
86 # Those that default to yes
87 .for var in ${__DEFAULT_YES_OPTIONS}
88 .if !defined(MK_${var})
89 .if defined(WITHOUT_${var})                     # WITHOUT always wins
90 MK_${var}:=     no
91 .else
92 MK_${var}:=     yes
93 .endif
94 .else
95 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
96 .error "Illegal value for MK_${var}: ${MK_${var}}"
97 .endif
98 .endif # !defined(MK_${var})
99 .endfor
100 .undef __DEFAULT_YES_OPTIONS
101
102 # Those that default to no
103 .for var in ${__DEFAULT_NO_OPTIONS}
104 .if !defined(MK_${var})
105 .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
106 MK_${var}:=     yes
107 .else
108 MK_${var}:=     no
109 .endif
110 .else
111 .if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
112 .error "Illegal value for MK_${var}: ${MK_${var}}"
113 .endif
114 .endif # !defined(MK_${var})
115 .endfor
116 .undef __DEFAULT_NO_OPTIONS
117
118 #
119 # MK_* options which are always no, usually because they are
120 # unsupported/badly broken on this architecture.
121 #
122 .for var in ${BROKEN_OPTIONS}
123 MK_${var}:=     no
124 .endfor
125 .undef BROKEN_OPTIONS
126 #end of bsd.mkopt.mk expanded inline.
127
128 #
129 # MK_*_SUPPORT options which default to "yes" unless their corresponding
130 # MK_* variable is set to "no".
131 #
132 .for var in \
133     INET \
134     INET6
135 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
136 MK_${var}_SUPPORT:= no
137 .else
138 .if defined(KERNBUILDDIR)       # See if there's an opt_foo.h
139 .if !defined(OPT_${var})
140 OPT_${var}!= cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo
141 .export OPT_${var}
142 .endif
143 .if ${OPT_${var}} == ""         # nothing -> no
144 MK_${var}_SUPPORT:= no
145 .else
146 MK_${var}_SUPPORT:= yes
147 .endif
148 .else                           # otherwise, yes
149 MK_${var}_SUPPORT:= yes
150 .endif
151 .endif
152 .endfor