Add a text on feature auto-detection in configure script being harmfull

PR:		docs/106065 (based on)
Submitted by:	Ganael LAPLANCHE <ganael.laplanche@martymac.com>
This commit is contained in:
Pav Lucistnik 2006-11-30 20:44:44 +00:00
parent d734bc0012
commit 2837201f26
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=29151

View file

@ -3865,6 +3865,47 @@ RUN_DEPENDS+= bar:${PORTSDIR}/bar/bar
</sect2>
<sect2>
<title>Feature auto-activation</title>
<para>When using a GNU configure script, keep an eye on which optional
features are activated by auto-detection. Explicitly disable
optional features you do not wish to be used by passing respective
<literal>--without-xxx</literal> or <literal>--disable-xxx</literal>
in <makevar>CONFIGURE_ARGS</makevar>.</para>
<example>
<title>Wrong handling of an option</title>
<programlisting>.if defined(WITH_FOO)
LIB_DEPENDS+= foo.0:${PORTSDIR}/devel/foo
CONFIGURE_ARGS+= --enable-foo
.endif</programlisting>
</example>
<para>In the example above, imagine a library libfoo is installed on
the system. User does not want this application to use libfoo, so he
toggled the option off in the <literal>make config</literal> dialog.
But the application's configure script detects the library present in
the system and includes its support in the resulting executable. Now
when user decides to remove libfoo from the system, the ports system
does not protest (no dependency on libfoo was recorded) but the
application breaks.</para>
<example>
<title>Correct handling of an option</title>
<programlisting>.if defined(WITH_FOO)
LIB_DEPENDS+= foo.0:${PORTSDIR}/devel/foo
CONFIGURE_ARGS+= --enable-foo
.else
CONFIGURE_ARGS+= --disable-foo
.endif</programlisting>
</example>
<para>In the second example, the library libfoo is explicitly disabled.
The configure script does not enable related features in the
application, despite library's presence in the system.</para>
</sect2>
</sect1>
<sect1 id="makefile-wrkdir">