aboutsummaryrefslogtreecommitdiff
path: root/share/mk
diff options
context:
space:
mode:
Diffstat (limited to 'share/mk')
-rw-r--r--share/mk/Makefile1
-rw-r--r--share/mk/bsd.README4
-rw-r--r--share/mk/bsd.compat.mk1
-rw-r--r--share/mk/bsd.confs.mk8
-rw-r--r--share/mk/bsd.cpu.mk19
-rw-r--r--share/mk/bsd.debug.mk68
-rw-r--r--share/mk/bsd.endian.mk13
-rw-r--r--share/mk/bsd.lib.mk121
-rw-r--r--share/mk/bsd.libnames.mk1
-rw-r--r--share/mk/bsd.man.mk82
-rw-r--r--share/mk/bsd.nls.mk9
-rw-r--r--share/mk/bsd.opts.mk3
-rw-r--r--share/mk/bsd.own.mk7
-rw-r--r--share/mk/bsd.prog.mk55
-rw-r--r--share/mk/bsd.test.mk3
-rw-r--r--share/mk/local.dirdeps-options.mk1
-rw-r--r--share/mk/local.dirdeps.mk2
-rw-r--r--share/mk/src.libnames.mk17
-rw-r--r--share/mk/src.opts.mk25
-rw-r--r--share/mk/src.sys.mk6
20 files changed, 298 insertions, 148 deletions
diff --git a/share/mk/Makefile b/share/mk/Makefile
index 4ab5c8cc314b..0e786b381fe2 100644
--- a/share/mk/Makefile
+++ b/share/mk/Makefile
@@ -22,6 +22,7 @@ FILES= \
bsd.confs.mk \
bsd.cpu.mk \
bsd.crunchgen.mk \
+ bsd.debug.mk \
bsd.dep.mk \
bsd.dirs.mk \
bsd.doc.mk \
diff --git a/share/mk/bsd.README b/share/mk/bsd.README
index 4820bf12c72d..85baba7ba117 100644
--- a/share/mk/bsd.README
+++ b/share/mk/bsd.README
@@ -20,6 +20,7 @@ bsd.compiler.mk - defined based on current compiler
bsd.confs.mk - install of configuration files
bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk)
bsd.crunchgen.mk - building crunched binaries using crunchgen(1)
+bsd.debug.mk - handling debug options for bsd.{prog,lib}.mk
bsd.dep.mk - handle Makefile dependencies
bsd.dirs.mk - handle directory creation
bsd.doc.mk - building troff system documents
@@ -258,6 +259,9 @@ MLINKS List of manual page links (using a .1 - .9 suffix). The
linked-to file must come first, the linked file second,
and there may be multiple pairs. The files are hard-linked.
+MANSRC.${MAN:T} Name of source file for an individual manual page.
+ Defaults to the manual page name.
+
The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
it exists.
diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk
index 6fa732fd730b..bad68d1ebd8e 100644
--- a/share/mk/bsd.compat.mk
+++ b/share/mk/bsd.compat.mk
@@ -74,6 +74,7 @@ LIB32WMAKEFLAGS= \
LIB32WMAKEFLAGS+= NM="${XNM}"
LIB32WMAKEFLAGS+= OBJCOPY="${XOBJCOPY}"
+LIB32WMAKEFLAGS+= STRIPBIN="${XSTRIPBIN}"
LIB32DTRACE= ${DTRACE} -32
LIB32_MACHINE_ABI= ${MACHINE_ABI:N*64} long32 ptr32
diff --git a/share/mk/bsd.confs.mk b/share/mk/bsd.confs.mk
index 77b573c7e42c..e953e6d978dc 100644
--- a/share/mk/bsd.confs.mk
+++ b/share/mk/bsd.confs.mk
@@ -22,6 +22,14 @@ buildconfig: ${${group}}
all: buildconfig
. endif
+# Take groups from both CONFGROUPS and CONFGROUPS.yes, to allow syntax like
+# CONFGROUPS.${MK_FOO}=FOO. Sort and uniq the list of groups in case of
+# duplicates.
+.if defined(CONFGROUPS) || defined(CONFGROUPS.yes)
+CONFGROUPS:=${CONFGROUPS} ${CONFGROUPS.yes}
+CONFGROUPS:=${CONFGROUPS:O:u}
+.endif
+
. for group in ${CONFGROUPS}
. if defined(${group}) && !empty(${group})
diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk
index f6599a0ad802..d11b8994dcd7 100644
--- a/share/mk/bsd.cpu.mk
+++ b/share/mk/bsd.cpu.mk
@@ -391,21 +391,24 @@ MACHINE_ABI+= soft-float
.else
MACHINE_ABI+= hard-float
.endif
-# Currently all 64-bit architectures include 64 in their name (see arch(7)).
-.if ${MACHINE_ARCH:M*64*}
-MACHINE_ABI+= long64
+# Currently all 64-bit FreeBSD architectures include 64 in their name
+# (see arch(7)). We need a special case for cross-building from macOS
+# (which uses arm64/arm).
+.if ${MACHINE_ARCH:M*64*} || \
+ (defined(BOOTSTRAPPING) && ${.MAKE.OS} == "Darwin" && ${MACHINE} == "arm64")
+MACHINE_ABI+= long64
.else
-MACHINE_ABI+= long32
+MACHINE_ABI+= long32
.endif
.if ${MACHINE_ABI:Mlong64}
-MACHINE_ABI+= ptr64
+MACHINE_ABI+= ptr64
.else
-MACHINE_ABI+= ptr32
+MACHINE_ABI+= ptr32
.endif
.if ${MACHINE_ARCH} == "i386"
-MACHINE_ABI+= time32
+MACHINE_ABI+= time32
.else
-MACHINE_ABI+= time64
+MACHINE_ABI+= time64
.endif
.if ${MACHINE_ARCH:Mpowerpc*} && !${MACHINE_ARCH:M*le}
MACHINE_ABI+= big-endian
diff --git a/share/mk/bsd.debug.mk b/share/mk/bsd.debug.mk
new file mode 100644
index 000000000000..cf2fb4356aef
--- /dev/null
+++ b/share/mk/bsd.debug.mk
@@ -0,0 +1,68 @@
+#
+# This file configures debug options for compiled targets. It is meant
+# to consolidate common logic in bsd.prog.mk and bsd.lib.mk. It should
+# not be included directly by Makefiles.
+#
+
+.include <bsd.opts.mk>
+
+.if ${MK_ASSERT_DEBUG} == "no"
+CFLAGS+= -DNDEBUG
+# XXX: shouldn't we ensure that !asserts marks potentially unused variables as
+# __unused instead of disabling -Werror globally?
+MK_WERROR= no
+.endif
+
+# If reproducible build mode is enabled, map the root of the source
+# directory to /usr/src and the root of the object directory to
+# /usr/obj.
+.if ${MK_REPRODUCIBLE_BUILD} != "no" && !defined(DEBUG_PREFIX)
+.if defined(SRCTOP)
+DEBUG_PREFIX+= ${SRCTOP:S,/$,,}=/usr/src
+.endif
+.if defined(OBJROOT)
+# Strip off compat subdirectories, e.g., /usr/obj/usr/src/amd64.amd64/obj-lib32
+# becomes /usr/obj/usr/src/amd64.amd64, since object files compiled there might
+# refer to something outside the root.
+DEBUG_PREFIX+= ${OBJROOT:S,/$,,:C,/obj-[^/]*$,,}=/usr/obj
+.endif
+.endif
+
+.if defined(DEBUG_PREFIX)
+.for map in ${DEBUG_PREFIX}
+CFLAGS+= -ffile-prefix-map=${map}
+CXXFLAGS+= -ffile-prefix-map=${map}
+.endfor
+.endif
+
+.if defined(DEBUG_FLAGS)
+CFLAGS+=${DEBUG_FLAGS}
+CXXFLAGS+=${DEBUG_FLAGS}
+
+.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != ""
+CTFFLAGS+= -g
+.endif
+.else
+STRIP?= -s
+.endif
+
+.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
+ empty(DEBUG_FLAGS:M-gdwarf*)
+.if !${COMPILER_FEATURES:Mcompressed-debug}
+CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*}
+CXXFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*}
+.else
+CFLAGS+= ${DEBUG_FILES_CFLAGS}
+CXXFLAGS+= ${DEBUG_FILES_CFLAGS}
+.endif
+CTFFLAGS+= -g
+.endif
+
+_debuginstall:
+.if ${MK_DEBUG_FILES} != "no" && defined(DEBUGFILE)
+.if defined(DEBUGMKDIR)
+ ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/
+.endif
+ ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${DEBUGOWN} -g ${DEBUGGRP} -m ${DEBUGMODE} \
+ ${DEBUGFILE} ${DESTDIR}${DEBUGFILEDIR}/${DEBUGFILE}
+.endif
diff --git a/share/mk/bsd.endian.mk b/share/mk/bsd.endian.mk
index ba662ffc7439..24da57954b5a 100644
--- a/share/mk/bsd.endian.mk
+++ b/share/mk/bsd.endian.mk
@@ -20,10 +20,17 @@ LOCALEDEF_ENDIAN= -b
#
# During bootstrapping on !FreeBSD OSes, we need to define some value. Short of
# having an exhaustive list for all variants of Linux and MacOS we simply do not
-# set TARGET_ENDIANNESS and poison the other variables. They should be unused
-# during the bootstrap phases (apart from one place that's adequately protected
-# in bsd.compiler.mk) where we're building the bootstrap tools.
+# set TARGET_ENDIANNESS (on Linux) and poison the other variables. They should
+# be unused during the bootstrap phases (apart from one place that's adequately
+# protected in bsd.compiler.mk) where we're building the bootstrap tools.
#
+.if ${.MAKE.OS} == "Darwin"
+# We do assume the endianness on macOS because Apple's modern hardware is all
+# little-endian. This might need revisited in the far future, but for the time
+# being Apple Silicon's reign of terror continues. We only set this one up
+# because libcrypto is now built in bootstrap.
+TARGET_ENDIANNESS= 1234
+.endif
CAP_MKDB_ENDIAN= -B # Poisoned value, invalid flags for both cap_mkdb
LOCALEDEF_ENDIAN= -B # and localedef.
.endif
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 3013f32c2b36..159957b6300b 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -1,4 +1,3 @@
-
.include <bsd.init.mk>
.include <bsd.compiler.mk>
.include <bsd.linker.mk>
@@ -45,23 +44,6 @@ SONAME?= ${SHLIB_NAME}
CFLAGS+= ${CRUNCH_CFLAGS}
.endif
-.if ${MK_ASSERT_DEBUG} == "no"
-CFLAGS+= -DNDEBUG
-# XXX: shouldn't we ensure that !asserts marks potentially unused variables as
-# __unused instead of disabling -Werror globally?
-MK_WERROR= no
-.endif
-
-.if defined(DEBUG_FLAGS)
-CFLAGS+= ${DEBUG_FLAGS}
-
-.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != ""
-CTFFLAGS+= -g
-.endif
-.else
-STRIP?= -s
-.endif
-
.for _libcompat in ${_ALL_libcompats}
.if ${SHLIBDIR:M*/lib${_libcompat}} || ${SHLIBDIR:M*/lib${_libcompat}/*}
TAGS+= lib${_libcompat}
@@ -70,11 +52,49 @@ TAGS+= lib${_libcompat}
.if defined(NO_ROOT)
.if !defined(TAGS) || ! ${TAGS:Mpackage=*}
-TAGS+= package=${PACKAGE:Uutilities}
+TAGS+= package=${PACKAGE:Uutilities}
+.endif
+
+# By default, if PACKAGE=foo, then the native runtime libraries will go into
+# the FreeBSD-foo package, and subpackages will be created for -dev, -lib32,
+# and so on. If LIB_PACKAGE is set, then we also create a subpackage for
+# runtime libraries with a -lib suffix. This is used when a package has
+# libraries and some other content (e.g., executables) to allow consumers to
+# depend on the libraries.
+.if defined(LIB_PACKAGE) && ! ${TAGS:Mlib*}
+.if !defined(PACKAGE)
+.error LIB_PACKAGE cannot be used without PACKAGE
.endif
+
+LIB_TAG_ARGS= ${TAG_ARGS},lib
+.else
+LIB_TAG_ARGS= ${TAG_ARGS}
+.endif
+
TAG_ARGS= -T ${TAGS:ts,:[*]}
+
+DBG_TAG_ARGS= ${TAG_ARGS},dbg
+# Usually we want to put development files (e.g., static libraries) into a
+# separate -dev packages but for a few cases, like tests, that's not wanted,
+# so allow the caller to disable it by setting NO_DEV_PACKAGE.
+.if !defined(NO_DEV_PACKAGE)
+DEV_TAG_ARGS= ${TAG_ARGS},dev
+.else
+DEV_TAG_ARGS= ${TAG_ARGS}
.endif
+.endif # defined(NO_ROOT)
+
+# By default, put library manpages in the -dev subpackage, since they're not
+# usually interesting if the development files aren't installed. For pages
+# that should be installed in the base package, define a new MANNODEV group.
+# Note that bsd.man.mk ignores this setting if MANSPLITPKG is enabled: then
+# manpages are always installed in the -man subpackage.
+MANSUBPACKAGE?= -dev
+MANGROUPS?= MAN
+MANGROUPS+= MANNODEV
+MANNODEVSUBPACKAGE=
+
# ELF hardening knobs
.if ${MK_BIND_NOW} != "no"
LDFLAGS+= -Wl,-znow
@@ -130,18 +150,6 @@ CXXFLAGS+= -fzero-call-used-regs=${ZEROREG_TYPE}
# bsd.sanitizer.mk is not installed, so don't require it (e.g. for ports).
.sinclude "bsd.sanitizer.mk"
-.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
- empty(DEBUG_FLAGS:M-gdwarf*)
-.if !${COMPILER_FEATURES:Mcompressed-debug}
-CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*}
-CXXFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*}
-.else
-CFLAGS+= ${DEBUG_FILES_CFLAGS}
-CXXFLAGS+= ${DEBUG_FILES_CFLAGS}
-.endif
-CTFFLAGS+= -g
-.endif
-
.if ${MACHINE_CPUARCH} == "riscv" && ${LINKER_FEATURES:Mriscv-relaxations} == ""
CFLAGS += -mno-relax
.endif
@@ -156,6 +164,7 @@ _SHLIBDIR:=${SHLIBDIR}
.if defined(SHLIB_NAME)
.if ${MK_DEBUG_FILES} != "no"
SHLIB_NAME_FULL=${SHLIB_NAME}.full
+DEBUGFILE= ${SHLIB_NAME}.debug
# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
.if ${_SHLIBDIR} == "/boot" ||\
${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\
@@ -272,16 +281,16 @@ ${SHLIB_NAME_FULL}: ${SOBJS}
.endif
.if ${MK_DEBUG_FILES} != "no"
-CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug
-${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug
- ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \
+CLEANFILES+= ${SHLIB_NAME_FULL} ${DEBUGFILE}
+${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${DEBUGFILE}
+ ${OBJCOPY} --strip-debug --add-gnu-debuglink=${DEBUGFILE} \
${SHLIB_NAME_FULL} ${.TARGET}
.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld)
# Note: This uses ln instead of ${INSTALL_LIBSYMLINK} since we are in OBJDIR
@${LN:Uln} -fs ${SHLIB_NAME} ${SHLIB_LINK}
.endif
-${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL}
+${DEBUGFILE}: ${SHLIB_NAME_FULL}
${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET}
.endif
.endif #defined(SHLIB_NAME)
@@ -384,7 +393,7 @@ _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${ie}}
installpcfiles: installpcfiles-${pcfile}
installpcfiles-${pcfile}: ${pcfile}
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} \
${.ALLSRC} ${DESTDIR}${LIBDATADIR}/pkgconfig/
.endfor
@@ -392,49 +401,42 @@ installpcfiles-${pcfile}: ${pcfile}
installpcfiles: .PHONY
.if !defined(INTERNALLIB)
-realinstall: _libinstall installpcfiles
-.ORDER: beforeinstall _libinstall
+realinstall: _libinstall installpcfiles _debuginstall
+.ORDER: beforeinstall _libinstall _debuginstall
_libinstall:
.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no"
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a ${DESTDIR}${_LIBDIR}/
.endif
.if defined(SHLIB_NAME)
- ${INSTALL} ${TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${INSTALL} ${LIB_TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \
${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/
-.if ${MK_DEBUG_FILES} != "no"
-.if defined(DEBUGMKDIR)
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/
-.endif
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \
- ${_INSTALLFLAGS} \
- ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}/
-.endif
.if defined(SHLIB_LINK)
.if commands(${SHLIB_LINK:R}.ld)
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${INSTALL} ${DEV_TAG_ARGS} -S -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \
${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS}
- ${INSTALL_LIBSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} ${SHLIB_LINK} \
- ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK}
+ ${INSTALL_LIBSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \
+ ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK}
.endfor
.else
.if ${_SHLIBDIR} == ${_LIBDIR}
.if ${SHLIB_LINK:Mlib*}
- ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS:D${TAG_ARGS},dev} \
+ ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${DEV_TAG_ARGS} \
${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.else
- ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
+ ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \
+ ${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} \
${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.endif
.else
.if ${SHLIB_LINK:Mlib*}
- ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS:D${TAG_ARGS},dev} \
+ ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${DEV_TAG_ARGS} \
${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.else
- ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${TAG_ARGS} \
+ ${INSTALL_RSYMLINK} ${_SHLINSTALLSYMLINKFLAGS} ${LIB_TAG_ARGS} \
${DESTDIR}${_SHLIBDIR}/${SHLIB_NAME} ${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.endif
.if exists(${DESTDIR}${_LIBDIR}/${SHLIB_NAME})
@@ -446,7 +448,7 @@ _libinstall:
.endif # SHLIB_LINK
.endif # SHIB_NAME
.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${INSTALL} ${DEV_TAG_ARGS} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/
.endif
.endif # !defined(INTERNALLIB)
@@ -466,7 +468,11 @@ LINKGRP?= ${LIBGRP}
LINKMODE?= ${LIBMODE}
SYMLINKOWN?= ${LIBOWN}
SYMLINKGRP?= ${LIBGRP}
-LINKTAGS= dev
+.if !defined(NO_DEV_PACKAGE)
+LINKTAGS= dev${_COMPAT_TAG}
+.else
+LINKTAGS= ${_COMPAT_TAG}
+.endif
.include <bsd.links.mk>
.if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY)
@@ -501,6 +507,7 @@ SUBDIR_TARGETS+= check
TESTS_LD_LIBRARY_PATH+= ${.OBJDIR}
.endif
+.include <bsd.debug.mk>
.include <bsd.dep.mk>
.include <bsd.clang-analyze.mk>
.include <bsd.obj.mk>
diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk
index 3ff4c4e90a1b..2f099e0579b2 100644
--- a/share/mk/bsd.libnames.mk
+++ b/share/mk/bsd.libnames.mk
@@ -27,6 +27,7 @@ LIBAVL?= ${LIBDESTDIR}${LIBDIR_BASE}/libavl.a
LIBBE?= ${LIBDESTDIR}${LIBDIR_BASE}/libbe.a
LIBBEGEMOT?= ${LIBDESTDIR}${LIBDIR_BASE}/libbegemot.a
LIBBLACKLIST?= ${LIBDESTDIR}${LIBDIR_BASE}/libblacklist.a
+LIBBLOCKLIST?= ${LIBDESTDIR}${LIBDIR_BASE}/libblocklist.a
LIBBLOCKSRUNTIME?= ${LIBDESTDIR}${LIBDIR_BASE}/libBlocksRuntime.a
LIBBLUETOOTH?= ${LIBDESTDIR}${LIBDIR_BASE}/libbluetooth.a
LIBBSDXML?= ${LIBDESTDIR}${LIBDIR_BASE}/libbsdxml.a
diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk
index f44048b4e453..dde11afb8283 100644
--- a/share/mk/bsd.man.mk
+++ b/share/mk/bsd.man.mk
@@ -21,6 +21,9 @@
# MAN The manual pages to be installed. For sections see
# variable ${SECTIONS}
#
+# MANSRC.${MAN:T} Name of source file for an individual manual page.
+# Defaults to the manual page name.
+#
# MCOMPRESS_CMD Program to compress man pages. Output is to
# stdout. [${COMPRESS_CMD}]
#
@@ -58,6 +61,16 @@
MANGROUPS?= MAN
+# MAN_SUBPACKAGE is the subpackage manpages will be installed in. When
+# MANSPLITPKG is enabled, this is ignored and the subpackage is forced
+# to be "-man", otherwise it defaults to empty so manpages go in the
+# base package. This can be set to "-dev" for manpages that should go
+# in the -dev package.
+MAN_SUBPACKAGE?=
+
+# The default man package, if not otherwise specified.
+MAN_PACKAGE= ${PACKAGE:Uutilities}
+
# Backwards compatibility.
MINSTALL?= ${MANINSTALL}
@@ -94,6 +107,14 @@ manlinksinstall: .PHONY
all-man:
+# Take groups from both MANGROUPS and MANGROUPS.yes, to allow syntax like
+# MANGROUPS.${MK_FOO}=FOO. Sort and uniq the list of groups in case of
+# duplicates.
+.if defined(MANGROUPS) || defined(MANGROUPS.yes)
+MANGROUPS:=${MANGROUPS} ${MANGROUPS.yes}
+MANGROUPS:=${MANGROUPS:O:u}
+.endif
+
.for __group in ${MANGROUPS}
realmaninstall: realmaninstall-${__group}
@@ -102,16 +123,19 @@ manlinksinstall: manlinksinstall-${__group}
${__group}OWN?= ${MANOWN}
${__group}GRP?= ${MANGRP}
${__group}MODE?= ${MANMODE}
+# If MANSPLITPKG is enabled, ignore the requested man subpackage and put the
+# manpages in -man instead.
+.if ${MK_MANSPLITPKG} == "yes"
+${__group}SUBPACKAGE= -man
+.else
+${__group}SUBPACKAGE?= ${MAN_SUBPACKAGE}
+.endif
+${__group}PACKAGE?= ${MAN_PACKAGE}${${__group}SUBPACKAGE}
# Tag processing is only done for NO_ROOT installs.
.if defined(NO_ROOT)
-
.if !defined(${__group}TAGS) || ! ${${__group}TAGS:Mpackage=*}
-.if ${MK_MANSPLITPKG} == "no"
-${__group}TAGS+= package=${${__group}PACKAGE:U${PACKAGE:Uutilities}}
-.else
-${__group}TAGS+= package=${${__group}PACKAGE:U${PACKAGE:Uutilities}}-man
-.endif
+${__group}TAGS+= package=${${__group}PACKAGE}
.endif
${__group}TAG_ARGS= -T ${${__group}TAGS:ts,:[*]}
@@ -141,13 +165,13 @@ CLEANFILES+= ${${__group}:T:S/$/${CATEXT}${FILTEXTENSION}/g}
# filenames contain colons.
.for __target in ${__page:T:S/:/\:/g:S/$/${FILTEXTENSION}/g}
all-man: ${__target}
-${__target}: ${__page}
+${__target}: ${MANSRC.${__page:T}:U${__page}}
${MANFILTER} < ${.ALLSRC} > ${.TARGET}
.endfor
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
.for __target in ${__page:T:S/:/\:/g:S/$/${CATEXT}${FILTEXTENSION}/g}
all-man: ${__target}
-${__target}: ${__page}
+${__target}: ${MANSRC.${__page:T}:U${__page}}
${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} > ${.TARGET}
.endfor
.endif
@@ -160,12 +184,23 @@ CLEANFILES+= ${${__group}:T:S/$/${CATEXT}/g}
.for __page in ${${__group}}
.for __target in ${__page:T:S/:/\:/g:S/$/${CATEXT}/g}
all-man: ${__target}
-${__target}: ${__page}
+${__target}: ${MANSRC.${__page:T}:U${__page}}
${MANDOC_CMD} ${.ALLSRC} > ${.TARGET}
.endfor
.endfor
.else
-all-man: ${${__group}}
+.for __page in ${${__group}}
+.if defined(MANSRC.${__page:T})
+.for __target in ${__page:T:S/:/\:/g}
+all-man: ${__target}
+CLEANFILES+= ${__target}
+${__target}: ${MANSRC.${__page:T}}
+ ${CP} ${.ALLSRC} ${.TARGET}
+.endfor
+.else
+all-man: ${__page}
+.endif
+.endfor
.endif
.endif
.endif # defined(MANFILTER)
@@ -180,7 +215,7 @@ CLEANFILES+= ${${__group}:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g}
.for __page in ${${__group}}
.for __target in ${__page:T:S/:/\:/g:S/$/${MCOMPRESS_EXT}/}
all-man: ${__target}
-${__target}: ${__page}
+${__target}: ${MANSRC.${__page:T}:U${__page}}
.if defined(MANFILTER)
${MANFILTER} < ${.ALLSRC} | ${MCOMPRESS_CMD} > ${.TARGET}
.else
@@ -190,7 +225,7 @@ ${__target}: ${__page}
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
.for __target in ${__page:T:S/:/\:/g:S/$/${CATEXT}${MCOMPRESS_EXT}/}
all-man: ${__target}
-${__target}: ${__page}
+${__target}: ${MANSRC.${__page:T}:U${__page}}
.if defined(MANFILTER)
${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} | ${MCOMPRESS_CMD} > ${.TARGET}
.else
@@ -238,7 +273,10 @@ stage_links.mlinks.${__group}: ${_mansets.${__group}:@s@stage_files.${__group}.$
realmaninstall-${__group}:
.if defined(${__group}) && !empty(${__group})
-realmaninstall-${__group}: ${${__group}}
+.for __page in ${${__group}}
+__mansrc.${__group}+= ${MANSRC.${__page:T}:U${__page}}
+.endfor
+realmaninstall-${__group}: ${__mansrc.${__group}}
.if ${MK_MANCOMPRESS} == "no"
.if defined(MANFILTER)
.for __page in ${${__group}}
@@ -288,11 +326,11 @@ manlinksinstall-${__group}:
.endif
.endfor
-manlint:
+manlint: .PHONY checkmanlinks
.if defined(${__group}) && !empty(${__group})
.for __page in ${${__group}}
manlint: ${__page:S/:/\:/g}lint
-${__page:S/:/\:/g}lint: ${__page}
+${__page:S/:/\:/g}lint: .PHONY ${MANSRC.${__page:T}:U${__page}}
.if defined(MANFILTER)
${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} -Tlint
.else
@@ -301,4 +339,18 @@ ${__page:S/:/\:/g}lint: ${__page}
.endfor
.endif
+checkmanlinks: .PHONY
+.if defined(${__group}LINKS)
+checkmanlinks: checkmanlinks-${__group}
+checkmanlinks-${__group}: .PHONY
+.for __page __link in ${${__group}LINKS}
+checkmanlinks-${__group}: checkmanlinks-${__group}-${__link}
+checkmanlinks-${__group}-${__link}: .PHONY ${__page}
+ @if ! egrep -q "^(\.\\\\\" )?\.Nm ${__link:R}( ,)?$$" ${.ALLSRC}; then \
+ echo "${__group}LINKS: '.Nm ${__link:R}' not found in ${__page}"; \
+ exit 1; \
+ fi >&2
+.endfor # __page __link in ${${__group}LINKS}
+.endif # defined(${__group}LINKS)
+
.endfor # __group in ${MANGROUPS}
diff --git a/share/mk/bsd.nls.mk b/share/mk/bsd.nls.mk
index bd13fe56679d..5a28e1cdd026 100644
--- a/share/mk/bsd.nls.mk
+++ b/share/mk/bsd.nls.mk
@@ -1,6 +1,8 @@
#
-# This include file <bsd.nls.mk> handles building and installing Native
-# Language Support (NLS) catalogs
+# Handle building and installing Native Language Support (NLS) catalogs.
+# This is implemented using a <bsd.files.mk> files group called "NLS",
+# so any per-group options that bsd.files.mk supports can be used here
+# with the prefix "NLS".
#
# +++ variables +++
#
@@ -17,6 +19,9 @@
# NLSMODE National Language Support files mode. [${NOBINMODE}]
#
# NLSOWN National Language Support files owner. [${SHAREOWN}]
+#
+# NLSPACKAGE Package to install the NLS files in.
+# [${PACKAGE}, or "utilities" if not set]
.if !target(__<bsd.init.mk>__)
.error bsd.nls.mk cannot be included directly.
diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk
index 85247d733a14..66eb427c3505 100644
--- a/share/mk/bsd.opts.mk
+++ b/share/mk/bsd.opts.mk
@@ -60,7 +60,6 @@ __DEFAULT_YES_OPTIONS = \
MAKE_CHECK_USE_SANDBOX \
MAN \
MANCOMPRESS \
- MANSPLITPKG \
NIS \
NLS \
OPENSSH \
@@ -78,6 +77,8 @@ __DEFAULT_NO_OPTIONS = \
CCACHE_BUILD \
CTF \
INSTALL_AS_USER \
+ MANSPLITPKG \
+ REPRODUCIBLE_BUILD \
RETPOLINE \
RUN_TESTS \
STALE_STAGED \
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index 00a048fedc1d..4dffe9723a9e 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -44,6 +44,10 @@
#
# DEBUGMODE Mode for debug files. [${NOBINMODE}]
#
+# DEBUGOWN Owner for debug info files. [root]
+#
+# DEBUGGRP Group for debug info files. [wheel]
+#
#
# KMODDIR Base path for loadable kernel modules
# (see kld(4)). [/boot/modules]
@@ -197,7 +201,8 @@ LIBMODE?= ${NOBINMODE}
DEBUGDIR?= /usr/lib/debug
DEBUGMODE?= ${NOBINMODE}
-
+DEBUGOWN?= ${BINOWN}
+DEBUGGRP?= ${BINGRP}
# Share files
SHAREDIR?= /usr/share
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index 9350d4786cec..10e1c177e2b2 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -12,22 +12,6 @@
CFLAGS+=${COPTS}
.endif
-.if ${MK_ASSERT_DEBUG} == "no"
-CFLAGS+= -DNDEBUG
-# XXX: shouldn't we ensure that !asserts marks potentially unused variables as
-# __unused instead of disabling -Werror globally?
-MK_WERROR= no
-.endif
-
-.if defined(DEBUG_FLAGS)
-CFLAGS+=${DEBUG_FLAGS}
-CXXFLAGS+=${DEBUG_FLAGS}
-
-.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != ""
-CTFFLAGS+= -g
-.endif
-.endif
-
.if defined(PROG_CXX)
PROG= ${PROG_CXX}
.endif
@@ -109,20 +93,6 @@ CFLAGS += -mno-relax
.if defined(CRUNCH_CFLAGS)
CFLAGS+=${CRUNCH_CFLAGS}
-.else
-.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
- empty(DEBUG_FLAGS:M-gdwarf-*)
-.if !${COMPILER_FEATURES:Mcompressed-debug}
-CFLAGS+= ${DEBUG_FILES_CFLAGS:N-gz*}
-.else
-CFLAGS+= ${DEBUG_FILES_CFLAGS}
-.endif
-CTFFLAGS+= -g
-.endif
-.endif
-
-.if !defined(DEBUG_FLAGS)
-STRIP?= -s
.endif
.if defined(NO_ROOT)
@@ -159,6 +129,9 @@ PROG_FULL= ${PROG}
.if defined(PROG)
PROGNAME?= ${PROG}
+.if ${MK_DEBUG_FILES} != "no"
+DEBUGFILE= ${PROGNAME}.debug
+.endif
.if defined(SRCS)
@@ -223,11 +196,12 @@ ${PROG_FULL}: ${OBJS}
.endif # !defined(SRCS)
.if ${MK_DEBUG_FILES} != "no"
-${PROG}: ${PROG_FULL} ${PROGNAME}.debug
- ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROGNAME}.debug \
+CLEANFILES+= ${PROG_FULL} ${DEBUGFILE}
+${PROG}: ${PROG_FULL} ${DEBUGFILE}
+ ${OBJCOPY} --strip-debug --add-gnu-debuglink=${DEBUGFILE} \
${PROG_FULL} ${.TARGET}
-${PROGNAME}.debug: ${PROG_FULL}
+${DEBUGFILE}: ${PROG_FULL}
${OBJCOPY} --only-keep-debug ${PROG_FULL} ${.TARGET}
.endif
@@ -266,9 +240,6 @@ all: all-man
.if defined(PROG)
CLEANFILES+= ${PROG} ${PROG}.bc ${PROG}.ll
-.if ${MK_DEBUG_FILES} != "no"
-CLEANFILES+= ${PROG_FULL} ${PROGNAME}.debug
-.endif
.endif
.if defined(OBJS)
@@ -308,19 +279,12 @@ _INSTALLFLAGS:= ${_INSTALLFLAGS${ie}}
.endfor
.if !target(realinstall) && !defined(INTERNALPROG)
-realinstall: _proginstall
-.ORDER: beforeinstall _proginstall
+realinstall: _proginstall _debuginstall
+.ORDER: beforeinstall _proginstall _debuginstall
_proginstall:
.if defined(PROG)
${INSTALL} ${TAG_ARGS} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME}
-.if ${MK_DEBUG_FILES} != "no"
-.if defined(DEBUGMKDIR)
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/
-.endif
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \
- ${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug
-.endif
.endif
.endif # !target(realinstall)
@@ -391,6 +355,7 @@ TESTS_PATH+= ${.OBJDIR}
OBJS_DEPEND_GUESS+= ${SRCS:M*.h}
.endif
+.include <bsd.debug.mk>
.include <bsd.dep.mk>
.include <bsd.clang-analyze.mk>
.include <bsd.obj.mk>
diff --git a/share/mk/bsd.test.mk b/share/mk/bsd.test.mk
index a2e15c840e02..9f20e5835369 100644
--- a/share/mk/bsd.test.mk
+++ b/share/mk/bsd.test.mk
@@ -16,6 +16,9 @@ LOCALBASE?= /usr/local
TESTSDIR?= ${TESTSBASE}/${RELDIR:H}
PACKAGE?= tests
+# Prevent creating a -dev package for tests. Sometimes tests include static
+# libraries or other artifacts which are not actually "development" files.
+NO_DEV_PACKAGE=
FILESGROUPS+= ${PACKAGE}FILES
${PACKAGE}FILESPACKAGE= ${PACKAGE}
diff --git a/share/mk/local.dirdeps-options.mk b/share/mk/local.dirdeps-options.mk
index 4eef5311375e..5773c4979e56 100644
--- a/share/mk/local.dirdeps-options.mk
+++ b/share/mk/local.dirdeps-options.mk
@@ -2,6 +2,7 @@
# avoid duplication
DIRDEPS.AUDIT.yes= lib/libbsm
DIRDEPS.BLACKLIST_SUPPORT.yes+= lib/libblacklist
+DIRDEPS.BLOCKLIST_SUPPORT.yes+= lib/libblocklist
DIRDEPS.CASPER.yes+= lib/libcasper/libcasper
DIRDEPS.GSSAPI.yes+= lib/libgssapi
DIRDEPS.JAIL.yes+= lib/libjail
diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk
index a92539689a31..bdc7242d4bfd 100644
--- a/share/mk/local.dirdeps.mk
+++ b/share/mk/local.dirdeps.mk
@@ -185,7 +185,7 @@ C_DIRDEPS= \
# libgcc is needed as well but is added later.
-.if ${MK_GSSAPI} != "no"
+.if ${MK_KERBEROS} != "no" && ${MK_MITKRB5} == "no"
C_DIRDEPS+= include/gssapi
.endif
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 9ca043e7733c..fd0424a96d9b 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -29,6 +29,8 @@ _PRIVATELIBS= \
heimipcs \
kldelf \
ldns \
+ opencsd \
+ samplerate \
sqlite3 \
ssh \
ucl \
@@ -72,7 +74,6 @@ _INTERNALLIBS= \
pfctl \
pkgecc \
pmcstat \
- samplerate \
sl \
sm \
smdb \
@@ -264,8 +265,12 @@ _LIBRARIES+= \
.if ${MK_BLACKLIST} != "no"
_LIBRARIES+= \
- blacklist \
+ blacklist
+.endif
+.if ${MK_BLOCKLIST} != "no"
+_LIBRARIES+= \
+ blocklist
.endif
.if ${MK_OFED} != "no"
@@ -319,6 +324,9 @@ _DP_zstd= pthread
.if ${MK_BLACKLIST} != "no"
_DP_blacklist+= pthread
.endif
+.if ${MK_BLOCKLIST} != "no"
+_DP_blocklist+= pthread
+.endif
_DP_crypto= pthread
# See comment by _DP_archive above
.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING)
@@ -329,7 +337,7 @@ _DP_archive+= md
.endif
.endif
_DP_sqlite3= pthread
-_DP_ssl= crypto
+_DP_ssl= pthread crypto
_DP_ssh= crypto crypt z
.if ${MK_LDNS} != "no"
_DP_ssh+= ldns
@@ -425,7 +433,7 @@ _DP_kadm5clnt= com_err krb5 roken
_DP_kadm5srv= com_err hdb krb5 roken
_DP_heimntlm= crypto com_err krb5 roken
_DP_hx509= asn1 com_err crypto roken wind
-_DP_hdb= asn1 com_err krb5 roken sqlite3
+_DP_hdb= asn1 com_err krb5 roken sqlite3 heimbase
_DP_asn1= com_err roken
_DP_kdc= roken hdb hx509 krb5 heimntlm asn1 crypto
_DP_wind= com_err roken
@@ -865,6 +873,7 @@ LIBGTESTDIR= ${_LIB_OBJTOP}/lib/googletest/gtest
LIBGTEST_MAINDIR= ${_LIB_OBJTOP}/lib/googletest/gtest_main
LIBALIASDIR= ${_LIB_OBJTOP}/lib/libalias/libalias
LIBBLACKLISTDIR= ${_LIB_OBJTOP}/lib/libblacklist
+LIBBLOCKLISTDIR= ${_LIB_OBJTOP}/lib/libblocklist
LIBBLOCKSRUNTIMEDIR= ${_LIB_OBJTOP}/lib/libblocksruntime
LIBBSNMPDIR= ${_LIB_OBJTOP}/lib/libbsnmp/libbsnmp
LIBCASPERDIR= ${_LIB_OBJTOP}/lib/libcasper/libcasper
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index 6000da865332..e10455cd4e82 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -66,6 +66,7 @@ __DEFAULT_YES_OPTIONS = \
AUTOFS \
BHYVE \
BLACKLIST \
+ BLOCKLIST \
BLUETOOTH \
BOOT \
BOOTPARAMD \
@@ -80,7 +81,6 @@ __DEFAULT_YES_OPTIONS = \
CDDL \
CLANG \
CLANG_BOOTSTRAP \
- CLEAN \
CPP \
CROSS_COMPILER \
CRYPT \
@@ -201,6 +201,7 @@ __DEFAULT_NO_OPTIONS = \
BHYVE_SNAPSHOT \
CLANG_EXTRAS \
CLANG_FORMAT \
+ CLEAN \
DIALOG \
DETECT_TZ_CHANGES \
DISK_IMAGE_TOOLS_BOOTSTRAP \
@@ -214,7 +215,6 @@ __DEFAULT_NO_OPTIONS = \
MALLOC_PRODUCTION \
OFED_EXTRA \
OPENLDAP \
- REPRODUCIBLE_BUILD \
RPCBIND_WARMSTART_SUPPORT \
SORT_THREADS \
ZONEINFO_LEAPSECONDS_SUPPORT \
@@ -243,6 +243,7 @@ __LIBC_MALLOC_DEFAULT= jemalloc
#
.for var in \
BLACKLIST \
+ BLOCKLIST \
BZIP2 \
INET \
INET6 \
@@ -296,12 +297,12 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF LLVM_TARGET_MIPS
.include <bsd.compiler.mk>
.if ${__T} == "i386" || ${__T} == "amd64"
-__DEFAULT_NO_OPTIONS += FDT
+__DEFAULT_NO_OPTIONS+=FDT
.else
-__DEFAULT_YES_OPTIONS += FDT
+__DEFAULT_YES_OPTIONS+=FDT
.endif
-.if ${__T:Marm*} == "" && ${__T:Mriscv64*} == ""
+.if ${__T:Mriscv64*} == ""
__DEFAULT_YES_OPTIONS+=LLDB
.else
__DEFAULT_NO_OPTIONS+=LLDB
@@ -392,6 +393,14 @@ MK_SOURCELESS_HOST:= no
MK_SOURCELESS_UCODE:= no
.endif
+.if ${MK_BLACKLIST} == "no"
+MK_BLOCKLIST:= no
+.endif
+
+.if ${MK_BLACKLIST_SUPPORT} == "no"
+MK_BLOCKLIST_SUPPORT:= no
+.endif
+
.if ${MK_CDDL} == "no"
MK_CTF:= no
MK_DTRACE:= no
@@ -508,7 +517,7 @@ MK_LOADER_VERIEXEC_PASS_MANIFEST := no
# MK_* options whose default value depends on another option.
#
.for vv in \
- GSSAPI/KERBEROS \
+ KERBEROS_SUPPORT/KERBEROS \
MAN_UTILS/MAN
.if defined(WITH_${vv:H})
MK_${vv:H}:= yes
@@ -519,8 +528,4 @@ MK_${vv:H}:= ${MK_${vv:T}}
.endif
.endfor
-#
-# Set defaults for the MK_*_SUPPORT variables.
-#
-
.endif # !target(__<src.opts.mk>__)
diff --git a/share/mk/src.sys.mk b/share/mk/src.sys.mk
index d5c2af0c559d..ec035fb71e54 100644
--- a/share/mk/src.sys.mk
+++ b/share/mk/src.sys.mk
@@ -6,7 +6,11 @@
.if !defined(_WITHOUT_SRCCONF)
# Allow user to configure things that only effect src tree builds.
+.if exists(${SRCTOP}/src.conf)
+SRCCONF?= ${SRCTOP}/src.conf
+.else
SRCCONF?= /etc/src.conf
+.endif
.if !empty(SRCCONF) && \
(exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && \
!target(_srcconf_included_)
@@ -42,7 +46,7 @@ CFLAGS+= ${CFCOMMONFLAG}
CFLAGS+= -fmacro-prefix-map=${SRCTOP}=/usr/src -fdebug-prefix-map=${SRCTOP}=/usr/src
.endif
-DEFAULTWARNS= 6
+DEFAULTWARNS?= 6
# tempting, but bsd.compiler.mk causes problems this early
# probably need to remove dependence on bsd.own.mk