Index: en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml =================================================================== --- en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml +++ en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml @@ -4111,7 +4111,9 @@ - <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,15 @@ 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 +4144,8 @@ .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 @@ -4253,16 +4232,22 @@ - <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 +4257,27 @@ .if ${PORT_OPTIONS:MOPT1} CONFIGURE_ARGS+= --add-test -.endif - - - - <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 +4287,27 @@ .if ${PORT_OPTIONS:MOPT1} CMAKE_ARGS+= -DTEST:BOOL=true -.endif - - - - <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 + enabled. 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 +4317,8 @@ .if ${PORT_OPTIONS:MOPT1} QMAKE_ARGS+= -DTEST:BOOL=true -.endif - - - - <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 @@ -4496,6 +4428,66 @@ + + <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