- Improve text on RUN_DEPENDS

PR:		docs/149480
Submitted by:	sahil
This commit is contained in:
Gabor Pali 2010-08-11 19:37:15 +00:00
parent 9635d96d04
commit 0a9be94096
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=36227

View file

@ -3283,33 +3283,28 @@ ALWAYS_KEEP_DISTFILES= yes
part can be omitted if it is the same as part can be omitted if it is the same as
<makevar>DEPENDS_TARGET</makevar>.</para> <makevar>DEPENDS_TARGET</makevar>.</para>
<para>Quite common situation is when <para>A quite common situation is when
<makevar>RUN_DEPENDS</makevar> is literally the same as <makevar>RUN_DEPENDS</makevar> is literally the same as
<makevar>BUILD_DEPENDS</makevar>, especially if ported <makevar>BUILD_DEPENDS</makevar>, especially if ported
software is written in a scripted language or if it requires software is written in a scripted language or if it requires
the same run-time environment used to build it. In this the same build and run-time environment. In this
case, it is very tempting, and indeed natural to directly case, it is both tempting and intuitive to directly
assign one to another:</para> assign one to the other:</para>
<programlisting>RUN_DEPENDS= ${BUILD_DEPENDS}</programlisting> <programlisting>RUN_DEPENDS= ${BUILD_DEPENDS}</programlisting>
<para>However, doing so can and often will result in <para>However, such assignment can pollute run-time dependencies
run-time dependencies be polluted by superfluous entries, not with entries not defined in the port's original <makevar>BUILD_DEPENDS</makevar>.
present in original port's <makevar>BUILD_DEPENDS</makevar>. This happens because of &man.make.1;'s lazy evaluation of variable
It happens due to the fact that &man.make.1 is being lazy assignment. Consider a <filename>Makefile</filename> with
when it evaluates assignments like these. Most probably <makevar>USE_<replaceable>*</replaceable></makevar> variables, which
additional dependencies will be pulled by are processed by <filename>ports/Mk/bsd.*.mk</filename> to augment
<filename>ports/Mk/bsd.*.mk</filename> when processing initial build dependencies. For example, <literal>USE_GMAKE=yes</literal>
<makevar>USE_<replaceable>*</replaceable></makevar> adds <filename role="package">devel/gmake</filename> to
variables, which most ports contain. For example, such <makevar>BUILD_DEPENDS</makevar>. To prevent such additional dependencies
direct assignment along with from polluting <makevar>RUN_DEPENDS</makevar>, take care to assign
<literal>USE_GMAKE=yes</literal> will bring with expansion, i.e. expand the value before assigning it to the
<application>gmake</application> into variable:</para>
<makevar>RUN_DEPENDS</makevar>, despite that it was not
included explicitly in <makevar>BUILD_DEPENDS</makevar>. To
prevent this from happening, immediate expansion assignment
should be used, i.e. expand the value before assigning it
to the variable:</para>
<programlisting>RUN_DEPENDS:= ${BUILD_DEPENDS}</programlisting> <programlisting>RUN_DEPENDS:= ${BUILD_DEPENDS}</programlisting>
</sect2> </sect2>