Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#219 Use sysconfig.get_config_h_filename() to locate pyconfig.h #220

Merged
merged 3 commits into from
Feb 12, 2024
Merged
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
14 changes: 3 additions & 11 deletions distutils/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,11 @@ def _get_python_inc_posix_prefix(prefix):

def _get_python_inc_nt(prefix, spec_prefix, plat_specific):
if python_build:
# Include both the include and PC dir to ensure we can find
# pyconfig.h
# Include both include dirs to ensure we can find pyconfig.h
return (
os.path.join(prefix, "include")
+ os.path.pathsep
+ os.path.join(prefix, "PC")
+ os.path.dirname(sysconfig.get_config_h_filename())
)
return os.path.join(prefix, "include")

Expand Down Expand Up @@ -361,14 +360,7 @@ def customize_compiler(compiler): # noqa: C901

def get_config_h_filename():
"""Return full pathname of installed pyconfig.h file."""
if python_build:
if os.name == "nt":
inc_dir = os.path.join(_sys_home or project_base, "PC")
else:
inc_dir = _sys_home or project_base
return os.path.join(inc_dir, 'pyconfig.h')
else:
return sysconfig.get_config_h_filename()
return sysconfig.get_config_h_filename()


def get_makefile_filename():
Expand Down