From owner-svn-src-head@freebsd.org Sun Nov 5 00:12:10 2017 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 B6EBFE5AEB8; Sun, 5 Nov 2017 00:12:10 +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 651716421A; Sun, 5 Nov 2017 00:12:10 +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 vA50C9hh042998; Sun, 5 Nov 2017 00:12:09 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA50C9wD042997; Sun, 5 Nov 2017 00:12:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711050012.vA50C9wD042997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 00:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325417 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325417 X-SVN-Commit-Repository: base 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.23 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: Sun, 05 Nov 2017 00:12:11 -0000 Author: bdrewery Date: Sun Nov 5 00:12:09 2017 New Revision: 325417 URL: https://svnweb.freebsd.org/changeset/base/325417 Log: Set the expected __objdir for auto.obj.mk to try. This avoids some future discrepency that might cause auto.obj.mk to use the wrong OBJDIR. Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.sys.obj.mk Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Sun Nov 5 00:12:05 2017 (r325416) +++ head/share/mk/src.sys.obj.mk Sun Nov 5 00:12:09 2017 (r325417) @@ -94,9 +94,17 @@ OBJROOT:= ${OBJTOP}/ .endif .endif -# Try to enable MK_AUTO_OBJ by default if we can write to the OBJROOT. Only -# do this if AUTO_OBJ is not disabled by the user, not cleaning, and this -# is the first make ran. +# __objdir is the expected .OBJDIR we want to use and that auto.obj.mk will +# try to create. +.if !empty(MAKEOBJDIRPREFIX) +__objdir:= ${MAKEOBJDIRPREFIX}${.CURDIR} +.elif !empty(MAKEOBJDIR) +__objdir:= ${MAKEOBJDIR} +.endif + +# Try to enable MK_AUTO_OBJ by default if we can write to the __objdir. Only +# do this if AUTO_OBJ is not disabled by the user, not cleaning, and this is +# the first make ran. .if 0 && ${.MAKE.LEVEL} == 0 && \ ${MK_AUTO_OBJ} == "no" && empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) && \ !defined(WITHOUT_AUTO_OBJ) && !make(showconfig) && !make(print-dir) && \ @@ -138,15 +146,13 @@ CheckAutoObj() { \ echo no; \ fi; \ } -.if !empty(MAKEOBJDIRPREFIX) -WANTED_OBJDIR= ${MAKEOBJDIRPREFIX}${.CURDIR} -.else -WANTED_OBJDIR= ${MAKEOBJDIR} +.if !empty(__objdir) +__objdir_writable!= \ + ${CheckAutoObj}; CheckAutoObj "${__objdir}" || echo no .endif -OBJDIR_WRITABLE!= \ - ${CheckAutoObj}; CheckAutoObj "${WANTED_OBJDIR}" || echo no +__objdir_writable?= no # Export the decision to sub-makes. -MK_AUTO_OBJ:= ${OBJDIR_WRITABLE} +MK_AUTO_OBJ:= ${__objdir_writable} .export MK_AUTO_OBJ .elif make(showconfig) # Need to export for showconfig internally running make -dg1. It is enabled @@ -157,10 +163,8 @@ MK_AUTO_OBJ:= ${OBJDIR_WRITABLE} # Assign this directory as .OBJDIR if possible. # # The expected OBJDIR already exists, set it as .OBJDIR. -.if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}${.CURDIR}) -.OBJDIR: ${MAKEOBJDIRPREFIX}${.CURDIR} -.elif exists(${MAKEOBJDIR}) -.OBJDIR: ${MAKEOBJDIR} +.if !empty(__objdir) && exists(${__objdir}) +.OBJDIR: ${__objdir} # Special case to work around bmake bug. If the top-level .OBJDIR does not yet # exist and MAKEOBJDIR is passed into environment and yield a blank value, # bmake will incorrectly set .OBJDIR=${SRCTOP}/ rather than the expected