From owner-svn-ports-head@freebsd.org Fri Aug 21 12:02:51 2015 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 654BB9BE836; Fri, 21 Aug 2015 12:02:51 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 562A01046; Fri, 21 Aug 2015 12:02:51 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LC2psO039645; Fri, 21 Aug 2015 12:02:51 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LC2pWK039644; Fri, 21 Aug 2015 12:02:51 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201508211202.t7LC2pWK039644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Fri, 21 Aug 2015 12:02:51 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r394939 - head/Mk X-SVN-Group: ports-head 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.20 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: Fri, 21 Aug 2015 12:02:51 -0000 Author: mat Date: Fri Aug 21 12:02:50 2015 New Revision: 394939 URL: https://svnweb.freebsd.org/changeset/ports/394939 Log: Optimize opt_IMPLIES. PR: 191144 Submitted by: hrs Sponsored by: Absolight Modified: head/Mk/bsd.options.mk Modified: head/Mk/bsd.options.mk ============================================================================== --- head/Mk/bsd.options.mk Fri Aug 21 11:53:30 2015 (r394938) +++ head/Mk/bsd.options.mk Fri Aug 21 12:02:50 2015 (r394939) @@ -373,11 +373,37 @@ NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}} ## Enable options implied by other options # _PREVENTS is handled in bsd.port.mk:pre-check-config -.for count in ${PORT_OPTIONS} -. for opt in ${PORT_OPTIONS} -PORT_OPTIONS+= ${${opt}_IMPLIES} +## 1) Build dependency chain in A.B format: +_DEPCHAIN= +.for opt in ${COMPLETE_OPTIONS_LIST} +. for o in ${${opt}_IMPLIES} +_DEPCHAIN+= ${opt}.$o . endfor .endfor +## 2) Check each dependency pair and if LHS is in PORT_OPTIONS then add RHS. +## All of RHS of "RHS.*" (i.e. indirect dependency) are also added for +## fast convergence. +_PORT_OPTIONS:= ${PORT_OPTIONS} +.for count in _0 ${COMPLETE_OPTIONS_LIST} +### Check if all of the nested dependency are resolved already. +. if ${count} == _0 || ${_PORT_OPTIONS} != ${PORT_OPTIONS} +PORT_OPTIONS:= ${_PORT_OPTIONS} +. for dc in ${_DEPCHAIN} +. for opt in ${_PORT_OPTIONS} +_opt=${opt} +### Add all of direct and indirect dependency only if +### they are not in ${PORT_OPTIONS}. +. if !empty(_opt:M${dc:R}) +. for d in ${dc:E} ${_DEPCHAIN:M${dc:E}.*:E} +. if empty(_PORT_OPTIONS:M$d) +_PORT_OPTIONS+= $d +. endif +. endfor +. endif +. endfor +. endfor +. endif +.endfor # Finally, add options required by slave ports PORT_OPTIONS+= ${OPTIONS_SLAVE}