svn commit: r284598 - head/share/mk

Bryan Drewery bdrewery at FreeBSD.org
Wed Jul 29 01:04:16 UTC 2015


On 6/19/15 7:56 AM, Simon J. Gerraty wrote:
> Author: sjg
> Date: Fri Jun 19 14:56:24 2015
> New Revision: 284598
> URL: https://svnweb.freebsd.org/changeset/base/284598
> 
> Log:
>   Move include of make.conf back to its old position.
>   
>   This means moving include of local.sys.mk and src.sys.mk too.
>   Introduce new includes to take the early slot, for the purpose
>   of being able to influence toolchains and the like.
>   
>   Differential Revision:	D2860
>   Reviewed by:	imp
> 
> Added:
>   head/share/mk/local.sys.env.mk
>      - copied, changed from r284432, head/share/mk/local.sys.mk
>   head/share/mk/src.sys.env.mk
>      - copied, changed from r284432, head/share/mk/src.sys.mk
> Modified:
>   head/share/mk/local.sys.mk

I'm bothered by the amount of local.* files committed in the tree. I
expect, as a user and working in a downstream product, that a local.*
file is MINE, not FREEBSD. The pattern of using 'local' is quite common
as a *user* file.

Why are these named as such? It seems they should just be 'src.' with
.sinclude hooks for actual local overrides.

local.autodep.mk local.dirdeps.mk local.gendirdeps.mk local.init.mk
local.meta.sys.mk local.sys.env.mk local.sys.mk


>   head/share/mk/src.sys.mk
>   head/share/mk/sys.mk
> 

...

> +# site customizations that do not depend on anything!
> +SRC_ENV_CONF?= /etc/src-env.conf
> +.if !empty(SRC_ENV_CONF) && !target(_src_env_conf_included_)
> +.-include "${SRC_ENV_CONF}"
> +_src_env_conf_included_:	.NOTMAIN
>  .endif

This needs to be documented in at least src.conf(5). I'm concerned that
the need to add this indicates subtle changes elsewhere that may break
existing /etc/src.conf setups, but I cannot find an example.

> +
>  # If we were found via .../share/mk we need to replace that
>  # with ${.PARSEDIR:tA} so that we can be found by
>  # sub-makes launched from objdir.
> @@ -24,5 +22,3 @@ _srcconf_included_:	.NOTMAIN
>  MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},}
>  .export MAKESYSPATH
>  .endif
> -# tempting, but bsd.compiler.mk causes problems this early
> -#.include "src.opts.mk"
> 
> Modified: head/share/mk/src.sys.mk
> ==============================================================================
> --- head/share/mk/src.sys.mk	Fri Jun 19 14:20:21 2015	(r284597)
> +++ head/share/mk/src.sys.mk	Fri Jun 19 14:56:24 2015	(r284598)
> @@ -5,24 +5,13 @@
>  # to preserve historical (and useful) behavior. Changes here need to
>  # be reflected there so SRCCONF isn't included multiple times.
>  
> -# make sure this is defined in a consistent manner
> -SRCTOP:= ${.PARSEDIR:tA:H:H}
> -
>  # 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_)
>  .sinclude "${SRCCONF}"
>  _srcconf_included_:	.NOTMAIN
>  .endif
> -# If we were found via .../share/mk we need to replace that
> -# with ${.PARSEDIR:tA} so that we can be found by
> -# sub-makes launched from objdir.
> -.if ${.MAKEFLAGS:M.../share/mk} != ""
> -.MAKEFLAGS:= ${.MAKEFLAGS:S,.../share/mk,${.PARSEDIR:tA},}
> -.endif
> -.if ${MAKESYSPATH:Uno:M*.../*} != ""
> -MAKESYSPATH:= ${MAKESYSPATH:S,.../share/mk,${.PARSEDIR:tA},}
> -.export MAKESYSPATH
> -.endif
> +
>  # tempting, but bsd.compiler.mk causes problems this early
> +# probably need to remove dependence on bsd.own.mk 
>  #.include "src.opts.mk"
> 
> Modified: head/share/mk/sys.mk
> ==============================================================================
> --- head/share/mk/sys.mk	Fri Jun 19 14:20:21 2015	(r284597)
> +++ head/share/mk/sys.mk	Fri Jun 19 14:56:24 2015	(r284598)
> @@ -31,15 +31,9 @@ __DEFAULT_DEPENDENT_OPTIONS= \
>  
>  .include <bsd.mkopt.mk>
>  
> -# Pull in global settings.
> -__MAKE_CONF?=/etc/make.conf
> -.if exists(${__MAKE_CONF})
> -.include "${__MAKE_CONF}"
> -.endif
> -
> -# Set any local definitions first. Place this early, but it needs
> -# MACHINE_CPUARCH to be defined.
> -.-include <local.sys.mk>
> +# early include for customization
> +# see local.sys.mk below
> +.-include <local.sys.env.mk>
>  
>  .if ${MK_META_MODE} == "yes"
>  .-include <meta.sys.mk>
> @@ -360,6 +354,14 @@ YFLAGS		?=	-d
>  	rm -f ${.PREFIX}.tmp.c
>  	${CTFCONVERT_CMD}
>  
> +# Pull in global settings.
> +__MAKE_CONF?=/etc/make.conf
> +.if exists(${__MAKE_CONF})
> +.include "${__MAKE_CONF}"
> +.endif
> +
> +# late include for customization
> +.-include <local.sys.mk>

In local.sys.mk from r284345 is an inclusion of SRCCONF, which is now
different and earlier than before. I wonder if this should move back to
only being included from bsd.own.mk (there is even a lingering
WITHOUT_SRCCONF check in that file). The way it is now is very obscure
in terms of when it is actually included and from where.

>  
>  .if defined(__MAKE_SHELL) && !empty(__MAKE_SHELL)
>  SHELL=	${__MAKE_SHELL}
> 


-- 
Regards,
Bryan Drewery


More information about the svn-src-head mailing list