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 src the builds 45 46__DEFAULT_YES_OPTIONS = \ 47 ACCT \ 48 ACPI \ 49 AMD \ 50 APM \ 51 AT \ 52 ATM \ 53 AUDIT \ 54 AUTHPF \ 55 AUTOFS \ 56 BHYVE \ 57 BINUTILS \ 58 BINUTILS_BOOTSTRAP \ 59 BLACKLIST \ 60 BLUETOOTH \ 61 BOOT \ 62 BOOTPARAMD \ 63 BOOTPD \ 64 BSD_CPIO \ 65 BSDINSTALL \ 66 BSNMP \ 67 BZIP2 \ 68 CALENDAR \ 69 CAPSICUM \ 70 CASPER \ 71 CCD \ 72 CDDL \ 73 CPP \ 74 CROSS_COMPILER \ 75 CRYPT \ 76 CTM \ 77 CUSE \ 78 CXX \ 79 DIALOG \ 80 DICT \ 81 DMAGENT \ 82 DYNAMICROOT \ 83 ED_CRYPTO \ 84 EE \ 85 EFI \ 86 ELFTOOLCHAIN_BOOTSTRAP \ 87 EXAMPLES \ 88 FDT \ 89 FILE \ 90 FINGER \ 91 FLOPPY \ 92 FMTREE \ 93 FORTH \ 94 FP_LIBC \ 95 FREEBSD_UPDATE \ 96 FTP \ 97 GAMES \ 98 GCOV \ 99 GDB \ 100 GNU \ 101 GNU_GREP_COMPAT \ 102 GPIO \ 103 GPL_DTC \ 104 GROFF \ 105 HAST \ 106 HTML \ 107 HYPERV \ 108 ICONV \ 109 INET \ 110 INET6 \ 111 INETD \ 112 IPFILTER \ 113 IPFW \ 114 ISCSI \ 115 JAIL \ 116 KDUMP \ 117 KVM \ 118 LDNS \ 119 LDNS_UTILS \ 120 LEGACY_CONSOLE \ 121 LIB32 \ 122 LIBPTHREAD \ 123 LIBTHR \ 124 LOCALES \ 125 LOCATE \ 126 LPR \ 127 LS_COLORS \ 128 LZMA_SUPPORT \ 129 MAIL \ 130 MAILWRAPPER \ 131 MAKE \ 132 MANDOCDB \ 133 NDIS \ 134 NETCAT \ 135 NETGRAPH \ 136 NLS_CATALOGS \ 137 NS_CACHING \ 138 NTP \ 139 OPENSSL \ 140 PAM \ 141 PC_SYSINSTALL \ 142 PF \ 143 PKGBOOTSTRAP \ 144 PMC \ 145 PORTSNAP \ 146 PPP \ 147 QUOTAS \ 148 RADIUS_SUPPORT \ 149 RCMDS \ 150 RBOOTD \ 151 RESCUE \ 152 ROUTED \ 153 SENDMAIL \ 154 SETUID_LOGIN \ 155 SHAREDOCS \ 156 SOURCELESS \ 157 SOURCELESS_HOST \ 158 SOURCELESS_UCODE \ 159 SVNLITE \ 160 SYSCONS \ 161 SYSTEM_COMPILER \ 162 TALK \ 163 TCP_WRAPPERS \ 164 TCSH \ 165 TELNET \ 166 TESTS \ 167 TEXTPROC \ 168 TFTP \ 169 TIMED \ 170 UNBOUND \ 171 USB \ 172 UTMPX \ 173 VI \ 174 VT \ 175 WIRELESS \ 176 WPA_SUPPLICANT_EAPOL \ 177 ZFS \ 178 ZONEINFO 179 180__DEFAULT_NO_OPTIONS = \ 181 BSD_GREP \ 182 CLANG_EXTRAS \ 183 DTRACE_TESTS \ 184 EISA \ 185 HESIOD \ 186 LIBSOFT \ 187 NAND \ 188 OFED \ 189 OPENLDAP \ 190 RCS \ 191 SHARED_TOOLCHAIN \ 192 SORT_THREADS \ 193 SVN \ 194 195 196# 197# Default behaviour of some options depends on the architecture. Unfortunately 198# this means that we have to test TARGET_ARCH (the buildworld case) as well 199# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not 200# used at all in bsd.*.mk, but we have to make an exception here if we want 201# to allow defaults for some things like clang to vary by target architecture. 202# Additional, per-target behavior should be rarely added only after much 203# gnashing of teeth and grinding of gears. 204# 205.if defined(TARGET_ARCH) 206__T=${TARGET_ARCH} 207.else 208__T=${MACHINE_ARCH} 209.endif 210.if defined(TARGET) 211__TT=${TARGET} 212.else 213__TT=${MACHINE} 214.endif 215 216.include <bsd.compiler.mk> 217# If the compiler is not C++11 capable, disable Clang and use GCC instead. 218# This means that architectures that have GCC 4.2 as default can not 219# build Clang without using an external compiler. 220 221.if ${COMPILER_FEATURES:Mc++11} && (${__T} == "aarch64" || \ 222 ${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386") 223# Clang is enabled, and will be installed as the default /usr/bin/cc. 224__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC 225__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX 226.elif ${COMPILER_FEATURES:Mc++11} && ${__T:Mpowerpc*} 227# On powerpc, if an external compiler that supports C++11 is used as ${CC}, 228# then Clang is enabled, but GCC is installed as the default /usr/bin/cc. 229__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL GCC GCC_BOOTSTRAP GNUCXX 230__DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC 231.else 232# Everything else disables Clang, and uses GCC instead. 233__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX 234__DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC 235.endif 236# In-tree binutils/gcc are older versions without modern architecture support. 237.if ${__T} == "aarch64" || ${__T} == "riscv64" 238BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB 239.endif 240.if ${__T} == "riscv64" 241BROKEN_OPTIONS+=PROFILE # "sorry, unimplemented: profiler support for RISC-V" 242BROKEN_OPTIONS+=TESTS # "undefined reference to `_Unwind_Resume'" 243BROKEN_OPTIONS+=CXX # "libcxxrt.so: undefined reference to `_Unwind_Resume_or_Rethrow'" 244.endif 245.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ 246 ${__T} == "riscv64" 247__DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND 248.else 249__DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND 250.endif 251.if ${__T} == "aarch64" || ${__T} == "amd64" 252__DEFAULT_YES_OPTIONS+=LLDB 253.else 254__DEFAULT_NO_OPTIONS+=LLDB 255.endif 256# LLVM lacks support for FreeBSD 64-bit atomic operations for ARMv4/ARMv5 257.if ${__T} == "arm" || ${__T} == "armeb" 258BROKEN_OPTIONS+=LLDB 259.endif 260# Only doing soft float API stuff on armv6 261.if ${__T} != "armv6" 262BROKEN_OPTIONS+=LIBSOFT 263.endif 264.if ${__T:Mmips*} 265BROKEN_OPTIONS+=SSP 266.endif 267.if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*} 268BROKEN_OPTIONS+=EFI 269.endif 270 271.include <bsd.mkopt.mk> 272 273# 274# MK_* options that default to "yes" if the compiler is a C++11 compiler. 275# 276.for var in \ 277 LIBCPLUSPLUS 278.if !defined(MK_${var}) 279.if ${COMPILER_FEATURES:Mc++11} 280.if defined(WITHOUT_${var}) 281MK_${var}:= no 282.else 283MK_${var}:= yes 284.endif 285.else 286.if defined(WITH_${var}) 287MK_${var}:= yes 288.else 289MK_${var}:= no 290.endif 291.endif 292.endif 293.endfor 294 295# 296# Force some options off if their dependencies are off. 297# Order is somewhat important. 298# 299.if !${COMPILER_FEATURES:Mc++11} 300MK_LLVM_LIBUNWIND:= no 301.endif 302 303.if ${MK_BINUTILS} == "no" 304MK_GDB:= no 305.endif 306 307.if ${MK_LIBPTHREAD} == "no" 308MK_LIBTHR:= no 309.endif 310 311.if ${MK_LDNS} == "no" 312MK_LDNS_UTILS:= no 313MK_UNBOUND:= no 314.endif 315 316.if ${MK_SOURCELESS} == "no" 317MK_SOURCELESS_HOST:= no 318MK_SOURCELESS_UCODE:= no 319.endif 320 321.if ${MK_CDDL} == "no" 322MK_ZFS:= no 323MK_CTF:= no 324.endif 325 326.if ${MK_CRYPT} == "no" 327MK_OPENSSL:= no 328MK_OPENSSH:= no 329MK_KERBEROS:= no 330.endif 331 332.if ${MK_CXX} == "no" 333MK_CLANG:= no 334MK_GROFF:= no 335MK_GNUCXX:= no 336MK_TESTS:= no 337.endif 338 339.if ${MK_DIALOG} == "no" 340MK_BSDINSTALL:= no 341.endif 342 343.if ${MK_MAIL} == "no" 344MK_MAILWRAPPER:= no 345MK_SENDMAIL:= no 346MK_DMAGENT:= no 347.endif 348 349.if ${MK_NETGRAPH} == "no" 350MK_ATM:= no 351MK_BLUETOOTH:= no 352.endif 353 354.if ${MK_OPENSSL} == "no" 355MK_OPENSSH:= no 356MK_KERBEROS:= no 357.endif 358 359.if ${MK_PF} == "no" 360MK_AUTHPF:= no 361.endif 362 363.if ${MK_TESTS} == "no" 364MK_DTRACE_TESTS:= no 365.endif 366 367.if ${MK_TEXTPROC} == "no" 368MK_GROFF:= no 369.endif 370 371.if ${MK_CROSS_COMPILER} == "no" 372MK_BINUTILS_BOOTSTRAP:= no 373MK_CLANG_BOOTSTRAP:= no 374MK_ELFTOOLCHAIN_BOOTSTRAP:= no 375MK_GCC_BOOTSTRAP:= no 376.endif 377 378.if ${MK_TOOLCHAIN} == "no" 379MK_BINUTILS:= no 380MK_CLANG:= no 381MK_GCC:= no 382MK_GDB:= no 383MK_INCLUDES:= no 384MK_LLDB:= no 385.endif 386 387.if ${MK_CLANG} == "no" 388MK_CLANG_EXTRAS:= no 389MK_CLANG_FULL:= no 390.endif 391 392# 393# Set defaults for the MK_*_SUPPORT variables. 394# 395 396# 397# MK_*_SUPPORT options which default to "yes" unless their corresponding 398# MK_* variable is set to "no". 399# 400.for var in \ 401 BLACKLIST \ 402 BZIP2 \ 403 GNU \ 404 INET \ 405 INET6 \ 406 KERBEROS \ 407 KVM \ 408 NETGRAPH \ 409 PAM \ 410 TESTS \ 411 WIRELESS 412.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" 413MK_${var}_SUPPORT:= no 414.else 415MK_${var}_SUPPORT:= yes 416.endif 417.endfor 418 419# 420# MK_* options whose default value depends on another option. 421# 422.for vv in \ 423 GSSAPI/KERBEROS \ 424 MAN_UTILS/MAN 425.if defined(WITH_${vv:H}) 426MK_${vv:H}:= yes 427.elif defined(WITHOUT_${vv:H}) 428MK_${vv:H}:= no 429.else 430MK_${vv:H}:= ${MK_${vv:T}} 431.endif 432.endfor 433 434.if !${COMPILER_FEATURES:Mc++11} 435MK_LLDB:= no 436.endif 437 438# gcc 4.8 and newer supports libc++, so suppress gnuc++ in that case. 439# while in theory we could build it with that, we don't want to do 440# that since it creates too much confusion for too little gain. 441# XXX: This is incomplete and needs X_COMPILER_TYPE/VERSION checks too 442# to prevent Makefile.inc1 from bootstrapping unneeded dependencies 443# and to support 'make delete-old' when supplying an external toolchain. 444.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800 445MK_GNUCXX:=no 446MK_GCC:=no 447.endif 448 449.endif # !target(__<src.opts.mk>__) 450