autoconf
[Top][All Lists]
Advanced

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

Re: Why conditionally include config.h?


From: Marko Lindqvist
Subject: Re: Why conditionally include config.h?
Date: Fri, 14 Sep 2012 02:58:17 +0300

On 14 September 2012 02:43, Eric Blake <address@hidden> wrote:
> On 09/13/2012 05:22 PM, Kip Warner wrote:
>> Hey list,
>>
>> Why do many autoconfiscated projects bracket inclusion of the generated
>> config.h with #if HAVE_CONFIG_H / #endif.
>
> Bad copy-and-paste habits.

 I've seen some packages where same sources are used with multiple
build systems (typically autotools in more unixy systems and visual
studio project files on Windows) and it's actually needed to weed out
"config.h" include when building with system that does not provide it.
But more often "#ifdef HAVE_CONFIG_H" is just idiom copied from some
other project.

 For example, in our freeciv project, this would need cleanup. It used
to be possible to build without autotools and fc_config.h (for systems
lacking autotools support those ancient times), and thus #ifdefs are
used. However, if one would try to build without HAVE_CONFIG_H defined
today, it would go horribly wrong.


 - ML



reply via email to

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