xref: /freebsd/share/mk/src.opts.mk (revision b908f6c45e0202deb86fc9bde1b07212924c05fc)
15e84b765SWarner Losh# $FreeBSD$
25e84b765SWarner Losh#
3e0281204SWarner Losh# Option file for FreeBSD /usr/src builds, at least the userland and boot loader
4e0281204SWarner Losh# portions of the tree. These options generally chose what parts of the tree to
5e0281204SWarner Losh# include or omit and are FreeBSD source tree specific.
65e84b765SWarner Losh#
75e84b765SWarner Losh# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf
85e84b765SWarner Losh# and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no}
95e84b765SWarner Losh# with sensible (usually) defaults.
105e84b765SWarner Losh#
115e84b765SWarner Losh# Makefiles must include bsd.opts.mk after defining specific MK_FOO options that
125e84b765SWarner Losh# are applicable for that Makefile (typically there are none, but sometimes there
135e84b765SWarner Losh# are exceptions). Recursive makes usually add MK_FOO=no for options that they wish
145e84b765SWarner Losh# to omit from that make.
155e84b765SWarner Losh#
161fc86460SWarner Losh# Makefiles must include bsd.mkopt.mk before they test the value of any MK_FOO
175e84b765SWarner Losh# variable.
185e84b765SWarner Losh#
19c6063d0dSWarner Losh# Makefiles may also assume that this file is included by src.opts.mk should it
205e84b765SWarner Losh# need variables defined there prior to the end of the Makefile where
215e84b765SWarner Losh# bsd.{subdir,lib.bin}.mk is traditionally included.
225e84b765SWarner Losh#
235e84b765SWarner Losh# The old-style YES_FOO and NO_FOO are being phased out. No new instances of them
245e84b765SWarner Losh# should be added. Old instances should be removed since they were just to
255e84b765SWarner Losh# bridge the gap between FreeBSD 4 and FreeBSD 5.
265e84b765SWarner Losh#
275e84b765SWarner Losh# Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an
285e84b765SWarner Losh# exception is made for _WITHOUT_SRCONF which turns off this mechanism
2922cac754SWarner Losh# completely inside bsd.*.mk files).
305e84b765SWarner Losh#
315e84b765SWarner Losh
325e84b765SWarner Losh.if !target(__<src.opts.mk>__)
335e84b765SWarner Losh__<src.opts.mk>__:
345e84b765SWarner Losh
35f9798cc7SWarner Losh.include <bsd.own.mk>
36f9798cc7SWarner Losh
375e84b765SWarner Losh#
385e84b765SWarner Losh# Define MK_* variables (which are either "yes" or "no") for users
395e84b765SWarner Losh# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
405e84b765SWarner Losh# make(1) environment.
415e84b765SWarner Losh# These should be tested with `== "no"' or `!= "no"' in makefiles.
425e84b765SWarner Losh# The NO_* variables should only be set by makefiles for variables
435e84b765SWarner Losh# that haven't been converted over.
445e84b765SWarner Losh#
455e84b765SWarner Losh
46c1593b9eSWarner Losh# These options are used by the src builds. Those listed in
47c1593b9eSWarner Losh# __DEFAULT_YES_OPTIONS default to 'yes' and will build unless turned
48c1593b9eSWarner Losh# off.  __DEFAULT_NO_OPTIONS will default to 'no' and won't build
49c1593b9eSWarner Losh# unless turned on. Any options listed in 'BROKEN_OPTIONS' will be
50c1593b9eSWarner Losh# hard-wired to 'no'.  "Broken" here means not working or
51c1593b9eSWarner Losh# not-appropriate and/or not supported. It doesn't imply something is
52c1593b9eSWarner Losh# wrong with the code. There's not a single good word for this, so
53c1593b9eSWarner Losh# BROKEN was selected as the least imperfect one considered at the
54c1593b9eSWarner Losh# time. Options are added to BROKEN_OPTIONS list on a per-arch basis.
55c1593b9eSWarner Losh# At this time, there's no provision for mutually incompatible options.
56*b908f6c4SColin Percival# Options listed in 'REQUIRED_OPTIONS' will be hard-wired to 'yes'; this
57*b908f6c4SColin Percival# is intended as a transitional measure while options are in the process
58*b908f6c4SColin Percival# of being removed.
595e84b765SWarner Losh
605e84b765SWarner Losh__DEFAULT_YES_OPTIONS = \
615e84b765SWarner Losh    ACCT \
625e84b765SWarner Losh    ACPI \
635e84b765SWarner Losh    APM \
645e84b765SWarner Losh    AT \
655e84b765SWarner Losh    AUDIT \
665e84b765SWarner Losh    AUTHPF \
67b3590423SEnji Cooper    AUTOFS \
6802629e46SEnji Cooper    BHYVE \
6995856e14SKurt Lidl    BLACKLIST \
705e84b765SWarner Losh    BLUETOOTH \
715e84b765SWarner Losh    BOOT \
7211981695SEnji Cooper    BOOTPARAMD \
7311981695SEnji Cooper    BOOTPD \
745e84b765SWarner Losh    BSD_CPIO \
75e45b569cSEnji Cooper    BSDINSTALL \
765e84b765SWarner Losh    BSNMP \
775e84b765SWarner Losh    BZIP2 \
785e84b765SWarner Losh    CALENDAR \
795e84b765SWarner Losh    CAPSICUM \
80f27f39dbSKyle Evans    CAROOT \
815e84b765SWarner Losh    CASPER \
8218cc3172SEnji Cooper    CCD \
835e84b765SWarner Losh    CDDL \
8483a08b7cSEd Maste    CLANG \
854a4c9a0fSAlex Richardson    CLANG_BOOTSTRAP \
8675766799SEd Maste    CLEAN \
875e84b765SWarner Losh    CPP \
885e84b765SWarner Losh    CROSS_COMPILER \
895e84b765SWarner Losh    CRYPT \
9036716419SHans Petter Selasky    CUSE \
91983a395dSWarner Losh    CXGBETOOL \
92f987297fSEd Maste    DIALOG \
935e84b765SWarner Losh    DICT \
945e84b765SWarner Losh    DMAGENT \
953bf66365SBrooks Davis    DTRACE \
965e84b765SWarner Losh    DYNAMICROOT \
9779a86dafSEnji Cooper    EE \
98d49a5dddSWarner Losh    EFI \
9908474898SEd Maste    ELFTOOLCHAIN_BOOTSTRAP \
1005e84b765SWarner Losh    EXAMPLES \
101c7b6816fSEnji Cooper    FILE \
10211981695SEnji Cooper    FINGER \
1035e84b765SWarner Losh    FLOPPY \
1045e84b765SWarner Losh    FORTH \
1055e84b765SWarner Losh    FP_LIBC \
1065e84b765SWarner Losh    FREEBSD_UPDATE \
10711981695SEnji Cooper    FTP \
1085e84b765SWarner Losh    GAMES \
109252884aeSStefan Eßer    GH_BC \
11094ff3d03SEd Maste    GNU_DIFF \
111d679c719SKyle Evans    GOOGLETEST \
1125e84b765SWarner Losh    GPIO \
1134e395054SEnji Cooper    HAST \
1145e84b765SWarner Losh    HTML \
115983a395dSWarner Losh    HYPERV \
1165e84b765SWarner Losh    ICONV \
1175e84b765SWarner Losh    INET \
1185e84b765SWarner Losh    INET6 \
11911981695SEnji Cooper    INETD \
1205e84b765SWarner Losh    IPFILTER \
1215e84b765SWarner Losh    IPFW \
122b29d6977SEnji Cooper    ISCSI \
1235e84b765SWarner Losh    JAIL \
1245e84b765SWarner Losh    KDUMP \
1255e84b765SWarner Losh    KVM \
1265e84b765SWarner Losh    LDNS \
1275e84b765SWarner Losh    LDNS_UTILS \
1285e84b765SWarner Losh    LEGACY_CONSOLE \
12983a08b7cSEd Maste    LLD \
130a04ec978SBrandon Bergren    LLD_BOOTSTRAP \
131a04ec978SBrandon Bergren    LLD_IS_LD \
132147d7b56SKyle Evans    LLVM_ASSERTIONS \
1331b49115aSEd Maste    LLVM_COV \
1349fa94e1cSDimitry Andric    LLVM_CXXFILT \
13554095bf4SKyle Evans    LOADER_GELI \
1361a7ed7feSWarner Losh    LOADER_KBOOT \
1379d45c24cSWarner Losh    LOADER_LUA \
13854095bf4SKyle Evans    LOADER_OFW \
13954095bf4SKyle Evans    LOADER_UBOOT \
1405e84b765SWarner Losh    LOCALES \
1415e84b765SWarner Losh    LOCATE \
1425e84b765SWarner Losh    LPR \
1435e84b765SWarner Losh    LS_COLORS \
14420adba8bSGleb Popov    MACHDEP_OPTIMIZATIONS \
1455e84b765SWarner Losh    MAIL \
1465e84b765SWarner Losh    MAILWRAPPER \
1475e84b765SWarner Losh    MAKE \
148983a395dSWarner Losh    MLX5TOOL \
1495e84b765SWarner Losh    NETCAT \
1505e84b765SWarner Losh    NETGRAPH \
151cb1fc924SBaptiste Daroussin    NETLINK \
1524f6a5e1dSAlexander V. Chernikov    NETLINK_SUPPORT \
1535e84b765SWarner Losh    NLS_CATALOGS \
1545e84b765SWarner Losh    NS_CACHING \
1555e84b765SWarner Losh    NTP \
156983a395dSWarner Losh    NVME \
157be3bff32SKonstantin Belousov    OFED \
1585e84b765SWarner Losh    OPENSSL \
1595e84b765SWarner Losh    PAM \
1605e84b765SWarner Losh    PF \
1615e84b765SWarner Losh    PKGBOOTSTRAP \
1625e84b765SWarner Losh    PMC \
1635e84b765SWarner Losh    PPP \
1645e84b765SWarner Losh    QUOTAS \
16531a741f4SEnji Cooper    RADIUS_SUPPORT \
16611981695SEnji Cooper    RBOOTD \
1675e84b765SWarner Losh    RESCUE \
1685e84b765SWarner Losh    ROUTED \
1695e84b765SWarner Losh    SENDMAIL \
1706f077571SSean Bruno    SERVICESDB \
1715e84b765SWarner Losh    SETUID_LOGIN \
1726ab18ea6SDimitry Andric    SHARED_TOOLCHAIN \
1735e84b765SWarner Losh    SHAREDOCS \
1745e84b765SWarner Losh    SOURCELESS \
1755e84b765SWarner Losh    SOURCELESS_HOST \
1765e84b765SWarner Losh    SOURCELESS_UCODE \
1771a13f2e6SEdward Tomasz Napierala    STATS \
1785e84b765SWarner Losh    SYSCONS \
179bf16c2e9SBryan Drewery    SYSTEM_COMPILER \
180a7d84af8SBryan Drewery    SYSTEM_LINKER \
1813f802165SEnji Cooper    TALK \
18211981695SEnji Cooper    TCP_WRAPPERS \
1835e84b765SWarner Losh    TCSH \
1845e84b765SWarner Losh    TELNET \
1855e84b765SWarner Losh    TEXTPROC \
18611981695SEnji Cooper    TFTP \
1875e84b765SWarner Losh    UNBOUND \
1885e84b765SWarner Losh    USB \
1895e84b765SWarner Losh    UTMPX \
1905e84b765SWarner Losh    VI \
191824a9093SEd Maste    VT \
1925e84b765SWarner Losh    WIRELESS \
1935e84b765SWarner Losh    WPA_SUPPLICANT_EAPOL \
1945e84b765SWarner Losh    ZFS \
195fbeb31a2SMatt Macy    LOADER_ZFS \
1965e84b765SWarner Losh    ZONEINFO
1975e84b765SWarner Losh
1985e84b765SWarner Losh__DEFAULT_NO_OPTIONS = \
199a92958dfSSimon J. Gerraty    BEARSSL \
200483d953aSJohn Baldwin    BHYVE_SNAPSHOT \
2015e84b765SWarner Losh    CLANG_EXTRAS \
2020a9ab9f5SConrad Meyer    CLANG_FORMAT \
203ddedf2a1SEdward Tomasz Napierala    DETECT_TZ_CHANGES \
2049e914c7aSJessica Clarke    DISK_IMAGE_TOOLS_BOOTSTRAP \
205d912066cSMark Johnston    DTRACE_TESTS \
20643f75d57SBjoern A. Zeeb    EXPERIMENTAL \
2075e84b765SWarner Losh    HESIOD \
208f871c5d9SWarner Losh    LOADER_VERBOSE \
209b0fefb25SMarcin Wojtas    LOADER_VERIEXEC_PASS_MANIFEST \
210021385abSAlex Richardson    LLVM_BINUTILS \
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
219*b908f6c4SColin Percival__REQUIRED_OPTIONS = \
220*b908f6c4SColin Percival
221100fafebSBryan Drewery# LEFT/RIGHT. Left options which default to "yes" unless their corresponding
222100fafebSBryan Drewery# RIGHT option is disabled.
223100fafebSBryan Drewery__DEFAULT_DEPENDENT_OPTIONS= \
224100fafebSBryan Drewery	CLANG_FULL/CLANG \
225e7e22476SAlex Richardson	LLVM_TARGET_ALL/CLANG \
226a92958dfSSimon J. Gerraty	LOADER_VERIEXEC/BEARSSL \
22713ea0450SMarcin Wojtas	LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \
228afc571b1SSimon J. Gerraty	LOADER_VERIEXEC_VECTX/LOADER_VERIEXEC \
229a92958dfSSimon J. Gerraty	VERIEXEC/BEARSSL \
230100fafebSBryan Drewery
231100fafebSBryan Drewery# MK_*_SUPPORT options which default to "yes" unless their corresponding
232100fafebSBryan Drewery# MK_* variable is set to "no".
233100fafebSBryan Drewery#
234100fafebSBryan Drewery.for var in \
235100fafebSBryan Drewery    BLACKLIST \
236100fafebSBryan Drewery    BZIP2 \
237100fafebSBryan Drewery    INET \
238100fafebSBryan Drewery    INET6 \
239100fafebSBryan Drewery    KERBEROS \
240100fafebSBryan Drewery    KVM \
241100fafebSBryan Drewery    NETGRAPH \
242100fafebSBryan Drewery    PAM \
243100fafebSBryan Drewery    TESTS \
244100fafebSBryan Drewery    WIRELESS
245100fafebSBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+= ${var}_SUPPORT/${var}
246100fafebSBryan Drewery.endfor
2475e84b765SWarner Losh
2485e84b765SWarner Losh#
2495e84b765SWarner Losh# Default behaviour of some options depends on the architecture.  Unfortunately
2505e84b765SWarner Losh# this means that we have to test TARGET_ARCH (the buildworld case) as well
2515e84b765SWarner Losh# as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
2525e84b765SWarner Losh# used at all in bsd.*.mk, but we have to make an exception here if we want
2535e84b765SWarner Losh# to allow defaults for some things like clang to vary by target architecture.
2545e84b765SWarner Losh# Additional, per-target behavior should be rarely added only after much
2555e84b765SWarner Losh# gnashing of teeth and grinding of gears.
2565e84b765SWarner Losh#
2575e84b765SWarner Losh.if defined(TARGET_ARCH)
2585e84b765SWarner Losh__T=${TARGET_ARCH}
2595e84b765SWarner Losh.else
2605e84b765SWarner Losh__T=${MACHINE_ARCH}
2615e84b765SWarner Losh.endif
2620104753bSDimitry Andric
263631e709fSBryan Drewery# All supported backends for LLVM_TARGET_XXX
264631e709fSBryan Drewery__LLVM_TARGETS= \
265631e709fSBryan Drewery		aarch64 \
266631e709fSBryan Drewery		arm \
267631e709fSBryan Drewery		powerpc \
268de9950e8SJohn Baldwin		riscv \
269631e709fSBryan Drewery		x86
270eeedaefaSJohn Baldwin__LLVM_TARGET_FILT=	C/(amd64|i386)/x86/:C/powerpc.*/powerpc/:C/armv[67]/arm/:C/riscv.*/riscv/
2714e2a4490SBryan Drewery.for __llt in ${__LLVM_TARGETS}
27296aaefdfSBryan Drewery# Default enable the given TARGET's LLVM_TARGET support
273980bae69SWarner Losh.if ${__T:${__LLVM_TARGET_FILT}} == ${__llt}
27496aaefdfSBryan Drewery__DEFAULT_YES_OPTIONS+=	LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}
2754e2a4490SBryan Drewery# aarch64 needs arm for -m32 support.
276980bae69SWarner Losh.elif ${__T} == "aarch64" && ${__llt:Marm*} != ""
2774e2a4490SBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+=	LLVM_TARGET_ARM/LLVM_TARGET_AARCH64
27896aaefdfSBryan Drewery# Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL.
279631e709fSBryan Drewery.else
2804e2a4490SBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+=	LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL
281631e709fSBryan Drewery.endif
282631e709fSBryan Drewery.endfor
283631e709fSBryan Drewery
2844dbc7835SWarner Losh__DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF LLVM_TARGET_MIPS
28589edb881SDimitry Andric
2860104753bSDimitry Andric.include <bsd.compiler.mk>
2878758abd5SBryan Drewery
2887661a2abSEd Maste.if ${__T} == "i386" || ${__T} == "amd64"
2897661a2abSEd Maste__DEFAULT_NO_OPTIONS += FDT
2907661a2abSEd Maste.else
2917661a2abSEd Maste__DEFAULT_YES_OPTIONS += FDT
2927661a2abSEd Maste.endif
2937661a2abSEd Maste
2948dc42f98SEd Maste.if ${__T:Marm*} == "" && ${__T:Mriscv64*} == ""
295dfccd92cSEd Maste__DEFAULT_YES_OPTIONS+=LLDB
296d0ba16f7SEd Maste.else
297dfccd92cSEd Maste__DEFAULT_NO_OPTIONS+=LLDB
298d0ba16f7SEd Maste.endif
29969ee64c1SWarner Losh# LIB32 is supported on amd64 and powerpc64
30069ee64c1SWarner Losh.if (${__T} == "amd64" || ${__T} == "powerpc64")
301a4330302SBrooks Davis__DEFAULT_YES_OPTIONS+=LIB32
302a4330302SBrooks Davis.else
303a4330302SBrooks DavisBROKEN_OPTIONS+=LIB32
304a4330302SBrooks Davis.endif
305ad9d10a8SWarner Losh# EFI doesn't exist on powerpc (well, officially) and doesn't work on i386
306ad9d10a8SWarner Losh.if ${__T:Mpowerpc*} || ${__T} == "i386"
307f86dd996SWarner LoshBROKEN_OPTIONS+=EFI
308d49a5dddSWarner Losh.endif
30947e9f42eSWarner Losh# OFW is only for powerpc, exclude others
31047e9f42eSWarner Losh.if ${__T:Mpowerpc*} == ""
311f86dd996SWarner LoshBROKEN_OPTIONS+=LOADER_OFW
312f86dd996SWarner Losh.endif
31346010641SWarner Losh# KBOOT is only for powerpc64 (powerpc64le broken) amd64 and aarch64
31446010641SWarner Losh.if ${__T} != "powerpc64" && ${__T} != "amd64" && ${__T} != "aarch64"
3151a7ed7feSWarner LoshBROKEN_OPTIONS+=LOADER_KBOOT
3161a7ed7feSWarner Losh.endif
3179dc70af8SWarner Losh# UBOOT is only for arm, and big-endian powerpc
3189dc70af8SWarner Losh.if (${__T:Marm*} == "" && ${__T:Mpowerpc*} == "") || ${__T} == "powerpc64le"
319f86dd996SWarner LoshBROKEN_OPTIONS+=LOADER_UBOOT
320f86dd996SWarner Losh.endif
32147e9f42eSWarner Losh# GELI and Lua in loader currently cause boot failures on powerpc.
32249f1151fSNathan Whitehorn# Further debugging is required -- probably they are just broken on big
32349f1151fSNathan Whitehorn# endian systems generically (they jump to null pointers or try to read
32449f1151fSNathan Whitehorn# crazy high addresses, which is typical of endianness problems).
32547e9f42eSWarner Losh.if ${__T:Mpowerpc*}
326f54d801aSKurt LidlBROKEN_OPTIONS+=LOADER_GELI LOADER_LUA
327f54d801aSKurt Lidl.endif
328f86dd996SWarner Losh
329e552cac3SPiotr Kubaj# Kernel TLS is enabled by default on amd64, aarch64 and powerpc64*
330e552cac3SPiotr Kubaj.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T:Mpowerpc64*} != ""
331aa906e2aSJohn Baldwin__DEFAULT_YES_OPTIONS+=OPENSSL_KTLS
332aa906e2aSJohn Baldwin.else
333aa906e2aSJohn Baldwin__DEFAULT_NO_OPTIONS+=OPENSSL_KTLS
334aa906e2aSJohn Baldwin.endif
335aa906e2aSJohn Baldwin
336983a395dSWarner Losh.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
337d68224c2SPiotr Kubaj    ${__T:Mpowerpc64*} == ""
338983a395dSWarner LoshBROKEN_OPTIONS+=CXGBETOOL
339983a395dSWarner LoshBROKEN_OPTIONS+=MLX5TOOL
34054912308SNavdeep Parhar.endif
34154912308SNavdeep Parhar
3429729f076SSouradeep Chakrabarti.if ${__T} != "amd64" && ${__T} != "i386" && ${__T} != "aarch64"
343983a395dSWarner LoshBROKEN_OPTIONS+=HYPERV
3445b87c94aSBrooks Davis.endif
3455b87c94aSBrooks Davis
346b75abea4SBrandon Bergren# NVME is only aarch64, x86 and powerpc64*
3476b3555c3SDimitry Andric.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
348b75abea4SBrandon Bergren    ${__T:Mpowerpc64*} == ""
349983a395dSWarner LoshBROKEN_OPTIONS+=NVME
350f0f8a1afSWarner Losh.endif
351f0f8a1afSWarner Losh
3522a5220e1SDimitry Andric.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \
353aa033e0bSPiotr Kubaj    ${__T:Mpowerpc64*} != "" || ${__T:Mriscv64*} != ""
354b0840a28SDimitry Andric__DEFAULT_YES_OPTIONS+=OPENMP
355b0840a28SDimitry Andric.else
356b0840a28SDimitry Andric__DEFAULT_NO_OPTIONS+=OPENMP
357b0840a28SDimitry Andric.endif
358b0840a28SDimitry Andric
35941cf798eSWarner Losh# Broken on 32-bit arm, kernel module compile errors
360fe0f6950SJohn Baldwin.if ${__T:Marm*} != ""
3617661a2abSEd MasteBROKEN_OPTIONS+= OFED
3627661a2abSEd Maste.endif
3637661a2abSEd Maste
364976ba7f0SSimon J. Gerraty# MK_host_egacy is set by local.sys.mk so is valid here
365976ba7f0SSimon J. Gerraty.if ${MACHINE} == "host" && ${MK_host_egacy} == "yes"
366976ba7f0SSimon J. Gerraty# we cannot expect tests to work
367976ba7f0SSimon J. GerratyBROKEN_OPTIONS+= TESTS
368976ba7f0SSimon J. Gerraty.endif
369976ba7f0SSimon J. Gerraty
370c4c981c1SSimon J. Gerraty.-include <site.src.opts.mk>
371c4c981c1SSimon J. Gerraty
3725e84b765SWarner Losh.include <bsd.mkopt.mk>
3735e84b765SWarner Losh
3745e84b765SWarner Losh#
3755e84b765SWarner Losh# Force some options off if their dependencies are off.
3765e84b765SWarner Losh# Order is somewhat important.
3775e84b765SWarner Losh#
37858551dc6SBaptiste Daroussin.if ${MK_CAPSICUM} == "no"
37958551dc6SBaptiste DaroussinMK_CASPER:=	no
38058551dc6SBaptiste Daroussin.endif
38158551dc6SBaptiste Daroussin
3825e84b765SWarner Losh.if ${MK_SOURCELESS} == "no"
3835e84b765SWarner LoshMK_SOURCELESS_HOST:=	no
3845e84b765SWarner LoshMK_SOURCELESS_UCODE:= no
3855e84b765SWarner Losh.endif
3865e84b765SWarner Losh
3875e84b765SWarner Losh.if ${MK_CDDL} == "no"
3885e84b765SWarner LoshMK_CTF:=	no
3893bf66365SBrooks DavisMK_DTRACE:=	no
3903bf66365SBrooks DavisMK_LOADER_ZFS:=	no
3913bf66365SBrooks DavisMK_ZFS:=	no
3925e84b765SWarner Losh.endif
3935e84b765SWarner Losh
3945e84b765SWarner Losh.if ${MK_CRYPT} == "no"
3955e84b765SWarner LoshMK_OPENSSL:=	no
3965e84b765SWarner LoshMK_OPENSSH:=	no
3975e84b765SWarner LoshMK_KERBEROS:=	no
3980ce9d0afSEd MasteMK_KERBEROS_SUPPORT:=	no
3995e84b765SWarner Losh.endif
4005e84b765SWarner Losh
401f987297fSEd Maste.if ${MK_DIALOG} == "no"
402f987297fSEd MasteMK_BSDINSTALL:=	no
403f987297fSEd Maste.endif
404f987297fSEd Maste
4053bf66365SBrooks Davis.if ${MK_DTRACE} == "no"
4063bf66365SBrooks DavisMK_CTF:=	no
4073bf66365SBrooks Davis.endif
4083bf66365SBrooks Davis
4095e84b765SWarner Losh.if ${MK_MAIL} == "no"
4105e84b765SWarner LoshMK_MAILWRAPPER:= no
4115e84b765SWarner LoshMK_SENDMAIL:=	no
4125e84b765SWarner LoshMK_DMAGENT:=	no
4135e84b765SWarner Losh.endif
4145e84b765SWarner Losh
4155e84b765SWarner Losh.if ${MK_NETGRAPH} == "no"
4165e84b765SWarner LoshMK_BLUETOOTH:=	no
4175e84b765SWarner Losh.endif
4185e84b765SWarner Losh
419edb58145SEnji Cooper.if ${MK_NLS} == "no"
420edb58145SEnji CooperMK_NLS_CATALOGS:= no
421edb58145SEnji Cooper.endif
422edb58145SEnji Cooper
4235e84b765SWarner Losh.if ${MK_OPENSSL} == "no"
424df502accSEd MasteMK_DMAGENT:=	no
4255e84b765SWarner LoshMK_OPENSSH:=	no
4266940d0e4SEd MasteMK_OPENSSL_KTLS:=	no
4275e84b765SWarner LoshMK_KERBEROS:=	no
4280ce9d0afSEd MasteMK_KERBEROS_SUPPORT:=	no
42937516d3bSEd MasteMK_LDNS:=	no
4305ffef74bSEd MasteMK_PKGBOOTSTRAP:=	no
4319503d270SWarner LoshMK_LOADER_ZFS:=	no
432e5cc1c47SMitchell HorneMK_ZFS:=	no
43337516d3bSEd Maste.endif
43437516d3bSEd Maste
43537516d3bSEd Maste.if ${MK_LDNS} == "no"
43637516d3bSEd MasteMK_LDNS_UTILS:=	no
43737516d3bSEd MasteMK_UNBOUND:= no
4385e84b765SWarner Losh.endif
4395e84b765SWarner Losh
4405e84b765SWarner Losh.if ${MK_PF} == "no"
4415e84b765SWarner LoshMK_AUTHPF:=	no
4425e84b765SWarner Losh.endif
4435e84b765SWarner Losh
444abbe7d5aSKonstantin Belousov.if ${MK_OFED} == "no"
445abbe7d5aSKonstantin BelousovMK_OFED_EXTRA:=	no
446abbe7d5aSKonstantin Belousov.endif
447abbe7d5aSKonstantin Belousov
448d912066cSMark Johnston.if ${MK_TESTS} == "no"
449d912066cSMark JohnstonMK_DTRACE_TESTS:= no
45006beea0eSEnji Cooper.endif
45106beea0eSEnji Cooper
45206beea0eSEnji Cooper.if ${MK_TESTS_SUPPORT} == "no"
45343e25f47SEnji CooperMK_GOOGLETEST:=	no
454d912066cSMark Johnston.endif
455d912066cSMark Johnston
456c5cba060SEnji Cooper.if ${MK_ZONEINFO} == "no"
457c5cba060SEnji CooperMK_ZONEINFO_LEAPSECONDS_SUPPORT:= no
458c5cba060SEnji Cooper.endif
459c5cba060SEnji Cooper
4605e84b765SWarner Losh.if ${MK_CROSS_COMPILER} == "no"
4615e84b765SWarner LoshMK_CLANG_BOOTSTRAP:= no
46208474898SEd MasteMK_ELFTOOLCHAIN_BOOTSTRAP:= no
46389257265SEd MasteMK_LLD_BOOTSTRAP:= no
4645e84b765SWarner Losh.endif
4655e84b765SWarner Losh
4665e84b765SWarner Losh.if ${MK_TOOLCHAIN} == "no"
4675e84b765SWarner LoshMK_CLANG:=	no
468e5928414SEd MasteMK_LLD:=	no
46911e49977SBryan DreweryMK_LLDB:=	no
470021385abSAlex RichardsonMK_LLVM_BINUTILS:=	no
4715e84b765SWarner Losh.endif
4725e84b765SWarner Losh
4735e84b765SWarner Losh.if ${MK_CLANG} == "no"
4745e84b765SWarner LoshMK_CLANG_EXTRAS:= no
4750a9ab9f5SConrad MeyerMK_CLANG_FORMAT:= no
4765e84b765SWarner LoshMK_CLANG_FULL:= no
4771b49115aSEd MasteMK_LLVM_COV:= no
4785e84b765SWarner Losh.endif
4795e84b765SWarner Losh
48024f58618SAlex Richardson.if ${MK_ASAN} == "yes"
48124f58618SAlex Richardson# In order to get sensible backtraces from ASAN we have to install
48224f58618SAlex Richardson# llvm-symbolizer as /usr/bin/addr2line instead of the elftoolchain version.
48324f58618SAlex RichardsonMK_LLVM_BINUTILS:=	yes
48424f58618SAlex Richardson.endif
48524f58618SAlex Richardson
486021385abSAlex Richardson.if ${MK_LLVM_BINUTILS} == "yes"
487021385abSAlex Richardson# MK_LLVM_CXXFILT is a subset of MK_LLVM_BINUTILS and should therefore be
488021385abSAlex Richardson# enabled if MK_LLVM_BINUTILS is set.
489021385abSAlex RichardsonMK_LLVM_CXXFILT:=	yes
490021385abSAlex Richardson.endif
491021385abSAlex Richardson
492b0fefb25SMarcin Wojtas.if ${MK_LOADER_VERIEXEC} == "no"
493b0fefb25SMarcin WojtasMK_LOADER_VERIEXEC_PASS_MANIFEST := no
494b0fefb25SMarcin Wojtas.endif
495b0fefb25SMarcin Wojtas
4965e84b765SWarner Losh#
4974301886dSEnji Cooper# MK_* options whose default value depends on another option.
4984301886dSEnji Cooper#
4994301886dSEnji Cooper.for vv in \
5004301886dSEnji Cooper    GSSAPI/KERBEROS \
5014301886dSEnji Cooper    MAN_UTILS/MAN
5024301886dSEnji Cooper.if defined(WITH_${vv:H})
5034301886dSEnji CooperMK_${vv:H}:=	yes
5044301886dSEnji Cooper.elif defined(WITHOUT_${vv:H})
5054301886dSEnji CooperMK_${vv:H}:=	no
5064301886dSEnji Cooper.else
5074301886dSEnji CooperMK_${vv:H}:=	${MK_${vv:T}}
5084301886dSEnji Cooper.endif
5094301886dSEnji Cooper.endfor
5104301886dSEnji Cooper
5114301886dSEnji Cooper#
5125e84b765SWarner Losh# Set defaults for the MK_*_SUPPORT variables.
5135e84b765SWarner Losh#
5145e84b765SWarner Losh
515ff2cf368SBaptiste Daroussin.endif #  !target(__<src.opts.mk>__)
516