Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774.

This commit is contained in:
Martin v. Löwis 2001-07-26 13:41:06 +00:00
parent 4eb5940a4d
commit 4f1cd8bdcb
31 changed files with 320 additions and 320 deletions

View file

@ -125,7 +125,7 @@ class build_ext (Command):
self.extensions = self.distribution.ext_modules
# Make sure Python's include directories (for Python.h, config.h,
# Make sure Python's include directories (for Python.h, pyconfig.h,
# etc.) are in the include search path.
py_include = sysconfig.get_python_inc()
plat_py_include = sysconfig.get_python_inc(plat_specific=1)
@ -592,7 +592,7 @@ class build_ext (Command):
"""
# The python library is always needed on Windows. For MSVC, this
# is redundant, since the library is mentioned in a pragma in
# config.h that MSVC groks. The other Windows compilers all seem
# pyconfig.h that MSVC groks. The other Windows compilers all seem
# to need it mentioned explicitly, though, so that's what we do.
# Append '_d' to the python import library on debug builds.
from distutils.msvccompiler import MSVCCompiler

View file

@ -73,7 +73,7 @@ class CygwinCCompiler (UnixCCompiler):
(status, details))
if status is not CONFIG_H_OK:
self.warn(
"Python's config.h doesn't seem to support your compiler. " +
"Python's pyconfig.h doesn't seem to support your compiler. " +
("Reason: %s." % details) +
"Compiling may fail because of undefined preprocessor macros.")
@ -335,7 +335,7 @@ class Mingw32CCompiler (CygwinCCompiler):
# class Mingw32CCompiler
# Because these compilers aren't configured in Python's config.h file by
# Because these compilers aren't configured in Python's pyconfig.h file by
# default, we should at least warn the user if he is using a unmodified
# version.
@ -345,7 +345,7 @@ CONFIG_H_UNCERTAIN = "uncertain"
def check_config_h():
"""Check if the current Python installation (specifically, config.h)
"""Check if the current Python installation (specifically, pyconfig.h)
appears amenable to building extensions with GCC. Returns a tuple
(status, details), where 'status' is one of the following constants:
CONFIG_H_OK
@ -353,21 +353,21 @@ def check_config_h():
CONFIG_H_NOTOK
doesn't look good
CONFIG_H_UNCERTAIN
not sure -- unable to read config.h
not sure -- unable to read pyconfig.h
'details' is a human-readable string explaining the situation.
Note there are two ways to conclude "OK": either 'sys.version' contains
the string "GCC" (implying that this Python was built with GCC), or the
installed "config.h" contains the string "__GNUC__".
installed "pyconfig.h" contains the string "__GNUC__".
"""
# XXX since this function also checks sys.version, it's not strictly a
# "config.h" check -- should probably be renamed...
# "pyconfig.h" check -- should probably be renamed...
from distutils import sysconfig
import string
# if sys.version contains GCC then python was compiled with
# GCC, and the config.h file should be OK
# GCC, and the pyconfig.h file should be OK
if string.find(sys.version,"GCC") >= 0:
return (CONFIG_H_OK, "sys.version mentions 'GCC'")
@ -386,7 +386,7 @@ def check_config_h():
"couldn't read '%s': %s" % (fn, exc.strerror))
else:
# "config.h" contains an "#ifdef __GNUC__" or something similar
# "pyconfig.h" contains an "#ifdef __GNUC__" or something similar
if string.find(s,"__GNUC__") >= 0:
return (CONFIG_H_OK, "'%s' mentions '__GNUC__'" % fn)
else:

View file

@ -43,7 +43,7 @@ def get_python_inc(plat_specific=0, prefix=None):
If 'plat_specific' is false (the default), this is the path to the
non-platform-specific header files, i.e. Python.h and so on;
otherwise, this is the path to platform-specific header files
(namely config.h).
(namely pyconfig.h).
If 'prefix' is supplied, use it instead of sys.prefix or
sys.exec_prefix -- i.e., ignore 'plat_specific'.
@ -137,10 +137,10 @@ def customize_compiler(compiler):
def get_config_h_filename():
"""Return full pathname of installed config.h file."""
"""Return full pathname of installed pyconfig.h file."""
if python_build: inc_dir = '.'
else: inc_dir = get_python_inc(plat_specific=1)
return os.path.join(inc_dir, "config.h")
return os.path.join(inc_dir, "pyconfig.h")
def get_makefile_filename():