Question makefile

How to handle dependency with package with multiple variants?

For example we have nginx with 3 variants (no-ssl, ssl and all-module)

I wan to modify a makefile so that it takes nginx as dependency if it's not selected any of the 3 variants...

Any idea?

Each of the variants should PROVIDE: nginx
Then your other makefilr can depend on that. This way any of the 3 variants satisfies dependency.

Or have I misunderstood your question?

can you check the nginx makefile ? i don't really undstand well how provides works...

I couldn't find nginx makefile.

See the example for ip package which has variants ip-full and ip-tiny.
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/network/utils/iproute2/Makefile;hb=154c0c4006daf41e2cbb6c8b7ad5557f83dfea3e#l35

Lets say for example that your package relies on the "ping" utility which is included in both ip-tiny and ip-full. How would you define this dependency? You can't install both because they clash with each other. So PROVIDES sets up a "virtual package" with a different name that your package can depend on.
If your package needed a utility that was ONLY in the ip-full, you can still depend on ip-full.

This is my understanding of how it works.


So for nginx, i would define 3 separate packages
nginx-nossl
nginx-ssl
nginx-full

All three should PROVIDE "nginx". You should also not define any package called "nginx" as it is now a "virtual package" if that makes sense.

the nginx makefile is in the github openwrt/package in net directory...

hope you can take a look there...