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 AMD \ 59 APM \ 60 AT \ 61 ATM \ 62 AUDIT \ 63 AUTHPF \ 64 AUTOFS \ 65 BHYVE \ 66 BINUTILS \ 67 BINUTILS_BOOTSTRAP \ 68 BLACKLIST \ 69 BLUETOOTH \ 70 BOOT \ 71 BOOTPARAMD \ 72 BOOTPD \ 73 BSD_CPIO \ 74 BSDINSTALL \ 75 BSNMP \ 76 BZIP2 \ 77 CALENDAR \ 78 CAPSICUM \ 79 CASPER \ 80 CCD \ 81 CDDL \ 82 CPP \ 83 CROSS_COMPILER \ 84 CRYPT \ 85 CTM \ 86 CUSE \ 87 CXX \ 88 DIALOG \ 89 DICT \ 90 DMAGENT \ 91 DYNAMICROOT \ 92 ED_CRYPTO \ 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 GPIO \ 112 HAST \ 113 HTML \ 114 HYPERV \ 115 ICONV \ 116 INET \ 117 INET6 \ 118 INETD \ 119 IPFILTER \ 120 IPFW \ 121 ISCSI \ 122 JAIL \ 123 KDUMP \ 124 KVM \ 125 LDNS \ 126 LDNS_UTILS \ 127 LEGACY_CONSOLE \ 128 LIB32 \ 129 LIBPTHREAD \ 130 LIBTHR \ 131 LLVM_COV \ 132 LOADER_GELI \ 133 LOADER_OFW \ 134 LOADER_UBOOT \ 135 LOCALES \ 136 LOCATE \ 137 LPR \ 138 LS_COLORS \ 139 LZMA_SUPPORT \ 140 MAIL \ 141 MAILWRAPPER \ 142 MAKE \ 143 NDIS \ 144 NETCAT \ 145 NETGRAPH \ 146 NLS_CATALOGS \ 147 NS_CACHING \ 148 NTP \ 149 OPENSSL \ 150 PAM \ 151 PC_SYSINSTALL \ 152 PF \ 153 PKGBOOTSTRAP \ 154 PMC \ 155 PORTSNAP \ 156 PPP \ 157 QUOTAS \ 158 RADIUS_SUPPORT \ 159 RBOOTD \ 160 RESCUE \ 161 ROUTED \ 162 SENDMAIL \ 163 SERVICESDB \ 164 SETUID_LOGIN \ 165 SHAREDOCS \ 166 SOURCELESS \ 167 SOURCELESS_HOST \ 168 SOURCELESS_UCODE \ 169 SVNLITE \ 170 SYSCONS \ 171 SYSTEM_COMPILER \ 172 SYSTEM_LINKER \ 173 TALK \ 174 TCP_WRAPPERS \ 175 TCSH \ 176 TELNET \ 177 TEXTPROC \ 178 TFTP \ 179 TIMED \ 180 UNBOUND \ 181 USB \ 182 UTMPX \ 183 VI \ 184 VT \ 185 WIRELESS \ 186 WPA_SUPPLICANT_EAPOL \ 187 ZFS \ 188 ZONEINFO 189 190__DEFAULT_NO_OPTIONS = \ 191 BSD_GREP \ 192 CLANG_EXTRAS \ 193 DTRACE_TESTS \ 194 GNU_GREP_COMPAT \ 195 HESIOD \ 196 LIBSOFT \ 197 LOADER_FIREWIRE \ 198 LOADER_FORCE_LE \ 199 LOADER_LUA \ 200 NAND \ 201 OFED \ 202 OPENLDAP \ 203 REPRODUCIBLE_BUILD \ 204 RPCBIND_WARMSTART_SUPPORT \ 205 SHARED_TOOLCHAIN \ 206 SORT_THREADS \ 207 SVN \ 208 ZONEINFO_LEAPSECONDS_SUPPORT \ 209 ZONEINFO_OLD_TIMEZONES_SUPPORT \ 210 211# LEFT/RIGHT. Left options which default to "yes" unless their corresponding 212# RIGHT option is disabled. 213__DEFAULT_DEPENDENT_OPTIONS= \ 214 CLANG_FULL/CLANG \ 215 LLVM_TARGET_ALL/CLANG \ 216 217# MK_*_SUPPORT options which default to "yes" unless their corresponding 218# MK_* variable is set to "no". 219# 220.for var in \ 221 BLACKLIST \ 222 BZIP2 \ 223 INET \ 224 INET6 \ 225 KERBEROS \ 226 KVM \ 227 NETGRAPH \ 228 PAM \ 229 TESTS \ 230 WIRELESS 231__DEFAULT_DEPENDENT_OPTIONS+= ${var}_SUPPORT/${var} 232.endfor 233 234# 235# Default behaviour of some options depends on the architecture. Unfortunately 236# this means that we have to test TARGET_ARCH (the buildworld case) as well 237# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not 238# used at all in bsd.*.mk, but we have to make an exception here if we want 239# to allow defaults for some things like clang to vary by target architecture. 240# Additional, per-target behavior should be rarely added only after much 241# gnashing of teeth and grinding of gears. 242# 243.if defined(TARGET_ARCH) 244__T=${TARGET_ARCH} 245.else 246__T=${MACHINE_ARCH} 247.endif 248.if defined(TARGET) 249__TT=${TARGET} 250.else 251__TT=${MACHINE} 252.endif 253 254# All supported backends for LLVM_TARGET_XXX 255__LLVM_TARGETS= \ 256 aarch64 \ 257 arm \ 258 mips \ 259 powerpc \ 260 sparc \ 261 x86 262__LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/ 263.for __llt in ${__LLVM_TARGETS} 264# Default the given TARGET's LLVM_TARGET support to the value of MK_CLANG. 265.if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} 266__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/CLANG 267# aarch64 needs arm for -m32 support. 268.elif ${__TT} == "arm64" && ${__llt} == "arm" 269__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 270# Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL 271# which is based on MK_CLANG. 272.else 273__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL 274.endif 275.endfor 276 277.include <bsd.compiler.mk> 278# If the compiler is not C++11 capable, disable Clang and use GCC instead. 279# This means that architectures that have GCC 4.2 as default can not 280# build Clang without using an external compiler. 281 282.if ${COMPILER_FEATURES:Mc++11} && (${__T} == "aarch64" || \ 283 ${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386") 284# Clang is enabled, and will be installed as the default /usr/bin/cc. 285__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD 286__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC 287.elif ${COMPILER_FEATURES:Mc++11} && ${__T:Mriscv*} == "" && ${__T} != "sparc64" 288# If an external compiler that supports C++11 is used as ${CC} and Clang 289# supports the target, then Clang is enabled but GCC is installed as the 290# default /usr/bin/cc. 291__DEFAULT_YES_OPTIONS+=CLANG GCC GCC_BOOTSTRAP GNUCXX GPL_DTC LLD 292__DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC 293.else 294# Everything else disables Clang, and uses GCC instead. 295__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC 296__DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD 297.endif 298# In-tree binutils/gcc are older versions without modern architecture support. 299.if ${__T} == "aarch64" || ${__T:Mriscv*} != "" 300BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB 301.endif 302.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ 303 ${__T:Mriscv*} != "" || ${__TT} == "mips" 304__DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND 305.else 306__DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND 307.endif 308.if ${__T} == "aarch64" || ${__T} == "amd64" 309__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD 310.else 311__DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD 312.endif 313.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" 314__DEFAULT_YES_OPTIONS+=LLDB 315.else 316__DEFAULT_NO_OPTIONS+=LLDB 317.endif 318# LLVM lacks support for FreeBSD 64-bit atomic operations for ARMv4/ARMv5 319.if ${__T} == "arm" 320BROKEN_OPTIONS+=LLDB 321.endif 322# GDB in base is generally less functional than GDB in ports. Ports GDB 323# does not yet contain kernel support for arm, and sparc64 kernel support 324# has not been tested. 325.if ${__T:Marm*} != "" || ${__T} == "sparc64" 326__DEFAULT_NO_OPTIONS+=GDB_LIBEXEC 327.else 328__DEFAULT_YES_OPTIONS+=GDB_LIBEXEC 329.endif 330# Only doing soft float API stuff on armv6 and armv7 331.if ${__T} != "armv6" && ${__T} != "armv7" 332BROKEN_OPTIONS+=LIBSOFT 333.endif 334.if ${__T:Mmips*} 335BROKEN_OPTIONS+=SSP 336.endif 337# EFI doesn't exist on mips, powerpc, sparc or riscv. 338.if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*} 339BROKEN_OPTIONS+=EFI 340.endif 341# OFW is only for powerpc and sparc64, exclude others 342.if ${__T:Mpowerpc*} == "" && ${__T:Msparc64} == "" 343BROKEN_OPTIONS+=LOADER_OFW 344.endif 345# UBOOT is only for arm, mips and powerpc, exclude others 346.if ${__T:Marm*} == "" && ${__T:Mmips*} == "" && ${__T:Mpowerpc*} == "" 347BROKEN_OPTIONS+=LOADER_UBOOT 348.endif 349 350.if ${__T:Mmips64*} 351# profiling won't work on MIPS64 because there is only assembly for o32 352BROKEN_OPTIONS+=PROFILE 353.endif 354.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ 355 ${__T} == "powerpc64" || ${__T} == "sparc64" 356__DEFAULT_YES_OPTIONS+=CXGBETOOL 357__DEFAULT_YES_OPTIONS+=MLX5TOOL 358.else 359__DEFAULT_NO_OPTIONS+=CXGBETOOL 360__DEFAULT_NO_OPTIONS+=MLX5TOOL 361.endif 362 363# NVME is only x86 and powerpc64 364.if ${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64" 365__DEFAULT_YES_OPTIONS+=NVME 366.else 367__DEFAULT_NO_OPTIONS+=NVME 368.endif 369 370.include <bsd.mkopt.mk> 371 372# 373# MK_* options that default to "yes" if the compiler is a C++11 compiler. 374# 375.for var in \ 376 LIBCPLUSPLUS 377.if !defined(MK_${var}) 378.if ${COMPILER_FEATURES:Mc++11} 379.if defined(WITHOUT_${var}) 380MK_${var}:= no 381.else 382MK_${var}:= yes 383.endif 384.else 385.if defined(WITH_${var}) 386MK_${var}:= yes 387.else 388MK_${var}:= no 389.endif 390.endif 391.endif 392.endfor 393 394# 395# Force some options off if their dependencies are off. 396# Order is somewhat important. 397# 398.if !${COMPILER_FEATURES:Mc++11} 399MK_LLVM_LIBUNWIND:= no 400.endif 401 402.if ${MK_BINUTILS} == "no" 403MK_GDB:= no 404.endif 405 406.if ${MK_CAPSICUM} == "no" 407MK_CASPER:= no 408.endif 409 410.if ${MK_LIBPTHREAD} == "no" 411MK_LIBTHR:= no 412.endif 413 414.if ${MK_LDNS} == "no" 415MK_LDNS_UTILS:= no 416MK_UNBOUND:= no 417.endif 418 419.if ${MK_SOURCELESS} == "no" 420MK_SOURCELESS_HOST:= no 421MK_SOURCELESS_UCODE:= no 422.endif 423 424.if ${MK_CDDL} == "no" 425MK_ZFS:= no 426MK_CTF:= no 427.endif 428 429.if ${MK_CRYPT} == "no" 430MK_OPENSSL:= no 431MK_OPENSSH:= no 432MK_KERBEROS:= no 433.endif 434 435.if ${MK_CXX} == "no" 436MK_CLANG:= no 437MK_GNUCXX:= no 438MK_TESTS:= no 439.endif 440 441.if ${MK_DIALOG} == "no" 442MK_BSDINSTALL:= no 443.endif 444 445.if ${MK_MAIL} == "no" 446MK_MAILWRAPPER:= no 447MK_SENDMAIL:= no 448MK_DMAGENT:= no 449.endif 450 451.if ${MK_NETGRAPH} == "no" 452MK_ATM:= no 453MK_BLUETOOTH:= no 454.endif 455 456.if ${MK_NLS} == "no" 457MK_NLS_CATALOGS:= no 458.endif 459 460.if ${MK_OPENSSL} == "no" 461MK_OPENSSH:= no 462MK_KERBEROS:= no 463.endif 464 465.if ${MK_PF} == "no" 466MK_AUTHPF:= no 467.endif 468 469.if ${MK_PORTSNAP} == "no" 470# freebsd-update depends on phttpget from portsnap 471MK_FREEBSD_UPDATE:= no 472.endif 473 474.if ${MK_TESTS} == "no" 475MK_DTRACE_TESTS:= no 476.endif 477 478.if ${MK_ZONEINFO} == "no" 479MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no 480MK_ZONEINFO_OLD_TIMEZONES_SUPPORT:= no 481.endif 482 483.if ${MK_CROSS_COMPILER} == "no" 484MK_BINUTILS_BOOTSTRAP:= no 485MK_CLANG_BOOTSTRAP:= no 486MK_ELFTOOLCHAIN_BOOTSTRAP:= no 487MK_GCC_BOOTSTRAP:= no 488MK_LLD_BOOTSTRAP:= no 489.endif 490 491.if ${MK_TOOLCHAIN} == "no" 492MK_BINUTILS:= no 493MK_CLANG:= no 494MK_GCC:= no 495MK_GDB:= no 496MK_INCLUDES:= no 497MK_LLD:= no 498MK_LLDB:= no 499.endif 500 501.if ${MK_CLANG} == "no" 502MK_CLANG_EXTRAS:= no 503MK_CLANG_FULL:= no 504MK_LLVM_COV:= no 505.endif 506 507# 508# MK_* options whose default value depends on another option. 509# 510.for vv in \ 511 GSSAPI/KERBEROS \ 512 MAN_UTILS/MAN 513.if defined(WITH_${vv:H}) 514MK_${vv:H}:= yes 515.elif defined(WITHOUT_${vv:H}) 516MK_${vv:H}:= no 517.else 518MK_${vv:H}:= ${MK_${vv:T}} 519.endif 520.endfor 521 522# 523# Set defaults for the MK_*_SUPPORT variables. 524# 525 526.if !${COMPILER_FEATURES:Mc++11} 527MK_LLDB:= no 528.endif 529 530# gcc 4.8 and newer supports libc++, so suppress gnuc++ in that case. 531# while in theory we could build it with that, we don't want to do 532# that since it creates too much confusion for too little gain. 533# XXX: This is incomplete and needs X_COMPILER_TYPE/VERSION checks too 534# to prevent Makefile.inc1 from bootstrapping unneeded dependencies 535# and to support 'make delete-old' when supplying an external toolchain. 536.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800 537MK_GNUCXX:=no 538MK_GCC:=no 539.endif 540 541.endif # !target(__<src.opts.mk>__) 542