@@ -1185,6 +1185,18 @@ class db_found(Exception): pass
11851185 # Bug 1464056: If _curses.so links with ncursesw,
11861186 # _curses_panel.so must link with panelw.
11871187 panel_library = 'panelw'
1188+ if platform == 'darwin' :
1189+ # On OS X, there is no separate /usr/lib/libncursesw nor
1190+ # libpanelw. If we are here, we found a locally-supplied
1191+ # version of libncursesw. There should be also be a
1192+ # libpanelw. _XOPEN_SOURCE defines are usually excluded
1193+ # for OS X but we need _XOPEN_SOURCE_EXTENDED here for
1194+ # ncurses wide char support
1195+ curses_defines .append (('_XOPEN_SOURCE_EXTENDED' , '1' ))
1196+ elif platform == 'darwin' and curses_library == 'ncurses' :
1197+ # Building with the system-suppied combined libncurses/libpanel
1198+ curses_defines .append (('HAVE_NCURSESW' , '1' ))
1199+ curses_defines .append (('_XOPEN_SOURCE_EXTENDED' , '1' ))
11881200
11891201 if curses_library .startswith ('ncurses' ):
11901202 curses_libs = [curses_library ]
@@ -1213,6 +1225,7 @@ class db_found(Exception): pass
12131225 self .compiler .find_library_file (lib_dirs , panel_library )):
12141226 exts .append ( Extension ('_curses_panel' , ['_curses_panel.c' ],
12151227 include_dirs = curses_includes ,
1228+ define_macros = curses_defines ,
12161229 libraries = [panel_library ] + curses_libs ) )
12171230 else :
12181231 missing .append ('_curses_panel' )
0 commit comments