[Top][All Lists]

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

Re: configure is not checking everything

From: Eric Blake
Subject: Re: configure is not checking everything
Date: Thu, 06 Sep 2007 21:30:54 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070728 Thunderbird/ Mnenhy/

Hash: SHA1

According to Benoit SIGOURE on 9/6/2007 3:40 PM:
> On Sep 6, 2007, at 10:27 PM, Adam PAPAI wrote:
>> Dear list,
> The question has already been answered but I'd like to point out that

I'd also like to point out that:

>> case "$host" in
>>   *-linux*)
>>     AC_DEFINE(PLATFORM_LINUX, 1, [Define if you are compiling for Linux])
>>     ;;

Many variants of these defines are already available in system headers or
predefined by the compiler, so you need not litter them into your config.h
file.  Furthermore, platform-specific checks are not the autoconf way...

> but you're also missing other flavors of BSD (I think DragonFly BSD is
> also quite popular), I'd be tempted to throw a *-*bsd*) in there :D

...and this is why.  By doing feature checks, instead of platform checks,
a user of a new platform can automatically test for features on new
platforms that you as the developer had no access to.  But if you use
hard-coded platform checks, it is more porting work for new users, and
more maintenance work for you.  Yes, there are some cases where
platform-specific checks are necessary (such as cross-compilation), but
even then, you should provide default (although perhaps pessimistic)
fallbacks that work if none of your hard-coded choices occur.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


reply via email to

[Prev in Thread] Current Thread [Next in Thread]