Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Doc/.venv/
Doc/env/
Doc/.env/
Include/pydtrace_probes.h
Include/pyconfig.h
Lib/site-packages/*
!Lib/site-packages/README.txt
Lib/test/data/*
Expand Down
2 changes: 1 addition & 1 deletion Android/testbed/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ val ANDROID_DIR = file("../..")
val PYTHON_DIR = ANDROID_DIR.parentFile!!
val PYTHON_CROSS_DIR = file("$PYTHON_DIR/cross-build")
val inSourceTree = (
ANDROID_DIR.name == "Android" && file("$PYTHON_DIR/pyconfig.h.in").exists()
ANDROID_DIR.name == "Android" && file("$PYTHON_DIR/Include/pyconfig.h.in").exists()
)

val KNOWN_ABIS = mapOf(
Expand Down
2 changes: 1 addition & 1 deletion pyconfig.h.in → Include/pyconfig.h.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* pyconfig.h.in. Generated from configure.ac by autoheader. */
/* Include/pyconfig.h.in. Generated from configure.ac by autoheader. */


#ifndef Py_PYCONFIG_H
Expand Down
10 changes: 6 additions & 4 deletions Lib/sysconfig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,16 @@ def parse_config_h(fp, vars=None):

def get_config_h_filename():
"""Return the path of pyconfig.h."""
parts = []
if _PYTHON_BUILD:
if os.name == "nt":
inc_dir = os.path.dirname(sys._base_executable)
parts.append(os.path.dirname(sys._base_executable))
else:
inc_dir = _PROJECT_BASE
parts.extend([_PROJECT_BASE, 'Include'])
else:
inc_dir = get_path('platinclude')
return os.path.join(inc_dir, 'pyconfig.h')
parts.append(get_path('platinclude'))
parts.append('pyconfig.h')
return os.path.join(*parts)


def get_scheme_names():
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def test_srcdir(self):
# <srcdir>/PC/pyconfig.h.in always exists even if unused
pyconfig_h = os.path.join(srcdir, 'PC', 'pyconfig.h.in')
self.assertTrue(os.path.exists(pyconfig_h), pyconfig_h)
pyconfig_h_in = os.path.join(srcdir, 'pyconfig.h.in')
pyconfig_h_in = os.path.join(srcdir, 'Include', 'pyconfig.h.in')
self.assertTrue(os.path.exists(pyconfig_h_in), pyconfig_h_in)
if os.name == 'nt':
# <executable dir>/pyconfig.h exists on Windows in a build tree
Expand Down
12 changes: 6 additions & 6 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ SRCDIRS= @SRCDIRS@
SUBDIRSTOO= Include Lib Misc

# Files and directories to be distributed
CONFIGFILES= configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in
CONFIGFILES= configure configure.ac acconfig.h Include/pyconfig.h.in Makefile.pre.in
DISTFILES= README.rst ChangeLog $(CONFIGFILES)
DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
DIST= $(DISTFILES) $(DISTDIRS)
Expand Down Expand Up @@ -1207,7 +1207,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/warnings.h \
$(srcdir)/Include/weakrefobject.h \
\
pyconfig.h \
Include/pyconfig.h \
$(PARSER_HEADERS) \
\
$(srcdir)/Include/cpython/abstract.h \
Expand Down Expand Up @@ -2875,8 +2875,8 @@ inclinstall:
$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; \
done; \
fi
echo $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
$(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
echo $(INSTALL_DATA) Include/pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
$(INSTALL_DATA) Include/pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h

# Install the library and miscellaneous stuff needed for extending/embedding
# This goes into $(exec_prefix)
Expand Down Expand Up @@ -3076,7 +3076,7 @@ JIT_DEPS = \
$(srcdir)/Tools/jit/*.c \
$(srcdir)/Tools/jit/*.py \
$(srcdir)/Python/executor_cases.c.h \
pyconfig.h
Include/pyconfig.h

jit_stencils.h: $(JIT_DEPS)
@REGEN_JIT_COMMAND@
Expand Down Expand Up @@ -3209,7 +3209,7 @@ clean: clean-retain-profile clean-bolt
clobber: clean
-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
tags TAGS \
config.cache config.log pyconfig.h Modules/config.c
config.cache config.log Include/pyconfig.h Modules/config.c
-rm -rf build platform
-rm -rf $(PYTHONFRAMEWORKDIR)
-rm -rf iOS/Frameworks
Expand Down
4 changes: 2 additions & 2 deletions Tools/build/smelly.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ def check_library(library, dynamic=False):

def check_extensions():
print(__file__)
# This assumes pybuilddir.txt is in same directory as pyconfig.h.
# This assumes pybuilddir.txt is in same directory as Makefile.
# In the case of out-of-tree builds, we can't assume pybuilddir.txt is
# in the source folder.
config_dir = os.path.dirname(sysconfig.get_config_h_filename())
config_dir = os.path.dirname(sysconfig.get_makefile_filename())
filename = os.path.join(config_dir, "pybuilddir.txt")
try:
with open(filename, encoding="utf-8") as fp:
Expand Down
2 changes: 1 addition & 1 deletion Tools/patchcheck/patchcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def regenerated_configure(file_paths):
def regenerated_pyconfig_h_in(file_paths):
"""Check if pyconfig.h.in has been regenerated."""
if 'configure.ac' in file_paths:
return "yes" if 'pyconfig.h.in' in file_paths else "no"
return "yes" if os.path.join('Include', 'pyconfig.h.in') in file_paths else "no"
else:
return "not needed"

Expand Down
4 changes: 2 additions & 2 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ else
fi

AC_CONFIG_SRCDIR([Include/object.h])
AC_CONFIG_HEADERS([pyconfig.h])
AC_CONFIG_HEADERS([Include/pyconfig.h])

AC_CANONICAL_HOST
AC_SUBST([build])
Expand Down
Loading