From owner-svn-src-head@freebsd.org Thu Jan 7 00:19:04 2016 Return-Path: Delivered-To: svn-src-head@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 BE60EA650A4; Thu, 7 Jan 2016 00:19:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BFDF155E; Thu, 7 Jan 2016 00:19:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u070J3G3060136; Thu, 7 Jan 2016 00:19:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u070J3KI060134; Thu, 7 Jan 2016 00:19:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601070019.u070J3KI060134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 7 Jan 2016 00:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293286 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 00:19:04 -0000 Author: bdrewery Date: Thu Jan 7 00:19:03 2016 New Revision: 293286 URL: https://svnweb.freebsd.org/changeset/base/293286 Log: Move the MAKEOBJDIRPREFIX value guard to sys.mk and expand to MAKEOBJDIR. This will ensure that the variable was not set as a make override, in make.conf, src.conf or src-env.conf. It allows setting the value in src-env.conf when using WITH_AUTO_OBJ since that case properly handles changing .OBJDIR (except if MAKEOBJDIRPREFIX does not yet exist which is being discussed to be changed). This change allows setting a default MAKEOBJDIRPREFIX via local.sys.env.mk. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile head/share/mk/sys.mk Modified: head/Makefile ============================================================================== --- head/Makefile Thu Jan 7 00:15:02 2016 (r293285) +++ head/Makefile Thu Jan 7 00:19:03 2016 (r293286) @@ -143,13 +143,6 @@ TGTS+= ${BITGTS} PATH= /sbin:/bin:/usr/sbin:/usr/bin MAKEOBJDIRPREFIX?= /usr/obj -_MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \ - ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ - -f /dev/null -V MAKEOBJDIRPREFIX dummy -.if !empty(_MAKEOBJDIRPREFIX) -.error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ - (in make.conf(5)) or command-line variable. -.endif # We often need to use the tree's version of make to build it. # Choices add to complexity though. Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Thu Jan 7 00:15:02 2016 (r293285) +++ head/share/mk/sys.mk Thu Jan 7 00:19:03 2016 (r293286) @@ -33,6 +33,13 @@ __ENV_ONLY_OPTIONS:= \ ${__DEFAULT_YES_OPTIONS} \ ${__DEFAULT_DEPENDENT_OPTIONS:H} +__ENV_ONLY_VARS= \ + MAKEOBJDIR \ + MAKEOBJDIRPREFIX +.for _var in ${__ENV_ONLY_VARS} +_pre_includes_${_var:tl}:= ${${_var}:U__null} +.endfor + # early include for customization # see local.sys.mk below # Not included when building in fmake compatibility mode (still needed @@ -50,6 +57,9 @@ __ENV_ONLY_OPTIONS:= \ .endif .endif .if ${MK_AUTO_OBJ} == "yes" +# Reset, since it is allowed to be set from src-env.conf included before this. +_pre_includes_makeobjdirprefix:= ${MAKEOBJDIRPREFIX:U__null} +_pre_includes_makeobjdir:= ${MAKEOBJDIR:U__null} # This needs to be done early - before .PATH is computed # Don't do this for 'make showconfig' as it enables all options where meta mode # is not expected. @@ -410,6 +420,15 @@ __MAKE_SHELL?=/bin/sh path=${__MAKE_SHELL} .endif +# Ensure MAKEOBJDIRPREFIX was not incorrectly set. +.for _var in ${__ENV_ONLY_VARS} +.if ${.MAKEOVERRIDES:M${_var}} || (defined(${_var}) && \ + ${${_var}} != ${_pre_includes_${_var:tl}}) +.error ${_var} can only be set in environment, not as a global (in make.conf(5)) or command-line variable. +.endif +.undef _pre_includes_${_var:tl} +.endfor + # Hack for ports compatibility. Historically, ports makefiles have # assumed they can examine MACHINE_CPU without including anything # because this was automatically included in sys.mk. For /usr/src,