From owner-svn-doc-head@freebsd.org Wed Sep 9 13:01:56 2015 Return-Path: Delivered-To: svn-doc-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 DD92FA01E38; Wed, 9 Sep 2015 13:01:55 +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 C1EC11985; Wed, 9 Sep 2015 13:01:55 +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 t89D1t2A092572; Wed, 9 Sep 2015 13:01:55 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t89D1tco092571; Wed, 9 Sep 2015 13:01:55 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201509091301.t89D1tco092571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Wed, 9 Sep 2015 13:01:55 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r47394 - head/en_US.ISO8859-1/books/porters-handbook/makefiles X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2015 13:01:56 -0000 Author: mat Date: Wed Sep 9 13:01:54 2015 New Revision: 47394 URL: https://svnweb.freebsd.org/changeset/doc/47394 Log: Add documentation about opt_VARS. Reviewed by: wblock Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D3516 Modified: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml Modified: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml Wed Sep 9 13:01:45 2015 (r47393) +++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml Wed Sep 9 13:01:54 2015 (r47394) @@ -4429,6 +4429,66 @@ X509_PREVENTS_MSG= X509 and SCTP patches + + <varname><replaceable>OPT</replaceable>_VARS</varname> + and + <varname><replaceable>OPT</replaceable>_VARS_OFF</varname> + + Provides a generic way to set and append to + variables. + + Before using + OPT_VARS and + OPT_VARS_OFF, + see if there is already a more specific helper available in + . + + When option OPT is selected, + and OPT_VARS + defined, + key=value + and + key+=value + pairs are evaluated from + OPT_VARS. An + = cause the existing value of + KEY to be overwritten, an + += appends to the value. + OPT_VARS_OFF + works the same way, but when OPT is + not selected. + + OPTIONS_DEFINE= OPT1 OPT2 OPT3 +OPT1_VARS= also_build+=bin1 +OPT2_VARS= also_build+=bin2 +OPT3_VARS= bin3_build=yes +OPT3_VARS_OFF= bin3_build=no + +MAKE_ARGS= ALSO_BUILD="${ALSO_BUILD}" BIN3_BUILD="${BIN3_BUILD}" + + is equivalent to: + + OPTIONS_DEFINE= OPT1 OPT2 + +MAKE_ARGS= ALSO_BUILD="${ALSO_BUILD}" BIN3_BUILD="${BIN3_BUILD}" + +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MOPT1} +ALSO_BUILD+= bin1 +.endif + +.if ${PORT_OPTIONS:MOPT2} +ALSO_BUILD+= bin2 +.endif + +.if ${PORT_OPTIONS:MOPT2} +BIN3_BUILD= yes +.else +BIN3_BUILD= no +.endif + + Dependencies, <varname><replaceable>OPT</replaceable>_<replaceable>DEPTYPE</replaceable></varname>