xref: /freebsd/share/mk/src.sys.mk (revision 39ee7a7a6bdd1557b1c3532abf60d139798ac88b)
1# $FreeBSD$
2
3# Note: This file is also duplicated in the sys/conf/kern.pre.mk so
4# it will always grab SRCCONF, even if it isn't being built in-tree
5# to preserve historical (and useful) behavior. Changes here need to
6# be reflected there so SRCCONF isn't included multiple times.
7
8# Allow user to configure things that only effect src tree builds.
9SRCCONF?=	/etc/src.conf
10.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_)
11
12# Validate that the user didn't try setting an env-only variable in
13# their src.conf. This benefits from already including bsd.mkopt.mk.
14.for var in ${__ENV_ONLY_OPTIONS}
15__presrcconf_${var}:=	${MK_${var}:U-}${WITHOUT_${var}:Uno:Dyes}${WITH_${var}:Uno:Dyes}
16.endfor
17
18.sinclude "${SRCCONF}"
19_srcconf_included_:	.NOTMAIN
20
21# Validate the env-only variables.
22.for var in ${__ENV_ONLY_OPTIONS}
23__postrcconf_${var}:=	${MK_${var}:U-}${WITHOUT_${var}:Uno:Dyes}${WITH_${var}:Uno:Dyes}
24.if ${__presrcconf_${var}} != ${__postrcconf_${var}}
25.error Option ${var} may only be defined in ${SRC_ENV_CONF}, environment, or make argument, not ${SRCCONF}.
26.endif
27.undef __presrcconf_${var}
28.undef __postrcconf_${var}
29.endfor
30
31.endif # SRCCONF
32
33# tempting, but bsd.compiler.mk causes problems this early
34# probably need to remove dependence on bsd.own.mk
35#.include "src.opts.mk"
36