[Top][All Lists]

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

Re: RFC: Does hand editing of "config.h" make sense?

From: Keith MARSHALL
Subject: Re: RFC: Does hand editing of "config.h" make sense?
Date: Fri, 27 May 2005 12:15:33 +0100

Stepan Kasal wrote:
> On Fri, May 27, 2005 at 09:49:54AM +0100, Keith MARSHALL wrote:
>>> The book I just got on 'autoconf' mentions that editing 'config.h'
>>> is one of the things that is expected.  It explains the format of
>>> the file which includes comments to that effect.
>> Since this seems rather strange advice to me, I wondered what other
>> autoconf users, and in particular the maintainers, thought about this.
> Under normal circumstances, you don't edit it.  It definitely isn't
> something which should be encouranged.
> But if you port to a new or very weird platform, you can have problems
> running configure there.  Then it comes handy that you take the
> template and fill in the info, or correct the mistakes in config.h.

Ok.  Perhaps some additional background information is appropriate here.

The OP on the original list was attempting to justify a manual change in
config.h, after a *successful* run of configure had left HAVE_TERMIOS_H
undefined.  Another list subscriber had suggested that it he *needed* to
edit config.h to fix this, because he did have termios.h, and configure
got it wrong.  In fact, *he* was wrong, because he didn't have a usable
termios.h, and I pointed out that he could have diagnosed the problem
correctly by searching for termios.h in config.log, and examining the
compiler diagnostic from AC_CHECK_HEADERS([termios.h]); instead he had
lied in config.h, run make again, to reproduce this compiler diagnostic,
when his build again blew up, because his termios.h was syntactically
broken.  This would have been ok, except that the OP reported that the
hand editing of config.h was necessary, in *addition* to correcting the
broken syntax in termios.h.  I pointed out that this wasn't true, and
this led to a further discussion on whether hand editing of config.h
could, in fact *ever* be justified.

> In practice, I haven't met with such a situation, so we can discuss
> whether it's ever useful to mention this possibility in a manual.

Thanks for your comments on this, Stepan.  It still appears to me that,
if configure runs successfully, then there can be no justification for
hand editing config.h -- perhaps there is some justification for making
this clearer, either in a manual, or possibly better, by adding a
suitable comment into the generated config.h itself.  Something like

   /* This file has been automatically generated by GNU autotools
    * If configure runs successfully on your computer, you should
    * never need to modify this file by hand.  Only consider
    * modifying this file, if you are unable to run configure.

would suffice.

Any further thoughts?

Best regards,

reply via email to

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