MK.CONF(5)
๐ mk.conf(5) โ File Formats Manual ๐
okay so bestie, this is the mk.conf(5) page from the File Formats Manual, and it's literally the make configuration file. group-chat voice: we're about to go through every single variable, no skipping, periodt. ๐
โจ NAME โจ
mk.conf โ make configuration file
๐ธ DESCRIPTION ๐ธ
The mk.conf file overrides various parameters used during the build of the system. that's the whole vibe. โจ
๐ฆ NETBSD SYSTEM VARIABLES ๐ฆ
Listed below are the mk.conf variables that may be set that affect the NetBSD 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 build.sh), and the default value of each variable. buckle up, bestie ๐ซถ
BSDOBJDIRโ the real path to the object directory tree for the NetBSD source tree.- Default:
/usr/obj.
- Default:
BSDSRCDIRโ the real path to the NetBSD source tree, ifNETBSDSRCDIRisn't defined.- Default:
/usr/src.
- Default:
BUILDโ if defined,make installchecks that themake(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-existentmake(1)targets.- Default: Unset.
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; ifOBJMACHINEis also set, then.BUILDIDis appended after.MACHINE. The identifier will also be used as part of the kernel version string, which can be shown byuname -v.- Default: Unset.
BUILDINFOโ optional multi-line string containing information about the build. This will appear inDESTDIR/etc/release, and it will be stored in thebuildinfovariable in any kernels that are built. When such kernels are booted, thesysctl(7)kern.buildinfovariable will report this value. The string may contain backslash escape sequences, such as\\(representing a backslash character) and\n(representing a newline).- Default: Unset.
BUILDSEEDโg++(1)uses random numbers when compiling C++ code. This variable seeds theg++(1)random number generator using-frandom-seedwith this value. By default, it is set toNetBSD-(majorversion). 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 theg++(1)documentation of-frandom-seed.- Default: Unset.
CDEXTRAโ a space-separated list of files or directories that will be added to the CD-ROM image that may be created by thebuild.shiso-imageoriso-image-sourceoperations. 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. Note: If usingbuild.sh, multiple paths may be specified via multiple-Coptions, or via a single option whose argument contains multiple space-separated paths.- Default: Unset.
CONFIGOPTSโ additional options toconfig(1)when building kernels.- Default: Unset.
COPTSโ extra options for the C compiler. Should be appended to (e.g.,COPTS+=-g), rather than explicitly set.- Note:
CPUFLAGS, notCOPTS, should be used for compiler options that select CPU-related options. - Note:
CFLAGSshould never be set inmk.conf.
- Note:
CPUFLAGSโ additional options passed to the compiler/assembler to select CPU instruction set options, CPU tuning options, etc.- Note: Such options should not be specified in
COPTS, because some parts of the build process need to override CPU-related compiler options. - Default: Unset.
- Note: Such options should not be specified in
DESTDIRโ directory to contain the built NetBSD system. If set, special options are passed to the compilation tools to prevent their default use of the host system's/usr/include,/usr/lib, and so forth. This pathname must be an absolute path, and should not end with a slash (/) character. (For installation into the system's root directory, setDESTDIRto an empty string, not to/). The directory must reside on a file system which supports long file names and hard links.- Note:
build.shwill provide a default ofdestdir.MACHINE(in the top-level.OBJDIR) unless run in โexpertโ mode with the-Eoption. - Default: Empty string if
USETOOLS=yes; otherwise unset.
- Note:
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 aTOOLCHAIN_MISSINGplatform,EXTERNAL_TOOLCHAINcan be used to re-enable the cross-compile framework.- If
EXTERNAL_TOOLCHAINis defined, act asMKGCC=no, since the external version of the compiler may not be able to build the library components of the in-tree compiler. - This variable should be used in conjunction with an appropriate
HAVE_GCCorHAVE_LLVMsetting to control the compiler options. - 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.
- Default: Unset.
- If
INSTALLBOOT_BOARDSโ a list ofevbarmboards for which to create bootable images. If corresponding U-Boot packages are installed, bootable images are created as part of a release. See the-o board=nameoption ofinstallboot(8).- Default: Unset.
INSTALLWORLDDIRโ directory for the top-levelmake(1)installworldtarget to install to. If specified, must be an absolute path.- Default:
/.
- Default:
KERNARCHDIRโ directory underKERNSRCDIRcontaining the machine dependent kernel sources.- Default:
arch/MACHINE.
- Default:
KERNCONFDIRโ directory containing the kernel configuration files.- Default:
KERNSRCDIR/KERNARCHDIR/conf.
- Default:
KERNEL_DIR(experimental) โ can be set toyesorno. Indicates if a top-level directory/netbsd/is created. Ifyes, the directory will contain a kernel file/netbsd/kerneland a corresponding modules directory/netbsd/modules/. System bootstrap procedures will be modified to search for the kernel and modules in the/netbsd/directory. This is intended to simplify system upgrade and rollback procedures by keeping the kernel and its associated modules together in one place.- If
no, the kernel file will be stored in/netbsdand the modules will be stored within the/stand/${ARCH}/directory hierarchy. - The
KERNEL_DIRoption is currently available only foramd64andi386platforms. It is a work-in-progress, and is highly experimental. It is also subject to change without notice. - Default:
no.
- If
KERNOBJDIRโ directory for kernel builds. For example, the kernelGENERICwill be compiled inKERNOBJDIR/GENERIC.- Default:
MAKEOBJDIRPREFIX/KERNSRCDIR/KERNARCHDIR/compileif it exists or themake(1)objtarget is being made; otherwiseKERNSRCDIR/KERNARCHDIR/compile.
- Default:
KERNSRCDIRโ directory at the top of the kernel source.- Default:
NETBSDSRCDIR/sys.
- Default:
LOCALTIMEโ the name of thetzfile(5)timezone file in the directory/usr/share/zoneinfoto symbolically linkDESTDIR/etc/localtimeto.- Default:
UTC.
- Default:
MAKEVERBOSEโ level of verbosity of status messages. Supported values:0โ no descriptive messages or commands executed bymake(1)are shown.1โ brief messages are shown describing what is being done, but the actual commands executed bymake(1)are not shown.2โ descriptive messages are shown as above (prefixed with a#), and ordinary commands performed bymake(1)are shown.3โ in addition to the above, all commands performed bymake(1)are shown, even if they would ordinarily have been hidden through use of the@prefix in the relevant makefile.4โ in addition to the above, commands executed bymake(1)are traced through use of thesh(1)-xflag.- Default:
2.
MKAMDGPUFIRMWAREโ can be set toyesorno. Indicates whether to install the/libdata/firmware/amdgpudirectory, which is necessary for theamdgpu(4)AMD RADEON GPU video driver.- Default:
yesoni386andx86_64;noon other platforms.
- Default:
MKARGON2โ can be set toyesorno. Indicates whether the Argon2 hash is enabled inlibcrypt.- Default:
yes.
- Default:
MKARZEROโ can be set toyesorno. Indicates whetherar(1)should zero the timestamp, uid, and gid in the archive for reproducible builds.MKATFโ can beyesorno, and it's the vibe check for whether the Automated Testing Framework (ATF) gets built and installed. Plot twist: this also controls whether the NetBSD test suite gets built and installed, because the tests literally cannot exist without ATF โ they'd be nothing. ๐
Forced to no if MKCXX=no.
Default: yes.
MKBINUTILSโyesorno, bestie. Says whether any of the binutils tools or libraries get built and installed. Like, the librarieslibbfd,libiberty, or literally anything that depends on them, e.g.as(1),ld(1),dbsym(8), ormdsetimage(8).
Forced to no if TOOLCHAIN_MISSING!=no.
Default: yes.
MKBSDGREPโyesorno, and it's a whole "which one of you is the main character" moment forgrep(1). Ifyes, you get the BSD implementation. Ifno, you get the GNU implementation. Choose your fighter. โจ
Default: no.
MKBSDTARโyesorno. This one decides which implementation ofcpio(1)andtar(1)gets built and installed.yes= thelibarchive-based implementations.no= thepax(1)based ones. Iconic either way. ๐
Default: yes.
MKCATPAGESโyesorno. Indicates whether preformatted plaintext manual pages get created and installed. Extremely retro of them.
Forced to no if MKMAN=no or MKSHARE=no.
Default: no.
MKCLEANSRCโyesorno. Indicates whether โmake cleanโ and โmake cleandirโ will delete file names inCLEANFILESorCLEANDIRFILESfrom both the object directory,.OBJDIR, and the source directory,.SRCDIR.
If yes, then those file names get deleted relative to both .OBJDIR and .CURDIR. If no, the deletion happens relative to .OBJDIR only. Context matters, bestie.
Default: yes.
MKCLEANVERIFYโyesorno. Controls whether โmake cleanโ and โmake cleandirโ verify that files have actually been deleted. Ifyes, file deletions get verified usingls(1). Ifno, no verification, we just trust the process. ๐
Default: yes.
MKCOMPATโyesorno. Indicates whether support for multiple ABIs is to be built and installed.
Forced to no if NOCOMPAT is defined, usually in the Makefile before any make(1) .include directives.
Default: yes on aarch64 (without gcc), earm* (to support compatibility between OABI and EABI binaries), mips64, powerpc64, riscv64, sparc64, and x86_64; no on other platforms.
MKCOMPATMODULESโyesorno. Indicates whether the compat kernel modules get built and installed.
Forced to no if MKCOMPAT=no.
Default: yes on evbppc-powerpc and mips64; no on other platforms.
MKCOMPATTESTSโyesorno. Indicates whether the NetBSD test suite forsrc/compatgets built and installed.
Forced to no if MKCOMPAT=no.
Default: no.
MKCOMPATX11โyesorno. Indicates whether the X11 libraries get built and installed.
Forced to no if MKCOMPAT=no.
Default: no.
MKCOMPLEXโyesorno. Indicates whether the Math Library (libm,-lm) is compiled with support for<complex.h>. Math girlies rise. ๐ง
Default: yes.
MKCROSSGDBโyesorno. Create a cross-gdb as a host tool.
Default: no.
MKCTFโyesorno. Indicates whether CTF tools are to be built and installed. Ifyes, the tools get used to generate and manipulate CTF data of ELF binaries during build.
Forced to no if NOCTF is defined, usually in the Makefile before any make(1) .include directives.
This is disabled internally for standalone programs in /usr/mdec.
Default: yes on aarch64, amd64, and i386; no on other platforms.
MKCVSโyesorno. Indicates whethercvs(1)gets built and installed.
Default: yes.
MKCXXโyesorno. Indicates whether C++ support is enabled.
If no, C++ compilers and software will not be built, and it acts as MKATF=no MKGCCCMDS=no MKGDB=no MKGROFF=no MKKYUA=no. One switch, so much drama. ๐
Default: yes.
MKDEBUGโyesorno. Indicates whether debug information should be generated for all userland binaries. The result gets collected as an additionaldebugandxdebugset and installed inDESTDIR/usr/libdata/debug.
Forced to no if NODEBUG is defined, usually in the Makefile before any make(1) .include directives.
If yes, it acts as MKSTRIPSYM=no.
Default: no.
MKDEBUGKERNELโyesorno. Indicates whether debugging symbols get built for kernels by default; basically pretend as ifmakeoptions DEBUG="-g"is specified in kernel configuration files. This will also put the debug kernelnetbsd.gdbin the kernel sets. Seeoptions(4)for the details. Super useful if a cross-gdb is built as well (seeMKCROSSGDB). ๐ซถ
Default: no.
MKDEBUGLIBโyesorno. Indicates whether debug libraries (lib*_g.a) get built and installed. Debug libraries are compiled with-g -DDEBUG.
Forced to no if NODEBUGLIB is defined, usually in the Makefile before any make(1) .include directives.
Default: no.
MKDEBUGTOOLSโyesorno. Indicates whether debug information (lib*_g.a) gets included in the build toolchain.
Default: no.
MKDEPINCLUDESโyesorno. Indicates whether to add.includestatements in the.dependfiles instead of inlining the contents of the*.dfiles. This is useful when stale dependencies are present, to list the exact files that need refreshing, but it is possibly slower than inlining. Tradeoffs, babes.
Default: no.
MKDOCโyesorno. Indicates whether system documentation destined forDESTDIR/usr/share/docgets installed.
Forced to no if NODOC is defined, usually in the Makefile before any make(1) .include directives.
Forced to no if MKSHARE=no.
Default: yes.
MKDTBโyesorno. Indicates whether the devicetree blobs get built and installed.
Default: yes on aarch64, armv6, armv7, riscv32, and riscv64; no on other platforms.
MKDTCโyesorno. Indicates whether the Device Tree Compiler (dtc) gets built and installed.
Default: yes.
MKDTRACEโyesorno. Indicates whether the kernel modules, utilities, and libraries fordtrace(1)support are to be built and installed.
Default: yes on aarch64, amd64, and i386; no on other platforms.
MKDYNAMICROOTโyesorno. Indicates whether all programs should be dynamically linked, and whether to install the shared libraries required by/binand/sbinand the shared linkerld.elf_so(1)into/lib. Ifno, link programs in/binand/sbinstatically. Static era. โญ
Default: no on ia64; yes on other platforms.
MKFIRMWAREโyesorno. Indicates whether to install the/libdata/firmwaredirectory, which is necessary for various drivers, including:athn(4),bcm43xx(4),bwfm(4),ipw(4),iwi(4),iwm(4),iwn(4),otus(4),ral(4),rtwn(4),rum(4),run(4),urtwn(4),wpi(4),zyd(4), and the Tegra 124 SoC. That's a whole roster, ngl. ๐ฅ
Default: yes on amd64, cobalt, evbarm, evbmips, evbppc, hpcarm, hppa, i386, mac68k, macppc, sandpoint, and sparc64; no on other platforms.
MKGCCโyesorno. Indicates whethergcc(1)or any related libraries (libg2c,libgcc,libobjc,libstdc++) will be built and installed.
Forced to no if TOOLCHAIN_MISSING!=no or EXTERNAL_TOOLCHAIN is defined.
Default: yes.
MKGCCCMDSโyesorno. Indicates whethergcc(1)gets built and installed. Ifno, thenMKGCCcontrols whether the GCC libraries get built and installed.
Forced to no if MKCXX=no.
Default: no on m68000; yes on other platforms.
MKGDBโyesorno. Indicates whethergdb(1)will be built and installed.
(okay so we're mid-variable, bestie โ here's the tail end of the last one, no heading needed, just vibes ๐ )
- Forced to
"no"ifMKCXX=noorTOOLCHAIN_MISSING!=no. - Default:
"no"on ia64 and or1k;"yes"on other platforms.
MKGROFFโ set it to"yes"or"no". It's the switch for whethergroff(1)gets built, installed, and used to format some of the PostScript and PDF documentation. ๐- Forced to
"no"ifMKCXX=no. - Default:
"yes".
- Forced to
MKGROFFHTMLDOCโ"yes"or"no". Controls whethergroff(1)is used to generate HTML for miscellaneous articles, which sometimes needs software that isn't in the base installation. Heads up: this does not affect the generation of HTML man pages.- Default:
"no".
- Default:
MKHESIODโ"yes"or"no". Says whether the Hesiod infrastructure (that's the libraries and support programs) gets built and installed. ๐- Default:
"yes".
- Default:
MKHOSTOBJโ"yes"or"no". Here's the tea: if"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 bymake obj. (This allows multiple host systems to compile NetBSD for a single target architecture.) If"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. ๐๏ธ- Default:
"no".
- Default:
MKHTMLโ"yes"or"no". Indicates whether the HTML manual pages are created and installed. ๐- Forced to
"no"ifNOHTMLis defined, usually in theMakefilebefore anymake(1).includedirectives. - Forced to
"no"ifMKMAN=noorMKSHARE=no. - Default:
"yes".
- Forced to
MKIEEEFPโ"yes"or"no". Indicates whether code for IEEE754/IEC60559 conformance will be built and installed. Lowkey it has no effect on most platforms.- Default:
"yes".
- Default:
MKINET6โ"yes"or"no". Indicates whether INET6 (IPv6) infrastructure (libraries and support programs) will be built and installed. ๐ฐ๏ธ- > Note:
MKINET6must not be set to"no"ifMKX11!=no. - Default:
"yes".
- > Note:
MKINFOโ"yes"or"no". Indicates whether GNU Info files โ the ones used for the documentation for most of the compilation tools โ will be built and installed. ๐- Forced to
"no"ifNOINFOis defined, usually in theMakefilebefore anymake(1).includedirectives. - Forced to
"no"ifMKSHARE=no. - Default:
"yes".
- Forced to
MKIPFILTERโ"yes"or"no". Indicates whether theipf(4)programs, headers, and other components will be built and installed. ๐ก๏ธ- Default:
"yes".
- Default:
MKISCSIโ"yes"or"no". Indicates whether the iSCSI library and applications are built and installed.- Default:
"no"on m68000;"yes"on other platforms.
- Default:
MKKERBEROSโ"yes"or"no". Indicates whether the Kerberos v5 infrastructure (libraries and support programs) will be built and installed. ๐๏ธ- > Caution: the default
pam(8)configuration requires that Kerberos be present even if not used. Do not install a userland without Kerberos without also either updating thepam.conf(5)files or disabling PAM viaMKPAM. Otherwise all logins will fail. ๐ญ - Default:
"yes".
- > Caution: the default
MKKMODโ"yes"or"no". Indicates whether kernel modules will be built and installed. ๐งฉ- Default:
"no"on or1k;"yes"on other platforms.
- Default:
MKKYUAโ"yes"or"no". Indicates whether Kyua (the testing infrastructure used by NetBSD) will be built and installed. ๐งช- Forced to
"no"ifMKCXX=no. - > 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
MKATFvariable. - Default:
"no"until the import of Kyua is done and validated.
- Forced to
MKLDAPโ"yes"or"no". Indicates whether the Lightweight Directory Access Protocol (LDAP) infrastructure (libraries and support programs) will be built and installed. ๐- Default:
"yes".
- Default:
MKLIBCSANITIZERโ"yes"or"no". Indicates whether to use the sanitizer for libc, using the sanitizer defined byUSE_LIBCSANITIZER. ๐งผ- Forced to
"no"ifNOLIBCSANITIZERis defined, usually in theMakefilebefore anymake(1).includedirectives. - Default:
"no".
- Forced to
MKLIBCXXโ"yes"or"no". Indicates if libc++ will be built and installed (usually forclang++(1)). ๐ง- Default:
"yes"ifMKLLVM=yes; otherwise"no".
- Default:
MKLIBSTDCXXโ"yes"or"no". Indicates if libstdc++ will be built and installed (usually forg++(1)).- Default:
"yes".
- Default:
MKLINKLIBโ"yes"or"no". Indicates whether all of the shared library infrastructure will be built and installed. ๐- If
"no", prevents:- installation of the
*.alibraries - installation of the
*_pic.alibraries on PIC systems - building of
*.alibraries on PIC systems - installation of
.sosymlinks on ELF systems
- installation of the
- I.e, only install the shared library (and the
.so.majorsymlink on ELF). - Forced to
"no"ifNOLINKLIBis defined, usually in theMakefilebefore anymake(1).includedirectives. - If
"no", acts asMKLINT=noMKPICINSTALL=noMKPROFILE=no. - Default:
"yes".
- If
MKLINTโ"yes"or"no". Indicates whetherlint(1)will be run against portions of the NetBSD source code during the build, and whether lint libraries will be installed intoDESTDIR/usr/libdata/lint. ๐ง- Forced to
"no"ifNOLINTis defined, usually in theMakefilebefore anymake(1).includedirectives. - Forced to
"no"ifMKLINKLIB=no. - Default:
"no".
- Forced to
MKLLVMโ"yes"or"no". Indicates whetherclang(1)is installed as a host tool and target compiler. ๐- If
"yes", acts asMKLIBCXX=yes. - > Note: Use of
clang(1)as the system compiler is controlled byHAVE_LLVM. - Default:
"no".
- If
MKLLVMRTโ"yes"or"no". 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.)- Default: If
MKX11=yesandHAVE_MESA_VER>=19,"yes"on aarch64, amd64, and i386; otherwise"no".
- Default: If
MKLVMโ"yes"or"no". If not"no", build and install the logical volume manager. ๐ฝ- Default:
"yes".
- Default:
MKMAKEMANDBโ"yes"or"no". Indicates if the whatis tools (apropos(1),whatis(1),getNAME(8),makemandb(8), andmakewhatis(8)), should be built, installed, and used to create and install thewhatis.db. ๐- Default:
"yes".
- Default:
MKMANโ"yes"or"no". Indicates whether manual pages will be installed. (Hi, that's the thing you're reading rn ๐)- Forced to
"no"ifNOMANis defined, usually in theMakefilebefore anymake(1).includedirectives. - Forced to
"no"ifMKSHARE=no. - If
"no", acts asMKCATPAGES=noMKHTML=no. - Default:
"yes".
- Forced to
MKMANDOCโ"yes"or"no". Indicates whethermandoc(1)will be built and installed, and used to create and install catman and HTML pages.MKMANZโ"yes"or"no". Indicates whether manual pages should be compressed withgzip(1)at installation time. ๐๏ธ- Only used if
MKMAN=yes. - Default:
"no".
- Only used if
MKMDNSโ"yes"or"no". Indicates whether the mDNS (Multicast DNS) infrastructure (libraries and support programs) will be built and installed. ๐ก- Default:
"yes".
- Default:
MKNLSโ"yes"or"no". Indicates whether Native Language System (NLS) locale zone files will be built and installed. ๐- Forced to
"no"ifNONLSis defined, usually in theMakefilebefore anymake(1).includedirectives. - Forced to
"no"ifMKSHARE=no. - Default:
"yes".
- Forced to
MKNOUVEAUFIRMWAREโ"yes"or"no". Indicates whether to install the/libdata/firmware/nouveaudirectory, which is necessary for thenouveau(4)NVIDIA video driver. ๐ฅ๏ธ
Default: yes on aarch64, i386, and x86_64, no on other platforms. ๐
(that was the tail end of the last one โ we move, we don't dwell ๐ซถ)
MKNPFโ can beyesorno. Says whether the NPF packet filter gets built and installed. Default:yes. โจMKNSDโ can beyesorno. Says whether the Name Server Daemon (NSD) gets built and installed. Default:no.MKOBJโ can beyesorno. Says whether object directories get created when you runmake obj. If it'sno, then like, all the built files just live inside the regular source tree. Messy but ok.- Forced to
noifNOOBJis defined, usually in the Makefile before anymake(1).includedirectives. - If
no, it acts asMKOBJDIRS=no. - Default:
yes.
- Forced to
โ ๏ธ Note: settingMKOBJtonois not recommended and may cause problems when updating the tree withcvs(1). Like, please don't, bestie ๐ญ
MKOBJDIRSโ can beyesorno. Says whether object directories get created automatically (via amake objpass) at the start of a build.- Forced to
noifMKOBJ=no. - Default:
no.
- Forced to
๐ Note: if you're usingbuild.sh, the default isyes. You can set it tonoby givingbuild.shthe-ooption.
MKPAMโ can beyesorno. Says whether thepam(8)framework (libraries and support files) gets built and installed. Heads up: the pre-PAM code is not supported and may be removed in the future. ๐ Default:noon m68000;yeson other platforms.MKPCCโ can beyesorno. Says whetherpcc(1)or any related libraries (libpcc,libpccsoftfloat) get built and installed. Default:no.MKPFโ can beyesorno. Says whether thepf(4)programs, headers, and LKM get built and installed. Default:yes.MKPICโ can beyesorno. Says whether shared objects and libraries get created and installed. If it'sno, the entire built system is statically linked. (big chonky binaries, we love her ๐ธ)- Forced to
noifNOPICis defined, usually in the Makefile before anymake(1).includedirectives. - If
no, it acts asMKPICLIB=no. - Default:
noon m68000;yeson other platforms.
- Forced to
MKPICINSTALLโ can beyesorno. Says whether thear(1)format libraries (lib*_pic.a) โ the ones used to generate shared libraries โ actually get installed.- Forced to
noifNOPICINSTALLis defined, usually in the Makefile before anymake(1).includedirectives. - Forced to
noifMKLINKLIB=no. - Default:
no.
- Forced to
MKPICLIBโ can beyesorno. Says whether thear(1)format libraries (lib*_pic.a), used to generate shared libraries, are a thing. ๐ฆ- Forced to
noifMKPIC=no. - Default:
noon vax;yeson other platforms.
- Forced to
MKPIEโ can beyesorno. Says whether Position Independent Executables (PIE) get built and installed. ๐- Forced to
noifNOPIEis defined, usually in the Makefile before anymake(1).includedirectives. - Forced to
noifCOVERITY_TOP_CONFIGis defined. - This is disabled internally for standalone programs in
/usr/mdec. - Default:
yeson aarch64, arm, i386, m68k, mips, sh3, sparc64, and x86_64;noon other platforms.
- Forced to
MKPIGZGZIPโ can beyesorno. If it'sno, thepigz(1)utility is not installed asgzip(1). Default:no.MKPOSTFIXโ can beyesorno. Says whether Postfix gets built and installed. Default:yes.MKPROFILEโ can beyesorno. Says whether profiled libraries (lib*_p.a) get built and installed.- Forced to
noifNOPROFILEis defined, usually in the Makefile before anymake(1).includedirectives. - Forced to
noifMKLINKLIB=no. - Default:
noon or1k, riscv32, and riscv64 (due to toolchain problems with profiled code);yeson other platforms.
- Forced to
MKRADEONFIRMWAREโ can beyesorno. Says whether to install the/libdata/firmware/radeondirectory, which is necessary for theradeon(4)AMD RADEON GPU video driver. ๐ฎ Default:yeson aarch64, i386, and x86_64,noon other platforms.MKRELROโ says whether to enable support for Relocation Read-Only (RELRO). The supported values are, like, a whole little menu:partialโ set the non-PLT GOT to read-only.fullโ set the non-PLT GOT to read-only and also force immediate symbol binding, unlessNOFULLRELROis defined and notno(usually in the Makefile before anymake(1).includedirectives).noโ disable RELRO.- Forced to
noifNORELROis defined, usually in the Makefile before anymake(1).includedirectives. - Default:
partialon aarch64, i386, and x86_64;noon other platforms.
MKREPROโ can beyesorno. Says whether builds are meant to be reproducible. If it'syes, two builds from the same source tree will produce the same build results. same energy fr fr โจ- Used as the default for
MKARZERO. - Default:
no.
- Used as the default for
๐ Note: this may be set toyesby givingbuild.shthe-Poption.
MKREPRO_TIMESTAMPโ a Unix timestamp. WhenMKREPROis set, the timestamp of all files in the sets gets set to this value.- Default: unset.
๐ Note: this may be set automatically to the latest source tree timestamp usingcvslatest(1)by givingbuild.shthe-Poption.
MKRUMPโ can beyesorno. Says whether therump(3)headers, libraries, and programs are to be installed.- Forced to
noifCOVERITY_TOP_CONFIGis defined. - See also the variables that start with
RUMPUSER_orRUMP_. - Default:
yes.
- Forced to
MKSANITIZERโ can beyesorno. Says whether to use the sanitizer to compile userland programs, using the sanitizer defined byUSE_SANITIZER.- Forced to
noifNOSANITIZERis defined, usually in the Makefile before anymake(1).includedirectives. - Default:
no.
- Forced to
MKSHAREโ can beyesorno. Says whether files destined to reside inDESTDIR/usr/shareget built and installed.- Forced to
noifNOSHAREis defined, usually in the Makefile before anymake(1).includedirectives. - If
no, it acts asMKCATPAGES=no MKDOC=no MKINFO=no MKHTML=no MKMAN=no MKNLS=no. (one switch, six breakups ๐) - Default:
yes.
- Forced to
MKSKEYโ can beyesorno. Says whether the S/key infrastructure (libraries and support programs) gets built and installed. Default:yes.MKSLJITโ can beyesorno. Says whether to enable support for sljit (stack-less platform-independent Just in Time (JIT) compiler) private library and tests. Default:yeson i386, sparc, and x86_64;noon other platforms.MKSOFTFLOATโ can beyesorno. Says whether the compiler generates output containing library calls for floating point and possibly soft-float library support.- Forced to
yeson arm without'hf', coldfire, emips, or1k, and sh3. - Default:
yeson mips64;noon other platforms.
- Forced to
MKSTATICLIBโ can beyesorno. Says whether the normal static libraries (lib*_g.a) get built and installed.- Forced to
noifNOSTATICLIBis defined, usually in the Makefile before anymake(1).includedirectives. - Default:
yes.
- Forced to
MKSTATICPIEโ can beyesorno. Says whether support for static PIE binaries gets built and installed. These binaries use a special support incrt0.ofor resolving relative relocations and require linker support. ๐ง Default:yeson i386 and x86_64;noon other platforms.MKSTRIPIDENTโ can beyesorno. Says whether RCS IDs, for use withident(1), should be stripped from program binaries and shared libraries. Default:no.MKSTRIPSYMโ set it toyesorno, bestie. It's the vibe check for whether all local symbols get stripped from shared libraries.yes= strip every local symbol, which hits exactly like the-xoption of ld(1).no= only temporary local symbols get the boot, just like the-Xoption of ld(1). And why would you ever wantno? Because keeping non-temporary local symbols (think static function names) is genuinely useful when you're using DTrace on userland libraries and trying to get a backtrace out of a rumpkernel(7) kernel that's loading shared libraries. ๐ซถ
Heads up: this gets forced tonoifMKDEBUG=yes. No arguing, it's the rules.
Default: yes. โจ
MKTEGRAFIRMWAREโyesorno, your call. Controls whether the/libdata/firmware/nvidiadirectory gets installed โ and yes, that's the directory the NVIDIA Tegra XHCI driver literally needs to function. ๐
Default: yes on evbarm; no on every other platform.
MKTPMโyesorno. Do we install the Trusted Platform Module (TPM) infrastructure or not? ๐
Default: no.
MKUNBOUNDโyesorno. Tells you whether the unbound(8) DNS resolver gets built and installed. ๐ฅ
Default: yes.
MKUNPRIVEDโyesorno. This one's giving main character energy: it says whether an unprivileged install will happen. When it's on, the user, group, permissions, and file flags won't be set on the installed items. Instead, all that info gets appended to a file calledMETALOGinDESTDIR. Then theMETALOGcontents get used while generating the distribution tar files, so the right file ownership is still stored. Net effect? You can do a non-rootmake installand it just works. ๐
Default: no.
MKUPDATEโyesorno. When it'syes, every install operation that's meant to write toDESTDIRfirst compares file timestamps and skips the install entirely if the destination files are already up-to-date. Obsessed with not doing redundant work, honestly. โญ
For top-level builds this implies the effects of NOCLEANDIR โ i.e., make cleandir is avoided.
Note: this may be set toyesby handing build.sh the-uoption. ๐
Default: no.
MKX11โyesorno. Indicates whether X11 gets built and installed fromX11SRCDIR, and whether the X sets get created. ๐
Note: ifyes, it requiresMKINET6=yes.
Default: no.
MKX11FONTSโyesorno. Ifno, don't build and install the X fonts. Thexfontset still gets created though โ it'll just be empty (sad, hollow little set ๐ญ). Only used ifMKX11=yes.
Default: yes.
MKX11MOTIFโyesorno. Ifyes, build the native XorglibGLwwith Motif stubs. This one requires that Motif can be found viaX11MOTIFPATH. ๐
Default: no.
MKXORG_SERVERโyesorno. Tells you whether the Xorg(7) X server and its drivers get built and installed. ๐ฅ๏ธ
Default: yes on alpha, amd64, amiga, bebox, cats, dreamcast, ews4800mips, evbarm, evbmips, evbppc, hp300, hpcarm, hpcmips, hpcsh, hppa, i386, ibmnws, iyonix, luna68k, mac68k, macppc, netwinder, newsmips, pmax, prep, ofppc, sgimips, shark, sparc, sparc64, vax, and zaurus; no on other platforms. (That list ate, fr fr. ๐)
MKYPโyesorno. Indicates whether the YP (NIS) infrastructure โ the libraries and support programs โ gets built and installed. ๐
Default: yes.
MKZFSโyesorno. Says whether the ZFS kernel module, plus the utilities and libraries used to manage the ZFS system, are to be built and installed. ๐ธ
Note: ZFS requires 64-bit atomic operations. That's not a vibe, that's a requirement.
Default: yes on aarch64, amd64, and sparc64; no on other platforms.
NETBSDSRCDIRโ the path to the top level of the NetBSD sources. ๐๏ธ
Default: the top level of the NetBSD source tree (as determined by the presence of build.sh and tools/) if make(1) is run from within that tree; otherwise BSDSRCDIR will be used.
NETBSD_OFFICIAL_RELEASEโyesorno. Tells you whether the build creates an official NetBSD release, the kind that's going to be available fromftp.NetBSD.organd/orcdn.NetBSD.orglocations. It 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 telldailybuilds apart from the real-deal releases. ๐
Default: Unset. (I.e., no.)
NETBSD_REVISIONIDโ a tree-wide revision identifier, like a Mercurial or Git commit hash or something similar. If it's set, it gets included in program notes wherever__RCSID(3)and__KERNEL_RCSID(3)are used, and it'll be reported by ident(1). โจ
Default: Unset.
NOCLEANDIRโ if set, it dodges themake cleandirphase of a full build. The effect: only changed files in a source tree get recompiled. Which is a huge slay when you're only updating a few files in the tree and don't want to wait forever. ๐ฆ
See also MKUPDATE.
Default: Unset.
NODISTRIBDIRSโ if set, it dodges themake distrib-dirsphase of a full build. That means it skips running mtree(8) onDESTDIRโ super useful on systems where you're building as an unprivileged user, or where you already know the system-wide mtree(8) files haven't changed. ๐
Default: Unset.
NOINCLUDESโ if set, it dodges themake includesphase of a full build. That stops make(1) from thinking some programs are out-of-date just because the system include files changed.
But bestie, listen: don't use this when you're updating the entire NetBSD source tree arbitrarily. In that case the suggestion is to use MKUPDATE=yes instead. ๐
Default: Unset.
OBJMACHINEโ if defined, it creates objdirs of the formobj.MACHINE, whereMACHINEis the current architecture (as peruname -m). ๐
Default: Unset.
RELEASEDIRโ if set, it specifies the directory that a release(7) layout gets written to at the end of amake release. If you do specify it, it must be an absolute path. โ ๏ธ
Note: build.sh will provide a default ofreleasedir(in the top-level.OBJDIR) unless it's run inexpertmode with the-Eoption.
Default: Unset.
RUMPUSER_THREADSโ defines the threading implementation used by the rumpuser(3) hypercall implementation. Supported values:fiberโ use a fiber interface, with cooperatively scheduled contexts.noneโ do not support kernel threads.pthreadโ use pthread(3) to implement threads.
Default: pthread. ๐งต
RUMP_CURLWPโ defines howcurlwpis obtained in the rumpkernel(7) kernel.curlwpis a very frequently accessed thread-local variable, so optimizing access has a significant performance impact โ like, this matters. Note that all options are not available on hosts/machine architectures. Supported values:hypercallโ use a hypercall to fetch the value.registerโ use a dedicated register. (Implies compiling with-ffixed-reg.)__threadโ use the__threadfeature to fetch the value via thread local storage (TLS).
Default: hypercall. ๐ฅ
RUMP_DEBUGโ if defined, indicates whether rumpkernel(7) kernels are built with-DDEBUG. ๐
Default: Unset.
RUMP_DIAGNOSTICโyesorno. Indicates whether rumpkernel(7) kernels are built with-DDIAGNOSTIC. ๐ฉบ
Default: yes.
RUMP_KTRACEโyesorno. Indicates whether rumpkernel(7) kernels are built with-DKTRACE. ๐
Default: yes.
RUMP_LOCKDEBUGโ if defined, indicates whether rumpkernel(7) kernels are built with-DLOCKDEBUG. ๐
Default: Unset.
RUMP_LOCKS_UPโyesorno. Indicates whether rumpkernel(7) kernels are built with uniprocess-optimized locking or not.
If yes, build with uniprocess-optimized locking, which requires RUMP_NCPU=1 in the environment at runtime.
If no, build with multiprocessor-capable locking.
Default: no. ๐ธ
RUMP_NBCOMPATโ selects which NetBSD userland binary compatibilityCOMPAT_verkernel options are enabled in the rumpkernel(7) kernels. This option is only useful when you're building rumpkernel(7) kernels for NetBSD userspace โ and an empty value may be supplied elsewhere. Supported values (one or more, comma-separated):allโ all supported release versions. Equivalent to50,60,70,80,90.defaultโ default value. Equivalent toall, although this default may change in the future.noneโ no compatibility options are enabled. ๐
50โ NetBSD 5.x compatibility, viaCOMPAT_50kernel option.60โ NetBSD 6.x compatibility, viaCOMPAT_60kernel option.70โ NetBSD 7.x compatibility, viaCOMPAT_70kernel option.80โ NetBSD 8.x compatibility, viaCOMPAT_80kernel option.90โ NetBSD 9.x compatibility, viaCOMPAT_90kernel option.
Default: โallโ. ๐
RUMP_VIRTIFโ okay so this one takes โyesโ or โnoโ, and it tells you whetherrumpkernel(7)kernels get built with support for thevirt(4)network interface.
If it's โnoโ, then no virt(4) support gets built โ and ngl, that's sometimes literally necessary on systems that are missing the headers it needs, like musl libc based Linux. ๐ญ
Default: โyesโ.
RUMP_VNODE_LOCKDEBUGโ if it's defined, this says whetherrumpkernel(7)kernels are built with-DVNODE_LOCKDEBUG.
Default: Unset. (so, vibes only, no lockdebug ๐ซถ)
TOOLCHAIN_MISSINGโ can be โyesโ or โnoโ. If it's not โnoโ, that means the platformMACHINE_ARCHyou're building doesn't have a working in-tree toolchain. ๐
If it's not โnoโ, it acts as MKBINUTILS=no MKGCC=no MKGDB=no.
Default: โnoโ.
TOOLDIRโ the directory that holds the host tools once they're built. If you set it, it must be an absolute path, no exceptions, periodt. This directory should be unique to a given host system and NetBSD source tree. (But like โ multiple target architectures can share the sameTOOLDIR, because the target-architecture-dependent files have unique names. icon behavior โจ) If you leave it unset, a default gets created in the.OBJDIRofsrc, based on theuname(1)info of the host platform.
Default: Unset.
USETOOLSโ โyesโ or โnoโ. Says whether the tools specified byTOOLDIRshould be used as part of a build that's in progress. Must be set to โyesโ if you're cross-compiling. Supported values:yesโ use the tools fromTOOLDIR.noโ do not use the tools fromTOOLDIR, but refuse to build native compilation tool components that are version-specific for that tool.neverโ do not use the tools fromTOOLDIR, even when building native tool components. This is similar to the traditional NetBSD build method, but it doesn't verify that the compilation tools in use are up-to-date enough to build the tree successfully. โ ๏ธ Heads up: this may cause build or runtime problems when you're building the whole NetBSD source tree.
Default: โnoโ when using โจbsd.*.mkโฉ outside the NetBSD source tree (it detects this automatically) or if TOOLCHAIN_MISSING=yes; otherwise โyesโ.
USE_FORTโ โyesโ or โnoโ. Says whether the so-called โFORTIFY_SOURCEโsecurity(7)extensions are enabled; seessp(3)for the deets. Lowkey this imposes some performance penalty, just so you know. ๐ข
Forced to โnoโ if NOFORT is defined โ usually in the Makefile before any make(1) .include directives.
Default: โnoโ.
USE_HESIODโ โyesโ or โnoโ. Says whether Hesiod support is enabled in the various applications that support it.
Forced to โnoโ if MKHESIOD=no.
Default: โyesโ.
USE_INET6โ โyesโ or โnoโ. Says whether INET6 (IPv6, the future, the main character ๐) support is enabled in the various applications that support it.
Forced to โnoโ if MKINET6=no.
Default: โyesโ.
USE_JEMALLOCโ โyesโ or โnoโ. Says whether the jemalloc allocator (designed for improved performance with threaded applications, iykyk) is used instead of the phkmalloc allocator (which was the default until NetBSD 5.0, rip bozo ๐).
Default: โyesโ.
USE_KERBEROSโ โyesโ or โnoโ. Says whether Kerberos v5 support is enabled in the various applications that support it.
Forced to โnoโ if MKKERBEROS=no.
Default: โyesโ.
USE_LDAPโ โyesโ or โnoโ. Says whether LDAP support is enabled in the various applications that support it.
Forced to โnoโ if MKLDAP=no.
Default: โyesโ.
USE_LIBCSANITIZERโ picks the sanitizer in libc to compile userland programs and libraries with. Supported values: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 differs from the UBSan available inMKSANITIZER. The runtime is stripped down from C++ features, and is invoked with-fsanitize=no-vptrbecause that sanitizer is not supported. The runtime configuration is restricted to theLIBC_UBSANenvironment variable, which is designed to be safe for hardening. ๐ก๏ธ
The value of USE_LIBCSANITIZER gets passed to the C and C++ compilers as the argument to -fsanitize=. You can pass additional sanitizer arguments through LIBCSANITIZERFLAGS.
Disabled if MKLIBCSANITIZER=no.
Default: โundefinedโ.
USE_PAMโ โyesโ or โnoโ. Says whetherpam(8)support is enabled in the various applications that support it.
Forced to โnoโ if MKPAM=no.
Default: โyesโ.
USE_PIGZGZIPโ โyesโ or โnoโ. Says whetherpigz(1)is used instead ofgzip(1)for multi-threaded gzip compression of the distribution tar sets. ๐ทโก
Default: โnoโ.
USE_SANITIZERโ picks the sanitizer to compile userland programs and libraries with. Supported values (you can have one or more, comma-separated):addressโ a memory error detector.cfiโ a control flow detector.dataflowโ a general data flow analysis.leakโ a memory leak detector.memoryโ an uninitialized memory read detector.safe-stackโ protect against stack-based corruption.scudoโ the Scudo Hardened Allocator.threadโ a data race detector.undefinedโ an undefined behavior detector.
The value of USE_SANITIZER gets passed to the C and C++ compilers as the argument to -fsanitize=. Additional sanitizer arguments can be passed through SANITIZERFLAGS.
Fr fr the list of supported features and their valid combinations depends on the compiler version and the target CPU architecture โ so don't @ me if your fave combo isn't there. ๐
Disabled if MKSANITIZER=no.
Default: โaddressโ.
USE_SKEYโ โyesโ or โnoโ. Says whether S/key support is enabled in the various applications that support it.
Forced to โnoโ if MKSKEY=no.
Note: this is mutually exclusive to USE_PAM!=no. ๐
pick a lane bestie.
Default: โnoโ.
USE_SSPโ โyesโ or โnoโ. Says whether GCC stack-smashing protection (SSP) support is enabled โ that's the thing that detects stack overflows and aborts the program. This imposes some performance penalty (approximately 5%, so yeah, real money).
This is disabled internally for standalone programs in /usr/mdec.
Forced to โnoโ if NOSSP is defined โ usually in the Makefile before any make(1) .include directives.
Forced to โnoโ if COVERITY_TOP_CONFIG is defined.
Default: โnoโ on alpha, hppa, ia64, and mips; โyesโ on other platforms if USE_FORT=yes; otherwise โnoโ.
USE_XZ_SETSโ โyesโ or โnoโ. Says whether the distribution tar files get compressed withxz(1)instead ofgzip(1)orpigz(1).
Forced to โnoโ if USE_PIGZGZIP=yes.
Default: โyesโ on aarch64, amd64, and sparc64, โnoโ on other platforms.
USE_YPโ โyesโ or โnoโ. Says whether YP (NIS) support is enabled in the various applications that support it.
Forced to โnoโ if MKYP=no.
Default: โyesโ.
X11MOTIFPATHโ path of the Motif installation to use ifMKX11MOTIF=yes.
Default: โ/usr/pkgโ.
X11SRCDIRโ the directory containing the modular Xorg source. If you specify it, it must be an absolute path. The main modular Xorg source is found inX11SRCDIR/external/mit.
Default: NETBSDSRCDIR/../xsrc, if that exists; otherwise โ/usr/xsrcโ.
๐ธ PKGSRC SYSTEM VARIABLES ๐ธ
okay bestie, for this part you gotta go read the pkgsrc guide โ it lives at https://www.netbsd.org/docs/pkgsrc/ โ or peep pkgsrc/doc/pkgsrc.txt for all the extra variables used internally by the package system. And if you want package-specific examples, ${PKGSRCDIR}/mk/defaults/mk.conf is literally right there waiting for you. ๐ซถโจ
๐๏ธ OBSOLETE VARIABLES ๐๏ธ
okay so these ones? they're obsolete, bestie โ like they had their moment and now they're retired. do not use them, periodt. ๐
EXTSRCSRCDIRโ obsolete. gone. bye. ๐MKBFDโ useMKBINUTILSinstead, bestie.MKCRYPTOโ obsolete. it's giving ghost ofmk.confpast. ๐MKEXTSRCโ obsolete. not the main character anymore.MKKDEBUGโ useMKDEBUGKERNELinstead.MKKERBEROS4โ obsolete. retired fr fr.MKLLDโ obsolete. lowkey ancient.MKLLDBโ obsolete. also ancient.MKMCLINKERโ obsolete. no cap.MKPERFUSEโ obsolete. bye bestie. ๐ฆMKTOOLSDEBUGโ useMKDEBUGTOOLSinstead.NBUILDJOBSโ use thebuild.shandmake(1)option-jinstead.SHAREDSTRINGSโ obsolete. it's not slaying anymore.USE_COMBINEโ obsolete. don't let it back in the group chat. ๐USE_NEW_TOOLCHAINโ the new toolchain is now the default, slay. to disable it, useTOOLCHAIN_MISSING=yes.
๐ FILES ๐
these are the spots where mk.conf and friends hang out, iykyk:
/etc/mk.confโ themk.conffile resides in/etc. that's the whole vibe. โจ${PKGSRCDIR}/mk/defaults/mk.confโ examples for settings regarding the pkgsrc collection. very demure, very mindful. ๐
๐ SEE ALSO ๐
if you wanna go deeper (and you should, you're a main character), check out all these:
apropos(1), ar(1), as(1), clang(1), clang++(1), config(1), cpio(1), cvs(1), cvslatest(1), dtrace(1), g++(1), gcc(1), gdb(1), groff(1), gzip(1), ident(1), ld(1), ld.elf_so(1), lint(1), ls(1), make(1), mandoc(1), pax(1), pcc(1), pigz(1), sh(1), tar(1), uname(1), whatis(1), xz(1), rump(3), rumpuser(3), ssp(3), amdgpu(4), athn(4), bcm43xx(4), bwfm(4), ipf(4), ipw(4), iwi(4), iwm(4), iwn(4), nouveau(4), options(4), otus(4), pf(4), radeon(4), ral(4), rtwn(4), rum(4), run(4), urtwn(4), virt(4), wpi(4), zyd(4), pam.conf(5), release(7), rumpkernel(7), security(7), Xorg(7), dbsym(8), getNAME(8), installboot(8), makemandb(8), makewhatis(8), mdsetimage(8), mtree(8), pam(8), unbound(8), /usr/share/mk/bsd.README, src/BUILDING, pkgsrc/doc/pkgsrc.txt, https://www.netbsd.org/docs/pkgsrc/
๐ HISTORY ๐
fun fact: the mk.conf file appeared in NetBSD 1.2. iconic behavior from day one. ๐
and that's a wrap, bestie! this iconic page is from Debian, dated May 3, 2025, and it's page MK.CONF(5) โ periodt. ๐ซถ๐โจ
๐ฆ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 1999-2023 The NetBSD Foundation, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms