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 AMD \ 595e84b765SWarner Losh APM \ 605e84b765SWarner Losh AT \ 615e84b765SWarner Losh ATM \ 625e84b765SWarner Losh AUDIT \ 635e84b765SWarner Losh AUTHPF \ 64b3590423SEnji Cooper AUTOFS \ 6502629e46SEnji Cooper BHYVE \ 665e84b765SWarner Losh BINUTILS \ 675e84b765SWarner Losh BINUTILS_BOOTSTRAP \ 6895856e14SKurt Lidl BLACKLIST \ 695e84b765SWarner Losh BLUETOOTH \ 705e84b765SWarner Losh BOOT \ 7111981695SEnji Cooper BOOTPARAMD \ 7211981695SEnji Cooper BOOTPD \ 735e84b765SWarner Losh BSD_CPIO \ 7430c5db2bSAndrew Turner BSD_CRTBEGIN \ 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 \ 845e84b765SWarner Losh CPP \ 855e84b765SWarner Losh CROSS_COMPILER \ 865e84b765SWarner Losh CRYPT \ 8736716419SHans Petter Selasky CUSE \ 885e84b765SWarner Losh CXX \ 89983a395dSWarner Losh CXGBETOOL \ 90f987297fSEd Maste DIALOG \ 915e84b765SWarner Losh DICT \ 925e84b765SWarner Losh DMAGENT \ 935e84b765SWarner Losh DYNAMICROOT \ 9479a86dafSEnji Cooper EE \ 95d49a5dddSWarner Losh EFI \ 9608474898SEd Maste ELFTOOLCHAIN_BOOTSTRAP \ 975e84b765SWarner Losh EXAMPLES \ 985e84b765SWarner Losh FDT \ 99c7b6816fSEnji Cooper FILE \ 10011981695SEnji Cooper FINGER \ 1015e84b765SWarner Losh FLOPPY \ 1025e84b765SWarner Losh FMTREE \ 1035e84b765SWarner Losh FORTH \ 1045e84b765SWarner Losh FP_LIBC \ 1055e84b765SWarner Losh FREEBSD_UPDATE \ 10611981695SEnji Cooper FTP \ 1075e84b765SWarner Losh GAMES \ 1085e84b765SWarner Losh GCOV \ 10973ad3fb5SJohn Baldwin GDB \ 11094ff3d03SEd Maste GNU_DIFF \ 11194ff3d03SEd Maste GNU_GREP \ 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 \ 1295e84b765SWarner Losh LIB32 \ 1305e84b765SWarner Losh LIBPTHREAD \ 1315e84b765SWarner Losh LIBTHR \ 1321b49115aSEd Maste LLVM_COV \ 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 \ 1695e84b765SWarner Losh SHAREDOCS \ 1705e84b765SWarner Losh SOURCELESS \ 1715e84b765SWarner Losh SOURCELESS_HOST \ 1725e84b765SWarner Losh SOURCELESS_UCODE \ 173*1a13f2e6SEdward Tomasz Napierala STATS \ 1745e84b765SWarner Losh SVNLITE \ 1755e84b765SWarner Losh SYSCONS \ 176bf16c2e9SBryan Drewery SYSTEM_COMPILER \ 177a7d84af8SBryan Drewery SYSTEM_LINKER \ 1783f802165SEnji Cooper TALK \ 17911981695SEnji Cooper TCP_WRAPPERS \ 1805e84b765SWarner Losh TCSH \ 1815e84b765SWarner Losh TELNET \ 1825e84b765SWarner Losh TEXTPROC \ 18311981695SEnji Cooper TFTP \ 1845e84b765SWarner Losh UNBOUND \ 1855e84b765SWarner Losh USB \ 1865e84b765SWarner Losh UTMPX \ 1875e84b765SWarner Losh VI \ 188824a9093SEd Maste VT \ 1895e84b765SWarner Losh WIRELESS \ 1905e84b765SWarner Losh WPA_SUPPLICANT_EAPOL \ 1915e84b765SWarner Losh ZFS \ 192fbeb31a2SMatt Macy LOADER_ZFS \ 1935e84b765SWarner Losh ZONEINFO 1945e84b765SWarner Losh 1955e84b765SWarner Losh__DEFAULT_NO_OPTIONS = \ 196a92958dfSSimon J. Gerraty BEARSSL \ 1975e84b765SWarner Losh BSD_GREP \ 1985e84b765SWarner Losh CLANG_EXTRAS \ 199d912066cSMark Johnston DTRACE_TESTS \ 20043f75d57SBjoern A. Zeeb EXPERIMENTAL \ 201e9e768f7SEd Maste GNU_GREP_COMPAT \ 2025e84b765SWarner Losh HESIOD \ 2032d0a92c9SKyle Evans HTTPD \ 204c42ade60SWarner Losh LIBSOFT \ 205a179cd91SWarner Losh LOADER_FIREWIRE \ 20676541eb0SWojciech Macek LOADER_FORCE_LE \ 207f871c5d9SWarner Losh LOADER_VERBOSE \ 208b0fefb25SMarcin Wojtas LOADER_VERIEXEC_PASS_MANIFEST \ 209abbe7d5aSKonstantin Belousov OFED_EXTRA \ 2105e84b765SWarner Losh OPENLDAP \ 211a58383d2SJohn Baldwin REPRODUCIBLE_BUILD \ 212609b7b26SEnji Cooper RPCBIND_WARMSTART_SUPPORT \ 2135e84b765SWarner Losh SHARED_TOOLCHAIN \ 2145e84b765SWarner Losh SORT_THREADS \ 2156120aabdSBryan Drewery SVN \ 216c5cba060SEnji Cooper ZONEINFO_LEAPSECONDS_SUPPORT \ 217c5cba060SEnji Cooper ZONEINFO_OLD_TIMEZONES_SUPPORT \ 2186120aabdSBryan Drewery 219100fafebSBryan Drewery# LEFT/RIGHT. Left options which default to "yes" unless their corresponding 220100fafebSBryan Drewery# RIGHT option is disabled. 221100fafebSBryan Drewery__DEFAULT_DEPENDENT_OPTIONS= \ 222100fafebSBryan Drewery CLANG_FULL/CLANG \ 223631e709fSBryan Drewery LLVM_TARGET_ALL/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 26515b53426SKyle Evans# Default GOOGLETEST to off for MIPS while LLVM PR 43263 is active. Part 26615b53426SKyle Evans# of the fusefs tests trigger excessively long compile times. It does 26715b53426SKyle Evans# eventually succeed, but this shouldn't be forced on those building by default. 26815b53426SKyle Evans.if ${__TT} == "mips" 26915b53426SKyle Evans__DEFAULT_NO_OPTIONS+= GOOGLETEST 27015b53426SKyle Evans.else 27115b53426SKyle Evans__DEFAULT_YES_OPTIONS+= GOOGLETEST 27215b53426SKyle Evans.endif 27315b53426SKyle Evans 274631e709fSBryan Drewery# All supported backends for LLVM_TARGET_XXX 275631e709fSBryan Drewery__LLVM_TARGETS= \ 276631e709fSBryan Drewery aarch64 \ 277631e709fSBryan Drewery arm \ 278631e709fSBryan Drewery mips \ 279631e709fSBryan Drewery powerpc \ 280631e709fSBryan Drewery sparc \ 281631e709fSBryan Drewery x86 2820a0163ebSLeandro Lupori__LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/:S/powerpc64/powerpc/ 2834e2a4490SBryan Drewery.for __llt in ${__LLVM_TARGETS} 2844e2a4490SBryan Drewery# Default the given TARGET's LLVM_TARGET support to the value of MK_CLANG. 2854e2a4490SBryan Drewery.if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} 2864e2a4490SBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/CLANG 28712401698SDimitry Andric# Disable other targets for arm and armv6, to work around "relocation truncated 28812401698SDimitry Andric# to fit" errors with BFD ld, since libllvm.a will get too large to link. 28912401698SDimitry Andric.elif ${__T} == "arm" || ${__T} == "armv6" 29012401698SDimitry Andric__DEFAULT_NO_OPTIONS+=LLVM_TARGET_${__llt:tu} 2914e2a4490SBryan Drewery# aarch64 needs arm for -m32 support. 2924e2a4490SBryan Drewery.elif ${__TT} == "arm64" && ${__llt} == "arm" 2934e2a4490SBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 294631e709fSBryan Drewery# Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL 295631e709fSBryan Drewery# which is based on MK_CLANG. 296631e709fSBryan Drewery.else 2974e2a4490SBryan Drewery__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL 298631e709fSBryan Drewery.endif 299631e709fSBryan Drewery.endfor 300631e709fSBryan Drewery 30189edb881SDimitry Andric__DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF 302b2689b12SMitchell Horne__DEFAULT_NO_OPTIONS+=LLVM_TARGET_RISCV 30389edb881SDimitry Andric 3040104753bSDimitry Andric.include <bsd.compiler.mk> 3058758abd5SBryan Drewery# If the compiler is not C++11 capable, disable Clang and use GCC instead. 3068758abd5SBryan Drewery# This means that architectures that have GCC 4.2 as default can not 3078758abd5SBryan Drewery# build Clang without using an external compiler. 3088758abd5SBryan Drewery 3098758abd5SBryan Drewery.if ${COMPILER_FEATURES:Mc++11} && (${__T} == "aarch64" || \ 3108758abd5SBryan Drewery ${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386") 3118758abd5SBryan Drewery# Clang is enabled, and will be installed as the default /usr/bin/cc. 312100fafebSBryan Drewery__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD 313a793c109SEd Maste__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC 314993d3dedSEd Maste.elif ${COMPILER_FEATURES:Mc++11} && ${__T:Mriscv*} == "" && ${__T} != "sparc64" 31560af5546SEd Maste# If an external compiler that supports C++11 is used as ${CC} and Clang 31660af5546SEd Maste# supports the target, then Clang is enabled but GCC is installed as the 31760af5546SEd Maste# default /usr/bin/cc. 318100fafebSBryan Drewery__DEFAULT_YES_OPTIONS+=CLANG GCC GCC_BOOTSTRAP GNUCXX GPL_DTC LLD 3192dce6bfbSEd Maste__DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC 3200104753bSDimitry Andric.else 3218758abd5SBryan Drewery# Everything else disables Clang, and uses GCC instead. 322a793c109SEd Maste__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC 323100fafebSBryan Drewery__DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD 3245e84b765SWarner Losh.endif 3251cee64a8SEd Maste# In-tree binutils/gcc are older versions without modern architecture support. 3267804dd52SRuslan Bukin.if ${__T} == "aarch64" || ${__T:Mriscv*} != "" 327054f15acSEnji CooperBROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB 3288daa8167SAndrew Turner.endif 3297ddf05edSRuslan Bukin.if ${__T:Mriscv*} != "" 3307ddf05edSRuslan BukinBROKEN_OPTIONS+=OFED 3317ddf05edSRuslan Bukin.endif 33206b41817SEd Maste.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ 3331e18e7d2SJohn Baldwin ${__T:Mriscv*} != "" || ${__TT} == "mips" 33406b41817SEd Maste__DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND 33506b41817SEd Maste.else 33606b41817SEd Maste__DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND 33706b41817SEd Maste.endif 338ca5efb62SEd Maste.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv7" || \ 339ca5efb62SEd Maste ${__T} == "i386" 340ffe63c8bSEd Maste__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD 3410aa5466eSEd Maste.else 342ffe63c8bSEd Maste__DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD 3430aa5466eSEd Maste.endif 344056dd75bSEd Maste.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" 345dfccd92cSEd Maste__DEFAULT_YES_OPTIONS+=LLDB 346d0ba16f7SEd Maste.else 347dfccd92cSEd Maste__DEFAULT_NO_OPTIONS+=LLDB 348d0ba16f7SEd Maste.endif 349ac99c33fSEd Maste# LLVM lacks support for FreeBSD 64-bit atomic operations for ARMv4/ARMv5 35071cb2dfcSWarner Losh.if ${__T} == "arm" 351ac99c33fSEd MasteBROKEN_OPTIONS+=LLDB 352ac99c33fSEd Maste.endif 35399b8bccdSJohn Baldwin# GDB in base is generally less functional than GDB in ports. Ports GDB 354513fdd50SJohn Baldwin# sparc64 kernel support has not been tested. 355513fdd50SJohn Baldwin.if ${__T} == "sparc64" 35673ad3fb5SJohn Baldwin__DEFAULT_NO_OPTIONS+=GDB_LIBEXEC 35799b8bccdSJohn Baldwin.else 35873ad3fb5SJohn Baldwin__DEFAULT_YES_OPTIONS+=GDB_LIBEXEC 35999b8bccdSJohn Baldwin.endif 3600c095a65SEnji Cooper# Only doing soft float API stuff on armv6 and armv7 3610b972ac9SWarner Losh.if ${__T} != "armv6" && ${__T} != "armv7" 362c42ade60SWarner LoshBROKEN_OPTIONS+=LIBSOFT 363c42ade60SWarner Losh.endif 3643d79fdacSWarner Losh.if ${__T:Mmips*} 3655bec6d55SRuslan BukinBROKEN_OPTIONS+=SSP 3665bec6d55SRuslan Bukin.endif 3679e74797fSWarner Losh# EFI doesn't exist on mips, powerpc, sparc or riscv. 368d49a5dddSWarner Losh.if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*} 369f86dd996SWarner LoshBROKEN_OPTIONS+=EFI 370d49a5dddSWarner Losh.endif 371f86dd996SWarner Losh# OFW is only for powerpc and sparc64, exclude others 372f86dd996SWarner Losh.if ${__T:Mpowerpc*} == "" && ${__T:Msparc64} == "" 373f86dd996SWarner LoshBROKEN_OPTIONS+=LOADER_OFW 374f86dd996SWarner Losh.endif 375f86dd996SWarner Losh# UBOOT is only for arm, mips and powerpc, exclude others 376f86dd996SWarner Losh.if ${__T:Marm*} == "" && ${__T:Mmips*} == "" && ${__T:Mpowerpc*} == "" 377f86dd996SWarner LoshBROKEN_OPTIONS+=LOADER_UBOOT 378f86dd996SWarner Losh.endif 37949f1151fSNathan Whitehorn# GELI and Lua in loader currently cause boot failures on sparc64 and powerpc. 38049f1151fSNathan Whitehorn# Further debugging is required -- probably they are just broken on big 38149f1151fSNathan Whitehorn# endian systems generically (they jump to null pointers or try to read 38249f1151fSNathan Whitehorn# crazy high addresses, which is typical of endianness problems). 38349f1151fSNathan Whitehorn.if ${__T} == "sparc64" || ${__T:Mpowerpc*} 384f54d801aSKurt LidlBROKEN_OPTIONS+=LOADER_GELI LOADER_LUA 385f54d801aSKurt Lidl.endif 386f86dd996SWarner Losh 3872427dc7dSEd Maste.if ${__T:Mmips64*} 3882427dc7dSEd Maste# profiling won't work on MIPS64 because there is only assembly for o32 3892427dc7dSEd MasteBROKEN_OPTIONS+=PROFILE 3902427dc7dSEd Maste.endif 391983a395dSWarner Losh.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \ 392983a395dSWarner Losh ${__T} != "powerpc64" && ${__T} != "sparc64" 393983a395dSWarner LoshBROKEN_OPTIONS+=CXGBETOOL 394983a395dSWarner LoshBROKEN_OPTIONS+=MLX5TOOL 39554912308SNavdeep Parhar.endif 39654912308SNavdeep Parhar 3975b87c94aSBrooks Davis# HyperV is currently x86-only 398983a395dSWarner Losh.if ${__T} != "amd64" && ${__T} != "i386" 399983a395dSWarner LoshBROKEN_OPTIONS+=HYPERV 4005b87c94aSBrooks Davis.endif 4015b87c94aSBrooks Davis 402ecdc19b5SWarner Losh# NVME is only aarch64, x86 and powerpc64 403ecdc19b5SWarner Losh.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && ${__T} != "powerpc64" 404983a395dSWarner LoshBROKEN_OPTIONS+=NVME 405f0f8a1afSWarner Losh.endif 406f0f8a1afSWarner Losh 4074ee71ec9SAndrew Turner# Sparc64 need extra crt*.o files 4084ee71ec9SAndrew Turner.if ${__T:Msparc64} 409f74c331aSAndrew TurnerBROKEN_OPTIONS+=BSD_CRTBEGIN 410f74c331aSAndrew Turner.endif 411f74c331aSAndrew Turner 41207302582SDimitry Andric.if ${COMPILER_FEATURES:Mc++11} && (${__T} == "amd64" || ${__T} == "i386") 413b0840a28SDimitry Andric__DEFAULT_YES_OPTIONS+=OPENMP 414b0840a28SDimitry Andric.else 415b0840a28SDimitry Andric__DEFAULT_NO_OPTIONS+=OPENMP 416b0840a28SDimitry Andric.endif 417b0840a28SDimitry Andric 4185e84b765SWarner Losh.include <bsd.mkopt.mk> 4195e84b765SWarner Losh 4205e84b765SWarner Losh# 4215e84b765SWarner Losh# MK_* options that default to "yes" if the compiler is a C++11 compiler. 4225e84b765SWarner Losh# 4235e84b765SWarner Losh.for var in \ 4245e84b765SWarner Losh LIBCPLUSPLUS 4255e84b765SWarner Losh.if !defined(MK_${var}) 4265e84b765SWarner Losh.if ${COMPILER_FEATURES:Mc++11} 4275e84b765SWarner Losh.if defined(WITHOUT_${var}) 4285e84b765SWarner LoshMK_${var}:= no 4295e84b765SWarner Losh.else 4305e84b765SWarner LoshMK_${var}:= yes 4315e84b765SWarner Losh.endif 4325e84b765SWarner Losh.else 4335e84b765SWarner Losh.if defined(WITH_${var}) 4345e84b765SWarner LoshMK_${var}:= yes 4355e84b765SWarner Losh.else 4365e84b765SWarner LoshMK_${var}:= no 4375e84b765SWarner Losh.endif 4385e84b765SWarner Losh.endif 4395e84b765SWarner Losh.endif 4405e84b765SWarner Losh.endfor 4415e84b765SWarner Losh 4425e84b765SWarner Losh# 4435e84b765SWarner Losh# Force some options off if their dependencies are off. 4445e84b765SWarner Losh# Order is somewhat important. 4455e84b765SWarner Losh# 44693cdeb4aSEd Maste.if !${COMPILER_FEATURES:Mc++11} 44743e25f47SEnji CooperMK_GOOGLETEST:= no 44893cdeb4aSEd MasteMK_LLVM_LIBUNWIND:= no 44993cdeb4aSEd Maste.endif 45093cdeb4aSEd Maste 45158551dc6SBaptiste Daroussin.if ${MK_CAPSICUM} == "no" 45258551dc6SBaptiste DaroussinMK_CASPER:= no 45358551dc6SBaptiste Daroussin.endif 45458551dc6SBaptiste Daroussin 4555e84b765SWarner Losh.if ${MK_LIBPTHREAD} == "no" 4565e84b765SWarner LoshMK_LIBTHR:= no 4575e84b765SWarner Losh.endif 4585e84b765SWarner Losh 4595e84b765SWarner Losh.if ${MK_LDNS} == "no" 4605e84b765SWarner LoshMK_LDNS_UTILS:= no 4615e84b765SWarner LoshMK_UNBOUND:= no 4625e84b765SWarner Losh.endif 4635e84b765SWarner Losh 4645e84b765SWarner Losh.if ${MK_SOURCELESS} == "no" 4655e84b765SWarner LoshMK_SOURCELESS_HOST:= no 4665e84b765SWarner LoshMK_SOURCELESS_UCODE:= no 4675e84b765SWarner Losh.endif 4685e84b765SWarner Losh 4695e84b765SWarner Losh.if ${MK_CDDL} == "no" 4705e84b765SWarner LoshMK_ZFS:= no 471fbeb31a2SMatt MacyMK_LOADER_ZFS:= no 4725e84b765SWarner LoshMK_CTF:= no 4735e84b765SWarner Losh.endif 4745e84b765SWarner Losh 4755e84b765SWarner Losh.if ${MK_CRYPT} == "no" 4765e84b765SWarner LoshMK_OPENSSL:= no 4775e84b765SWarner LoshMK_OPENSSH:= no 4785e84b765SWarner LoshMK_KERBEROS:= no 4795e84b765SWarner Losh.endif 4805e84b765SWarner Losh 4815e84b765SWarner Losh.if ${MK_CXX} == "no" 4825e84b765SWarner LoshMK_CLANG:= no 4839e88096eSWarner LoshMK_GNUCXX:= no 4848a9745b5SEd MasteMK_TESTS:= no 4855e84b765SWarner Losh.endif 4865e84b765SWarner Losh 487f987297fSEd Maste.if ${MK_DIALOG} == "no" 488f987297fSEd MasteMK_BSDINSTALL:= no 489f987297fSEd Maste.endif 490f987297fSEd Maste 4915e84b765SWarner Losh.if ${MK_MAIL} == "no" 4925e84b765SWarner LoshMK_MAILWRAPPER:= no 4935e84b765SWarner LoshMK_SENDMAIL:= no 4945e84b765SWarner LoshMK_DMAGENT:= no 4955e84b765SWarner Losh.endif 4965e84b765SWarner Losh 4975e84b765SWarner Losh.if ${MK_NETGRAPH} == "no" 4985e84b765SWarner LoshMK_ATM:= no 4995e84b765SWarner LoshMK_BLUETOOTH:= no 5005e84b765SWarner Losh.endif 5015e84b765SWarner Losh 502edb58145SEnji Cooper.if ${MK_NLS} == "no" 503edb58145SEnji CooperMK_NLS_CATALOGS:= no 504edb58145SEnji Cooper.endif 505edb58145SEnji Cooper 5065e84b765SWarner Losh.if ${MK_OPENSSL} == "no" 5075e84b765SWarner LoshMK_OPENSSH:= no 5085e84b765SWarner LoshMK_KERBEROS:= no 5095e84b765SWarner Losh.endif 5105e84b765SWarner Losh 5115e84b765SWarner Losh.if ${MK_PF} == "no" 5125e84b765SWarner LoshMK_AUTHPF:= no 5135e84b765SWarner Losh.endif 5145e84b765SWarner Losh 515abbe7d5aSKonstantin Belousov.if ${MK_OFED} == "no" 516abbe7d5aSKonstantin BelousovMK_OFED_EXTRA:= no 517abbe7d5aSKonstantin Belousov.endif 518abbe7d5aSKonstantin Belousov 5191069f41bSEd Maste.if ${MK_PORTSNAP} == "no" 5201069f41bSEd Maste# freebsd-update depends on phttpget from portsnap 5211069f41bSEd MasteMK_FREEBSD_UPDATE:= no 5221069f41bSEd Maste.endif 5231069f41bSEd Maste 524d912066cSMark Johnston.if ${MK_TESTS} == "no" 525d912066cSMark JohnstonMK_DTRACE_TESTS:= no 52606beea0eSEnji Cooper.endif 52706beea0eSEnji Cooper 52806beea0eSEnji Cooper.if ${MK_TESTS_SUPPORT} == "no" 52943e25f47SEnji CooperMK_GOOGLETEST:= no 530d912066cSMark Johnston.endif 531d912066cSMark Johnston 532c5cba060SEnji Cooper.if ${MK_ZONEINFO} == "no" 533c5cba060SEnji CooperMK_ZONEINFO_LEAPSECONDS_SUPPORT:= no 534c5cba060SEnji CooperMK_ZONEINFO_OLD_TIMEZONES_SUPPORT:= no 535c5cba060SEnji Cooper.endif 536c5cba060SEnji Cooper 5375e84b765SWarner Losh.if ${MK_CROSS_COMPILER} == "no" 5385e84b765SWarner LoshMK_BINUTILS_BOOTSTRAP:= no 5395e84b765SWarner LoshMK_CLANG_BOOTSTRAP:= no 54008474898SEd MasteMK_ELFTOOLCHAIN_BOOTSTRAP:= no 5415e84b765SWarner LoshMK_GCC_BOOTSTRAP:= no 54289257265SEd MasteMK_LLD_BOOTSTRAP:= no 5435e84b765SWarner Losh.endif 5445e84b765SWarner Losh 5455e84b765SWarner Losh.if ${MK_TOOLCHAIN} == "no" 5465e84b765SWarner LoshMK_BINUTILS:= no 5475e84b765SWarner LoshMK_CLANG:= no 5485e84b765SWarner LoshMK_GCC:= no 5495e84b765SWarner LoshMK_GDB:= no 550590461a4SWarner LoshMK_INCLUDES:= no 551e5928414SEd MasteMK_LLD:= no 55211e49977SBryan DreweryMK_LLDB:= no 5535e84b765SWarner Losh.endif 5545e84b765SWarner Losh 5555e84b765SWarner Losh.if ${MK_CLANG} == "no" 5565e84b765SWarner LoshMK_CLANG_EXTRAS:= no 5575e84b765SWarner LoshMK_CLANG_FULL:= no 5581b49115aSEd MasteMK_LLVM_COV:= no 5595e84b765SWarner Losh.endif 5605e84b765SWarner Losh 561b0fefb25SMarcin Wojtas.if ${MK_LOADER_VERIEXEC} == "no" 562b0fefb25SMarcin WojtasMK_LOADER_VERIEXEC_PASS_MANIFEST := no 563b0fefb25SMarcin Wojtas.endif 564b0fefb25SMarcin Wojtas 5655e84b765SWarner Losh# 5664301886dSEnji Cooper# MK_* options whose default value depends on another option. 5674301886dSEnji Cooper# 5684301886dSEnji Cooper.for vv in \ 5694301886dSEnji Cooper GSSAPI/KERBEROS \ 5704301886dSEnji Cooper MAN_UTILS/MAN 5714301886dSEnji Cooper.if defined(WITH_${vv:H}) 5724301886dSEnji CooperMK_${vv:H}:= yes 5734301886dSEnji Cooper.elif defined(WITHOUT_${vv:H}) 5744301886dSEnji CooperMK_${vv:H}:= no 5754301886dSEnji Cooper.else 5764301886dSEnji CooperMK_${vv:H}:= ${MK_${vv:T}} 5774301886dSEnji Cooper.endif 5784301886dSEnji Cooper.endfor 5794301886dSEnji Cooper 5804301886dSEnji Cooper# 5815e84b765SWarner Losh# Set defaults for the MK_*_SUPPORT variables. 5825e84b765SWarner Losh# 5835e84b765SWarner Losh 5845e84b765SWarner Losh.if !${COMPILER_FEATURES:Mc++11} 5855e84b765SWarner LoshMK_LLDB:= no 5865e84b765SWarner Losh.endif 5875e84b765SWarner Losh 588ff2cf368SBaptiste Daroussin# gcc 4.8 and newer supports libc++, so suppress gnuc++ in that case. 589ff2cf368SBaptiste Daroussin# while in theory we could build it with that, we don't want to do 590ff2cf368SBaptiste Daroussin# that since it creates too much confusion for too little gain. 59107394091SBryan Drewery# XXX: This is incomplete and needs X_COMPILER_TYPE/VERSION checks too 59207394091SBryan Drewery# to prevent Makefile.inc1 from bootstrapping unneeded dependencies 59307394091SBryan Drewery# and to support 'make delete-old' when supplying an external toolchain. 594ff2cf368SBaptiste Daroussin.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800 595ff2cf368SBaptiste DaroussinMK_GNUCXX:=no 596ff2cf368SBaptiste DaroussinMK_GCC:=no 5975e84b765SWarner Losh.endif 598ff2cf368SBaptiste Daroussin 599ff2cf368SBaptiste Daroussin.endif # !target(__<src.opts.mk>__) 600