bpo-36210: correct logic in setup.py for optional extensions for AIX … · python/cpython@e4be8c9 (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

``

`@@ -807,7 +808,9 @@ def detect_simple_extensions(self):

`

807

808

`if (self.config_h_vars.get('HAVE_GETSPNAM', False) or

`

808

809

`self.config_h_vars.get('HAVE_GETSPENT', False)):

`

809

810

`self.add(Extension('spwd', ['spwdmodule.c']))

`

810

``

`-

else:

`

``

811

`+

AIX has shadow passwords, but access is not via getspent(), etc.

`

``

812

`+

module support is not expected so it not 'missing'

`

``

813

`+

elif not AIX:

`

811

814

`self.missing.append('spwd')

`

812

815

``

813

816

`# select(2); not on ancient System V

`

`@@ -911,6 +914,10 @@ def detect_readline_curses(self):

`

911

914

`curses_library = readline_termcap_library

`

912

915

`elif self.compiler.find_library_file(self.lib_dirs, 'ncursesw'):

`

913

916

`curses_library = 'ncursesw'

`

``

917

`+

Issue 36210: OSS provided ncurses does not link on AIX

`

``

918

`+

Use IBM supplied 'curses' for successful build of _curses

`

``

919

`+

elif AIX and self.compiler.find_library_file(self.lib_dirs, 'curses'):

`

``

920

`+

curses_library = 'curses'

`

914

921

`elif self.compiler.find_library_file(self.lib_dirs, 'ncurses'):

`

915

922

`curses_library = 'ncurses'

`

916

923

`elif self.compiler.find_library_file(self.lib_dirs, 'curses'):

`

`@@ -1006,13 +1013,15 @@ def detect_readline_curses(self):

`

1006

1013

`self.missing.append('_curses')

`

1007

1014

``

1008

1015

`# If the curses module is enabled, check for the panel module

`

1009

``

`-

if (curses_enabled and

`

1010

``

`-

self.compiler.find_library_file(self.lib_dirs, panel_library)):

`

``

1016

`+

_curses_panel needs some form of ncurses

`

``

1017

`+

skip_curses_panel = True if AIX else False

`

``

1018

`+

if (curses_enabled and not skip_curses_panel and

`

``

1019

`+

self.compiler.find_library_file(self.lib_dirs, panel_library)):

`

1011

1020

`self.add(Extension('_curses_panel', ['_curses_panel.c'],

`

1012

1021

`include_dirs=curses_includes,

`

1013

1022

`define_macros=curses_defines,

`

1014

1023

`libraries=[panel_library, *curses_libs]))

`

1015

``

`-

else:

`

``

1024

`+

elif not skip_curses_panel:

`

1016

1025

`self.missing.append('_curses_panel')

`

1017

1026

``

1018

1027

`def detect_crypt(self):

`

`@@ -1465,7 +1474,7 @@ def detect_platform_specific_exts(self):

`

1465

1474

`# Platform-specific libraries

`

1466

1475

`if HOST_PLATFORM.startswith(('linux', 'freebsd', 'gnukfreebsd')):

`

1467

1476

`self.add(Extension('ossaudiodev', ['ossaudiodev.c']))

`

1468

``

`-

else:

`

``

1477

`+

elif not AIX:

`

1469

1478

`self.missing.append('ossaudiodev')

`

1470

1479

``

1471

1480

`if MACOS:

`