.\" $NetBSD: mk.conf.5,v 1.106 2023/07/05 16:40:34 lukem Exp $
.\"
.\" Copyright (c) 1999-2023 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Luke Mewburn.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd July 5, 2023
.Dt MK.CONF 5
.Os
.\" turn off hyphenation
.hym 999
.
.Sh NAME
.Nm mk.conf
.Nd make configuration file
.
.Sh DESCRIPTION
The
.Nm
file overrides various parameters used during the build of the system.
.
.Sh NETBSD SYSTEM VARIABLES
.
Listed below are the
.Nm
variables that may be set that affect the
.Nx
system build,
the values to which each may be set,
a brief description of what each variable does,
references to relevant manual pages,
notes (including any interaction with
.Sy build.sh ) ,
and the default value of each variable.
.
.de DFLT
.Pp
.Em Default :
..
.de DFLTn
.DFLT
.Dq no .
..
.de DFLTu
.DFLT
Unset.
..
.de DFLTy
.DFLT
.Dq yes .
..
.de NODEF
.Pp
Forced to
.Dq no
if
.Sy \\$*
is defined,
usually in the Makefile before any
.Xr make 1
.Cm \&.include
directives.
..
.de NOVAR
.Pp
Forced to
.Dq no
if
.Sy \\$* .
..
.de YorN
Can be set to
.Dq yes
or
.Dq no .
..
.
.Bl -tag -width 14n
.
.\" These entries are sorted alphabetically.
.
.It Sy BSDOBJDIR
The real path to the object directory tree for the
.Nx
source tree.
.DFLT
.Dq Pa /usr/obj .
.
.It Sy BSDSRCDIR
The real path to the
.Nx
source tree, if
.Sy NETBSDSRCDIR
isn't defined.
.DFLT
.Dq Pa /usr/src .
.
.It Sy BUILD
If defined,
.Sq "make install"
checks that the
.Xr make 1
targets in the source directories are up-to-date and
re-makes them if they are out of date, instead of blindly trying to install
out of date or non-existent
.Xr make 1
targets.
.DFLTu
.
.It Sy BUILDID
Identifier for the build.
If set, this should be a short string that is suitable for use as
part of a file or directory name.
The identifier will be appended to
object directory names, and can be consulted in the
.Xr make 1
configuration file in order to set additional build parameters,
such as compiler flags.
It will also be used as part of the kernel version string,
which can be shown by
.Dq Li uname \-v .
.DFLTu
.
.It Sy BUILDINFO
Optional multi-line string containing information about the build.
This will appear in
.Sy DESTDIR Ns Pa /etc/release ,
and it will be stored in the
.Va buildinfo
variable in any kernels that are built.
When such kernels are booted, the
.Xr sysctl 7
.Va kern.buildinfo
variable will report this value.
The string may contain backslash escape sequences, such as
.Dq "\e\e"
(representing a backslash character)
and
.Dq "\en"
(representing a newline).
.DFLTu
.
.It Sy BUILDSEED
.Xr g++ 1
uses random numbers when compiling C++ code.
This variable seeds the
.Xr g++ 1
random number generator using
.Fl frandom-seed
with this value.
By default, it is set to
.Do NetBSD-( Ns Em majorversion ) Dc .
Using a fixed value causes C++ binaries to be the same when
built from the same sources, resulting in identical (reproducible) builds.
Additional information is available in the
.Xr g++ 1
documentation of
.Fl frandom-seed .
.DFLTu
.
.It Sy CDEXTRA
A space-separated list of files or directories that will be
added to the CD-ROM image that may be create by the
.Sy build.sh
.Dq iso-image
or
.Dq iso-image-source
operations.
Files will be added to the root of the CD-ROM image,
whereas directories will be copied recursively.
If relative paths are specified, they will be converted to
absolute paths before being used.
.Em Note :
If using
.Sy build.sh ,
multiple paths may be specified via multiple
.Fl C
options, or via a single option whose argument contains multiple
space-separated paths.
.DFLTu
.
.It Sy CONFIGOPTS
Additional flags to
.Xr config 1
when building kernels.
.DFLTu
.
.It Sy COPTS
Extra options for the C compiler.
Should be appended to (e.g.,
.Sy COPTS+=-g ) ,
rather than explicitly set.
.Pp
.Em Note :
.Sy CPUFLAGS ,
not
.Sy COPTS ,
should be used for
compiler flags that select CPU-related options.
.Pp
.Em Note :
.Sy CFLAGS
should never be set in
.Nm .
.
.It Sy CPUFLAGS
Additional options passed to the compiler/assembler to select
CPU instruction set options, CPU tuning options, etc.
.Pp
.Em Note :
Such options should not be specified in
.Sy COPTS ,
because some parts of the build process need to override
CPU-related compiler options.
.DFLTu
.
.It Sy DESTDIR
Directory to contain the built
.Nx
system.
If set, special options are passed to the compilation tools to
prevent their default use of the host system's
.Sy /usr/include , /usr/lib ,
and so forth.
This pathname must be an absolute path, and should
.Em not
end with a slash
.Pq /
character.
(For installation into the system's root directory, set
.Sy DESTDIR
to an empty string, not to
.Dq / ) .
The directory must reside on a file system which supports long file
names and hard links.
.Pp
.Em Note :
.Sy build.sh
will provide a default of
.Dq Pa destdir . Ns Sy MACHINE
(in the top-level
.Sy .OBJDIR )
unless run in
.Sq expert
mode with the
.Fl E
option.
.DFLT
Empty string if
.Sy USETOOLS=yes ;
otherwise unset.
.
.It Sy EXTERNAL_TOOLCHAIN
If defined, this variable indicates the root directory of
an external toolchain which will be used to build the tree.
For example, if a platform is a
.Sy TOOLCHAIN_MISSING
platform,
.Sy EXTERNAL_TOOLCHAIN
can be used to re-enable the cross-compile framework.
.Pp
If
.Sy EXTERNAL_TOOLCHAIN
is defined, act as
.Sy MKGCC=no ,
since the external version of the compiler may not be
able to build the library components of the in-tree compiler.
.Pp
This variable should be used in conjunction with an appropriate
.Sy HAVE_GCC
or
.Sy HAVE_LLVM
setting to control the compiler flags.
.Pp
.Em Note :
This variable is not yet used in as many places as it should be.
Expect the exact semantics of this variable to change in the short
term as parts of the cross-compile framework continue to be cleaned up.
.DFLTu
.
.It Sy INSTALLBOOT_BOARDS
A list of
.Sy evbarm
boards to create bootable images for.
If corresponding U-Boot packages are installed,
bootable images are created as part of a release.
See the
.Bk -words
.Fl o Sy board= Ns Ar name
.Ek
option of
.Xr installboot 8 .
.DFLTu
.
.It Sy INSTALLWORLDDIR
Directory for the top-level
.Xr make 1
.Dq installworld
target to install to.
If specified, must be an absolute path.
.DFLT
.Dq Pa / .
.
.It Sy KERNARCHDIR
Directory under
.Sy KERNSRCDIR
containing the machine dependent kernel sources.
.DFLT
.Dq Pa arch/ Ns Sy MACHINE .
.
.It Sy KERNCONFDIR
Directory containing the kernel configuration files.
.DFLT
.Dq Sy KERNSRCDIR Ns Pa / Ns Sy KERNARCHDIR Ns Pa /conf .
.
.It Sy KERNEL_DIR Pq No experimental
.YorN
Indicates if a top-level directory
.Sy /netbsd/
is created.
If
.Dq yes ,
the directory will contain a kernel file
.Pa /netbsd/kernel
and a corresponding modules directory
.Pa /netbsd/modules/ .
System bootstrap procedures will be modified to search for the kernel
and modules in the
.Pa /netbsd/
directory.
This is intended to simplify system upgrade and rollback procedures by
keeping the kernel and its associated modules together in one place.
.Pp
If
.Dq no ,
the kernel file will be stored in
.Pa /netbsd
and the modules will be stored within the
.Pa /stand/${ARCH}/
directory hierarchy.
.Pp
The
.Sy KERNEL_DIR
option is a work-in-progress, and is highly experimental.
It is also subject to change without notice.
.DFLTn
.
.It Sy KERNOBJDIR
Directory for kernel builds.
For example, the kernel
.Sy GENERIC
will be compiled in
.Sy KERNOBJDIR Ns Pa /GENERIC .
.DFLT
.Dq Sy MAKEOBJDIRPREFIX Ns Pa / Ns Sy KERNSRCDIR Ns Pa / Ns Sy KERNARCHDIR Ns Pa /compile
if it exists or the
.Xr make 1
.Dq obj
target is being made;
otherwise
.Dq Sy KERNSRCDIR Ns Pa / Ns Sy KERNARCHDIR Ns Pa /compile .
.
.It Sy KERNSRCDIR
Directory at the top of the kernel source.
.DFLT
.Dq Sy NETBSDSRCDIR Ns Pa /sys .
.
.It Sy LOCALTIME
The name of the
.Xr tzfile 5
timezone file in the directory
.Pa /usr/share/zoneinfo
to symbolically link
.Sy DESTDIR Ns Pa /etc/localtime
to.
.DFLT
.Dq UTC .
.
.It Sy MAKEVERBOSE
Level of verbosity of status messages.
Supported values:
.Bl -tag -width 2n
.It 0
No descriptive messages or commands executed by
.Xr make 1
are shown.
.It 1
Brief messages are shown describing what is being done,
but the actual commands executed by
.Xr make 1
are not shown.
.It 2
Descriptive messages are shown as above (prefixed with a
.Sq # ) ,
and ordinary commands performed by
.Xr make 1
are shown.
.It 3
In addition to the above, all commands performed by
.Xr make 1
are shown, even if they would ordinarily have been hidden
through use of the
.Dq \&@
prefix in the relevant makefile.
.It 4
In addition to the above, commands executed by
.Xr make 1
are traced through use of the
.Xr sh 1
.Dq Fl x
flag.
.El
.DFLT
.Sy 2 .
.
.It Sy MKAMDGPUFIRMWARE
.YorN
Indicates whether to install the
.Pa /libdata/firmware/amdgpu
directory, which is necessary for the
.Xr amdgpu 4
AMD RADEON GPU video driver.
.DFLT
.Dq yes
on
.Sy i386
and
.Sy x86_64 ;
.Dq no
on other platforms.
.
.It Sy MKARGON2
.YorN
Indicates whether the Argon2 hash is enabled in libcrypt.
.DFLTy
.
.It Sy MKARZERO
.YorN
Indicates whether
.Xr ar 1
should zero the timestamp, uid, and gid in the archive
for reproducible builds.
.DFLT
The value of
.Sy MKREPRO
(if defined), otherwise
.Dq no .
.
.It Sy MKATF
.YorN
Indicates whether the Automated Testing Framework (ATF)
will be built and installed.
This also controls whether the
.Nx
test suite will be built and installed,
as the tests rely on ATF and cannot be built without it.
.NOVAR MKCXX=no
.DFLTy
.
.It Sy MKBINUTILS
.YorN
Indicates whether any of the binutils tools or libraries
will be built and installed.
That is, the libraries
.Sy libbfd ,
.Sy libiberty ,
or any of the things that depend upon them, e.g.
.Xr as 1 ,
.Xr ld 1 ,
.Xr dbsym 8 ,
or
.Xr mdsetimage 8 .
.NOVAR TOOLCHAIN_MISSING!=no
.DFLTy
.
.It Sy MKBSDGREP
.YorN
Determines which implementation of
.Xr grep 1
will be built and installed.
If
.Dq yes ,
use the BSD implementation.
If
.Dq no ,
use the GNU implementation.
.DFLTn
.
.It Sy MKBSDTAR
.YorN
Determines which implementation of
.Xr cpio 1
and
.Xr tar 1
will be built and installed.
If
.Dq yes ,
use the
.Sy libarchive Ns - Ns
based implementations.
If
.Dq no ,
use the
.Xr pax 1
based implementations.
.DFLTy
.
.It Sy MKCATPAGES
.YorN
Indicates whether preformatted plaintext manual pages will be created
and installed.
.NOVAR MKMAN=no No or Sy MKSHARE=no
.DFLTn
.
.It Sy MKCLEANSRC
.YorN
Indicates whether
.Sq "make clean"
and
.Sq "make cleandir"
will delete file names in
.Sy CLEANFILES
or
.Sy CLEANDIRFILES
from both the object directory,
.Sy .OBJDIR ,
and the source directory,
.Sy .SRCDIR .
.Pp
If
.Dq yes ,
then these file names will be deleted relative to both
.Sy .OBJDIR
and
.Sy .CURDIR .
If
.Dq no ,
then the deletion will be performed relative to
.Sy .OBJDIR
only.
.DFLTy
.
.It Sy MKCLEANVERIFY
.YorN
Controls whether
.Sq "make clean"
and
.Sq "make cleandir"
will verify that files have been deleted.
If
.Dq yes ,
then file deletions will be verified using
.Xr ls 1 .
If
.Dq no ,
then file deletions will not be verified.
.DFLTy
.
.It Sy MKCOMPAT
.YorN
Indicates whether support for multiple ABIs is to be built and
installed.
.NODEF NOCOMPAT
.DFLT
.Dq yes
on
.Sy aarch64
(without gcc),
.Sy mips64 ,
.Sy powerpc64 ,
.Sy riscv64 ,
.Sy sparc64 ,
and
.Sy x86_64 ;
.Dq no
on other platforms.
.
.It Sy MKCOMPATMODULES
.YorN
Indicates whether the compat kernel modules will be built and installed.
.NOVAR MKCOMPAT=no
.DFLT
.Dq yes
on
.Sy evbppc-powerpc
and
.Sy mips64 ;
.Dq no
on other platforms.
.
.It Sy MKCOMPATTESTS
.YorN
Indicates whether the
.Nx
test suite for
.Pa src/compat
will be built and installed.
.NOVAR MKCOMPAT=no
.DFLTn
.
.It Sy MKCOMPATX11
.YorN
Indicates whether the X11 libraries will be built and installed.
.NOVAR MKCOMPAT=no
.DFLTn
.
.It Sy MKCOMPLEX
.YorN
Indicates whether the
.Lb libm
is compiled with support for
.In complex.h .
.DFLTy
.
.It Sy MKCROSSGDB
.YorN
Create a cross-gdb as a host tool.
.DFLTn
.
.It Sy MKCTF
.YorN
Indicates whether CTF tools are to be built and installed.
If
.Dq yes ,
the tools will be used to generate and manipulate
CTF data of ELF binaries during build.
.NODEF NOCTF
.Pp
This is disabled internally for standalone programs in
.Pa /usr/mdec .
.DFLT
.Dq yes
on
.Sy aarch64 ,
.Sy amd64 ,
and
.Sy i386 ;
.Dq no
on other platforms.
.
.It Sy MKCVS
.YorN
Indicates whether
.Xr cvs 1
will be built and installed.
.DFLTy
.
.It Sy MKCXX
.YorN
Indicates whether C++ support is enabled.
.Pp
If
.Dq no ,
C++ compilers and software will not be built,
and acts as
.Sy MKATF=no MKGCCCMDS=no MKGDB=no MKGROFF=no MKKYUA=no .
.DFLTy
.
.It Sy MKDEBUG
.YorN
Indicates whether debug information should be generated for
all userland binaries.
The result is collected as an additional
.Sy debug
and
.Sy xdebug
set and installed in
.Sy DESTDIR Ns Pa /usr/libdata/debug .
.NODEF NODEBUG
.DFLTn
.
.It Sy MKDEBUGKERNEL
.YorN
Indicates whether debugging symbols will be built for kernels
by default; pretend as if
.Em makeoptions DEBUG="-g"
is specified in kernel configuration files.
This will also put the debug kernel
.Pa netbsd.gdb
in the kernel sets.
See
.Xr options 4
for details.
This is useful if a cross-gdb is built as well (see
.Sy MKCROSSGDB ) .
.DFLTn
.
.It Sy MKDEBUGLIB
.YorN
Indicates whether debug libraries
.Sy ( lib*_g.a )
will be built and installed.
Debug libraries are compiled with
.Dq Li -g -DDEBUG .
.NODEF NODEBUGLIB
.DFLTn
.
.It Sy MKDEBUGTOOLS
.YorN
Indicates whether debug information
.Sy ( lib*_g.a )
will be included in the build toolchain.
.DFLTn
.
.It Sy MKDEPINCLUDES
.YorN
Indicates whether to add
.Cm \&.include
statements in the
.Pa .depend
files instead of inlining the contents of the
.Pa *.d
files.
This is useful when stale dependencies are present,
to list the exact files that need refreshing, but
it is possibly slower than inlining.
.DFLTn
.
.It Sy MKDOC
.YorN
Indicates whether system documentation destined for
.Sy DESTDIR Ns Pa /usr/share/doc
will be installed.
.NODEF NODOC
.NOVAR MKSHARE=no
.DFLTy
.
.It Sy MKDTB
.YorN
Indicates whether the devicetree blobs will be built and installed.
.DFLT
.Dq yes
on
.Sy aarch64 ,
.Sy armv6 ,
.Sy armv7 ,
.Sy riscv32 ,
and
.Sy riscv64 ;
.Dq no
on other platforms.
.
.It Sy MKDTC
.YorN
Indicates whether the Device Tree Compiler (dtc) will be built and installed.
.DFLTy
.
.It Sy MKDTRACE
.YorN
Indicates whether the kernel modules, utilities, and libraries for
.Xr dtrace 1
support are to be built and installed.
.DFLT
.Dq yes
on
.Sy aarch64 ,
.Sy amd64 ,
and
.Sy i386 ;
.Dq no
on other platforms.
.
.It Sy MKDYNAMICROOT
.YorN
Indicates whether all programs should be dynamically linked,
and to install shared libraries required by
.Pa /bin
and
.Pa /sbin
and the shared linker
.Xr ld.elf_so 1
into
.Pa /lib .
If
.Dq no ,
link programs in
.Pa /bin
and
.Pa /sbin
statically.
.DFLT
.Dq no
on
.Sy ia64 ;
.Dq yes
on other platforms.
.
.It Sy MKFIRMWARE
.YorN
Indicates whether to install the
.Pa /libdata/firmware
directory, which is necessary for various drivers, including:
.Xr athn 4 ,
.Xr bcm43xx 4 ,
.Xr bwfm 4 ,
.Xr ipw 4 ,
.Xr iwi 4 ,
.Xr iwm 4 ,
.Xr iwn 4 ,
.Xr otus 4 ,
.Xr ral 4 ,
.Xr rtwn 4 ,
.Xr rum 4 ,
.Xr run 4 ,
.Xr urtwn 4 ,
.Xr wpi 4 ,
.Xr zyd 4 ,
and the Tegra 124 SoC.
.DFLT
.Dq yes
on
.Sy amd64 ,
.Sy cobalt ,
.Sy evbarm ,
.Sy evbmips ,
.Sy evbppc ,
.Sy hpcarm ,
.Sy hppa ,
.Sy i386 ,
.Sy mac68k ,
.Sy macppc ,
.Sy sandpoint ,
and
.Sy sparc64 ;
.Dq no
on other platforms.
.
.It Sy MKGCC
.YorN
Indicates whether
.Xr gcc 1
or any related libraries
.Pq Sy libg2c , libgcc , libobjc , libstdc++
will be built and installed.
.NOVAR TOOLCHAIN_MISSING!=no No or Sy EXTERNAL_TOOLCHAIN No is defined
.DFLTy
.
.It Sy MKGCCCMDS
.YorN
Indicates whether
.Xr gcc 1
will be built and installed.
If
.Dq no ,
then
.Sy MKGCC
controls if the
GCC libraries will be built and installed.
.NOVAR MKCXX=no
.DFLT
.Dq no
on
.Sy m68000 ;
.Dq yes
on other platforms.
.
.It Sy MKGDB
.YorN
Indicates whether
.Xr gdb 1
will be built and installed.
.NOVAR MKCXX=no No or Sy TOOLCHAIN_MISSING!=no
.DFLT
.Dq no
on
.Sy ia64
and
.Sy or1k ;
.Dq yes
on other platforms.
.
.It Sy MKGROFF
.YorN
Indicates whether
.Xr groff 1
will be built, installed,
and used to format some of the PostScript and PDF
documentation.
.NOVAR MKCXX=no
.DFLTy
.
.It Sy MKGROFFHTMLDOC
.YorN
Indicates whether to use
.Xr groff 1
to generate HTML for miscellaneous articles which
sometimes requires software not in the base installation.
Does not affect the generation of HTML man pages.
.DFLTn
.
.It Sy MKHESIOD
.YorN
Indicates whether the Hesiod infrastructure
(libraries and support programs) will be built and installed.
.DFLTy
.
.It Sy MKHOSTOBJ
.YorN
If
.Dq yes ,
then for programs intended to be run on the compile host,
the name, release, and architecture of the host operating system
will be suffixed to the name of the object directory created by
.Dq make obj .
(This allows multiple host systems to compile
.Nx
for a single target architecture.)
If
.Dq no ,
then programs built to be run on the compile host will use the same
object directory names as programs built to be run on the target
architecture.
.DFLTn
.
.It Sy MKHTML
.YorN
Indicates whether the HTML manual pages are created and installed.
.NODEF NOHTML
.NOVAR MKMAN=no No or Sy MKSHARE=no
.DFLTy
.
.It Sy MKIEEEFP
.YorN
Indicates whether code for IEEE754/IEC60559 conformance
will be built and installed.
Has no effect on most platforms.
.DFLTy
.
.It Sy MKINET6
.YorN
Indicates whether INET6 (IPv6) infrastructure
(libraries and support programs) will be built and installed.
.Pp
.Em Note :
.Sy MKINET6
must not be set to
.Dq no
if
.Sy MKX11!=no .
.DFLTy
.
.It Sy MKINFO
.YorN
Indicates whether GNU Info files, used for the documentation for
most of the compilation tools, will be built and installed.
.NODEF NOINFO
.NOVAR MKSHARE=no
.DFLTy
.
.It Sy MKIPFILTER
.YorN
Indicates whether the
.Xr ipf 4
programs, headers, and other components will be built and installed.
.DFLTy
.
.It Sy MKISCSI
.YorN
Indicates whether the iSCSI library and applications are
built and installed.
.DFLT
.Dq no
on
.Sy m68000 ;
.Dq yes
on other platforms.
.
.It Sy MKKERBEROS
.YorN
Indicates whether the Kerberos v5 infrastructure
(libraries and support programs) will be built and installed.
Caution: the default
.Xr pam 8
configuration requires that Kerberos be present even if not used.
Do not install a userland without Kerberos without also either
updating the
.Xr pam.conf 5
files or disabling PAM via
.Sy MKPAM .
Otherwise all logins will fail.
.DFLTy
.
.It Sy MKKMOD
.YorN
Indicates whether kernel modules will be built and installed.
.DFLT
.Dq no
on
.Sy or1k ;
.Dq yes
on other platforms.
.
.It Sy MKKYUA
.YorN
Indicates whether Kyua (the testing infrastructure used by
.Nx )
will be built and installed.
.NOVAR MKCXX=no
.Pp
.Em Note :
This does not control the installation of the tests themselves.
The tests rely on the ATF libraries and therefore their build is controlled
by the
.Sy MKATF
variable.
.DFLT
.Dq no
until the import of Kyua is done and validated.
.
.It Sy MKLDAP
.YorN
Indicates whether the Lightweight Directory Access Protocol (LDAP)
infrastructure
(libraries and support programs) will be built and installed.
.DFLTy
.
.It Sy MKLIBCSANITIZER
.YorN
Indicates whether to use the sanitizer for libc,
using the sanitizer defined by
.Sy USE_LIBCSANITIZER .
.NODEF NOLIBCSANITIZER
.DFLTn
.
.It Sy MKLIBCXX
.YorN
Indicates if libc++ will be built and installed
(usually for
.Xr clang++ 1 ) .
.DFLT
.Dq yes
if
.Sy MKLLVM=yes ;
otherwise
.Dq no .
.
.It Sy MKLIBSTDCXX
.YorN
Indicates if libstdc++ will be built and installed
(usually for
.Xr g++ 1 ) .
.DFLTy
.
.It Sy MKLINKLIB
.YorN
Indicates whether all of the shared library infrastructure
will be built and installed.
.Pp
If
.Dq no ,
prevents:
.Bl -dash -compact
.It
installation of the
.Sy *.a
libraries
.It
installation of the
.Sy *_pic.a
libraries on PIC systems
.It
building of
.Sy *.a
libraries on PIC systems
.It
installation of
.Sy .so
symlinks on ELF systems
.El
.Pp
I.e, only install the shared library (and the
.Pa .so.major
symlink on ELF).
.NODEF NOLINKLIB
.Pp
If
.Dq no ,
acts as
.Sy MKLINT=no MKPICINSTALL=no MKPROFILE=no .
.DFLTy
.
.It Sy MKLINT
.YorN
Indicates whether
.Xr lint 1
will be run against portions of the
.Nx
source code during the build, and whether lint libraries will be
installed into
.Sy DESTDIR Ns Pa /usr/libdata/lint .
.NODEF NOLINT
.NOVAR MKLINKLIB=no
.DFLTn
.
.It Sy MKLLVM
.YorN
Indicates whether
.Xr clang 1
is installed as a host tool and target compiler.
.Pp
If
.Dq yes ,
acts as
.Sy MKLIBCXX=yes .
.Pp
.Em Note :
Use of
.Xr clang 1
as the system compiler is controlled by
.Sy HAVE_LLVM .
.DFLTn
.
.It Sy MKLLVMRT
.YorN
Indicates whether to build the LLVM PIC libraries necessary
for the various Mesa backend and the native JIT of the target
architecture, if supported.
(Radeon R300 and newer, LLVMPIPE for most.)
.DFLT
If
.Sy MKX11=yes
and
.Sy HAVE_MESA_VER>=19 ,
.Dq yes
on
.Sy aarch64 ,
.Sy amd64 ,
and
.Sy i386 ;
otherwise
.Dq no .
.
.It Sy MKLVM
.YorN
If not
.Dq no ,
build and install the logical volume manager.
.DFLTy
.
.It Sy MKMAKEMANDB
.YorN
Indicates if the whatis tools
.Xr ( apropos 1 ,
.Xr whatis 1 ,
.Xr getNAME 8 ,
.Xr makemandb 8 ,
and
.Xr makewhatis 8 ) ,
should be built, installed, and used to
create and install the
.Pa whatis.db .
.DFLTy
.
.It Sy MKMAN
.YorN
Indicates whether manual pages will be installed.
.NODEF NOMAN
.NOVAR MKSHARE=no
.Pp
If
.Dq no ,
acts as
.Sy MKCATPAGES=no MKHTML=no .
.DFLTy
.
.It Sy MKMANDOC
.YorN
Indicates whether
.Xr mandoc 1
will be built and installed, and used to create and install
catman and HTML pages.
.Pp
If
.Dq no ,
use
.Xr groff 1
instead of
.Xr mandoc 1 .
.NODEF NOMANDOC No or Sy NOMANDOC . Ns Ar target No (for a given Xr make 1 target Ar target )
.Pp
Only used if
.Sy MKMAN=yes .
.DFLTy
.
.It Sy MKMANZ
.YorN
Indicates whether manual pages should be compressed with
.Xr gzip 1
at installation time.
.Pp
Only used if
.Sy MKMAN=yes .
.DFLTn
.
.It Sy MKMDNS
.YorN
Indicates whether the mDNS (Multicast DNS) infrastructure
(libraries and support programs) will be built and installed.
.DFLTy
.
.It Sy MKNLS
.YorN
Indicates whether Native Language System (NLS) locale zone files will be
built and installed.
.NODEF NONLS
.NOVAR MKSHARE=no
.DFLTy
.
.It Sy MKNOUVEAUFIRMWARE
.YorN
Indicates whether to install the
.Pa /libdata/firmware/nouveau
directory, which is necessary for the
.Xr nouveau 4
NVIDIA video driver.
.DFLT
.Dq yes
on
.Sy aarch64 ,
.Sy i386 ,
and
.Sy x86_64 ,
.Dq no
on other platforms.
.
.It Sy MKNPF
.YorN
Indicates whether the NPF packet filter is to be built and installed.
.DFLTy
.
.It Sy MKNSD
.YorN
Indicates whether the Name Server Daemon (NSD) is to be built and installed.
.DFLTn
.
.It Sy MKOBJ
.YorN
Indicates whether object directories will be created when running
.Dq make obj .
If
.Dq no ,
then all built files will be located inside the regular source tree.
.NODEF NOOBJ
.Pp
If
.Dq no ,
acts as
.Sy MKOBJDIRS=no .
.Pp
.Em Note :
Setting
.Sy MKOBJ
to
.Dq no
is not recommended and may cause problems when updating the tree with
.Xr cvs 1 .
.DFLTy
.
.It Sy MKOBJDIRS
.YorN
Indicates whether object directories will be created automatically
(via a
.Dq make obj
pass) at the start of a build.
.NOVAR MKOBJ=no
.Pp
.Em Note :
If using
.Sy build.sh ,
the default is
.Dq yes .
This may be set to
.Dq no
by giving
.Sy build.sh
the
.Fl o
option.
.DFLTn
.
.It Sy MKPAM
.YorN
Indicates whether the
.Xr pam 8
framework (libraries and support files) will be built and installed.
The pre-PAM code is not supported and may be removed in the future.
.DFLTy
.
.It Sy MKPCC
.YorN
Indicates whether
.Xr pcc 1
or any related libraries
.Pq Sy libpcc , libpccsoftfloat
will be built and installed.
.DFLTn
.
.It Sy MKPF
.YorN
Indicates whether the
.Xr pf 4
programs, headers, and LKM will be built and installed.
.DFLTy
.
.It Sy MKPIC
.YorN
Indicates whether shared objects and libraries will be created and
installed.
If
.Dq no ,
the entire built system will be statically linked.
.NODEF NOPIC
.Pp
If
.Dq no ,
acts as
.Sy MKPICLIB=no .
.DFLT
.Dq no
on
.Sy m68000 ;
.Dq yes
on other platforms.
.
.It Sy MKPICINSTALL
.YorN
Indicates whether the
.Xr ar 1
format libraries
.Sy ( lib*_pic.a ) ,
used to generate shared libraries, are installed.
.NODEF NOPICINSTALL
.NOVAR MKLINKLIB=no
.DFLTn
.
.It Sy MKPICLIB
.YorN
Indicates whether the
.Xr ar 1
format libraries
.Sy ( lib*_pic.a ) ,
used to generate shared libraries.
.NOVAR MKPIC=no
.DFLT
.Dq no
on
.Sy vax ;
.Dq yes
on other platforms.
.
.It Sy MKPIE
.YorN
Indicates whether Position Independent Executables (PIE)
will be built and installed.
.NODEF NOPIE
.NOVAR COVERITY_TOP_CONFIG No is defined
.Pp
This is disabled internally for standalone programs in
.Pa /usr/mdec .
.DFLT
.Dq yes
on
.Sy aarch64 ,
.Sy arm ,
.Sy i386 ,
.Sy m68k ,
.Sy mips ,
.Sy sh3 ,
.Sy sparc64 ,
and
.Sy x86_64 ;
.Dq no
on other platforms.
.
.It Sy MKPIGZGZIP
.YorN
If
.Dq no ,
the
.Xr pigz 1
utility is not installed as
.Xr gzip 1 .
.DFLTn
.
.It Sy MKPOSTFIX
.YorN
Indicates whether Postfix will be built and installed.
.DFLTy
.
.It Sy MKPROFILE
.YorN
Indicates whether profiled libraries
.Sy ( lib*_p.a )
will be built and installed.
.NODEF NOPROFILE
.NOVAR MKLINKLIB=no
.DFLT
.Dq no
on
.Sy or1k ,
.Sy riscv32 ,
and
.Sy riscv64
(due to toolchain problems with profiled code);
.Dq yes
on other platforms.
.
.It Sy MKRADEONFIRMWARE
.YorN
Indicates whether to install the
.Pa /libdata/firmware/radeon
directory, which is necessary for the
.Xr radeon 4
AMD RADEON GPU video driver.
.DFLT
.Dq yes
on
.Sy aarch64 ,
.Sy i386 ,
and
.Sy x86_64 ,
.Dq no
on other platforms.
.
.It Sy MKRELRO
Indicates whether to enable support for Relocation Read-Only (RELRO).
Supported values:
.Bl -tag -width partial
.It partial
Set the non-PLT GOT to read-only.
.It full
Set the non-PLT GOT to read-only and
also force immediate symbol binding,
unless
.Sy NOFULLRELRO
is defined and not
.Dq no
(usually in the Makefile before any
.Xr make 1
.Cm \&.include
directives).
.It no
Disable RELRO.
.El
.NODEF NORELRO
.DFLT
.Dq partial
on
.Sy aarch64 ,
.Sy i386 ,
and
.Sy x86_64 ;
.Dq no
on other platforms.
.
.It Sy MKREPRO
.YorN
Indicates whether builds are to be reproducible.
If
.Dq yes ,
two builds from the same source tree will produce the same build
results.
.Pp
Used as the default for
.Sy MKARZERO .
.Pp
.Em Note :
This may be set to
.Dq yes
by giving
.Sy build.sh
the
.Fl P
option.
.DFLTn
.
.It Sy MKREPRO_TIMESTAMP
Unix timestamp.
When
.Sy MKREPRO
is set, the timestamp of all files in the sets will be set
to this value.
.Pp
.Em Note :
This may be set automatically to the latest source tree timestamp
using
.Xr cvslatest 1
by giving
.Sy build.sh
the
.Fl P
option.
.DFLTu
.
.It Sy MKRUMP
.YorN
Indicates whether the
.Xr rump 3
headers, libraries, and programs are to be installed.
.NOVAR COVERITY_TOP_CONFIG No is defined
.Pp
See also
variables that start with
.Sy RUMPUSER_
or
.Sy RUMP_ .
.DFLTy
.
.It Sy MKSANITIZER
.YorN
Indicates whether to use the sanitizer to compile userland programs,
using the sanitizer defined by
.Sy USE_SANITIZER .
.NODEF NOSANITIZER
.DFLTn
.
.It Sy MKSHARE
.YorN
Indicates whether files destined to reside in
.Sy DESTDIR Ns Pa /usr/share
will be built and installed.
.NODEF NOSHARE
.Pp
If
.Dq no ,
acts as
.Sy MKCATPAGES=no MKDOC=no MKINFO=no MKHTML=no MKMAN=no MKNLS=no .
.DFLTy
.
.It Sy MKSKEY
.YorN
Indicates whether the S/key infrastructure
(libraries and support programs) will be built and installed.
.DFLTy
.
.It Sy MKSLJIT
.YorN
Indicates whether to enable support for sljit
(stack-less platform-independent Just in Time (JIT) compiler)
private library and tests.
.DFLT
.Dq yes
on
.Sy i386 ,
.Sy sparc ,
and
.Sy x86_64 ;
.Dq no
on other platforms.
.
.It Sy MKSOFTFLOAT
.YorN
Indicates whether the compiler generates output containing
library calls for floating point and possibly soft-float library
support.
.Pp
Forced to
.Dq yes
on
.Sy arm
without
.Sq hf ,
.Sy coldfire ,
.Sy emips ,
.Sy or1k ,
and
.Sy sh3 .
.DFLT
.Dq yes
on
.Sy mips64 ;
.Dq no
on other platforms.
.
.It Sy MKSTATICLIB
.YorN
Indicates whether the normal static libraries
.Sy ( lib*_g.a )
will be built and installed.
.NODEF NOSTATICLIB
.DFLTy
.
.It Sy MKSTATICPIE
.YorN
Indicates whether support for static PIE binaries
will be built and installed.
These binaries use a special support in crt0.o for
resolving relative relocations and require linker support.
.DFLT
.Dq yes
on
.Sy i386
and
.Sy x86_64 ;
.Dq no
on other platforms.
.
.It Sy MKSTRIPIDENT
.YorN
Indicates whether RCS IDs, for use with
.Xr ident 1 ,
should be stripped from program binaries and shared libraries.
.DFLTn
.
.It Sy MKSTRIPSYM
.YorN
Indicates whether all local symbols should be stripped from shared libraries.
If
.Dq yes ,
strip all local symbols from shared libraries;
the effect is equivalent to the
.Fl x
option of
.Xr ld 1 .
If
.Dq no ,
strip only temporary local symbols; the effect is equivalent
to the
.Fl X
option of
.Xr ld 1 .
Keeping non-temporary local symbols
such as static function names is useful on using DTrace for
userland libraries and getting a backtrace from a
.Xr rumpkernel 7
kernel
loading shared libraries.
.DFLTy
.
.It Sy MKTEGRAFIRMWARE
.YorN
Indicates whether to install the
.Pa /libdata/firmware/nvidia
directory, which is necessary for the
NVIDIA Tegra XHCI driver.
.DFLT
.Dq yes
on
.Sy evbarm ;
.Dq no
on other platforms.
.
.It Sy MKTPM
.YorN
Indicates whether to install the Trusted Platform Module (TPM)
infrastructure.
.DFLTn
.
.It Sy MKUNBOUND
.YorN
Indicates whether the
.Xr unbound 8
DNS resolver will be built and installed.
.DFLTy
.
.It Sy MKUNPRIVED
.YorN
Indicates whether an unprivileged install will occur.
The user, group, permissions, and file flags, will not be set on
the installed items; instead the information will be appended to
a file called
.Pa METALOG
in
.Sy DESTDIR .
The
.Pa METALOG
contents are used during the generation of the distribution
tar files to ensure that the appropriate file ownership is stored.
This allows a non-root
.Sq "make install" .
.DFLTn
.
.It Sy MKUPDATE
.YorN
Indicates whether all install operations intended to write to
.Sy DESTDIR
will compare file timestamps before installing, and skip the install
phase if the destination files are up-to-date.
.Pp
For top-level builds this this implies the effects of
.Sy NOCLEANDIR
(i.e.,
.Dq make cleandir
is avoided).
.Pp
.Em Note :
This may be set to
.Dq yes
by giving
.Sy build.sh
the
.Fl u
option.
.DFLTn
.
.It Sy MKX11
.YorN
Indicates whether X11 will be built and installed from
.Sy X11SRCDIR ,
and whether the X sets will be created.
.Pp
.Em Note :
If
.Dq yes ,
requires
.Sy MKINET6=yes .
.DFLTn
.
.It Sy MKX11FONTS
.YorN
If
.Dq no ,
do not build and install the X fonts.
The xfont set is still created but will be empty.
.Pp
Only used if
.Sy MKX11=yes .
.DFLTy
.
.It Sy MKX11MOTIF
.YorN
If
.Dq yes ,
build the native Xorg libGLw with Motif stubs.
Requires that Motif can be found via
.Sy X11MOTIFPATH .
.DFLTn
.
.It Sy MKXORG_SERVER
.YorN
Indicates whether the
.Xr Xorg 7
X server and drivers will be built and installed.
.DFLT
.Dq yes
on
.Sy alpha ,
.Sy amd64 ,
.Sy amiga ,
.Sy bebox ,
.Sy cats ,
.Sy dreamcast ,
.Sy ews4800mips ,
.Sy evbarm ,
.Sy evbmips ,
.Sy evbppc ,
.Sy hp300 ,
.Sy hpcarm ,
.Sy hpcmips ,
.Sy hpcsh ,
.Sy hppa ,
.Sy i386 ,
.Sy ibmnws ,
.Sy iyonix ,
.Sy luna68k ,
.Sy mac68k ,
.Sy macppc ,
.Sy netwinder ,
.Sy newsmips ,
.Sy pmax ,
.Sy prep ,
.Sy ofppc ,
.Sy sgimips ,
.Sy shark ,
.Sy sparc ,
.Sy sparc64 ,
.Sy vax ,
and
.Sy zaurus ;
.Dq no
on other platforms.
.
.It Sy MKYP
.YorN
Indicates whether the YP (NIS) infrastructure
(libraries and support programs) will be built and installed.
.DFLTy
.
.It Sy MKZFS
.YorN
Indicates whether the ZFS kernel module and the utilities and
libraries used to manage the ZFS system are to be built and installed.
.Pp
.Em Note :
ZFS requires 64-bit atomic operations.
.DFLT
.Dq yes
on
.Sy aarch64 ,
.Sy amd64 ,
and
.Sy sparc64 ;
.Dq no
on other platforms.
.
.It Sy NETBSDSRCDIR
The path to the top level of the
.Nx
sources.
.DFLT
Top level of the
.Nx
source tree (as determined by the presence of
.Pa build.sh
and
.Pa tools/ )
if
.Xr make 1
is run from within that tree;
otherwise
.Sy BSDSRCDIR
will be used.
.
.It Sy NETBSD_OFFICIAL_RELEASE
.YorN
Indicates whether the build creates an official
.Nx
release which is going to be available from
.Lk ftp.NetBSD.org
and/or
.Lk cdn.NetBSD.org
locations.
This variable modifies a few default paths in the installer
and also creates different links in the install documentation.
The auto-build cluster uses this variable to distinguish
.Sq daily
builds from real releases.
.DFLTu
.Pq I.e., Dq no .
.
.It Sy NOCLEANDIR
If set, avoids the
.Dq make cleandir
phase of a full build.
This has the effect of allowing only changed
files in a source tree to be recompiled.
This can speed up builds when updating only a few files in the tree.
.Pp
See also
.Sy MKUPDATE .
.DFLTu
.
.It Sy NODISTRIBDIRS
If set, avoids the
.Dq make distrib-dirs
phase of a full build.
This skips running
.Xr mtree 8
on
.Sy DESTDIR ,
useful on systems where building as an unprivileged user, or where it is
known that the system-wide
.Xr mtree 8
files have not changed.
.DFLTu
.
.It Sy NOINCLUDES
If set, avoids the
.Dq make includes
phase of a full build.
This has the effect of preventing
.Xr make 1
from thinking that some programs are out-of-date simply because the
system include files have changed.
However, this option should not be used when updating the entire
.Nx
source tree arbitrarily; it is suggested to use
.Sy MKUPDATE=yes
instead in that case.
.DFLTu
.
.It Sy OBJMACHINE
If defined, creates objdirs of the form
.Pa obj . Ns Sy MACHINE ,
where
.Sy MACHINE
is the current architecture (as per
.Sq "uname -m" ) .
.DFLTu
.
.It Sy RELEASEDIR
If set, specifies the directory to which a
.Xr release 7
layout will be written at the end of a
.Dq make release .
If specified, must be an absolute path.
.Pp
.Em Note :
.Sy build.sh
will provide a default of
.Dq Pa releasedir
(in the top-level
.Sy .OBJDIR )
unless run in
.Sq expert
mode with the
.Fl E
option.
.DFLTu
.
.It Sy RUMPUSER_THREADS
Defines the threading implementation used by the
.Xr rumpuser 3
hypercall implementation.
Supported values:
.Bl -tag -width pthread
.It fiber
Use a fiber interface, with cooperatively scheduled contexts.
.It none
Do not support kernel threads.
.It pthread
Use
.Xr pthread 3
to implement threads.
.El
.DFLT
.Dq pthread .
.
.It Sy RUMP_CURLWP
Defines how
.Va curlwp
is obtained in the
.Xr rumpkernel 7
kernel.
.Va curlwp
is
a very frequently accessed thread-local variable, and optimizing
access has a significant performance impact.
Note that all options are not available on hosts/machine architectures.
Supported values:
.Bl -tag -width hypercall
.It hypercall
Use a hypercall to fetch the value.
.It register
Use a dedicated register.
(Implies compiling with
.Fl ffixed- Ns Ar reg ) .
.It __thread
Use the __thread feature to fetch value via
thread local storage (TLS).
.El
.DFLT
.Dq hypercall .
.
.It Sy RUMP_DEBUG
If defined,
indicates whether
.Xr rumpkernel 7
kernels are built with
.Fl DDEBUG .
.DFLTu
.
.It Sy RUMP_DIAGNOSTIC
.YorN
Indicates whether
.Xr rumpkernel 7
kernels are built with
.Fl DDIAGNOSTIC .
.DFLTy
.
.It Sy RUMP_KTRACE
.YorN
Indicates whether
.Xr rumpkernel 7
kernels are built with
.Fl DKTRACE .
.DFLTy
.
.It Sy RUMP_LOCKDEBUG
If defined,
indicates whether
.Xr rumpkernel 7
kernels are built with
.Fl DLOCKDEBUG .
.DFLTu
.
.It Sy RUMP_LOCKS_UP
.YorN
Indicates whether
.Xr rumpkernel 7
kernels are built with
uniprocess-optimized locking or not.
.Pp
If
.Dq yes ,
build with uniprocess-optimized locking, which requires
.Ev RUMP_NCPU=1
in the environment at runtime.
.Pp
If
.Dq no ,
build with multiprocessor-capable locking.
.DFLTn
.
.It Sy RUMP_NBCOMPAT
Selects which
.Nx
userland binary compatibility
.Dv COMPAT_ Ns Ar ver
kernel options are enabled in the
.Xr rumpkernel 7
kernels.
This option is useful only when building
.Xr rumpkernel 7 kernels
for
.Nx
userspace, and an empty value may be supplied elsewhere.
Supported (one or more, comma-separated) values:
.Bl -tag -width default
.It all
All supported release versions.
Equivalent to
.Dq 50,60,70,80,90 .
.It default
Default value.
Equivalent to
.Dq all ,
although this default may change in the future.
.It none
No compatibility options are enabled.
.It 50
.Nx
5.x compatibility, via
.Dv COMPAT_50
kernel option.
.It 60
.Nx
6.x compatibility, via
.Dv COMPAT_60
kernel option.
.It 70
.Nx
7.x compatibility, via
.Dv COMPAT_70
kernel option.
.It 80
.Nx
8.x compatibility, via
.Dv COMPAT_80
kernel option.
.It 90
.Nx
9.x compatibility, via
.Dv COMPAT_90
kernel option.
.El
.DFLT
.Dq all .
.
.It Sy RUMP_VIRTIF
.YorN
Indicates whether
.Xr rumpkernel 7
kernels are built with support for the
.Xr virt 4
network interface.
.Pp
If
.Dq no ,
don't build with
.Xr virt 4
support, which may be necessary on systems that lack the
necessary headers, such as musl libc based Linux.
.DFLTy
.
.It Sy RUMP_VNODE_LOCKDEBUG
If defined,
indicates whether
.Xr rumpkernel 7
kernels are built with
.Fl DVNODE_LOCKDEBUG .
.DFLTu
.
.It Sy TOOLCHAIN_MISSING
.YorN
If not
.Dq no ,
this indicates that the platform
.Dq Sy MACHINE_ARCH
being built does not have a working in-tree toolchain.
.Pp
If not
.Dq no ,
acts as
.Sy MKBINUTILS=no MKGCC=no MKGDB=no .
.\" See MKGCCCMDS for example text if a platform defaults to yes.
.DFLTn
.
.It Sy TOOLDIR
Directory to hold the host tools, once built.
If specified, must be an absolute path.
This directory should be unique to a given host system and
.Nx
source tree.
(However, multiple target architectures may share the same
.Sy TOOLDIR ;
the target-architecture-dependent files have unique names.)
If unset, a default based
on the
.Xr uname 1
information of the host platform will be created in the
.Sy .OBJDIR
of
.Pa src .
.DFLTu
.
.It Sy USETOOLS
.YorN
Indicates whether the tools specified by
.Sy TOOLDIR
should be used as part of a build in progress.
Must be set to
.Dq yes
if cross-compiling.
Supported values:
.Bl -tag -width never
.It yes
Use the tools from
.Sy TOOLDIR .
.It no
Do not use the tools from
.Sy TOOLDIR ,
but refuse to build native compilation tool components that are
version-specific for that tool.
.It never
Do not use the tools from
.Sy TOOLDIR ,
even when building native tool components.
This is similar to the traditional
.Nx
build method, but does
.Em not
verify that the compilation tools in use are up-to-date enough in order
to build the tree successfully.
This may cause build or runtime problems when building the whole
.Nx
source tree.
.El
.DFLT
.Dq no
when using
.Aq bsd.*.mk
outside the
.Nx
source tree (detected automatically) or if
.Sy TOOLCHAIN_MISSING=yes ;
otherwise
.Dq yes .
.
.It Sy USE_FORT
.YorN
Indicates whether the so-called
.Dq FORTIFY_SOURCE
.Xr security 7
extensions are enabled; see
.Xr ssp 3
for details.
This imposes some performance penalty.
.NODEF NOFORT
.DFLTn
.
.It Sy USE_HESIOD
.YorN
Indicates whether Hesiod support is
enabled in the various applications that support it.
.NOVAR MKHESIOD=no
.DFLTy
.
.It Sy USE_INET6
.YorN
Indicates whether INET6 (IPv6) support is
enabled in the various applications that support it.
.NOVAR MKINET6=no
.DFLTy
.
.It Sy USE_JEMALLOC
.YorN
Indicates whether the
.Em jemalloc
allocator
.Pq which is designed for improved performance with threaded applications
is used instead of the
.Em phkmalloc
allocator
.Pq that was the default until Nx 5.0 .
.DFLTy
.
.It Sy USE_KERBEROS
.YorN
Indicates whether Kerberos v5 support is
enabled in the various applications that support it.
.NOVAR MKKERBEROS=no
.DFLTy
.
.It Sy USE_LDAP
.YorN
Indicates whether LDAP support is
enabled in the various applications that support it.
.NOVAR MKLDAP=no
.DFLTy
.
.It Sy USE_LIBCSANITIZER
Selects the sanitizer in libc to compile userland programs and libraries.
Supported values:
.Bl -tag -width undefined
.It undefined
Enables the micro-UBSan in the user mode (uUBSan)
undefined behaviour sanitizer.
The code is shared with the kernel mode variation (kUBSan).
The runtime runtime differs from the UBSan available in
.Sy MKSANITIZER .
The runtime is stripped down from C++ features,
and is invoked with
.Li -fsanitize=no-vptr
as that sanitizer is not supported.
The runtime configuration is restricted to the
.Ev LIBC_UBSAN
environment variable, that is designed to be safe for hardening.
.El
.Pp
The value of
.Sy USE_LIBCSANITIZER
is passed to the C and C++ compilers as the argument to
.Li -fsanitize= .
Additional sanitizer arguments can be passed through
.Sy LIBCSANITIZERFLAGS .
.Pp
Disabled if
.Sy MKLIBCSANITIZER=no .
.DFLT
.Dq undefined .
.
.It Sy USE_PAM
.YorN
Indicates whether
.Xr pam 8
support is enabled in the various applications that support it.
.NOVAR MKPAM=no
.DFLTy
.
.It Sy USE_PIGZGZIP
.YorN
Indicates whether
.Xr pigz 1
is used instead of
.Xr gzip 1
for multi-threaded gzip compression of the distribution tar sets.
.DFLTn
.
.It Sy USE_SANITIZER
Selects the sanitizer to compile userland programs and libraries.
Supported (one or more, comma-separated) values:
.Bl -tag -width safe-stack
.It address
A memory error detector.
.It cfi
A control flow detector.
.It dataflow
A general data flow analysis.
.It leak
A memory leak detector.
.It memory
An uninitialized memory read detector.
.It safe-stack
Protect against stack-based corruption.
.It scudo
The Scudo Hardened Allocator.
.It thread
A data race detector.
.It undefined
An undefined behavior detector.
.El
.Pp
The value of
.Sy USE_SANITIZER
is passed to the C and C++ compilers as the argument to
.Li -fsanitize= .
Additional sanitizer arguments can be passed through
.Sy SANITIZERFLAGS .
.Pp
The list of supported features and their valid combinations
depends on the compiler version and target CPU architecture.
.Pp
Disabled if
.Sy MKSANITIZER=no .
.DFLT
.Dq address .
.
.It Sy USE_SKEY
.YorN
Indicates whether S/key support is
enabled in the various applications that support it.
.NOVAR MKSKEY=no
.Pp
.Em Note :
This is mutually exclusive to
.Sy USE_PAM!=no .
.DFLTn
.
.It Sy USE_SSP
.YorN
Indicates whether GCC stack-smashing protection (SSP) support,
which detects stack overflows and aborts the program,
is enabled.
This imposes some performance penalty
(approximately 5%).
.Pp
This is disabled internally for standalone programs in
.Pa /usr/mdec .
.NODEF NOSSP
.NOVAR COVERITY_TOP_CONFIG No is defined
.DFLT
.Dq no
on
.Sy alpha ,
.Sy hppa ,
.Sy ia64 ,
and
.Sy mips ;
.Dq yes
on other platforms if
.Sy USE_FORT=yes ;
otherwise
.Dq no .
.
.It Sy USE_XZ_SETS
.YorN
Indicates whether the distribution tar files are to be compressed
with
.Xr xz 1
instead of
.Xr gzip 1
or
.Xr pigz 1 .
.NOVAR USE_PIGZGZIP=yes
.DFLT
.Dq yes
on
.Sy aarch64 ,
.Sy amd64 ,
and
.Sy sparc64 ,
.Dq no
on other platforms.
.
.It Sy USE_YP
.YorN
Indicates whether YP (NIS) support is
enabled in the various applications that support it.
.NOVAR MKYP=no
.DFLTy
.
.It Sy X11MOTIFPATH
Path of the Motif installation to use if
.Sy MKX11MOTIF=yes .
.DFLT
.Dq Pa /usr/pkg .
.
.It Sy X11SRCDIR
Directory containing the modular Xorg source.
If specified, must be an absolute path.
The main modular Xorg source is found in
.Sy X11SRCDIR Ns Pa /external/mit .
.DFLT
.Sy NETBSDSRCDIR Ns Pa /../xsrc ,
if that exists; otherwise
.Dq Pa /usr/xsrc .
.
.El
.
.Sh PKGSRC SYSTEM VARIABLES
.
Please see the pkgsrc guide at
.Lk http://www.netbsd.org/Documentation/pkgsrc/
or
.Pa pkgsrc/doc/pkgsrc.txt
for more variables used internally by the package system and
.Pa ${PKGSRCDIR}/mk/defaults/mk.conf
for package-specific examples.
.
.Sh OBSOLETE VARIABLES
.
These variables are obsolete.
.
.Bl -tag -width 14n
.
.\" These entries are sorted alphabetically.
.
.It Sy EXTSRCSRCDIR
Obsolete.
.
.It Sy MKBFD
Use
.Sy MKBINUTILS .
.
.It Sy MKCRYPTO
Obsolete.
.
.It Sy MKEXTSRC
Obsolete.
.
.It Sy MKKERBEROS4
Obsolete.
.
.It Sy MKKDEBUG
Use
.Sy MKDEBUGKERNEL .
.
.It Sy MKLLD
Obsolete.
.
.It Sy MKLLDB
Obsolete.
.
.It Sy MKMCLINKER
Obsolete.
.
.It Sy MKPERFUSE
Obsolete.
.
.It Sy MKTOOLSDEBUG
Use
.Sy MKDEBUGTOOLS .
.
.It Sy NBUILDJOBS
Use the
.Nm build.sh
and
.Xr make 1
option
.Fl j
instead.
.
.It Sy SHAREDSTRINGS
Obsolete.
.
.It Sy USE_COMBINE
Obsolete.
.
.It Sy USE_NEW_TOOLCHAIN
The new toolchain is now the default.
To disable, use
.Sy TOOLCHAIN_MISSING=yes .
.
.El
.
.Sh FILES
.Bl -tag -width /etc/mk.conf
.
.It Pa /etc/mk.conf
The
.Nm
file resides in
.Pa /etc .
.
.It Pa ${PKGSRCDIR}/mk/defaults/mk.conf
Examples for settings regarding the pkgsrc collection.
.El
.
.Sh SEE ALSO
.Xr apropos 1 ,
.Xr ar 1 ,
.Xr as 1 ,
.Xr clang 1 ,
.Xr clang++ 1 ,
.Xr config 1 ,
.Xr cpio 1 ,
.Xr cvs 1 ,
.Xr cvslatest 1 ,
.Xr dtrace 1 ,
.Xr g++ 1 ,
.Xr gcc 1 ,
.Xr gdb 1 ,
.Xr groff 1 ,
.Xr gzip 1 ,
.Xr ident 1 ,
.Xr ld 1 ,
.Xr ld.elf_so 1 ,
.Xr lint 1 ,
.Xr ls 1 ,
.Xr make 1 ,
.Xr mandoc 1 ,
.Xr pax 1 ,
.Xr pcc 1 ,
.Xr pigz 1 ,
.Xr sh 1 ,
.Xr tar 1 ,
.Xr uname 1 ,
.Xr whatis 1 ,
.Xr xz 1 ,
.Xr rump 3 ,
.Xr rumpuser 3 ,
.Xr ssp 3 ,
.Xr amdgpu 4 ,
.Xr athn 4 ,
.Xr bcm43xx 4 ,
.Xr bwfm 4 ,
.Xr ipf 4 ,
.Xr ipw 4 ,
.Xr iwi 4 ,
.Xr iwm 4 ,
.Xr iwn 4 ,
.Xr nouveau 4 ,
.Xr options 4 ,
.Xr otus 4 ,
.Xr pf 4 ,
.Xr radeon 4 ,
.Xr ral 4 ,
.Xr rtwn 4 ,
.Xr rum 4 ,
.Xr run 4 ,
.Xr urtwn 4 ,
.Xr virt 4 ,
.Xr wpi 4 ,
.Xr zyd 4 ,
.Xr pam.conf 5 ,
.Xr release 7 ,
.Xr rumpkernel 7 ,
.Xr security 7 ,
.Xr Xorg 7 ,
.Xr dbsym 8 ,
.Xr getNAME 8 ,
.Xr installboot 8 ,
.Xr makemandb 8 ,
.Xr makewhatis 8 ,
.Xr mdsetimage 8 ,
.Xr mtree 8 ,
.Xr pam 8 ,
.Xr unbound 8 ,
.Pa /usr/share/mk/bsd.README ,
.Pa src/BUILDING ,
.Pa pkgsrc/doc/pkgsrc.txt ,
.Lk http://www.netbsd.org/Documentation/pkgsrc/
.Sh HISTORY
The
.Nm
file appeared in
.Nx 1.2 .