]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/src.opts.mk
unbound: Vendor import 1.16.0
[FreeBSD/FreeBSD.git] / share / mk / src.opts.mk
1 # $FreeBSD$
2 #
3 # Option file for FreeBSD /usr/src builds, at least the userland and boot loader
4 # portions of the tree. These options generally chose what parts of the tree to
5 # include or omit and are FreeBSD source tree specific.
6 #
7 # Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf
8 # and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no}
9 # with sensible (usually) defaults.
10 #
11 # Makefiles must include bsd.opts.mk after defining specific MK_FOO options that
12 # are applicable for that Makefile (typically there are none, but sometimes there
13 # are exceptions). Recursive makes usually add MK_FOO=no for options that they wish
14 # to omit from that make.
15 #
16 # Makefiles must include bsd.mkopt.mk before they test the value of any MK_FOO
17 # variable.
18 #
19 # Makefiles may also assume that this file is included by src.opts.mk should it
20 # need variables defined there prior to the end of the Makefile where
21 # bsd.{subdir,lib.bin}.mk is traditionally included.
22 #
23 # The old-style YES_FOO and NO_FOO are being phased out. No new instances of them
24 # should be added. Old instances should be removed since they were just to
25 # bridge the gap between FreeBSD 4 and FreeBSD 5.
26 #
27 # Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an
28 # exception is made for _WITHOUT_SRCONF which turns off this mechanism
29 # completely inside bsd.*.mk files).
30 #
31
32 .if !target(__<src.opts.mk>__)
33 __<src.opts.mk>__:
34
35 .include <bsd.own.mk>
36
37 #
38 # Define MK_* variables (which are either "yes" or "no") for users
39 # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
40 # make(1) environment.
41 # These should be tested with `== "no"' or `!= "no"' in makefiles.
42 # The NO_* variables should only be set by makefiles for variables
43 # that haven't been converted over.
44 #
45
46 # These options are used by the src builds. Those listed in
47 # __DEFAULT_YES_OPTIONS default to 'yes' and will build unless turned
48 # off.  __DEFAULT_NO_OPTIONS will default to 'no' and won't build
49 # unless turned on. Any options listed in 'BROKEN_OPTIONS' will be
50 # hard-wired to 'no'.  "Broken" here means not working or
51 # not-appropriate and/or not supported. It doesn't imply something is
52 # wrong with the code. There's not a single good word for this, so
53 # BROKEN was selected as the least imperfect one considered at the
54 # time. Options are added to BROKEN_OPTIONS list on a per-arch basis.
55 # At this time, there's no provision for mutually incompatible options.
56
57 __DEFAULT_YES_OPTIONS = \
58     ACCT \
59     ACPI \
60     APM \
61     AT \
62     ATM \
63     AUDIT \
64     AUTHPF \
65     AUTOFS \
66     BHYVE \
67     BLACKLIST \
68     BLUETOOTH \
69     BOOT \
70     BOOTPARAMD \
71     BOOTPD \
72     BSD_CPIO \
73     BSDINSTALL \
74     BSNMP \
75     BZIP2 \
76     CALENDAR \
77     CAPSICUM \
78     CAROOT \
79     CASPER \
80     CCD \
81     CDDL \
82     CLANG \
83     CLANG_BOOTSTRAP \
84     CLANG_IS_CC \
85     CLEAN \
86     CPP \
87     CROSS_COMPILER \
88     CRYPT \
89     CUSE \
90     CXX \
91     CXGBETOOL \
92     DIALOG \
93     DICT \
94     DMAGENT \
95     DYNAMICROOT \
96     EE \
97     EFI \
98     ELFTOOLCHAIN_BOOTSTRAP \
99     EXAMPLES \
100     FDT \
101     FILE \
102     FINGER \
103     FLOPPY \
104     FORTH \
105     FP_LIBC \
106     FREEBSD_UPDATE \
107     FTP \
108     GAMES \
109     GH_BC \
110     GNU_DIFF \
111     GOOGLETEST \
112     GPIO \
113     HAST \
114     HTML \
115     HYPERV \
116     ICONV \
117     INET \
118     INET6 \
119     INETD \
120     IPFILTER \
121     IPFW \
122     ISCSI \
123     JAIL \
124     KDUMP \
125     KVM \
126     LDNS \
127     LDNS_UTILS \
128     LEGACY_CONSOLE \
129     LLD \
130     LLD_BOOTSTRAP \
131     LLD_IS_LD \
132     LLVM_ASSERTIONS \
133     LLVM_COV \
134     LLVM_CXXFILT \
135     LOADER_GELI \
136     LOADER_KBOOT \
137     LOADER_LUA \
138     LOADER_OFW \
139     LOADER_UBOOT \
140     LOCALES \
141     LOCATE \
142     LPR \
143     LS_COLORS \
144     MAIL \
145     MAILWRAPPER \
146     MAKE \
147     MLX5TOOL \
148     NDIS \
149     NETCAT \
150     NETGRAPH \
151     NLS_CATALOGS \
152     NS_CACHING \
153     NTP \
154     NVME \
155     OFED \
156     OPENSSL \
157     PAM \
158     PF \
159     PKGBOOTSTRAP \
160     PMC \
161     PORTSNAP \
162     PPP \
163     QUOTAS \
164     RADIUS_SUPPORT \
165     RBOOTD \
166     RESCUE \
167     ROUTED \
168     SENDMAIL \
169     SERVICESDB \
170     SETUID_LOGIN \
171     SHARED_TOOLCHAIN \
172     SHAREDOCS \
173     SOURCELESS \
174     SOURCELESS_HOST \
175     SOURCELESS_UCODE \
176     STATS \
177     SYSCONS \
178     SYSTEM_COMPILER \
179     SYSTEM_LINKER \
180     TALK \
181     TCP_WRAPPERS \
182     TCSH \
183     TELNET \
184     TEXTPROC \
185     TFTP \
186     UNBOUND \
187     USB \
188     UTMPX \
189     VI \
190     VT \
191     WIRELESS \
192     WPA_SUPPLICANT_EAPOL \
193     ZFS \
194     LOADER_ZFS \
195     ZONEINFO
196
197 __DEFAULT_NO_OPTIONS = \
198     BEARSSL \
199     BHYVE_SNAPSHOT \
200     CLANG_EXTRAS \
201     CLANG_FORMAT \
202     DETECT_TZ_CHANGES \
203     DTRACE_TESTS \
204     EXPERIMENTAL \
205     HESIOD \
206     LOADER_FIREWIRE \
207     LOADER_VERBOSE \
208     LOADER_VERIEXEC_PASS_MANIFEST \
209     LLVM_BINUTILS \
210     MALLOC_PRODUCTION \
211     OFED_EXTRA \
212     OPENLDAP \
213     REPRODUCIBLE_BUILD \
214     RPCBIND_WARMSTART_SUPPORT \
215     SORT_THREADS \
216     ZONEINFO_LEAPSECONDS_SUPPORT \
217
218 # LEFT/RIGHT. Left options which default to "yes" unless their corresponding
219 # RIGHT option is disabled.
220 __DEFAULT_DEPENDENT_OPTIONS= \
221         CLANG_FULL/CLANG \
222         LLVM_TARGET_ALL/CLANG \
223         LOADER_VERIEXEC/BEARSSL \
224         LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \
225         LOADER_VERIEXEC_VECTX/LOADER_VERIEXEC \
226         VERIEXEC/BEARSSL \
227
228 # MK_*_SUPPORT options which default to "yes" unless their corresponding
229 # MK_* variable is set to "no".
230 #
231 .for var in \
232     BLACKLIST \
233     BZIP2 \
234     INET \
235     INET6 \
236     KERBEROS \
237     KVM \
238     NETGRAPH \
239     PAM \
240     TESTS \
241     WIRELESS
242 __DEFAULT_DEPENDENT_OPTIONS+= ${var}_SUPPORT/${var}
243 .endfor
244
245 #
246 # Default behaviour of some options depends on the architecture.  Unfortunately
247 # this means that we have to test TARGET_ARCH (the buildworld case) as well
248 # as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
249 # used at all in bsd.*.mk, but we have to make an exception here if we want
250 # to allow defaults for some things like clang to vary by target architecture.
251 # Additional, per-target behavior should be rarely added only after much
252 # gnashing of teeth and grinding of gears.
253 #
254 .if defined(TARGET_ARCH)
255 __T=${TARGET_ARCH}
256 .else
257 __T=${MACHINE_ARCH}
258 .endif
259
260 # All supported backends for LLVM_TARGET_XXX
261 __LLVM_TARGETS= \
262                 aarch64 \
263                 arm \
264                 powerpc \
265                 riscv \
266                 x86
267 __LLVM_TARGET_FILT=     C/(amd64|i386)/x86/:C/powerpc.*/powerpc/:C/armv[67]/arm/:C/riscv.*/riscv/:C/mips.*/mips/
268 .for __llt in ${__LLVM_TARGETS}
269 # Default enable the given TARGET's LLVM_TARGET support
270 .if ${__T:${__LLVM_TARGET_FILT}} == ${__llt}
271 __DEFAULT_YES_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}
272 # aarch64 needs arm for -m32 support.
273 .elif ${__T} == "aarch64" && ${__llt:Marm*} != ""
274 __DEFAULT_DEPENDENT_OPTIONS+=   LLVM_TARGET_ARM/LLVM_TARGET_AARCH64
275 # Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL.
276 .else
277 __DEFAULT_DEPENDENT_OPTIONS+=   LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL
278 .endif
279 .endfor
280
281 __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF LLVM_TARGET_MIPS
282
283 .include <bsd.compiler.mk>
284
285 .if ${__T:Marm*} == "" && ${__T:Mriscv64*} == ""
286 __DEFAULT_YES_OPTIONS+=LLDB
287 .else
288 __DEFAULT_NO_OPTIONS+=LLDB
289 .endif
290 # LIB32 is supported on amd64 and powerpc64
291 .if (${__T} == "amd64" || ${__T} == "powerpc64")
292 __DEFAULT_YES_OPTIONS+=LIB32
293 .else
294 BROKEN_OPTIONS+=LIB32
295 .endif
296 # EFI doesn't exist on powerpc (well, officially)
297 .if ${__T:Mpowerpc*}
298 BROKEN_OPTIONS+=EFI
299 .endif
300 # OFW is only for powerpc, exclude others
301 .if ${__T:Mpowerpc*} == ""
302 BROKEN_OPTIONS+=LOADER_OFW
303 .endif
304 # KBOOT is only for powerpc64 (powerpc64le broken) and kinda for amd64
305 .if ${__T} != "powerpc64" && ${__T} != "amd64"
306 BROKEN_OPTIONS+=LOADER_KBOOT
307 .endif
308 # UBOOT is only for arm, and big-endian powerpc
309 .if (${__T:Marm*} == "" && ${__T:Mpowerpc*} == "") || ${__T} == "powerpc64le"
310 BROKEN_OPTIONS+=LOADER_UBOOT
311 .endif
312 # GELI and Lua in loader currently cause boot failures on powerpc.
313 # Further debugging is required -- probably they are just broken on big
314 # endian systems generically (they jump to null pointers or try to read
315 # crazy high addresses, which is typical of endianness problems).
316 .if ${__T:Mpowerpc*}
317 BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA
318 .endif
319
320 # Kernel TLS is enabled by default on amd64 and aarch64
321 .if ${__T} == "aarch64" || ${__T} == "amd64"
322 __DEFAULT_YES_OPTIONS+=OPENSSL_KTLS
323 .else
324 __DEFAULT_NO_OPTIONS+=OPENSSL_KTLS
325 .endif
326
327 .if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
328     ${__T:Mpowerpc64*} == ""
329 BROKEN_OPTIONS+=CXGBETOOL
330 BROKEN_OPTIONS+=MLX5TOOL
331 .endif
332
333 # HyperV is currently x86-only
334 .if ${__T} != "amd64" && ${__T} != "i386"
335 BROKEN_OPTIONS+=HYPERV
336 .endif
337
338 # NVME is only aarch64, x86 and powerpc64*
339 .if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
340     ${__T:Mpowerpc64*} == ""
341 BROKEN_OPTIONS+=NVME
342 .endif
343
344 .if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \
345     ${__T:Mpowerpc64*} != "" || ${__T:Mriscv64*} != ""
346 __DEFAULT_YES_OPTIONS+=OPENMP
347 .else
348 __DEFAULT_NO_OPTIONS+=OPENMP
349 .endif
350
351 .include <bsd.mkopt.mk>
352
353 #
354 # Force some options off if their dependencies are off.
355 # Order is somewhat important.
356 #
357 .if ${MK_CAPSICUM} == "no"
358 MK_CASPER:=     no
359 .endif
360
361 .if ${MK_SOURCELESS} == "no"
362 MK_SOURCELESS_HOST:=    no
363 MK_SOURCELESS_UCODE:= no
364 .endif
365
366 .if ${MK_CDDL} == "no"
367 MK_ZFS:=        no
368 MK_LOADER_ZFS:= no
369 MK_CTF:=        no
370 .endif
371
372 .if ${MK_CRYPT} == "no"
373 MK_OPENSSL:=    no
374 MK_OPENSSH:=    no
375 MK_KERBEROS:=   no
376 MK_KERBEROS_SUPPORT:=   no
377 .endif
378
379 .if ${MK_CXX} == "no"
380 MK_CLANG:=      no
381 MK_GOOGLETEST:= no
382 MK_OFED:=       no
383 MK_OPENMP:=     no
384 MK_PMC:=        no
385 MK_TESTS:=      no
386 .endif
387
388 .if ${MK_DIALOG} == "no"
389 MK_BSDINSTALL:= no
390 .endif
391
392 .if ${MK_MAIL} == "no"
393 MK_MAILWRAPPER:= no
394 MK_SENDMAIL:=   no
395 MK_DMAGENT:=    no
396 .endif
397
398 .if ${MK_NETGRAPH} == "no"
399 MK_ATM:=        no
400 MK_BLUETOOTH:=  no
401 .endif
402
403 .if ${MK_NLS} == "no"
404 MK_NLS_CATALOGS:= no
405 .endif
406
407 .if ${MK_OPENSSL} == "no"
408 MK_DMAGENT:=    no
409 MK_OPENSSH:=    no
410 MK_OPENSSL_KTLS:=       no
411 MK_KERBEROS:=   no
412 MK_KERBEROS_SUPPORT:=   no
413 MK_LDNS:=       no
414 MK_PKGBOOTSTRAP:=       no
415 MK_ZFS:=        no
416 .endif
417
418 .if ${MK_LDNS} == "no"
419 MK_LDNS_UTILS:= no
420 MK_UNBOUND:= no
421 .endif
422
423 .if ${MK_PF} == "no"
424 MK_AUTHPF:=     no
425 .endif
426
427 .if ${MK_OFED} == "no"
428 MK_OFED_EXTRA:= no
429 .endif
430
431 .if ${MK_TESTS} == "no"
432 MK_DTRACE_TESTS:= no
433 .endif
434
435 .if ${MK_TESTS_SUPPORT} == "no"
436 MK_GOOGLETEST:= no
437 .endif
438
439 .if ${MK_ZONEINFO} == "no"
440 MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no
441 .endif
442
443 .if ${MK_CROSS_COMPILER} == "no"
444 MK_CLANG_BOOTSTRAP:= no
445 MK_ELFTOOLCHAIN_BOOTSTRAP:= no
446 MK_LLD_BOOTSTRAP:= no
447 .endif
448
449 .if ${MK_TOOLCHAIN} == "no"
450 MK_CLANG:=      no
451 MK_INCLUDES:=   no
452 MK_LLD:=        no
453 MK_LLDB:=       no
454 MK_LLVM_BINUTILS:=      no
455 .endif
456
457 .if ${MK_CLANG} == "no"
458 MK_CLANG_EXTRAS:= no
459 MK_CLANG_FORMAT:= no
460 MK_CLANG_FULL:= no
461 MK_LLVM_COV:= no
462 .endif
463
464 .if ${MK_ASAN} == "yes"
465 # In order to get sensible backtraces from ASAN we have to install
466 # llvm-symbolizer as /usr/bin/addr2line instead of the elftoolchain version.
467 MK_LLVM_BINUTILS:=      yes
468 .endif
469
470 .if ${MK_LLVM_BINUTILS} == "yes"
471 # MK_LLVM_CXXFILT is a subset of MK_LLVM_BINUTILS and should therefore be
472 # enabled if MK_LLVM_BINUTILS is set.
473 MK_LLVM_CXXFILT:=       yes
474 .endif
475
476 .if ${MK_LOADER_VERIEXEC} == "no"
477 MK_LOADER_VERIEXEC_PASS_MANIFEST := no
478 .endif
479
480 #
481 # MK_* options whose default value depends on another option.
482 #
483 .for vv in \
484     GSSAPI/KERBEROS \
485     MAN_UTILS/MAN
486 .if defined(WITH_${vv:H})
487 MK_${vv:H}:=    yes
488 .elif defined(WITHOUT_${vv:H})
489 MK_${vv:H}:=    no
490 .else
491 MK_${vv:H}:=    ${MK_${vv:T}}
492 .endif
493 .endfor
494
495 #
496 # Set defaults for the MK_*_SUPPORT variables.
497 #
498
499 .endif #  !target(__<src.opts.mk>__)