From owner-svn-doc-all@FreeBSD.ORG Fri Aug 2 16:08:39 2013 Return-Path: Delivered-To: svn-doc-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 20B77B17; Fri, 2 Aug 2013 16:08:39 +0000 (UTC) (envelope-from brd@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0B77F2E70; Fri, 2 Aug 2013 16:08:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r72G8cWM084393; Fri, 2 Aug 2013 16:08:38 GMT (envelope-from brd@svn.freebsd.org) Received: (from brd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r72G8cbM084392; Fri, 2 Aug 2013 16:08:38 GMT (envelope-from brd@svn.freebsd.org) Message-Id: <201308021608.r72G8cbM084392@svn.freebsd.org> From: Brad Davis Date: Fri, 2 Aug 2013 16:08:38 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r42487 - head/en_US.ISO8859-1/books/porters-handbook X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 16:08:39 -0000 Author: brd Date: Fri Aug 2 16:08:38 2013 New Revision: 42487 URL: http://svnweb.freebsd.org/changeset/doc/42487 Log: - Add a new section for Options Helpers from bapt@ Submitted by: bapt@ Reviewed by: Ken Reed Modified: head/en_US.ISO8859-1/books/porters-handbook/book.xml Modified: head/en_US.ISO8859-1/books/porters-handbook/book.xml ============================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/book.xml Fri Aug 2 06:01:58 2013 (r42486) +++ head/en_US.ISO8859-1/books/porters-handbook/book.xml Fri Aug 2 16:08:38 2013 (r42487) @@ -4629,6 +4629,247 @@ CONFIGURE_ARGS+= --disable-foo .if ${VARIABLE:MVALUE} + + Options Helpers + + There are some macros to help simplify conditional + values which differ based on the options set. + + If OPTIONS_SUB is set to + yes then each of the options added + to OPTIONS_DEFINE will be added to + PLIST_SUB, for example: + + OPTIONS_DEFINE= OPT1 +OPTIONS_SUB= yes + + is equivalent to: + + OPTIONS_DEFINE= OPT1 + +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MOPT1} +PLIST_SUB+= OPT1="" +.else +PLIST_SUB+= OPT1="@comment " +.endif + + If X_CONFIGURE_ENABLE is set then + --enable-${X_CONFIGURE_ENABLE} + or --disable-${X_CONFIGURE_ENABLE} will + be added to CONFIGURE_ARGS depending on + the value of the optionX, for example: + + OPTIONS_DEFINE= OPT1 +OPT1_CONFIGURE_ENABLE= test + + is equivalent to: + + OPTIONS_DEFINE= OPT1 + +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MOPT1} +CONFIGURE_ARGS+= --enable-test +.else +CONFIGURE_ARGS+= --disable-test +.endif + + If X_CONFIGURE_WITH is set then + --with-${X_CONFIGURE_WITH} + or --without-${X_CONFIGURE_WITH} will + be added to CONFIGURE_ARGS depending + on the status of the option X, + for example: + + OPTIONS_DEFINE= OPT1 +OPT1_CONFIGURE_WITH= test + + is equivalent to: + + OPTIONS_DEFINE= OPT1 + +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MOPT1} +CONFIGURE_ARGS+= --with-test +.else +CONFIGURE_ARGS+= --without-test +.endif + + If X_CONFIGURE_ON is set then its value + will be appended to CONFIGURE_ARGS depending + on the status of the option X, for example: + + + OPTIONS_DEFINE= OPT1 +OPT1_CONFIGURE_ON= --add-test + + is equivalent to: + + OPTIONS_DEFINE= OPT1 + +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MOPT1} +CONFIGURE_ARGS+= --add-test +.endif + + If X_CONFIGURE_OFF is set then its value + will be appended to CONFIGURE_ARGS depending + on the status of the option X, 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} +CONFIGURE_ARGS+= --no-test +.endif + + If X_CMAKE_ON is set then its value + will be appended to CMAKE_ARGS depending + on the status of the option X, for example: + + + OPTIONS_DEFINE= OPT1 +OPT1_CMAKE_ON= -DTEST:BOOL=true + + is equivalent to: + + OPTIONS_DEFINE= OPT1 + +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MOPT1} +CMAKE_ARGS+= -DTEST:BOOL=true +.endif + + If X_CMAKE_OFF is set then its value + will be appended to CMAKE_ARGS depending + on the status of the option X, 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 +.endif + + For any of the following variables: + + + + CFLAGS + + + + CXXFLAGS + + + + LDLAGS + + + + CONFIGURE_ENV + + + + MAKE_ENV + + + + USES + + + + DISTFILES + + + + If X_ABOVEVARIABLE is defined then + its value will be appended to + ABOVEVARIABLE depending on the status of + the option X, 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 + + For any of the following dependency type: + + + + PKG_DEPENDS + + + + EXTRACT_DEPENDS + + + + PATCH_DEPENDS + + + + FETCH_DEPENDS + + + + BUILD_DEPENDS + + + + LIB_DEPENDS + + + + RUN_DEPENDS + + + + If X_ABOVEVARIABLE is defined then + its value will be appended to + ABOVEVARIABLE depending on the status + of the option X, for example: + + OPTIONS_DEFINE= OPT1 +OPT1_LIB_DEPENDS= 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 +