The file mk.conf is the central configuration file for BSD make. It is used by the BSD-style Makefiles in /usr/share/mk, most importantly for building the base system, and secondarily for programs not part of NetBSD proper that use BSD make. It is used by pkgsrc. The standard location is /etc on NetBSD, and it is (for pkgsrc use) in ${PKGBASE}/etc on systems where pkgsrc is bootstrapped.
A confusing aspect of mk.conf is that it is used for the base system and for pkgsrc, but these two build systems are unrelated. See /usr/share/mk/bsd.README for information about the base system and the pgksrc guide for pkgsrc.
The following variables can be tested so that settings can be conditional on the build environment.
BSD_PKG_MK: Defined when a pkgsrc package is built.BUILDING_HTDOCS: Defined when the NetBSD web site is built.- None of the above: Implies that the base system is in use, or some other program.
A typical mk.conf file might look like the following. NB: This is not an default to be copied; it is an explanation of how the file might be written. This one sets an option for all packages to disabled a hypothetical bloated toolkit (this is not a real option).
# This is /etc/mk.conf on HOSTNAME
#
.if defined(BSD_PKG_MK)
#...
PKG_DEFAULT_OPTIONS= -bloated-toolkit
#...
.else
# Build sets with traditional gz instead of xz.
#USE_XZ_SETS= no
.endif
