Possible fix for sysconfig.py (Win32)
The call to parse_config_h() in _init_nt() [both found in distutils/sysconfig.py] clobbers the previously correct values of PREFIX and EXEC_PREFIX for the standard Python installation on Win32. This in turn leads to the compiler picking up the wrong Python include file paths (and probably other glitches I haven't stumbled onto yet). One workaround (the one I've used) is to comment out that call to parse_config_h() ;)
On 12 April 2000, Lyle Johnson said:
The call to parse_config_h() in _init_nt() [both found in distutils/sysconfig.py] clobbers the previously correct values of PREFIX and EXEC_PREFIX for the standard Python installation on Win32. This in turn leads to the compiler picking up the wrong Python include file paths (and probably other glitches I haven't stumbled onto yet).
Oops! Hmm, I can't see that happening with the config.h on my Linux box: does the config.h installed for Windows "#define PREFIX" and "#define EXEC_PREFIX"? If so, that's what's going on. Anyways, commenting out that line is just fine. In fact, it seems to me that there is no reason to read config.h on any platform, and very little reason even to keep that code around. The information read from config.h simply isn't used anywhere in the Distutils. Fred, what's your take on this? Should we just ditch the config.h-reading code from sysconfig.py? Greg -- Greg Ward - Linux nerd gward@python.net http://starship.python.net/~gward/ Whatever became of eternal truth?
Greg Ward writes:
Anyways, commenting out that line is just fine. In fact, it seems to me that there is no reason to read config.h on any platform, and very little reason even to keep that code around. The information read from config.h simply isn't used anywhere in the Distutils. Fred, what's your take on this? Should we just ditch the config.h-reading code from sysconfig.py?
If none of the information is being used, then let's comment out the call to read the file. When building the modules in Modules/, I notice that -DHAVE_CONFIG_H is passed on the command line, but that indicates distutils should make that define from the command line if appropriate (or perhaps always?). The file itself may not need to be parsed by distutils. I'd keep the function around, since a specific package may benefit from having that information around; the setup.py for that can call the function if appropriate. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> Corporation for National Research Initiatives
participants (3)
-
Fred L. Drake, Jr. -
Greg Ward -
Lyle Johnson