Most of the time recipes in Yocto and OpenEmbedded are pretty static in the sense that when you build your image you either you get what is described in the recipe.
It is possible to build the package different based on the
MACHINE for example but otherwise packages are fixed in what they provide.
What if you want a package that can be built in different ways?
For example Apache Thrift can build additional libraries if
zlib is available at build-time.
In order to model this OpenEmbedded provides a
PACKAGECONFIG variable that allows to model such dependencies.
For Thrift this we would add the following to our recipe:
PACKAGECONFIG ??= "zlib libevent" PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib" PACKAGECONFIG[libevent] = "--with-libevent,--without-libevent,build-libevent"
For more details please refer to the Yocto Reference Manual