git: 073ccb9d5553 - main - Allow site.*.mk to augment local.*.mk and src.*.mk

From: Simon J. Gerraty <sjg_at_FreeBSD.org>
Date: Wed, 07 Dec 2022 19:31:14 UTC
The branch main has been updated by sjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=073ccb9d5553684590ef1ba4de3d5af77a53ee94

commit 073ccb9d5553684590ef1ba4de3d5af77a53ee94
Author:     Simon J. Gerraty <sjg@FreeBSD.org>
AuthorDate: 2022-12-07 19:30:35 +0000
Commit:     Simon J. Gerraty <sjg@FreeBSD.org>
CommitDate: 2022-12-07 19:30:35 +0000

    Allow site.*.mk to augment local.*.mk and src.*.mk
    
    Add some extra customization points so that FreeBSD build
    can be adapted to local requirements.
    We use these to minimize changes to share/mk
    
    Reviewed by:    stevek
    Sponsored by:   Juniper Networks, Inc.
    Differential Revision:  https://reviews.freebsd.org/D37617
---
 share/mk/local.dirdeps-options.mk | 2 +-
 share/mk/local.dirdeps.mk         | 2 ++
 share/mk/local.init.mk            | 1 +
 share/mk/local.meta.sys.mk        | 3 +++
 share/mk/local.sys.env.mk         | 1 +
 share/mk/local.sys.mk             | 1 +
 share/mk/src.libnames.mk          | 2 ++
 share/mk/src.opts.mk              | 2 ++
 share/mk/src.sys.env.mk           | 4 +++-
 9 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/share/mk/local.dirdeps-options.mk b/share/mk/local.dirdeps-options.mk
index 9ad08a78cb19..87af1604c4e4 100644
--- a/share/mk/local.dirdeps-options.mk
+++ b/share/mk/local.dirdeps-options.mk
@@ -25,4 +25,4 @@ DIRDEPS.OPENSSL.no+= lib/libmd
 DIRDEPS.PAM_SUPPORT.yes+= lib/libpam/libpam
 DIRDEPS.TCP_WRAPPERS.yes+= lib/libwrap
 
-
+.-include <site.dirdeps-options.mk>
diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk
index 16c9ee5a55ec..d7e5396c81ed 100644
--- a/share/mk/local.dirdeps.mk
+++ b/share/mk/local.dirdeps.mk
@@ -217,3 +217,5 @@ CSU_DIR.${DEP_MACHINE_ARCH} ?= csu/${DEP_MACHINE_ARCH}
 CSU_DIR := ${CSU_DIR.${DEP_MACHINE_ARCH}}
 BOOT_MACHINE_DIR:= ${BOOT_MACHINE_DIR.${DEP_MACHINE}}
 KERNEL_NAME:= ${KERNEL_NAME.${DEP_MACHINE}}
+
+.-include <site.dirdeps.mk>
diff --git a/share/mk/local.init.mk b/share/mk/local.init.mk
index 29a951a6aac0..c8072004697f 100644
--- a/share/mk/local.init.mk
+++ b/share/mk/local.init.mk
@@ -36,5 +36,6 @@ CFLAGS+= ${HOST_CFLAGS}
 .endif
 
 .-include "src.init.mk"
+.-include <site.init.mk>
 .-include "${.CURDIR}/local.init.mk"
 .endif
diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk
index 075a84fb67de..fc28b83d82cc 100644
--- a/share/mk/local.meta.sys.mk
+++ b/share/mk/local.meta.sys.mk
@@ -25,6 +25,9 @@ MACHINE_ARCH.host = ${_HOST_ARCH}
 
 # the list of machines we support
 ALL_MACHINE_LIST?= amd64 arm arm64 i386 powerpc riscv
+
+.-include <site.meta.sys.mk>
+
 .for m in ${ALL_MACHINE_LIST:O:u}
 MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_${m}:U$m}
 MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]}
diff --git a/share/mk/local.sys.env.mk b/share/mk/local.sys.env.mk
index 2187104e83fa..e3348537db41 100644
--- a/share/mk/local.sys.env.mk
+++ b/share/mk/local.sys.env.mk
@@ -49,3 +49,4 @@ ECHO_TRACE?=	true
 .endif
 
 .include "src.sys.env.mk"
+.-include <site.sys.env.mk>
diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk
index a4b7b0561f15..519c72df2383 100644
--- a/share/mk/local.sys.mk
+++ b/share/mk/local.sys.mk
@@ -52,6 +52,7 @@ _PREMK_LIBDIR:=	${LIBDIR}
 .endif
 
 .include "src.sys.mk"
+.-include <site.sys.mk>
 
 .if ${.MAKE.MODE:Mmeta*} != ""
 # we can afford to use cookies to prevent some targets
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 59b7630bcf55..db7c86651f96 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -756,6 +756,8 @@ LIBLNDIR=	${_LIB_OBJTOP}/usr.bin/lex/lib
 
 LIBTERMCAPWDIR=	${LIBTINFOWDIR}
 
+.-include <site.src.libnames.mk>
+
 # Default other library directories to lib/libNAME.
 .for lib in ${_LIBRARIES}
 LIB${lib:tu}DIR?=	${OBJTOP}/lib/lib${lib}
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index adb6912daa7d..de36d672d20e 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -242,6 +242,8 @@ __DEFAULT_DEPENDENT_OPTIONS= \
 __DEFAULT_DEPENDENT_OPTIONS+= ${var}_SUPPORT/${var}
 .endfor
 
+.-include <site.src.opts.mk>
+
 #
 # Default behaviour of some options depends on the architecture.  Unfortunately
 # this means that we have to test TARGET_ARCH (the buildworld case) as well
diff --git a/share/mk/src.sys.env.mk b/share/mk/src.sys.env.mk
index 86f739414230..e20bc52d2065 100644
--- a/share/mk/src.sys.env.mk
+++ b/share/mk/src.sys.env.mk
@@ -42,6 +42,8 @@ _undefMAKEOBJDIRPREFIX=	t
 .endif
 .endif
 
+.-include <site.src.sys.env.mk>
+
 SRC_ENV_CONF?= /etc/src-env.conf
 .if !empty(SRC_ENV_CONF) && !target(_src_env_conf_included_)
 .-include "${SRC_ENV_CONF}"
@@ -89,6 +91,6 @@ MAKESYSPATH:=	${.PARSEDIR:tA}
 .endif
 
 .if ${RELDIR:U} == "." && ${.MAKE.LEVEL} == 0
-.sinclude "${.CURDIR}/Makefile.sys.inc"
+.-include "${.CURDIR}/Makefile.sys.inc"
 .endif
 .include <src.sys.obj.mk>