diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ .clangd .ccls-cache sys/*/compile +/src.conf diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 --- 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 August 20, 2025 +.Dd September 10, 2025 .Dt SRC.CONF 5 .Os .Sh NAME @@ -29,8 +29,11 @@ .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 --- 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 --- 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 --- a/tools/build/options/makeman +++ b/tools/build/options/makeman @@ -222,8 +222,11 @@ .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