Skip to content

Commit

Permalink
wscript: Use EXT_SUFFIX when available to fix build on Py 3.11
Browse files Browse the repository at this point in the history
This is a backport of a an upstream fix in waf's check_python_headers().

See: https://gitlab.com/ita1024/waf/-/commit/8d6cbb3657bdbf2ad5ef33b8ba51f29747743e1d
  • Loading branch information
swt2c committed Nov 7, 2022
1 parent 7b12caf commit ba0d8cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def my_check_python_headers(conf):
if not pybin:
conf.fatal('Could not find the python executable')

v = 'prefix SO LDFLAGS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDSHARED CFLAGS'.split()
v = 'prefix SO EXT_SUFFIX LDFLAGS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDSHARED CFLAGS'.split()
try:
lst = conf.get_python_variables(["get_config_var('%s') or ''" % x for x in v])
except RuntimeError:
Expand All @@ -397,7 +397,7 @@ def my_check_python_headers(conf):
if dct[x]:
conf.env[x] = conf.environ[x] = dct[x]

env['pyext_PATTERN'] = '%s' + dct['SO'] # not a mistake
env['pyext_PATTERN'] = '%s' + (dct['EXT_SUFFIX'] or dct['SO']) # SO is deprecated in 3.5 and removed in 3.11

# Check for python libraries for embedding
all_flags = dct['LDFLAGS'] + ' ' + dct['CFLAGS']
Expand Down

0 comments on commit ba0d8cf

Please sign in to comment.