bpo-36210: update optional extension handling for AIX (GH-12202) · python/cpython@08970cb (original) (raw)
`@@ -43,6 +43,7 @@ def get_platform():
`
43
43
`MS_WINDOWS = (HOST_PLATFORM == 'win32')
`
44
44
`CYGWIN = (HOST_PLATFORM == 'cygwin')
`
45
45
`MACOS = (HOST_PLATFORM == 'darwin')
`
``
46
`+
AIX = (HOST_PLATFORM.startswith('aix'))
`
46
47
`VXWORKS = ('vxworks' in HOST_PLATFORM)
`
47
48
``
48
49
``
`@@ -805,7 +806,9 @@ def detect_simple_extensions(self):
`
805
806
`if (self.config_h_vars.get('HAVE_GETSPNAM', False) or
`
806
807
`self.config_h_vars.get('HAVE_GETSPENT', False)):
`
807
808
`self.add(Extension('spwd', ['spwdmodule.c']))
`
808
``
`-
else:
`
``
809
`+
AIX has shadow passwords, but access is not via getspent(), etc.
`
``
810
`+
module support is not expected so it not 'missing'
`
``
811
`+
elif not AIX:
`
809
812
`self.missing.append('spwd')
`
810
813
``
811
814
`# select(2); not on ancient System V
`
`@@ -909,6 +912,10 @@ def detect_readline_curses(self):
`
909
912
`curses_library = readline_termcap_library
`
910
913
`elif self.compiler.find_library_file(self.lib_dirs, 'ncursesw'):
`
911
914
`curses_library = 'ncursesw'
`
``
915
`+
Issue 36210: OSS provided ncurses does not link on AIX
`
``
916
`+
Use IBM supplied 'curses' for successful build of _curses
`
``
917
`+
elif AIX and self.compiler.find_library_file(self.lib_dirs, 'curses'):
`
``
918
`+
curses_library = 'curses'
`
912
919
`elif self.compiler.find_library_file(self.lib_dirs, 'ncurses'):
`
913
920
`curses_library = 'ncurses'
`
914
921
`elif self.compiler.find_library_file(self.lib_dirs, 'curses'):
`
`@@ -1004,13 +1011,15 @@ def detect_readline_curses(self):
`
1004
1011
`self.missing.append('_curses')
`
1005
1012
``
1006
1013
`# If the curses module is enabled, check for the panel module
`
1007
``
`-
if (curses_enabled and
`
1008
``
`-
self.compiler.find_library_file(self.lib_dirs, panel_library)):
`
``
1014
`+
_curses_panel needs some form of ncurses
`
``
1015
`+
skip_curses_panel = True if AIX else False
`
``
1016
`+
if (curses_enabled and not skip_curses_panel and
`
``
1017
`+
self.compiler.find_library_file(self.lib_dirs, panel_library)):
`
1009
1018
`self.add(Extension('_curses_panel', ['_curses_panel.c'],
`
1010
``
`-
include_dirs=curses_includes,
`
1011
``
`-
define_macros=curses_defines,
`
1012
``
`-
libraries=[panel_library, *curses_libs]))
`
1013
``
`-
else:
`
``
1019
`+
include_dirs=curses_includes,
`
``
1020
`+
define_macros=curses_defines,
`
``
1021
`+
libraries=[panel_library, *curses_libs]))
`
``
1022
`+
elif not skip_curses_panel:
`
1014
1023
`self.missing.append('_curses_panel')
`
1015
1024
``
1016
1025
`def detect_crypt(self):
`
`@@ -1463,7 +1472,7 @@ def detect_platform_specific_exts(self):
`
1463
1472
`# Platform-specific libraries
`
1464
1473
`if HOST_PLATFORM.startswith(('linux', 'freebsd', 'gnukfreebsd')):
`
1465
1474
`self.add(Extension('ossaudiodev', ['ossaudiodev.c']))
`
1466
``
`-
else:
`
``
1475
`+
elif not AIX:
`
1467
1476
`self.missing.append('ossaudiodev')
`
1468
1477
``
1469
1478
`if MACOS:
`