xref: /freebsd/share/mk/src.opts.mk (revision a42d6f76018e4ed8324e319ab48aac904bda437c)
15e84b765SWarner Losh#
2e0281204SWarner Losh# Option file for FreeBSD /usr/src builds, at least the userland and boot loader
3e0281204SWarner Losh# portions of the tree. These options generally chose what parts of the tree to
4e0281204SWarner Losh# include or omit and are FreeBSD source tree specific.
55e84b765SWarner Losh#
65e84b765SWarner Losh# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf
75e84b765SWarner Losh# and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no}
85e84b765SWarner Losh# with sensible (usually) defaults.
95e84b765SWarner Losh#
105e84b765SWarner Losh# Makefiles must include bsd.opts.mk after defining specific MK_FOO options that
115e84b765SWarner Losh# are applicable for that Makefile (typically there are none, but sometimes there
125e84b765SWarner Losh# are exceptions). Recursive makes usually add MK_FOO=no for options that they wish
135e84b765SWarner Losh# to omit from that make.
145e84b765SWarner Losh#
151fc86460SWarner Losh# Makefiles must include bsd.mkopt.mk before they test the value of any MK_FOO
165e84b765SWarner Losh# variable.
175e84b765SWarner Losh#
18c6063d0dSWarner Losh# Makefiles may also assume that this file is included by src.opts.mk should it
195e84b765SWarner Losh# need variables defined there prior to the end of the Makefile where
205e84b765SWarner Losh# bsd.{subdir,lib.bin}.mk is traditionally included.
215e84b765SWarner Losh#
225e84b765SWarner Losh# The old-style YES_FOO and NO_FOO are being phased out. No new instances of them
235e84b765SWarner Losh# should be added. Old instances should be removed since they were just to
245e84b765SWarner Losh# bridge the gap between FreeBSD 4 and FreeBSD 5.
255e84b765SWarner Losh#
265e84b765SWarner Losh# Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an
275e84b765SWarner Losh# exception is made for _WITHOUT_SRCONF which turns off this mechanism
2822cac754SWarner Losh# completely inside bsd.*.mk files).
295e84b765SWarner Losh#
305e84b765SWarner Losh
315e84b765SWarner Losh.if !target(__<src.opts.mk>__)
325e84b765SWarner Losh__<src.opts.mk>__:
335e84b765SWarner Losh
34f9798cc7SWarner Losh.include <bsd.own.mk>
35f9798cc7SWarner Losh
365e84b765SWarner Losh#
375e84b765SWarner Losh# Define MK_* variables (which are either "yes" or "no") for users
385e84b765SWarner Losh# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
395e84b765SWarner Losh# make(1) environment.
405e84b765SWarner Losh# These should be tested with `== "no"' or `!= "no"' in makefiles.
415e84b765SWarner Losh# The NO_* variables should only be set by makefiles for variables
425e84b765SWarner Losh# that haven't been converted over.
435e84b765SWarner Losh#
445e84b765SWarner Losh
45c1593b9eSWarner Losh# These options are used by the src builds. Those listed in
46c1593b9eSWarner Losh# __DEFAULT_YES_OPTIONS default to 'yes' and will build unless turned
47c1593b9eSWarner Losh# off.  __DEFAULT_NO_OPTIONS will default to 'no' and won't build
48c1593b9eSWarner Losh# unless turned on. Any options listed in 'BROKEN_OPTIONS' will be
49c1593b9eSWarner Losh# hard-wired to 'no'.  "Broken" here means not working or
50c1593b9eSWarner Losh# not-appropriate and/or not supported. It doesn't imply something is
51c1593b9eSWarner Losh# wrong with the code. There's not a single good word for this, so
52c1593b9eSWarner Losh# BROKEN was selected as the least imperfect one considered at the
53c1593b9eSWarner Losh# time. Options are added to BROKEN_OPTIONS list on a per-arch basis.
54c1593b9eSWarner Losh# At this time, there's no provision for mutually incompatible options.
55b908f6c4SColin Percival# Options listed in 'REQUIRED_OPTIONS' will be hard-wired to 'yes'; this
56b908f6c4SColin Percival# is intended as a transitional measure while options are in the process
57b908f6c4SColin Percival# of being removed.
585e84b765SWarner Losh
595e84b765SWarner Losh__DEFAULT_YES_OPTIONS = \
605e84b765SWarner Losh    ACCT \
615e84b765SWarner Losh    ACPI \
625e84b765SWarner Losh    APM \
635e84b765SWarner Losh    AT \
645e84b765SWarner Losh    AUDIT \
655e84b765SWarner Losh    AUTHPF \
66b3590423SEnji Cooper    AUTOFS \
6702629e46SEnji Cooper    BHYVE \
6895856e14SKurt Lidl    BLACKLIST \
695e84b765SWarner Losh    BLUETOOTH \
705e84b765SWarner Losh    BOOT \
7111981695SEnji Cooper    BOOTPARAMD \
7211981695SEnji Cooper    BOOTPD \
735e84b765SWarner Losh    BSD_CPIO \
74e45b569cSEnji Cooper    BSDINSTALL \
755e84b765SWarner Losh    BSNMP \
765e84b765SWarner Losh    BZIP2 \
775e84b765SWarner Losh    CALENDAR \
78f27f39dbSKyle Evans    CAROOT \
7918cc3172SEnji Cooper    CCD \
805e84b765SWarner Losh    CDDL \
8183a08b7cSEd Maste    CLANG \
824a4c9a0fSAlex Richardson    CLANG_BOOTSTRAP \
8375766799SEd Maste    CLEAN \
845e84b765SWarner Losh    CPP \
855e84b765SWarner Losh    CROSS_COMPILER \
865e84b765SWarner Losh    CRYPT \
8736716419SHans Petter Selasky    CUSE \
88983a395dSWarner Losh    CXGBETOOL \
895e84b765SWarner Losh    DICT \
905e84b765SWarner Losh    DMAGENT \
913bf66365SBrooks Davis    DTRACE \
925e84b765SWarner Losh    DYNAMICROOT \
9379a86dafSEnji Cooper    EE \
94d49a5dddSWarner Losh    EFI \
9508474898SEd Maste    ELFTOOLCHAIN_BOOTSTRAP \
965e84b765SWarner Losh    EXAMPLES \
97c7b6816fSEnji Cooper    FILE \
9811981695SEnji Cooper    FINGER \
995e84b765SWarner Losh    FLOPPY \
1005e84b765SWarner Losh    FORTH \
1015e84b765SWarner Losh    FP_LIBC \
1025e84b765SWarner Losh    FREEBSD_UPDATE \
10311981695SEnji Cooper    FTP \
1045e84b765SWarner Losh    GAMES \
105252884aeSStefan Eßer    GH_BC \
10694ff3d03SEd Maste    GNU_DIFF \
107d679c719SKyle Evans    GOOGLETEST \
1085e84b765SWarner Losh    GPIO \
1094e395054SEnji Cooper    HAST \
1105e84b765SWarner Losh    HTML \
111983a395dSWarner Losh    HYPERV \
1125e84b765SWarner Losh    ICONV \
1135e84b765SWarner Losh    INET \
1145e84b765SWarner Losh    INET6 \
11511981695SEnji Cooper    INETD \
1165e84b765SWarner Losh    IPFILTER \
1175e84b765SWarner Losh    IPFW \
118b29d6977SEnji Cooper    ISCSI \
1195e84b765SWarner Losh    JAIL \
1205e84b765SWarner Losh    KDUMP \
1215e84b765SWarner Losh    KVM \
1225e84b765SWarner Losh    LDNS \
1235e84b765SWarner Losh    LDNS_UTILS \
1245e84b765SWarner Losh    LEGACY_CONSOLE \
12583a08b7cSEd Maste    LLD \
126a04ec978SBrandon Bergren    LLD_BOOTSTRAP \
127147d7b56SKyle Evans    LLVM_ASSERTIONS \
1281b49115aSEd Maste    LLVM_COV \
1299fa94e1cSDimitry Andric    LLVM_CXXFILT \
13054095bf4SKyle Evans    LOADER_GELI \
1311a7ed7feSWarner Losh    LOADER_KBOOT \
1329d45c24cSWarner Losh    LOADER_LUA \
13354095bf4SKyle Evans    LOADER_OFW \
13454095bf4SKyle Evans    LOADER_UBOOT \
1355e84b765SWarner Losh    LOCALES \
1365e84b765SWarner Losh    LOCATE \
1375e84b765SWarner Losh    LPR \
1385e84b765SWarner Losh    LS_COLORS \
13920adba8bSGleb Popov    MACHDEP_OPTIMIZATIONS \
1405e84b765SWarner Losh    MAIL \
1415e84b765SWarner Losh    MAILWRAPPER \
1425e84b765SWarner Losh    MAKE \
143983a395dSWarner Losh    MLX5TOOL \
1445e84b765SWarner Losh    NETCAT \
1455e84b765SWarner Losh    NETGRAPH \
146cb1fc924SBaptiste Daroussin    NETLINK \
1474f6a5e1dSAlexander V. Chernikov    NETLINK_SUPPORT \
1485e84b765SWarner Losh    NLS_CATALOGS \
1495e84b765SWarner Losh    NS_CACHING \
1505e84b765SWarner Losh    NTP \
151*a42d6f76SBaptiste Daroussin    NUAGEINIT \
152983a395dSWarner Losh    NVME \
153be3bff32SKonstantin Belousov    OFED \
1545e84b765SWarner Losh    OPENSSL \
1555e84b765SWarner Losh    PAM \
1565e84b765SWarner Losh    PF \
1575e84b765SWarner Losh    PKGBOOTSTRAP \
1585e84b765SWarner Losh    PMC \
1595e84b765SWarner Losh    PPP \
160642cd511SGreg Becker    PTHREADS_ASSERTIONS \
1615e84b765SWarner Losh    QUOTAS \
16231a741f4SEnji Cooper    RADIUS_SUPPORT \
16311981695SEnji Cooper    RBOOTD \
1645e84b765SWarner Losh    RESCUE \
1655e84b765SWarner Losh    ROUTED \
1665e84b765SWarner Losh    SENDMAIL \
1676f077571SSean Bruno    SERVICESDB \
1685e84b765SWarner Losh    SETUID_LOGIN \
1695e84b765SWarner Losh    SHAREDOCS \
1705e84b765SWarner Losh    SOURCELESS \
1715e84b765SWarner Losh    SOURCELESS_HOST \
1725e84b765SWarner Losh    SOURCELESS_UCODE \
1731a13f2e6SEdward Tomasz Napierala    STATS \
1745e84b765SWarner Losh    SYSCONS \
175bf16c2e9SBryan Drewery    SYSTEM_COMPILER \
176a7d84af8SBryan Drewery    SYSTEM_LINKER \
1773f802165SEnji Cooper    TALK \
17811981695SEnji Cooper    TCP_WRAPPERS \
1795e84b765SWarner Losh    TCSH \
1805e84b765SWarner Losh    TELNET \
1815e84b765SWarner Losh    TEXTPROC \
18211981695SEnji Cooper    TFTP \
1835e84b765SWarner Losh    UNBOUND \
1845e84b765SWarner Losh    USB \
1855e84b765SWarner Losh    UTMPX \
1865e84b765SWarner Losh    VI \
187824a9093SEd Maste    VT \
1885e84b765SWarner Losh    WIRELESS \
1895e84b765SWarner Losh    WPA_SUPPLICANT_EAPOL \
1905e84b765SWarner Losh    ZFS \
191fbeb31a2SMatt Macy    LOADER_ZFS \
1925e84b765SWarner Losh    ZONEINFO
1935e84b765SWarner Losh
1945e84b765SWarner Losh__DEFAULT_NO_OPTIONS = \
195a92958dfSSimon J. Gerraty    BEARSSL \
196483d953aSJohn Baldwin    BHYVE_SNAPSHOT \
1975e84b765SWarner Losh    CLANG_EXTRAS \
1980a9ab9f5SConrad Meyer    CLANG_FORMAT \
19938981026SBaptiste Daroussin    DIALOG \
200ddedf2a1SEdward Tomasz Napierala    DETECT_TZ_CHANGES \
2019e914c7aSJessica Clarke    DISK_IMAGE_TOOLS_BOOTSTRAP \
2026de02228SDomagoj Stolfa    DTRACE_ASAN \
203d912066cSMark Johnston    DTRACE_TESTS \
20443f75d57SBjoern A. Zeeb    EXPERIMENTAL \
2055e84b765SWarner Losh    HESIOD \
20663e9c976SWarner Losh    LOADER_BIOS_TEXTONLY \
207f871c5d9SWarner Losh    LOADER_VERBOSE \
208b0fefb25SMarcin Wojtas    LOADER_VERIEXEC_PASS_MANIFEST \
209021385abSAlex Richardson    LLVM_BINUTILS \
21073ff7384SDimitry Andric    LLVM_FULL_DEBUGINFO \
2117d4374f6SDimitry Andric    MALLOC_PRODUCTION \
212abbe7d5aSKonstantin Belousov    OFED_EXTRA \
2135e84b765SWarner Losh    OPENLDAP \
214a58383d2SJohn Baldwin    REPRODUCIBLE_BUILD \
215609b7b26SEnji Cooper    RPCBIND_WARMSTART_SUPPORT \
2165e84b765SWarner Losh    SORT_THREADS \
217c5cba060SEnji Cooper    ZONEINFO_LEAPSECONDS_SUPPORT \
2186120aabdSBryan Drewery
219b908f6c4SColin Percival__REQUIRED_OPTIONS = \
220c24c117bSColin Percival    CAPSICUM \
221c24c117bSColin Percival    CASPER
222b908f6c4SColin Percival
223100fafebSBryan Drewery# LEFT/RIGHT. Left options which default to "yes" unless their corresponding
224100fafebSBryan Drewery# RIGHT option is disabled.
225100fafebSBryan Drewery__DEFAULT_DEPENDENT_OPTIONS= \
226100fafebSBryan Drewery	CLANG_FULL/CLANG \
227e7e22476SAlex Richardson	LLVM_TARGET_ALL/CLANG \
228a92958dfSSimon J. Gerraty	LOADER_VERIEXEC/BEARSSL \
22913ea0450SMarcin Wojtas	LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \
230afc571b1SSimon J. Gerraty	LOADER_VERIEXEC_VECTX/LOADER_VERIEXEC \
231a92958dfSSimon J. Gerraty	VERIEXEC/BEARSSL \
232100fafebSBryan Drewery
23309e32b2fSBrooks Davis__SINGLE_OPTIONS = \
23409e32b2fSBrooks Davis	LIBC_MALLOC
23509e32b2fSBrooks Davis
23609e32b2fSBrooks Davis__LIBC_MALLOC_OPTIONS=	jemalloc
23709e32b2fSBrooks Davis__LIBC_MALLOC_DEFAULT=	jemalloc
23809e32b2fSBrooks Davis
239100fafebSBryan Drewery# MK_*_SUPPORT options which default to "yes" unless their corresponding
240100fafebSBryan Drewery# MK_* variable is set to "no".
241100fafebSBryan Drewery#
242100fafebSBryan Drewery.for var in \
243100fafebSBryan Drewery    BLACKLIST \
244100fafebSBryan Drewery    BZIP2 \
245100fafebSBryan Drewery    INET \
246100fafebSBryan Drewery    INET6 \
247100fafebSBryan Drewery    KERBEROS \
248100fafebSBryan Drewery    KVM \
249100fafebSBryan Drewery    NETGRAPH \
250100fafebSBryan Drewery    PAM \
251100fafebSBryan Drewery    TESTS \
252100fafebSBryan Drewery    WIRELESS
253100fafebSBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+= ${var}_SUPPORT/${var}
254100fafebSBryan Drewery.endfor
2555e84b765SWarner Losh
2565e84b765SWarner Losh#
2575e84b765SWarner Losh# Default behaviour of some options depends on the architecture.  Unfortunately
2585e84b765SWarner Losh# this means that we have to test TARGET_ARCH (the buildworld case) as well
2595e84b765SWarner Losh# as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
2605e84b765SWarner Losh# used at all in bsd.*.mk, but we have to make an exception here if we want
2615e84b765SWarner Losh# to allow defaults for some things like clang to vary by target architecture.
2625e84b765SWarner Losh# Additional, per-target behavior should be rarely added only after much
2635e84b765SWarner Losh# gnashing of teeth and grinding of gears.
2645e84b765SWarner Losh#
2655e84b765SWarner Losh.if defined(TARGET_ARCH)
2665e84b765SWarner Losh__T=${TARGET_ARCH}
2675e84b765SWarner Losh.else
2685e84b765SWarner Losh__T=${MACHINE_ARCH}
2695e84b765SWarner Losh.endif
2700104753bSDimitry Andric
271631e709fSBryan Drewery# All supported backends for LLVM_TARGET_XXX
272631e709fSBryan Drewery__LLVM_TARGETS= \
273631e709fSBryan Drewery		aarch64 \
274631e709fSBryan Drewery		arm \
275631e709fSBryan Drewery		powerpc \
276de9950e8SJohn Baldwin		riscv \
277631e709fSBryan Drewery		x86
278eeedaefaSJohn Baldwin__LLVM_TARGET_FILT=	C/(amd64|i386)/x86/:C/powerpc.*/powerpc/:C/armv[67]/arm/:C/riscv.*/riscv/
2794e2a4490SBryan Drewery.for __llt in ${__LLVM_TARGETS}
28096aaefdfSBryan Drewery# Default enable the given TARGET's LLVM_TARGET support
281980bae69SWarner Losh.if ${__T:${__LLVM_TARGET_FILT}} == ${__llt}
28296aaefdfSBryan Drewery__DEFAULT_YES_OPTIONS+=	LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}
2834e2a4490SBryan Drewery# aarch64 needs arm for -m32 support.
284980bae69SWarner Losh.elif ${__T} == "aarch64" && ${__llt:Marm*} != ""
2854e2a4490SBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+=	LLVM_TARGET_ARM/LLVM_TARGET_AARCH64
28696aaefdfSBryan Drewery# Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL.
287631e709fSBryan Drewery.else
2884e2a4490SBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+=	LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL
289631e709fSBryan Drewery.endif
290631e709fSBryan Drewery.endfor
291631e709fSBryan Drewery
2924dbc7835SWarner Losh__DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF LLVM_TARGET_MIPS
29389edb881SDimitry Andric
2940104753bSDimitry Andric.include <bsd.compiler.mk>
2958758abd5SBryan Drewery
2967661a2abSEd Maste.if ${__T} == "i386" || ${__T} == "amd64"
2977661a2abSEd Maste__DEFAULT_NO_OPTIONS += FDT
2987661a2abSEd Maste.else
2997661a2abSEd Maste__DEFAULT_YES_OPTIONS += FDT
3007661a2abSEd Maste.endif
3017661a2abSEd Maste
3028dc42f98SEd Maste.if ${__T:Marm*} == "" && ${__T:Mriscv64*} == ""
303dfccd92cSEd Maste__DEFAULT_YES_OPTIONS+=LLDB
304d0ba16f7SEd Maste.else
305dfccd92cSEd Maste__DEFAULT_NO_OPTIONS+=LLDB
306d0ba16f7SEd Maste.endif
307a1b67573SMike Karels# LIB32 is not supported on all 64-bit architectures.
308a1b67573SMike Karels.if (${__T} == "amd64" || ${__T:Maarch64*} != "" || ${__T} == "powerpc64")
309a4330302SBrooks Davis__DEFAULT_YES_OPTIONS+=LIB32
310a4330302SBrooks Davis.else
311a4330302SBrooks DavisBROKEN_OPTIONS+=LIB32
312a4330302SBrooks Davis.endif
313ad9d10a8SWarner Losh# EFI doesn't exist on powerpc (well, officially) and doesn't work on i386
314ad9d10a8SWarner Losh.if ${__T:Mpowerpc*} || ${__T} == "i386"
315f86dd996SWarner LoshBROKEN_OPTIONS+=EFI
316d49a5dddSWarner Losh.endif
317dcb621efSWarner Losh# Bad coupling for libsecure stuff with bearssl and efi, so broken on EFI
318dcb621efSWarner Losh.if ${__T:Mpowerpc*}
319dcb621efSWarner LoshBROKEN_OPTIONS+=BEARSSL		# bearssl brings in secure efi stuff xxx
3200da51f1fSWarner Losh.endif
32147e9f42eSWarner Losh# OFW is only for powerpc, exclude others
32247e9f42eSWarner Losh.if ${__T:Mpowerpc*} == ""
323f86dd996SWarner LoshBROKEN_OPTIONS+=LOADER_OFW
324f86dd996SWarner Losh.endif
32546010641SWarner Losh# KBOOT is only for powerpc64 (powerpc64le broken) amd64 and aarch64
32646010641SWarner Losh.if ${__T} != "powerpc64" && ${__T} != "amd64" && ${__T} != "aarch64"
3271a7ed7feSWarner LoshBROKEN_OPTIONS+=LOADER_KBOOT
3281a7ed7feSWarner Losh.endif
3299dc70af8SWarner Losh# UBOOT is only for arm, and big-endian powerpc
3309dc70af8SWarner Losh.if (${__T:Marm*} == "" && ${__T:Mpowerpc*} == "") || ${__T} == "powerpc64le"
331f86dd996SWarner LoshBROKEN_OPTIONS+=LOADER_UBOOT
332f86dd996SWarner Losh.endif
33347e9f42eSWarner Losh# GELI and Lua in loader currently cause boot failures on powerpc.
33449f1151fSNathan Whitehorn# Further debugging is required -- probably they are just broken on big
33549f1151fSNathan Whitehorn# endian systems generically (they jump to null pointers or try to read
33649f1151fSNathan Whitehorn# crazy high addresses, which is typical of endianness problems).
33747e9f42eSWarner Losh.if ${__T:Mpowerpc*}
338f54d801aSKurt LidlBROKEN_OPTIONS+=LOADER_GELI LOADER_LUA
339f54d801aSKurt Lidl.endif
340f86dd996SWarner Losh
341e552cac3SPiotr Kubaj# Kernel TLS is enabled by default on amd64, aarch64 and powerpc64*
342e552cac3SPiotr Kubaj.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T:Mpowerpc64*} != ""
343aa906e2aSJohn Baldwin__DEFAULT_YES_OPTIONS+=OPENSSL_KTLS
344aa906e2aSJohn Baldwin.else
345aa906e2aSJohn Baldwin__DEFAULT_NO_OPTIONS+=OPENSSL_KTLS
346aa906e2aSJohn Baldwin.endif
347aa906e2aSJohn Baldwin
348983a395dSWarner Losh.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
349d68224c2SPiotr Kubaj    ${__T:Mpowerpc64*} == ""
350983a395dSWarner LoshBROKEN_OPTIONS+=CXGBETOOL
351983a395dSWarner LoshBROKEN_OPTIONS+=MLX5TOOL
35254912308SNavdeep Parhar.endif
35354912308SNavdeep Parhar
3549729f076SSouradeep Chakrabarti.if ${__T} != "amd64" && ${__T} != "i386" && ${__T} != "aarch64"
355983a395dSWarner LoshBROKEN_OPTIONS+=HYPERV
3565b87c94aSBrooks Davis.endif
3575b87c94aSBrooks Davis
358b75abea4SBrandon Bergren# NVME is only aarch64, x86 and powerpc64*
3596b3555c3SDimitry Andric.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
360b75abea4SBrandon Bergren    ${__T:Mpowerpc64*} == ""
361983a395dSWarner LoshBROKEN_OPTIONS+=NVME
362f0f8a1afSWarner Losh.endif
363f0f8a1afSWarner Losh
3642a5220e1SDimitry Andric.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \
365aa033e0bSPiotr Kubaj    ${__T:Mpowerpc64*} != "" || ${__T:Mriscv64*} != ""
366b0840a28SDimitry Andric__DEFAULT_YES_OPTIONS+=OPENMP
367b0840a28SDimitry Andric.else
368b0840a28SDimitry Andric__DEFAULT_NO_OPTIONS+=OPENMP
369b0840a28SDimitry Andric.endif
370b0840a28SDimitry Andric
37141cf798eSWarner Losh# Broken on 32-bit arm, kernel module compile errors
372fe0f6950SJohn Baldwin.if ${__T:Marm*} != ""
3737661a2abSEd MasteBROKEN_OPTIONS+= OFED
3747661a2abSEd Maste.endif
3757661a2abSEd Maste
376976ba7f0SSimon J. Gerraty# MK_host_egacy is set by local.sys.mk so is valid here
377f9df6097SSimon J. Gerraty.if ${MACHINE:Nhost*} == "" && ${MK_host_egacy} == "yes"
378976ba7f0SSimon J. Gerraty# we cannot expect tests to work
379976ba7f0SSimon J. GerratyBROKEN_OPTIONS+= TESTS
380976ba7f0SSimon J. Gerraty.endif
381976ba7f0SSimon J. Gerraty
382c4c981c1SSimon J. Gerraty.-include <site.src.opts.mk>
383c4c981c1SSimon J. Gerraty
3845e84b765SWarner Losh.include <bsd.mkopt.mk>
3855e84b765SWarner Losh
3865e84b765SWarner Losh#
3875e84b765SWarner Losh# Force some options off if their dependencies are off.
3885e84b765SWarner Losh# Order is somewhat important.
3895e84b765SWarner Losh#
39058551dc6SBaptiste Daroussin.if ${MK_CAPSICUM} == "no"
39158551dc6SBaptiste DaroussinMK_CASPER:=	no
39258551dc6SBaptiste Daroussin.endif
39358551dc6SBaptiste Daroussin
3945e84b765SWarner Losh.if ${MK_SOURCELESS} == "no"
3955e84b765SWarner LoshMK_SOURCELESS_HOST:=	no
3965e84b765SWarner LoshMK_SOURCELESS_UCODE:= no
3975e84b765SWarner Losh.endif
3985e84b765SWarner Losh
3995e84b765SWarner Losh.if ${MK_CDDL} == "no"
4005e84b765SWarner LoshMK_CTF:=	no
4013bf66365SBrooks DavisMK_DTRACE:=	no
4023bf66365SBrooks DavisMK_LOADER_ZFS:=	no
4033bf66365SBrooks DavisMK_ZFS:=	no
4045e84b765SWarner Losh.endif
4055e84b765SWarner Losh
4065e84b765SWarner Losh.if ${MK_CRYPT} == "no"
4075e84b765SWarner LoshMK_OPENSSL:=	no
4085e84b765SWarner LoshMK_OPENSSH:=	no
4095e84b765SWarner LoshMK_KERBEROS:=	no
4100ce9d0afSEd MasteMK_KERBEROS_SUPPORT:=	no
4115e84b765SWarner Losh.endif
4125e84b765SWarner Losh
4133bf66365SBrooks Davis.if ${MK_DTRACE} == "no"
4143bf66365SBrooks DavisMK_CTF:=	no
4153bf66365SBrooks Davis.endif
4163bf66365SBrooks Davis
4175e84b765SWarner Losh.if ${MK_MAIL} == "no"
4185e84b765SWarner LoshMK_MAILWRAPPER:= no
4195e84b765SWarner LoshMK_SENDMAIL:=	no
4205e84b765SWarner LoshMK_DMAGENT:=	no
4215e84b765SWarner Losh.endif
4225e84b765SWarner Losh
4235e84b765SWarner Losh.if ${MK_NETGRAPH} == "no"
4245e84b765SWarner LoshMK_BLUETOOTH:=	no
4255e84b765SWarner Losh.endif
4265e84b765SWarner Losh
427edb58145SEnji Cooper.if ${MK_NLS} == "no"
428edb58145SEnji CooperMK_NLS_CATALOGS:= no
429edb58145SEnji Cooper.endif
430edb58145SEnji Cooper
4315e84b765SWarner Losh.if ${MK_OPENSSL} == "no"
432df502accSEd MasteMK_DMAGENT:=	no
4335e84b765SWarner LoshMK_OPENSSH:=	no
4346940d0e4SEd MasteMK_OPENSSL_KTLS:=	no
4355e84b765SWarner LoshMK_KERBEROS:=	no
4360ce9d0afSEd MasteMK_KERBEROS_SUPPORT:=	no
43737516d3bSEd MasteMK_LDNS:=	no
4385ffef74bSEd MasteMK_PKGBOOTSTRAP:=	no
4399503d270SWarner LoshMK_LOADER_ZFS:=	no
440e5cc1c47SMitchell HorneMK_ZFS:=	no
44137516d3bSEd Maste.endif
44237516d3bSEd Maste
44337516d3bSEd Maste.if ${MK_LDNS} == "no"
44437516d3bSEd MasteMK_LDNS_UTILS:=	no
44537516d3bSEd MasteMK_UNBOUND:= no
4465e84b765SWarner Losh.endif
4475e84b765SWarner Losh
4485e84b765SWarner Losh.if ${MK_PF} == "no"
4495e84b765SWarner LoshMK_AUTHPF:=	no
4505e84b765SWarner Losh.endif
4515e84b765SWarner Losh
452abbe7d5aSKonstantin Belousov.if ${MK_OFED} == "no"
453abbe7d5aSKonstantin BelousovMK_OFED_EXTRA:=	no
454abbe7d5aSKonstantin Belousov.endif
455abbe7d5aSKonstantin Belousov
456d912066cSMark Johnston.if ${MK_TESTS} == "no"
457d912066cSMark JohnstonMK_DTRACE_TESTS:= no
45806beea0eSEnji Cooper.endif
45906beea0eSEnji Cooper
46006beea0eSEnji Cooper.if ${MK_TESTS_SUPPORT} == "no"
46143e25f47SEnji CooperMK_GOOGLETEST:=	no
462d912066cSMark Johnston.endif
463d912066cSMark Johnston
464c5cba060SEnji Cooper.if ${MK_ZONEINFO} == "no"
465c5cba060SEnji CooperMK_ZONEINFO_LEAPSECONDS_SUPPORT:= no
466c5cba060SEnji Cooper.endif
467c5cba060SEnji Cooper
4685e84b765SWarner Losh.if ${MK_CROSS_COMPILER} == "no"
4695e84b765SWarner LoshMK_CLANG_BOOTSTRAP:= no
47008474898SEd MasteMK_ELFTOOLCHAIN_BOOTSTRAP:= no
47189257265SEd MasteMK_LLD_BOOTSTRAP:= no
4725e84b765SWarner Losh.endif
4735e84b765SWarner Losh
4745e84b765SWarner Losh.if ${MK_TOOLCHAIN} == "no"
4755e84b765SWarner LoshMK_CLANG:=	no
476e5928414SEd MasteMK_LLD:=	no
47711e49977SBryan DreweryMK_LLDB:=	no
478021385abSAlex RichardsonMK_LLVM_BINUTILS:=	no
4795e84b765SWarner Losh.endif
4805e84b765SWarner Losh
4815e84b765SWarner Losh.if ${MK_CLANG} == "no"
4825e84b765SWarner LoshMK_CLANG_EXTRAS:= no
4830a9ab9f5SConrad MeyerMK_CLANG_FORMAT:= no
4845e84b765SWarner LoshMK_CLANG_FULL:= no
4851b49115aSEd MasteMK_LLVM_COV:= no
4865e84b765SWarner Losh.endif
4875e84b765SWarner Losh
48824f58618SAlex Richardson.if ${MK_ASAN} == "yes"
48924f58618SAlex Richardson# In order to get sensible backtraces from ASAN we have to install
49024f58618SAlex Richardson# llvm-symbolizer as /usr/bin/addr2line instead of the elftoolchain version.
49124f58618SAlex RichardsonMK_LLVM_BINUTILS:=	yes
49224f58618SAlex Richardson.endif
49324f58618SAlex Richardson
494021385abSAlex Richardson.if ${MK_LLVM_BINUTILS} == "yes"
495021385abSAlex Richardson# MK_LLVM_CXXFILT is a subset of MK_LLVM_BINUTILS and should therefore be
496021385abSAlex Richardson# enabled if MK_LLVM_BINUTILS is set.
497021385abSAlex RichardsonMK_LLVM_CXXFILT:=	yes
498021385abSAlex Richardson.endif
499021385abSAlex Richardson
500b0fefb25SMarcin Wojtas.if ${MK_LOADER_VERIEXEC} == "no"
501b0fefb25SMarcin WojtasMK_LOADER_VERIEXEC_PASS_MANIFEST := no
502b0fefb25SMarcin Wojtas.endif
503b0fefb25SMarcin Wojtas
5045e84b765SWarner Losh#
5054301886dSEnji Cooper# MK_* options whose default value depends on another option.
5064301886dSEnji Cooper#
5074301886dSEnji Cooper.for vv in \
5084301886dSEnji Cooper    GSSAPI/KERBEROS \
5094301886dSEnji Cooper    MAN_UTILS/MAN
5104301886dSEnji Cooper.if defined(WITH_${vv:H})
5114301886dSEnji CooperMK_${vv:H}:=	yes
5124301886dSEnji Cooper.elif defined(WITHOUT_${vv:H})
5134301886dSEnji CooperMK_${vv:H}:=	no
5144301886dSEnji Cooper.else
5154301886dSEnji CooperMK_${vv:H}:=	${MK_${vv:T}}
5164301886dSEnji Cooper.endif
5174301886dSEnji Cooper.endfor
5184301886dSEnji Cooper
5194301886dSEnji Cooper#
5205e84b765SWarner Losh# Set defaults for the MK_*_SUPPORT variables.
5215e84b765SWarner Losh#
5225e84b765SWarner Losh
523ff2cf368SBaptiste Daroussin.endif #  !target(__<src.opts.mk>__)
524