[Pythonmac-SIG] Compiling MachoPython 2.2.1 on Jaguar: _socket

Russell E Owen owen@astro.washington.edu
Fri, 27 Sep 2002 12:29:28 -0600


Brian Lenihan kindly gave me permission to post his fix. This patch 
is NOT needed in the upcoming Python versions 2.2.2 and 2.3. Brian 
also said that he personally uses Python 2.3 from CVS.

-- Russell

----- email from Brian Lenihan, posted with permission -----

There is a work-around for an OS X bug in the socketmodule which is 
no longer needed and prevents the socketmodule from compiling.

line 216 of Modules/socketmodule.c:

#ifdef __APPLE__
/* On OS X, getaddrinfo returns no error indication of lookup
    failure, so we must use the emulation instead of the libinfo
    implementation. Unfortunately, performing an autoconf test
    for this bug would require DNS access for the machine performing
    the configuration, which is not acceptable. Therefore, we
    determine the bug just by checking for __APPLE__. If this bug
    gets ever fixed, perhaps checking for sys/version.h would be
    appropriate, which is 10/0 on the system with the bug. */
/*#undef HAVE_GETADDRINFO*/
/* avoid clashes with the C library definition of the symbol. */
/*#define getaddrinfo fake_getaddrinfo*/
#endif

You can delete the whole section, or comment out the #undef and the 
#define as long as you don't nest the comments.  I've found it is 
prudent to run make again after a Python build to see if any modules 
failed to compile.