From owner-svn-src-head@FreeBSD.ORG Fri Apr 18 17:04:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8091DD5; Fri, 18 Apr 2014 17:04:27 +0000 (UTC) Received: from svn.freebsd.org (svn.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 53BB216CB; Fri, 18 Apr 2014 17:04:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3IH4RA9050724; Fri, 18 Apr 2014 17:04:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3IH4QaR050720; Fri, 18 Apr 2014 17:04:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201404181704.s3IH4QaR050720@svn.freebsd.org> From: Warner Losh Date: Fri, 18 Apr 2014 17:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264663 - 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.17 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: Fri, 18 Apr 2014 17:04:27 -0000 Author: imp Date: Fri Apr 18 17:04:26 2014 New Revision: 264663 URL: http://svnweb.freebsd.org/changeset/base/264663 Log: Move the generic part of bsd.opts.mk into bsd.mkopts.mk to allow for the WITH/WITHOUT_FOO -> MK_FOO={yes,no} stuff to be used elsewhere. Added: head/share/mk/bsd.mkopt.mk (contents, props changed) Modified: head/share/mk/bsd.opts.mk Added: head/share/mk/bsd.mkopt.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/bsd.mkopt.mk Fri Apr 18 17:04:26 2014 (r264663) @@ -0,0 +1,40 @@ +# +# $FreeBSD$ +# +# Generic mechanism to deal with WITH and WITHOUT options and turn them into MK_ options. +# +# +# For each option FOO that defaults to YES, MK_FOO is set to yes, unless WITHOUT_FOO +# is defined, in which case it is set to no. If both WITH_FOO and WITHOUT_FOO are +# defined, WITHOUT_FOO wins. The list of default yes options is contained in the +# __DEFAULT_YES_OPTIONS variable, which is undefined after expansion. +# +# For each option FOO that defaults to NO, MK_FOO is set to no, unless WITH_FOO +# is defined, in which case it is set to yes. If both WITH_FOO and WITHOUT_FOO are +# defined, WITH_FOO wins. The list of default no options is contained in the +# __DEFAULT_NO_OPTIONS variable, which is undefined after expansion. +# +.for var in ${__DEFAULT_YES_OPTIONS} +.if !defined(MK_${var}) +.if defined(WITHOUT_${var}) # IF both WITH and WITHOUT defined, WITHOUT wins. +MK_${var}:= no +.else +MK_${var}:= yes +.endif +.endif +.endfor +.undef __DEFAULT_YES_OPTIONS + +# +# MK_* options which default to "no". +# +.for var in ${__DEFAULT_NO_OPTIONS} +.if !defined(MK_${var}) +.if defined(WITH_${var}) # If both WITH and WITHOUT defined, WITH wins +MK_${var}:= yes +.else +MK_${var}:= no +.endif +.endif +.endfor +.undef __DEFAULT_NO_OPTIONS Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Fri Apr 18 17:04:18 2014 (r264662) +++ head/share/mk/bsd.opts.mk Fri Apr 18 17:04:26 2014 (r264663) @@ -243,34 +243,7 @@ __DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG __DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP .endif -# -# MK_* options which default to "yes". -# -.for var in ${__DEFAULT_YES_OPTIONS} -.if !defined(MK_${var}) -.if defined(WITHOUT_${var}) -MK_${var}:= no -.else -MK_${var}:= yes -.endif -.endif -.endfor -.undef __DEFAULT_YES_OPTIONS - -# -# MK_* options which default to "no". -# -.for var in ${__DEFAULT_NO_OPTIONS} -.if !defined(MK_${var}) -.if defined(WITH_${var}) -MK_${var}:= yes -.else -MK_${var}:= no -.endif -.endif -.endfor -.undef __DEFAULT_NO_OPTIONS - +.include # # Supported NO_* options (if defined, MK_* will be forced to "no",