1# $FreeBSD$ 2# 3# Option file for FreeBSD /usr/src builds. 4# 5# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf 6# and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no} 7# with sensible (usually) defaults. 8# 9# Makefiles must include bsd.opts.mk after defining specific MK_FOO options that 10# are applicable for that Makefile (typically there are none, but sometimes there 11# are exceptions). Recursive makes usually add MK_FOO=no for options that they wish 12# to omit from that make. 13# 14# Makefiles must include bsd.mkopt.mk before they test the value of any MK_FOO 15# variable. 16# 17# Makefiles may also assume that this file is included by src.opts.mk should it 18# need variables defined there prior to the end of the Makefile where 19# bsd.{subdir,lib.bin}.mk is traditionally included. 20# 21# The old-style YES_FOO and NO_FOO are being phased out. No new instances of them 22# should be added. Old instances should be removed since they were just to 23# bridge the gap between FreeBSD 4 and FreeBSD 5. 24# 25# Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an 26# exception is made for _WITHOUT_SRCONF which turns off this mechanism 27# completely inside bsd.*.mk files). 28# 29 30.if !target(__<src.opts.mk>__) 31__<src.opts.mk>__: 32 33.include <bsd.own.mk> 34 35# 36# Define MK_* variables (which are either "yes" or "no") for users 37# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the 38# make(1) environment. 39# These should be tested with `== "no"' or `!= "no"' in makefiles. 40# The NO_* variables should only be set by makefiles for variables 41# that haven't been converted over. 42# 43 44# These options are used by the src builds. Those listed in 45# __DEFAULT_YES_OPTIONS default to 'yes' and will build unless turned 46# off. __DEFAULT_NO_OPTIONS will default to 'no' and won't build 47# unless turned on. Any options listed in 'BROKEN_OPTIONS' will be 48# hard-wired to 'no'. "Broken" here means not working or 49# not-appropriate and/or not supported. It doesn't imply something is 50# wrong with the code. There's not a single good word for this, so 51# BROKEN was selected as the least imperfect one considered at the 52# time. Options are added to BROKEN_OPTIONS list on a per-arch basis. 53# At this time, there's no provision for mutually incompatible options. 54 55__DEFAULT_YES_OPTIONS = \ 56 ACCT \ 57 ACPI \ 58 APM \ 59 AT \ 60 ATM \ 61 AUDIT \ 62 AUTHPF \ 63 AUTOFS \ 64 BHYVE \ 65 BINUTILS \ 66 BINUTILS_BOOTSTRAP \ 67 BLACKLIST \ 68 BLUETOOTH \ 69 BOOT \ 70 BOOTPARAMD \ 71 BOOTPD \ 72 BSD_CPIO \ 73 BSD_CRTBEGIN \ 74 BSDINSTALL \ 75 BSNMP \ 76 BZIP2 \ 77 CALENDAR \ 78 CAPSICUM \ 79 CAROOT \ 80 CASPER \ 81 CCD \ 82 CDDL \ 83 CPP \ 84 CROSS_COMPILER \ 85 CRYPT \ 86 CUSE \ 87 CXX \ 88 CXGBETOOL \ 89 DIALOG \ 90 DICT \ 91 DMAGENT \ 92 DYNAMICROOT \ 93 EE \ 94 EFI \ 95 ELFTOOLCHAIN_BOOTSTRAP \ 96 EXAMPLES \ 97 FDT \ 98 FILE \ 99 FINGER \ 100 FLOPPY \ 101 FMTREE \ 102 FORTH \ 103 FP_LIBC \ 104 FREEBSD_UPDATE \ 105 FTP \ 106 GAMES \ 107 GCOV \ 108 GDB \ 109 GNU_DIFF \ 110 GNU_GREP \ 111 GOOGLETEST \ 112 GPIO \ 113 HAST \ 114 HTML \ 115 HYPERV \ 116 ICONV \ 117 INET \ 118 INET6 \ 119 INETD \ 120 IPFILTER \ 121 IPFW \ 122 ISCSI \ 123 JAIL \ 124 KDUMP \ 125 KVM \ 126 LDNS \ 127 LDNS_UTILS \ 128 LEGACY_CONSOLE \ 129 LIBPTHREAD \ 130 LIBTHR \ 131 LLVM_COV \ 132 LLVM_LIBUNWIND \ 133 LLVM_TARGET_ALL \ 134 LOADER_GELI \ 135 LOADER_LUA \ 136 LOADER_OFW \ 137 LOADER_UBOOT \ 138 LOCALES \ 139 LOCATE \ 140 LPR \ 141 LS_COLORS \ 142 LZMA_SUPPORT \ 143 MAIL \ 144 MAILWRAPPER \ 145 MAKE \ 146 MLX5TOOL \ 147 NDIS \ 148 NETCAT \ 149 NETGRAPH \ 150 NLS_CATALOGS \ 151 NS_CACHING \ 152 NTP \ 153 NVME \ 154 OFED \ 155 OPENSSL \ 156 PAM \ 157 PF \ 158 PKGBOOTSTRAP \ 159 PMC \ 160 PORTSNAP \ 161 PPP \ 162 QUOTAS \ 163 RADIUS_SUPPORT \ 164 RBOOTD \ 165 RESCUE \ 166 ROUTED \ 167 SENDMAIL \ 168 SERVICESDB \ 169 SETUID_LOGIN \ 170 SHARED_TOOLCHAIN \ 171 SHAREDOCS \ 172 SOURCELESS \ 173 SOURCELESS_HOST \ 174 SOURCELESS_UCODE \ 175 STATS \ 176 SVNLITE \ 177 SYSCONS \ 178 SYSTEM_COMPILER \ 179 SYSTEM_LINKER \ 180 TALK \ 181 TCP_WRAPPERS \ 182 TCSH \ 183 TELNET \ 184 TEXTPROC \ 185 TFTP \ 186 UNBOUND \ 187 USB \ 188 UTMPX \ 189 VI \ 190 VT \ 191 WIRELESS \ 192 WPA_SUPPLICANT_EAPOL \ 193 ZFS \ 194 LOADER_ZFS \ 195 ZONEINFO 196 197__DEFAULT_NO_OPTIONS = \ 198 AMD \ 199 BEARSSL \ 200 BSD_GREP \ 201 CLANG_EXTRAS \ 202 DTRACE_TESTS \ 203 EXPERIMENTAL \ 204 GCC \ 205 GCC_BOOTSTRAP \ 206 GNUCXX \ 207 GNU_GREP_COMPAT \ 208 GPL_DTC \ 209 HESIOD \ 210 HTTPD \ 211 LIBSOFT \ 212 LOADER_FIREWIRE \ 213 LOADER_FORCE_LE \ 214 LOADER_VERBOSE \ 215 LOADER_VERIEXEC_PASS_MANIFEST \ 216 OFED_EXTRA \ 217 OPENLDAP \ 218 REPRODUCIBLE_BUILD \ 219 RPCBIND_WARMSTART_SUPPORT \ 220 SORT_THREADS \ 221 SVN \ 222 ZONEINFO_LEAPSECONDS_SUPPORT \ 223 ZONEINFO_OLD_TIMEZONES_SUPPORT \ 224 225# LEFT/RIGHT. Left options which default to "yes" unless their corresponding 226# RIGHT option is disabled. 227__DEFAULT_DEPENDENT_OPTIONS= \ 228 CLANG_FULL/CLANG \ 229 LOADER_VERIEXEC/BEARSSL \ 230 LOADER_EFI_SECUREBOOT/LOADER_VERIEXEC \ 231 VERIEXEC/BEARSSL \ 232 233# MK_*_SUPPORT options which default to "yes" unless their corresponding 234# MK_* variable is set to "no". 235# 236.for var in \ 237 BLACKLIST \ 238 BZIP2 \ 239 INET \ 240 INET6 \ 241 KERBEROS \ 242 KVM \ 243 NETGRAPH \ 244 PAM \ 245 TESTS \ 246 WIRELESS 247__DEFAULT_DEPENDENT_OPTIONS+= ${var}_SUPPORT/${var} 248.endfor 249 250# 251# Default behaviour of some options depends on the architecture. Unfortunately 252# this means that we have to test TARGET_ARCH (the buildworld case) as well 253# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not 254# used at all in bsd.*.mk, but we have to make an exception here if we want 255# to allow defaults for some things like clang to vary by target architecture. 256# Additional, per-target behavior should be rarely added only after much 257# gnashing of teeth and grinding of gears. 258# 259.if defined(TARGET_ARCH) 260__T=${TARGET_ARCH} 261.else 262__T=${MACHINE_ARCH} 263.endif 264.if defined(TARGET) 265__TT=${TARGET} 266.else 267__TT=${MACHINE} 268.endif 269 270# All supported backends for LLVM_TARGET_XXX 271__LLVM_TARGETS= \ 272 aarch64 \ 273 arm \ 274 mips \ 275 powerpc \ 276 riscv \ 277 sparc \ 278 x86 279__LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/:S/powerpc64/powerpc/ 280.for __llt in ${__LLVM_TARGETS} 281# Default enable the given TARGET's LLVM_TARGET support 282.if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} 283__DEFAULT_YES_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu} 284# aarch64 needs arm for -m32 support. 285.elif ${__TT} == "arm64" && ${__llt} == "arm" 286__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 287# Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL. 288.else 289__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL 290.endif 291.endfor 292 293__DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF 294 295.include <bsd.compiler.mk> 296# If the compiler is not C++11 capable, disable Clang. External toolchain will 297# be required. 298 299.if ${COMPILER_FEATURES:Mc++11} && (${__TT} != "mips" && ${__TT} != "sparc64") 300# Clang is enabled, and will be installed as the default /usr/bin/cc. 301__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD 302.elif ${COMPILER_FEATURES:Mc++11} && ${__T} != "sparc64" 303# If an external compiler that supports C++11 is used as ${CC} and Clang 304# supports the target, then Clang is enabled but we still require an external 305# toolchain. 306# default /usr/bin/cc. 307__DEFAULT_YES_OPTIONS+=CLANG LLD 308__DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC 309.else 310# Everything else disables Clang, and uses GCC instead. 311__DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD 312.endif 313# In-tree binutils/gcc are older versions without modern architecture support. 314.if ${__T} == "aarch64" || ${__T:Mriscv*} != "" 315BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB 316.endif 317.if ${__T:Mriscv*} != "" 318BROKEN_OPTIONS+=OFED 319.endif 320.if ${__TT} != "mips" && ${__T} != "powerpc" && ${__T} != "powerpcspe" && \ 321 ${__T} != "sparc64" 322__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD 323.else 324__DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD 325.endif 326.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" 327__DEFAULT_YES_OPTIONS+=LLDB 328.else 329__DEFAULT_NO_OPTIONS+=LLDB 330.endif 331# GDB in base is generally less functional than GDB in ports. Ports GDB 332# sparc64 kernel support has not been tested. 333.if ${__T} == "sparc64" 334__DEFAULT_NO_OPTIONS+=GDB_LIBEXEC 335.else 336__DEFAULT_YES_OPTIONS+=GDB_LIBEXEC 337.endif 338# LIB32 is supported on amd64, mips64, and powerpc64 339.if (${__T} == "amd64" || ${__T:Mmips64*} || ${__T} == "powerpc64") 340__DEFAULT_YES_OPTIONS+=LIB32 341.else 342BROKEN_OPTIONS+=LIB32 343.endif 344# Only doing soft float API stuff on armv6 and armv7 345.if ${__T} != "armv6" && ${__T} != "armv7" 346BROKEN_OPTIONS+=LIBSOFT 347.endif 348.if ${__T:Mmips*} 349BROKEN_OPTIONS+=SSP 350.endif 351# EFI doesn't exist on mips, powerpc, sparc or riscv. 352.if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*} 353BROKEN_OPTIONS+=EFI 354.endif 355# OFW is only for powerpc and sparc64, exclude others 356.if ${__T:Mpowerpc*} == "" && ${__T:Msparc64} == "" 357BROKEN_OPTIONS+=LOADER_OFW 358.endif 359# UBOOT is only for arm, mips and powerpc, exclude others 360.if ${__T:Marm*} == "" && ${__T:Mmips*} == "" && ${__T:Mpowerpc*} == "" 361BROKEN_OPTIONS+=LOADER_UBOOT 362.endif 363# GELI and Lua in loader currently cause boot failures on sparc64 and powerpc. 364# Further debugging is required -- probably they are just broken on big 365# endian systems generically (they jump to null pointers or try to read 366# crazy high addresses, which is typical of endianness problems). 367.if ${__T} == "sparc64" || ${__T:Mpowerpc*} 368BROKEN_OPTIONS+=LOADER_GELI LOADER_LUA 369.endif 370 371.if ${__T:Mmips64*} 372# profiling won't work on MIPS64 because there is only assembly for o32 373BROKEN_OPTIONS+=PROFILE 374.endif 375.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \ 376 ${__T} != "powerpc64" && ${__T} != "sparc64" 377BROKEN_OPTIONS+=CXGBETOOL 378BROKEN_OPTIONS+=MLX5TOOL 379.endif 380 381# HyperV is currently x86-only 382.if ${__T} != "amd64" && ${__T} != "i386" 383BROKEN_OPTIONS+=HYPERV 384.endif 385 386# NVME is only aarch64, x86 and powerpc64 387.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && \ 388 ${__T} != "powerpc64" 389BROKEN_OPTIONS+=NVME 390.endif 391 392.if ${__T:Msparc64} 393# Sparc64 need extra crt*.o files - PR 239851 394BROKEN_OPTIONS+=BSD_CRTBEGIN 395# PR 233405 396BROKEN_OPTIONS+=LLVM_LIBUNWIND 397.endif 398 399.if ${COMPILER_FEATURES:Mc++11} && \ 400 (${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64") 401__DEFAULT_YES_OPTIONS+=OPENMP 402.else 403__DEFAULT_NO_OPTIONS+=OPENMP 404.endif 405 406.include <bsd.mkopt.mk> 407 408# 409# MK_* options that default to "yes" if the compiler is a C++11 compiler. 410# 411.for var in \ 412 LIBCPLUSPLUS 413.if !defined(MK_${var}) 414.if ${COMPILER_FEATURES:Mc++11} 415.if defined(WITHOUT_${var}) 416MK_${var}:= no 417.else 418MK_${var}:= yes 419.endif 420.else 421.if defined(WITH_${var}) 422MK_${var}:= yes 423.else 424MK_${var}:= no 425.endif 426.endif 427.endif 428.endfor 429 430# 431# Force some options off if their dependencies are off. 432# Order is somewhat important. 433# 434.if !${COMPILER_FEATURES:Mc++11} 435MK_GOOGLETEST:= no 436MK_LLVM_LIBUNWIND:= no 437.endif 438 439.if ${MK_CAPSICUM} == "no" 440MK_CASPER:= no 441.endif 442 443.if ${MK_LIBPTHREAD} == "no" 444MK_LIBTHR:= no 445.endif 446 447.if ${MK_SOURCELESS} == "no" 448MK_SOURCELESS_HOST:= no 449MK_SOURCELESS_UCODE:= no 450.endif 451 452.if ${MK_CDDL} == "no" 453MK_ZFS:= no 454MK_LOADER_ZFS:= no 455MK_CTF:= no 456.endif 457 458.if ${MK_CRYPT} == "no" 459MK_OPENSSL:= no 460MK_OPENSSH:= no 461MK_KERBEROS:= no 462MK_KERBEROS_SUPPORT:= no 463.endif 464 465.if ${MK_CXX} == "no" 466MK_CLANG:= no 467MK_GNUCXX:= no 468MK_GOOGLETEST:= no 469MK_TESTS:= no 470.endif 471 472.if ${MK_DIALOG} == "no" 473MK_BSDINSTALL:= no 474.endif 475 476.if ${MK_FILE} == "no" 477MK_SVNLITE:= no 478.endif 479 480.if (${__TT} == "mips" || ${__TT} == "sparc64") && ${MK_GCC} == "no" 481MK_BINUTILS_BOOTSTRAP:= no 482.endif 483 484.if ${MK_MAIL} == "no" 485MK_MAILWRAPPER:= no 486MK_SENDMAIL:= no 487MK_DMAGENT:= no 488.endif 489 490.if ${MK_NETGRAPH} == "no" 491MK_ATM:= no 492MK_BLUETOOTH:= no 493.endif 494 495.if ${MK_NLS} == "no" 496MK_NLS_CATALOGS:= no 497.endif 498 499.if ${MK_OPENSSL} == "no" 500MK_OPENSSH:= no 501MK_KERBEROS:= no 502MK_KERBEROS_SUPPORT:= no 503MK_LDNS:= no 504.endif 505 506.if ${MK_LDNS} == "no" 507MK_LDNS_UTILS:= no 508MK_UNBOUND:= no 509.endif 510 511.if ${MK_PF} == "no" 512MK_AUTHPF:= no 513.endif 514 515.if ${MK_OFED} == "no" 516MK_OFED_EXTRA:= no 517.endif 518 519.if ${MK_PORTSNAP} == "no" 520# freebsd-update depends on phttpget from portsnap 521MK_FREEBSD_UPDATE:= no 522.endif 523 524.if ${MK_TESTS} == "no" 525MK_DTRACE_TESTS:= no 526.endif 527 528.if ${MK_TESTS_SUPPORT} == "no" 529MK_GOOGLETEST:= no 530.endif 531 532.if ${MK_ZONEINFO} == "no" 533MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no 534MK_ZONEINFO_OLD_TIMEZONES_SUPPORT:= no 535.endif 536 537.if ${MK_CROSS_COMPILER} == "no" 538MK_BINUTILS_BOOTSTRAP:= no 539MK_CLANG_BOOTSTRAP:= no 540MK_ELFTOOLCHAIN_BOOTSTRAP:= no 541MK_GCC_BOOTSTRAP:= no 542MK_LLD_BOOTSTRAP:= no 543.endif 544 545.if ${MK_TOOLCHAIN} == "no" 546MK_BINUTILS:= no 547MK_CLANG:= no 548MK_GCC:= no 549MK_GDB:= no 550MK_INCLUDES:= no 551MK_LLD:= no 552MK_LLDB:= no 553.endif 554 555.if ${MK_CLANG} == "no" 556MK_CLANG_EXTRAS:= no 557MK_CLANG_FULL:= no 558MK_LLVM_COV:= no 559.endif 560 561.if ${MK_LOADER_VERIEXEC} == "no" 562MK_LOADER_VERIEXEC_PASS_MANIFEST := no 563.endif 564 565# 566# MK_* options whose default value depends on another option. 567# 568.for vv in \ 569 GSSAPI/KERBEROS \ 570 MAN_UTILS/MAN 571.if defined(WITH_${vv:H}) 572MK_${vv:H}:= yes 573.elif defined(WITHOUT_${vv:H}) 574MK_${vv:H}:= no 575.else 576MK_${vv:H}:= ${MK_${vv:T}} 577.endif 578.endfor 579 580# 581# Set defaults for the MK_*_SUPPORT variables. 582# 583 584.if !${COMPILER_FEATURES:Mc++11} 585MK_LLDB:= no 586.endif 587 588# gcc 4.8 and newer supports libc++, so suppress gnuc++ in that case. 589# while in theory we could build it with that, we don't want to do 590# that since it creates too much confusion for too little gain. 591# XXX: This is incomplete and needs X_COMPILER_TYPE/VERSION checks too 592# to prevent Makefile.inc1 from bootstrapping unneeded dependencies 593# and to support 'make delete-old' when supplying an external toolchain. 594.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800 595MK_GNUCXX:=no 596MK_GCC:=no 597.endif 598 599.endif # !target(__<src.opts.mk>__) 600