View | Details | Raw Unified | Return to bug 149480
Collapse All | Expand All

(-)en_US.ISO8859-1/books/porters-handbook/book.sgml (-21 / +16 lines)
Lines 3283-3315 Link Here
3283
	    part can be omitted if it is the same as
3283
	    part can be omitted if it is the same as
3284
	    <makevar>DEPENDS_TARGET</makevar>.</para>
3284
	    <makevar>DEPENDS_TARGET</makevar>.</para>
3285
3285
3286
	  <para>Quite common situation is when
3286
	  <para>A quite common situation is when
3287
	    <makevar>RUN_DEPENDS</makevar> is literally the same as
3287
	    <makevar>RUN_DEPENDS</makevar> is literally the same as
3288
	    <makevar>BUILD_DEPENDS</makevar>, especially if ported
3288
	    <makevar>BUILD_DEPENDS</makevar>, especially if ported
3289
	    software is written in a scripted language or if it requires
3289
	    software is written in a scripted language or if it requires
3290
	    the same run-time environment used to build it.  In this
3290
	    the same build and run-time environment.  In this
3291
	    case, it is very tempting, and indeed natural to directly
3291
	    case, it is both tempting and intuitive to directly
3292
	    assign one to another:</para>
3292
	    assign one to the other:</para>
3293
3293
3294
	  <programlisting>RUN_DEPENDS= ${BUILD_DEPENDS}</programlisting>
3294
	  <programlisting>RUN_DEPENDS= ${BUILD_DEPENDS}</programlisting>
3295
3295
3296
	  <para>However, doing so can and often will result in
3296
	  <para>However, such assignment can pollute run-time dependencies
3297
	    run-time dependencies be polluted by superfluous entries, not
3297
	  with entries not defined in the port's original <makevar>BUILD_DEPENDS</makevar>.
3298
	    present in original port's <makevar>BUILD_DEPENDS</makevar>.
3298
	  This happens because of &man.make.1;'s lazy evaluation of variable
3299
	    It happens due to the fact that &man.make.1 is being lazy
3299
	  assignment.  Consider a <filename>Makefile</filename> with 
3300
	    when it evaluates assignments like these.  Most probably
3300
	  <makevar>USE_<replaceable>*</replaceable></makevar> variables, which
3301
	    additional dependencies will be pulled by
3301
	  are processed by <filename>ports/Mk/bsd.*.mk</filename> to augment
3302
	    <filename>ports/Mk/bsd.*.mk</filename> when processing
3302
	  initial build dependencies.  For example, <literal>USE_GMAKE=yes</literal>
3303
	    <makevar>USE_<replaceable>*</replaceable></makevar>
3303
	  adds <filename role="package">devel/gmake</filename> to
3304
	    variables, which most ports contain.  For example, such
3304
	  <makevar>BUILD_DEPENDS</makevar>. To prevent such additional dependencies
3305
	    direct assignment along with
3305
	  from polluting <makevar>RUN_DEPENDS</makevar>, take care to assign
3306
	    <literal>USE_GMAKE=yes</literal> will bring
3306
	  with expansion, i.e. expand the value before assigning it to the 
3307
	    <application>gmake</application> into
3307
	  variable:</para>
3308
	    <makevar>RUN_DEPENDS</makevar>, despite that it was not
3309
	    included explicitly in <makevar>BUILD_DEPENDS</makevar>.  To
3310
	    prevent this from happening, immediate expansion assignment
3311
	    should be used, i.e. expand the value before assigning it
3312
	    to the variable:</para>
3313
3308
3314
	    <programlisting>RUN_DEPENDS:=  ${BUILD_DEPENDS}</programlisting>
3309
	    <programlisting>RUN_DEPENDS:=  ${BUILD_DEPENDS}</programlisting>
3315
	</sect2>
3310
	</sect2>

Return to bug 149480