freebsd-dev/share/mk/src.sys.mk
Bryan Drewery 945ceaafbc Only include src.conf if _WITHOUT_SRCCONF not defined.
This does not really fix anything currently since _WITHOUT_SRCCONF must be
defined in the environment or local.sys.*.mk, but is proper and needed for
downstream fixes.  I am working towards reworking src.conf inclusion still.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 20:56:16 +00:00

38 lines
1.3 KiB
Makefile

# $FreeBSD$
# Note: This file is also duplicated in the sys/conf/kern.pre.mk so
# it will always grab SRCCONF, even if it isn't being built in-tree
# to preserve historical (and useful) behavior. Changes here need to
# be reflected there so SRCCONF isn't included multiple times.
.if !defined(_WITHOUT_SRCCONF)
# Allow user to configure things that only effect src tree builds.
SRCCONF?= /etc/src.conf
.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_)
# Validate that the user didn't try setting an env-only variable in
# their src.conf. This benefits from already including bsd.mkopt.mk.
.for var in ${__ENV_ONLY_OPTIONS}
__presrcconf_${var}:= ${MK_${var}:U-}${WITHOUT_${var}:Uno:Dyes}${WITH_${var}:Uno:Dyes}
.endfor
.sinclude "${SRCCONF}"
_srcconf_included_: .NOTMAIN
# Validate the env-only variables.
.for var in ${__ENV_ONLY_OPTIONS}
__postrcconf_${var}:= ${MK_${var}:U-}${WITHOUT_${var}:Uno:Dyes}${WITH_${var}:Uno:Dyes}
.if ${__presrcconf_${var}} != ${__postrcconf_${var}}
.error Option ${var} may only be defined in ${SRC_ENV_CONF}, environment, or make argument, not ${SRCCONF}.
.endif
.undef __presrcconf_${var}
.undef __postrcconf_${var}
.endfor
.endif # SRCCONF
.endif
# tempting, but bsd.compiler.mk causes problems this early
# probably need to remove dependence on bsd.own.mk
#.include "src.opts.mk"