From owner-svn-ports-head@freebsd.org Wed Nov 15 19:13:51 2017 Return-Path: Delivered-To: svn-ports-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 69CE0DE495D; Wed, 15 Nov 2017 19:13:51 +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 3668976B38; Wed, 15 Nov 2017 19:13:51 +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 vAFJDoYE019656; Wed, 15 Nov 2017 19:13:50 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAFJDo6Z019655; Wed, 15 Nov 2017 19:13:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711151913.vAFJDo6Z019655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 15 Nov 2017 19:13:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r454266 - head/Mk X-SVN-Group: ports-head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/Mk X-SVN-Commit-Revision: 454266 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Nov 2017 19:13:51 -0000 Author: bdrewery Date: Wed Nov 15 19:13:50 2017 New Revision: 454266 URL: https://svnweb.freebsd.org/changeset/ports/454266 Log: Fix [DE]SELECTED_OPTIONS to lazily evaluate as late as possible. If a port modifies OPTIONS_UNSET after including bsd.port.options.mk then these values were wrong even though all of 'showconfig', 'pretty-print-config', and the package generated all had the expected options. Only Poudriere and synth use these variables for incremental build checks. Reviewed by: sjg, bapt Approved by: portmgr (bapt) Differential Revision: https://reviews.freebsd.org/D13092 Modified: head/Mk/bsd.options.mk Modified: head/Mk/bsd.options.mk ============================================================================== --- head/Mk/bsd.options.mk Wed Nov 15 18:57:48 2017 (r454265) +++ head/Mk/bsd.options.mk Wed Nov 15 19:13:50 2017 (r454266) @@ -640,22 +640,15 @@ _OPTIONS_${_target}:= ${_OPTIONS_${_target}} ${_prio}: .undef (SELECTED_OPTIONS) .undef (DESELECTED_OPTIONS) -.for opt in ${ALL_OPTIONS} -. if ${PORT_OPTIONS:M${opt}} -SELECTED_OPTIONS:= ${opt} ${SELECTED_OPTIONS} -. else -DESELECTED_OPTIONS:= ${opt} ${DESELECTED_OPTIONS} -. endif -.endfor +# Wait to expand PORT_OPTIONS until the last moment in case something modifies +# the selected OPTIONS after bsd.port.options.mk is included. This uses +# bmake's :@ for loop. +SELECTED_OPTIONS= ${ALL_OPTIONS:@opt@${PORT_OPTIONS:M${opt}}@} +DESELECTED_OPTIONS= ${ALL_OPTIONS:@opt@${"${PORT_OPTIONS:M${opt}}":?:${opt}}@} .for otype in MULTI GROUP SINGLE RADIO . for m in ${OPTIONS_${otype}} -. for opt in ${OPTIONS_${otype}_${m}} -. if ${PORT_OPTIONS:M${opt}} -SELECTED_OPTIONS:= ${opt} ${SELECTED_OPTIONS} -. else -DESELECTED_OPTIONS:= ${opt} ${DESELECTED_OPTIONS} -. endif -. endfor +SELECTED_OPTIONS+= ${OPTIONS_${otype}_${m}:@opt@${PORT_OPTIONS:M${opt}}@} +DESELECTED_OPTIONS+= ${OPTIONS_${otype}_${m}:@opt@${"${PORT_OPTIONS:M${opt}}":?:${opt}}@} . endfor .endfor