Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Apr 2012 19:19:24 -0400 (EDT)
From:      "A.J. Kehoe IV (Nanoman)" <zxMbzY3e@nanoman.ca>
To:        "Max Brazhnikov" <makc@freebsd.org>
Cc:        freebsd-doc@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject:   Re: docs/166855: [patch] Automatic Detection of Dependencies  Addendum for Porter's Handbook
Message-ID:  <11181.192.168.1.9.1334272764.squirrel@www.nanoman.ca>
In-Reply-To: <201204122226.36290.makc@freebsd.org>
References:  <201204111833.q3BIXILU034322@red.freebsd.org> <201204122226.36290.makc@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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 &lt;bsd.port.pre.mk&gt;
>> +
>> +.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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?11181.192.168.1.9.1334272764.squirrel>