@@ -43,6 +43,7 @@ def get_platform():
4343MS_WINDOWS = (HOST_PLATFORM == 'win32' )
4444CYGWIN = (HOST_PLATFORM == 'cygwin' )
4545MACOS = (HOST_PLATFORM == 'darwin' )
46+ AIX = (HOST_PLATFORM .startswith ('aix' ))
4647VXWORKS = ('vxworks' in HOST_PLATFORM )
4748
4849
@@ -805,7 +806,9 @@ def detect_simple_extensions(self):
805806 if (self .config_h_vars .get ('HAVE_GETSPNAM' , False ) or
806807 self .config_h_vars .get ('HAVE_GETSPENT' , False )):
807808 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 :
809812 self .missing .append ('spwd' )
810813
811814 # select(2); not on ancient System V
@@ -909,6 +912,10 @@ def detect_readline_curses(self):
909912 curses_library = readline_termcap_library
910913 elif self .compiler .find_library_file (self .lib_dirs , 'ncursesw' ):
911914 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'
912919 elif self .compiler .find_library_file (self .lib_dirs , 'ncurses' ):
913920 curses_library = 'ncurses'
914921 elif self .compiler .find_library_file (self .lib_dirs , 'curses' ):
@@ -1004,13 +1011,15 @@ def detect_readline_curses(self):
10041011 self .missing .append ('_curses' )
10051012
10061013 # 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 )):
10091018 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 :
10141023 self .missing .append ('_curses_panel' )
10151024
10161025 def detect_crypt (self ):
@@ -1463,7 +1472,7 @@ def detect_platform_specific_exts(self):
14631472 # Platform-specific libraries
14641473 if HOST_PLATFORM .startswith (('linux' , 'freebsd' , 'gnukfreebsd' )):
14651474 self .add (Extension ('ossaudiodev' , ['ossaudiodev.c' ]))
1466- else :
1475+ elif not AIX :
14671476 self .missing .append ('ossaudiodev' )
14681477
14691478 if MACOS :
0 commit comments