git: a5bf37963aeb - stable/14 - src.sys.mk: Support src.conf in SRCTOP
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 16 Sep 2025 13:59:16 UTC
The branch stable/14 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=a5bf37963aeb6ee2dc2c26cb39a1931ea7558055
commit a5bf37963aeb6ee2dc2c26cb39a1931ea7558055
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2025-09-10 16:57:26 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2025-09-16 13:27:55 +0000
src.sys.mk: Support src.conf in SRCTOP
If SRCCONF is not defined and src.conf exists at the top level of the
source tree, use that instead of /etc/src.conf.
MFC after: 3 days
Reviewed by: kevans, imp
Differential Revision: https://reviews.freebsd.org/D52470
(cherry picked from commit dd8c666d8b78f6b9ddb691f0505837fa885ff3b4)
UPDATING: mention the src.conf change
Fixes: dd8c666d8b78 ("src.sys.mk: Support src.conf in SRCTOP")
(cherry picked from commit ab2fea3f9a5a58f0ba90499ad3a8614e3dca0c5f)
---
.gitignore | 1 +
UPDATING | 5 +++++
share/man/man5/src.conf.5 | 9 ++++++---
share/mk/src.sys.mk | 4 ++++
sys/conf/kern.pre.mk | 4 ++++
tools/build/options/makeman | 7 +++++--
6 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore
index 785568271794..ffa366fde357 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,4 @@ tags
.cache
.clangd
.ccls-cache
+/src.conf
diff --git a/UPDATING b/UPDATING
index 965ecac80055..644e17fc55be 100644
--- a/UPDATING
+++ b/UPDATING
@@ -12,6 +12,11 @@ Items affecting the ports and packages system can be found in
/usr/ports/UPDATING. Please read that file before updating system packages
and/or ports.
+20250916:
+ If SRCCONF is unset and a file named src.conf is present at
+ the top of the source tree, it will now be used instead of
+ /etc/src.conf.
+
20250823:
Commit 3f61ececacd8 changed the internal KAPI between
the NFS modules. As such, they all need to be rebuilt
diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index 63fba6d2ac01..24d041d055a4 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,5 +1,5 @@
.\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
-.Dd June 13, 2025
+.Dd September 16, 2025
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -29,8 +29,11 @@ variables that control the aspects of how the system builds.
.Pp
The default location of
.Nm
-is
-.Pa /etc/src.conf ,
+is the top level of the source tree, or
+.Pa /etc/src.conf
+if no
+.Nm
+is found in the source tree itself,
though an alternative location can be specified in the
.Xr make 1
variable
diff --git a/share/mk/src.sys.mk b/share/mk/src.sys.mk
index d5c2af0c559d..d563859586b0 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_)
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index ff19cd75d3ea..becd11da64c9 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -8,7 +8,11 @@
# the rest of /usr/src, but they still always process SRCCONF even though
# the normal mechanisms to prevent that (compiling out of tree) won't
# work. To ensure they do work, we have to duplicate thee few lines here.
+.if exists(${SRCTOP}/src.conf)
+SRCCONF?= ${SRCTOP}/src.conf
+.else
SRCCONF?= /etc/src.conf
+.endif
.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_)
.include "${SRCCONF}"
_srcconf_included_:
diff --git a/tools/build/options/makeman b/tools/build/options/makeman
index 4e44c78b0278..fb75990cc383 100755
--- a/tools/build/options/makeman
+++ b/tools/build/options/makeman
@@ -179,8 +179,11 @@ variables that control the aspects of how the system builds.
.Pp
The default location of
.Nm
-is
-.Pa /etc/src.conf ,
+is the top level of the source tree, or
+.Pa /etc/src.conf
+if no
+.Nm
+is found in the source tree itself,
though an alternative location can be specified in the
.Xr make 1
variable