freebsd-skq/tools/build/options
Bryan Drewery cf1eeb33be Add a FAST_DEPEND option, off by default, which speeds up the build significantly.
This speeds up buildworld by 16% on my system and buildkernel by 35%.

Rather than calling mkdep(1), which is just a wrapper around 'cc -E',
use the modern -MD -MT -MF flags to gather and generate dependencies during
compilation.  This flag was introduced in GCC "a long time ago", in GCC 3.0,
and is also supported by Clang.  (It appears that ICC also supports this but I
do not have access to test it).  This avoids running the preprocessor *twice*
for every build, in both 'make depend' and 'make all'.  This is especially
noticeable when using ccache since it does not cache preprocessor results from
mkdep(1) / 'cc -E', but still speeds up compilation with the -MD flags.

For 'make depend' a tree-walk is still done to ensure that all DPSRCS
are generated when expected, and that beforedepend/afterdepend and
_EXTRADEPEND are all still respected.  In time this may change but for now
I've been conservative.  The time for a tree-walk with -j combined with
SUBDIR_PARALLEL is not significant.  For example, it takes about 9 seconds
with -j15 to walk all of src/ for 'make depend' now on my system.

A .depend file is still generated with the various rules that apply to
the final target, or custom rules.  Otherwise there are now
per-built-object-file .depend files, such as .depend.filename.o.  These
are included directly by make rather than populating .depend with a loop
and .depend lines, which only added overhead to the now almost-NOP 'make
depend' phase.

Before this I experimented with having mkdep(1) called in parallel per-file.
While this improved the kernel and lib/libc 'make depend' phase, it resulted
in slower build times overall.

The -M flags are removed from CFLAGS when linking since they have no effect.

Enabling this by default, for src or out-of-src, can be done once more testing
has been done, such as a ports exp-run, and with more compilers.

The system I used for testing was:
  WITNESS
  Build options: -j20 WITH_LLDB=yes WITH_DEBUG_FILES=yes WITH_FAST_DEPEND=yes
  DISK: ZFS 3-way mirror with very slow disks using SSD l2arc/log.
        The arc was fully populated with src tree files.
  RAM: 76GiB
  CPU: Intel(R) Xeon(R) CPU L5520 @2.27GHz
       2 package(s) x 4 core(s) x 2 SMT threads = hw.ncpu=16

