Date: Tue, 15 Dec 2015 10:54:48 -0800 From: Bryan Drewery <bdrewery@FreeBSD.org> To: Mark Millard <markmi@dsl-only.net> Cc: "Simon J. Gerraty" <sjg@juniper.net>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: 11.0-CURRENT SRC_ENV_CONF file vs. MAKEOBJDIRPREFIX in the file: they do not mix Message-ID: <567061F8.4040508@FreeBSD.org> In-Reply-To: <1F2AC0BD-8963-46BA-9C1B-EB5F48CDA204@dsl-only.net> References: <A9ECA670-0B14-455E-BB22-7B546CE182CB@dsl-only.net> <2426.1449521335@chaos> <D5A9EE24-519D-4870-9370-64FB826130DA@dsl-only.net> <56675638.5010904@FreeBSD.org> <56705DEB.2030004@FreeBSD.org> <1F2AC0BD-8963-46BA-9C1B-EB5F48CDA204@dsl-only.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 12/15/15 10:54 AM, Mark Millard wrote: > On 2015-Dec-15, at 10:37 AM, Bryan Drewery <bdrewery@FreeBSD.org> wrote: >> >> On 12/8/15 2:14 PM, Bryan Drewery wrote: >>> On 12/7/15 1:33 PM, Mark Millard wrote: >>>> >>>>> On 2015-Dec-7, at 12:48 PM, Simon J. Gerraty <sjg@juniper.net> wrote: >>>>> >>>>> Mark Millard <markmi@dsl-only.net> wrote: >>>>>> My guess is that it is picking up the >>>>>> >>>>>> MAKEOBJDIRPREFIX=/usr/obj/xtoolchain >>>>> >>>>> You should use ?= if you want this to work. >>>>> There are many places in Makefile.inc1 where MAKEOBJDIRPREFIX is tweaked >>>>> in the environment of a sub-make. >>>>> >>>>> By using = above, you break that. >>>> >>>> That presumes that MAKEOBJDIRPREFIX has not been assigned a default value before the SRC_ENV_CONF file has been included the first time. If MAKEOBJDIRPREFIX had been defined already then the ?= would do nothing and the wrong value would be used. >>>> >>>> I believe that the following trace shows that such an assignment of a default value does happen first, making ?= not work either. >>>> >>>> >>>> >>>> /usr/src/Makefile (head/Makefile 29160) has >>>> >>>>> MAKEOBJDIRPREFIX?= /usr/obj >>>> >>>> at line 145 (used when it is not using targets/Makefile from the relevant .if/.else/.endif). >>>> >>>> Line 105 has .include <bsd.compiler.mk> and there no others before the above assignment. bsd.compiler.mk in turn includes bsd.opt.mk (only), which in turns includes bsd.mkopt.mk (only). That in turn includes nothing else. So these files and only these files are the involved files before that assignment as far as I can tell. >>>> >>>> None of these get to src.sys.env.mk and so SRC_ENV_CONF use has not happened yet when >>>> >>>>> MAKEOBJDIRPREFIX?= /usr/obj >>>> >>>> is executed. >>>> >>>> So, if I understand right, MAKEOBJDIRPREFIX is already defined before the code >>>> >>>>> 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 >>>> >>>> is executed and so using ?= would not be effective in the included file. >>>> >>>> Did I miss something? >>> >>> >>> Yes. sys.mk and src-env.conf are included *before* Makefile. Think of it >>> as being in line 0. >>> >>> Technically you should be able to use MAKEOBJDIRPREFIX in make.conf or >>> src.conf if you are not using any of the meta mode features (all off by >>> default). >>> >> >> Clarification: We *could* support this but it does not work today. We >> can use .OBJDIR to force using a MAKEOBJDIRPREFIX from make.conf but >> only if we also force creating the directory as well. Getting this all >> right just ends up falling into the new auto.obj.mk territory anyhow. I >> do want to expand that to the default build, which would allow setting >> MAKEOBJDIRPREFIX in src-env.conf. > > > So may be the paragraph below from "man src.conf" should not (yet?) suggest that MAKEOBJDIRPREFIX is valid in a file to be referenced by SRC_ENV_CONF: > >> The environment of make(1) for the build can be controlled via the >> SRC_ENV_CONF variable, which defaults to /etc/src-env.conf. Some >> examples that may only be set in this file are MAKEOBJDIRPREFIX, >> WITH_DIRDEPS_BUILD, and WITH_META_MODE as they are environment-only >> variables. > > Yes, I fixed it after my mail. -- Regards, Bryan Drewery
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?567061F8.4040508>