NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NetBSD macros

At Sun, 13 Dec 2009 14:01:16 +0100, Jonathan Schleifer 
<> wrote:
Subject: Re: NetBSD macros
> Why reinvent the wheel? autoconf does exactly that - check whether
> specified functions and headers are available and defining HAVE_XXX. It
> does not make much sense to write those checks manually when there are
> already checks you can just use that have been tested hundreds of times
> on hundreds of systems.

I would very strongly question the "hundreds of systems" part of that
claim these days, even if one includes every release of every kind of
system where these tests have actually been run "hundreds of times"!

> autoconf is not slow per se. It is that most add unncessary checks so
> that it takes very long. It is perfectly possible to only add that
> single check you need.

Even worse, many people use autoconf as a crutch and then fail to write
good portable code that doesn't need compile-time configuration in the
first place!

I think was the point someone was trying to make earlier in this thread.

Sure, compile-time feature tests are useful sometimes for many different
reasons, and Autoconf can, depending on the target systems, be a
reasonable way to run such feature tests automatically as part of the
build system.

However these days a vast amount of crud and overhead can be eliminated
simply by writing good basic code that complies to relevant standards,
and using a minimum of pre-processor logic to do the obvious low-level
compile-time configuration as necessary.

To that end one should avoid using system identifiers if possible, but
sometimes these are indeed the best way to control compile-time

                                                Greg A. Woods
                                                Planix, Inc.

<>       +1 416 218 0099

Attachment: pgp1VTfDQZRMc.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index