Date: Thu, 17 Sep 2015 21:49:29 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287939 - head/share/mk Message-ID: <201509172149.t8HLnT1n016833@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Thu Sep 17 21:49:29 2015 New Revision: 287939 URL: https://svnweb.freebsd.org/changeset/base/287939 Log: Add a check to ensure that the env-only mkopts are not set via src.conf. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.sys.mk Modified: head/share/mk/src.sys.mk ============================================================================== --- head/share/mk/src.sys.mk Thu Sep 17 21:12:47 2015 (r287938) +++ head/share/mk/src.sys.mk Thu Sep 17 21:49:29 2015 (r287939) @@ -8,9 +8,27 @@ # 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 # tempting, but bsd.compiler.mk causes problems this early # probably need to remove dependence on bsd.own.mk
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509172149.t8HLnT1n016833>