Updated: 2022/Sep/29

Please read Privacy Policy. It's for your privacy.


MK.CONF(5)                    File Formats Manual                   MK.CONF(5)

NAME
     mk.conf - make configuration file

DESCRIPTION
     The mk.conf file overrides various parameters used during the build of
     the system.

     Listed below are the mk.conf variables that may be set, the values to
     which each may be set, a brief description of what each variable does,
     and a reference to relevant manual pages.

   NetBSD System variables
     NETBSDSRCDIR   The path to the top level of the NetBSD sources.  If
                    make(1) is run from within the NetBSD source tree, the
                    default is the top level of that tree (as determined by
                    the presence of build.sh and tools/), otherwise BSDSRCDIR
                    will be used.

     BSDOBJDIR      The real path to the `obj' tree for the NetBSD source
                    tree.

                    Default: /usr/obj

     BSDSRCDIR      The real path to the NetBSD source tree.

                    Default: /usr/src

     BUILD          If defined, `make install' checks that the 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 targets.

                    Default: Unset.

     BUILDID        Identifier for the build.  The identifier will be appended
                    to object directory names, and can be consulted in the
                    make(1) configuration file in order to set additional
                    build parameters, such as compiler flags.

                    Default: Unset.

     COPTS          Extra options for the C compiler.  Should be appended to
                    (e.g., COPTS+=-g), rather than explicitly set.  Note that
                    CPUFLAGS, not COPTS, should be used for compiler flags
                    that select CPU-related options.  Also note that CFLAGS
                    should never be set in mk.conf.

     CPUFLAGS       Additional flags passed to the compiler/assembler to
                    select CPU instruction set options, CPU tuning options,
                    etc.  Such options should not be specified in COPTS,
                    because some parts of the build process need to override
                    CPU-related compiler options.

     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
                    should not end with a slash (/) character (for
                    installation into the system's root directory, set DESTDIR
                    to an empty string).  The directory must reside on a file
                    system which supports long file names and hard links.

                    Default: Empty string if USETOOLS is "yes"; unset
                    otherwise.

                    Note: build.sh will provide a default of destdir.MACHINE
                    (in the top-level .OBJDIR) unless run in `expert' mode

     KERNEL_DIR (experimental)
                    Can be set to "yes" or "no".  Indicates if a top-level
                    directory /netbsd/ is created.  If "yes", the directory
                    will contain a kernel file /netbsd/kernel and 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 /netbsd and the
                    modules will be stored within the /stand/${ARCH}/
                    directory hierarchy.

                    The KERNEL_DIR option is a work-in-progress, and is highly
                    experimental.  It is also subject to change without
                    notice.

                    Default: "no"

     MAKEVERBOSE    Level of verbosity of status messages.  Supported values:

                    0    No descriptive messages or commands executed by
                         make(1) are shown.

                    1    Brief messages are shown describing what is being
                         done, but the actual commands executed by make(1) are
                         not displayed.

                    2    Descriptive messages are shown as above (prefixed
                         with a `#'), and ordinary commands performed by
                         make(1) are displayed.

                    3    In addition to the above, all commands performed by
                         make(1) are displayed, 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 by
                         make(1) are traced through use of the sh(1) "-x"
                         flag.

                    Default: 2

     MKATF          Can be set to "yes" or "no".  Indicates whether the
                    Automated Testing Framework is built and installed.  This
                    also controls whether the NetBSD test suite is built and
                    installed, as the tests rely on ATF and cannot be built
                    without it.

                    Default: "yes"

     MKBINUTILS     Can be set to "yes" or "no".  Indicates whether any of the
                    binutils tools or libraries should be built.  That is, the
                    libraries libbfd, libiberty, or any of the things that
                    depend upon them, e.g.  as(1), ld(1), dbsym(8), or
                    mdsetimage(8).

                    Default: "yes"

     MKBSDTAR       Can be set to "yes" or "no".  If "yes", libarchive-based
                    implementations of cpio(1) and tar(1) are built and
                    installed.  If "no", pax(1) based frontends are used.

                    Default: "yes"

     MKCATPAGES     Can be set to "yes" or "no".  Indicates whether
                    preformatted plaintext manual pages will be created and
                    installed.

                    Default: "no"

     MKCLEANSRC     Can be set to "yes" or "no".  Indicates whether `make
                    clean' and `make cleandir' will delete file names in
                    CLEANFILES or CLEANDIRFILES from both the object
                    directory, .OBJDIR, and the source directory, .SRCDIR.

                    If "yes", then these file names will be deleted relative
                    to both .OBJDIR and .CURDIR.  If "no", then the deletion
                    will be performed relative to .OBJDIR only.

                    Default: "yes"

     MKCLEANVERIFY  Can be set to "yes" or "no".  Controls whether `make
                    clean' and `make cleandir' will verify that files have
                    been deleted.  If "yes", then file deletions will be
                    verified using ls(1).  If "no", then file deletions will
                    not be verified.

                    Default: "yes"

     MKCOMPAT       Can be set to "yes" or "no".  Indicates whether support
                    for multiple ABIs is to be built and installed.

                    Default: "yes" on amd64, mips64 and sparc64, "no" on other
                    architectures.

     MKCOMPLEX      Can be set to "yes" or "no".  Indicates whether the Math
                    Library (libm, -lm) is compiled with support for
                    <complex.h>.

                    Default: "yes"

     MKCTF          Can be set to "yes" or "no".  Indicates whether CTF tools
                    are to be built and installed.  If yes, the tools will be
                    used to generate and manipulate CTF data of ELF binaries
                    during build.

                    Default: "no"

     MKCVS          Can be set to "yes" or "no".  Indicates whether cvs(1) is
                    built.

                    Default: "yes"

     MKDEBUG        Can be set to "yes" or "no".  Indicates whether separate
                    debugging symbols should be installed into
                    DESTDIR/usr/libdata/debug.

                    Default: "no"

     MKDEBUGKERNEL  Can be set to "yes" or "no".  Indicates whether debugging
                    symbols will be built for kernels by default; pretend as
                    if makeoptions DEBUG="-g" is specified in kernel
                    configuration files.  This will also put the debug kernel
                    in the kernel sets.  See options(4) for details.

                    Default: "no"

     MKDEBUGLIB     Can be set to "yes" or "no".  Indicates whether debug
                    libraries (lib*_g.a) will be built and installed.  Debug
                    libraries are compiled with "-g -DDEBUG".

                    Default: "no"

     MKDEBUGTOOLS   Can be set to "yes" or "no".  Indicates whether debug
                    information (lib*_g.a) will be included in the build
                    toolchain.

                    Default: "no"

     MKDOC          Can be set to "yes" or "no".  Indicates whether system
                    documentation destined for DESTDIR/usr/share/doc will be
                    installed.

                    Default: "yes"

     MKDTRACE       Can be set to "yes" or "no".  Indicates whether the kernel
                    modules, utilities and libraries for dtrace(1) support are
                    to be built and installed.

                    Default: "no"

     MKDYNAMICROOT  Can be set to "yes" or "no".  Indicates whether all
                    programs should be dynamically linked, and to install
                    shared libraries required by /bin and /sbin and the shared
                    linker ld.elf_so(1) into /lib.  If `no', link programs in
                    /bin and /sbin statically.

                    Default: "yes"

     MKGCC          Can be set to "yes" or "no".  Indicates whether gcc(1) or
                    any related libraries (libg2c, libgcc, libobjc, libstdc++)
                    are built.

                    Default: "yes"

     MKGCCCMDS      Can be set to "yes" or "no".  Indicates whether gcc(1) is
                    built.  If "no", then MKGCC controls if the GCC libraries
                    are built.

                    Default: "yes"

     MKGDB          Can be set to "yes" or "no".  Indicates whether gdb(1) is
                    built.

                    Default: "yes"

     MKHESIOD       Can be set to "yes" or "no".  Indicates whether the Hesiod
                    infrastructure (libraries and support programs) is built
                    and installed.

                    Default: "yes"

     MKHOSTOBJ      Can be set to "yes" or "no".  If set to "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 "make obj".  (This allows multiple host systems
                    to compile NetBSD for a single target.)  If set to "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.

                    Default: "no"

     MKHTML         Can be set to "yes" or "no".  Indicates whether the HTML
                    manual pages are created and installed.

                    Default: "yes"

     MKIEEEFP       Can be set to "yes" or "no".  Indicates whether code for
                    IEEE754/IEC60559 conformance is built.  Has no effect on
                    most platforms.

                    Default: "yes"

     MKINET6        Indicates whether INET6 (IPv6) infrastructure (libraries
                    and support programs) is built and installed.

                    Default: "yes"

     MKINFO         Can be set to "yes" or "no".  Indicates whether GNU Info
                    files, used for the documentation for most of the
                    compilation tools, will be built and installed.

                    Default: "yes"

     MKIPFILTER     Can be set to "yes" or "no".  Indicates whether the ipf(4)
                    programs, headers and other components will be built and
                    installed.

                    Default: "yes"

     MKISCSI        Can be set to "yes" or "no".  Indicates whether the iSCSI
                    library and applications are built and installed.

                    Default: "yes"

     MKKERBEROS     Can be set to "yes" or "no".  Indicates whether the
                    Kerberos v5 infrastructure (libraries and support
                    programs) is 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 the pam.conf(5)
                    files or disabling PAM via MKPAM.  Otherwise all logins
                    will fail.

                    Default: "yes"

     MKKMOD         Can be set to "yes" or "no".  Indicates whether kernel
                    modules are built and installed.

                    Default: "yes"

     MKKYUA         Can be set to "yes" or "no".  Indicates whether Kyua (the
                    testing infrastructure used by NetBSD) is built and
                    installed.  Note that 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 MKATF knob.

                    Default: "no" until the import of Kyua is done and
                    validated.

     MKLDAP         Can be set to "yes" or "no".  Indicates whether the
                    Lightweight Directory Access Protocol (LDAP)
                    infrastructure (libraries and support programs) is built
                    and installed.

                    Default: "yes"

     MKLINKLIB      Can be set to "yes" or "no".  Indicates whether all of the
                    shared library infrastructure is built.  If `no',
                    prevents: installation of the *.a libraries, installation
                    of the *_pic.a libraries on PIC systems, building of *.a
                    libraries on PIC systems, or installation of .so symlinks
                    on ELF systems.

                    Default: "yes"

                    If "no", acts as MKPICINSTALL=no MKPROFILE=no.

     MKLINT         Can be set to "yes" or "no".  Indicates whether lint(1)
                    will be run against portions of the NetBSD source code
                    during the build, and whether lint libraries will be
                    installed into DESTDIR/usr/libdata/lint.

                    Default: "yes"

     MKLVM          Can be set to "yes" or "no".  If not "no", build and
                    install the logical volume manager.

                    Default: "yes"

     MKMAN          Can be set to "yes" or "no".  Indicates whether manual
                    pages will be installed.

                    Default: "yes"

                    If "no", acts as MKCATPAGES=no MKHTML=no.

     MKMANZ         Can be set to "yes" or "no".  Indicates whether manual
                    pages should be compressed with gzip(1) at installation
                    time.

                    Default: "no"

     MKMDNS         Can be set to "yes" or "no".  Indicates whether the mDNS
                    (Multicast DNS) infrastructure (libraries and support
                    programs) is built and installed.

                    Default: "yes"

     MKNLS          Can be set to "yes" or "no".  Indicates whether Native
                    Language System (NLS) locale zone files will be built and
                    installed.

                    Default: "yes"

     MKNOUVEAUFIRMWARE
                    Can be set to "yes" or "no".  Indicates whether to install
                    the /libdata/firmware/nouveau directory, which is
                    necessary for the nvidia DRM driver.

                    Default: Platform dependent.

     MKNPF          Can be set to "yes" or "no".  Indicates whether the NPF
                    packet filter is to be built and installed.

                    Default: "yes"

     MKOBJ          Can be set to "yes" or "no".  Indicates whether object
                    directories will be created when running "make obj".  If
                    set to "no", then all built files will be located inside
                    the regular source tree.

                    Default: "yes"

                    If "no", acts as MKOBJDIRS=no.

     MKOBJDIRS      Can be set to "yes" or "no".  Indicates whether object
                    directories will be created automatically (via a "make
                    obj" pass) at the start of a build.

                    Default: "no"

     MKPAM          Can be set to "yes" or "no".  Indicates whether the pam(8)
                    framework (libraries and support files) is built.  The
                    pre-PAM code is not supported and may be removed in the
                    future.

                    Default: "yes"

     MKPCC          Can be set to "yes" or "no".  Indicates whether pcc(1) or
                    any related libraries (libpcc, libpccsoftfloat) are built.

                    Default: "no"

     MKPF           Can be set to "yes" or "no".  Indicates whether the pf(4)
                    programs, headers and LKM will be built and installed.

                    Default: "yes"

     MKPIC          Can be set to "yes" or "no".  Indicates whether shared
                    objects and libraries will be created and installed.  If
                    set to "no", the entire built system will be statically
                    linked.

                    Default: Platform dependent.  As of this writing, all
                    platforms except m68000 default to "yes".

                    If "no", acts as MKPICLIB=no.

     MKPICINSTALL   Can be set to "yes" or "no".  Indicates whether the ar(1)
                    format libraries (lib*_pic.a), used to generate shared
                    libraries, are installed.

                    Default: "yes"

     MKPICLIB       Can be set to "yes" or "no".  Indicates whether the ar(1)
                    format libraries (lib*_pic.a), used to generate shared
                    libraries.

                    Default: "yes"

     MKPIE          Indicates whether Position Independent Executables (PIE)
                    are built and installed.

                    Default: Platform dependent.

     MKPIGZGZIP     Can be set to "yes" or "no".  If "no", the pigz(1) utility
                    is not installed as gzip(1).

                    Default: "no"

     MKPOSTFIX      Can be set to "yes" or "no".  Indicates whether Postfix is
                    built.

                    Default: "yes"

     MKPROFILE      Can be set to "yes" or "no".  Indicates whether profiled
                    libraries (lib*_p.a) will be built and installed.

                    Default: "yes"; however, some platforms turn off MKPROFILE
                    by default at times due to toolchain problems with
                    profiled code.

     MKREPRO        Can be set to "yes" or "no".  Indicates whether builds are
                    to be reproducible.  If "yes", two builds from the same
                    source tree will produce the same build results.

                    Default: "no"

     MKRADEONFIRMWARE
                    Can be set to "yes" or "no".  Indicates whether to install
                    the /libdata/firmware/radeon directory, which is necessary
                    for the radeon DRM driver.

                    Default: Platform dependent.

     MKRELRO        If "partial", set the non-PLT GOT to read-only.  If
                    "full", also force immediate symbol binding.

                    Default: Platform dependent.

     MKRUMP         Can be set to "yes" or "no".  Indicates whether the
                    rump(3) headers, libraries and programs are to be
                    installed.

                    Default: "yes"

     MKSHARE        Can be set to "yes" or "no".  Indicates whether files
                    destined to reside in DESTDIR/usr/share will be built and
                    installed.

                    Default: "yes"

                    If "no", acts as MKCATPAGES=no MKDOC=no MKINFO=no
                    MKHTML=no MKMAN=no MKNLS=no.

     MKSKEY         Can be set to "yes" or "no".  Indicates whether the S/key
                    infrastructure (libraries and support programs) is built.

                    Default: "yes"

     MKSOFTFLOAT    Can be set to "yes" or "no".  Indicates whether the
                    compiler generates output containing library calls for
                    floating point and possibly soft-float library support.

                    Default: "no"

     MKSTATICLIB    Can be set to "yes" or "no".  Indicates whether the normal
                    static libraries (lib*_g.a) will be built and installed.

                    Default: "yes"

     MKSTRIPIDENT   Can be set to "yes" or "no".  Indicates whether RCS IDs,
                    for use with ident(1), should be stripped from program
                    binaries and shared libraries.

                    Default: "no"

     MKSTRIPSYM     Can be set to "yes" or "no".  Indicates whether all local
                    symbols should be stripped from shared libraries.  If
                    "yes", strip all local symbols from shared libraries; the
                    affect is equivalent to the -x option of ld(1).  If "no",
                    strip only temporary local symbols; the affect is
                    equivalent to the -X option of 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 rump kernel loading shared libraries.

                    Default: "yes"

     MKUNPRIVED     Can be set to "yes" or "no".  Indicates whether an
                    unprivileged install will occur.  The user, group,
                    permissions, and file flags, will not be set on the
                    installed item; instead the information will be appended
                    to a file called METALOG in DESTDIR.  The contents of
                    METALOG is used during the generation of the distribution
                    tar files to ensure that the appropriate file ownership is
                    stored.

                    Default: "no"

     MKUPDATE       Can be set to "yes" or "no".  Indicates whether all
                    install operations intended to write to DESTDIR will
                    compare file timestamps before installing, and skip the
                    install phase if the destination files are up-to-date.
                    This also has implications on full builds (see next
                    subsection).

                    Default: "no"

     MKX11          Can be set to "yes" or "no".  Indicates whether X11 is
                    built and installed (by descending into
                    src/external/mit/xorg).

                    Default: "no"

     MKX11FONTS     Can be set to "yes" or "no".  If "no", do not build and
                    install the X fonts.

                    Default: "yes"

     X11MOTIFPATH   Location of the Motif installation to use if setting
                    MKX11MOTIF to "yes".

                    Default: /usr/pkg

     MKX11MOTIF     Can be set to "yes" or "no".  If "yes", build the native
                    Xorg libGLw with Motif stubs.  Requires that Motif can be
                    found via X11MOTIFPATH.

                    Default: "no"

     MKYP           Can be set to "yes" or "no".  Indicates whether the YP
                    (NIS) infrastructure (libraries and support programs) is
                    built.

                    Default: "yes"

     MKZFS          Can be set to "yes" or "no".  Indicates whether the ZFS
                    kernel module and the utilities and libraries used to
                    manage the ZFS system are to be built.

                    Default: "yes" on amd64, "no" on other architectures.

     OBJMACHINE     If defined, creates objdirs of the form obj.MACHINE, where
                    MACHINE is the current architecture (as per `uname -m').

     RELEASEDIR     If set, specifies the directory to which a release(7)
                    layout will be written at the end of a "make release".

                    Default: Unset.

                    Note: build.sh will provide a default of releasedir (in
                    the top-level .OBJDIR) unless run in `expert' mode

     TOOLDIR        Directory to hold the host tools, once built.  This
                    directory should be unique to a given host system and
                    NetBSD source tree.  (However, multiple targets may share
                    the same TOOLDIR; the target-dependent files have unique
                    names.)  If unset, a default based on the uname(1)
                    information of the host platform will be created in the
                    .OBJDIR of src.

                    Default: Unset.

     USE_FORT       Indicates whether the so-called "FORTIFY_SOURCE"
                    security(7) extensions are enabled; see ssp(3) for
                    details.  This imposes some performance penalty.

                    Default: "no"

     USE_HESIOD     Can be set to "yes" or "no".  Indicates whether Hesiod
                    support is enabled in the various applications that
                    support it.  If MKHESIOD=no, USE_HESIOD will also be
                    forced to "no".

                    Default: "yes"

     USE_INET6      Can be set to "yes" or "no".  Indicates whether INET6
                    (IPv6) support is enabled in the various applications that
                    support it.  If MKINET6=no, USE_INET6 will also be forced
                    to "no".

                    Default: "yes"

     USE_JEMALLOC   Can be set to "yes" or "no".  Indicates whether the
                    jemalloc allocator (which is designed for improved
                    performance with threaded applications) is used instead of
                    the phkmalloc allocator (that was the default until
                    NetBSD 5.0).

                    Default: "yes"

     USE_KERBEROS   Can be set to "yes" or "no".  Indicates whether Kerberos
                    v5 support is enabled in the various applications that
                    support it.  If MKKERBEROS=no, USE_KERBEROS will also be
                    forced to "no".

                    Default: "yes"

     USE_LDAP       Can be set to "yes" or "no".  Indicates whether LDAP
                    support is enabled in the various applications that
                    support it.  If MKLDAP=no, USE_LDAP will also be forced to
                    "no".

                    Default: "yes"

     USE_PAM        Can be set to "yes" or "no".  Indicates whether pam(8)
                    support is enabled in the various applications that
                    support it.  If MKPAM=no, USE_PAM will also be forced to
                    "no".

                    Default: "yes"

     USE_SKEY       Can be set to "yes" or "no".  Indicates whether S/key
                    support is enabled in the various applications that
                    support it.  If MKSKEY=no, USE_SKEY will also be forced to
                    "no".

                    Default: "yes"

                    This is mutually exclusive to USE_PAM!=no.

     USE_SSP        Can be set to "yes" or "no".  Indicates whether GCC stack-
                    smashing protection (SSP) support, which detects stack
                    overflows and aborts the program, is enabled.  This
                    imposes some performance penalty.

                    Default: "yes"

     USE_YP         Can be set to "yes" or "no".  Indicates whether YP (NIS)
                    support is enabled in the various applications that
                    support it.  If MKYP=no, USE_YP will also be forced to
                    "no".

                    Default: "yes"

     USETOOLS       Indicates whether the tools specified by TOOLDIR should be
                    used as part of a build in progress.  Must be set to "yes"
                    if cross-compiling.

                    yes    Use the tools from TOOLDIR.

                    no     Do not use the tools from TOOLDIR, but refuse to
                           build native compilation tool components that are
                           version-specific for that tool.

                    never  Do not use the tools from TOOLDIR, even when
                           building native tool components.  This is similar
                           to the traditional NetBSD build method, but does
                           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 NetBSD source
                           tree.

                    Default: "yes" if building all or part of a whole NetBSD
                    source tree (detected automatically); "no" otherwise (to
                    preserve traditional semantics of the <bsd.*.mk> make(1)
                    include files).

   pkgsrc system variables
     Please see the pkgsrc guide at
     http://www.netbsd.org/Documentation/pkgsrc/ or pkgsrc/doc/pkgsrc.txt for
     more variables used internally by the package system and
     ${PKGSRCDIR}/mk/defaults/mk.conf for package-specific examples.

FILES
     /etc/mk.conf  This file.

     ${PKGSRCDIR}/mk/defaults/mk.conf
                   Examples for settings regarding the pkgsrc collection.

SEE ALSO
     make(1), /usr/share/mk/bsd.README, pkgsrc/doc/pkgsrc.txt,
     http://www.netbsd.org/Documentation/pkgsrc/

HISTORY
     The mk.conf file appeared in NetBSD 1.2.

NetBSD 9.99                      July 9, 2022                      NetBSD 9.99