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_LIBPTHREAD} == "no" 304MK_LIBTHR:= no 305.endif 306 307.if ${MK_LDNS} == "no" 308MK_LDNS_UTILS:= no 309MK_UNBOUND:= no 310.endif 311 312.if ${MK_SOURCELESS} == "no" 313MK_SOURCELESS_HOST:= no 314MK_SOURCELESS_UCODE:= no 315.endif 316 317.if ${MK_CDDL} == "no" 318MK_ZFS:= no 319MK_CTF:= no 320.endif 321 322.if ${MK_CRYPT} == "no" 323MK_OPENSSL:= no 324MK_OPENSSH:= no 325MK_KERBEROS:= no 326.endif 327 328.if ${MK_CXX} == "no" 329MK_CLANG:= no 330MK_GROFF:= no 331MK_GNUCXX:= no 332MK_TESTS:= no 333.endif 334 335.if ${MK_DIALOG} == "no" 336MK_BSDINSTALL:= no 337.endif 338 339.if ${MK_MAIL} == "no" 340MK_MAILWRAPPER:= no 341MK_SENDMAIL:= no 342MK_DMAGENT:= no 343.endif 344 345.if ${MK_NETGRAPH} == "no" 346MK_ATM:= no 347MK_BLUETOOTH:= no 348.endif 349 350.if ${MK_OPENSSL} == "no" 351MK_OPENSSH:= no 352MK_KERBEROS:= no 353.endif 354 355.if ${MK_PF} == "no" 356MK_AUTHPF:= no 357.endif 358 359.if ${MK_TESTS} == "no" 360MK_DTRACE_TESTS:= no 361.endif 362 363.if ${MK_TEXTPROC} == "no" 364MK_GROFF:= no 365.endif 366 367.if ${MK_CROSS_COMPILER} == "no" 368MK_BINUTILS_BOOTSTRAP:= no 369MK_CLANG_BOOTSTRAP:= no 370MK_ELFTOOLCHAIN_BOOTSTRAP:= no 371MK_GCC_BOOTSTRAP:= no 372.endif 373 374.if ${MK_TOOLCHAIN} == "no" 375MK_BINUTILS:= no 376MK_CLANG:= no 377MK_GCC:= no 378MK_GDB:= no 379MK_INCLUDES:= no 380MK_LLDB:= no 381.endif 382 383.if ${MK_CLANG} == "no" 384MK_CLANG_EXTRAS:= no 385MK_CLANG_FULL:= no 386.endif 387 388# 389# Set defaults for the MK_*_SUPPORT variables. 390# 391 392# 393# MK_*_SUPPORT options which default to "yes" unless their corresponding 394# MK_* variable is set to "no". 395# 396.for var in \ 397 BLACKLIST \ 398 BZIP2 \ 399 GNU \ 400 INET \ 401 INET6 \ 402 KERBEROS \ 403 KVM \ 404 NETGRAPH \ 405 PAM \ 406 TESTS \ 407 WIRELESS 408.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" 409MK_${var}_SUPPORT:= no 410.else 411MK_${var}_SUPPORT:= yes 412.endif 413.endfor 414 415# 416# MK_* options whose default value depends on another option. 417# 418.for vv in \ 419 GSSAPI/KERBEROS \ 420 MAN_UTILS/MAN 421.if defined(WITH_${vv:H}) 422MK_${vv:H}:= yes 423.elif defined(WITHOUT_${vv:H}) 424MK_${vv:H}:= no 425.else 426MK_${vv:H}:= ${MK_${vv:T}} 427.endif 428.endfor 429 430.if !${COMPILER_FEATURES:Mc++11} 431MK_LLDB:= no 432.endif 433 434# gcc 4.8 and newer supports libc++, so suppress gnuc++ in that case. 435# while in theory we could build it with that, we don't want to do 436# that since it creates too much confusion for too little gain. 437# XXX: This is incomplete and needs X_COMPILER_TYPE/VERSION checks too 438# to prevent Makefile.inc1 from bootstrapping unneeded dependencies 439# and to support 'make delete-old' when supplying an external toolchain. 440.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40800 441MK_GNUCXX:=no 442MK_GCC:=no 443.endif 444 445.endif # !target(__<src.opts.mk>__) 446