Am 30.01.2012, 15:24 Uhr, schrieb Manu <turkey...@gmail.com>:

Here's another one I'm endlessly wishing I had in C.
I want to know if a library is present, and automatically disable non-vital
features if it isn't.
It shits me to tears when I can't build something because a non-vital
dependant lib is not available for a given platform or just not wanted.

A library is some .dll/.so in this case ?
If you know it exists only on a certain platform: use version(Platform)
If it _may_ be there, then compile the feature in, but load and check the library at runtime like you would do with a plugin.

This sounds like what has been solved with configure scripts long ago. If you ever built e.g. GDC or most other Linux programs, they come with a little script that allows you to preconfigure your build process and takes care of linking to the different available libraries.

        ./configure --disable-libDontUseMe

I never wrote one myself though...

Reply via email to