E57C Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. · python/cpython@4f1cd8b · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f1cd8b

Browse files
committed
Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774.
1 parent 4eb5940 commit 4f1cd8b

31 files changed

+320
-320
lines changed

Doc/ext/ext.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,10 +2380,10 @@ \section{A Cookbook Approach \label{win-cookbook}}
23802380

23812381
Grab the binary installer from \url{http://www.python.org/} and
23822382
install Python. The binary installer has all of the required header
2383-
files except for \file{config.h}.
2383+
files except for \file{pyconfig.h}.
23842384

23852385
Get the source distribution and extract it into a convenient location.
2386-
Copy the \file{config.h} from the \file{PC/} directory into the
2386+
Copy the \file{pyconfig.h} from the \file{PC/} directory into the
23872387
\file{include/} directory created by the installer.
23882388

23892389
Create a \file{Setup} file for your extension module, as described in

Doc/lib/libexcs.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ \section{Built-in Exceptions}
140140
always defined, but can only be raised when Python is configured
141141
with the \longprogramopt{with-fpectl} option, or the
142142
\constant{WANT_SIGFPE_HANDLER} symbol is defined in the
143-
\file{config.h} file.
143+
\file{pyconfig.h} file.
144144
\end{excdesc}
145145

146146
\begin{excdesc}{IOError}

Doc/lib/libsys.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ \section{\module{sys} ---
129129
also \code{'/usr/local'}. This can be set at build time with the
130130
\longprogramopt{exec-prefix} argument to the \program{configure}
131131
script. Specifically, all configuration files (e.g. the
132-
\file{config.h} header file) are installed in the directory
132+
\file{pyconfig.h} header file) are installed in the directory
133133
\code{exec_prefix + '/lib/python\var{version}/config'}, and shared
134134
library modules are installed in \code{exec_prefix +
135135
'/lib/python\var{version}/lib-dynload'}, where \var{version} is
@@ -298,7 +298,7 @@ \section{\module{sys} ---
298298
the \longprogramopt{prefix} argument to the \program{configure}
299299
script. The main collection of Python library modules is installed
300300
in the directory \code{prefix + '/lib/python\var{version}'} while
301-
the platform independent header files (all except \file{config.h})
301+
the platform independent header files (all except \file{pyconfig.h})
302302
are stored in \code{prefix + '/include/python\var{version}'}, where
303303
\var{version} is equal to \code{version[:3]}.
304304
\end{datadesc}

Include/Python.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/* Include nearly all Python header files */
2222

2323
#include "patchlevel.h"
24-
#include "config.h"
24+
#include "pyconfig.h"
2525

2626
#ifdef HAVE_LIMITS_H
2727
#include <limits.h>

Include/pgenheaders.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extern "C" {
77

88
/* Include files and extern declarations used by most of the parser. */
99

10-
#include "config.h"
10+
#include "pyconfig.h"
1111

1212
/* config.h may or may not define DL_IMPORT */
1313
#ifndef DL_IMPORT /* declarations for DLL import/export */

Include/pyport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef Py_PYPORT_H
22
#define Py_PYPORT_H
33

4-
#include "config.h" /* include for defines */
4+
#include "pyconfig.h" /* include for defines */
55

66
/**************************************************************************
77
Symbols and macros to supply platform-independent interfaces to basic

Lib/distutils/command/build_ext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def finalize_options (self):
125125
self.extensions = self.distribution.ext_modules
126126

127127

128-
# Make sure Python's include directories (for Python.h, config.h,
128+
# Make sure Python's include directories (for Python.h, pyconfig.h,
129129
# etc.) are in the include search path.
130130
py_include = sysconfig.get_python_inc()
131131
plat_py_include = sysconfig.get_python_inc(plat_specific=1)
@@ -592,7 +592,7 @@ def get_libraries (self, ext):
592592
"""
593593
# The python library is always needed on Windows. For MSVC, this
594594
# is redundant, since the library is mentioned in a pragma in
595-
# config.h that MSVC groks. The other Windows compilers all seem
595+
# pyconfig.h that MSVC groks. The other Windows compilers all seem
596596
# to need it mentioned explicitly, though, so that's what we do.
597597
# Append '_d' to the python import library on debug builds.
598598
from distutils.msvccompiler import MSVCCompiler

Lib/distutils/cygwinccompiler.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __init__ (self,
7373
(status, details))
7474
if status is not CONFIG_H_OK:
7575
self.warn(
76-
"Python's config.h doesn't seem to support your compiler. " +
76+
"Python's pyconfig.h doesn't seem to support your compiler. " +
7777
("Reason: %s." % details) +
7878
"Compiling may fail because of undefined preprocessor macros.")
7979

@@ -335,7 +335,7 @@ def __init__ (self,
335335

336336
# class Mingw32CCompiler
337337

338-
# Because these compilers aren't configured in Python's config.h file by
338+
# Because these compilers aren't configured in Python's pyconfig.h file by
339339
# default, we should at least warn the user if he is using a unmodified
340340
# version.
341341

@@ -345,29 +345,29 @@ def __init__ (self,
345345

346346
def check_config_h():
347347

348-
"""Check if the current Python installation (specifically, config.h)
348+
"""Check if the current Python installation (specifically, pyconfig.h)
349349
appears amenable to building extensions with GCC. Returns a tuple
350350
(status, details), where 'status' is one of the following constants:
351351
CONFIG_H_OK
352352
all is well, go ahead and compile
353353
CONFIG_H_NOTOK
354354
doesn't look good
355355
CONFIG_H_UNCERTAIN
356-
not sure -- unable to read config.h
356+
not sure -- unable to read pyconfig.h
357357
'details' is a human-readable string explaining the situation.
358358
359359
Note there are two ways to conclude "OK": either 'sys.version' contains
360360
the string "GCC" (implying that this Python was built with GCC), or the
361-
installed "config.h" contains the string "__GNUC__".
361+
installed "pyconfig.h" contains the string "__GNUC__".
362362
"""
363363

364364
# XXX since this function also checks sys.version, it's not strictly a
365-
# "config.h" check -- should probably be renamed...
365+
# "pyconfig.h" check -- should probably be renamed...
366366

367367
from distutils import sysconfig
368368
import string
369369
# if sys.version contains GCC then python was compiled with
370-
# GCC, and the config.h file should be OK
370+
# GCC, and the pyconfig.h file should be OK
371371
if string.find(sys.version,"GCC") >= 0:
372372
return (CONFIG_H_OK, "sys.version mentions 'GCC'")
373373

@@ -386,7 +386,7 @@ def check_config_h():
386386
"couldn't read '%s': %s" % (fn, exc.strerror))
387387

388388
else:
389-
# "config.h" contains an "#ifdef __GNUC__" or something similar
389+
# "pyconfig.h" contains an "#ifdef __GNUC__" or something similar
390390
if string.find(s,"__GNUC__") >= 0:
391391
return (CONFIG_H_OK, "'%s' mentions '__GNUC__'" % fn)
392392
else:

Lib/distutils/sysconfig.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_python_inc(plat_specific=0, prefix=None):
4343
If 'plat_specific' is false (the default), this is the path to the
4444
non-platform-specific header files, i.e. Python.h and so on;
4545
otherwise, this is the path to platform-specific header files
46-
(namely config.h).
46+
(namely pyconfig.h).
4747
4848
If 'prefix' is supplied, use it instead of sys.prefix or
4949
sys.exec_prefix -- i.e., ignore 'plat_specific'.
@@ -137,10 +137,10 @@ def customize_compiler(compiler):
137137

138138

139139
def get_config_h_filename():
140-
"""Return full pathname of installed config.h file."""
140+
"""Return full pathname of installed pyconfig.h file."""
141141
if python_build: inc_dir = '.'
142142
else: inc_dir = get_python_inc(plat_specific=1)
143-
return os.path.join(inc_dir, "config.h")
143+
return os.path.join(inc_dir, "pyconfig.h")
144144

145145

146146
def get_makefile_filename():

Makefile.pre.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ SRCDIRS= @SRCDIRS@
118118
SUBDIRSTOO= Include Lib Misc Demo
119119

120120
# Files and directories to be distributed
121-
CONFIGFILES= configure configure.in acconfig.h config.h.in Makefile.pre.in
121+
CONFIGFILES= configure configure.in acconfig.h pyconfig.h.in Makefile.pre.in
122122
DISTFILES= README ChangeLog $(CONFIGFILES)
123123
DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
124124
DIST= $(DISTFILES) $(DISTDIRS)
@@ -417,7 +417,7 @@ Mac/Python/macglue.o: $(srcdir)/Mac/Python/macglue.c
417417

418418
PYTHON_HEADERS= \
419419
Include/Python.h \
420-
config.h \
420+
pyconfig.h \
421421
Include/patchlevel.h \
422422
Include/pyport.h \
423423
Include/pymem.h \
@@ -650,7 +650,7 @@ inclinstall:
650650
echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
651651
$(INSTALL_DATA) $$i $(INCLUDEPY); \
652652
done
653-
$(INSTALL_DATA) config.h $(CONFINCLUDEPY)/config.h
653+
$(INSTALL_DATA) pyconfig.h $(CONFINCLUDEPY)/pyconfig.h
654654

655655
# Install the library and miscellaneous stuff needed for extending/embedding
656656
# This goes into $(exec_prefix)
@@ -732,7 +732,7 @@ recheck:
732732
$(SHELL) config.status --recheck
733733
$(SHELL) config.status
734734

735-
# Rebuild the configure script from configure.in; also rebuild config.h.in
735+
# Rebuild the configure script from configure.in; also rebuild pyconfig.h.in
736736
autoconf:
737737
(cd $(srcdir); autoconf)
738738
(cd $(srcdir); autoheader)
@@ -762,7 +762,7 @@ clean:
762762
clobber: clean
763763
-rm -f $(PYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
764764
tags TAGS \
765-
config.cache config.log config.h Modules/config.c
765+
config.cache config.log pyconfig.h Modules/config.c
766766
-rm -rf build platform
767767

768768
# Make things extra clean, before making a distribution:

0 commit comments

Comments
 (0)
0