Compile time filesystem access?

Manu turkeyman at gmail.com
Mon Jan 30 09:48:56 PST 2012


On 30 January 2012 19:30, Marco Leise <Marco.Leise at gmx.de> wrote:

> Am 30.01.2012, 15:24 Uhr, schrieb Manu <turkeyman at 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.
>

I'm talking about static libs, since you need to link the supporting code
for DLL's anyway.

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 scripts certainly don't 'solve' the problem, they make it
worse... now my buildscript has twice as many steps, nobody can understand
it, and it only works on linux.

       ./configure --disable-libDontUseMe
>
> I never wrote one myself though...
>

Exactly, and nobody I've ever met has either. They just seem to exist,
magically appeared out of nowhere in all major linux projects that have
existed for 20 years or so. As far as I can tell, nobody ACTUALLY wrote
them, they've just always been there... ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120130/04b95a20/attachment.html>


More information about the Digitalmars-d mailing list