buildworld:
  x buildworld-before
  + buildworld-fastdep
  +-------------------------------------------------------------------------------+
  |+                                                                              |
  |+                                                                              |
  |+                                                                       xx    x|
  |                                                                       |_MA___||
  |A                                                                              |
  +-------------------------------------------------------------------------------+
      N           Min           Max        Median           Avg        Stddev
  x   3       3744.13       3794.31       3752.25     3763.5633     26.935139
  +   3       3153.34       3155.16        3154.2     3154.2333    0.91045776
  Difference at 95.0% confidence
          -609.33 +/- 43.1943
          -16.1902% +/- 1.1477%
          (Student's t, pooled s = 19.0569)

buildkernel:
  x buildkernel-before
  + buildkernel-fastdep
  +-------------------------------------------------------------------------------+
  |+                                                                            x |
  |++                                                                           xx|
  |                                                                             A||
  |A|                                                                             |
  +-------------------------------------------------------------------------------+
      N           Min           Max        Median           Avg        Stddev
  x   3        571.57        573.94        571.79     572.43333     1.3094401
  +   3        369.12        370.57         369.3     369.66333    0.79033748
  Difference at 95.0% confidence
          -202.77 +/- 2.45131
          -35.4225% +/- 0.428227%
          (Student's t, pooled s = 1.0815)

Sponsored by:	EMC / Isilon Storage Division
MFC after:	3 weeks
Relnotes:	yes
2015-11-06 04:45:29 +00:00
..
makeman makeman: Fix handling of env-only vars by using SRC_ENV_CONF rather than SRCCONF. 2015-09-17 22:04:46 +00:00
WITH_AUTO_OBJ Fix generation of src.conf.5 2015-06-22 20:21:57 +00:00
WITH_BSD_GREP Build and install a BSD licensed grep. 2011-05-25 01:04:12 +00:00
WITH_CLANG Separate out enabling building clang and/or gcc for the system and 2014-04-18 17:03:58 +00:00
WITH_CLANG_BOOTSTRAP Separate out enabling building clang and/or gcc for the system and 2014-04-18 17:03:58 +00:00
WITH_CLANG_EXTRAS Add a WITH_CLANG_EXTRAS option for src.conf(5), disabled by default, 2012-02-05 23:56:22 +00:00
WITH_CLANG_FULL Pull in r170135 from upstream clang trunk: 2013-02-02 22:28:29 +00:00
WITH_CLANG_IS_CC Regenerate src.conf(5) for mdoc(7) and typo corrections. 2012-05-12 16:12:36 +00:00
WITH_CTF Add WITH_CTF description. 2011-11-30 18:22:44 +00:00
WITH_DEBUG_FILES Add a new knob WITH_DEBUG_FILES to control the building of standalone 2013-06-07 21:40:02 +00:00
WITH_DIRDEPS_CACHE Fix generation of src.conf.5 2015-06-22 20:21:57 +00:00
WITH_DTRACE_TESTS Add a src.conf option to build and install the DTrace test suite. 2015-08-02 00:37:33 +00:00
WITH_EISA Don't build EISA by default anymore. Remove from i386 GENERIC and 2014-04-18 16:53:06 +00:00
WITH_ELFCOPY_AS_OBJCOPY Allow ELF Tool Chain elfcopy to be installed as objcopy 2015-07-29 18:45:38 +00:00
WITH_FAST_DEPEND Add a FAST_DEPEND option, off by default, which speeds up the build significantly. 2015-11-06 04:45:29 +00:00
WITH_FDT - There now exist options that have different defaults depending on 2011-05-10 11:14:40 +00:00
WITH_FMAKE Whitespace cleanup to fix rendering nits in 2014-11-26 20:43:09 +00:00
WITH_GCC Add WITH_GCC alongside WITHOUT_GCC. 2013-09-06 20:49:48 +00:00
WITH_GCC_BOOTSTRAP Separate out enabling building clang and/or gcc for the system and 2014-04-18 17:03:58 +00:00
WITH_GNUCXX On platforms where clang is the default compiler, don't build gcc or libstdc++. 2013-09-06 20:08:03 +00:00
WITH_GPL_DTC Add missing src.conf(5) fragments for WITHOUT_LIBCPLUSPLUS and WITH_GPL_DTC. 2013-02-02 22:42:46 +00:00
WITH_HESIOD
WITH_INSTALL_AS_USER Add description for INSTALL_AS_USER 2012-07-02 20:24:01 +00:00
WITH_LIBCPLUSPLUS Add WITH_LIBCPLUSPLUS under tools/build/options; the knob itself was 2011-11-28 17:56:46 +00:00
WITH_LLDB Add LLDB bmake infrastructure 2013-09-20 01:52:02 +00:00
WITH_META_FILES Fix generation of src.conf.5 2015-06-22 20:21:57 +00:00
WITH_META_MODE Document NO_DIRDEPS for META_MODE and give link to full details. 2015-09-18 22:22:32 +00:00
WITH_NAND Import work done under project/nand (@235533) into head. 2012-05-17 10:11:18 +00:00
WITH_OFED Added description for WITH_OFED. 2011-05-17 11:06:41 +00:00
WITH_OPENLDAP Use MK_OPENLDAP in preference to WITH_OPENLDAP and make it a default 2014-04-24 23:17:31 +00:00
WITH_OPENSSH_NONE_CIPHER Add a src.conf(5) option to allow users to compile in the "NONE cipher", 2013-01-17 01:51:04 +00:00
WITH_SHARED_TOOLCHAIN Regenerate src.conf(5) for mdoc(7) and typo corrections. 2012-05-12 16:12:36 +00:00
WITH_SORT_THREADS Document upcoming build option WITH_SORT_THREADS 2014-04-05 18:00:45 +00:00
WITH_STAGING Fix generation of src.conf.5 2015-06-22 20:21:57 +00:00
WITH_STAGING_MAN Fix generation of src.conf.5 2015-06-22 20:21:57 +00:00
WITH_STAGING_PROG Fix generation of src.conf.5 2015-06-22 20:21:57 +00:00
WITH_STALE_STAGED Fix generation of src.conf.5 2015-06-22 20:21:57 +00:00
WITH_SVN Document WITHOUT_SVNLITE and WITH_SVN. 2013-07-03 12:36:47 +00:00
WITH_SYSROOT Fix generation of src.conf.5 2015-06-22 20:21:57 +00:00
WITH_USB_GADGET_EXAMPLES Document WITHOUT_ICONV, WITH_LIBICONV_COMPAT and WITH_USB_GADGET_EXAMPLES 2013-08-26 17:15:56 +00:00
WITHOUT_ACCT Don't omit ac(8) as part of WITHOUT_ACCT. 2011-06-17 20:47:44 +00:00
WITHOUT_ACPI
WITHOUT_AMD
WITHOUT_APM
WITHOUT_ASSERT_DEBUG
WITHOUT_AT
WITHOUT_ATM
WITHOUT_AUDIT
WITHOUT_AUTHPF
WITHOUT_AUTOFS Add MK_AUTOFS knob for building and installing autofs(4), et al 2015-01-26 07:15:49 +00:00
WITHOUT_BHYVE Add MK_BHYVE knob for building and installing bhyve(4), et al 2015-01-26 06:44:48 +00:00
WITHOUT_BINUTILS Remove old GNU Binutils tools now provided by ELF Tool Chain 2015-08-05 18:30:00 +00:00
WITHOUT_BINUTILS_BOOTSTRAP Separate out enabling building clang and/or gcc for the system and 2014-04-18 17:03:58 +00:00
WITHOUT_BLUETOOTH
WITHOUT_BMAKE Fix description of WITHOUT_BMAKE's purpose. 2014-03-12 11:53:35 +00:00
WITHOUT_BOOT
WITHOUT_BOOTPARAMD Add the following options to enable/disable several features in the base system 2015-02-04 10:19:32 +00:00
WITHOUT_BOOTPD Add the following options to enable/disable several features in the base system 2015-02-04 10:19:32 +00:00
WITHOUT_BSD_CPIO
WITHOUT_BSDINSTALL Add MK_BSDINSTALL knob for building and installing bsdinstall 2015-01-25 04:43:13 +00:00
WITHOUT_BSNMP
WITHOUT_BZIP2
WITHOUT_BZIP2_SUPPORT
WITHOUT_CALENDAR
WITHOUT_CAPSICUM Add WITHOUT_CAPSICUM src.conf(5) define, which can be used to compile out 2012-01-02 21:57:58 +00:00
WITHOUT_CASPER Please welcome casperd daemon. It (and its services) will be responsible for 2013-12-02 08:21:28 +00:00
WITHOUT_CCD Add MK_CCD knob for building and installing ccd(4), ccdconfig, etc 2015-01-25 04:52:48 +00:00
WITHOUT_CDDL
WITHOUT_CLANG Separate out enabling building clang and/or gcc for the system and 2014-04-18 17:03:58 +00:00
WITHOUT_CLANG_BOOTSTRAP Correct two typos 2014-10-16 18:28:11 +00:00
WITHOUT_CLANG_FULL Pull in r170135 from upstream clang trunk: 2013-02-02 22:28:29 +00:00
WITHOUT_CLANG_IS_CC Add a description of WITHOUT_CLANG_IS_CC. 2012-11-05 21:53:23 +00:00
WITHOUT_CPP
WITHOUT_CROSS_COMPILER Whitespace cleanup to fix rendering nits in 2014-11-26 20:43:09 +00:00
WITHOUT_CRYPT
WITHOUT_CTM
WITHOUT_CUSE Add missing WITHOUT_CUSE file. 2014-08-19 15:40:26 +00:00
WITHOUT_CVS
WITHOUT_CXX Remove specific reference to g++(1) for WITH_CXX as it may be clang. 2015-04-03 23:55:04 +00:00
WITHOUT_DEBUG_FILES Add WITHOUT_DEBUG_FILES description 2015-10-27 20:49:56 +00:00
WITHOUT_DICT
WITHOUT_DMAGENT Rename WITHOUT_DMA into WITHOUT_DMAGENT to avoid confusion 2014-02-22 13:05:23 +00:00
WITHOUT_DOCCOMPRESS Remove empty lines that cause mdoc warnings. 2014-05-27 15:52:27 +00:00
WITHOUT_DYNAMICROOT
WITHOUT_ED_CRYPTO Document the ED_CRYPTO and LS_COLORS options. 2012-05-19 20:05:27 +00:00
WITHOUT_EE Add MK_EE knob to control installing edit, ee, etc 2015-01-25 00:03:44 +00:00
WITHOUT_ELFCOPY_AS_OBJCOPY Allow ELF Tool Chain elfcopy to be installed as objcopy 2015-07-29 18:45:38 +00:00
WITHOUT_EXAMPLES
WITHOUT_FDT Tidy up formatting. 2011-05-06 19:10:27 +00:00
WITHOUT_FILE Add MK_FILE to control whether or not to build file(1), libmagic(3), etc 2015-02-04 10:24:40 +00:00
WITHOUT_FINGER Add the following options to enable/disable several features in the base system 2015-02-04 10:19:32 +00:00
WITHOUT_FLOPPY Removed trailing whitespace. 2011-05-06 19:13:03 +00:00
WITHOUT_FMTREE Merge from CheriBSD: 2014-01-30 21:37:43 +00:00
WITHOUT_FORMAT_EXTENSIONS Add a new option WITHOUT_FORMAT_EXTENSIONS to disable flags related to 2013-05-15 13:04:10 +00:00
WITHOUT_FORTH
WITHOUT_FP_LIBC
WITHOUT_FREEBSD_UPDATE
WITHOUT_FTP Add the following options to enable/disable several features in the base system 2015-02-04 10:19:32 +00:00
WITHOUT_GAMES
WITHOUT_GCC Separate out enabling building clang and/or gcc for the system and 2014-04-18 17:03:58 +00:00
WITHOUT_GCC_BOOTSTRAP Correct two typos 2014-10-16 18:28:11 +00:00
WITHOUT_GCOV
WITHOUT_GDB
WITHOUT_GNU
WITHOUT_GNU_GREP_COMPAT Fix typo in src option description 2014-10-21 20:44:33 +00:00
WITHOUT_GNU_SUPPORT
WITHOUT_GNUCXX On platforms where clang is the default compiler, don't build gcc or libstdc++. 2013-09-06 20:08:03 +00:00
WITHOUT_GPIO MK_GPIO changed its default; reflect. 2011-05-06 19:14:06 +00:00
WITHOUT_GPL_DTC Document WITHOUT_GPL_DTC too. 2014-04-15 20:41:55 +00:00
WITHOUT_GROFF Flesh out WITHOUT_GROFF support to DTRT. 2011-02-22 08:13:49 +00:00
WITHOUT_GSSAPI
WITHOUT_HAST Add MK_HAST knob for building and installing hastd(8), et al 2015-01-26 06:27:07 +00:00
WITHOUT_HTML
WITHOUT_HYPERV Import HyperV Key-Value Pair (KVP) driver and daemon code by Microsoft, 2014-09-13 02:15:31 +00:00
WITHOUT_ICONV Document WITHOUT_ICONV, WITH_LIBICONV_COMPAT and WITH_USB_GADGET_EXAMPLES 2013-08-26 17:15:56 +00:00
WITHOUT_INCLUDES Whitespace cleanup to fix rendering nits in 2014-11-26 20:43:09 +00:00
WITHOUT_INET Introduce two new options MK_INET and MK_INET_SUPPORT analogically 2011-04-30 17:58:28 +00:00
WITHOUT_INET6
WITHOUT_INET6_SUPPORT
WITHOUT_INET_SUPPORT Introduce two new options MK_INET and MK_INET_SUPPORT analogically 2011-04-30 17:58:28 +00:00
WITHOUT_INETD Add the following options to enable/disable several features in the base system 2015-02-04 10:19:32 +00:00
WITHOUT_INFO
WITHOUT_INSTALLLIB
WITHOUT_IPFILTER
WITHOUT_IPFW
WITHOUT_ISCSI Add MK_ISCSI knob for building the iscsi initiator, iscsi daemon, kernel 2015-01-25 04:20:11 +00:00
WITHOUT_JAIL Add a comma to satisfy Igor. 2013-04-27 04:09:09 +00:00
WITHOUT_KDUMP Add documentation for the WITHOUT_KDUMP switch. 2012-09-19 11:38:37 +00:00
WITHOUT_KERBEROS
WITHOUT_KERBEROS_SUPPORT Remove CVS from the base system. 2013-06-15 20:29:07 +00:00
WITHOUT_KERNEL_SYMBOLS Add the description properly... 2011-05-22 18:23:17 +00:00
WITHOUT_KVM
WITHOUT_KVM_SUPPORT
WITHOUT_LDNS Tweak wording. 2013-09-15 13:11:13 +00:00
WITHOUT_LDNS_UTILS Flip the switch: disable BIND and enable LDNS_UTILS. 2013-09-24 14:33:31 +00:00
WITHOUT_LEGACY_CONSOLE Add a comma to satisfy Igor. 2013-04-27 04:09:09 +00:00
WITHOUT_LIB32 LIB32 is supported for powerpc64 too. Make the note more general about 2014-11-18 17:06:48 +00:00
WITHOUT_LIBCPLUSPLUS Add missing src.conf(5) fragments for WITHOUT_LIBCPLUSPLUS and WITH_GPL_DTC. 2013-02-02 22:42:46 +00:00
WITHOUT_LIBPTHREAD
WITHOUT_LIBTHR
WITHOUT_LLDB Add WITHOUT_LLDB for src.conf(5) 2015-10-14 00:23:31 +00:00
WITHOUT_LOCALES
WITHOUT_LOCATE
WITHOUT_LPR
WITHOUT_LS_COLORS Document the ED_CRYPTO and LS_COLORS options. 2012-05-19 20:05:27 +00:00
WITHOUT_LZMA_SUPPORT Following r226271, allow disabling lzma support with "WITHOUT_LZMA_SUPPORT". 2013-01-08 18:37:12 +00:00
WITHOUT_MAIL
WITHOUT_MAILWRAPPER
WITHOUT_MAKE
WITHOUT_MAN
WITHOUT_MAN_UTILS Add an option file for WITHOUT_MAN_UTILS to regenerate src.conf(5). 2010-05-20 00:07:21 +00:00
WITHOUT_MANCOMPRESS Remove empty lines that cause mdoc warnings. 2014-05-27 15:52:27 +00:00
WITHOUT_MANDOCDB Switch to mandoc's version of makewhatis(8), whatis(1), apropos(1) utilities. 2015-05-30 17:41:37 +00:00
WITHOUT_NAND Import work done under project/nand (@235533) into head. 2012-05-17 10:11:18 +00:00
WITHOUT_NCP
WITHOUT_NDIS
WITHOUT_NETCAT
WITHOUT_NETGRAPH
WITHOUT_NETGRAPH_SUPPORT
WITHOUT_NIS
WITHOUT_NLS
WITHOUT_NLS_CATALOGS
WITHOUT_NS_CACHING
WITHOUT_NTP
WITHOUT_OPENSSH
WITHOUT_OPENSSL
WITHOUT_PAM
WITHOUT_PAM_SUPPORT
WITHOUT_PC_SYSINSTALL Add option to make pc-sysinstall optional 2013-01-18 15:57:09 +00:00
WITHOUT_PF
WITHOUT_PKGBOOTSTRAP Add missing period for WITHOUT_PKGBOOTSTRAP so that it matches all 2013-12-04 15:58:42 +00:00
WITHOUT_PMC
WITHOUT_PORTSNAP
WITHOUT_PPP
WITHOUT_PROFILE Revert to conservative defaults. WITH_PROFILE is a default now. 2011-12-02 09:09:54 +00:00
WITHOUT_QUOTAS
WITHOUT_RADIUS_SUPPORT Conditionalize building radius support into libpam, ppp, etc via 2015-02-04 06:53:45 +00:00
WITHOUT_RBOOTD Add the following options to enable/disable several features in the base system 2015-02-04 10:19:32 +00:00
WITHOUT_RCMDS
WITHOUT_RCS Whitespace cleanup to fix rendering nits in 2014-11-26 20:43:09 +00:00
WITHOUT_RESCUE
WITHOUT_ROUTED
WITHOUT_SENDMAIL
WITHOUT_SETUID_LOGIN
WITHOUT_SHAREDOCS
WITHOUT_SOURCELESS Add MK_SOURCELESS build option. Setting MK_SOURCELESS to "no" will disable 2012-02-04 00:54:43 +00:00
WITHOUT_SOURCELESS_HOST Add MK_SOURCELESS build option. Setting MK_SOURCELESS to "no" will disable 2012-02-04 00:54:43 +00:00
WITHOUT_SOURCELESS_UCODE Add MK_SOURCELESS build option. Setting MK_SOURCELESS to "no" will disable 2012-02-04 00:54:43 +00:00
WITHOUT_SSP
WITHOUT_SVNLITE Document WITHOUT_SVNLITE and WITH_SVN. 2013-07-03 12:36:47 +00:00
WITHOUT_SYMVER
WITHOUT_SYSCONS
WITHOUT_TALK Add MK_TALK knob for building the talk and talkd 2015-01-25 04:37:44 +00:00
WITHOUT_TCP_WRAPPERS Add the following options to enable/disable several features in the base system 2015-02-04 10:19:32 +00:00
WITHOUT_TCSH
WITHOUT_TELNET
WITHOUT_TESTS Enable MK_TESTS by default, take 2. 2014-07-16 21:40:11 +00:00
WITHOUT_TESTS_SUPPORT Document WITHOUT_USB_EXAMPLES and WITHOUT_TESTS_SUPPORT 2014-11-18 17:06:50 +00:00
WITHOUT_TEXTPROC
WITHOUT_TFTP Add the following options to enable/disable several features in the base system 2015-02-04 10:19:32 +00:00
WITHOUT_TIMED Add the following options to enable/disable several features in the base system 2015-02-04 10:19:32 +00:00
WITHOUT_TOOLCHAIN Document that WITHOUT_TOOLCHAIN causes headers to not be installed, not 2014-10-16 15:55:13 +00:00
WITHOUT_UNBOUND Build and install the Unbound caching DNS resolver daemon. 2013-09-15 14:51:23 +00:00
WITHOUT_USB
WITHOUT_USB_GADGET_EXAMPLES Document WITHOUT_USB_EXAMPLES and WITHOUT_TESTS_SUPPORT 2014-11-18 17:06:50 +00:00
WITHOUT_UTMPX Replace utxrm(8) by utx(8). 2012-02-11 20:28:42 +00:00
WITHOUT_VI Add option WITHOUT_VI to not build/install vi. vi was the largest 2014-04-24 23:17:40 +00:00
WITHOUT_VT Rename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT 2014-06-30 00:20:12 +00:00
WITHOUT_WARNS Fix typo 2015-01-02 18:57:58 +00:00
WITHOUT_WIRELESS
WITHOUT_WIRELESS_SUPPORT
WITHOUT_WPA_SUPPLICANT_EAPOL
WITHOUT_ZFS
WITHOUT_ZONEINFO Regenerate src.conf(5) for mdoc(7) and typo corrections. 2012-05-12 16:12:36 +00:00