docs/166855: [patch] Automatic Detection of Dependencies Addendum for Porter's Handbook
A.J. Kehoe IV (Nanoman)
zxMbzY3e at nanoman.ca
Thu Apr 12 23:19:31 UTC 2012
> On Wed, 11 Apr 2012 18:33:18 GMT, A.J. Kehoe IV (Nanoman) wrote:
>> + <example>
>> + <title>Correct Declaration of an Optional Dependency</title>
>> +
>> + <programlisting>OPTIONS= BAR "Enable bar
>> support" on
>> +
>> +.include <bsd.port.pre.mk>
>> +
>> +.if defined(WITH_BAR) && !defined(WITHOUT_BAR)
>> +LIB_DEPENDS= bar:${PORTSDIR}/foo/bar
>> +.endif</programlisting>
>> + </example>
>
> It's not enough. You also need to add something like --disable-bar to
> configure arguments and of course configure script should respect the
> switch.
This is needed only if it's required by the configure script. If support
for a dependency doesn't need to be compiled in, then simply including it
in the dependency list would suffice.
My examples included only the elements that were needed to illustrate my
point. Anyone wanting to use optional dependencies should read the
"makefile-options" section that I linked to, along with any other sections
that are relevant to their port.
More information about the freebsd-doc
mailing list