From owner-svn-doc-head@freebsd.org Wed Sep 9 13:01:45 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 EFC97A01E00; Wed, 9 Sep 2015 13:01:45 +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 DBF5A194D; Wed, 9 Sep 2015 13:01:45 +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 t89D1j4S092520; Wed, 9 Sep 2015 13:01:45 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t89D1jPd092519; Wed, 9 Sep 2015 13:01:45 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201509091301.t89D1jPd092519@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:45 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r47393 - 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:46 -0000 Author: mat Date: Wed Sep 9 13:01:45 2015 New Revision: 47393 URL: https://svnweb.freebsd.org/changeset/doc/47393 Log: Combine sections describe SOMETHING and SOMETHING_OFF. 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 09:43:40 2015 (r47392) +++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml Wed Sep 9 13:01:45 2015 (r47393) @@ -4111,7 +4111,9 @@ SUB_LIST+= OPT1="@comment " NO_OPT1="" - <varname><replaceable>OPT</replaceable>_USE</varname> + <varname><replaceable>OPT</replaceable>_USE</varname> + and + <varname><replaceable>OPT</replaceable>_USE_OFF</varname> When option OPT is selected, for each @@ -4123,10 +4125,14 @@ SUB_LIST+= OPT1="@comment " NO_OPT1="" USE_KEY. If value has spaces in it, replace them with commas and they will be changed back to spaces - during processing. For example: + during processing. + OPT_USE_OFF + works the same way, but when OPT is + not selected. For example: OPTIONS_DEFINE= OPT1 -OPT1_USE= mysql=yes xorg=x11,xextproto,xext,xrandr +OPT1_USE= mysql=yes xorg=x11,xextproto,xext,xrandr +OPT1_USE_OFF= openssl=yes is equivalent to: @@ -4137,36 +4143,8 @@ OPT1_USE= mysql=yes xorg=x11,xextproto,x .if ${PORT_OPTIONS:MOPT1} USE_MYSQL= yes USE_XORG= x11 xextproto xext xrandr -.endif - - - - <varname><replaceable>OPT</replaceable>_USE_OFF</varname> - - When option OPT is - not selected, for each - key=value - pair in - OPT_USE_OFF, - value is appended to the - corresponding - USE_KEY. If - value has spaces in it, replace - them with commas and they will be changed back to spaces - during processing. For example: - - OPTIONS_DEFINE= OPT1 -OPT1_USE_OFF= mysql=yes xorg=x11,xextproto,xext,xrandr - - is equivalent to: - - OPTIONS_DEFINE= OPT1 - -.include <bsd.port.options.mk> - -.if ! ${PORT_OPTIONS:MOPT1} -USE_MYSQL= yes -USE_XORG= x11 xextproto xext xrandr +.else +USE_OPENSSL= yes .endif @@ -4179,7 +4157,8 @@ USE_XORG= x11 xextproto xext xrandr then --enable-entry is appended to CONFIGURE_ARGS. When - option OPT is not selected, + option OPT is + not selected, --disable-entry is appended to CONFIGURE_ARGS. An optional argument can be specified with an @@ -4220,7 +4199,8 @@ CONFIGURE_ARGS+= --disable-test2 then --with-entry is appended to CONFIGURE_ARGS. When - option OPT is not selected, + option OPT is + not selected, --without-entry is appended to CONFIGURE_ARGS. An optional argument can be specified with an @@ -4253,16 +4233,22 @@ CONFIGURE_ARGS+= --without-test2 - <varname><replaceable>OPT</replaceable>_CONFIGURE_ON</varname> + <varname><replaceable>OPT</replaceable>_CONFIGURE_ON</varname> + and + <varname><replaceable>OPT</replaceable>_CONFIGURE_OFF</varname> When option OPT is selected, the value of OPT_CONFIGURE_ON, if defined, is appended to - CONFIGURE_ARGS. For example: + CONFIGURE_ARGS. + OPT_CONFIGURE_OFF + works the same way, but when OPT is + not selected. For example: OPTIONS_DEFINE= OPT1 -OPT1_CONFIGURE_ON= --add-test +OPT1_CONFIGURE_ON= --add-test +OPT1_CONFIGURE_OFF= --no-test is equivalent to: @@ -4272,43 +4258,27 @@ OPT1_CONFIGURE_ON= --add-test - - - - <varname><replaceable>OPT</replaceable>_CONFIGURE_OFF</varname> - - When option OPT is - not selected, the value of - OPT_CONFIGURE_ON, - if defined, is appended to - CONFIGURE_ARGS. For example: - - OPTIONS_DEFINE= OPT1 -OPT1_CONFIGURE_OFF= --no-test - - is equivalent to: - - OPTIONS_DEFINE= OPT1 - -.include <bsd.port.options.mk> - -.if ! ${PORT_OPTIONS:MOPT1} +.else CONFIGURE_ARGS+= --no-test .endif - <varname><replaceable>OPT</replaceable>_CMAKE_ON</varname> + <varname><replaceable>OPT</replaceable>_CMAKE_ON</varname> + and + <varname><replaceable>OPT</replaceable>_CMAKE_OFF</varname> When option OPT is selected, the value of OPT_CMAKE_ON, if defined, is appended to CMAKE_ARGS. - For example: + OPT_CMAKE_OFF + works the same way, but when OPT is + not selected. For example: OPTIONS_DEFINE= OPT1 -OPT1_CMAKE_ON= -DTEST:BOOL=true +OPT1_CMAKE_ON= -DTEST:BOOL=true +OPT1_CMAKE_OFF= -DOPTIMIZE:BOOL=true is equivalent to: @@ -4318,43 +4288,27 @@ OPT1_CMAKE_ON= -DTEST:BOOL=true - - - - <varname><replaceable>OPT</replaceable>_CMAKE_OFF</varname> - - When option OPT is - not selected, the value of - OPT_CMAKE_OFF, - if defined, is appended to CMAKE_ARGS. - For example: - - OPTIONS_DEFINE= OPT1 -OPT1_CMAKE_OFF= -DTEST:BOOL=false - - is equivalent to: - - OPTIONS_DEFINE= OPT1 - -.include <bsd.port.options.mk> - -.if ! ${PORT_OPTIONS:MOPT1} -CMAKE_ARGS+= -DTEST:BOOL=false +.else +CMAKE_ARGS+= -DOPTIMIZE:BOOL=true .endif - <varname><replaceable>OPT</replaceable>_QMAKE_ON</varname> + <varname><replaceable>OPT</replaceable>_QMAKE_ON</varname> + and + <varname><replaceable>OPT</replaceable>_QMAKE_OFF</varname> When option OPT is selected, the value of OPT_QMAKE_ON, - if defined, is appended to - QMAKE_ARGS. For example: + if defined, is appended to QMAKE_ARGS. + OPT_QMAKE_OFF + works the same way, but when OPT is + not selected. For example: OPTIONS_DEFINE= OPT1 -OPT1_QMAKE_ON= -DTEST:BOOL=true +OPT1_QMAKE_ON= -DTEST:BOOL=true +OPT1_QMAKE_OFF= -DPRODUCTION:BOOL=true is equivalent to: @@ -4364,29 +4318,8 @@ OPT1_QMAKE_ON= -DTEST:BOOL=true - - - - <varname><replaceable>OPT</replaceable>_QMAKE_OFF</varname> - - When option OPT is - not selected, the value of - OPT_QMAKE_OFF, - if defined, is appended to - QMAKE_ARGS. For example: - - OPTIONS_DEFINE= OPT1 -OPT1_QMAKE_OFF= -DTEST:BOOL=false - - is equivalent to: - - OPTIONS_DEFINE= OPT1 - -.include <bsd.port.options.mk> - -.if ! ${PORT_OPTIONS:MOPT1} -QMAKE_ARGS+= -DTEST:BOOL=false +.else +QMAKE_ARGS+= -DPRODUCTION:BOOL=true .endif @@ -4497,7 +4430,10 @@ X509_PREVENTS_MSG= X509 and SCTP patches - Dependencies + Dependencies, + <varname><replaceable>OPT</replaceable>_<replaceable>DEPTYPE</replaceable></varname> + and + <varname><replaceable>OPT</replaceable>_<replaceable>DEPTYPE</replaceable>_OFF</varname> For any of these dependency types: @@ -4531,20 +4467,19 @@ X509_PREVENTS_MSG= X509 and SCTP patches - The following variables can be used. - - - <varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable></varname> - When option OPT is selected, the value of - OPT_ABOVEVARIABLE, + OPT_DEPTYPE, if defined, is appended to - ABOVEVARIABLE. - For example: + DEPTYPE. + OPT_DEPTYPE_OFF + works the same, but when OPT is + not + selected. For example: OPTIONS_DEFINE= OPT1 -OPT1_LIB_DEPENDS= liba.so:${PORTSDIR}/devel/a +OPT1_LIB_DEPENDS= liba.so:${PORTSDIR}/devel/a +OPT1_LIB_DEPENDS_OFF= libb.so:${PORTSDIR}/devel/b is equivalent to: @@ -4554,37 +4489,16 @@ OPT1_LIB_DEPENDS= liba.so:${PORTSDIR}/de .if ${PORT_OPTIONS:MOPT1} LIB_DEPENDS+= liba.so:${PORTSDIR}/devel/a +.else +LIB_DEPENDS+= libb.so:${PORTSDIR}/devel/b .endif - - - - - <varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable>_OFF</varname> - - When option OPT - is not selected, the value of - OPT_ABOVEVARIABLE_OFF, - if defined, is appended to - ABOVEVARIABLE. - For example: - - OPTIONS_DEFINE= OPT1 -OPT1_LIB_DEPENDS_OFF= liba.so:${PORTSDIR}/devel/a - - is equivalent to: - - OPTIONS_DEFINE= OPT1 - -.include <bsd.port.options.mk> - -. if ! ${PORT_OPTIONS:MOPT1} -LIB_DEPENDS+= liba.so:${PORTSDIR}/devel/a -.endif - - Generic Variables Replacement + Generic Variables Replacement, + <varname><replaceable>OPT</replaceable>_<replaceable>VARIABLE</replaceable></varname> + and + <varname><replaceable>OPT</replaceable>_<replaceable>VARIABLE</replaceable>_OFF</varname> For any of these variables: @@ -4730,7 +4644,31 @@ LIB_DEPENDS+= liba.so:${PORTSDIR}/devel/ - The following variables can be used. + When option OPT is + selected, the value of + OPT_ABOVEVARIABLE, + if defined, is appended to + ABOVEVARIABLE. + OPT_ABOVEVARIABLE_OFF + works the same way, but when OPT is + not + selected. For example: + + OPTIONS_DEFINE= OPT1 +OPT1_USES= gmake +OPT1_CFLAGS_OFF= -DTEST + + is equivalent to: + + OPTIONS_DEFINE= OPT1 + +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MOPT1} +USES+= gmake +.else +CFLAGS+= -DTEST +.endif Some variables are not in this list, in particular @@ -4770,59 +4708,13 @@ DOCS_ALL_TARGET= doc would have a value of all. - - <varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable></varname> - - When option OPT is - selected, the value of - OPT_ABOVEVARIABLE, - if defined, is appended to - ABOVEVARIABLE. - For example: - - OPTIONS_DEFINE= OPT1 -OPT1_USES= gmake -OPT1_CFLAGS= -DTEST - - is equivalent to: - - OPTIONS_DEFINE= OPT1 - -.include <bsd.port.options.mk> - -.if ${PORT_OPTIONS:MOPT1} -USES+= gmake -CFLAGS+= -DTEST -.endif - - - - <varname><replaceable>OPT</replaceable>_<replaceable>ABOVEVARIABLE</replaceable>_OFF</varname> - - When option OPT is not selected, the value of - OPT_ABOVEVARIABLE_OFF, - if defined, is appended to - ABOVEVARIABLE. - For example: - - OPTIONS_DEFINE= OPT1 -OPT1_USES_OFF= gmake - - is equivalent to: - - OPTIONS_DEFINE= OPT1 - -.include <bsd.port.options.mk> - -.if ! ${PORT_OPTIONS:MOPT1} -USES+= gmake -.endif - - - Additional Build Targets + Additional Build Targets, + <buildtarget><replaceable>TARGET</replaceable>-<replaceable>OPT</replaceable>-on</buildtarget> + and + <buildtarget><replaceable>TARGET</replaceable>-<replaceable>OPT</replaceable>-on</buildtarget> These Makefile targets can accept optional extra build targets: @@ -4917,49 +4809,21 @@ USES+= gmake - The additional build targets are listed below. - - - <buildtarget><replaceable>ABOVETARGET</replaceable>-<replaceable>OPT</replaceable>-on</buildtarget> - When option OPT is selected, the target - ABOVETARGET-OPT-on, + TARGET-OPT-on, if defined, is executed after - ABOVETARGET. - For example: + TARGET. + TARGET-OPT-off + works the same way, but when OPT is + not selected. For example: OPTIONS_DEFINE= OPT1 post-patch-OPT1-on: - @${REINPLACE_CMD} -e '/opt1/d' ${WRKSRC}/Makefile - - is equivalent to: - - OPTIONS_DEFINE= OPT1 - -.include <bsd.port.options.mk> - -post-patch: -.if ${PORT_OPTIONS:MOPT1} @${REINPLACE_CMD} -e '/opt1/d' ${WRKSRC}/Makefile -.endif - - - - <buildtarget><replaceable>ABOVETARGET</replaceable>-<replaceable>OPT</replaceable>-off</buildtarget> - - When option OPT is - not selected, the target - ABOVETARGET-OPT-off, - if defined, is executed after - ABOVETARGET. - For example: - - OPTIONS_DEFINE= OPT1 - post-patch-OPT1-off: - @${REINPLACE_CMD} -e '/opt1/d' ${WRKSRC}/Makefile + @${REINPLACE_CMD} -e '/opt1/s|/usr/bin/|${LOCALBASE}/bin/|' ${WRKSRC}/Makefile is equivalent to: @@ -4968,10 +4832,11 @@ post-patch-OPT1-off: .include <bsd.port.options.mk> post-patch: -.if !${PORT_OPTIONS:MOPT1} +.if ${PORT_OPTIONS:MOPT1} @${REINPLACE_CMD} -e '/opt1/d' ${WRKSRC}/Makefile +.else + @${REINPLACE_CMD} -e '/opt1/s|/usr/bin/|${LOCALBASE}/bin/|' ${WRKSRC}/Makefile .endif -