]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/src.opts.mk
contrib/bsddialog: Import version 0.4
[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     DTRACE \
96     DYNAMICROOT \
97     EE \
98     EFI \
99     ELFTOOLCHAIN_BOOTSTRAP \
100     EXAMPLES \
101     FDT \
102     FILE \
103     FINGER \
104     FLOPPY \
105     FORTH \
106     FP_LIBC \
107     FREEBSD_UPDATE \
108     FTP \
109     GAMES \
110     GH_BC \
111     GNU_DIFF \
112     GOOGLETEST \
113     GPIO \
114     HAST \
115     HTML \
116     HYPERV \
117     ICONV \
118     INET \
119     INET6 \
120     INETD \
121     IPFILTER \
122     IPFW \
123     ISCSI \
124     JAIL \
125     KDUMP \
126     KVM \
127     LDNS \
128     LDNS_UTILS \
129     LEGACY_CONSOLE \
130     LLD \
131     LLD_BOOTSTRAP \
132     LLD_IS_LD \
133     LLVM_ASSERTIONS \
134     LLVM_COV \
135     LLVM_CXXFILT \
136     LOADER_GELI \
137     LOADER_KBOOT \
138     LOADER_LUA \
139     LOADER_OFW \
140     LOADER_UBOOT \
141     LOCALES \
142     LOCATE \
143     LPR \
144     LS_COLORS \
145     MACHDEP_OPTIMIZATIONS \
146     MAIL \
147     MAILWRAPPER \
148     MAKE \
149     MLX5TOOL \
150     NDIS \
151     NETCAT \
152     NETGRAPH \
153     NLS_CATALOGS \
154     NS_CACHING \
155     NTP \
156     NVME \
157     OFED \
158     OPENSSL \
159     PAM \
160     PF \
161     PKGBOOTSTRAP \
162     PMC \
163     PORTSNAP \
164     PPP \
165     QUOTAS \
166     RADIUS_SUPPORT \
167     RBOOTD \
168     RESCUE \
169     ROUTED \
170     SENDMAIL \
171     SERVICESDB \
172     SETUID_LOGIN \
173     SHARED_TOOLCHAIN \
174     SHAREDOCS \
175     SOURCELESS \
176     SOURCELESS_HOST \
177     SOURCELESS_UCODE \
178     STATS \
179     SYSCONS \
180     SYSTEM_COMPILER \
181     SYSTEM_LINKER \
182     TALK \
183     TCP_WRAPPERS \
184     TCSH \
185     TELNET \
186     TEXTPROC \
187     TFTP \
188     UNBOUND \
189     USB \
190     UTMPX \
191     VI \
192     VT \
193     WIRELESS \
194     WPA_SUPPLICANT_EAPOL \
195     ZFS \
196     LOADER_ZFS \
197     ZONEINFO
198
199 __DEFAULT_NO_OPTIONS = \
200     BEARSSL \
201     BHYVE_SNAPSHOT \
202     CLANG_EXTRAS \
203     CLANG_FORMAT \
204     DETECT_TZ_CHANGES \
205     DTRACE_TESTS \
206     EXPERIMENTAL \
207     HESIOD \
208     LOADER_FIREWIRE \
209     LOADER_VERBOSE \
210     LOADER_VERIEXEC_PASS_MANIFEST \
211     LLVM_BINUTILS \
212     MALLOC_PRODUCTION \
213     OFED_EXTRA \
214     OPENLDAP \
215     REPRODUCIBLE_BUILD \
216     RPCBIND_WARMSTART_SUPPORT \
217     SORT_THREADS \
218     ZONEINFO_LEAPSECONDS_SUPPORT \
219
220 # LEFT/RIGHT. Left options which default to "yes" unless their corresponding
221 # RIGHT option is disabled.
222 __DEFAULT_DEPENDENT_OPTIONS= \
223         CLANG_FULL/CLANG \
224         LLVM_TARGET_ALL/CLANG \
225         LOADER_VERIEXEC/BEARSSL \
226         LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \
227         LOADER_VERIEXEC_VECTX/LOADER_VERIEXEC \
228         VERIEXEC/BEARSSL \
229
230 # MK_*_SUPPORT options which default to "yes" unless their corresponding
231 # MK_* variable is set to "no".
232 #
233 .for var in \
234     BLACKLIST \
235     BZIP2 \
236     INET \
237     INET6 \
238     KERBEROS \
239     KVM \
240     NETGRAPH \
241     PAM \
242     TESTS \
243     WIRELESS
244 __DEFAULT_DEPENDENT_OPTIONS+= ${var}_SUPPORT/${var}
245 .endfor
246
247 #
248 # Default behaviour of some options depends on the architecture.  Unfortunately
249 # this means that we have to test TARGET_ARCH (the buildworld case) as well
250 # as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
251 # used at all in bsd.*.mk, but we have to make an exception here if we want
252 # to allow defaults for some things like clang to vary by target architecture.
253 # Additional, per-target behavior should be rarely added only after much
254 # gnashing of teeth and grinding of gears.
255 #
256 .if defined(TARGET_ARCH)
257 __T=${TARGET_ARCH}
258 .else
259 __T=${MACHINE_ARCH}
260 .endif
261
262 # All supported backends for LLVM_TARGET_XXX
263 __LLVM_TARGETS= \
264                 aarch64 \
265                 arm \
266                 powerpc \
267                 riscv \
268                 x86
269 __LLVM_TARGET_FILT=     C/(amd64|i386)/x86/:C/powerpc.*/powerpc/:C/armv[67]/arm/:C/riscv.*/riscv/:C/mips.*/mips/
270 .for __llt in ${__LLVM_TARGETS}
271 # Default enable the given TARGET's LLVM_TARGET support
272 .if ${__T:${__LLVM_TARGET_FILT}} == ${__llt}
273 __DEFAULT_YES_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}
274 # aarch64 needs arm for -m32 support.
275 .elif ${__T} == "aarch64" && ${__llt:Marm*} != ""
276 __DEFAULT_DEPENDENT_OPTIONS+=   LLVM_TARGET_ARM/LLVM_TARGET_AARCH64
277 # Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL.
278 .else
279 __DEFAULT_DEPENDENT_OPTIONS+=   LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL
280 .endif
281 .endfor
282
283 __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF LLVM_TARGET_MIPS
284
285 .include <bsd.compiler.mk>
286
287 .if ${__T:Marm*} == "" && ${__T:Mriscv64*} == ""
288 __DEFAULT_YES_OPTIONS+=LLDB
289 .else
290 __DEFAULT_NO_OPTIONS+=LLDB
291 .endif
292 # LIB32 is supported on amd64 and powerpc64
293 .if (${__T} == "amd64" || ${__T} == "powerpc64")
294 __DEFAULT_YES_OPTIONS+=LIB32
295 .else
296 BROKEN_OPTIONS+=LIB32
297 .endif
298 # EFI doesn't exist on powerpc (well, officially)
299 .if ${__T:Mpowerpc*}
300 BROKEN_OPTIONS+=EFI
301 .endif
302 # OFW is only for powerpc, exclude others
303 .if ${__T:Mpowerpc*} == ""
304 BROKEN_OPTIONS+=LOADER_OFW
305 .endif
306 # KBOOT is only for powerpc64 (powerpc64le broken) and kinda for amd64
307 .if ${__T} != "powerpc64" && ${__T} != "amd64"
308 BROKEN_OPTIONS+=LOADER_KBOOT
309 .endif
310 # UBOOT is only for arm, and big-endian powerpc
311 .if (${__T:Marm*} == "" && ${__T:Mpowerpc*} == "") || ${__T} == "powerpc64le"
312 BROKEN_OPTIONS+=LOADER_UBOOT
313 .endif
314 # GELI and Lua in loader currently cause boot failures on powerpc.
315 # Further debugging is required -- probably they are just broken on big
316 # endian systems generically (they jump to null pointers or try to read
317 # crazy high addresses, which is typical of endianness problems).
318 .if ${__T:Mpowerpc*}
319 BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA
320 .endif
321
322 # Kernel TLS is enabled by default on amd64 and aarch64
323 .if ${__T} == "aarch64" || ${__T} == "amd64"
324 __DEFAULT_YES_OPTIONS+=OPENSSL_KTLS
325 .else
326 __DEFAULT_NO_OPTIONS+=OPENSSL_KTLS
327 .endif
328
329 .if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
330     ${__T:Mpowerpc64*} == ""
331 BROKEN_OPTIONS+=CXGBETOOL
332 BROKEN_OPTIONS+=MLX5TOOL
333 .endif
334
335 # HyperV is currently x86-only
336 .if ${__T} != "amd64" && ${__T} != "i386"
337 BROKEN_OPTIONS+=HYPERV
338 .endif
339
340 # NVME is only aarch64, x86 and powerpc64*
341 .if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
342     ${__T:Mpowerpc64*} == ""
343 BROKEN_OPTIONS+=NVME
344 .endif
345
346 .if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \
347     ${__T:Mpowerpc64*} != "" || ${__T:Mriscv64*} != ""
348 __DEFAULT_YES_OPTIONS+=OPENMP
349 .else
350 __DEFAULT_NO_OPTIONS+=OPENMP
351 .endif
352
353 .include <bsd.mkopt.mk>
354
355 #
356 # Force some options off if their dependencies are off.
357 # Order is somewhat important.
358 #
359 .if ${MK_CAPSICUM} == "no"
360 MK_CASPER:=     no
361 .endif
362
363 .if ${MK_SOURCELESS} == "no"
364 MK_SOURCELESS_HOST:=    no
365 MK_SOURCELESS_UCODE:= no
366 .endif
367
368 .if ${MK_CDDL} == "no"
369 MK_CTF:=        no
370 MK_DTRACE:=     no
371 MK_LOADER_ZFS:= no
372 MK_ZFS:=        no
373 .endif
374
375 .if ${MK_CRYPT} == "no"
376 MK_OPENSSL:=    no
377 MK_OPENSSH:=    no
378 MK_KERBEROS:=   no
379 MK_KERBEROS_SUPPORT:=   no
380 .endif
381
382 .if ${MK_CXX} == "no"
383 MK_CLANG:=      no
384 MK_GOOGLETEST:= no
385 MK_OFED:=       no
386 MK_OPENMP:=     no
387 MK_PMC:=        no
388 MK_TESTS:=      no
389 .endif
390
391 .if ${MK_DIALOG} == "no"
392 MK_BSDINSTALL:= no
393 .endif
394
395 .if ${MK_DTRACE} == "no"
396 MK_CTF:=        no
397 .endif
398
399 .if ${MK_MAIL} == "no"
400 MK_MAILWRAPPER:= no
401 MK_SENDMAIL:=   no
402 MK_DMAGENT:=    no
403 .endif
404
405 .if ${MK_NETGRAPH} == "no"
406 MK_ATM:=        no
407 MK_BLUETOOTH:=  no
408 .endif
409
410 .if ${MK_NLS} == "no"
411 MK_NLS_CATALOGS:= no
412 .endif
413
414 .if ${MK_OPENSSL} == "no"
415 MK_DMAGENT:=    no
416 MK_OPENSSH:=    no
417 MK_OPENSSL_KTLS:=       no
418 MK_KERBEROS:=   no
419 MK_KERBEROS_SUPPORT:=   no
420 MK_LDNS:=       no
421 MK_PKGBOOTSTRAP:=       no
422 MK_ZFS:=        no
423 .endif
424
425 .if ${MK_LDNS} == "no"
426 MK_LDNS_UTILS:= no
427 MK_UNBOUND:= no
428 .endif
429
430 .if ${MK_PF} == "no"
431 MK_AUTHPF:=     no
432 .endif
433
434 .if ${MK_OFED} == "no"
435 MK_OFED_EXTRA:= no
436 .endif
437
438 .if ${MK_TESTS} == "no"
439 MK_DTRACE_TESTS:= no
440 .endif
441
442 .if ${MK_TESTS_SUPPORT} == "no"
443 MK_GOOGLETEST:= no
444 .endif
445
446 .if ${MK_ZONEINFO} == "no"
447 MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no
448 .endif
449
450 .if ${MK_CROSS_COMPILER} == "no"
451 MK_CLANG_BOOTSTRAP:= no
452 MK_ELFTOOLCHAIN_BOOTSTRAP:= no
453 MK_LLD_BOOTSTRAP:= no
454 .endif
455
456 .if ${MK_TOOLCHAIN} == "no"
457 MK_CLANG:=      no
458 MK_INCLUDES:=   no
459 MK_LLD:=        no
460 MK_LLDB:=       no
461 MK_LLVM_BINUTILS:=      no
462 .endif
463
464 .if ${MK_CLANG} == "no"
465 MK_CLANG_EXTRAS:= no
466 MK_CLANG_FORMAT:= no
467 MK_CLANG_FULL:= no
468 MK_LLVM_COV:= no
469 .endif
470
471 .if ${MK_ASAN} == "yes"
472 # In order to get sensible backtraces from ASAN we have to install
473 # llvm-symbolizer as /usr/bin/addr2line instead of the elftoolchain version.
474 MK_LLVM_BINUTILS:=      yes
475 .endif
476
477 .if ${MK_LLVM_BINUTILS} == "yes"
478 # MK_LLVM_CXXFILT is a subset of MK_LLVM_BINUTILS and should therefore be
479 # enabled if MK_LLVM_BINUTILS is set.
480 MK_LLVM_CXXFILT:=       yes
481 .endif
482
483 .if ${MK_LOADER_VERIEXEC} == "no"
484 MK_LOADER_VERIEXEC_PASS_MANIFEST := no
485 .endif
486
487 #
488 # MK_* options whose default value depends on another option.
489 #
490 .for vv in \
491     GSSAPI/KERBEROS \
492     MAN_UTILS/MAN
493 .if defined(WITH_${vv:H})
494 MK_${vv:H}:=    yes
495 .elif defined(WITHOUT_${vv:H})
496 MK_${vv:H}:=    no
497 .else
498 MK_${vv:H}:=    ${MK_${vv:T}}
499 .endif
500 .endfor
501
502 #
503 # Set defaults for the MK_*_SUPPORT variables.
504 #
505
506 .endif #  !target(__<src.opts.mk>__)