Index: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml =================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml +++ head/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,14 @@ 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 @@ .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 @@ 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 @@ 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 @@ - <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 @@ .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 +4288,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 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 @@ .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 @@ -4497,7 +4430,10 @@ - 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 @@ - 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 @@ .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 @@ - 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 @@ 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 @@ - 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 @@ .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 -