[Python-Dev] Re: pycnfig.h.in and UW7

Guido van Rossum guido@python.org
Wed, 05 Sep 2001 11:28:06 -0400


> > The removed lines were added by you a few minutes earlier.  I did a
> > full cvs update, ran autoconf and autoheader, and checked in the
> > resulting files (after testing everything first).
> > 
> > AFAIK, pyconfig.h.in is a generated file, written by autoheader, so
> > those #defines that you added won't stick.  I'm not sure where they
> > *should* go though.  
> 
> Thanks for the notice. The right place is acconfig.h, which is the
> template for autoheader (autoheader also requires to put template
> definitions in there if it cannot determine the comment above itself).
> I've now corrected that.

Thanks.  I wasn't aware that you could have regular old #ifdef and
stuff in acconfig.h.  How does autoconf decide which portions of the
file to copy to pyconfig.h.in?

> > I think there are a few places in configure.in where -D options are
> > added to OPT or to CC -- I'm not sure why, it could be that the author
> > of the patch didn't know the proper way, or it could be there was a
> > special reason.
> 
> I guess it's both. Getting rid of -DINET6 is still on my agenda. In
> some cases, people apparently don't trust that pyconfig.h is always
> included before any system header. If that is guaranteed, I cannot
> think of any further special reason, unless there is some compiler
> that treats -D special (beyond defining the symbol).

I think that mistrust is mistaken -- most system headers are included
by Python.h, which includes pyconfig.h before any system headers.  We
can make a new rule: "Python.h must be included first, instead of most
system headers and before any other system headers are included."

--Guido van Rossum (home page: http://www.python.org/~guido/)