[Python-Dev] -DINET6 in Makefile

M.-A. Lemburg mal@lemburg.com
Fri, 30 Nov 2001 21:46:14 +0100


"Martin v. Loewis" wrote:
> 
> > What's the reasoning behind putting -DINET6 into the default
> > compiler options of the generic Makefile ?
> 
> I believe the sole reason is that the author of the patch didn't know
> how to get it into pyconfig.h. itojun recently confirmed that all uses
> of the INET6 can be replaced with ENABLE_IPV6, and that the define may
> go away.
> 
> I hesitate to change that, though, since some of the IPv6
> implementations *may* require that INET6 is defined when processing
> the "system" headers (not all IPv6 implementations we support actually
> come with the operating system).

For Python's own use, it should suffice defining the symbol in 
pyconfig.h.
 
> > I'm just asking because such a define will be inherited by
> > all extensions being compiled with distutils and the Makefile.pre.in
> > setup process... sounds like trouble if you ask me.
> 
> What kind of trouble?

The symbol could enable some logic which may not be desired
by the application, e.g. cause system includes to change,
socket semantics of wrapped libs could also be affected etc.

> > Shouldn't the define be placed into the pyconfig.h file or
> > only in those extensions which need it ?
> 
> Wouldn't it cause the same trouble there?

No, because the pyconfig.h import is under extension control
(e.g. you can first include the system or lib header files 
and only then import pyconfig.h).

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/