[LEDE-DEV] Need help with package dependencies

Zefir Kurtisi zefir.kurtisi at neratec.com
Thu Oct 20 06:11:24 PDT 2016

On 10/19/2016 07:12 PM, Alexandru Ardelean wrote:
> On Tue, Oct 18, 2016 at 2:09 PM, Zefir Kurtisi
> <zefir.kurtisi at neratec.com> wrote:
>> Hi,
>> to those understanding the package dependency logic by heart, I'm trying to
>> achieve something I assumed to be common, but fail to get there with the help of
>> the available documentation.
>> The short version is this:
>> * package A has an optional feature X provided by package B
>> * package B is optional (feeds package)
>>   => feature X should be selectable only if B is installed and selected
>> * if feature X is activated, package A depends from package B
>> I did:
>> 1) in Config.in of package A add
>> config WITH_FEATURE_X
>>         bool
>>         depends on PACKAGE_B
>>         prompt "Enable feature X"
>>         default n
>> 2) in Makefile of package A add
> Why not just do  DEPENDS+=+PACKAGE_B:B ?
> This has the semantic that package A depends on B, only if it was
> selected by some other package.
This would add an unconditional dependency (A depends from B when B is selected),
which is maybe not desirable. I.e. you can have packages snmp and lldpd installed,
but lldpd's SNMP agentx support is not mandatory. That's the idea of having
WITH_FEATURE_X selectable in menu.

> There are other depends like this PACKAGE_x around.
> You could then drop WITH_FEATURE_X config option in A
> If you need to add any other CFLAGS or LDFLAGS in A, you can just do
> ifeq ($(CONFIG_PACKAGE_B),y)
> etc
> endif
> I hope I understood correctly what you want to do.
Looked through all packages with Config.in menus, but did not find any with such
inter-package dependencies. Maybe it is just not supported out of the box.

Thanks anyway, I'll report back if I find some workaround.

More information about the Lede-dev mailing list