xref: /freebsd/share/mk/src.opts.mk (revision 83a08b7c09d6987920ab7663a57ffc0f61cea70b)
15e84b765SWarner Losh# $FreeBSD$
25e84b765SWarner Losh#
35e84b765SWarner Losh# Option file for FreeBSD /usr/src builds.
45e84b765SWarner Losh#
55e84b765SWarner Losh# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf
65e84b765SWarner Losh# and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no}
75e84b765SWarner Losh# with sensible (usually) defaults.
85e84b765SWarner Losh#
95e84b765SWarner Losh# Makefiles must include bsd.opts.mk after defining specific MK_FOO options that
105e84b765SWarner Losh# are applicable for that Makefile (typically there are none, but sometimes there
115e84b765SWarner Losh# are exceptions). Recursive makes usually add MK_FOO=no for options that they wish
125e84b765SWarner Losh# to omit from that make.
135e84b765SWarner Losh#
141fc86460SWarner Losh# Makefiles must include bsd.mkopt.mk before they test the value of any MK_FOO
155e84b765SWarner Losh# variable.
165e84b765SWarner Losh#
17c6063d0dSWarner Losh# Makefiles may also assume that this file is included by src.opts.mk should it
185e84b765SWarner Losh# need variables defined there prior to the end of the Makefile where
195e84b765SWarner Losh# bsd.{subdir,lib.bin}.mk is traditionally included.
205e84b765SWarner Losh#
215e84b765SWarner Losh# The old-style YES_FOO and NO_FOO are being phased out. No new instances of them
225e84b765SWarner Losh# should be added. Old instances should be removed since they were just to
235e84b765SWarner Losh# bridge the gap between FreeBSD 4 and FreeBSD 5.
245e84b765SWarner Losh#
255e84b765SWarner Losh# Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an
265e84b765SWarner Losh# exception is made for _WITHOUT_SRCONF which turns off this mechanism
2722cac754SWarner Losh# completely inside bsd.*.mk files).
285e84b765SWarner Losh#
295e84b765SWarner Losh
305e84b765SWarner Losh.if !target(__<src.opts.mk>__)
315e84b765SWarner Losh__<src.opts.mk>__:
325e84b765SWarner Losh
33f9798cc7SWarner Losh.include <bsd.own.mk>
34f9798cc7SWarner Losh
355e84b765SWarner Losh#
365e84b765SWarner Losh# Define MK_* variables (which are either "yes" or "no") for users
375e84b765SWarner Losh# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
385e84b765SWarner Losh# make(1) environment.
395e84b765SWarner Losh# These should be tested with `== "no"' or `!= "no"' in makefiles.
405e84b765SWarner Losh# The NO_* variables should only be set by makefiles for variables
415e84b765SWarner Losh# that haven't been converted over.
425e84b765SWarner Losh#
435e84b765SWarner Losh
44c1593b9eSWarner Losh# These options are used by the src builds. Those listed in
45c1593b9eSWarner Losh# __DEFAULT_YES_OPTIONS default to 'yes' and will build unless turned
46c1593b9eSWarner Losh# off.  __DEFAULT_NO_OPTIONS will default to 'no' and won't build
47c1593b9eSWarner Losh# unless turned on. Any options listed in 'BROKEN_OPTIONS' will be
48c1593b9eSWarner Losh# hard-wired to 'no'.  "Broken" here means not working or
49c1593b9eSWarner Losh# not-appropriate and/or not supported. It doesn't imply something is
50c1593b9eSWarner Losh# wrong with the code. There's not a single good word for this, so
51c1593b9eSWarner Losh# BROKEN was selected as the least imperfect one considered at the
52c1593b9eSWarner Losh# time. Options are added to BROKEN_OPTIONS list on a per-arch basis.
53c1593b9eSWarner Losh# At this time, there's no provision for mutually incompatible options.
545e84b765SWarner Losh
555e84b765SWarner Losh__DEFAULT_YES_OPTIONS = \
565e84b765SWarner Losh    ACCT \
575e84b765SWarner Losh    ACPI \
585e84b765SWarner Losh    APM \
595e84b765SWarner Losh    AT \
605e84b765SWarner Losh    ATM \
615e84b765SWarner Losh    AUDIT \
625e84b765SWarner Losh    AUTHPF \
63b3590423SEnji Cooper    AUTOFS \
6402629e46SEnji Cooper    BHYVE \
655e84b765SWarner Losh    BINUTILS \
6695856e14SKurt Lidl    BLACKLIST \
675e84b765SWarner Losh    BLUETOOTH \
685e84b765SWarner Losh    BOOT \
6911981695SEnji Cooper    BOOTPARAMD \
7011981695SEnji Cooper    BOOTPD \
715e84b765SWarner Losh    BSD_CPIO \
72e45b569cSEnji Cooper    BSDINSTALL \
735e84b765SWarner Losh    BSNMP \
745e84b765SWarner Losh    BZIP2 \
755e84b765SWarner Losh    CALENDAR \
765e84b765SWarner Losh    CAPSICUM \
77f27f39dbSKyle Evans    CAROOT \
785e84b765SWarner Losh    CASPER \
7918cc3172SEnji Cooper    CCD \
805e84b765SWarner Losh    CDDL \
81*83a08b7cSEd Maste    CLANG \
825e84b765SWarner Losh    CPP \
835e84b765SWarner Losh    CROSS_COMPILER \
845e84b765SWarner Losh    CRYPT \
8536716419SHans Petter Selasky    CUSE \
865e84b765SWarner Losh    CXX \
87983a395dSWarner Losh    CXGBETOOL \
88f987297fSEd Maste    DIALOG \
895e84b765SWarner Losh    DICT \
905e84b765SWarner Losh    DMAGENT \
915e84b765SWarner Losh    DYNAMICROOT \
9279a86dafSEnji Cooper    EE \
93d49a5dddSWarner Losh    EFI \
9408474898SEd Maste    ELFTOOLCHAIN_BOOTSTRAP \
955e84b765SWarner Losh    EXAMPLES \
965e84b765SWarner Losh    FDT \
97c7b6816fSEnji Cooper    FILE \
9811981695SEnji Cooper    FINGER \
995e84b765SWarner Losh    FLOPPY \
1005e84b765SWarner Losh    FMTREE \
1015e84b765SWarner Losh    FORTH \
1025e84b765SWarner Losh    FP_LIBC \
1035e84b765SWarner Losh    FREEBSD_UPDATE \
10411981695SEnji Cooper    FTP \
1055e84b765SWarner Losh    GAMES \
10673ad3fb5SJohn Baldwin    GDB \
10747e9f42eSWarner Losh    GDB_LIBEXEC \
10894ff3d03SEd Maste    GNU_DIFF \
10994ff3d03SEd Maste    GNU_GREP \
110d679c719SKyle Evans    GOOGLETEST \
1115e84b765SWarner Losh    GPIO \
1124e395054SEnji Cooper    HAST \
1135e84b765SWarner Losh    HTML \
114983a395dSWarner Losh    HYPERV \
1155e84b765SWarner Losh    ICONV \
1165e84b765SWarner Losh    INET \
1175e84b765SWarner Losh    INET6 \
11811981695SEnji Cooper    INETD \
1195e84b765SWarner Losh    IPFILTER \
1205e84b765SWarner Losh    IPFW \
121b29d6977SEnji Cooper    ISCSI \
1225e84b765SWarner Losh    JAIL \
1235e84b765SWarner Losh    KDUMP \
1245e84b765SWarner Losh    KVM \
1255e84b765SWarner Losh    LDNS \
1265e84b765SWarner Losh    LDNS_UTILS \
1275e84b765SWarner Losh    LEGACY_CONSOLE \
1285e84b765SWarner Losh    LIBPTHREAD \
1295e84b765SWarner Losh    LIBTHR \
130*83a08b7cSEd Maste    LLD \
1311b49115aSEd Maste    LLVM_COV \
13296aaefdfSBryan Drewery    LLVM_TARGET_ALL \
13354095bf4SKyle Evans    LOADER_GELI \
1349d45c24cSWarner Losh    LOADER_LUA \
13554095bf4SKyle Evans    LOADER_OFW \
13654095bf4SKyle Evans    LOADER_UBOOT \
1375e84b765SWarner Losh    LOCALES \
1385e84b765SWarner Losh    LOCATE \
1395e84b765SWarner Losh    LPR \
1405e84b765SWarner Losh    LS_COLORS \
1415e84b765SWarner Losh    LZMA_SUPPORT \
1425e84b765SWarner Losh    MAIL \
1435e84b765SWarner Losh    MAILWRAPPER \
1445e84b765SWarner Losh    MAKE \
145983a395dSWarner Losh    MLX5TOOL \
1465e84b765SWarner Losh    NDIS \
1475e84b765SWarner Losh    NETCAT \
1485e84b765SWarner Losh    NETGRAPH \
1495e84b765SWarner Losh    NLS_CATALOGS \
1505e84b765SWarner Losh    NS_CACHING \
1515e84b765SWarner Losh    NTP \
152983a395dSWarner Losh    NVME \
153be3bff32SKonstantin Belousov    OFED \
1545e84b765SWarner Losh    OPENSSL \
1555e84b765SWarner Losh    PAM \
1565e84b765SWarner Losh    PF \
1575e84b765SWarner Losh    PKGBOOTSTRAP \
1585e84b765SWarner Losh    PMC \
1595e84b765SWarner Losh    PORTSNAP \
1605e84b765SWarner Losh    PPP \
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 \
1696ab18ea6SDimitry Andric    SHARED_TOOLCHAIN \
1705e84b765SWarner Losh    SHAREDOCS \
1715e84b765SWarner Losh    SOURCELESS \
1725e84b765SWarner Losh    SOURCELESS_HOST \
1735e84b765SWarner Losh    SOURCELESS_UCODE \
1741a13f2e6SEdward Tomasz Napierala    STATS \
1755e84b765SWarner Losh    SVNLITE \
1765e84b765SWarner Losh    SYSCONS \
177bf16c2e9SBryan Drewery    SYSTEM_COMPILER \
178a7d84af8SBryan Drewery    SYSTEM_LINKER \
1793f802165SEnji Cooper    TALK \
18011981695SEnji Cooper    TCP_WRAPPERS \
1815e84b765SWarner Losh    TCSH \
1825e84b765SWarner Losh    TELNET \
1835e84b765SWarner Losh    TEXTPROC \
18411981695SEnji Cooper    TFTP \
1855e84b765SWarner Losh    UNBOUND \
1865e84b765SWarner Losh    USB \
1875e84b765SWarner Losh    UTMPX \
1885e84b765SWarner Losh    VI \
189824a9093SEd Maste    VT \
1905e84b765SWarner Losh    WIRELESS \
1915e84b765SWarner Losh    WPA_SUPPLICANT_EAPOL \
1925e84b765SWarner Losh    ZFS \
193fbeb31a2SMatt Macy    LOADER_ZFS \
1945e84b765SWarner Losh    ZONEINFO
1955e84b765SWarner Losh
1965e84b765SWarner Losh__DEFAULT_NO_OPTIONS = \
1975882cf71SEd Maste    AMD \
198a92958dfSSimon J. Gerraty    BEARSSL \
1995e84b765SWarner Losh    BSD_GREP \
2005e84b765SWarner Losh    CLANG_EXTRAS \
201d912066cSMark Johnston    DTRACE_TESTS \
20243f75d57SBjoern A. Zeeb    EXPERIMENTAL \
203e9e768f7SEd Maste    GNU_GREP_COMPAT \
204cb9da00eSEd Maste    GPL_DTC \
2055e84b765SWarner Losh    HESIOD \
206c42ade60SWarner Losh    LIBSOFT \
207a179cd91SWarner Losh    LOADER_FIREWIRE \
20876541eb0SWojciech Macek    LOADER_FORCE_LE \
209f871c5d9SWarner Losh    LOADER_VERBOSE \
210b0fefb25SMarcin Wojtas    LOADER_VERIEXEC_PASS_MANIFEST \
211abbe7d5aSKonstantin Belousov    OFED_EXTRA \
2125e84b765SWarner Losh    OPENLDAP \
213a58383d2SJohn Baldwin    REPRODUCIBLE_BUILD \
214609b7b26SEnji Cooper    RPCBIND_WARMSTART_SUPPORT \
2155e84b765SWarner Losh    SORT_THREADS \
2166120aabdSBryan Drewery    SVN \
217c5cba060SEnji Cooper    ZONEINFO_LEAPSECONDS_SUPPORT \
218c5cba060SEnji Cooper    ZONEINFO_OLD_TIMEZONES_SUPPORT \
2196120aabdSBryan Drewery
220100fafebSBryan Drewery# LEFT/RIGHT. Left options which default to "yes" unless their corresponding
221100fafebSBryan Drewery# RIGHT option is disabled.
222100fafebSBryan Drewery__DEFAULT_DEPENDENT_OPTIONS= \
223100fafebSBryan Drewery	CLANG_FULL/CLANG \
224a92958dfSSimon J. Gerraty	LOADER_VERIEXEC/BEARSSL \
22513ea0450SMarcin Wojtas	LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \
226a92958dfSSimon J. Gerraty	VERIEXEC/BEARSSL \
227100fafebSBryan Drewery
228100fafebSBryan Drewery# MK_*_SUPPORT options which default to "yes" unless their corresponding
229100fafebSBryan Drewery# MK_* variable is set to "no".
230100fafebSBryan Drewery#
231100fafebSBryan Drewery.for var in \
232100fafebSBryan Drewery    BLACKLIST \
233100fafebSBryan Drewery    BZIP2 \
234100fafebSBryan Drewery    INET \
235100fafebSBryan Drewery    INET6 \
236100fafebSBryan Drewery    KERBEROS \
237100fafebSBryan Drewery    KVM \
238100fafebSBryan Drewery    NETGRAPH \
239100fafebSBryan Drewery    PAM \
240100fafebSBryan Drewery    TESTS \
241100fafebSBryan Drewery    WIRELESS
242100fafebSBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+= ${var}_SUPPORT/${var}
243100fafebSBryan Drewery.endfor
2445e84b765SWarner Losh
2455e84b765SWarner Losh#
2465e84b765SWarner Losh# Default behaviour of some options depends on the architecture.  Unfortunately
2475e84b765SWarner Losh# this means that we have to test TARGET_ARCH (the buildworld case) as well
2485e84b765SWarner Losh# as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
2495e84b765SWarner Losh# used at all in bsd.*.mk, but we have to make an exception here if we want
2505e84b765SWarner Losh# to allow defaults for some things like clang to vary by target architecture.
2515e84b765SWarner Losh# Additional, per-target behavior should be rarely added only after much
2525e84b765SWarner Losh# gnashing of teeth and grinding of gears.
2535e84b765SWarner Losh#
2545e84b765SWarner Losh.if defined(TARGET_ARCH)
2555e84b765SWarner Losh__T=${TARGET_ARCH}
2565e84b765SWarner Losh.else
2575e84b765SWarner Losh__T=${MACHINE_ARCH}
2585e84b765SWarner Losh.endif
2595e84b765SWarner Losh.if defined(TARGET)
2605e84b765SWarner Losh__TT=${TARGET}
2615e84b765SWarner Losh.else
2625e84b765SWarner Losh__TT=${MACHINE}
2635e84b765SWarner Losh.endif
2640104753bSDimitry Andric
265631e709fSBryan Drewery# All supported backends for LLVM_TARGET_XXX
266631e709fSBryan Drewery__LLVM_TARGETS= \
267631e709fSBryan Drewery		aarch64 \
268631e709fSBryan Drewery		arm \
269631e709fSBryan Drewery		mips \
270631e709fSBryan Drewery		powerpc \
271de9950e8SJohn Baldwin		riscv \
272631e709fSBryan Drewery		x86
27347e9f42eSWarner Losh__LLVM_TARGET_FILT=	C/(amd64|i386)/x86/:S/arm64/aarch64/:S/powerpc64/powerpc/
2744e2a4490SBryan Drewery.for __llt in ${__LLVM_TARGETS}
27596aaefdfSBryan Drewery# Default enable the given TARGET's LLVM_TARGET support
2764e2a4490SBryan Drewery.if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt}
27796aaefdfSBryan Drewery__DEFAULT_YES_OPTIONS+=	LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}
2784e2a4490SBryan Drewery# aarch64 needs arm for -m32 support.
2794e2a4490SBryan Drewery.elif ${__TT} == "arm64" && ${__llt} == "arm"
2804e2a4490SBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+=	LLVM_TARGET_ARM/LLVM_TARGET_AARCH64
28196aaefdfSBryan Drewery# Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL.
282631e709fSBryan Drewery.else
2834e2a4490SBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+=	LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL
284631e709fSBryan Drewery.endif
285631e709fSBryan Drewery.endfor
28647e9f42eSWarner Losh# until we can unwind clang + sparc
28747e9f42eSWarner LoshMK_LLVM_TARGET_SPARC:=no
288631e709fSBryan Drewery
28989edb881SDimitry Andric__DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF
29089edb881SDimitry Andric
2910104753bSDimitry Andric.include <bsd.compiler.mk>
2928758abd5SBryan Drewery
293*83a08b7cSEd Maste.if ${__TT} != "mips"
294*83a08b7cSEd Maste# Clang is installed as the default /usr/bin/cc.
295*83a08b7cSEd Maste__DEFAULT_YES_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC
2960104753bSDimitry Andric.else
297*83a08b7cSEd Maste# Clang is enabled but we still require an external toolchain.
298*83a08b7cSEd Maste__DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC
2995e84b765SWarner Losh.endif
3001cee64a8SEd Maste# In-tree binutils/gcc are older versions without modern architecture support.
3017804dd52SRuslan Bukin.if ${__T} == "aarch64" || ${__T:Mriscv*} != ""
30257f80467SEd MasteBROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GDB
3038daa8167SAndrew Turner.endif
3049d0e1b8aSEd Maste.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
3059d0e1b8aSEd Maste__DEFAULT_YES_OPTIONS+=BINUTILS_BOOTSTRAP
3069d0e1b8aSEd Maste.else
3079d0e1b8aSEd Maste__DEFAULT_NO_OPTIONS+=BINUTILS_BOOTSTRAP
3089d0e1b8aSEd Maste.endif
3097ddf05edSRuslan Bukin.if ${__T:Mriscv*} != ""
3107ddf05edSRuslan BukinBROKEN_OPTIONS+=OFED
3117ddf05edSRuslan Bukin.endif
31247e9f42eSWarner Losh.if ${__TT} != "mips" && ${__T} != "powerpc" && ${__T} != "powerpcspe"
313ffe63c8bSEd Maste__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
3140aa5466eSEd Maste.else
315ffe63c8bSEd Maste__DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
3160aa5466eSEd Maste.endif
317056dd75bSEd Maste.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386"
318dfccd92cSEd Maste__DEFAULT_YES_OPTIONS+=LLDB
319d0ba16f7SEd Maste.else
320dfccd92cSEd Maste__DEFAULT_NO_OPTIONS+=LLDB
321d0ba16f7SEd Maste.endif
322a4330302SBrooks Davis# LIB32 is supported on amd64, mips64, and powerpc64
32355c2583aSBrooks Davis.if (${__T} == "amd64" || ${__T:Mmips64*} || ${__T} == "powerpc64")
324a4330302SBrooks Davis__DEFAULT_YES_OPTIONS+=LIB32
325a4330302SBrooks Davis.else
326a4330302SBrooks DavisBROKEN_OPTIONS+=LIB32
327a4330302SBrooks Davis.endif
3280c095a65SEnji Cooper# Only doing soft float API stuff on armv6 and armv7
3290b972ac9SWarner Losh.if ${__T} != "armv6" && ${__T} != "armv7"
330c42ade60SWarner LoshBROKEN_OPTIONS+=LIBSOFT
331c42ade60SWarner Losh.endif
3323d79fdacSWarner Losh.if ${__T:Mmips*}
3336794d195SKyle Evans# GOOGLETEST cannot currently be compiled on mips due to external circumstances.
3346794d195SKyle Evans# Notably, the freebsd-gcc port isn't linking in libgcc so we end up trying ot
3356794d195SKyle Evans# link to a hidden symbol. LLVM would successfully link this in, but some of
3366794d195SKyle Evans# the mips variants are broken under LLVM until LLVM 10. GOOGLETEST should be
3376794d195SKyle Evans# marked no longer broken with the switch to LLVM.
3386794d195SKyle EvansBROKEN_OPTIONS+=GOOGLETEST SSP
3395bec6d55SRuslan Bukin.endif
34047e9f42eSWarner Losh# EFI doesn't exist on mips, powerpc, or riscv.
34147e9f42eSWarner Losh.if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Mriscv*}
342f86dd996SWarner LoshBROKEN_OPTIONS+=EFI
343d49a5dddSWarner Losh.endif
34447e9f42eSWarner Losh# OFW is only for powerpc, exclude others
34547e9f42eSWarner Losh.if ${__T:Mpowerpc*} == ""
346f86dd996SWarner LoshBROKEN_OPTIONS+=LOADER_OFW
347f86dd996SWarner Losh.endif
348f86dd996SWarner Losh# UBOOT is only for arm, mips and powerpc, exclude others
349f86dd996SWarner Losh.if ${__T:Marm*} == "" && ${__T:Mmips*} == "" && ${__T:Mpowerpc*} == ""
350f86dd996SWarner LoshBROKEN_OPTIONS+=LOADER_UBOOT
351f86dd996SWarner Losh.endif
35247e9f42eSWarner Losh# GELI and Lua in loader currently cause boot failures on powerpc.
35349f1151fSNathan Whitehorn# Further debugging is required -- probably they are just broken on big
35449f1151fSNathan Whitehorn# endian systems generically (they jump to null pointers or try to read
35549f1151fSNathan Whitehorn# crazy high addresses, which is typical of endianness problems).
35647e9f42eSWarner Losh.if ${__T:Mpowerpc*}
357f54d801aSKurt LidlBROKEN_OPTIONS+=LOADER_GELI LOADER_LUA
358f54d801aSKurt Lidl.endif
359f86dd996SWarner Losh
3602427dc7dSEd Maste.if ${__T:Mmips64*}
3612427dc7dSEd Maste# profiling won't work on MIPS64 because there is only assembly for o32
3622427dc7dSEd MasteBROKEN_OPTIONS+=PROFILE
3632427dc7dSEd Maste.endif
364983a395dSWarner Losh.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
36547e9f42eSWarner Losh    ${__T} != "powerpc64"
366983a395dSWarner LoshBROKEN_OPTIONS+=CXGBETOOL
367983a395dSWarner LoshBROKEN_OPTIONS+=MLX5TOOL
36854912308SNavdeep Parhar.endif
36954912308SNavdeep Parhar
3705b87c94aSBrooks Davis# HyperV is currently x86-only
371983a395dSWarner Losh.if ${__T} != "amd64" && ${__T} != "i386"
372983a395dSWarner LoshBROKEN_OPTIONS+=HYPERV
3735b87c94aSBrooks Davis.endif
3745b87c94aSBrooks Davis
375ecdc19b5SWarner Losh# NVME is only aarch64, x86 and powerpc64
3766b3555c3SDimitry Andric.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \
3776b3555c3SDimitry Andric    ${__T} != "powerpc64"
378983a395dSWarner LoshBROKEN_OPTIONS+=NVME
379f0f8a1afSWarner Losh.endif
380f0f8a1afSWarner Losh
3816b3555c3SDimitry Andric.if ${COMPILER_FEATURES:Mc++11} && \
3826b3555c3SDimitry Andric    (${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64")
383b0840a28SDimitry Andric__DEFAULT_YES_OPTIONS+=OPENMP
384b0840a28SDimitry Andric.else
385b0840a28SDimitry Andric__DEFAULT_NO_OPTIONS+=OPENMP
386b0840a28SDimitry Andric.endif
387b0840a28SDimitry Andric
3885e84b765SWarner Losh.include <bsd.mkopt.mk>
3895e84b765SWarner Losh
3905e84b765SWarner Losh#
3915e84b765SWarner Losh# MK_* options that default to "yes" if the compiler is a C++11 compiler.
3925e84b765SWarner Losh#
3935e84b765SWarner Losh.for var in \
3945e84b765SWarner Losh    LIBCPLUSPLUS
3955e84b765SWarner Losh.if !defined(MK_${var})
3965e84b765SWarner Losh.if ${COMPILER_FEATURES:Mc++11}
3975e84b765SWarner Losh.if defined(WITHOUT_${var})
3985e84b765SWarner LoshMK_${var}:=	no
3995e84b765SWarner Losh.else
4005e84b765SWarner LoshMK_${var}:=	yes
4015e84b765SWarner Losh.endif
4025e84b765SWarner Losh.else
4035e84b765SWarner Losh.if defined(WITH_${var})
4045e84b765SWarner LoshMK_${var}:=	yes
4055e84b765SWarner Losh.else
4065e84b765SWarner LoshMK_${var}:=	no
4075e84b765SWarner Losh.endif
4085e84b765SWarner Losh.endif
4095e84b765SWarner Losh.endif
4105e84b765SWarner Losh.endfor
4115e84b765SWarner Losh
4125e84b765SWarner Losh#
4135e84b765SWarner Losh# Force some options off if their dependencies are off.
4145e84b765SWarner Losh# Order is somewhat important.
4155e84b765SWarner Losh#
41693cdeb4aSEd Maste.if !${COMPILER_FEATURES:Mc++11}
41743e25f47SEnji CooperMK_GOOGLETEST:=	no
41893cdeb4aSEd Maste.endif
41993cdeb4aSEd Maste
42058551dc6SBaptiste Daroussin.if ${MK_CAPSICUM} == "no"
42158551dc6SBaptiste DaroussinMK_CASPER:=	no
42258551dc6SBaptiste Daroussin.endif
42358551dc6SBaptiste Daroussin
4245e84b765SWarner Losh.if ${MK_LIBPTHREAD} == "no"
4255e84b765SWarner LoshMK_LIBTHR:=	no
4265e84b765SWarner Losh.endif
4275e84b765SWarner Losh
4285e84b765SWarner Losh.if ${MK_SOURCELESS} == "no"
4295e84b765SWarner LoshMK_SOURCELESS_HOST:=	no
4305e84b765SWarner LoshMK_SOURCELESS_UCODE:= no
4315e84b765SWarner Losh.endif
4325e84b765SWarner Losh
4335e84b765SWarner Losh.if ${MK_CDDL} == "no"
4345e84b765SWarner LoshMK_ZFS:=	no
435fbeb31a2SMatt MacyMK_LOADER_ZFS:=	no
4365e84b765SWarner LoshMK_CTF:=	no
4375e84b765SWarner Losh.endif
4385e84b765SWarner Losh
4395e84b765SWarner Losh.if ${MK_CRYPT} == "no"
4405e84b765SWarner LoshMK_OPENSSL:=	no
4415e84b765SWarner LoshMK_OPENSSH:=	no
4425e84b765SWarner LoshMK_KERBEROS:=	no
4430ce9d0afSEd MasteMK_KERBEROS_SUPPORT:=	no
4445e84b765SWarner Losh.endif
4455e84b765SWarner Losh
4465e84b765SWarner Losh.if ${MK_CXX} == "no"
4475e84b765SWarner LoshMK_CLANG:=	no
4489ed13baaSEd MasteMK_GOOGLETEST:=	no
4498a9745b5SEd MasteMK_TESTS:=	no
4505e84b765SWarner Losh.endif
4515e84b765SWarner Losh
452f987297fSEd Maste.if ${MK_DIALOG} == "no"
453f987297fSEd MasteMK_BSDINSTALL:=	no
454f987297fSEd Maste.endif
455f987297fSEd Maste
456b4f20f20SEd Maste.if ${MK_FILE} == "no"
457b4f20f20SEd MasteMK_SVNLITE:=	no
458b4f20f20SEd Maste.endif
459b4f20f20SEd Maste
4605e84b765SWarner Losh.if ${MK_MAIL} == "no"
4615e84b765SWarner LoshMK_MAILWRAPPER:= no
4625e84b765SWarner LoshMK_SENDMAIL:=	no
4635e84b765SWarner LoshMK_DMAGENT:=	no
4645e84b765SWarner Losh.endif
4655e84b765SWarner Losh
4665e84b765SWarner Losh.if ${MK_NETGRAPH} == "no"
4675e84b765SWarner LoshMK_ATM:=	no
4685e84b765SWarner LoshMK_BLUETOOTH:=	no
4695e84b765SWarner Losh.endif
4705e84b765SWarner Losh
471edb58145SEnji Cooper.if ${MK_NLS} == "no"
472edb58145SEnji CooperMK_NLS_CATALOGS:= no
473edb58145SEnji Cooper.endif
474edb58145SEnji Cooper
4755e84b765SWarner Losh.if ${MK_OPENSSL} == "no"
476df502accSEd MasteMK_DMAGENT:=	no
4775e84b765SWarner LoshMK_OPENSSH:=	no
4785e84b765SWarner LoshMK_KERBEROS:=	no
4790ce9d0afSEd MasteMK_KERBEROS_SUPPORT:=	no
48037516d3bSEd MasteMK_LDNS:=	no
48137516d3bSEd Maste.endif
48237516d3bSEd Maste
48337516d3bSEd Maste.if ${MK_LDNS} == "no"
48437516d3bSEd MasteMK_LDNS_UTILS:=	no
48537516d3bSEd MasteMK_UNBOUND:= no
4865e84b765SWarner Losh.endif
4875e84b765SWarner Losh
4885e84b765SWarner Losh.if ${MK_PF} == "no"
4895e84b765SWarner LoshMK_AUTHPF:=	no
4905e84b765SWarner Losh.endif
4915e84b765SWarner Losh
492abbe7d5aSKonstantin Belousov.if ${MK_OFED} == "no"
493abbe7d5aSKonstantin BelousovMK_OFED_EXTRA:=	no
494abbe7d5aSKonstantin Belousov.endif
495abbe7d5aSKonstantin Belousov
4961069f41bSEd Maste.if ${MK_PORTSNAP} == "no"
4971069f41bSEd Maste# freebsd-update depends on phttpget from portsnap
4981069f41bSEd MasteMK_FREEBSD_UPDATE:=	no
4991069f41bSEd Maste.endif
5001069f41bSEd Maste
501d912066cSMark Johnston.if ${MK_TESTS} == "no"
502d912066cSMark JohnstonMK_DTRACE_TESTS:= no
50306beea0eSEnji Cooper.endif
50406beea0eSEnji Cooper
50506beea0eSEnji Cooper.if ${MK_TESTS_SUPPORT} == "no"
50643e25f47SEnji CooperMK_GOOGLETEST:=	no
507d912066cSMark Johnston.endif
508d912066cSMark Johnston
509c5cba060SEnji Cooper.if ${MK_ZONEINFO} == "no"
510c5cba060SEnji CooperMK_ZONEINFO_LEAPSECONDS_SUPPORT:= no
511c5cba060SEnji CooperMK_ZONEINFO_OLD_TIMEZONES_SUPPORT:= no
512c5cba060SEnji Cooper.endif
513c5cba060SEnji Cooper
5145e84b765SWarner Losh.if ${MK_CROSS_COMPILER} == "no"
5155e84b765SWarner LoshMK_BINUTILS_BOOTSTRAP:= no
5165e84b765SWarner LoshMK_CLANG_BOOTSTRAP:= no
51708474898SEd MasteMK_ELFTOOLCHAIN_BOOTSTRAP:= no
51889257265SEd MasteMK_LLD_BOOTSTRAP:= no
5195e84b765SWarner Losh.endif
5205e84b765SWarner Losh
5215e84b765SWarner Losh.if ${MK_TOOLCHAIN} == "no"
5225e84b765SWarner LoshMK_BINUTILS:=	no
5235e84b765SWarner LoshMK_CLANG:=	no
5245e84b765SWarner LoshMK_GDB:=	no
525590461a4SWarner LoshMK_INCLUDES:=	no
526e5928414SEd MasteMK_LLD:=	no
52711e49977SBryan DreweryMK_LLDB:=	no
5285e84b765SWarner Losh.endif
5295e84b765SWarner Losh
5305e84b765SWarner Losh.if ${MK_CLANG} == "no"
5315e84b765SWarner LoshMK_CLANG_EXTRAS:= no
5325e84b765SWarner LoshMK_CLANG_FULL:= no
5331b49115aSEd MasteMK_LLVM_COV:= no
5345e84b765SWarner Losh.endif
5355e84b765SWarner Losh
536b0fefb25SMarcin Wojtas.if ${MK_LOADER_VERIEXEC} == "no"
537b0fefb25SMarcin WojtasMK_LOADER_VERIEXEC_PASS_MANIFEST := no
538b0fefb25SMarcin Wojtas.endif
539b0fefb25SMarcin Wojtas
5405e84b765SWarner Losh#
5414301886dSEnji Cooper# MK_* options whose default value depends on another option.
5424301886dSEnji Cooper#
5434301886dSEnji Cooper.for vv in \
5444301886dSEnji Cooper    GSSAPI/KERBEROS \
5454301886dSEnji Cooper    MAN_UTILS/MAN
5464301886dSEnji Cooper.if defined(WITH_${vv:H})
5474301886dSEnji CooperMK_${vv:H}:=	yes
5484301886dSEnji Cooper.elif defined(WITHOUT_${vv:H})
5494301886dSEnji CooperMK_${vv:H}:=	no
5504301886dSEnji Cooper.else
5514301886dSEnji CooperMK_${vv:H}:=	${MK_${vv:T}}
5524301886dSEnji Cooper.endif
5534301886dSEnji Cooper.endfor
5544301886dSEnji Cooper
5554301886dSEnji Cooper#
5565e84b765SWarner Losh# Set defaults for the MK_*_SUPPORT variables.
5575e84b765SWarner Losh#
5585e84b765SWarner Losh
5595e84b765SWarner Losh.if !${COMPILER_FEATURES:Mc++11}
5605e84b765SWarner LoshMK_LLDB:=	no
5615e84b765SWarner Losh.endif
5625e84b765SWarner Losh
563ff2cf368SBaptiste Daroussin.endif #  !target(__<src.opts.mk>__)
564