From owner-freebsd-ppc@freebsd.org Tue Dec 8 22:14:22 2015 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D53A79D452C; Tue, 8 Dec 2015 22:14:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id C54BF1FC7; Tue, 8 Dec 2015 22:14:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id BD3FC1F8B; Tue, 8 Dec 2015 22:14:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 7345B16D6D; Tue, 8 Dec 2015 22:14:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Uq7BxFo86i41; Tue, 8 Dec 2015 22:14:19 +0000 (UTC) Subject: Re: 11.0-CURRENT SRC_ENV_CONF file vs. MAKEOBJDIRPREFIX in the file: they do not mix DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 431EC16D64 To: Mark Millard , "Simon J. Gerraty" References: <2426.1449521335@chaos> Cc: FreeBSD PowerPC ML , FreeBSD Toolchain , FreeBSD Current From: Bryan Drewery Organization: FreeBSD Message-ID: <56675638.5010904@FreeBSD.org> Date: Tue, 8 Dec 2015 14:14:16 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 22:14:22 -0000 On 12/7/15 1:33 PM, Mark Millard wrote: > >> On 2015-Dec-7, at 12:48 PM, Simon J. Gerraty wrote: >> >> Mark Millard 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 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). -- Regards, Bryan Drewery